subnode.hpp revision 1472:c18cbe5936b8
1238106Sdes/*
2238106Sdes * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
3238106Sdes * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4238106Sdes *
5238106Sdes * This code is free software; you can redistribute it and/or modify it
6238106Sdes * under the terms of the GNU General Public License version 2 only, as
7238106Sdes * published by the Free Software Foundation.
8238106Sdes *
9238106Sdes * This code is distributed in the hope that it will be useful, but WITHOUT
10238106Sdes * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11238106Sdes * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12238106Sdes * version 2 for more details (a copy is included in the LICENSE file that
13238106Sdes * accompanied this code).
14238106Sdes *
15238106Sdes * You should have received a copy of the GNU General Public License version
16238106Sdes * 2 along with this work; if not, write to the Free Software Foundation,
17238106Sdes * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18238106Sdes *
19238106Sdes * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20238106Sdes * or visit www.oracle.com if you need additional information or have any
21238106Sdes * questions.
22238106Sdes *
23238106Sdes */
24269257Sdes
25269257Sdes// Portions of code courtesy of Clifford Click
26269257Sdes
27269257Sdes//------------------------------SUBNode----------------------------------------
28269257Sdes// Class SUBTRACTION functionality.  This covers all the usual 'subtract'
29269257Sdes// behaviors.  Subtract-integer, -float, -double, binary xor, compare-integer,
30269257Sdes// -float, and -double are all inherited from this class.  The compare
31269257Sdes// functions behave like subtract functions, except that all negative answers
32269257Sdes// are compressed into -1, and all positive answers compressed to 1.
33269257Sdesclass SubNode : public Node {
34238106Sdespublic:
35238106Sdes  SubNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {
36238106Sdes    init_class_id(Class_Sub);
37238106Sdes  }
38238106Sdes
39238106Sdes  // Handle algebraic identities here.  If we have an identity, return the Node
40238106Sdes  // we are equivalent to.  We look for "add of zero" as an identity.
41238106Sdes  virtual Node *Identity( PhaseTransform *phase );
42238106Sdes
43238106Sdes  // Compute a new Type for this node.  Basically we just do the pre-check,
44238106Sdes  // then call the virtual add() to set the type.
45238106Sdes  virtual const Type *Value( PhaseTransform *phase ) const;
46238106Sdes
47238106Sdes  // Supplied function returns the subtractend of the inputs.
48238106Sdes  // This also type-checks the inputs for sanity.  Guaranteed never to
49238106Sdes  // be passed a TOP or BOTTOM type, these are filtered out by a pre-check.
50238106Sdes  virtual const Type *sub( const Type *, const Type * ) const = 0;
51238106Sdes
52238106Sdes  // Supplied function to return the additive identity type.
53238106Sdes  // This is returned whenever the subtracts inputs are the same.
54238106Sdes  virtual const Type *add_id() const = 0;
55238106Sdes
56238106Sdes};
57238106Sdes
58238106Sdes
59238106Sdes// NOTE: SubINode should be taken away and replaced by add and negate
60238106Sdes//------------------------------SubINode---------------------------------------
61238106Sdes// Subtract 2 integers
62238106Sdesclass SubINode : public SubNode {
63238106Sdespublic:
64238106Sdes  SubINode( Node *in1, Node *in2 ) : SubNode(in1,in2) {}
65238106Sdes  virtual int Opcode() const;
66238106Sdes  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
67238106Sdes  virtual const Type *sub( const Type *, const Type * ) const;
68238106Sdes  const Type *add_id() const { return TypeInt::ZERO; }
69238106Sdes  const Type *bottom_type() const { return TypeInt::INT; }
70238106Sdes  virtual uint ideal_reg() const { return Op_RegI; }
71238106Sdes};
72238106Sdes
73238106Sdes//------------------------------SubLNode---------------------------------------
74238106Sdes// Subtract 2 integers
75238106Sdesclass SubLNode : public SubNode {
76269257Sdespublic:
77238106Sdes  SubLNode( Node *in1, Node *in2 ) : SubNode(in1,in2) {}
78238106Sdes  virtual int Opcode() const;
79238106Sdes  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
80238106Sdes  virtual const Type *sub( const Type *, const Type * ) const;
81238106Sdes  const Type *add_id() const { return TypeLong::ZERO; }
82238106Sdes  const Type *bottom_type() const { return TypeLong::LONG; }
83238106Sdes  virtual uint ideal_reg() const { return Op_RegL; }
84238106Sdes};
85238106Sdes
86238106Sdes// NOTE: SubFPNode should be taken away and replaced by add and negate
87238106Sdes//------------------------------SubFPNode--------------------------------------
88238106Sdes// Subtract 2 floats or doubles
89238106Sdesclass SubFPNode : public SubNode {
90238106Sdesprotected:
91238106Sdes  SubFPNode( Node *in1, Node *in2 ) : SubNode(in1,in2) {}
92238106Sdespublic:
93238106Sdes  const Type *Value( PhaseTransform *phase ) const;
94238106Sdes};
95238106Sdes
96238106Sdes// NOTE: SubFNode should be taken away and replaced by add and negate
97238106Sdes//------------------------------SubFNode---------------------------------------
98238106Sdes// Subtract 2 doubles
99238106Sdesclass SubFNode : public SubFPNode {
100238106Sdespublic:
101238106Sdes  SubFNode( Node *in1, Node *in2 ) : SubFPNode(in1,in2) {}
102238106Sdes  virtual int Opcode() const;
103238106Sdes  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
104238106Sdes  virtual const Type *sub( const Type *, const Type * ) const;
105238106Sdes  const Type   *add_id() const { return TypeF::ZERO; }
106238106Sdes  const Type   *bottom_type() const { return Type::FLOAT; }
107238106Sdes  virtual uint  ideal_reg() const { return Op_RegF; }
108238106Sdes};
109238106Sdes
110238106Sdes// NOTE: SubDNode should be taken away and replaced by add and negate
111238106Sdes//------------------------------SubDNode---------------------------------------
112238106Sdes// Subtract 2 doubles
113238106Sdesclass SubDNode : public SubFPNode {
114238106Sdespublic:
115238106Sdes  SubDNode( Node *in1, Node *in2 ) : SubFPNode(in1,in2) {}
116238106Sdes  virtual int Opcode() const;
117238106Sdes  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
118238106Sdes  virtual const Type *sub( const Type *, const Type * ) const;
119238106Sdes  const Type   *add_id() const { return TypeD::ZERO; }
120238106Sdes  const Type   *bottom_type() const { return Type::DOUBLE; }
121238106Sdes  virtual uint  ideal_reg() const { return Op_RegD; }
122238106Sdes};
123238106Sdes
124238106Sdes//------------------------------CmpNode---------------------------------------
125238106Sdes// Compare 2 values, returning condition codes (-1, 0 or 1).
126238106Sdesclass CmpNode : public SubNode {
127238106Sdespublic:
128238106Sdes  CmpNode( Node *in1, Node *in2 ) : SubNode(in1,in2) {
129238106Sdes    init_class_id(Class_Cmp);
130238106Sdes  }
131238106Sdes  virtual Node *Identity( PhaseTransform *phase );
132238106Sdes  const Type *add_id() const { return TypeInt::ZERO; }
133238106Sdes  const Type *bottom_type() const { return TypeInt::CC; }
134238106Sdes  virtual uint ideal_reg() const { return Op_RegFlags; }
135238106Sdes};
136238106Sdes
137238106Sdes//------------------------------CmpINode---------------------------------------
138238106Sdes// Compare 2 signed values, returning condition codes (-1, 0 or 1).
139238106Sdesclass CmpINode : public CmpNode {
140238106Sdespublic:
141238106Sdes  CmpINode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
142238106Sdes  virtual int Opcode() const;
143238106Sdes  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
144238106Sdes  virtual const Type *sub( const Type *, const Type * ) const;
145238106Sdes};
146238106Sdes
147238106Sdes//------------------------------CmpUNode---------------------------------------
148238106Sdes// Compare 2 unsigned values (integer or pointer), returning condition codes (-1, 0 or 1).
149238106Sdesclass CmpUNode : public CmpNode {
150238106Sdespublic:
151238106Sdes  CmpUNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
152238106Sdes  virtual int Opcode() const;
153238106Sdes  virtual const Type *sub( const Type *, const Type * ) const;
154238106Sdes};
155238106Sdes
156238106Sdes//------------------------------CmpPNode---------------------------------------
157238106Sdes// Compare 2 pointer values, returning condition codes (-1, 0 or 1).
158238106Sdesclass CmpPNode : public CmpNode {
159238106Sdespublic:
160238106Sdes  CmpPNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
161238106Sdes  virtual int Opcode() const;
162238106Sdes  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
163238106Sdes  virtual const Type *sub( const Type *, const Type * ) const;
164238106Sdes};
165238106Sdes
166238106Sdes//------------------------------CmpNNode--------------------------------------
167238106Sdes// Compare 2 narrow oop values, returning condition codes (-1, 0 or 1).
168238106Sdesclass CmpNNode : public CmpNode {
169238106Sdespublic:
170238106Sdes  CmpNNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
171238106Sdes  virtual int Opcode() const;
172238106Sdes  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
173238106Sdes  virtual const Type *sub( const Type *, const Type * ) const;
174238106Sdes};
175238106Sdes
176238106Sdes//------------------------------CmpLNode---------------------------------------
177238106Sdes// Compare 2 long values, returning condition codes (-1, 0 or 1).
178238106Sdesclass CmpLNode : public CmpNode {
179238106Sdespublic:
180238106Sdes  CmpLNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
181238106Sdes  virtual int    Opcode() const;
182238106Sdes  virtual const Type *sub( const Type *, const Type * ) const;
183};
184
185//------------------------------CmpL3Node--------------------------------------
186// Compare 2 long values, returning integer value (-1, 0 or 1).
187class CmpL3Node : public CmpLNode {
188public:
189  CmpL3Node( Node *in1, Node *in2 ) : CmpLNode(in1,in2) {
190    // Since it is not consumed by Bools, it is not really a Cmp.
191    init_class_id(Class_Sub);
192  }
193  virtual int    Opcode() const;
194  virtual uint ideal_reg() const { return Op_RegI; }
195};
196
197//------------------------------CmpFNode---------------------------------------
198// Compare 2 float values, returning condition codes (-1, 0 or 1).
199// This implements the Java bytecode fcmpl, so unordered returns -1.
200// Operands may not commute.
201class CmpFNode : public CmpNode {
202public:
203  CmpFNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
204  virtual int Opcode() const;
205  virtual const Type *sub( const Type *, const Type * ) const { ShouldNotReachHere(); return NULL; }
206  const Type *Value( PhaseTransform *phase ) const;
207};
208
209//------------------------------CmpF3Node--------------------------------------
210// Compare 2 float values, returning integer value (-1, 0 or 1).
211// This implements the Java bytecode fcmpl, so unordered returns -1.
212// Operands may not commute.
213class CmpF3Node : public CmpFNode {
214public:
215  CmpF3Node( Node *in1, Node *in2 ) : CmpFNode(in1,in2) {
216    // Since it is not consumed by Bools, it is not really a Cmp.
217    init_class_id(Class_Sub);
218  }
219  virtual int Opcode() const;
220  // Since it is not consumed by Bools, it is not really a Cmp.
221  virtual uint ideal_reg() const { return Op_RegI; }
222};
223
224
225//------------------------------CmpDNode---------------------------------------
226// Compare 2 double values, returning condition codes (-1, 0 or 1).
227// This implements the Java bytecode dcmpl, so unordered returns -1.
228// Operands may not commute.
229class CmpDNode : public CmpNode {
230public:
231  CmpDNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
232  virtual int Opcode() const;
233  virtual const Type *sub( const Type *, const Type * ) const { ShouldNotReachHere(); return NULL; }
234  const Type *Value( PhaseTransform *phase ) const;
235  virtual Node  *Ideal(PhaseGVN *phase, bool can_reshape);
236};
237
238//------------------------------CmpD3Node--------------------------------------
239// Compare 2 double values, returning integer value (-1, 0 or 1).
240// This implements the Java bytecode dcmpl, so unordered returns -1.
241// Operands may not commute.
242class CmpD3Node : public CmpDNode {
243public:
244  CmpD3Node( Node *in1, Node *in2 ) : CmpDNode(in1,in2) {
245    // Since it is not consumed by Bools, it is not really a Cmp.
246    init_class_id(Class_Sub);
247  }
248  virtual int Opcode() const;
249  virtual uint ideal_reg() const { return Op_RegI; }
250};
251
252
253//------------------------------BoolTest---------------------------------------
254// Convert condition codes to a boolean test value (0 or -1).
255// We pick the values as 3 bits; the low order 2 bits we compare against the
256// condition codes, the high bit flips the sense of the result.
257struct BoolTest VALUE_OBJ_CLASS_SPEC {
258  enum mask { eq = 0, ne = 4, le = 5, ge = 7, lt = 3, gt = 1, illegal = 8 };
259  mask _test;
260  BoolTest( mask btm ) : _test(btm) {}
261  const Type *cc2logical( const Type *CC ) const;
262  // Commute the test.  I use a small table lookup.  The table is created as
263  // a simple char array where each element is the ASCII version of a 'mask'
264  // enum from above.
265  mask commute( ) const { return mask("038147858"[_test]-'0'); }
266  mask negate( ) const { return mask(_test^4); }
267  bool is_canonical( ) const { return (_test == BoolTest::ne || _test == BoolTest::lt || _test == BoolTest::le); }
268#ifndef PRODUCT
269  void dump_on(outputStream *st) const;
270#endif
271};
272
273//------------------------------BoolNode---------------------------------------
274// A Node to convert a Condition Codes to a Logical result.
275class BoolNode : public Node {
276  virtual uint hash() const;
277  virtual uint cmp( const Node &n ) const;
278  virtual uint size_of() const;
279public:
280  const BoolTest _test;
281  BoolNode( Node *cc, BoolTest::mask t): _test(t), Node(0,cc) {
282    init_class_id(Class_Bool);
283  }
284  // Convert an arbitrary int value to a Bool or other suitable predicate.
285  static Node* make_predicate(Node* test_value, PhaseGVN* phase);
286  // Convert self back to an integer value.
287  Node* as_int_value(PhaseGVN* phase);
288  // Invert sense of self, returning new Bool.
289  BoolNode* negate(PhaseGVN* phase);
290  virtual int Opcode() const;
291  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
292  virtual const Type *Value( PhaseTransform *phase ) const;
293  virtual const Type *bottom_type() const { return TypeInt::BOOL; }
294  uint match_edge(uint idx) const { return 0; }
295  virtual uint ideal_reg() const { return Op_RegI; }
296
297  bool is_counted_loop_exit_test();
298#ifndef PRODUCT
299  virtual void dump_spec(outputStream *st) const;
300#endif
301};
302
303//------------------------------AbsNode----------------------------------------
304// Abstract class for absolute value.  Mostly used to get a handy wrapper
305// for finding this pattern in the graph.
306class AbsNode : public Node {
307public:
308  AbsNode( Node *value ) : Node(0,value) {}
309};
310
311//------------------------------AbsINode---------------------------------------
312// Absolute value an integer.  Since a naive graph involves control flow, we
313// "match" it in the ideal world (so the control flow can be removed).
314class AbsINode : public AbsNode {
315public:
316  AbsINode( Node *in1 ) : AbsNode(in1) {}
317  virtual int Opcode() const;
318  const Type *bottom_type() const { return TypeInt::INT; }
319  virtual uint ideal_reg() const { return Op_RegI; }
320};
321
322//------------------------------AbsFNode---------------------------------------
323// Absolute value a float, a common float-point idiom with a cheap hardware
324// implemention on most chips.  Since a naive graph involves control flow, we
325// "match" it in the ideal world (so the control flow can be removed).
326class AbsFNode : public AbsNode {
327public:
328  AbsFNode( Node *in1 ) : AbsNode(in1) {}
329  virtual int Opcode() const;
330  const Type *bottom_type() const { return Type::FLOAT; }
331  virtual uint ideal_reg() const { return Op_RegF; }
332};
333
334//------------------------------AbsDNode---------------------------------------
335// Absolute value a double, a common float-point idiom with a cheap hardware
336// implemention on most chips.  Since a naive graph involves control flow, we
337// "match" it in the ideal world (so the control flow can be removed).
338class AbsDNode : public AbsNode {
339public:
340  AbsDNode( Node *in1 ) : AbsNode(in1) {}
341  virtual int Opcode() const;
342  const Type *bottom_type() const { return Type::DOUBLE; }
343  virtual uint ideal_reg() const { return Op_RegD; }
344};
345
346
347//------------------------------CmpLTMaskNode----------------------------------
348// If p < q, return -1 else return 0.  Nice for flow-free idioms.
349class CmpLTMaskNode : public Node {
350public:
351  CmpLTMaskNode( Node *p, Node *q ) : Node(0, p, q) {}
352  virtual int Opcode() const;
353  const Type *bottom_type() const { return TypeInt::INT; }
354  virtual uint ideal_reg() const { return Op_RegI; }
355};
356
357
358//------------------------------NegNode----------------------------------------
359class NegNode : public Node {
360public:
361  NegNode( Node *in1 ) : Node(0,in1) {}
362};
363
364//------------------------------NegFNode---------------------------------------
365// Negate value a float.  Negating 0.0 returns -0.0, but subtracting from
366// zero returns +0.0 (per JVM spec on 'fneg' bytecode).  As subtraction
367// cannot be used to replace negation we have to implement negation as ideal
368// node; note that negation and addition can replace subtraction.
369class NegFNode : public NegNode {
370public:
371  NegFNode( Node *in1 ) : NegNode(in1) {}
372  virtual int Opcode() const;
373  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
374  const Type *bottom_type() const { return Type::FLOAT; }
375  virtual uint ideal_reg() const { return Op_RegF; }
376};
377
378//------------------------------NegDNode---------------------------------------
379// Negate value a double.  Negating 0.0 returns -0.0, but subtracting from
380// zero returns +0.0 (per JVM spec on 'dneg' bytecode).  As subtraction
381// cannot be used to replace negation we have to implement negation as ideal
382// node; note that negation and addition can replace subtraction.
383class NegDNode : public NegNode {
384public:
385  NegDNode( Node *in1 ) : NegNode(in1) {}
386  virtual int Opcode() const;
387  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
388  const Type *bottom_type() const { return Type::DOUBLE; }
389  virtual uint ideal_reg() const { return Op_RegD; }
390};
391
392//------------------------------CosDNode---------------------------------------
393// Cosinus of a double
394class CosDNode : public Node {
395public:
396  CosDNode( Node *in1  ) : Node(0, in1) {}
397  virtual int Opcode() const;
398  const Type *bottom_type() const { return Type::DOUBLE; }
399  virtual uint ideal_reg() const { return Op_RegD; }
400  virtual const Type *Value( PhaseTransform *phase ) const;
401};
402
403//------------------------------CosDNode---------------------------------------
404// Sinus of a double
405class SinDNode : public Node {
406public:
407  SinDNode( Node *in1  ) : Node(0, in1) {}
408  virtual int Opcode() const;
409  const Type *bottom_type() const { return Type::DOUBLE; }
410  virtual uint ideal_reg() const { return Op_RegD; }
411  virtual const Type *Value( PhaseTransform *phase ) const;
412};
413
414
415//------------------------------TanDNode---------------------------------------
416// tangens of a double
417class TanDNode : public Node {
418public:
419  TanDNode(Node *in1  ) : Node(0, in1) {}
420  virtual int Opcode() const;
421  const Type *bottom_type() const { return Type::DOUBLE; }
422  virtual uint ideal_reg() const { return Op_RegD; }
423  virtual const Type *Value( PhaseTransform *phase ) const;
424};
425
426
427//------------------------------AtanDNode--------------------------------------
428// arcus tangens of a double
429class AtanDNode : public Node {
430public:
431  AtanDNode(Node *c, Node *in1, Node *in2  ) : Node(c, in1, in2) {}
432  virtual int Opcode() const;
433  const Type *bottom_type() const { return Type::DOUBLE; }
434  virtual uint ideal_reg() const { return Op_RegD; }
435};
436
437
438//------------------------------SqrtDNode--------------------------------------
439// square root a double
440class SqrtDNode : public Node {
441public:
442  SqrtDNode(Node *c, Node *in1  ) : Node(c, in1) {}
443  virtual int Opcode() const;
444  const Type *bottom_type() const { return Type::DOUBLE; }
445  virtual uint ideal_reg() const { return Op_RegD; }
446  virtual const Type *Value( PhaseTransform *phase ) const;
447};
448
449//------------------------------ExpDNode---------------------------------------
450//  Exponentiate a double
451class ExpDNode : public Node {
452public:
453  ExpDNode( Node *c, Node *in1 ) : Node(c, in1) {}
454  virtual int Opcode() const;
455  const Type *bottom_type() const { return Type::DOUBLE; }
456  virtual uint ideal_reg() const { return Op_RegD; }
457  virtual const Type *Value( PhaseTransform *phase ) const;
458};
459
460//------------------------------LogDNode---------------------------------------
461// Log_e of a double
462class LogDNode : public Node {
463public:
464  LogDNode( Node *in1 ) : Node(0, in1) {}
465  virtual int Opcode() const;
466  const Type *bottom_type() const { return Type::DOUBLE; }
467  virtual uint ideal_reg() const { return Op_RegD; }
468  virtual const Type *Value( PhaseTransform *phase ) const;
469};
470
471//------------------------------Log10DNode---------------------------------------
472// Log_10 of a double
473class Log10DNode : public Node {
474public:
475  Log10DNode( Node *in1 ) : Node(0, in1) {}
476  virtual int Opcode() const;
477  const Type *bottom_type() const { return Type::DOUBLE; }
478  virtual uint ideal_reg() const { return Op_RegD; }
479  virtual const Type *Value( PhaseTransform *phase ) const;
480};
481
482//------------------------------PowDNode---------------------------------------
483// Raise a double to a double power
484class PowDNode : public Node {
485public:
486  PowDNode(Node *c, Node *in1, Node *in2  ) : Node(c, in1, in2) {}
487  virtual int Opcode() const;
488  const Type *bottom_type() const { return Type::DOUBLE; }
489  virtual uint ideal_reg() const { return Op_RegD; }
490  virtual const Type *Value( PhaseTransform *phase ) const;
491};
492
493//-------------------------------ReverseBytesINode--------------------------------
494// reverse bytes of an integer
495class ReverseBytesINode : public Node {
496public:
497  ReverseBytesINode(Node *c, Node *in1) : Node(c, in1) {}
498  virtual int Opcode() const;
499  const Type *bottom_type() const { return TypeInt::INT; }
500  virtual uint ideal_reg() const { return Op_RegI; }
501};
502
503//-------------------------------ReverseBytesLNode--------------------------------
504// reverse bytes of a long
505class ReverseBytesLNode : public Node {
506public:
507  ReverseBytesLNode(Node *c, Node *in1) : Node(c, in1) {}
508  virtual int Opcode() const;
509  const Type *bottom_type() const { return TypeLong::LONG; }
510  virtual uint ideal_reg() const { return Op_RegL; }
511};
512
513//-------------------------------ReverseBytesUSNode--------------------------------
514// reverse bytes of an unsigned short / char
515class ReverseBytesUSNode : public Node {
516public:
517  ReverseBytesUSNode(Node *c, Node *in1) : Node(c, in1) {}
518  virtual int Opcode() const;
519  const Type *bottom_type() const { return TypeInt::CHAR; }
520  virtual uint ideal_reg() const { return Op_RegI; }
521};
522
523//-------------------------------ReverseBytesSNode--------------------------------
524// reverse bytes of a short
525class ReverseBytesSNode : public Node {
526public:
527  ReverseBytesSNode(Node *c, Node *in1) : Node(c, in1) {}
528  virtual int Opcode() const;
529  const Type *bottom_type() const { return TypeInt::SHORT; }
530  virtual uint ideal_reg() const { return Op_RegI; }
531};
532