1 /*
  2  * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  5  * This code is free software; you can redistribute it and/or modify it
  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #ifndef SHARE_OPTO_SUBNODE_HPP
 26 #define SHARE_OPTO_SUBNODE_HPP
 27 
 28 #include "opto/node.hpp"
 29 #include "opto/opcodes.hpp"
 30 #include "opto/type.hpp"
 31 
 32 // Portions of code courtesy of Clifford Click
 33 
 34 //------------------------------SUBNode----------------------------------------
 35 // Class SUBTRACTION functionality.  This covers all the usual 'subtract'
 36 // behaviors.  Subtract-integer, -float, -double, binary xor, compare-integer,
 37 // -float, and -double are all inherited from this class.  The compare
 38 // functions behave like subtract functions, except that all negative answers
 39 // are compressed into -1, and all positive answers compressed to 1.
 40 class SubNode : public Node {
 41 public:
 42   SubNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {
 43     init_class_id(Class_Sub);
 44   }
 45 
 46   // Handle algebraic identities here.  If we have an identity, return the Node
 47   // we are equivalent to.  We look for "add of zero" as an identity.
 48   virtual Node* Identity(PhaseGVN* phase);
 49 
 50   // Compute a new Type for this node.  Basically we just do the pre-check,
 51   // then call the virtual add() to set the type.
 52   virtual const Type* Value(PhaseGVN* phase) const;
 53   const Type* Value_common( PhaseTransform *phase ) const;
 54 
 55   // Supplied function returns the subtractend of the inputs.
 56   // This also type-checks the inputs for sanity.  Guaranteed never to
 57   // be passed a TOP or BOTTOM type, these are filtered out by a pre-check.
 58   virtual const Type *sub( const Type *, const Type * ) const = 0;
 59 
 60   // Supplied function to return the additive identity type.
 61   // This is returned whenever the subtracts inputs are the same.
 62   virtual const Type *add_id() const = 0;
 63 
 64   static SubNode* make(Node* in1, Node* in2, BasicType bt);
 65 };
 66 
 67 
 68 // NOTE: SubINode should be taken away and replaced by add and negate
 69 //------------------------------SubINode---------------------------------------
 70 // Subtract 2 integers
 71 class SubINode : public SubNode {
 72 public:
 73   SubINode( Node *in1, Node *in2 ) : SubNode(in1,in2) {}
 74   virtual int Opcode() const;
 75   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 76   virtual const Type *sub( const Type *, const Type * ) const;
 77   const Type *add_id() const { return TypeInt::ZERO; }
 78   const Type *bottom_type() const { return TypeInt::INT; }
 79   virtual uint ideal_reg() const { return Op_RegI; }
 80 };
 81 
 82 //------------------------------SubLNode---------------------------------------
 83 // Subtract 2 integers
 84 class SubLNode : public SubNode {
 85 public:
 86   SubLNode( Node *in1, Node *in2 ) : SubNode(in1,in2) {}
 87   virtual int Opcode() const;
 88   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
 89   virtual const Type *sub( const Type *, const Type * ) const;
 90   const Type *add_id() const { return TypeLong::ZERO; }
 91   const Type *bottom_type() const { return TypeLong::LONG; }
 92   virtual uint ideal_reg() const { return Op_RegL; }
 93 };
 94 
 95 // NOTE: SubFPNode should be taken away and replaced by add and negate
 96 //------------------------------SubFPNode--------------------------------------
 97 // Subtract 2 floats or doubles
 98 class SubFPNode : public SubNode {
 99 protected:
100   SubFPNode( Node *in1, Node *in2 ) : SubNode(in1,in2) {}
101 public:
102   const Type* Value(PhaseGVN* phase) const;
103 };
104 
105 // NOTE: SubFNode should be taken away and replaced by add and negate
106 //------------------------------SubFNode---------------------------------------
107 // Subtract 2 doubles
108 class SubFNode : public SubFPNode {
109 public:
110   SubFNode( Node *in1, Node *in2 ) : SubFPNode(in1,in2) {}
111   virtual int Opcode() const;
112   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
113   virtual const Type *sub( const Type *, const Type * ) const;
114   const Type   *add_id() const { return TypeF::ZERO; }
115   const Type   *bottom_type() const { return Type::FLOAT; }
116   virtual uint  ideal_reg() const { return Op_RegF; }
117 };
118 
119 // NOTE: SubDNode should be taken away and replaced by add and negate
120 //------------------------------SubDNode---------------------------------------
121 // Subtract 2 doubles
122 class SubDNode : public SubFPNode {
123 public:
124   SubDNode( Node *in1, Node *in2 ) : SubFPNode(in1,in2) {}
125   virtual int Opcode() const;
126   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
127   virtual const Type *sub( const Type *, const Type * ) const;
128   const Type   *add_id() const { return TypeD::ZERO; }
129   const Type   *bottom_type() const { return Type::DOUBLE; }
130   virtual uint  ideal_reg() const { return Op_RegD; }
131 };
132 
133 //------------------------------CmpNode---------------------------------------
134 // Compare 2 values, returning condition codes (-1, 0 or 1).
135 class CmpNode : public SubNode {
136 public:
137   CmpNode( Node *in1, Node *in2 ) : SubNode(in1,in2) {
138     init_class_id(Class_Cmp);
139   }
140   virtual Node* Identity(PhaseGVN* phase);
141   const Type *add_id() const { return TypeInt::ZERO; }
142   const Type *bottom_type() const { return TypeInt::CC; }
143   virtual uint ideal_reg() const { return Op_RegFlags; }
144 
145   static CmpNode *make(Node *in1, Node *in2, BasicType bt, bool unsigned_comp = false);
146 
147 #ifndef PRODUCT
148   // CmpNode and subclasses include all data inputs (until hitting a control
149   // boundary) in their related node set, as well as all outputs until and
150   // including eventual control nodes and their projections.
151   virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
152 #endif
153 };
154 
155 //------------------------------CmpINode---------------------------------------
156 // Compare 2 signed values, returning condition codes (-1, 0 or 1).
157 class CmpINode : public CmpNode {
158 public:
159   CmpINode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
160   virtual int Opcode() const;
161   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
162   virtual const Type *sub( const Type *, const Type * ) const;
163 };
164 
165 //------------------------------CmpUNode---------------------------------------
166 // Compare 2 unsigned values (integer or pointer), returning condition codes (-1, 0 or 1).
167 class CmpUNode : public CmpNode {
168 public:
169   CmpUNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
170   virtual int Opcode() const;
171   virtual const Type *sub( const Type *, const Type * ) const;
172   const Type* Value(PhaseGVN* phase) const;
173   bool is_index_range_check() const;
174 };
175 
176 //------------------------------CmpPNode---------------------------------------
177 // Compare 2 pointer values, returning condition codes (-1, 0 or 1).
178 class CmpPNode : public CmpNode {
179 public:
180   CmpPNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
181   virtual int Opcode() const;
182   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
183   virtual const Type *sub( const Type *, const Type * ) const;
184 };
185 
186 //------------------------------CmpNNode--------------------------------------
187 // Compare 2 narrow oop values, returning condition codes (-1, 0 or 1).
188 class CmpNNode : public CmpNode {
189 public:
190   CmpNNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
191   virtual int Opcode() const;
192   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
193   virtual const Type *sub( const Type *, const Type * ) const;
194 };
195 
196 //------------------------------CmpLNode---------------------------------------
197 // Compare 2 long values, returning condition codes (-1, 0 or 1).
198 class CmpLNode : public CmpNode {
199 public:
200   CmpLNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
201   virtual int    Opcode() const;
202   virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
203   virtual const Type* Value(PhaseGVN* phase) const;
204   virtual const Type *sub( const Type *, const Type * ) const;
205   bool is_double_null_check(PhaseGVN* phase, Node*& a, Node*& b) const;
206 };
207 
208 //------------------------------CmpULNode---------------------------------------
209 // Compare 2 unsigned long values, returning condition codes (-1, 0 or 1).
210 class CmpULNode : public CmpNode {
211 public:
212   CmpULNode(Node* in1, Node* in2) : CmpNode(in1, in2) { }
213   virtual int Opcode() const;
214   virtual const Type* sub(const Type*, const Type*) const;
215 };
216 
217 //------------------------------CmpL3Node--------------------------------------
218 // Compare 2 long values, returning integer value (-1, 0 or 1).
219 class CmpL3Node : public CmpLNode {
220 public:
221   CmpL3Node( Node *in1, Node *in2 ) : CmpLNode(in1,in2) {
222     // Since it is not consumed by Bools, it is not really a Cmp.
223     init_class_id(Class_Sub);
224   }
225   virtual int    Opcode() const;
226   virtual uint ideal_reg() const { return Op_RegI; }
227 };
228 
229 //------------------------------CmpFNode---------------------------------------
230 // Compare 2 float values, returning condition codes (-1, 0 or 1).
231 // This implements the Java bytecode fcmpl, so unordered returns -1.
232 // Operands may not commute.
233 class CmpFNode : public CmpNode {
234 public:
235   CmpFNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
236   virtual int Opcode() const;
237   virtual const Type *sub( const Type *, const Type * ) const { ShouldNotReachHere(); return NULL; }
238   const Type* Value(PhaseGVN* phase) const;
239 };
240 
241 //------------------------------CmpF3Node--------------------------------------
242 // Compare 2 float values, returning integer value (-1, 0 or 1).
243 // This implements the Java bytecode fcmpl, so unordered returns -1.
244 // Operands may not commute.
245 class CmpF3Node : public CmpFNode {
246 public:
247   CmpF3Node( Node *in1, Node *in2 ) : CmpFNode(in1,in2) {
248     // Since it is not consumed by Bools, it is not really a Cmp.
249     init_class_id(Class_Sub);
250   }
251   virtual int Opcode() const;
252   // Since it is not consumed by Bools, it is not really a Cmp.
253   virtual uint ideal_reg() const { return Op_RegI; }
254 };
255 
256 
257 //------------------------------CmpDNode---------------------------------------
258 // Compare 2 double values, returning condition codes (-1, 0 or 1).
259 // This implements the Java bytecode dcmpl, so unordered returns -1.
260 // Operands may not commute.
261 class CmpDNode : public CmpNode {
262 public:
263   CmpDNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
264   virtual int Opcode() const;
265   virtual const Type *sub( const Type *, const Type * ) const { ShouldNotReachHere(); return NULL; }
266   const Type* Value(PhaseGVN* phase) const;
267   virtual Node  *Ideal(PhaseGVN *phase, bool can_reshape);
268 };
269 
270 //------------------------------CmpD3Node--------------------------------------
271 // Compare 2 double values, returning integer value (-1, 0 or 1).
272 // This implements the Java bytecode dcmpl, so unordered returns -1.
273 // Operands may not commute.
274 class CmpD3Node : public CmpDNode {
275 public:
276   CmpD3Node( Node *in1, Node *in2 ) : CmpDNode(in1,in2) {
277     // Since it is not consumed by Bools, it is not really a Cmp.
278     init_class_id(Class_Sub);
279   }
280   virtual int Opcode() const;
281   virtual uint ideal_reg() const { return Op_RegI; }
282 };
283 
284 //--------------------------FlatArrayCheckNode---------------------------------
285 // Returns true if one of the input array objects or array klass ptrs (there
286 // can be multiple) is flat.
287 class FlatArrayCheckNode : public CmpNode {
288 public:
289   enum {
290     Control,
291     Memory,
292     ArrayOrKlass
293   };
294   FlatArrayCheckNode(Compile* C, Node* mem, Node* array_or_klass) : CmpNode(mem, array_or_klass) {
295     init_class_id(Class_FlatArrayCheck);
296     init_flags(Flag_is_macro);
297     C->add_macro_node(this);
298   }
299   virtual int Opcode() const;
300   virtual const Type* sub(const Type*, const Type*) const { ShouldNotReachHere(); return NULL; }
301   const Type* Value(PhaseGVN* phase) const;
302   virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
303 };
304 
305 //------------------------------BoolTest---------------------------------------
306 // Convert condition codes to a boolean test value (0 or -1).
307 // We pick the values as 3 bits; the low order 2 bits we compare against the
308 // condition codes, the high bit flips the sense of the result.
309 // For vector compares, additionally, the 4th bit indicates if the compare is unsigned
310 struct BoolTest {
311   enum mask { eq = 0, ne = 4, le = 5, ge = 7, lt = 3, gt = 1, overflow = 2, no_overflow = 6, never = 8, illegal = 9,
312               // The following values are used with vector compares
313               // A BoolTest value should not be constructed for such values
314               unsigned_compare = 16,
315               ule = unsigned_compare | le, uge = unsigned_compare | ge, ult = unsigned_compare | lt, ugt = unsigned_compare | gt };
316   mask _test;
317   BoolTest( mask btm ) : _test(btm) { assert((btm & unsigned_compare) == 0, "unsupported");}
318   const Type *cc2logical( const Type *CC ) const;
319   // Commute the test.  I use a small table lookup.  The table is created as
320   // a simple char array where each element is the ASCII version of a 'mask'
321   // enum from above.
322   mask commute( ) const { return mask("032147658"[_test]-'0'); }
323   mask negate( ) const { return mask(_test^4); }
324   bool is_canonical( ) const { return (_test == BoolTest::ne || _test == BoolTest::lt || _test == BoolTest::le || _test == BoolTest::overflow); }
325   bool is_less( )  const { return _test == BoolTest::lt || _test == BoolTest::le; }
326   bool is_greater( ) const { return _test == BoolTest::gt || _test == BoolTest::ge; }
327   void dump_on(outputStream *st) const;
328   mask merge(BoolTest other) const;
329 };
330 
331 //------------------------------BoolNode---------------------------------------
332 // A Node to convert a Condition Codes to a Logical result.
333 class BoolNode : public Node {
334   virtual uint hash() const;
335   virtual bool cmp( const Node &n ) const;
336   virtual uint size_of() const;
337 
338   // Try to optimize signed integer comparison
339   Node* fold_cmpI(PhaseGVN* phase, SubNode* cmp, Node* cmp1, int cmp_op,
340                   int cmp1_op, const TypeInt* cmp2_type);
341 public:
342   const BoolTest _test;
343   BoolNode(Node *cc, BoolTest::mask t): Node(NULL,cc), _test(t) {
344     init_class_id(Class_Bool);
345   }
346   // Convert an arbitrary int value to a Bool or other suitable predicate.
347   static Node* make_predicate(Node* test_value, PhaseGVN* phase);
348   // Convert self back to an integer value.
349   Node* as_int_value(PhaseGVN* phase);
350   // Invert sense of self, returning new Bool.
351   BoolNode* negate(PhaseGVN* phase);
352   virtual int Opcode() const;
353   virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
354   virtual const Type* Value(PhaseGVN* phase) const;
355   virtual const Type *bottom_type() const { return TypeInt::BOOL; }
356   uint match_edge(uint idx) const { return 0; }
357   virtual uint ideal_reg() const { return Op_RegI; }
358 
359   bool is_counted_loop_exit_test();
360 #ifndef PRODUCT
361   virtual void dump_spec(outputStream *st) const;
362   virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
363 #endif
364 };
365 
366 //------------------------------AbsNode----------------------------------------
367 // Abstract class for absolute value.  Mostly used to get a handy wrapper
368 // for finding this pattern in the graph.
369 class AbsNode : public Node {
370 public:
371   AbsNode( Node *value ) : Node(0,value) {}
372   virtual Node* Identity(PhaseGVN* phase);
373   virtual Node* Ideal(PhaseGVN* phase, bool can_reshape);
374   virtual const Type* Value(PhaseGVN* phase) const;
375 };
376 
377 //------------------------------AbsINode---------------------------------------
378 // Absolute value an integer.  Since a naive graph involves control flow, we
379 // "match" it in the ideal world (so the control flow can be removed).
380 class AbsINode : public AbsNode {
381 public:
382   AbsINode( Node *in1 ) : AbsNode(in1) {}
383   virtual int Opcode() const;
384   const Type *bottom_type() const { return TypeInt::INT; }
385   virtual uint ideal_reg() const { return Op_RegI; }
386 };
387 
388 //------------------------------AbsLNode---------------------------------------
389 // Absolute value a long.  Since a naive graph involves control flow, we
390 // "match" it in the ideal world (so the control flow can be removed).
391 class AbsLNode : public AbsNode {
392 public:
393   AbsLNode( Node *in1 ) : AbsNode(in1) {}
394   virtual int Opcode() const;
395   const Type *bottom_type() const { return TypeLong::LONG; }
396   virtual uint ideal_reg() const { return Op_RegL; }
397 };
398 
399 //------------------------------AbsFNode---------------------------------------
400 // Absolute value a float, a common float-point idiom with a cheap hardware
401 // implemention on most chips.  Since a naive graph involves control flow, we
402 // "match" it in the ideal world (so the control flow can be removed).
403 class AbsFNode : public AbsNode {
404 public:
405   AbsFNode( Node *in1 ) : AbsNode(in1) {}
406   virtual int Opcode() const;
407   const Type *bottom_type() const { return Type::FLOAT; }
408   virtual uint ideal_reg() const { return Op_RegF; }
409 };
410 
411 //------------------------------AbsDNode---------------------------------------
412 // Absolute value a double, a common float-point idiom with a cheap hardware
413 // implemention on most chips.  Since a naive graph involves control flow, we
414 // "match" it in the ideal world (so the control flow can be removed).
415 class AbsDNode : public AbsNode {
416 public:
417   AbsDNode( Node *in1 ) : AbsNode(in1) {}
418   virtual int Opcode() const;
419   const Type *bottom_type() const { return Type::DOUBLE; }
420   virtual uint ideal_reg() const { return Op_RegD; }
421 };
422 
423 
424 //------------------------------CmpLTMaskNode----------------------------------
425 // If p < q, return -1 else return 0.  Nice for flow-free idioms.
426 class CmpLTMaskNode : public Node {
427 public:
428   CmpLTMaskNode( Node *p, Node *q ) : Node(0, p, q) {}
429   virtual int Opcode() const;
430   const Type *bottom_type() const { return TypeInt::INT; }
431   virtual uint ideal_reg() const { return Op_RegI; }
432 };
433 
434 
435 //------------------------------NegNode----------------------------------------
436 class NegNode : public Node {
437 public:
438   NegNode( Node *in1 ) : Node(0,in1) {}
439 };
440 
441 //------------------------------NegINode---------------------------------------
442 // Negate value an int.  For int values, negation is the same as subtraction
443 // from zero
444 class NegINode : public NegNode {
445 public:
446   NegINode(Node *in1) : NegNode(in1) {}
447   virtual int Opcode() const;
448   const Type *bottom_type() const { return TypeInt::INT; }
449   virtual uint ideal_reg() const { return Op_RegI; }
450 };
451 
452 //------------------------------NegLNode---------------------------------------
453 // Negate value an int.  For int values, negation is the same as subtraction
454 // from zero
455 class NegLNode : public NegNode {
456 public:
457   NegLNode(Node *in1) : NegNode(in1) {}
458   virtual int Opcode() const;
459   const Type *bottom_type() const { return TypeLong::LONG; }
460   virtual uint ideal_reg() const { return Op_RegL; }
461 };
462 
463 //------------------------------NegFNode---------------------------------------
464 // Negate value a float.  Negating 0.0 returns -0.0, but subtracting from
465 // zero returns +0.0 (per JVM spec on 'fneg' bytecode).  As subtraction
466 // cannot be used to replace negation we have to implement negation as ideal
467 // node; note that negation and addition can replace subtraction.
468 class NegFNode : public NegNode {
469 public:
470   NegFNode( Node *in1 ) : NegNode(in1) {}
471   virtual int Opcode() const;
472   const Type *bottom_type() const { return Type::FLOAT; }
473   virtual uint ideal_reg() const { return Op_RegF; }
474 };
475 
476 //------------------------------NegDNode---------------------------------------
477 // Negate value a double.  Negating 0.0 returns -0.0, but subtracting from
478 // zero returns +0.0 (per JVM spec on 'dneg' bytecode).  As subtraction
479 // cannot be used to replace negation we have to implement negation as ideal
480 // node; note that negation and addition can replace subtraction.
481 class NegDNode : public NegNode {
482 public:
483   NegDNode( Node *in1 ) : NegNode(in1) {}
484   virtual int Opcode() const;
485   const Type *bottom_type() const { return Type::DOUBLE; }
486   virtual uint ideal_reg() const { return Op_RegD; }
487 };
488 
489 //------------------------------AtanDNode--------------------------------------
490 // arcus tangens of a double
491 class AtanDNode : public Node {
492 public:
493   AtanDNode(Node *c, Node *in1, Node *in2  ) : Node(c, in1, in2) {}
494   virtual int Opcode() const;
495   const Type *bottom_type() const { return Type::DOUBLE; }
496   virtual uint ideal_reg() const { return Op_RegD; }
497 };
498 
499 
500 //------------------------------SqrtDNode--------------------------------------
501 // square root a double
502 class SqrtDNode : public Node {
503 public:
504   SqrtDNode(Compile* C, Node *c, Node *in1) : Node(c, in1) {
505     init_flags(Flag_is_expensive);
506     C->add_expensive_node(this);
507   }
508   virtual int Opcode() const;
509   const Type *bottom_type() const { return Type::DOUBLE; }
510   virtual uint ideal_reg() const { return Op_RegD; }
511   virtual const Type* Value(PhaseGVN* phase) const;
512 };
513 
514 //------------------------------SqrtFNode--------------------------------------
515 // square root a float
516 class SqrtFNode : public Node {
517 public:
518   SqrtFNode(Compile* C, Node *c, Node *in1) : Node(c, in1) {
519     init_flags(Flag_is_expensive);
520     if (c != NULL) {
521       // Treat node only as expensive if a control input is set because it might
522       // be created from a SqrtDNode in ConvD2FNode::Ideal() that was found to
523       // be unique and therefore has no control input.
524       C->add_expensive_node(this);
525     }
526   }
527   virtual int Opcode() const;
528   const Type *bottom_type() const { return Type::FLOAT; }
529   virtual uint ideal_reg() const { return Op_RegF; }
530   virtual const Type* Value(PhaseGVN* phase) const;
531 };
532 
533 //-------------------------------ReverseBytesINode--------------------------------
534 // reverse bytes of an integer
535 class ReverseBytesINode : public Node {
536 public:
537   ReverseBytesINode(Node *c, Node *in1) : Node(c, in1) {}
538   virtual int Opcode() const;
539   const Type *bottom_type() const { return TypeInt::INT; }
540   virtual uint ideal_reg() const { return Op_RegI; }
541 };
542 
543 //-------------------------------ReverseBytesLNode--------------------------------
544 // reverse bytes of a long
545 class ReverseBytesLNode : public Node {
546 public:
547   ReverseBytesLNode(Node *c, Node *in1) : Node(c, in1) {}
548   virtual int Opcode() const;
549   const Type *bottom_type() const { return TypeLong::LONG; }
550   virtual uint ideal_reg() const { return Op_RegL; }
551 };
552 
553 //-------------------------------ReverseBytesUSNode--------------------------------
554 // reverse bytes of an unsigned short / char
555 class ReverseBytesUSNode : public Node {
556 public:
557   ReverseBytesUSNode(Node *c, Node *in1) : Node(c, in1) {}
558   virtual int Opcode() const;
559   const Type *bottom_type() const { return TypeInt::CHAR; }
560   virtual uint ideal_reg() const { return Op_RegI; }
561 };
562 
563 //-------------------------------ReverseBytesSNode--------------------------------
564 // reverse bytes of a short
565 class ReverseBytesSNode : public Node {
566 public:
567   ReverseBytesSNode(Node *c, Node *in1) : Node(c, in1) {}
568   virtual int Opcode() const;
569   const Type *bottom_type() const { return TypeInt::SHORT; }
570   virtual uint ideal_reg() const { return Op_RegI; }
571 };
572 
573 #endif // SHARE_OPTO_SUBNODE_HPP
--- EOF ---