967 // Extract a double from a vector at position "pos"
968 class ExtractDNode : public ExtractNode {
969 public:
970 ExtractDNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
971 virtual int Opcode() const;
972 virtual const Type *bottom_type() const { return Type::DOUBLE; }
973 virtual uint ideal_reg() const { return Op_RegD; }
974 };
975
976 //------------------------------SetVectMaskINode-------------------------------
977 // Provide a mask for a vector predicate machine
978 class SetVectMaskINode : public Node {
979 public:
980 SetVectMaskINode(Node *c, Node *in1) : Node(c, in1) {}
981 virtual int Opcode() const;
982 const Type *bottom_type() const { return TypeInt::INT; }
983 virtual uint ideal_reg() const { return Op_RegI; }
984 virtual const Type *Value(PhaseGVN *phase) const { return TypeInt::INT; }
985 };
986
987 // Type conversion nodes
988 class ConvertVF2VDNode : public VectorNode {
989 public:
990 ConvertVF2VDNode(Node* in, const TypeVect* vt) : VectorNode(in,vt) {}
991 virtual int Opcode() const;
992 };
993
994 class VectorBoxNode : public Node {
995 private:
996 const TypeInstPtr* const _box_type;
997 const TypeVect* const _vec_type;
998 public:
999 enum {
1000 Box = 1,
1001 Value = 2
1002 };
1003 VectorBoxNode(Compile* C, Node* box, Node* val,
1004 const TypeInstPtr* box_type, const TypeVect* vt)
1005 : Node(NULL, box, val), _box_type(box_type), _vec_type(vt) {
1006 init_flags(Flag_is_macro);
1007 C->add_macro_node(this);
1008 }
1009
1010 const TypeInstPtr* box_type() const { assert(_box_type != NULL, ""); return _box_type; };
1011 const TypeVect* vec_type() const { assert(_vec_type != NULL, ""); return _vec_type; };
1012
1013 virtual int Opcode() const;
1157 }
1158 int GetInputMaskSize() const { return _mask_size; }
1159 virtual int Opcode() const;
1160 };
1161
1162 // This is intended for use as a simple reinterpret node that has no cast.
1163 class VectorReinterpretNode : public VectorNode {
1164 private:
1165 const TypeVect* _src_vt;
1166 protected:
1167 uint size_of() const { return sizeof(*this); }
1168 public:
1169 VectorReinterpretNode(Node* in, const TypeVect* src_vt, const TypeVect* dst_vt)
1170 : VectorNode(in, dst_vt), _src_vt(src_vt) { }
1171
1172 virtual uint hash() const { return VectorNode::hash() + _src_vt->hash(); }
1173 virtual uint cmp( const Node &n ) const {
1174 return VectorNode::cmp(n) && !Type::cmp(_src_vt,((VectorReinterpretNode&)n)._src_vt);
1175 }
1176
1177 virtual int Opcode() const;
1178 };
1179
1180 #endif // SHARE_VM_OPTO_VECTORNODE_HPP
|
967 // Extract a double from a vector at position "pos"
968 class ExtractDNode : public ExtractNode {
969 public:
970 ExtractDNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
971 virtual int Opcode() const;
972 virtual const Type *bottom_type() const { return Type::DOUBLE; }
973 virtual uint ideal_reg() const { return Op_RegD; }
974 };
975
976 //------------------------------SetVectMaskINode-------------------------------
977 // Provide a mask for a vector predicate machine
978 class SetVectMaskINode : public Node {
979 public:
980 SetVectMaskINode(Node *c, Node *in1) : Node(c, in1) {}
981 virtual int Opcode() const;
982 const Type *bottom_type() const { return TypeInt::INT; }
983 virtual uint ideal_reg() const { return Op_RegI; }
984 virtual const Type *Value(PhaseGVN *phase) const { return TypeInt::INT; }
985 };
986
987 class VectorBoxNode : public Node {
988 private:
989 const TypeInstPtr* const _box_type;
990 const TypeVect* const _vec_type;
991 public:
992 enum {
993 Box = 1,
994 Value = 2
995 };
996 VectorBoxNode(Compile* C, Node* box, Node* val,
997 const TypeInstPtr* box_type, const TypeVect* vt)
998 : Node(NULL, box, val), _box_type(box_type), _vec_type(vt) {
999 init_flags(Flag_is_macro);
1000 C->add_macro_node(this);
1001 }
1002
1003 const TypeInstPtr* box_type() const { assert(_box_type != NULL, ""); return _box_type; };
1004 const TypeVect* vec_type() const { assert(_vec_type != NULL, ""); return _vec_type; };
1005
1006 virtual int Opcode() const;
1150 }
1151 int GetInputMaskSize() const { return _mask_size; }
1152 virtual int Opcode() const;
1153 };
1154
1155 // This is intended for use as a simple reinterpret node that has no cast.
1156 class VectorReinterpretNode : public VectorNode {
1157 private:
1158 const TypeVect* _src_vt;
1159 protected:
1160 uint size_of() const { return sizeof(*this); }
1161 public:
1162 VectorReinterpretNode(Node* in, const TypeVect* src_vt, const TypeVect* dst_vt)
1163 : VectorNode(in, dst_vt), _src_vt(src_vt) { }
1164
1165 virtual uint hash() const { return VectorNode::hash() + _src_vt->hash(); }
1166 virtual uint cmp( const Node &n ) const {
1167 return VectorNode::cmp(n) && !Type::cmp(_src_vt,((VectorReinterpretNode&)n)._src_vt);
1168 }
1169
1170 virtual int Opcode() const;
1171 };
1172
1173 class VectorCastB2XNode : public VectorNode {
1174 public:
1175 VectorCastB2XNode(Node* in, const TypeVect* vt) : VectorNode(in, vt) {
1176 assert(in->bottom_type()->is_vect()->element_basic_type() == T_BYTE, "must be byte");
1177 }
1178 virtual int Opcode() const;
1179 };
1180
1181 class VectorCastS2XNode : public VectorNode {
1182 public:
1183 VectorCastS2XNode(Node* in, const TypeVect* vt) : VectorNode(in, vt) {
1184 assert(in->bottom_type()->is_vect()->element_basic_type() == T_SHORT, "must be short");
1185 }
1186 virtual int Opcode() const;
1187 };
1188
1189 class VectorCastI2XNode : public VectorNode {
1190 public:
1191 VectorCastI2XNode(Node* in, const TypeVect* vt) : VectorNode(in, vt) {
1192 assert(in->bottom_type()->is_vect()->element_basic_type() == T_INT, "must be int");
1193 }
1194 virtual int Opcode() const;
1195 };
1196
1197 class VectorCastL2XNode : public VectorNode {
1198 public:
1199 VectorCastL2XNode(Node* in, const TypeVect* vt) : VectorNode(in, vt) {
1200 assert(in->bottom_type()->is_vect()->element_basic_type() == T_LONG, "must be long");
1201 }
1202 virtual int Opcode() const;
1203 };
1204
1205 class VectorCastF2XNode : public VectorNode {
1206 public:
1207 VectorCastF2XNode(Node* in, const TypeVect* vt) : VectorNode(in, vt) {
1208 assert(in->bottom_type()->is_vect()->element_basic_type() == T_FLOAT, "must be float");
1209 }
1210 virtual int Opcode() const;
1211 };
1212
1213 class VectorCastD2XNode : public VectorNode {
1214 public:
1215 VectorCastD2XNode(Node* in, const TypeVect* vt) : VectorNode(in, vt) {
1216 assert(in->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE, "must be double");
1217 }
1218 virtual int Opcode() const;
1219 };
1220
1221 #endif // SHARE_VM_OPTO_VECTORNODE_HPP
|