< prev index next >
src/hotspot/share/opto/vectornode.hpp
Print this page
@@ -77,11 +77,10 @@
static int opcode(int opc, BasicType bt);
static int replicate_opcode(BasicType bt);
static bool implemented(int opc, uint vlen, BasicType bt);
static bool is_shift(Node* n);
- static bool is_vshift(Node* n);
static bool is_vshift_cnt(Node* n);
static bool is_type_transition_short_to_int(Node* n);
static bool is_type_transition_to_int(Node* n);
static bool is_muladds2i(Node* n);
static bool is_roundopD(Node * n);
@@ -178,41 +177,34 @@
// Vector add byte, short and int as a reduction
class AddReductionVINode : public ReductionNode {
public:
AddReductionVINode(Node * ctrl, Node* in1, Node* in2) : ReductionNode(ctrl, in1, in2) {}
virtual int Opcode() const;
- virtual uint ideal_reg() const { return Op_RegI; }
};
//------------------------------AddReductionVLNode--------------------------------------
// Vector add long as a reduction
class AddReductionVLNode : public ReductionNode {
public:
AddReductionVLNode(Node *ctrl, Node* in1, Node* in2) : ReductionNode(ctrl, in1, in2) {}
virtual int Opcode() const;
- virtual const Type* bottom_type() const { return TypeLong::LONG; }
- virtual uint ideal_reg() const { return Op_RegL; }
};
//------------------------------AddReductionVFNode--------------------------------------
// Vector add float as a reduction
class AddReductionVFNode : public ReductionNode {
public:
AddReductionVFNode(Node *ctrl, Node* in1, Node* in2) : ReductionNode(ctrl, in1, in2) {}
virtual int Opcode() const;
- virtual const Type* bottom_type() const { return Type::FLOAT; }
- virtual uint ideal_reg() const { return Op_RegF; }
};
//------------------------------AddReductionVDNode--------------------------------------
// Vector add double as a reduction
class AddReductionVDNode : public ReductionNode {
public:
AddReductionVDNode(Node *ctrl, Node* in1, Node* in2) : ReductionNode(ctrl, in1, in2) {}
virtual int Opcode() const;
- virtual const Type* bottom_type() const { return Type::DOUBLE; }
- virtual uint ideal_reg() const { return Op_RegD; }
};
//------------------------------SubVBNode--------------------------------------
// Vector subtract byte
class SubVBNode : public VectorNode {
@@ -353,41 +345,34 @@
// Vector multiply byte, short and int as a reduction
class MulReductionVINode : public ReductionNode {
public:
MulReductionVINode(Node *ctrl, Node* in1, Node* in2) : ReductionNode(ctrl, in1, in2) {}
virtual int Opcode() const;
- virtual uint ideal_reg() const { return Op_RegI; }
};
//------------------------------MulReductionVLNode--------------------------------------
// Vector multiply int as a reduction
class MulReductionVLNode : public ReductionNode {
public:
MulReductionVLNode(Node *ctrl, Node* in1, Node* in2) : ReductionNode(ctrl, in1, in2) {}
virtual int Opcode() const;
- virtual const Type* bottom_type() const { return TypeLong::LONG; }
- virtual uint ideal_reg() const { return Op_RegL; }
};
//------------------------------MulReductionVFNode--------------------------------------
// Vector multiply float as a reduction
class MulReductionVFNode : public ReductionNode {
public:
MulReductionVFNode(Node *ctrl, Node* in1, Node* in2) : ReductionNode(ctrl, in1, in2) {}
virtual int Opcode() const;
- virtual const Type* bottom_type() const { return Type::FLOAT; }
- virtual uint ideal_reg() const { return Op_RegF; }
};
//------------------------------MulReductionVDNode--------------------------------------
// Vector multiply double as a reduction
class MulReductionVDNode : public ReductionNode {
public:
MulReductionVDNode(Node *ctrl, Node* in1, Node* in2) : ReductionNode(ctrl, in1, in2) {}
virtual int Opcode() const;
- virtual const Type* bottom_type() const { return Type::DOUBLE; }
- virtual uint ideal_reg() const { return Op_RegD; }
};
//------------------------------DivVFNode--------------------------------------
// Vector divide float
class DivVFNode : public VectorNode {
@@ -429,27 +414,19 @@
};
//------------------------------MaxVNode--------------------------------------
// Vector Max
class MaxVNode : public VectorNode {
-public:
+ public:
MaxVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1, in2, vt) {}
virtual int Opcode() const;
};
-//------------------------------AbsVNode--------------------------------------
-// Vector Abs
-class AbsVNode : public VectorNode {
-public:
- AbsVNode(Node* in, const TypeVect* vt) : VectorNode(in, vt) {}
- virtual int Opcode() const;
-};
-
//------------------------------AbsVINode--------------------------------------
// Vector Abs int
class AbsVINode : public VectorNode {
-public:
+ public:
AbsVINode(Node* in, const TypeVect* vt) : VectorNode(in, vt) {}
virtual int Opcode() const;
};
//------------------------------AbsVLNode--------------------------------------
@@ -477,11 +454,11 @@
};
//------------------------------NegVINode--------------------------------------
// Vector Neg int
class NegVINode : public VectorNode {
-public:
+ public:
NegVINode(Node* in, const TypeVect* vt) : VectorNode(in, vt) {}
virtual int Opcode() const;
};
//------------------------------NegVFNode--------------------------------------
@@ -529,18 +506,10 @@
public:
SqrtVDNode(Node* in, const TypeVect* vt) : VectorNode(in,vt) {}
virtual int Opcode() const;
};
-//------------------------------NotVNode--------------------------------------
-// Vector Not
-class NotVNode : public VectorNode {
-public:
- NotVNode(Node* in, const TypeVect* vt) : VectorNode(in, vt) {}
- virtual int Opcode() const;
-};
-
//------------------------------LShiftVBNode-----------------------------------
// Vector left shift bytes
class LShiftVBNode : public VectorNode {
public:
LShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
@@ -649,34 +618,10 @@
public:
RShiftCntVNode(Node* cnt, const TypeVect* vt) : VectorNode(cnt,vt) {}
virtual int Opcode() const;
};
-//------------------------------VLShiftVNode-----------------------------------
-// Variable vector left shift bytes
-class VLShiftVNode : public VectorNode {
- public:
- VLShiftVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
- virtual int Opcode() const;
-};
-
-//------------------------------VRShiftVNode-----------------------------------
-// Variable vector right shift bytes
-class VRShiftVNode : public VectorNode {
- public:
- VRShiftVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
- virtual int Opcode() const;
-};
-
-//------------------------------VURShiftVNode-----------------------------------
-// Variable vector unsigned right shift bytes
-class VURShiftVNode : public VectorNode {
- public:
- VURShiftVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
- virtual int Opcode() const;
-};
-
//------------------------------AndVNode---------------------------------------
// Vector and integer
class AndVNode : public VectorNode {
public:
AndVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
@@ -684,11 +629,11 @@
};
//------------------------------AndReductionVNode--------------------------------------
// Vector and byte, short, int, long as a reduction
class AndReductionVNode : public ReductionNode {
-public:
+ public:
AndReductionVNode(Node *ctrl, Node* in1, Node* in2) : ReductionNode(ctrl, in1, in2) {}
virtual int Opcode() const;
};
//------------------------------OrVNode---------------------------------------
@@ -700,19 +645,19 @@
};
//------------------------------OrReductionVNode--------------------------------------
// Vector xor byte, short, int, long as a reduction
class OrReductionVNode : public ReductionNode {
-public:
+ public:
OrReductionVNode(Node *ctrl, Node* in1, Node* in2) : ReductionNode(ctrl, in1, in2) {}
virtual int Opcode() const;
};
//------------------------------XorReductionVNode--------------------------------------
// Vector and int, long as a reduction
class XorReductionVNode : public ReductionNode {
-public:
+ public:
XorReductionVNode(Node *ctrl, Node* in1, Node* in2) : ReductionNode(ctrl, in1, in2) {}
virtual int Opcode() const;
};
//------------------------------XorVNode---------------------------------------
@@ -1102,15 +1047,11 @@
protected:
uint size_of() const { return sizeof(*this); }
public:
VectorMaskCmpNode(BoolTest::mask predicate, Node* in1, Node* in2, ConINode* predicate_node, const TypeVect* vt) :
-#ifdef X86
VectorNode(in1, in2, predicate_node, vt),
-#else
- VectorNode(in1, in2, vt),
-#endif
_predicate(predicate) {
assert(in1->bottom_type()->is_vect()->element_basic_type() == in2->bottom_type()->is_vect()->element_basic_type(),
"VectorMaskCmp inputs must have same type for elements");
assert(in1->bottom_type()->is_vect()->length() == in2->bottom_type()->is_vect()->length(),
"VectorMaskCmp inputs must have same number of elements");
@@ -1123,16 +1064,16 @@
return VectorNode::cmp(n) && _predicate == ((VectorMaskCmpNode&)n)._predicate;
}
BoolTest::mask get_predicate() { return _predicate; }
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
-#endif // PRODUCT
+#endif // !PRODUCT
};
// Used to wrap other vector nodes in order to add masking functionality.
class VectorMaskWrapperNode : public VectorNode {
-public:
+ public:
VectorMaskWrapperNode(Node* vector, Node* mask)
: VectorNode(vector, mask, vector->bottom_type()->is_vect()) {
assert(mask->is_VectorMaskCmp(), "VectorMaskWrapper requires that second argument be a mask");
}
@@ -1167,11 +1108,11 @@
// in middle-end, we make it boolean result directly.
BoolTest::mask get_predicate() const { return _predicate; }
};
class VectorBlendNode : public VectorNode {
-public:
+ public:
VectorBlendNode(Node* vec1, Node* vec2, Node* mask)
: VectorNode(vec1, vec2, mask, vec1->bottom_type()->is_vect()) {
// assert(mask->is_VectorMask(), "VectorBlendNode requires that third argument be a mask");
}
@@ -1180,11 +1121,11 @@
Node* vec2() const { return in(2); }
Node* vec_mask() const { return in(3); }
};
class VectorRearrangeNode : public VectorNode {
-public:
+ public:
VectorRearrangeNode(Node* vec1, Node* shuffle)
: VectorNode(vec1, shuffle, vec1->bottom_type()->is_vect()) {
// assert(mask->is_VectorMask(), "VectorBlendNode requires that third argument be a mask");
}
@@ -1200,16 +1141,15 @@
: VectorNode(in, vt) {
assert(in->is_LoadVector(), "expected load vector");
assert(in->as_LoadVector()->vect_type()->element_basic_type() == T_BOOLEAN, "must be boolean");
}
- int GetOutMaskSize() const { return type2aelembytes(vect_type()->element_basic_type()); }
virtual int Opcode() const;
};
class VectorLoadShuffleNode : public VectorNode {
-public:
+ public:
VectorLoadShuffleNode(Node* in, const TypeVect* vt)
: VectorNode(in, vt) {
assert(in->is_LoadVector(), "expected load vector");
assert(in->as_LoadVector()->vect_type()->element_basic_type() == T_BYTE, "must be BYTE");
}
@@ -1217,27 +1157,18 @@
int GetOutShuffleSize() const { return type2aelembytes(vect_type()->element_basic_type()); }
virtual int Opcode() const;
};
class VectorStoreMaskNode : public VectorNode {
- private:
- int _mask_size;
protected:
- uint size_of() const { return sizeof(*this); }
+ VectorStoreMaskNode(Node* in1, ConINode* in2, const TypeVect* vt)
+ : VectorNode(in1, in2, vt) { }
public:
- VectorStoreMaskNode(Node* in, BasicType in_type, uint num_elem)
- : VectorNode(in, TypeVect::make(T_BOOLEAN, num_elem)) {
- _mask_size = type2aelembytes(in_type);
- }
-
- virtual uint hash() const { return VectorNode::hash() + _mask_size; }
- virtual bool cmp( const Node &n ) const {
- return VectorNode::cmp(n) && _mask_size == ((VectorStoreMaskNode&)n)._mask_size;
- }
- int GetInputMaskSize() const { return _mask_size; }
virtual int Opcode() const;
+
+ static VectorStoreMaskNode* make(PhaseGVN& gvn, Node* in, BasicType in_type, uint num_elem);
};
// This is intended for use as a simple reinterpret node that has no cast.
class VectorReinterpretNode : public VectorNode {
private:
@@ -1266,51 +1197,51 @@
static int opcode(BasicType bt);
static bool implemented(BasicType bt, uint vlen);
};
class VectorCastB2XNode : public VectorCastNode {
-public:
+ public:
VectorCastB2XNode(Node* in, const TypeVect* vt) : VectorCastNode(in, vt) {
assert(in->bottom_type()->is_vect()->element_basic_type() == T_BYTE, "must be byte");
}
virtual int Opcode() const;
};
class VectorCastS2XNode : public VectorCastNode {
-public:
+ public:
VectorCastS2XNode(Node* in, const TypeVect* vt) : VectorCastNode(in, vt) {
assert(in->bottom_type()->is_vect()->element_basic_type() == T_SHORT, "must be short");
}
virtual int Opcode() const;
};
class VectorCastI2XNode : public VectorCastNode {
-public:
+ public:
VectorCastI2XNode(Node* in, const TypeVect* vt) : VectorCastNode(in, vt) {
assert(in->bottom_type()->is_vect()->element_basic_type() == T_INT, "must be int");
}
virtual int Opcode() const;
};
class VectorCastL2XNode : public VectorCastNode {
-public:
+ public:
VectorCastL2XNode(Node* in, const TypeVect* vt) : VectorCastNode(in, vt) {
assert(in->bottom_type()->is_vect()->element_basic_type() == T_LONG, "must be long");
}
virtual int Opcode() const;
};
class VectorCastF2XNode : public VectorCastNode {
-public:
+ public:
VectorCastF2XNode(Node* in, const TypeVect* vt) : VectorCastNode(in, vt) {
assert(in->bottom_type()->is_vect()->element_basic_type() == T_FLOAT, "must be float");
}
virtual int Opcode() const;
};
class VectorCastD2XNode : public VectorCastNode {
-public:
+ public:
VectorCastD2XNode(Node* in, const TypeVect* vt) : VectorCastNode(in, vt) {
assert(in->bottom_type()->is_vect()->element_basic_type() == T_DOUBLE, "must be double");
}
virtual int Opcode() const;
};
@@ -1346,11 +1277,11 @@
const TypeInstPtr* box_type() const { assert(_box_type != NULL, ""); return _box_type; };
const TypeVect* vec_type() const { assert(_vec_type != NULL, ""); return _vec_type; };
virtual int Opcode() const;
- virtual const Type *bottom_type() const { return _box_type; /* TypeInstPtr::BOTTOM? */ }
+ virtual const Type* bottom_type() const { return _box_type; }
virtual uint ideal_reg() const { return box_type()->ideal_reg(); }
virtual uint size_of() const { return sizeof(*this); }
static const TypeFunc* vec_box_type(const TypeInstPtr* box_type);
};
@@ -1364,17 +1295,17 @@
}
virtual int Opcode() const;
#ifndef PRODUCT
virtual void dump_spec(outputStream *st) const;
-#endif // PRODUCT
+#endif // !PRODUCT
};
class VectorUnboxNode : public VectorNode {
-private:
+ private:
bool _shuffle_to_vector;
-protected:
+ protected:
uint size_of() const { return sizeof(*this); }
public:
VectorUnboxNode(Compile* C, const TypeVect* vec_type, Node* obj, Node* mem, bool shuffle_to_vector)
: VectorNode(mem, obj, vec_type) {
_shuffle_to_vector = shuffle_to_vector;
< prev index next >