hotspot/src/share/vm/opto/subnode.hpp
author coleenp
Sun, 13 Apr 2008 17:43:42 -0400
changeset 360 21d113ecbf6a
parent 1 489c9b5090e2
child 670 ddf3e9583f2f
permissions -rw-r--r--
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes Summary: Compressed oops in instances, arrays, and headers. Code contributors are coleenp, phh, never, swamyv Reviewed-by: jmasa, kamg, acorn, tbell, kvn, rasbold
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
489c9b5090e2 Initial load
duke
parents:
diff changeset
     2
 * Copyright 1997-2006 Sun Microsystems, Inc.  All Rights Reserved.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    21
 * have any questions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
// Portions of code courtesy of Clifford Click
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
//------------------------------SUBNode----------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
// Class SUBTRACTION functionality.  This covers all the usual 'subtract'
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
// behaviors.  Subtract-integer, -float, -double, binary xor, compare-integer,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
// -float, and -double are all inherited from this class.  The compare
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
// functions behave like subtract functions, except that all negative answers
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
// are compressed into -1, and all positive answers compressed to 1.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
class SubNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
  SubNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
    init_class_id(Class_Sub);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
  // Handle algebraic identities here.  If we have an identity, return the Node
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
  // we are equivalent to.  We look for "add of zero" as an identity.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
  // Compute a new Type for this node.  Basically we just do the pre-check,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
  // then call the virtual add() to set the type.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  // Supplied function returns the subtractend of the inputs.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
  // This also type-checks the inputs for sanity.  Guaranteed never to
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  // be passed a TOP or BOTTOM type, these are filtered out by a pre-check.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
  virtual const Type *sub( const Type *, const Type * ) const = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
  // Supplied function to return the additive identity type.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  // This is returned whenever the subtracts inputs are the same.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  virtual const Type *add_id() const = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
// NOTE: SubINode should be taken away and replaced by add and negate
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
//------------------------------SubINode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
// Subtract 2 integers
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
class SubINode : public SubNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  SubINode( Node *in1, Node *in2 ) : SubNode(in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
  virtual const Type *sub( const Type *, const Type * ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  const Type *add_id() const { return TypeInt::ZERO; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  const Type *bottom_type() const { return TypeInt::INT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  virtual uint ideal_reg() const { return Op_RegI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
//------------------------------SubLNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
// Subtract 2 integers
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
class SubLNode : public SubNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
  SubLNode( Node *in1, Node *in2 ) : SubNode(in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
  virtual const Type *sub( const Type *, const Type * ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
  const Type *add_id() const { return TypeLong::ZERO; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  const Type *bottom_type() const { return TypeLong::LONG; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  virtual uint ideal_reg() const { return Op_RegL; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
// NOTE: SubFPNode should be taken away and replaced by add and negate
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
//------------------------------SubFPNode--------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
// Subtract 2 floats or doubles
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
class SubFPNode : public SubNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
protected:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  SubFPNode( Node *in1, Node *in2 ) : SubNode(in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
// NOTE: SubFNode should be taken away and replaced by add and negate
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
//------------------------------SubFNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
// Subtract 2 doubles
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
class SubFNode : public SubFPNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  SubFNode( Node *in1, Node *in2 ) : SubFPNode(in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
  virtual const Type *sub( const Type *, const Type * ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  const Type   *add_id() const { return TypeF::ZERO; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
  const Type   *bottom_type() const { return Type::FLOAT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
  virtual uint  ideal_reg() const { return Op_RegF; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
// NOTE: SubDNode should be taken away and replaced by add and negate
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
//------------------------------SubDNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
// Subtract 2 doubles
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
class SubDNode : public SubFPNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  SubDNode( Node *in1, Node *in2 ) : SubFPNode(in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  virtual const Type *sub( const Type *, const Type * ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  const Type   *add_id() const { return TypeD::ZERO; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
  const Type   *bottom_type() const { return Type::DOUBLE; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  virtual uint  ideal_reg() const { return Op_RegD; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
//------------------------------CmpNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
// Compare 2 values, returning condition codes (-1, 0 or 1).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
class CmpNode : public SubNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
  CmpNode( Node *in1, Node *in2 ) : SubNode(in1,in2) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
    init_class_id(Class_Cmp);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
  const Type *add_id() const { return TypeInt::ZERO; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
  const Type *bottom_type() const { return TypeInt::CC; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  virtual uint ideal_reg() const { return Op_RegFlags; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
//------------------------------CmpINode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
// Compare 2 signed values, returning condition codes (-1, 0 or 1).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
class CmpINode : public CmpNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  CmpINode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
  virtual const Type *sub( const Type *, const Type * ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
//------------------------------CmpUNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
// Compare 2 unsigned values (integer or pointer), returning condition codes (-1, 0 or 1).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
class CmpUNode : public CmpNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
  CmpUNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
  virtual const Type *sub( const Type *, const Type * ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
//------------------------------CmpPNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
// Compare 2 pointer values, returning condition codes (-1, 0 or 1).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
class CmpPNode : public CmpNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
  CmpPNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  virtual const Type *sub( const Type *, const Type * ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   166
//------------------------------CmpNNode--------------------------------------
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   167
// Compare 2 narrow oop values, returning condition codes (-1, 0 or 1).
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   168
class CmpNNode : public CmpNode {
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   169
public:
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   170
  CmpNNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   171
  virtual int Opcode() const;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   172
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   173
  virtual const Type *sub( const Type *, const Type * ) const;
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   174
};
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   175
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
//------------------------------CmpLNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
// Compare 2 long values, returning condition codes (-1, 0 or 1).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
class CmpLNode : public CmpNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
  CmpLNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
  virtual int    Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
  virtual const Type *sub( const Type *, const Type * ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
//------------------------------CmpL3Node--------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
// Compare 2 long values, returning integer value (-1, 0 or 1).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
class CmpL3Node : public CmpLNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
  CmpL3Node( Node *in1, Node *in2 ) : CmpLNode(in1,in2) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
    // Since it is not consumed by Bools, it is not really a Cmp.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
    init_class_id(Class_Sub);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
  virtual int    Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
  virtual uint ideal_reg() const { return Op_RegI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
//------------------------------CmpFNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
// Compare 2 float values, returning condition codes (-1, 0 or 1).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
// This implements the Java bytecode fcmpl, so unordered returns -1.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
// Operands may not commute.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
class CmpFNode : public CmpNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
  CmpFNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
  virtual const Type *sub( const Type *, const Type * ) const { ShouldNotReachHere(); return NULL; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
  const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
//------------------------------CmpF3Node--------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
// Compare 2 float values, returning integer value (-1, 0 or 1).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
// This implements the Java bytecode fcmpl, so unordered returns -1.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
// Operands may not commute.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
class CmpF3Node : public CmpFNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
  CmpF3Node( Node *in1, Node *in2 ) : CmpFNode(in1,in2) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
    // Since it is not consumed by Bools, it is not really a Cmp.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
    init_class_id(Class_Sub);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
  // Since it is not consumed by Bools, it is not really a Cmp.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
  virtual uint ideal_reg() const { return Op_RegI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
//------------------------------CmpDNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
// Compare 2 double values, returning condition codes (-1, 0 or 1).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
// This implements the Java bytecode dcmpl, so unordered returns -1.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
// Operands may not commute.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
class CmpDNode : public CmpNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
  CmpDNode( Node *in1, Node *in2 ) : CmpNode(in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
  virtual const Type *sub( const Type *, const Type * ) const { ShouldNotReachHere(); return NULL; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
  const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
  virtual Node  *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
//------------------------------CmpD3Node--------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
// Compare 2 double values, returning integer value (-1, 0 or 1).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
// This implements the Java bytecode dcmpl, so unordered returns -1.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
// Operands may not commute.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
class CmpD3Node : public CmpDNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
  CmpD3Node( Node *in1, Node *in2 ) : CmpDNode(in1,in2) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
    // Since it is not consumed by Bools, it is not really a Cmp.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
    init_class_id(Class_Sub);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
  virtual uint ideal_reg() const { return Op_RegI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
//------------------------------BoolTest---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
// Convert condition codes to a boolean test value (0 or -1).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
// We pick the values as 3 bits; the low order 2 bits we compare against the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
// condition codes, the high bit flips the sense of the result.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
struct BoolTest VALUE_OBJ_CLASS_SPEC {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
  enum mask { eq = 0, ne = 4, le = 5, ge = 7, lt = 3, gt = 1, illegal = 8 };
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
  mask _test;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
  BoolTest( mask btm ) : _test(btm) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
  const Type *cc2logical( const Type *CC ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
  // Commute the test.  I use a small table lookup.  The table is created as
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
  // a simple char array where each element is the ASCII version of a 'mask'
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
  // enum from above.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
  mask commute( ) const { return mask("038147858"[_test]-'0'); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
  mask negate( ) const { return mask(_test^4); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
  bool is_canonical( ) const { return (_test == BoolTest::ne || _test == BoolTest::lt || _test == BoolTest::le); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
  void dump_on(outputStream *st) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
//------------------------------BoolNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
// A Node to convert a Condition Codes to a Logical result.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
class BoolNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
  virtual uint hash() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
  virtual uint cmp( const Node &n ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
  virtual uint size_of() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
  const BoolTest _test;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
  BoolNode( Node *cc, BoolTest::mask t): _test(t), Node(0,cc) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
    init_class_id(Class_Bool);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
  // Convert an arbitrary int value to a Bool or other suitable predicate.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
  static Node* make_predicate(Node* test_value, PhaseGVN* phase);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
  // Convert self back to an integer value.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
  Node* as_int_value(PhaseGVN* phase);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
  // Invert sense of self, returning new Bool.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
  BoolNode* negate(PhaseGVN* phase);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
  virtual const Type *bottom_type() const { return TypeInt::BOOL; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
  uint match_edge(uint idx) const { return 0; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
  virtual uint ideal_reg() const { return Op_RegI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
  bool is_counted_loop_exit_test();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
  virtual void dump_spec(outputStream *st) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
//------------------------------AbsNode----------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
// Abstract class for absolute value.  Mostly used to get a handy wrapper
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
// for finding this pattern in the graph.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
class AbsNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
  AbsNode( Node *value ) : Node(0,value) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
//------------------------------AbsINode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
// Absolute value an integer.  Since a naive graph involves control flow, we
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
// "match" it in the ideal world (so the control flow can be removed).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
class AbsINode : public AbsNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
  AbsINode( Node *in1 ) : AbsNode(in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   317
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
  const Type *bottom_type() const { return TypeInt::INT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
  virtual uint ideal_reg() const { return Op_RegI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
489c9b5090e2 Initial load
duke
parents:
diff changeset
   322
//------------------------------AbsFNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
// Absolute value a float, a common float-point idiom with a cheap hardware
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
// implemention on most chips.  Since a naive graph involves control flow, we
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
// "match" it in the ideal world (so the control flow can be removed).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
class AbsFNode : public AbsNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
  AbsFNode( Node *in1 ) : AbsNode(in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
  const Type *bottom_type() const { return Type::FLOAT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
  virtual uint ideal_reg() const { return Op_RegF; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   332
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
//------------------------------AbsDNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
// Absolute value a double, a common float-point idiom with a cheap hardware
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
// implemention on most chips.  Since a naive graph involves control flow, we
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
// "match" it in the ideal world (so the control flow can be removed).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
class AbsDNode : public AbsNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
  AbsDNode( Node *in1 ) : AbsNode(in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
  const Type *bottom_type() const { return Type::DOUBLE; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
  virtual uint ideal_reg() const { return Op_RegD; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
489c9b5090e2 Initial load
duke
parents:
diff changeset
   346
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
//------------------------------CmpLTMaskNode----------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   348
// If p < q, return -1 else return 0.  Nice for flow-free idioms.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   349
class CmpLTMaskNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   350
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   351
  CmpLTMaskNode( Node *p, Node *q ) : Node(0, p, q) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   352
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   353
  const Type *bottom_type() const { return TypeInt::INT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   354
  virtual uint ideal_reg() const { return Op_RegI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   355
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   356
489c9b5090e2 Initial load
duke
parents:
diff changeset
   357
489c9b5090e2 Initial load
duke
parents:
diff changeset
   358
//------------------------------NegNode----------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   359
class NegNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   360
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   361
  NegNode( Node *in1 ) : Node(0,in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   362
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   363
489c9b5090e2 Initial load
duke
parents:
diff changeset
   364
//------------------------------NegFNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   365
// Negate value a float.  Negating 0.0 returns -0.0, but subtracting from
489c9b5090e2 Initial load
duke
parents:
diff changeset
   366
// zero returns +0.0 (per JVM spec on 'fneg' bytecode).  As subtraction
489c9b5090e2 Initial load
duke
parents:
diff changeset
   367
// cannot be used to replace negation we have to implement negation as ideal
489c9b5090e2 Initial load
duke
parents:
diff changeset
   368
// node; note that negation and addition can replace subtraction.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   369
class NegFNode : public NegNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   370
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   371
  NegFNode( Node *in1 ) : NegNode(in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   372
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   373
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   374
  const Type *bottom_type() const { return Type::FLOAT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   375
  virtual uint ideal_reg() const { return Op_RegF; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   376
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   377
489c9b5090e2 Initial load
duke
parents:
diff changeset
   378
//------------------------------NegDNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   379
// Negate value a double.  Negating 0.0 returns -0.0, but subtracting from
489c9b5090e2 Initial load
duke
parents:
diff changeset
   380
// zero returns +0.0 (per JVM spec on 'dneg' bytecode).  As subtraction
489c9b5090e2 Initial load
duke
parents:
diff changeset
   381
// cannot be used to replace negation we have to implement negation as ideal
489c9b5090e2 Initial load
duke
parents:
diff changeset
   382
// node; note that negation and addition can replace subtraction.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   383
class NegDNode : public NegNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   384
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   385
  NegDNode( Node *in1 ) : NegNode(in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   386
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   387
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   388
  const Type *bottom_type() const { return Type::DOUBLE; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   389
  virtual uint ideal_reg() const { return Op_RegD; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   390
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   391
489c9b5090e2 Initial load
duke
parents:
diff changeset
   392
//------------------------------CosDNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   393
// Cosinus of a double
489c9b5090e2 Initial load
duke
parents:
diff changeset
   394
class CosDNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   395
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   396
  CosDNode( Node *in1  ) : Node(0, in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   397
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   398
  const Type *bottom_type() const { return Type::DOUBLE; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   399
  virtual uint ideal_reg() const { return Op_RegD; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   400
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   401
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   402
489c9b5090e2 Initial load
duke
parents:
diff changeset
   403
//------------------------------CosDNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   404
// Sinus of a double
489c9b5090e2 Initial load
duke
parents:
diff changeset
   405
class SinDNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   406
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   407
  SinDNode( Node *in1  ) : Node(0, in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   408
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   409
  const Type *bottom_type() const { return Type::DOUBLE; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   410
  virtual uint ideal_reg() const { return Op_RegD; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   411
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   412
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   413
489c9b5090e2 Initial load
duke
parents:
diff changeset
   414
489c9b5090e2 Initial load
duke
parents:
diff changeset
   415
//------------------------------TanDNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   416
// tangens of a double
489c9b5090e2 Initial load
duke
parents:
diff changeset
   417
class TanDNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   418
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   419
  TanDNode(Node *in1  ) : Node(0, in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   420
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   421
  const Type *bottom_type() const { return Type::DOUBLE; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   422
  virtual uint ideal_reg() const { return Op_RegD; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   423
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   424
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   425
489c9b5090e2 Initial load
duke
parents:
diff changeset
   426
489c9b5090e2 Initial load
duke
parents:
diff changeset
   427
//------------------------------AtanDNode--------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   428
// arcus tangens of a double
489c9b5090e2 Initial load
duke
parents:
diff changeset
   429
class AtanDNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   430
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   431
  AtanDNode(Node *c, Node *in1, Node *in2  ) : Node(c, in1, in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   432
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   433
  const Type *bottom_type() const { return Type::DOUBLE; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   434
  virtual uint ideal_reg() const { return Op_RegD; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   435
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   436
489c9b5090e2 Initial load
duke
parents:
diff changeset
   437
489c9b5090e2 Initial load
duke
parents:
diff changeset
   438
//------------------------------SqrtDNode--------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   439
// square root a double
489c9b5090e2 Initial load
duke
parents:
diff changeset
   440
class SqrtDNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   441
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   442
  SqrtDNode(Node *c, Node *in1  ) : Node(c, in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   443
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   444
  const Type *bottom_type() const { return Type::DOUBLE; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   445
  virtual uint ideal_reg() const { return Op_RegD; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   446
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   447
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   448
489c9b5090e2 Initial load
duke
parents:
diff changeset
   449
//------------------------------ExpDNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   450
//  Exponentiate a double
489c9b5090e2 Initial load
duke
parents:
diff changeset
   451
class ExpDNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   452
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   453
  ExpDNode( Node *c, Node *in1 ) : Node(c, in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   454
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   455
  const Type *bottom_type() const { return Type::DOUBLE; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   456
  virtual uint ideal_reg() const { return Op_RegD; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   457
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   458
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   459
489c9b5090e2 Initial load
duke
parents:
diff changeset
   460
//------------------------------LogDNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   461
// Log_e of a double
489c9b5090e2 Initial load
duke
parents:
diff changeset
   462
class LogDNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   463
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   464
  LogDNode( Node *in1 ) : Node(0, in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   465
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   466
  const Type *bottom_type() const { return Type::DOUBLE; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   467
  virtual uint ideal_reg() const { return Op_RegD; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   468
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   469
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   470
489c9b5090e2 Initial load
duke
parents:
diff changeset
   471
//------------------------------Log10DNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   472
// Log_10 of a double
489c9b5090e2 Initial load
duke
parents:
diff changeset
   473
class Log10DNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   474
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   475
  Log10DNode( Node *in1 ) : Node(0, in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   476
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   477
  const Type *bottom_type() const { return Type::DOUBLE; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   478
  virtual uint ideal_reg() const { return Op_RegD; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   479
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   480
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   481
489c9b5090e2 Initial load
duke
parents:
diff changeset
   482
//------------------------------PowDNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   483
// Raise a double to a double power
489c9b5090e2 Initial load
duke
parents:
diff changeset
   484
class PowDNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   485
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   486
  PowDNode(Node *c, Node *in1, Node *in2  ) : Node(c, in1, in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   487
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   488
  const Type *bottom_type() const { return Type::DOUBLE; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   489
  virtual uint ideal_reg() const { return Op_RegD; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   490
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   491
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   492
489c9b5090e2 Initial load
duke
parents:
diff changeset
   493
//-------------------------------ReverseBytesINode--------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   494
// reverse bytes of an integer
489c9b5090e2 Initial load
duke
parents:
diff changeset
   495
class ReverseBytesINode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   496
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   497
  ReverseBytesINode(Node *c, Node *in1) : Node(c, in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   498
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   499
  const Type *bottom_type() const { return TypeInt::INT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   500
  virtual uint ideal_reg() const { return Op_RegI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   501
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   502
489c9b5090e2 Initial load
duke
parents:
diff changeset
   503
//-------------------------------ReverseBytesLNode--------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   504
// reverse bytes of a long
489c9b5090e2 Initial load
duke
parents:
diff changeset
   505
class ReverseBytesLNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   506
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   507
  ReverseBytesLNode(Node *c, Node *in1) : Node(c, in1) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   508
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   509
  const Type *bottom_type() const { return TypeLong::LONG; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   510
  virtual uint ideal_reg() const { return Op_RegL; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   511
};