Mercurial > hg > graal-compiler
comparison src/share/vm/opto/vectornode.hpp @ 6823:859c45fb8cea
7201026: add vector for shift count
Summary: Add generation of vectors for scalar shift count.
Reviewed-by: roland, twisti, dlong
author | kvn |
---|---|
date | Tue, 02 Oct 2012 12:25:13 -0700 |
parents | 5af51c882207 |
children | 2113136690bc |
comparison
equal
deleted
inserted
replaced
6822:f6b0eb4e44cf | 6823:859c45fb8cea |
---|---|
27 #include "opto/matcher.hpp" | 27 #include "opto/matcher.hpp" |
28 #include "opto/memnode.hpp" | 28 #include "opto/memnode.hpp" |
29 #include "opto/node.hpp" | 29 #include "opto/node.hpp" |
30 #include "opto/opcodes.hpp" | 30 #include "opto/opcodes.hpp" |
31 | 31 |
32 //------------------------------VectorNode-------------------------------------- | 32 //------------------------------VectorNode------------------------------------- |
33 // Vector Operation | 33 // Vector Operation |
34 class VectorNode : public TypeNode { | 34 class VectorNode : public TypeNode { |
35 public: | 35 public: |
36 | 36 |
37 VectorNode(Node* n1, const TypeVect* vt) : TypeNode(vt, 2) { | 37 VectorNode(Node* n1, const TypeVect* vt) : TypeNode(vt, 2) { |
51 virtual int Opcode() const; | 51 virtual int Opcode() const; |
52 | 52 |
53 virtual uint ideal_reg() const { return Matcher::vector_ideal_reg(vect_type()->length_in_bytes()); } | 53 virtual uint ideal_reg() const { return Matcher::vector_ideal_reg(vect_type()->length_in_bytes()); } |
54 | 54 |
55 static VectorNode* scalar2vector(Compile* C, Node* s, uint vlen, const Type* opd_t); | 55 static VectorNode* scalar2vector(Compile* C, Node* s, uint vlen, const Type* opd_t); |
56 | 56 static VectorNode* shift_count(Compile* C, Node* shift, Node* cnt, uint vlen, BasicType bt); |
57 static VectorNode* make(Compile* C, int opc, Node* n1, Node* n2, uint vlen, BasicType bt); | 57 static VectorNode* make(Compile* C, int opc, Node* n1, Node* n2, uint vlen, BasicType bt); |
58 | 58 |
59 static int opcode(int opc, BasicType bt); | 59 static int opcode(int opc, BasicType bt); |
60 static bool implemented(int opc, uint vlen, BasicType bt); | 60 static bool implemented(int opc, uint vlen, BasicType bt); |
61 static bool is_shift(Node* n); | 61 static bool is_shift(Node* n); |
62 static bool is_invariant_vector(Node* n); | 62 static bool is_invariant_vector(Node* n); |
63 // [Start, end) half-open range defining which operands are vectors | 63 // [Start, end) half-open range defining which operands are vectors |
64 static void vector_operands(Node* n, uint* start, uint* end); | 64 static void vector_operands(Node* n, uint* start, uint* end); |
65 }; | 65 }; |
66 | 66 |
67 //===========================Vector=ALU=Operations==================================== | 67 //===========================Vector=ALU=Operations============================= |
68 | 68 |
69 //------------------------------AddVBNode--------------------------------------- | 69 //------------------------------AddVBNode-------------------------------------- |
70 // Vector add byte | 70 // Vector add byte |
71 class AddVBNode : public VectorNode { | 71 class AddVBNode : public VectorNode { |
72 public: | 72 public: |
73 AddVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 73 AddVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
74 virtual int Opcode() const; | 74 virtual int Opcode() const; |
75 }; | 75 }; |
76 | 76 |
77 //------------------------------AddVSNode--------------------------------------- | 77 //------------------------------AddVSNode-------------------------------------- |
78 // Vector add char/short | 78 // Vector add char/short |
79 class AddVSNode : public VectorNode { | 79 class AddVSNode : public VectorNode { |
80 public: | 80 public: |
81 AddVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 81 AddVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
82 virtual int Opcode() const; | 82 virtual int Opcode() const; |
83 }; | 83 }; |
84 | 84 |
85 //------------------------------AddVINode--------------------------------------- | 85 //------------------------------AddVINode-------------------------------------- |
86 // Vector add int | 86 // Vector add int |
87 class AddVINode : public VectorNode { | 87 class AddVINode : public VectorNode { |
88 public: | 88 public: |
89 AddVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 89 AddVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
90 virtual int Opcode() const; | 90 virtual int Opcode() const; |
91 }; | 91 }; |
92 | 92 |
93 //------------------------------AddVLNode--------------------------------------- | 93 //------------------------------AddVLNode-------------------------------------- |
94 // Vector add long | 94 // Vector add long |
95 class AddVLNode : public VectorNode { | 95 class AddVLNode : public VectorNode { |
96 public: | 96 public: |
97 AddVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 97 AddVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
98 virtual int Opcode() const; | 98 virtual int Opcode() const; |
99 }; | 99 }; |
100 | 100 |
101 //------------------------------AddVFNode--------------------------------------- | 101 //------------------------------AddVFNode-------------------------------------- |
102 // Vector add float | 102 // Vector add float |
103 class AddVFNode : public VectorNode { | 103 class AddVFNode : public VectorNode { |
104 public: | 104 public: |
105 AddVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 105 AddVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
106 virtual int Opcode() const; | 106 virtual int Opcode() const; |
107 }; | 107 }; |
108 | 108 |
109 //------------------------------AddVDNode--------------------------------------- | 109 //------------------------------AddVDNode-------------------------------------- |
110 // Vector add double | 110 // Vector add double |
111 class AddVDNode : public VectorNode { | 111 class AddVDNode : public VectorNode { |
112 public: | 112 public: |
113 AddVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 113 AddVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
114 virtual int Opcode() const; | 114 virtual int Opcode() const; |
115 }; | 115 }; |
116 | 116 |
117 //------------------------------SubVBNode--------------------------------------- | 117 //------------------------------SubVBNode-------------------------------------- |
118 // Vector subtract byte | 118 // Vector subtract byte |
119 class SubVBNode : public VectorNode { | 119 class SubVBNode : public VectorNode { |
120 public: | 120 public: |
121 SubVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 121 SubVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
122 virtual int Opcode() const; | 122 virtual int Opcode() const; |
123 }; | 123 }; |
124 | 124 |
125 //------------------------------SubVSNode--------------------------------------- | 125 //------------------------------SubVSNode-------------------------------------- |
126 // Vector subtract short | 126 // Vector subtract short |
127 class SubVSNode : public VectorNode { | 127 class SubVSNode : public VectorNode { |
128 public: | 128 public: |
129 SubVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 129 SubVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
130 virtual int Opcode() const; | 130 virtual int Opcode() const; |
131 }; | 131 }; |
132 | 132 |
133 //------------------------------SubVINode--------------------------------------- | 133 //------------------------------SubVINode-------------------------------------- |
134 // Vector subtract int | 134 // Vector subtract int |
135 class SubVINode : public VectorNode { | 135 class SubVINode : public VectorNode { |
136 public: | 136 public: |
137 SubVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 137 SubVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
138 virtual int Opcode() const; | 138 virtual int Opcode() const; |
139 }; | 139 }; |
140 | 140 |
141 //------------------------------SubVLNode--------------------------------------- | 141 //------------------------------SubVLNode-------------------------------------- |
142 // Vector subtract long | 142 // Vector subtract long |
143 class SubVLNode : public VectorNode { | 143 class SubVLNode : public VectorNode { |
144 public: | 144 public: |
145 SubVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 145 SubVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
146 virtual int Opcode() const; | 146 virtual int Opcode() const; |
147 }; | 147 }; |
148 | 148 |
149 //------------------------------SubVFNode--------------------------------------- | 149 //------------------------------SubVFNode-------------------------------------- |
150 // Vector subtract float | 150 // Vector subtract float |
151 class SubVFNode : public VectorNode { | 151 class SubVFNode : public VectorNode { |
152 public: | 152 public: |
153 SubVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 153 SubVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
154 virtual int Opcode() const; | 154 virtual int Opcode() const; |
155 }; | 155 }; |
156 | 156 |
157 //------------------------------SubVDNode--------------------------------------- | 157 //------------------------------SubVDNode-------------------------------------- |
158 // Vector subtract double | 158 // Vector subtract double |
159 class SubVDNode : public VectorNode { | 159 class SubVDNode : public VectorNode { |
160 public: | 160 public: |
161 SubVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 161 SubVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
162 virtual int Opcode() const; | 162 virtual int Opcode() const; |
163 }; | 163 }; |
164 | 164 |
165 //------------------------------MulVSNode--------------------------------------- | 165 //------------------------------MulVSNode-------------------------------------- |
166 // Vector multiply short | 166 // Vector multiply short |
167 class MulVSNode : public VectorNode { | 167 class MulVSNode : public VectorNode { |
168 public: | 168 public: |
169 MulVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 169 MulVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
170 virtual int Opcode() const; | 170 virtual int Opcode() const; |
171 }; | 171 }; |
172 | 172 |
173 //------------------------------MulVINode--------------------------------------- | 173 //------------------------------MulVINode-------------------------------------- |
174 // Vector multiply int | 174 // Vector multiply int |
175 class MulVINode : public VectorNode { | 175 class MulVINode : public VectorNode { |
176 public: | 176 public: |
177 MulVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 177 MulVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
178 virtual int Opcode() const; | 178 virtual int Opcode() const; |
179 }; | 179 }; |
180 | 180 |
181 //------------------------------MulVFNode--------------------------------------- | 181 //------------------------------MulVFNode-------------------------------------- |
182 // Vector multiply float | 182 // Vector multiply float |
183 class MulVFNode : public VectorNode { | 183 class MulVFNode : public VectorNode { |
184 public: | 184 public: |
185 MulVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 185 MulVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
186 virtual int Opcode() const; | 186 virtual int Opcode() const; |
187 }; | 187 }; |
188 | 188 |
189 //------------------------------MulVDNode--------------------------------------- | 189 //------------------------------MulVDNode-------------------------------------- |
190 // Vector multiply double | 190 // Vector multiply double |
191 class MulVDNode : public VectorNode { | 191 class MulVDNode : public VectorNode { |
192 public: | 192 public: |
193 MulVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 193 MulVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
194 virtual int Opcode() const; | 194 virtual int Opcode() const; |
195 }; | 195 }; |
196 | 196 |
197 //------------------------------DivVFNode--------------------------------------- | 197 //------------------------------DivVFNode-------------------------------------- |
198 // Vector divide float | 198 // Vector divide float |
199 class DivVFNode : public VectorNode { | 199 class DivVFNode : public VectorNode { |
200 public: | 200 public: |
201 DivVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 201 DivVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
202 virtual int Opcode() const; | 202 virtual int Opcode() const; |
203 }; | 203 }; |
204 | 204 |
205 //------------------------------DivVDNode--------------------------------------- | 205 //------------------------------DivVDNode-------------------------------------- |
206 // Vector Divide double | 206 // Vector Divide double |
207 class DivVDNode : public VectorNode { | 207 class DivVDNode : public VectorNode { |
208 public: | 208 public: |
209 DivVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 209 DivVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
210 virtual int Opcode() const; | 210 virtual int Opcode() const; |
211 }; | 211 }; |
212 | 212 |
213 //------------------------------LShiftVBNode--------------------------------------- | 213 //------------------------------LShiftVBNode----------------------------------- |
214 // Vector left shift bytes | 214 // Vector left shift bytes |
215 class LShiftVBNode : public VectorNode { | 215 class LShiftVBNode : public VectorNode { |
216 public: | 216 public: |
217 LShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 217 LShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
218 virtual int Opcode() const; | 218 virtual int Opcode() const; |
219 }; | 219 }; |
220 | 220 |
221 //------------------------------LShiftVSNode--------------------------------------- | 221 //------------------------------LShiftVSNode----------------------------------- |
222 // Vector left shift shorts | 222 // Vector left shift shorts |
223 class LShiftVSNode : public VectorNode { | 223 class LShiftVSNode : public VectorNode { |
224 public: | 224 public: |
225 LShiftVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 225 LShiftVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
226 virtual int Opcode() const; | 226 virtual int Opcode() const; |
227 }; | 227 }; |
228 | 228 |
229 //------------------------------LShiftVINode--------------------------------------- | 229 //------------------------------LShiftVINode----------------------------------- |
230 // Vector left shift ints | 230 // Vector left shift ints |
231 class LShiftVINode : public VectorNode { | 231 class LShiftVINode : public VectorNode { |
232 public: | 232 public: |
233 LShiftVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 233 LShiftVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
234 virtual int Opcode() const; | 234 virtual int Opcode() const; |
235 }; | 235 }; |
236 | 236 |
237 //------------------------------LShiftVLNode--------------------------------------- | 237 //------------------------------LShiftVLNode----------------------------------- |
238 // Vector left shift longs | 238 // Vector left shift longs |
239 class LShiftVLNode : public VectorNode { | 239 class LShiftVLNode : public VectorNode { |
240 public: | 240 public: |
241 LShiftVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 241 LShiftVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
242 virtual int Opcode() const; | 242 virtual int Opcode() const; |
243 }; | 243 }; |
244 | 244 |
245 //------------------------------RShiftVBNode--------------------------------------- | 245 //------------------------------RShiftVBNode----------------------------------- |
246 // Vector right arithmetic (signed) shift bytes | 246 // Vector right arithmetic (signed) shift bytes |
247 class RShiftVBNode : public VectorNode { | 247 class RShiftVBNode : public VectorNode { |
248 public: | 248 public: |
249 RShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 249 RShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
250 virtual int Opcode() const; | 250 virtual int Opcode() const; |
251 }; | 251 }; |
252 | 252 |
253 //------------------------------RShiftVSNode--------------------------------------- | 253 //------------------------------RShiftVSNode----------------------------------- |
254 // Vector right arithmetic (signed) shift shorts | 254 // Vector right arithmetic (signed) shift shorts |
255 class RShiftVSNode : public VectorNode { | 255 class RShiftVSNode : public VectorNode { |
256 public: | 256 public: |
257 RShiftVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 257 RShiftVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
258 virtual int Opcode() const; | 258 virtual int Opcode() const; |
259 }; | 259 }; |
260 | 260 |
261 //------------------------------RShiftVINode--------------------------------------- | 261 //------------------------------RShiftVINode----------------------------------- |
262 // Vector right arithmetic (signed) shift ints | 262 // Vector right arithmetic (signed) shift ints |
263 class RShiftVINode : public VectorNode { | 263 class RShiftVINode : public VectorNode { |
264 public: | 264 public: |
265 RShiftVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 265 RShiftVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
266 virtual int Opcode() const; | 266 virtual int Opcode() const; |
267 }; | 267 }; |
268 | 268 |
269 //------------------------------RShiftVLNode--------------------------------------- | 269 //------------------------------RShiftVLNode----------------------------------- |
270 // Vector right arithmetic (signed) shift longs | 270 // Vector right arithmetic (signed) shift longs |
271 class RShiftVLNode : public VectorNode { | 271 class RShiftVLNode : public VectorNode { |
272 public: | 272 public: |
273 RShiftVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 273 RShiftVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
274 virtual int Opcode() const; | 274 virtual int Opcode() const; |
275 }; | 275 }; |
276 | 276 |
277 //------------------------------URShiftVBNode--------------------------------------- | 277 //------------------------------URShiftVBNode---------------------------------- |
278 // Vector right logical (unsigned) shift bytes | 278 // Vector right logical (unsigned) shift bytes |
279 class URShiftVBNode : public VectorNode { | 279 class URShiftVBNode : public VectorNode { |
280 public: | 280 public: |
281 URShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 281 URShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
282 virtual int Opcode() const; | 282 virtual int Opcode() const; |
283 }; | 283 }; |
284 | 284 |
285 //------------------------------URShiftVSNode--------------------------------------- | 285 //------------------------------URShiftVSNode---------------------------------- |
286 // Vector right logical (unsigned) shift shorts | 286 // Vector right logical (unsigned) shift shorts |
287 class URShiftVSNode : public VectorNode { | 287 class URShiftVSNode : public VectorNode { |
288 public: | 288 public: |
289 URShiftVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 289 URShiftVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
290 virtual int Opcode() const; | 290 virtual int Opcode() const; |
291 }; | 291 }; |
292 | 292 |
293 //------------------------------URShiftVINode--------------------------------------- | 293 //------------------------------URShiftVINode---------------------------------- |
294 // Vector right logical (unsigned) shift ints | 294 // Vector right logical (unsigned) shift ints |
295 class URShiftVINode : public VectorNode { | 295 class URShiftVINode : public VectorNode { |
296 public: | 296 public: |
297 URShiftVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 297 URShiftVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
298 virtual int Opcode() const; | 298 virtual int Opcode() const; |
299 }; | 299 }; |
300 | 300 |
301 //------------------------------URShiftVLNode--------------------------------------- | 301 //------------------------------URShiftVLNode---------------------------------- |
302 // Vector right logical (unsigned) shift longs | 302 // Vector right logical (unsigned) shift longs |
303 class URShiftVLNode : public VectorNode { | 303 class URShiftVLNode : public VectorNode { |
304 public: | 304 public: |
305 URShiftVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 305 URShiftVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
306 virtual int Opcode() const; | 306 virtual int Opcode() const; |
307 }; | |
308 | |
309 //------------------------------LShiftCntVNode--------------------------------- | |
310 // Vector left shift count | |
311 class LShiftCntVNode : public VectorNode { | |
312 public: | |
313 LShiftCntVNode(Node* cnt, const TypeVect* vt) : VectorNode(cnt,vt) {} | |
314 virtual int Opcode() const; | |
315 virtual uint ideal_reg() const { return Matcher::vector_shift_count_ideal_reg(vect_type()->length_in_bytes()); } | |
316 }; | |
317 | |
318 //------------------------------RShiftCntVNode--------------------------------- | |
319 // Vector right shift count | |
320 class RShiftCntVNode : public VectorNode { | |
321 public: | |
322 RShiftCntVNode(Node* cnt, const TypeVect* vt) : VectorNode(cnt,vt) {} | |
323 virtual int Opcode() const; | |
324 virtual uint ideal_reg() const { return Matcher::vector_shift_count_ideal_reg(vect_type()->length_in_bytes()); } | |
307 }; | 325 }; |
308 | 326 |
309 | 327 |
310 //------------------------------AndVNode--------------------------------------- | 328 //------------------------------AndVNode--------------------------------------- |
311 // Vector and integer | 329 // Vector and integer |
450 PackNode* binary_tree_pack(Compile* C, int lo, int hi); | 468 PackNode* binary_tree_pack(Compile* C, int lo, int hi); |
451 | 469 |
452 static PackNode* make(Compile* C, Node* s, uint vlen, BasicType bt); | 470 static PackNode* make(Compile* C, Node* s, uint vlen, BasicType bt); |
453 }; | 471 }; |
454 | 472 |
455 //------------------------------PackBNode--------------------------------------- | 473 //------------------------------PackBNode-------------------------------------- |
456 // Pack byte scalars into vector | 474 // Pack byte scalars into vector |
457 class PackBNode : public PackNode { | 475 class PackBNode : public PackNode { |
458 public: | 476 public: |
459 PackBNode(Node* in1, const TypeVect* vt) : PackNode(in1, vt) {} | 477 PackBNode(Node* in1, const TypeVect* vt) : PackNode(in1, vt) {} |
460 virtual int Opcode() const; | 478 virtual int Opcode() const; |
461 }; | 479 }; |
462 | 480 |
463 //------------------------------PackSNode--------------------------------------- | 481 //------------------------------PackSNode-------------------------------------- |
464 // Pack short scalars into a vector | 482 // Pack short scalars into a vector |
465 class PackSNode : public PackNode { | 483 class PackSNode : public PackNode { |
466 public: | 484 public: |
467 PackSNode(Node* in1, const TypeVect* vt) : PackNode(in1, vt) {} | 485 PackSNode(Node* in1, const TypeVect* vt) : PackNode(in1, vt) {} |
468 PackSNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {} | 486 PackSNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {} |
469 virtual int Opcode() const; | 487 virtual int Opcode() const; |
470 }; | 488 }; |
471 | 489 |
472 //------------------------------PackINode--------------------------------------- | 490 //------------------------------PackINode-------------------------------------- |
473 // Pack integer scalars into a vector | 491 // Pack integer scalars into a vector |
474 class PackINode : public PackNode { | 492 class PackINode : public PackNode { |
475 public: | 493 public: |
476 PackINode(Node* in1, const TypeVect* vt) : PackNode(in1, vt) {} | 494 PackINode(Node* in1, const TypeVect* vt) : PackNode(in1, vt) {} |
477 PackINode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {} | 495 PackINode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {} |
478 virtual int Opcode() const; | 496 virtual int Opcode() const; |
479 }; | 497 }; |
480 | 498 |
481 //------------------------------PackLNode--------------------------------------- | 499 //------------------------------PackLNode-------------------------------------- |
482 // Pack long scalars into a vector | 500 // Pack long scalars into a vector |
483 class PackLNode : public PackNode { | 501 class PackLNode : public PackNode { |
484 public: | 502 public: |
485 PackLNode(Node* in1, const TypeVect* vt) : PackNode(in1, vt) {} | 503 PackLNode(Node* in1, const TypeVect* vt) : PackNode(in1, vt) {} |
486 PackLNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {} | 504 PackLNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {} |
487 virtual int Opcode() const; | 505 virtual int Opcode() const; |
488 }; | 506 }; |
489 | 507 |
490 //------------------------------Pack2LNode-------------------------------------- | 508 //------------------------------Pack2LNode------------------------------------- |
491 // Pack 2 long scalars into a vector | 509 // Pack 2 long scalars into a vector |
492 class Pack2LNode : public PackNode { | 510 class Pack2LNode : public PackNode { |
493 public: | 511 public: |
494 Pack2LNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {} | 512 Pack2LNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {} |
495 virtual int Opcode() const; | 513 virtual int Opcode() const; |
496 }; | 514 }; |
497 | 515 |
498 //------------------------------PackFNode--------------------------------------- | 516 //------------------------------PackFNode-------------------------------------- |
499 // Pack float scalars into vector | 517 // Pack float scalars into vector |
500 class PackFNode : public PackNode { | 518 class PackFNode : public PackNode { |
501 public: | 519 public: |
502 PackFNode(Node* in1, const TypeVect* vt) : PackNode(in1, vt) {} | 520 PackFNode(Node* in1, const TypeVect* vt) : PackNode(in1, vt) {} |
503 PackFNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {} | 521 PackFNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {} |
504 virtual int Opcode() const; | 522 virtual int Opcode() const; |
505 }; | 523 }; |
506 | 524 |
507 //------------------------------PackDNode--------------------------------------- | 525 //------------------------------PackDNode-------------------------------------- |
508 // Pack double scalars into a vector | 526 // Pack double scalars into a vector |
509 class PackDNode : public PackNode { | 527 class PackDNode : public PackNode { |
510 public: | 528 public: |
511 PackDNode(Node* in1, const TypeVect* vt) : PackNode(in1, vt) {} | 529 PackDNode(Node* in1, const TypeVect* vt) : PackNode(in1, vt) {} |
512 PackDNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {} | 530 PackDNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {} |
513 virtual int Opcode() const; | 531 virtual int Opcode() const; |
514 }; | 532 }; |
515 | 533 |
516 //------------------------------Pack2DNode-------------------------------------- | 534 //------------------------------Pack2DNode------------------------------------- |
517 // Pack 2 double scalars into a vector | 535 // Pack 2 double scalars into a vector |
518 class Pack2DNode : public PackNode { | 536 class Pack2DNode : public PackNode { |
519 public: | 537 public: |
520 Pack2DNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {} | 538 Pack2DNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {} |
521 virtual int Opcode() const; | 539 virtual int Opcode() const; |
522 }; | 540 }; |
523 | 541 |
524 | 542 |
525 //========================Extract_Scalar_from_Vector=============================== | 543 //========================Extract_Scalar_from_Vector=========================== |
526 | 544 |
527 //------------------------------ExtractNode--------------------------------------- | 545 //------------------------------ExtractNode------------------------------------ |
528 // Extract a scalar from a vector at position "pos" | 546 // Extract a scalar from a vector at position "pos" |
529 class ExtractNode : public Node { | 547 class ExtractNode : public Node { |
530 public: | 548 public: |
531 ExtractNode(Node* src, ConINode* pos) : Node(NULL, src, (Node*)pos) { | 549 ExtractNode(Node* src, ConINode* pos) : Node(NULL, src, (Node*)pos) { |
532 assert(in(2)->get_int() >= 0, "positive constants"); | 550 assert(in(2)->get_int() >= 0, "positive constants"); |
535 uint pos() const { return in(2)->get_int(); } | 553 uint pos() const { return in(2)->get_int(); } |
536 | 554 |
537 static Node* make(Compile* C, Node* v, uint position, BasicType bt); | 555 static Node* make(Compile* C, Node* v, uint position, BasicType bt); |
538 }; | 556 }; |
539 | 557 |
540 //------------------------------ExtractBNode--------------------------------------- | 558 //------------------------------ExtractBNode----------------------------------- |
541 // Extract a byte from a vector at position "pos" | 559 // Extract a byte from a vector at position "pos" |
542 class ExtractBNode : public ExtractNode { | 560 class ExtractBNode : public ExtractNode { |
543 public: | 561 public: |
544 ExtractBNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} | 562 ExtractBNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} |
545 virtual int Opcode() const; | 563 virtual int Opcode() const; |
546 virtual const Type *bottom_type() const { return TypeInt::INT; } | 564 virtual const Type *bottom_type() const { return TypeInt::INT; } |
547 virtual uint ideal_reg() const { return Op_RegI; } | 565 virtual uint ideal_reg() const { return Op_RegI; } |
548 }; | 566 }; |
549 | 567 |
550 //------------------------------ExtractUBNode-------------------------------------- | 568 //------------------------------ExtractUBNode---------------------------------- |
551 // Extract a boolean from a vector at position "pos" | 569 // Extract a boolean from a vector at position "pos" |
552 class ExtractUBNode : public ExtractNode { | 570 class ExtractUBNode : public ExtractNode { |
553 public: | 571 public: |
554 ExtractUBNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} | 572 ExtractUBNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} |
555 virtual int Opcode() const; | 573 virtual int Opcode() const; |
556 virtual const Type *bottom_type() const { return TypeInt::INT; } | 574 virtual const Type *bottom_type() const { return TypeInt::INT; } |
557 virtual uint ideal_reg() const { return Op_RegI; } | 575 virtual uint ideal_reg() const { return Op_RegI; } |
558 }; | 576 }; |
559 | 577 |
560 //------------------------------ExtractCNode--------------------------------------- | 578 //------------------------------ExtractCNode----------------------------------- |
561 // Extract a char from a vector at position "pos" | 579 // Extract a char from a vector at position "pos" |
562 class ExtractCNode : public ExtractNode { | 580 class ExtractCNode : public ExtractNode { |
563 public: | 581 public: |
564 ExtractCNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} | 582 ExtractCNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} |
565 virtual int Opcode() const; | 583 virtual int Opcode() const; |
566 virtual const Type *bottom_type() const { return TypeInt::INT; } | 584 virtual const Type *bottom_type() const { return TypeInt::INT; } |
567 virtual uint ideal_reg() const { return Op_RegI; } | 585 virtual uint ideal_reg() const { return Op_RegI; } |
568 }; | 586 }; |
569 | 587 |
570 //------------------------------ExtractSNode--------------------------------------- | 588 //------------------------------ExtractSNode----------------------------------- |
571 // Extract a short from a vector at position "pos" | 589 // Extract a short from a vector at position "pos" |
572 class ExtractSNode : public ExtractNode { | 590 class ExtractSNode : public ExtractNode { |
573 public: | 591 public: |
574 ExtractSNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} | 592 ExtractSNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} |
575 virtual int Opcode() const; | 593 virtual int Opcode() const; |
576 virtual const Type *bottom_type() const { return TypeInt::INT; } | 594 virtual const Type *bottom_type() const { return TypeInt::INT; } |
577 virtual uint ideal_reg() const { return Op_RegI; } | 595 virtual uint ideal_reg() const { return Op_RegI; } |
578 }; | 596 }; |
579 | 597 |
580 //------------------------------ExtractINode--------------------------------------- | 598 //------------------------------ExtractINode----------------------------------- |
581 // Extract an int from a vector at position "pos" | 599 // Extract an int from a vector at position "pos" |
582 class ExtractINode : public ExtractNode { | 600 class ExtractINode : public ExtractNode { |
583 public: | 601 public: |
584 ExtractINode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} | 602 ExtractINode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} |
585 virtual int Opcode() const; | 603 virtual int Opcode() const; |
586 virtual const Type *bottom_type() const { return TypeInt::INT; } | 604 virtual const Type *bottom_type() const { return TypeInt::INT; } |
587 virtual uint ideal_reg() const { return Op_RegI; } | 605 virtual uint ideal_reg() const { return Op_RegI; } |
588 }; | 606 }; |
589 | 607 |
590 //------------------------------ExtractLNode--------------------------------------- | 608 //------------------------------ExtractLNode----------------------------------- |
591 // Extract a long from a vector at position "pos" | 609 // Extract a long from a vector at position "pos" |
592 class ExtractLNode : public ExtractNode { | 610 class ExtractLNode : public ExtractNode { |
593 public: | 611 public: |
594 ExtractLNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} | 612 ExtractLNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} |
595 virtual int Opcode() const; | 613 virtual int Opcode() const; |
596 virtual const Type *bottom_type() const { return TypeLong::LONG; } | 614 virtual const Type *bottom_type() const { return TypeLong::LONG; } |
597 virtual uint ideal_reg() const { return Op_RegL; } | 615 virtual uint ideal_reg() const { return Op_RegL; } |
598 }; | 616 }; |
599 | 617 |
600 //------------------------------ExtractFNode--------------------------------------- | 618 //------------------------------ExtractFNode----------------------------------- |
601 // Extract a float from a vector at position "pos" | 619 // Extract a float from a vector at position "pos" |
602 class ExtractFNode : public ExtractNode { | 620 class ExtractFNode : public ExtractNode { |
603 public: | 621 public: |
604 ExtractFNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} | 622 ExtractFNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} |
605 virtual int Opcode() const; | 623 virtual int Opcode() const; |
606 virtual const Type *bottom_type() const { return Type::FLOAT; } | 624 virtual const Type *bottom_type() const { return Type::FLOAT; } |
607 virtual uint ideal_reg() const { return Op_RegF; } | 625 virtual uint ideal_reg() const { return Op_RegF; } |
608 }; | 626 }; |
609 | 627 |
610 //------------------------------ExtractDNode--------------------------------------- | 628 //------------------------------ExtractDNode----------------------------------- |
611 // Extract a double from a vector at position "pos" | 629 // Extract a double from a vector at position "pos" |
612 class ExtractDNode : public ExtractNode { | 630 class ExtractDNode : public ExtractNode { |
613 public: | 631 public: |
614 ExtractDNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} | 632 ExtractDNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} |
615 virtual int Opcode() const; | 633 virtual int Opcode() const; |