@@ -68,6 +68,12 @@ class AddNode : public Node {
6868 // Supplied function to return the additive identity type
6969 virtual const Type *add_id () const = 0;
7070
71+ // Supplied function to return the additive opcode
72+ virtual int max_opcode () const = 0;
73+
74+ // Supplied function to return the multiplicative opcode
75+ virtual int min_opcode () const = 0;
76+
7177 virtual bool operates_on (BasicType bt, bool signed_int) const {
7278 assert (bt == T_INT || bt == T_LONG, " unsupported" );
7379 return false ;
@@ -84,6 +90,8 @@ class AddINode : public AddNode {
8490 virtual const Type *add_ring ( const Type *, const Type * ) const ;
8591 virtual const Type *add_id () const { return TypeInt::ZERO; }
8692 virtual const Type *bottom_type () const { return TypeInt::INT; }
93+ int max_opcode () const { return Op_MaxI; }
94+ int min_opcode () const { return Op_MinI; }
8795 virtual Node *Ideal (PhaseGVN *phase, bool can_reshape);
8896 virtual Node* Identity (PhaseGVN* phase);
8997 virtual bool operates_on (BasicType bt, bool signed_int) const {
@@ -102,6 +110,8 @@ class AddLNode : public AddNode {
102110 virtual const Type *add_ring ( const Type *, const Type * ) const ;
103111 virtual const Type *add_id () const { return TypeLong::ZERO; }
104112 virtual const Type *bottom_type () const { return TypeLong::LONG; }
113+ int max_opcode () const { return Op_MaxL; }
114+ int min_opcode () const { return Op_MinL; }
105115 virtual Node *Ideal (PhaseGVN *phase, bool can_reshape);
106116 virtual Node* Identity (PhaseGVN* phase);
107117 virtual bool operates_on (BasicType bt, bool signed_int) const {
@@ -122,6 +132,8 @@ class AddFNode : public AddNode {
122132 virtual const Type *add_ring ( const Type *, const Type * ) const ;
123133 virtual const Type *add_id () const { return TypeF::ZERO; }
124134 virtual const Type *bottom_type () const { return Type::FLOAT; }
135+ int max_opcode () const { return Op_MaxF; }
136+ int min_opcode () const { return Op_MinF; }
125137 virtual Node* Identity (PhaseGVN* phase) { return this ; }
126138 virtual uint ideal_reg () const { return Op_RegF; }
127139};
@@ -137,6 +149,8 @@ class AddDNode : public AddNode {
137149 virtual const Type *add_ring ( const Type *, const Type * ) const ;
138150 virtual const Type *add_id () const { return TypeD::ZERO; }
139151 virtual const Type *bottom_type () const { return Type::DOUBLE; }
152+ int max_opcode () const { return Op_MaxD; }
153+ int min_opcode () const { return Op_MinD; }
140154 virtual Node* Identity (PhaseGVN* phase) { return this ; }
141155 virtual uint ideal_reg () const { return Op_RegD; }
142156};
@@ -183,6 +197,8 @@ class OrINode : public AddNode {
183197 virtual const Type *add_ring ( const Type *, const Type * ) const ;
184198 virtual const Type *add_id () const { return TypeInt::ZERO; }
185199 virtual const Type *bottom_type () const { return TypeInt::INT; }
200+ int max_opcode () const { return Op_MaxI; }
201+ int min_opcode () const { return Op_MinI; }
186202 virtual Node* Identity (PhaseGVN* phase);
187203 virtual uint ideal_reg () const { return Op_RegI; }
188204 virtual Node *Ideal (PhaseGVN *phase, bool can_reshape);
@@ -198,6 +214,8 @@ class OrLNode : public AddNode {
198214 virtual const Type *add_ring ( const Type *, const Type * ) const ;
199215 virtual const Type *add_id () const { return TypeLong::ZERO; }
200216 virtual const Type *bottom_type () const { return TypeLong::LONG; }
217+ int max_opcode () const { return Op_MaxL; }
218+ int min_opcode () const { return Op_MinL; }
201219 virtual Node* Identity (PhaseGVN* phase);
202220 virtual uint ideal_reg () const { return Op_RegL; }
203221 virtual Node *Ideal (PhaseGVN *phase, bool can_reshape);
@@ -212,6 +230,8 @@ class XorINode : public AddNode {
212230 virtual const Type *add_ring ( const Type *, const Type * ) const ;
213231 virtual const Type *add_id () const { return TypeInt::ZERO; }
214232 virtual const Type *bottom_type () const { return TypeInt::INT; }
233+ int max_opcode () const { return Op_MaxI; }
234+ int min_opcode () const { return Op_MinI; }
215235 virtual const Type *Value (PhaseGVN *phase) const ;
216236 virtual uint ideal_reg () const { return Op_RegI; }
217237};
@@ -225,6 +245,8 @@ class XorLNode : public AddNode {
225245 virtual const Type *add_ring ( const Type *, const Type * ) const ;
226246 virtual const Type *add_id () const { return TypeLong::ZERO; }
227247 virtual const Type *bottom_type () const { return TypeLong::LONG; }
248+ int max_opcode () const { return Op_MaxL; }
249+ int min_opcode () const { return Op_MinL; }
228250 virtual const Type *Value (PhaseGVN *phase) const ;
229251 virtual uint ideal_reg () const { return Op_RegL; }
230252};
@@ -241,6 +263,8 @@ class MaxNode : public AddNode {
241263public:
242264 MaxNode ( Node *in1, Node *in2 ) : AddNode(in1,in2) {}
243265 virtual int Opcode () const = 0;
266+ virtual int max_opcode () const = 0;
267+ virtual int min_opcode () const = 0;
244268
245269 static Node* unsigned_max (Node* a, Node* b, const Type* t, PhaseGVN& gvn) {
246270 return build_min_max (a, b, true , true , t, gvn);
@@ -280,6 +304,8 @@ class MaxINode : public MaxNode {
280304 virtual const Type *add_id () const { return TypeInt::make (min_jint); }
281305 virtual const Type *bottom_type () const { return TypeInt::INT; }
282306 virtual uint ideal_reg () const { return Op_RegI; }
307+ int max_opcode () const { return Op_MaxI; }
308+ int min_opcode () const { return Op_MinI; }
283309};
284310
285311// ------------------------------MinINode---------------------------------------
@@ -293,6 +319,8 @@ class MinINode : public MaxNode {
293319 virtual const Type *add_id () const { return TypeInt::make (max_jint); }
294320 virtual const Type *bottom_type () const { return TypeInt::INT; }
295321 virtual uint ideal_reg () const { return Op_RegI; }
322+ int max_opcode () const { return Op_MaxI; }
323+ int min_opcode () const { return Op_MinI; }
296324 virtual Node *Ideal (PhaseGVN *phase, bool can_reshape);
297325};
298326
@@ -306,6 +334,8 @@ class MaxLNode : public MaxNode {
306334 virtual const Type *add_id () const { return TypeLong::make (min_jlong); }
307335 virtual const Type *bottom_type () const { return TypeLong::LONG; }
308336 virtual uint ideal_reg () const { return Op_RegL; }
337+ int max_opcode () const { return Op_MaxL; }
338+ int min_opcode () const { return Op_MinL; }
309339};
310340
311341// ------------------------------MinLNode---------------------------------------
@@ -318,6 +348,8 @@ class MinLNode : public MaxNode {
318348 virtual const Type *add_id () const { return TypeLong::make (max_jlong); }
319349 virtual const Type *bottom_type () const { return TypeLong::LONG; }
320350 virtual uint ideal_reg () const { return Op_RegL; }
351+ int max_opcode () const { return Op_MaxL; }
352+ int min_opcode () const { return Op_MinL; }
321353};
322354
323355// ------------------------------MaxFNode---------------------------------------
@@ -330,6 +362,8 @@ class MaxFNode : public MaxNode {
330362 virtual const Type *add_id () const { return TypeF::NEG_INF; }
331363 virtual const Type *bottom_type () const { return Type::FLOAT; }
332364 virtual uint ideal_reg () const { return Op_RegF; }
365+ int max_opcode () const { return Op_MaxF; }
366+ int min_opcode () const { return Op_MinF; }
333367};
334368
335369// ------------------------------MinFNode---------------------------------------
@@ -342,6 +376,8 @@ class MinFNode : public MaxNode {
342376 virtual const Type *add_id () const { return TypeF::POS_INF; }
343377 virtual const Type *bottom_type () const { return Type::FLOAT; }
344378 virtual uint ideal_reg () const { return Op_RegF; }
379+ int max_opcode () const { return Op_MaxF; }
380+ int min_opcode () const { return Op_MinF; }
345381};
346382
347383// ------------------------------MaxDNode---------------------------------------
@@ -354,6 +390,8 @@ class MaxDNode : public MaxNode {
354390 virtual const Type *add_id () const { return TypeD::NEG_INF; }
355391 virtual const Type *bottom_type () const { return Type::DOUBLE; }
356392 virtual uint ideal_reg () const { return Op_RegD; }
393+ int max_opcode () const { return Op_MaxD; }
394+ int min_opcode () const { return Op_MinD; }
357395};
358396
359397// ------------------------------MinDNode---------------------------------------
@@ -366,6 +404,8 @@ class MinDNode : public MaxNode {
366404 virtual const Type *add_id () const { return TypeD::POS_INF; }
367405 virtual const Type *bottom_type () const { return Type::DOUBLE; }
368406 virtual uint ideal_reg () const { return Op_RegD; }
407+ int max_opcode () const { return Op_MaxD; }
408+ int min_opcode () const { return Op_MinD; }
369409};
370410
371411#endif // SHARE_OPTO_ADDNODE_HPP
0 commit comments