src/share/vm/opto/vectornode.hpp

changeset 0
f90c822e73f8
child 6876
710a3c8b516e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/share/vm/opto/vectornode.hpp	Wed Apr 27 01:25:04 2016 +0800
     1.3 @@ -0,0 +1,638 @@
     1.4 +/*
     1.5 + * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
     1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.7 + *
     1.8 + * This code is free software; you can redistribute it and/or modify it
     1.9 + * under the terms of the GNU General Public License version 2 only, as
    1.10 + * published by the Free Software Foundation.
    1.11 + *
    1.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    1.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.15 + * version 2 for more details (a copy is included in the LICENSE file that
    1.16 + * accompanied this code).
    1.17 + *
    1.18 + * You should have received a copy of the GNU General Public License version
    1.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    1.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.21 + *
    1.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    1.23 + * or visit www.oracle.com if you need additional information or have any
    1.24 + * questions.
    1.25 + */
    1.26 +
    1.27 +#ifndef SHARE_VM_OPTO_VECTORNODE_HPP
    1.28 +#define SHARE_VM_OPTO_VECTORNODE_HPP
    1.29 +
    1.30 +#include "opto/matcher.hpp"
    1.31 +#include "opto/memnode.hpp"
    1.32 +#include "opto/node.hpp"
    1.33 +#include "opto/opcodes.hpp"
    1.34 +
    1.35 +//------------------------------VectorNode-------------------------------------
    1.36 +// Vector Operation
    1.37 +class VectorNode : public TypeNode {
    1.38 + public:
    1.39 +
    1.40 +  VectorNode(Node* n1, const TypeVect* vt) : TypeNode(vt, 2) {
    1.41 +    init_class_id(Class_Vector);
    1.42 +    init_req(1, n1);
    1.43 +  }
    1.44 +  VectorNode(Node* n1, Node* n2, const TypeVect* vt) : TypeNode(vt, 3) {
    1.45 +    init_class_id(Class_Vector);
    1.46 +    init_req(1, n1);
    1.47 +    init_req(2, n2);
    1.48 +  }
    1.49 +
    1.50 +  const TypeVect* vect_type() const { return type()->is_vect(); }
    1.51 +  uint length() const { return vect_type()->length(); } // Vector length
    1.52 +  uint length_in_bytes() const { return vect_type()->length_in_bytes(); }
    1.53 +
    1.54 +  virtual int Opcode() const;
    1.55 +
    1.56 +  virtual uint ideal_reg() const { return Matcher::vector_ideal_reg(vect_type()->length_in_bytes()); }
    1.57 +
    1.58 +  static VectorNode* scalar2vector(Compile* C, Node* s, uint vlen, const Type* opd_t);
    1.59 +  static VectorNode* shift_count(Compile* C, Node* shift, Node* cnt, uint vlen, BasicType bt);
    1.60 +  static VectorNode* make(Compile* C, int opc, Node* n1, Node* n2, uint vlen, BasicType bt);
    1.61 +
    1.62 +  static int  opcode(int opc, BasicType bt);
    1.63 +  static bool implemented(int opc, uint vlen, BasicType bt);
    1.64 +  static bool is_shift(Node* n);
    1.65 +  static bool is_invariant_vector(Node* n);
    1.66 +  // [Start, end) half-open range defining which operands are vectors
    1.67 +  static void vector_operands(Node* n, uint* start, uint* end);
    1.68 +};
    1.69 +
    1.70 +//===========================Vector=ALU=Operations=============================
    1.71 +
    1.72 +//------------------------------AddVBNode--------------------------------------
    1.73 +// Vector add byte
    1.74 +class AddVBNode : public VectorNode {
    1.75 + public:
    1.76 +  AddVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
    1.77 +  virtual int Opcode() const;
    1.78 +};
    1.79 +
    1.80 +//------------------------------AddVSNode--------------------------------------
    1.81 +// Vector add char/short
    1.82 +class AddVSNode : public VectorNode {
    1.83 + public:
    1.84 +  AddVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
    1.85 +  virtual int Opcode() const;
    1.86 +};
    1.87 +
    1.88 +//------------------------------AddVINode--------------------------------------
    1.89 +// Vector add int
    1.90 +class AddVINode : public VectorNode {
    1.91 + public:
    1.92 +  AddVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
    1.93 +  virtual int Opcode() const;
    1.94 +};
    1.95 +
    1.96 +//------------------------------AddVLNode--------------------------------------
    1.97 +// Vector add long
    1.98 +class AddVLNode : public VectorNode {
    1.99 + public:
   1.100 +  AddVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.101 +  virtual int Opcode() const;
   1.102 +};
   1.103 +
   1.104 +//------------------------------AddVFNode--------------------------------------
   1.105 +// Vector add float
   1.106 +class AddVFNode : public VectorNode {
   1.107 + public:
   1.108 +  AddVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.109 +  virtual int Opcode() const;
   1.110 +};
   1.111 +
   1.112 +//------------------------------AddVDNode--------------------------------------
   1.113 +// Vector add double
   1.114 +class AddVDNode : public VectorNode {
   1.115 + public:
   1.116 +  AddVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.117 +  virtual int Opcode() const;
   1.118 +};
   1.119 +
   1.120 +//------------------------------SubVBNode--------------------------------------
   1.121 +// Vector subtract byte
   1.122 +class SubVBNode : public VectorNode {
   1.123 + public:
   1.124 +  SubVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.125 +  virtual int Opcode() const;
   1.126 +};
   1.127 +
   1.128 +//------------------------------SubVSNode--------------------------------------
   1.129 +// Vector subtract short
   1.130 +class SubVSNode : public VectorNode {
   1.131 + public:
   1.132 +  SubVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.133 +  virtual int Opcode() const;
   1.134 +};
   1.135 +
   1.136 +//------------------------------SubVINode--------------------------------------
   1.137 +// Vector subtract int
   1.138 +class SubVINode : public VectorNode {
   1.139 + public:
   1.140 +  SubVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.141 +  virtual int Opcode() const;
   1.142 +};
   1.143 +
   1.144 +//------------------------------SubVLNode--------------------------------------
   1.145 +// Vector subtract long
   1.146 +class SubVLNode : public VectorNode {
   1.147 + public:
   1.148 +  SubVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.149 +  virtual int Opcode() const;
   1.150 +};
   1.151 +
   1.152 +//------------------------------SubVFNode--------------------------------------
   1.153 +// Vector subtract float
   1.154 +class SubVFNode : public VectorNode {
   1.155 + public:
   1.156 +  SubVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.157 +  virtual int Opcode() const;
   1.158 +};
   1.159 +
   1.160 +//------------------------------SubVDNode--------------------------------------
   1.161 +// Vector subtract double
   1.162 +class SubVDNode : public VectorNode {
   1.163 + public:
   1.164 +  SubVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.165 +  virtual int Opcode() const;
   1.166 +};
   1.167 +
   1.168 +//------------------------------MulVSNode--------------------------------------
   1.169 +// Vector multiply short
   1.170 +class MulVSNode : public VectorNode {
   1.171 + public:
   1.172 +  MulVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.173 +  virtual int Opcode() const;
   1.174 +};
   1.175 +
   1.176 +//------------------------------MulVINode--------------------------------------
   1.177 +// Vector multiply int
   1.178 +class MulVINode : public VectorNode {
   1.179 + public:
   1.180 +  MulVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.181 +  virtual int Opcode() const;
   1.182 +};
   1.183 +
   1.184 +//------------------------------MulVFNode--------------------------------------
   1.185 +// Vector multiply float
   1.186 +class MulVFNode : public VectorNode {
   1.187 + public:
   1.188 +  MulVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.189 +  virtual int Opcode() const;
   1.190 +};
   1.191 +
   1.192 +//------------------------------MulVDNode--------------------------------------
   1.193 +// Vector multiply double
   1.194 +class MulVDNode : public VectorNode {
   1.195 + public:
   1.196 +  MulVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.197 +  virtual int Opcode() const;
   1.198 +};
   1.199 +
   1.200 +//------------------------------DivVFNode--------------------------------------
   1.201 +// Vector divide float
   1.202 +class DivVFNode : public VectorNode {
   1.203 + public:
   1.204 +  DivVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.205 +  virtual int Opcode() const;
   1.206 +};
   1.207 +
   1.208 +//------------------------------DivVDNode--------------------------------------
   1.209 +// Vector Divide double
   1.210 +class DivVDNode : public VectorNode {
   1.211 + public:
   1.212 +  DivVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.213 +  virtual int Opcode() const;
   1.214 +};
   1.215 +
   1.216 +//------------------------------LShiftVBNode-----------------------------------
   1.217 +// Vector left shift bytes
   1.218 +class LShiftVBNode : public VectorNode {
   1.219 + public:
   1.220 +  LShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.221 +  virtual int Opcode() const;
   1.222 +};
   1.223 +
   1.224 +//------------------------------LShiftVSNode-----------------------------------
   1.225 +// Vector left shift shorts
   1.226 +class LShiftVSNode : public VectorNode {
   1.227 + public:
   1.228 +  LShiftVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.229 +  virtual int Opcode() const;
   1.230 +};
   1.231 +
   1.232 +//------------------------------LShiftVINode-----------------------------------
   1.233 +// Vector left shift ints
   1.234 +class LShiftVINode : public VectorNode {
   1.235 + public:
   1.236 +  LShiftVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.237 +  virtual int Opcode() const;
   1.238 +};
   1.239 +
   1.240 +//------------------------------LShiftVLNode-----------------------------------
   1.241 +// Vector left shift longs
   1.242 +class LShiftVLNode : public VectorNode {
   1.243 + public:
   1.244 +  LShiftVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.245 +  virtual int Opcode() const;
   1.246 +};
   1.247 +
   1.248 +//------------------------------RShiftVBNode-----------------------------------
   1.249 +// Vector right arithmetic (signed) shift bytes
   1.250 +class RShiftVBNode : public VectorNode {
   1.251 + public:
   1.252 +  RShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.253 +  virtual int Opcode() const;
   1.254 +};
   1.255 +
   1.256 +//------------------------------RShiftVSNode-----------------------------------
   1.257 +// Vector right arithmetic (signed) shift shorts
   1.258 +class RShiftVSNode : public VectorNode {
   1.259 + public:
   1.260 +  RShiftVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.261 +  virtual int Opcode() const;
   1.262 +};
   1.263 +
   1.264 +//------------------------------RShiftVINode-----------------------------------
   1.265 +// Vector right arithmetic (signed) shift ints
   1.266 +class RShiftVINode : public VectorNode {
   1.267 + public:
   1.268 +  RShiftVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.269 +  virtual int Opcode() const;
   1.270 +};
   1.271 +
   1.272 +//------------------------------RShiftVLNode-----------------------------------
   1.273 +// Vector right arithmetic (signed) shift longs
   1.274 +class RShiftVLNode : public VectorNode {
   1.275 + public:
   1.276 +  RShiftVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.277 +  virtual int Opcode() const;
   1.278 +};
   1.279 +
   1.280 +//------------------------------URShiftVBNode----------------------------------
   1.281 +// Vector right logical (unsigned) shift bytes
   1.282 +class URShiftVBNode : public VectorNode {
   1.283 + public:
   1.284 +  URShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.285 +  virtual int Opcode() const;
   1.286 +};
   1.287 +
   1.288 +//------------------------------URShiftVSNode----------------------------------
   1.289 +// Vector right logical (unsigned) shift shorts
   1.290 +class URShiftVSNode : public VectorNode {
   1.291 + public:
   1.292 +  URShiftVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.293 +  virtual int Opcode() const;
   1.294 +};
   1.295 +
   1.296 +//------------------------------URShiftVINode----------------------------------
   1.297 +// Vector right logical (unsigned) shift ints
   1.298 +class URShiftVINode : public VectorNode {
   1.299 + public:
   1.300 +  URShiftVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.301 +  virtual int Opcode() const;
   1.302 +};
   1.303 +
   1.304 +//------------------------------URShiftVLNode----------------------------------
   1.305 +// Vector right logical (unsigned) shift longs
   1.306 +class URShiftVLNode : public VectorNode {
   1.307 + public:
   1.308 +  URShiftVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.309 +  virtual int Opcode() const;
   1.310 +};
   1.311 +
   1.312 +//------------------------------LShiftCntVNode---------------------------------
   1.313 +// Vector left shift count
   1.314 +class LShiftCntVNode : public VectorNode {
   1.315 + public:
   1.316 +  LShiftCntVNode(Node* cnt, const TypeVect* vt) : VectorNode(cnt,vt) {}
   1.317 +  virtual int Opcode() const;
   1.318 +  virtual uint ideal_reg() const { return Matcher::vector_shift_count_ideal_reg(vect_type()->length_in_bytes()); }
   1.319 +};
   1.320 +
   1.321 +//------------------------------RShiftCntVNode---------------------------------
   1.322 +// Vector right shift count
   1.323 +class RShiftCntVNode : public VectorNode {
   1.324 + public:
   1.325 +  RShiftCntVNode(Node* cnt, const TypeVect* vt) : VectorNode(cnt,vt) {}
   1.326 +  virtual int Opcode() const;
   1.327 +  virtual uint ideal_reg() const { return Matcher::vector_shift_count_ideal_reg(vect_type()->length_in_bytes()); }
   1.328 +};
   1.329 +
   1.330 +
   1.331 +//------------------------------AndVNode---------------------------------------
   1.332 +// Vector and integer
   1.333 +class AndVNode : public VectorNode {
   1.334 + public:
   1.335 +  AndVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.336 +  virtual int Opcode() const;
   1.337 +};
   1.338 +
   1.339 +//------------------------------OrVNode---------------------------------------
   1.340 +// Vector or integer
   1.341 +class OrVNode : public VectorNode {
   1.342 + public:
   1.343 +  OrVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.344 +  virtual int Opcode() const;
   1.345 +};
   1.346 +
   1.347 +//------------------------------XorVNode---------------------------------------
   1.348 +// Vector xor integer
   1.349 +class XorVNode : public VectorNode {
   1.350 + public:
   1.351 +  XorVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
   1.352 +  virtual int Opcode() const;
   1.353 +};
   1.354 +
   1.355 +//================================= M E M O R Y ===============================
   1.356 +
   1.357 +//------------------------------LoadVectorNode---------------------------------
   1.358 +// Load Vector from memory
   1.359 +class LoadVectorNode : public LoadNode {
   1.360 + public:
   1.361 +  LoadVectorNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeVect* vt)
   1.362 +    : LoadNode(c, mem, adr, at, vt, MemNode::unordered) {
   1.363 +    init_class_id(Class_LoadVector);
   1.364 +  }
   1.365 +
   1.366 +  const TypeVect* vect_type() const { return type()->is_vect(); }
   1.367 +  uint length() const { return vect_type()->length(); } // Vector length
   1.368 +
   1.369 +  virtual int Opcode() const;
   1.370 +
   1.371 +  virtual uint ideal_reg() const  { return Matcher::vector_ideal_reg(memory_size()); }
   1.372 +  virtual BasicType memory_type() const { return T_VOID; }
   1.373 +  virtual int memory_size() const { return vect_type()->length_in_bytes(); }
   1.374 +
   1.375 +  virtual int store_Opcode() const { return Op_StoreVector; }
   1.376 +
   1.377 +  static LoadVectorNode* make(Compile* C, int opc, Node* ctl, Node* mem,
   1.378 +                              Node* adr, const TypePtr* atyp, uint vlen, BasicType bt);
   1.379 +};
   1.380 +
   1.381 +//------------------------------StoreVectorNode--------------------------------
   1.382 +// Store Vector to memory
   1.383 +class StoreVectorNode : public StoreNode {
   1.384 + public:
   1.385 +  StoreVectorNode(Node* c, Node* mem, Node* adr, const TypePtr* at, Node* val)
   1.386 +    : StoreNode(c, mem, adr, at, val, MemNode::unordered) {
   1.387 +    assert(val->is_Vector() || val->is_LoadVector(), "sanity");
   1.388 +    init_class_id(Class_StoreVector);
   1.389 +  }
   1.390 +
   1.391 +  const TypeVect* vect_type() const { return in(MemNode::ValueIn)->bottom_type()->is_vect(); }
   1.392 +  uint length() const { return vect_type()->length(); } // Vector length
   1.393 +
   1.394 +  virtual int Opcode() const;
   1.395 +
   1.396 +  virtual uint ideal_reg() const  { return Matcher::vector_ideal_reg(memory_size()); }
   1.397 +  virtual BasicType memory_type() const { return T_VOID; }
   1.398 +  virtual int memory_size() const { return vect_type()->length_in_bytes(); }
   1.399 +
   1.400 +  static StoreVectorNode* make(Compile* C, int opc, Node* ctl, Node* mem,
   1.401 +                               Node* adr, const TypePtr* atyp, Node* val,
   1.402 +                               uint vlen);
   1.403 +};
   1.404 +
   1.405 +
   1.406 +//=========================Promote_Scalar_to_Vector============================
   1.407 +
   1.408 +//------------------------------ReplicateBNode---------------------------------
   1.409 +// Replicate byte scalar to be vector
   1.410 +class ReplicateBNode : public VectorNode {
   1.411 + public:
   1.412 +  ReplicateBNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {}
   1.413 +  virtual int Opcode() const;
   1.414 +};
   1.415 +
   1.416 +//------------------------------ReplicateSNode---------------------------------
   1.417 +// Replicate short scalar to be vector
   1.418 +class ReplicateSNode : public VectorNode {
   1.419 + public:
   1.420 +  ReplicateSNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {}
   1.421 +  virtual int Opcode() const;
   1.422 +};
   1.423 +
   1.424 +//------------------------------ReplicateINode---------------------------------
   1.425 +// Replicate int scalar to be vector
   1.426 +class ReplicateINode : public VectorNode {
   1.427 + public:
   1.428 +  ReplicateINode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {}
   1.429 +  virtual int Opcode() const;
   1.430 +};
   1.431 +
   1.432 +//------------------------------ReplicateLNode---------------------------------
   1.433 +// Replicate long scalar to be vector
   1.434 +class ReplicateLNode : public VectorNode {
   1.435 + public:
   1.436 +  ReplicateLNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {}
   1.437 +  virtual int Opcode() const;
   1.438 +};
   1.439 +
   1.440 +//------------------------------ReplicateFNode---------------------------------
   1.441 +// Replicate float scalar to be vector
   1.442 +class ReplicateFNode : public VectorNode {
   1.443 + public:
   1.444 +  ReplicateFNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {}
   1.445 +  virtual int Opcode() const;
   1.446 +};
   1.447 +
   1.448 +//------------------------------ReplicateDNode---------------------------------
   1.449 +// Replicate double scalar to be vector
   1.450 +class ReplicateDNode : public VectorNode {
   1.451 + public:
   1.452 +  ReplicateDNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {}
   1.453 +  virtual int Opcode() const;
   1.454 +};
   1.455 +
   1.456 +//========================Pack_Scalars_into_a_Vector===========================
   1.457 +
   1.458 +//------------------------------PackNode---------------------------------------
   1.459 +// Pack parent class (not for code generation).
   1.460 +class PackNode : public VectorNode {
   1.461 + public:
   1.462 +  PackNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {}
   1.463 +  PackNode(Node* in1, Node* n2, const TypeVect* vt) : VectorNode(in1, n2, vt) {}
   1.464 +  virtual int Opcode() const;
   1.465 +
   1.466 +  void add_opd(Node* n) {
   1.467 +    add_req(n);
   1.468 +  }
   1.469 +
   1.470 +  // Create a binary tree form for Packs. [lo, hi) (half-open) range
   1.471 +  PackNode* binary_tree_pack(Compile* C, int lo, int hi);
   1.472 +
   1.473 +  static PackNode* make(Compile* C, Node* s, uint vlen, BasicType bt);
   1.474 +};
   1.475 +
   1.476 +//------------------------------PackBNode--------------------------------------
   1.477 +// Pack byte scalars into vector
   1.478 +class PackBNode : public PackNode {
   1.479 + public:
   1.480 +  PackBNode(Node* in1, const TypeVect* vt)  : PackNode(in1, vt) {}
   1.481 +  virtual int Opcode() const;
   1.482 +};
   1.483 +
   1.484 +//------------------------------PackSNode--------------------------------------
   1.485 +// Pack short scalars into a vector
   1.486 +class PackSNode : public PackNode {
   1.487 + public:
   1.488 +  PackSNode(Node* in1, const TypeVect* vt)  : PackNode(in1, vt) {}
   1.489 +  PackSNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {}
   1.490 +  virtual int Opcode() const;
   1.491 +};
   1.492 +
   1.493 +//------------------------------PackINode--------------------------------------
   1.494 +// Pack integer scalars into a vector
   1.495 +class PackINode : public PackNode {
   1.496 + public:
   1.497 +  PackINode(Node* in1, const TypeVect* vt)  : PackNode(in1, vt) {}
   1.498 +  PackINode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {}
   1.499 +  virtual int Opcode() const;
   1.500 +};
   1.501 +
   1.502 +//------------------------------PackLNode--------------------------------------
   1.503 +// Pack long scalars into a vector
   1.504 +class PackLNode : public PackNode {
   1.505 + public:
   1.506 +  PackLNode(Node* in1, const TypeVect* vt)  : PackNode(in1, vt) {}
   1.507 +  PackLNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {}
   1.508 +  virtual int Opcode() const;
   1.509 +};
   1.510 +
   1.511 +//------------------------------Pack2LNode-------------------------------------
   1.512 +// Pack 2 long scalars into a vector
   1.513 +class Pack2LNode : public PackNode {
   1.514 + public:
   1.515 +  Pack2LNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {}
   1.516 +  virtual int Opcode() const;
   1.517 +};
   1.518 +
   1.519 +//------------------------------PackFNode--------------------------------------
   1.520 +// Pack float scalars into vector
   1.521 +class PackFNode : public PackNode {
   1.522 + public:
   1.523 +  PackFNode(Node* in1, const TypeVect* vt)  : PackNode(in1, vt) {}
   1.524 +  PackFNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {}
   1.525 +  virtual int Opcode() const;
   1.526 +};
   1.527 +
   1.528 +//------------------------------PackDNode--------------------------------------
   1.529 +// Pack double scalars into a vector
   1.530 +class PackDNode : public PackNode {
   1.531 + public:
   1.532 +  PackDNode(Node* in1, const TypeVect* vt) : PackNode(in1, vt) {}
   1.533 +  PackDNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {}
   1.534 +  virtual int Opcode() const;
   1.535 +};
   1.536 +
   1.537 +//------------------------------Pack2DNode-------------------------------------
   1.538 +// Pack 2 double scalars into a vector
   1.539 +class Pack2DNode : public PackNode {
   1.540 + public:
   1.541 +  Pack2DNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {}
   1.542 +  virtual int Opcode() const;
   1.543 +};
   1.544 +
   1.545 +
   1.546 +//========================Extract_Scalar_from_Vector===========================
   1.547 +
   1.548 +//------------------------------ExtractNode------------------------------------
   1.549 +// Extract a scalar from a vector at position "pos"
   1.550 +class ExtractNode : public Node {
   1.551 + public:
   1.552 +  ExtractNode(Node* src, ConINode* pos) : Node(NULL, src, (Node*)pos) {
   1.553 +    assert(in(2)->get_int() >= 0, "positive constants");
   1.554 +  }
   1.555 +  virtual int Opcode() const;
   1.556 +  uint  pos() const { return in(2)->get_int(); }
   1.557 +
   1.558 +  static Node* make(Compile* C, Node* v, uint position, BasicType bt);
   1.559 +};
   1.560 +
   1.561 +//------------------------------ExtractBNode-----------------------------------
   1.562 +// Extract a byte from a vector at position "pos"
   1.563 +class ExtractBNode : public ExtractNode {
   1.564 + public:
   1.565 +  ExtractBNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
   1.566 +  virtual int Opcode() const;
   1.567 +  virtual const Type *bottom_type() const { return TypeInt::INT; }
   1.568 +  virtual uint ideal_reg() const { return Op_RegI; }
   1.569 +};
   1.570 +
   1.571 +//------------------------------ExtractUBNode----------------------------------
   1.572 +// Extract a boolean from a vector at position "pos"
   1.573 +class ExtractUBNode : public ExtractNode {
   1.574 + public:
   1.575 +  ExtractUBNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
   1.576 +  virtual int Opcode() const;
   1.577 +  virtual const Type *bottom_type() const { return TypeInt::INT; }
   1.578 +  virtual uint ideal_reg() const { return Op_RegI; }
   1.579 +};
   1.580 +
   1.581 +//------------------------------ExtractCNode-----------------------------------
   1.582 +// Extract a char from a vector at position "pos"
   1.583 +class ExtractCNode : public ExtractNode {
   1.584 + public:
   1.585 +  ExtractCNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
   1.586 +  virtual int Opcode() const;
   1.587 +  virtual const Type *bottom_type() const { return TypeInt::INT; }
   1.588 +  virtual uint ideal_reg() const { return Op_RegI; }
   1.589 +};
   1.590 +
   1.591 +//------------------------------ExtractSNode-----------------------------------
   1.592 +// Extract a short from a vector at position "pos"
   1.593 +class ExtractSNode : public ExtractNode {
   1.594 + public:
   1.595 +  ExtractSNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
   1.596 +  virtual int Opcode() const;
   1.597 +  virtual const Type *bottom_type() const { return TypeInt::INT; }
   1.598 +  virtual uint ideal_reg() const { return Op_RegI; }
   1.599 +};
   1.600 +
   1.601 +//------------------------------ExtractINode-----------------------------------
   1.602 +// Extract an int from a vector at position "pos"
   1.603 +class ExtractINode : public ExtractNode {
   1.604 + public:
   1.605 +  ExtractINode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
   1.606 +  virtual int Opcode() const;
   1.607 +  virtual const Type *bottom_type() const { return TypeInt::INT; }
   1.608 +  virtual uint ideal_reg() const { return Op_RegI; }
   1.609 +};
   1.610 +
   1.611 +//------------------------------ExtractLNode-----------------------------------
   1.612 +// Extract a long from a vector at position "pos"
   1.613 +class ExtractLNode : public ExtractNode {
   1.614 + public:
   1.615 +  ExtractLNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
   1.616 +  virtual int Opcode() const;
   1.617 +  virtual const Type *bottom_type() const { return TypeLong::LONG; }
   1.618 +  virtual uint ideal_reg() const { return Op_RegL; }
   1.619 +};
   1.620 +
   1.621 +//------------------------------ExtractFNode-----------------------------------
   1.622 +// Extract a float from a vector at position "pos"
   1.623 +class ExtractFNode : public ExtractNode {
   1.624 + public:
   1.625 +  ExtractFNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
   1.626 +  virtual int Opcode() const;
   1.627 +  virtual const Type *bottom_type() const { return Type::FLOAT; }
   1.628 +  virtual uint ideal_reg() const { return Op_RegF; }
   1.629 +};
   1.630 +
   1.631 +//------------------------------ExtractDNode-----------------------------------
   1.632 +// Extract a double from a vector at position "pos"
   1.633 +class ExtractDNode : public ExtractNode {
   1.634 + public:
   1.635 +  ExtractDNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
   1.636 +  virtual int Opcode() const;
   1.637 +  virtual const Type *bottom_type() const { return Type::DOUBLE; }
   1.638 +  virtual uint ideal_reg() const { return Op_RegD; }
   1.639 +};
   1.640 +
   1.641 +#endif // SHARE_VM_OPTO_VECTORNODE_HPP

mercurial