27 #include "opto/matcher.hpp" 28 #include "opto/memnode.hpp" 29 #include "opto/node.hpp" 30 #include "opto/opcodes.hpp" 31 32 //------------------------------VectorNode------------------------------------- 33 // Vector Operation 34 class VectorNode : public TypeNode { 35 public: 36 37 VectorNode(Node* n1, const TypeVect* vt) : TypeNode(vt, 2) { 38 init_class_id(Class_Vector); 39 init_req(1, n1); 40 } 41 VectorNode(Node* n1, Node* n2, const TypeVect* vt) : TypeNode(vt, 3) { 42 init_class_id(Class_Vector); 43 init_req(1, n1); 44 init_req(2, n2); 45 } 46 47 const TypeVect* vect_type() const { return type()->is_vect(); } 48 uint length() const { return vect_type()->length(); } // Vector length 49 uint length_in_bytes() const { return vect_type()->length_in_bytes(); } 50 51 virtual int Opcode() const; 52 53 virtual uint ideal_reg() const { return Matcher::vector_ideal_reg(vect_type()->length_in_bytes()); } 54 55 static VectorNode* scalar2vector(Node* s, uint vlen, const Type* opd_t); 56 static VectorNode* shift_count(Node* shift, Node* cnt, uint vlen, BasicType bt); 57 static VectorNode* make(int opc, Node* n1, Node* n2, uint vlen, BasicType bt); 58 59 static int opcode(int opc, BasicType bt); 60 static bool implemented(int opc, uint vlen, BasicType bt); 61 static bool is_shift(Node* n); 62 static bool is_invariant_vector(Node* n); 63 // [Start, end) half-open range defining which operands are vectors 64 static void vector_operands(Node* n, uint* start, uint* end); 65 }; 66 233 // Vector multiply long 234 class MulVLNode : public VectorNode { 235 public: 236 MulVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1, in2, vt) {} 237 virtual int Opcode() const; 238 }; 239 240 //------------------------------MulVFNode-------------------------------------- 241 // Vector multiply float 242 class MulVFNode : public VectorNode { 243 public: 244 MulVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1, in2, vt) {} 245 virtual int Opcode() const; 246 }; 247 248 //------------------------------MulVDNode-------------------------------------- 249 // Vector multiply double 250 class MulVDNode : public VectorNode { 251 public: 252 MulVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1, in2, vt) {} 253 virtual int Opcode() const; 254 }; 255 256 //------------------------------MulReductionVINode-------------------------------------- 257 // Vector multiply int as a reduction 258 class MulReductionVINode : public ReductionNode { 259 public: 260 MulReductionVINode(Node *ctrl, Node* in1, Node* in2) : ReductionNode(ctrl, in1, in2) {} 261 virtual int Opcode() const; 262 virtual const Type* bottom_type() const { return TypeInt::INT; } 263 virtual uint ideal_reg() const { return Op_RegI; } 264 }; 265 266 //------------------------------MulReductionVLNode-------------------------------------- 267 // Vector multiply int as a reduction 268 class MulReductionVLNode : public ReductionNode { 269 public: 270 MulReductionVLNode(Node *ctrl, Node* in1, Node* in2) : ReductionNode(ctrl, in1, in2) {} 271 virtual int Opcode() const; 272 virtual const Type* bottom_type() const { return TypeLong::LONG; } | 27 #include "opto/matcher.hpp" 28 #include "opto/memnode.hpp" 29 #include "opto/node.hpp" 30 #include "opto/opcodes.hpp" 31 32 //------------------------------VectorNode------------------------------------- 33 // Vector Operation 34 class VectorNode : public TypeNode { 35 public: 36 37 VectorNode(Node* n1, const TypeVect* vt) : TypeNode(vt, 2) { 38 init_class_id(Class_Vector); 39 init_req(1, n1); 40 } 41 VectorNode(Node* n1, Node* n2, const TypeVect* vt) : TypeNode(vt, 3) { 42 init_class_id(Class_Vector); 43 init_req(1, n1); 44 init_req(2, n2); 45 } 46 47 VectorNode(Node* n1, Node* n2, Node* n3, const TypeVect* vt) : TypeNode(vt, 4) { 48 init_class_id(Class_Vector); 49 init_req(1, n1); 50 init_req(2, n2); 51 init_req(3, n3); 52 } 53 54 const TypeVect* vect_type() const { return type()->is_vect(); } 55 uint length() const { return vect_type()->length(); } // Vector length 56 uint length_in_bytes() const { return vect_type()->length_in_bytes(); } 57 58 virtual int Opcode() const; 59 60 virtual uint ideal_reg() const { return Matcher::vector_ideal_reg(vect_type()->length_in_bytes()); } 61 62 static VectorNode* scalar2vector(Node* s, uint vlen, const Type* opd_t); 63 static VectorNode* shift_count(Node* shift, Node* cnt, uint vlen, BasicType bt); 64 static VectorNode* make(int opc, Node* n1, Node* n2, uint vlen, BasicType bt); 65 66 static int opcode(int opc, BasicType bt); 67 static bool implemented(int opc, uint vlen, BasicType bt); 68 static bool is_shift(Node* n); 69 static bool is_invariant_vector(Node* n); 70 // [Start, end) half-open range defining which operands are vectors 71 static void vector_operands(Node* n, uint* start, uint* end); 72 }; 73 240 // Vector multiply long 241 class MulVLNode : public VectorNode { 242 public: 243 MulVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1, in2, vt) {} 244 virtual int Opcode() const; 245 }; 246 247 //------------------------------MulVFNode-------------------------------------- 248 // Vector multiply float 249 class MulVFNode : public VectorNode { 250 public: 251 MulVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1, in2, vt) {} 252 virtual int Opcode() const; 253 }; 254 255 //------------------------------MulVDNode-------------------------------------- 256 // Vector multiply double 257 class MulVDNode : public VectorNode { 258 public: 259 MulVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1, in2, vt) {} 260 virtual int Opcode() const; 261 }; 262 263 //------------------------------CMoveVDNode-------------------------------------- 264 // Vector multiply double 265 class CMoveVDNode : public VectorNode { 266 public: 267 CMoveVDNode(Node* in1, Node* in2, Node* in3, const TypeVect* vt) : VectorNode(in1, in2, in3, vt) {} 268 virtual int Opcode() const; 269 }; 270 271 //------------------------------MulReductionVINode-------------------------------------- 272 // Vector multiply int as a reduction 273 class MulReductionVINode : public ReductionNode { 274 public: 275 MulReductionVINode(Node *ctrl, Node* in1, Node* in2) : ReductionNode(ctrl, in1, in2) {} 276 virtual int Opcode() const; 277 virtual const Type* bottom_type() const { return TypeInt::INT; } 278 virtual uint ideal_reg() const { return Op_RegI; } 279 }; 280 281 //------------------------------MulReductionVLNode-------------------------------------- 282 // Vector multiply int as a reduction 283 class MulReductionVLNode : public ReductionNode { 284 public: 285 MulReductionVLNode(Node *ctrl, Node* in1, Node* in2) : ReductionNode(ctrl, in1, in2) {} 286 virtual int Opcode() const; 287 virtual const Type* bottom_type() const { return TypeLong::LONG; } |