annotate src/share/vm/opto/addnode.hpp @ 1972:f95d63e2154a

6989984: Use standard include model for Hospot Summary: Replaced MakeDeps and the includeDB files with more standardized solutions. Reviewed-by: coleenp, kvn, kamg
author stefank
date Tue, 23 Nov 2010 13:22:55 -0800
parents c18cbe5936b8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1541
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1541
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1541
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
25 #ifndef SHARE_VM_OPTO_ADDNODE_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #define SHARE_VM_OPTO_ADDNODE_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "opto/node.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "opto/opcodes.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
30 #include "opto/type.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
31
0
a61af66fc99e Initial load
duke
parents:
diff changeset
32 // Portions of code courtesy of Clifford Click
a61af66fc99e Initial load
duke
parents:
diff changeset
33
a61af66fc99e Initial load
duke
parents:
diff changeset
34 class PhaseTransform;
a61af66fc99e Initial load
duke
parents:
diff changeset
35
a61af66fc99e Initial load
duke
parents:
diff changeset
36 //------------------------------AddNode----------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
37 // Classic Add functionality. This covers all the usual 'add' behaviors for
a61af66fc99e Initial load
duke
parents:
diff changeset
38 // an algebraic ring. Add-integer, add-float, add-double, and binary-or are
a61af66fc99e Initial load
duke
parents:
diff changeset
39 // all inherited from this class. The various identity values are supplied
a61af66fc99e Initial load
duke
parents:
diff changeset
40 // by virtual functions.
a61af66fc99e Initial load
duke
parents:
diff changeset
41 class AddNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
42 virtual uint hash() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
43 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
44 AddNode( Node *in1, Node *in2 ) : Node(0,in1,in2) {
a61af66fc99e Initial load
duke
parents:
diff changeset
45 init_class_id(Class_Add);
a61af66fc99e Initial load
duke
parents:
diff changeset
46 }
a61af66fc99e Initial load
duke
parents:
diff changeset
47
a61af66fc99e Initial load
duke
parents:
diff changeset
48 // Handle algebraic identities here. If we have an identity, return the Node
a61af66fc99e Initial load
duke
parents:
diff changeset
49 // we are equivalent to. We look for "add of zero" as an identity.
a61af66fc99e Initial load
duke
parents:
diff changeset
50 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
51
a61af66fc99e Initial load
duke
parents:
diff changeset
52 // We also canonicalize the Node, moving constants to the right input,
a61af66fc99e Initial load
duke
parents:
diff changeset
53 // and flatten expressions (so that 1+x+2 becomes x+3).
a61af66fc99e Initial load
duke
parents:
diff changeset
54 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
55
a61af66fc99e Initial load
duke
parents:
diff changeset
56 // Compute a new Type for this node. Basically we just do the pre-check,
a61af66fc99e Initial load
duke
parents:
diff changeset
57 // then call the virtual add() to set the type.
a61af66fc99e Initial load
duke
parents:
diff changeset
58 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
59
a61af66fc99e Initial load
duke
parents:
diff changeset
60 // Check if this addition involves the additive identity
a61af66fc99e Initial load
duke
parents:
diff changeset
61 virtual const Type *add_of_identity( const Type *t1, const Type *t2 ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
62
a61af66fc99e Initial load
duke
parents:
diff changeset
63 // Supplied function returns the sum of the inputs.
a61af66fc99e Initial load
duke
parents:
diff changeset
64 // This also type-checks the inputs for sanity. Guaranteed never to
a61af66fc99e Initial load
duke
parents:
diff changeset
65 // be passed a TOP or BOTTOM type, these are filtered out by a pre-check.
a61af66fc99e Initial load
duke
parents:
diff changeset
66 virtual const Type *add_ring( const Type *, const Type * ) const = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
67
a61af66fc99e Initial load
duke
parents:
diff changeset
68 // Supplied function to return the additive identity type
a61af66fc99e Initial load
duke
parents:
diff changeset
69 virtual const Type *add_id() const = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
70
a61af66fc99e Initial load
duke
parents:
diff changeset
71 };
a61af66fc99e Initial load
duke
parents:
diff changeset
72
a61af66fc99e Initial load
duke
parents:
diff changeset
73 //------------------------------AddINode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
74 // Add 2 integers
a61af66fc99e Initial load
duke
parents:
diff changeset
75 class AddINode : public AddNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
76 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
77 AddINode( Node *in1, Node *in2 ) : AddNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
78 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
79 virtual const Type *add_ring( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
80 virtual const Type *add_id() const { return TypeInt::ZERO; }
a61af66fc99e Initial load
duke
parents:
diff changeset
81 virtual const Type *bottom_type() const { return TypeInt::INT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
82 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
83 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
84 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
85 };
a61af66fc99e Initial load
duke
parents:
diff changeset
86
a61af66fc99e Initial load
duke
parents:
diff changeset
87 //------------------------------AddLNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
88 // Add 2 longs
a61af66fc99e Initial load
duke
parents:
diff changeset
89 class AddLNode : public AddNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
90 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
91 AddLNode( Node *in1, Node *in2 ) : AddNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
92 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
93 virtual const Type *add_ring( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
94 virtual const Type *add_id() const { return TypeLong::ZERO; }
a61af66fc99e Initial load
duke
parents:
diff changeset
95 virtual const Type *bottom_type() const { return TypeLong::LONG; }
a61af66fc99e Initial load
duke
parents:
diff changeset
96 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
97 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
98 virtual uint ideal_reg() const { return Op_RegL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
99 };
a61af66fc99e Initial load
duke
parents:
diff changeset
100
a61af66fc99e Initial load
duke
parents:
diff changeset
101 //------------------------------AddFNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
102 // Add 2 floats
a61af66fc99e Initial load
duke
parents:
diff changeset
103 class AddFNode : public AddNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
104 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
105 AddFNode( Node *in1, Node *in2 ) : AddNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
106 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
107 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
108 virtual const Type *add_of_identity( const Type *t1, const Type *t2 ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
109 virtual const Type *add_ring( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
110 virtual const Type *add_id() const { return TypeF::ZERO; }
a61af66fc99e Initial load
duke
parents:
diff changeset
111 virtual const Type *bottom_type() const { return Type::FLOAT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
112 virtual Node *Identity( PhaseTransform *phase ) { return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
113 virtual uint ideal_reg() const { return Op_RegF; }
a61af66fc99e Initial load
duke
parents:
diff changeset
114 };
a61af66fc99e Initial load
duke
parents:
diff changeset
115
a61af66fc99e Initial load
duke
parents:
diff changeset
116 //------------------------------AddDNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
117 // Add 2 doubles
a61af66fc99e Initial load
duke
parents:
diff changeset
118 class AddDNode : public AddNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
119 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
120 AddDNode( Node *in1, Node *in2 ) : AddNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
121 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
122 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
123 virtual const Type *add_of_identity( const Type *t1, const Type *t2 ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
124 virtual const Type *add_ring( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
125 virtual const Type *add_id() const { return TypeD::ZERO; }
a61af66fc99e Initial load
duke
parents:
diff changeset
126 virtual const Type *bottom_type() const { return Type::DOUBLE; }
a61af66fc99e Initial load
duke
parents:
diff changeset
127 virtual Node *Identity( PhaseTransform *phase ) { return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
128 virtual uint ideal_reg() const { return Op_RegD; }
a61af66fc99e Initial load
duke
parents:
diff changeset
129 };
a61af66fc99e Initial load
duke
parents:
diff changeset
130
a61af66fc99e Initial load
duke
parents:
diff changeset
131 //------------------------------AddPNode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
132 // Add pointer plus integer to get pointer. NOT commutative, really.
a61af66fc99e Initial load
duke
parents:
diff changeset
133 // So not really an AddNode. Lives here, because people associate it with
a61af66fc99e Initial load
duke
parents:
diff changeset
134 // an add.
a61af66fc99e Initial load
duke
parents:
diff changeset
135 class AddPNode : public Node {
a61af66fc99e Initial load
duke
parents:
diff changeset
136 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
137 enum { Control, // When is it safe to do this add?
a61af66fc99e Initial load
duke
parents:
diff changeset
138 Base, // Base oop, for GC purposes
a61af66fc99e Initial load
duke
parents:
diff changeset
139 Address, // Actually address, derived from base
a61af66fc99e Initial load
duke
parents:
diff changeset
140 Offset } ; // Offset added to address
a61af66fc99e Initial load
duke
parents:
diff changeset
141 AddPNode( Node *base, Node *ptr, Node *off ) : Node(0,base,ptr,off) {
a61af66fc99e Initial load
duke
parents:
diff changeset
142 init_class_id(Class_AddP);
a61af66fc99e Initial load
duke
parents:
diff changeset
143 }
a61af66fc99e Initial load
duke
parents:
diff changeset
144 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
145 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
146 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
147 virtual const Type *Value( PhaseTransform *phase ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
148 virtual const Type *bottom_type() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
149 virtual uint ideal_reg() const { return Op_RegP; }
a61af66fc99e Initial load
duke
parents:
diff changeset
150 Node *base_node() { assert( req() > Base, "Missing base"); return in(Base); }
a61af66fc99e Initial load
duke
parents:
diff changeset
151 static Node* Ideal_base_and_offset(Node* ptr, PhaseTransform* phase,
a61af66fc99e Initial load
duke
parents:
diff changeset
152 // second return value:
a61af66fc99e Initial load
duke
parents:
diff changeset
153 intptr_t& offset);
17
ff5961f4c095 6395208: Elide autoboxing for calls to HashMap.get(int) and HashMap.get(long)
never
parents: 0
diff changeset
154
ff5961f4c095 6395208: Elide autoboxing for calls to HashMap.get(int) and HashMap.get(long)
never
parents: 0
diff changeset
155 // Collect the AddP offset values into the elements array, giving up
ff5961f4c095 6395208: Elide autoboxing for calls to HashMap.get(int) and HashMap.get(long)
never
parents: 0
diff changeset
156 // if there are more than length.
ff5961f4c095 6395208: Elide autoboxing for calls to HashMap.get(int) and HashMap.get(long)
never
parents: 0
diff changeset
157 int unpack_offsets(Node* elements[], int length);
ff5961f4c095 6395208: Elide autoboxing for calls to HashMap.get(int) and HashMap.get(long)
never
parents: 0
diff changeset
158
0
a61af66fc99e Initial load
duke
parents:
diff changeset
159 // Do not match base-ptr edge
a61af66fc99e Initial load
duke
parents:
diff changeset
160 virtual uint match_edge(uint idx) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
161 };
a61af66fc99e Initial load
duke
parents:
diff changeset
162
a61af66fc99e Initial load
duke
parents:
diff changeset
163 //------------------------------OrINode----------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
164 // Logically OR 2 integers. Included with the ADD nodes because it inherits
a61af66fc99e Initial load
duke
parents:
diff changeset
165 // all the behavior of addition on a ring.
a61af66fc99e Initial load
duke
parents:
diff changeset
166 class OrINode : public AddNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
167 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
168 OrINode( Node *in1, Node *in2 ) : AddNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
169 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
170 virtual const Type *add_ring( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
171 virtual const Type *add_id() const { return TypeInt::ZERO; }
a61af66fc99e Initial load
duke
parents:
diff changeset
172 virtual const Type *bottom_type() const { return TypeInt::INT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
173 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
174 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
175 };
a61af66fc99e Initial load
duke
parents:
diff changeset
176
a61af66fc99e Initial load
duke
parents:
diff changeset
177 //------------------------------OrLNode----------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
178 // Logically OR 2 longs. Included with the ADD nodes because it inherits
a61af66fc99e Initial load
duke
parents:
diff changeset
179 // all the behavior of addition on a ring.
a61af66fc99e Initial load
duke
parents:
diff changeset
180 class OrLNode : public AddNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
181 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
182 OrLNode( Node *in1, Node *in2 ) : AddNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
183 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
184 virtual const Type *add_ring( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
185 virtual const Type *add_id() const { return TypeLong::ZERO; }
a61af66fc99e Initial load
duke
parents:
diff changeset
186 virtual const Type *bottom_type() const { return TypeLong::LONG; }
a61af66fc99e Initial load
duke
parents:
diff changeset
187 virtual Node *Identity( PhaseTransform *phase );
a61af66fc99e Initial load
duke
parents:
diff changeset
188 virtual uint ideal_reg() const { return Op_RegL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
189 };
a61af66fc99e Initial load
duke
parents:
diff changeset
190
a61af66fc99e Initial load
duke
parents:
diff changeset
191 //------------------------------XorINode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
192 // XOR'ing 2 integers
a61af66fc99e Initial load
duke
parents:
diff changeset
193 class XorINode : public AddNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
194 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
195 XorINode( Node *in1, Node *in2 ) : AddNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
196 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
197 virtual const Type *add_ring( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
198 virtual const Type *add_id() const { return TypeInt::ZERO; }
a61af66fc99e Initial load
duke
parents:
diff changeset
199 virtual const Type *bottom_type() const { return TypeInt::INT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
200 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
201 };
a61af66fc99e Initial load
duke
parents:
diff changeset
202
a61af66fc99e Initial load
duke
parents:
diff changeset
203 //------------------------------XorINode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
204 // XOR'ing 2 longs
a61af66fc99e Initial load
duke
parents:
diff changeset
205 class XorLNode : public AddNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
206 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
207 XorLNode( Node *in1, Node *in2 ) : AddNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
208 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
209 virtual const Type *add_ring( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
210 virtual const Type *add_id() const { return TypeLong::ZERO; }
a61af66fc99e Initial load
duke
parents:
diff changeset
211 virtual const Type *bottom_type() const { return TypeLong::LONG; }
a61af66fc99e Initial load
duke
parents:
diff changeset
212 virtual uint ideal_reg() const { return Op_RegL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
213 };
a61af66fc99e Initial load
duke
parents:
diff changeset
214
a61af66fc99e Initial load
duke
parents:
diff changeset
215 //------------------------------MaxNode----------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
216 // Max (or min) of 2 values. Included with the ADD nodes because it inherits
a61af66fc99e Initial load
duke
parents:
diff changeset
217 // all the behavior of addition on a ring. Only new thing is that we allow
a61af66fc99e Initial load
duke
parents:
diff changeset
218 // 2 equal inputs to be equal.
a61af66fc99e Initial load
duke
parents:
diff changeset
219 class MaxNode : public AddNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
220 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
221 MaxNode( Node *in1, Node *in2 ) : AddNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
222 virtual int Opcode() const = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
223 };
a61af66fc99e Initial load
duke
parents:
diff changeset
224
a61af66fc99e Initial load
duke
parents:
diff changeset
225 //------------------------------MaxINode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
226 // Maximum of 2 integers. Included with the ADD nodes because it inherits
a61af66fc99e Initial load
duke
parents:
diff changeset
227 // all the behavior of addition on a ring.
a61af66fc99e Initial load
duke
parents:
diff changeset
228 class MaxINode : public MaxNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
229 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
230 MaxINode( Node *in1, Node *in2 ) : MaxNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
231 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
232 virtual const Type *add_ring( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
233 virtual const Type *add_id() const { return TypeInt::make(min_jint); }
a61af66fc99e Initial load
duke
parents:
diff changeset
234 virtual const Type *bottom_type() const { return TypeInt::INT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
235 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
236 };
a61af66fc99e Initial load
duke
parents:
diff changeset
237
a61af66fc99e Initial load
duke
parents:
diff changeset
238 //------------------------------MinINode---------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
239 // MINimum of 2 integers. Included with the ADD nodes because it inherits
a61af66fc99e Initial load
duke
parents:
diff changeset
240 // all the behavior of addition on a ring.
a61af66fc99e Initial load
duke
parents:
diff changeset
241 class MinINode : public MaxNode {
a61af66fc99e Initial load
duke
parents:
diff changeset
242 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
243 MinINode( Node *in1, Node *in2 ) : MaxNode(in1,in2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
244 virtual int Opcode() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
245 virtual const Type *add_ring( const Type *, const Type * ) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
246 virtual const Type *add_id() const { return TypeInt::make(max_jint); }
a61af66fc99e Initial load
duke
parents:
diff changeset
247 virtual const Type *bottom_type() const { return TypeInt::INT; }
a61af66fc99e Initial load
duke
parents:
diff changeset
248 virtual uint ideal_reg() const { return Op_RegI; }
a61af66fc99e Initial load
duke
parents:
diff changeset
249 virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
a61af66fc99e Initial load
duke
parents:
diff changeset
250 };
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
251
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
252 #endif // SHARE_VM_OPTO_ADDNODE_HPP