Mercurial > hg > graal-jvmci-8
comparison src/share/vm/opto/vectornode.hpp @ 6614:006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
Summary: Added asm encoding and mach nodes for vector arithmetic instructions on x86.
Reviewed-by: roland
author | kvn |
---|---|
date | Mon, 20 Aug 2012 09:07:21 -0700 |
parents | 8c92982cbbc4 |
children | 5af51c882207 |
comparison
equal
deleted
inserted
replaced
6594:d5ec46c7da5c | 6614:006050192a5a |
---|---|
44 init_req(2, n2); | 44 init_req(2, n2); |
45 } | 45 } |
46 | 46 |
47 const TypeVect* vect_type() const { return type()->is_vect(); } | 47 const TypeVect* vect_type() const { return type()->is_vect(); } |
48 uint length() const { return vect_type()->length(); } // Vector length | 48 uint length() const { return vect_type()->length(); } // Vector length |
49 uint length_in_bytes() const { return vect_type()->length_in_bytes(); } | |
49 | 50 |
50 virtual int Opcode() const; | 51 virtual int Opcode() const; |
51 | 52 |
52 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()); } |
53 | 54 |
55 | 56 |
56 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); |
57 | 58 |
58 static int opcode(int opc, uint vlen, BasicType bt); | 59 static int opcode(int opc, uint vlen, BasicType bt); |
59 static bool implemented(int opc, uint vlen, BasicType bt); | 60 static bool implemented(int opc, uint vlen, BasicType bt); |
60 | 61 static bool is_shift(Node* n); |
62 static bool is_invariant_vector(Node* n); | |
61 }; | 63 }; |
62 | 64 |
63 //===========================Vector=ALU=Operations==================================== | 65 //===========================Vector=ALU=Operations==================================== |
64 | 66 |
65 //------------------------------AddVBNode--------------------------------------- | 67 //------------------------------AddVBNode--------------------------------------- |
156 public: | 158 public: |
157 SubVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 159 SubVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
158 virtual int Opcode() const; | 160 virtual int Opcode() const; |
159 }; | 161 }; |
160 | 162 |
163 //------------------------------MulVSNode--------------------------------------- | |
164 // Vector multiply short | |
165 class MulVSNode : public VectorNode { | |
166 public: | |
167 MulVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | |
168 virtual int Opcode() const; | |
169 }; | |
170 | |
171 //------------------------------MulVINode--------------------------------------- | |
172 // Vector multiply int | |
173 class MulVINode : public VectorNode { | |
174 public: | |
175 MulVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | |
176 virtual int Opcode() const; | |
177 }; | |
178 | |
161 //------------------------------MulVFNode--------------------------------------- | 179 //------------------------------MulVFNode--------------------------------------- |
162 // Vector multiply float | 180 // Vector multiply float |
163 class MulVFNode : public VectorNode { | 181 class MulVFNode : public VectorNode { |
164 public: | 182 public: |
165 MulVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 183 MulVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
189 DivVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 207 DivVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
190 virtual int Opcode() const; | 208 virtual int Opcode() const; |
191 }; | 209 }; |
192 | 210 |
193 //------------------------------LShiftVBNode--------------------------------------- | 211 //------------------------------LShiftVBNode--------------------------------------- |
194 // Vector lshift byte | 212 // Vector left shift bytes |
195 class LShiftVBNode : public VectorNode { | 213 class LShiftVBNode : public VectorNode { |
196 public: | 214 public: |
197 LShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 215 LShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
198 virtual int Opcode() const; | 216 virtual int Opcode() const; |
199 }; | 217 }; |
200 | 218 |
201 //------------------------------LShiftVSNode--------------------------------------- | 219 //------------------------------LShiftVSNode--------------------------------------- |
202 // Vector lshift shorts | 220 // Vector left shift shorts |
203 class LShiftVSNode : public VectorNode { | 221 class LShiftVSNode : public VectorNode { |
204 public: | 222 public: |
205 LShiftVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 223 LShiftVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
206 virtual int Opcode() const; | 224 virtual int Opcode() const; |
207 }; | 225 }; |
208 | 226 |
209 //------------------------------LShiftVINode--------------------------------------- | 227 //------------------------------LShiftVINode--------------------------------------- |
210 // Vector lshift ints | 228 // Vector left shift ints |
211 class LShiftVINode : public VectorNode { | 229 class LShiftVINode : public VectorNode { |
212 public: | 230 public: |
213 LShiftVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 231 LShiftVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
214 virtual int Opcode() const; | 232 virtual int Opcode() const; |
215 }; | 233 }; |
216 | 234 |
235 //------------------------------LShiftVLNode--------------------------------------- | |
236 // Vector left shift longs | |
237 class LShiftVLNode : public VectorNode { | |
238 public: | |
239 LShiftVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | |
240 virtual int Opcode() const; | |
241 }; | |
242 | |
243 //------------------------------RShiftVBNode--------------------------------------- | |
244 // Vector right arithmetic (signed) shift bytes | |
245 class RShiftVBNode : public VectorNode { | |
246 public: | |
247 RShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | |
248 virtual int Opcode() const; | |
249 }; | |
250 | |
251 //------------------------------RShiftVSNode--------------------------------------- | |
252 // Vector right arithmetic (signed) shift shorts | |
253 class RShiftVSNode : public VectorNode { | |
254 public: | |
255 RShiftVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | |
256 virtual int Opcode() const; | |
257 }; | |
258 | |
259 //------------------------------RShiftVINode--------------------------------------- | |
260 // Vector right arithmetic (signed) shift ints | |
261 class RShiftVINode : public VectorNode { | |
262 public: | |
263 RShiftVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | |
264 virtual int Opcode() const; | |
265 }; | |
266 | |
267 //------------------------------RShiftVLNode--------------------------------------- | |
268 // Vector right arithmetic (signed) shift longs | |
269 class RShiftVLNode : public VectorNode { | |
270 public: | |
271 RShiftVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | |
272 virtual int Opcode() const; | |
273 }; | |
274 | |
217 //------------------------------URShiftVBNode--------------------------------------- | 275 //------------------------------URShiftVBNode--------------------------------------- |
218 // Vector urshift bytes | 276 // Vector right logical (unsigned) shift bytes |
219 class RShiftVBNode : public VectorNode { | 277 class URShiftVBNode : public VectorNode { |
220 public: | 278 public: |
221 RShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 279 URShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
222 virtual int Opcode() const; | 280 virtual int Opcode() const; |
223 }; | 281 }; |
224 | 282 |
225 //------------------------------URShiftVSNode--------------------------------------- | 283 //------------------------------URShiftVSNode--------------------------------------- |
226 // Vector urshift shorts | 284 // Vector right logical (unsigned) shift shorts |
227 class RShiftVSNode : public VectorNode { | 285 class URShiftVSNode : public VectorNode { |
228 public: | 286 public: |
229 RShiftVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 287 URShiftVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
230 virtual int Opcode() const; | 288 virtual int Opcode() const; |
231 }; | 289 }; |
232 | 290 |
233 //------------------------------URShiftVINode--------------------------------------- | 291 //------------------------------URShiftVINode--------------------------------------- |
234 // Vector urshift ints | 292 // Vector right logical (unsigned) shift ints |
235 class RShiftVINode : public VectorNode { | 293 class URShiftVINode : public VectorNode { |
236 public: | 294 public: |
237 RShiftVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 295 URShiftVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
238 virtual int Opcode() const; | 296 virtual int Opcode() const; |
239 }; | 297 }; |
298 | |
299 //------------------------------URShiftVLNode--------------------------------------- | |
300 // Vector right logical (unsigned) shift longs | |
301 class URShiftVLNode : public VectorNode { | |
302 public: | |
303 URShiftVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | |
304 virtual int Opcode() const; | |
305 }; | |
306 | |
240 | 307 |
241 //------------------------------AndVNode--------------------------------------- | 308 //------------------------------AndVNode--------------------------------------- |
242 // Vector and | 309 // Vector and integer |
243 class AndVNode : public VectorNode { | 310 class AndVNode : public VectorNode { |
244 public: | 311 public: |
245 AndVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 312 AndVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
246 virtual int Opcode() const; | 313 virtual int Opcode() const; |
247 }; | 314 }; |
248 | 315 |
249 //------------------------------OrVNode--------------------------------------- | 316 //------------------------------OrVNode--------------------------------------- |
250 // Vector or | 317 // Vector or integer |
251 class OrVNode : public VectorNode { | 318 class OrVNode : public VectorNode { |
252 public: | 319 public: |
253 OrVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 320 OrVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
254 virtual int Opcode() const; | 321 virtual int Opcode() const; |
255 }; | 322 }; |
256 | 323 |
257 //------------------------------XorVNode--------------------------------------- | 324 //------------------------------XorVNode--------------------------------------- |
258 // Vector xor | 325 // Vector xor integer |
259 class XorVNode : public VectorNode { | 326 class XorVNode : public VectorNode { |
260 public: | 327 public: |
261 XorVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} | 328 XorVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
262 virtual int Opcode() const; | 329 virtual int Opcode() const; |
263 }; | 330 }; |