hotspot/src/share/vm/opto/mulnode.hpp
author kvn
Fri, 20 Jan 2012 09:43:06 -0800
changeset 11562 969748c25d89
parent 10255 bab46e6f7661
child 13104 657b387034fb
permissions -rw-r--r--
7131302: connode.cpp:205 Error: ShouldNotReachHere() Summary: Add Value() methods to short and byte Load nodes to truncate constants which does not fit. Reviewed-by: jrose
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
     2
 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
1
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
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 670
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 670
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 670
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    25
#ifndef SHARE_VM_OPTO_MULNODE_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    26
#define SHARE_VM_OPTO_MULNODE_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    28
#include "opto/node.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "opto/opcodes.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    30
#include "opto/type.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    31
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
// Portions of code courtesy of Clifford Click
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
class PhaseTransform;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
//------------------------------MulNode----------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
// Classic MULTIPLY functionality.  This covers all the usual 'multiply'
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
// behaviors for an algebraic ring.  Multiply-integer, multiply-float,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
// multiply-double, and binary-and are all inherited from this class.  The
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
// various identity values are supplied by virtual functions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
class MulNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
  virtual uint hash() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
public:
10255
bab46e6f7661 7069452: Cleanup NodeFlags
kvn
parents: 7397
diff changeset
    44
  MulNode( Node *in1, Node *in2 ): Node(0,in1,in2) {}
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
  // Handle algebraic identities here.  If we have an identity, return the Node
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  // we are equivalent to.  We look for "add of zero" as an identity.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
  // We also canonicalize the Node, moving constants to the right input,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  // and flatten expressions (so that 1+x+2 becomes x+3).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  // Compute a new Type for this node.  Basically we just do the pre-check,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
  // then call the virtual add() to set the type.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
  // Supplied function returns the product of the inputs.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
  // This also type-checks the inputs for sanity.  Guaranteed never to
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
  // be passed a TOP or BOTTOM type, these are filtered out by a pre-check.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
  // This call recognizes the multiplicative zero type.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  virtual const Type *mul_ring( const Type *, const Type * ) const = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  // Supplied function to return the multiplicative identity type
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  virtual const Type *mul_id() const = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
  // Supplied function to return the additive identity type
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  virtual const Type *add_id() const = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  // Supplied function to return the additive opcode
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  virtual int add_opcode() const = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  // Supplied function to return the multiplicative opcode
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  virtual int mul_opcode() const = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
//------------------------------MulINode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
// Multiply 2 integers
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
class MulINode : public MulNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  MulINode( Node *in1, Node *in2 ) : MulNode(in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  virtual const Type *mul_ring( const Type *, const Type * ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  const Type *mul_id() const { return TypeInt::ONE; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  const Type *add_id() const { return TypeInt::ZERO; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  int add_opcode() const { return Op_AddI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  int mul_opcode() const { return Op_MulI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  const Type *bottom_type() const { return TypeInt::INT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  virtual uint ideal_reg() const { return Op_RegI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
//------------------------------MulLNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
// Multiply 2 longs
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
class MulLNode : public MulNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
  MulLNode( Node *in1, Node *in2 ) : MulNode(in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  virtual const Type *mul_ring( const Type *, const Type * ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  const Type *mul_id() const { return TypeLong::ONE; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
  const Type *add_id() const { return TypeLong::ZERO; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
  int add_opcode() const { return Op_AddL; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  int mul_opcode() const { return Op_MulL; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
  const Type *bottom_type() const { return TypeLong::LONG; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
  virtual uint ideal_reg() const { return Op_RegL; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
//------------------------------MulFNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
// Multiply 2 floats
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
class MulFNode : public MulNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  MulFNode( Node *in1, Node *in2 ) : MulNode(in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
  virtual const Type *mul_ring( const Type *, const Type * ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  const Type *mul_id() const { return TypeF::ONE; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  const Type *add_id() const { return TypeF::ZERO; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
  int add_opcode() const { return Op_AddF; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  int mul_opcode() const { return Op_MulF; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
  const Type *bottom_type() const { return Type::FLOAT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
  virtual uint ideal_reg() const { return Op_RegF; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
//------------------------------MulDNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
// Multiply 2 doubles
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
class MulDNode : public MulNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  MulDNode( Node *in1, Node *in2 ) : MulNode(in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
  virtual const Type *mul_ring( const Type *, const Type * ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
  const Type *mul_id() const { return TypeD::ONE; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
  const Type *add_id() const { return TypeD::ZERO; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  int add_opcode() const { return Op_AddD; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
  int mul_opcode() const { return Op_MulD; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
  const Type *bottom_type() const { return Type::DOUBLE; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  virtual uint ideal_reg() const { return Op_RegD; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
392
0b3167e2f2de 6603011: RFE: Optimize long division
rasbold
parents: 1
diff changeset
   141
//-------------------------------MulHiLNode------------------------------------
0b3167e2f2de 6603011: RFE: Optimize long division
rasbold
parents: 1
diff changeset
   142
// Upper 64 bits of a 64 bit by 64 bit multiply
0b3167e2f2de 6603011: RFE: Optimize long division
rasbold
parents: 1
diff changeset
   143
class MulHiLNode : public Node {
0b3167e2f2de 6603011: RFE: Optimize long division
rasbold
parents: 1
diff changeset
   144
public:
0b3167e2f2de 6603011: RFE: Optimize long division
rasbold
parents: 1
diff changeset
   145
  MulHiLNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {}
0b3167e2f2de 6603011: RFE: Optimize long division
rasbold
parents: 1
diff changeset
   146
  virtual int Opcode() const;
0b3167e2f2de 6603011: RFE: Optimize long division
rasbold
parents: 1
diff changeset
   147
  virtual const Type *Value( PhaseTransform *phase ) const;
0b3167e2f2de 6603011: RFE: Optimize long division
rasbold
parents: 1
diff changeset
   148
  const Type *bottom_type() const { return TypeLong::LONG; }
0b3167e2f2de 6603011: RFE: Optimize long division
rasbold
parents: 1
diff changeset
   149
  virtual uint ideal_reg() const { return Op_RegL; }
0b3167e2f2de 6603011: RFE: Optimize long division
rasbold
parents: 1
diff changeset
   150
};
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
//------------------------------AndINode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
// Logically AND 2 integers.  Included with the MUL nodes because it inherits
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
// all the behavior of multiplication on a ring.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
class AndINode : public MulINode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
  AndINode( Node *in1, Node *in2 ) : MulINode(in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
  virtual const Type *mul_ring( const Type *, const Type * ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
  const Type *mul_id() const { return TypeInt::MINUS_1; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  const Type *add_id() const { return TypeInt::ZERO; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
  int add_opcode() const { return Op_OrI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
  int mul_opcode() const { return Op_AndI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
  virtual uint ideal_reg() const { return Op_RegI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
//------------------------------AndINode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
// Logically AND 2 longs.  Included with the MUL nodes because it inherits
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
// all the behavior of multiplication on a ring.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
class AndLNode : public MulLNode {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
  AndLNode( Node *in1, Node *in2 ) : MulLNode(in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
  virtual const Type *mul_ring( const Type *, const Type * ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
  const Type *mul_id() const { return TypeLong::MINUS_1; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
  const Type *add_id() const { return TypeLong::ZERO; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
  int add_opcode() const { return Op_OrL; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
  int mul_opcode() const { return Op_AndL; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
  virtual uint ideal_reg() const { return Op_RegL; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
//------------------------------LShiftINode------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
// Logical shift left
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
class LShiftINode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
  LShiftINode( Node *in1, Node *in2 ) : Node(0,in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
  const Type *bottom_type() const { return TypeInt::INT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
  virtual uint ideal_reg() const { return Op_RegI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
//------------------------------LShiftLNode------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
// Logical shift left
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
class LShiftLNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
  LShiftLNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
  const Type *bottom_type() const { return TypeLong::LONG; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
  virtual uint ideal_reg() const { return Op_RegL; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
//------------------------------RShiftINode------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
// Signed shift right
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
class RShiftINode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
  RShiftINode( Node *in1, Node *in2 ) : Node(0,in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
  const Type *bottom_type() const { return TypeInt::INT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
  virtual uint ideal_reg() const { return Op_RegI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
//------------------------------RShiftLNode------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
// Signed shift right
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
class RShiftLNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
  RShiftLNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
  const Type *bottom_type() const { return TypeLong::LONG; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
  virtual uint ideal_reg() const { return Op_RegL; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
//------------------------------URShiftINode-----------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
// Logical shift right
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
class URShiftINode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
  URShiftINode( Node *in1, Node *in2 ) : Node(0,in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
  const Type *bottom_type() const { return TypeInt::INT; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
  virtual uint ideal_reg() const { return Op_RegI; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
//------------------------------URShiftLNode-----------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
// Logical shift right
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
class URShiftLNode : public Node {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
  URShiftLNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
  virtual int Opcode() const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
  virtual Node *Identity( PhaseTransform *phase );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
  virtual const Type *Value( PhaseTransform *phase ) const;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
  const Type *bottom_type() const { return TypeLong::LONG; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
  virtual uint ideal_reg() const { return Op_RegL; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   263
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   264
#endif // SHARE_VM_OPTO_MULNODE_HPP