1
|
1 |
/*
|
|
2 |
* Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
|
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
4 |
*
|
|
5 |
* This code is free software; you can redistribute it and/or modify it
|
|
6 |
* under the terms of the GNU General Public License version 2 only, as
|
|
7 |
* published by the Free Software Foundation.
|
|
8 |
*
|
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that
|
|
13 |
* accompanied this code).
|
|
14 |
*
|
|
15 |
* You should have received a copy of the GNU General Public License version
|
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
18 |
*
|
|
19 |
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
|
20 |
* CA 95054 USA or visit www.sun.com if you need additional information or
|
|
21 |
* have any questions.
|
|
22 |
*/
|
|
23 |
|
|
24 |
//------------------------------VectorNode--------------------------------------
|
|
25 |
// Vector Operation
|
|
26 |
class VectorNode : public Node {
|
|
27 |
protected:
|
|
28 |
uint _length; // vector length
|
|
29 |
virtual BasicType elt_basic_type() const = 0; // Vector element basic type
|
|
30 |
|
|
31 |
static const Type* vect_type(BasicType elt_bt, uint len);
|
|
32 |
static const Type* vect_type(const Type* elt_type, uint len) {
|
|
33 |
return vect_type(elt_type->array_element_basic_type(), len);
|
|
34 |
}
|
|
35 |
|
|
36 |
public:
|
|
37 |
friend class VectorLoadNode; // For vect_type
|
|
38 |
friend class VectorStoreNode; // ditto.
|
|
39 |
|
|
40 |
VectorNode(Node* n1, uint vlen) : Node(NULL, n1), _length(vlen) {
|
|
41 |
init_flags(Flag_is_Vector);
|
|
42 |
}
|
|
43 |
VectorNode(Node* n1, Node* n2, uint vlen) : Node(NULL, n1, n2), _length(vlen) {
|
|
44 |
init_flags(Flag_is_Vector);
|
|
45 |
}
|
|
46 |
virtual int Opcode() const;
|
|
47 |
|
|
48 |
uint length() const { return _length; } // Vector length
|
|
49 |
|
|
50 |
static uint max_vlen(BasicType bt) { // max vector length
|
|
51 |
return (uint)(Matcher::vector_width_in_bytes() / type2aelembytes[bt]);
|
|
52 |
}
|
|
53 |
|
|
54 |
// Element and vector type
|
|
55 |
const Type* elt_type() const { return Type::get_const_basic_type(elt_basic_type()); }
|
|
56 |
const Type* vect_type() const { return vect_type(elt_basic_type(), length()); }
|
|
57 |
|
|
58 |
virtual const Type *bottom_type() const { return vect_type(); }
|
|
59 |
virtual uint ideal_reg() const { return Matcher::vector_ideal_reg(); }
|
|
60 |
|
|
61 |
// Vector opcode from scalar opcode
|
|
62 |
static int opcode(int sopc, uint vlen, const Type* opd_t);
|
|
63 |
|
|
64 |
static VectorNode* scalar2vector(Compile* C, Node* s, uint vlen, const Type* opd_t);
|
|
65 |
|
|
66 |
static VectorNode* make(Compile* C, int sopc, Node* n1, Node* n2, uint vlen, const Type* elt_t);
|
|
67 |
|
|
68 |
};
|
|
69 |
|
|
70 |
//===========================Vector=ALU=Operations====================================
|
|
71 |
|
|
72 |
//------------------------------AddVBNode---------------------------------------
|
|
73 |
// Vector add byte
|
|
74 |
class AddVBNode : public VectorNode {
|
|
75 |
protected:
|
|
76 |
virtual BasicType elt_basic_type() const { return T_BYTE; }
|
|
77 |
public:
|
|
78 |
AddVBNode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
79 |
virtual int Opcode() const;
|
|
80 |
};
|
|
81 |
|
|
82 |
//------------------------------AddVCNode---------------------------------------
|
|
83 |
// Vector add char
|
|
84 |
class AddVCNode : public VectorNode {
|
|
85 |
protected:
|
|
86 |
virtual BasicType elt_basic_type() const { return T_CHAR; }
|
|
87 |
public:
|
|
88 |
AddVCNode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
89 |
virtual int Opcode() const;
|
|
90 |
};
|
|
91 |
|
|
92 |
//------------------------------AddVSNode---------------------------------------
|
|
93 |
// Vector add short
|
|
94 |
class AddVSNode : public VectorNode {
|
|
95 |
protected:
|
|
96 |
virtual BasicType elt_basic_type() const { return T_SHORT; }
|
|
97 |
public:
|
|
98 |
AddVSNode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
99 |
virtual int Opcode() const;
|
|
100 |
};
|
|
101 |
|
|
102 |
//------------------------------AddVINode---------------------------------------
|
|
103 |
// Vector add int
|
|
104 |
class AddVINode : public VectorNode {
|
|
105 |
protected:
|
|
106 |
virtual BasicType elt_basic_type() const { return T_INT; }
|
|
107 |
public:
|
|
108 |
AddVINode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
109 |
virtual int Opcode() const;
|
|
110 |
};
|
|
111 |
|
|
112 |
//------------------------------AddVLNode---------------------------------------
|
|
113 |
// Vector add long
|
|
114 |
class AddVLNode : public VectorNode {
|
|
115 |
protected:
|
|
116 |
virtual BasicType elt_basic_type() const { return T_LONG; }
|
|
117 |
public:
|
|
118 |
AddVLNode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
119 |
virtual int Opcode() const;
|
|
120 |
};
|
|
121 |
|
|
122 |
//------------------------------AddVFNode---------------------------------------
|
|
123 |
// Vector add float
|
|
124 |
class AddVFNode : public VectorNode {
|
|
125 |
protected:
|
|
126 |
virtual BasicType elt_basic_type() const { return T_FLOAT; }
|
|
127 |
public:
|
|
128 |
AddVFNode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
129 |
virtual int Opcode() const;
|
|
130 |
};
|
|
131 |
|
|
132 |
//------------------------------AddVDNode---------------------------------------
|
|
133 |
// Vector add double
|
|
134 |
class AddVDNode : public VectorNode {
|
|
135 |
protected:
|
|
136 |
virtual BasicType elt_basic_type() const { return T_DOUBLE; }
|
|
137 |
public:
|
|
138 |
AddVDNode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
139 |
virtual int Opcode() const;
|
|
140 |
};
|
|
141 |
|
|
142 |
//------------------------------SubVBNode---------------------------------------
|
|
143 |
// Vector subtract byte
|
|
144 |
class SubVBNode : public VectorNode {
|
|
145 |
protected:
|
|
146 |
virtual BasicType elt_basic_type() const { return T_BYTE; }
|
|
147 |
public:
|
|
148 |
SubVBNode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
149 |
virtual int Opcode() const;
|
|
150 |
};
|
|
151 |
|
|
152 |
//------------------------------SubVCNode---------------------------------------
|
|
153 |
// Vector subtract char
|
|
154 |
class SubVCNode : public VectorNode {
|
|
155 |
protected:
|
|
156 |
virtual BasicType elt_basic_type() const { return T_CHAR; }
|
|
157 |
public:
|
|
158 |
SubVCNode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
159 |
virtual int Opcode() const;
|
|
160 |
};
|
|
161 |
|
|
162 |
//------------------------------SubVSNode---------------------------------------
|
|
163 |
// Vector subtract short
|
|
164 |
class SubVSNode : public VectorNode {
|
|
165 |
protected:
|
|
166 |
virtual BasicType elt_basic_type() const { return T_SHORT; }
|
|
167 |
public:
|
|
168 |
SubVSNode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
169 |
virtual int Opcode() const;
|
|
170 |
};
|
|
171 |
|
|
172 |
//------------------------------SubVINode---------------------------------------
|
|
173 |
// Vector subtract int
|
|
174 |
class SubVINode : public VectorNode {
|
|
175 |
protected:
|
|
176 |
virtual BasicType elt_basic_type() const { return T_INT; }
|
|
177 |
public:
|
|
178 |
SubVINode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
179 |
virtual int Opcode() const;
|
|
180 |
};
|
|
181 |
|
|
182 |
//------------------------------SubVLNode---------------------------------------
|
|
183 |
// Vector subtract long
|
|
184 |
class SubVLNode : public VectorNode {
|
|
185 |
protected:
|
|
186 |
virtual BasicType elt_basic_type() const { return T_LONG; }
|
|
187 |
public:
|
|
188 |
SubVLNode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
189 |
virtual int Opcode() const;
|
|
190 |
};
|
|
191 |
|
|
192 |
//------------------------------SubVFNode---------------------------------------
|
|
193 |
// Vector subtract float
|
|
194 |
class SubVFNode : public VectorNode {
|
|
195 |
protected:
|
|
196 |
virtual BasicType elt_basic_type() const { return T_FLOAT; }
|
|
197 |
public:
|
|
198 |
SubVFNode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
199 |
virtual int Opcode() const;
|
|
200 |
};
|
|
201 |
|
|
202 |
//------------------------------SubVDNode---------------------------------------
|
|
203 |
// Vector subtract double
|
|
204 |
class SubVDNode : public VectorNode {
|
|
205 |
protected:
|
|
206 |
virtual BasicType elt_basic_type() const { return T_DOUBLE; }
|
|
207 |
public:
|
|
208 |
SubVDNode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
209 |
virtual int Opcode() const;
|
|
210 |
};
|
|
211 |
|
|
212 |
//------------------------------MulVFNode---------------------------------------
|
|
213 |
// Vector multiply float
|
|
214 |
class MulVFNode : public VectorNode {
|
|
215 |
protected:
|
|
216 |
virtual BasicType elt_basic_type() const { return T_FLOAT; }
|
|
217 |
public:
|
|
218 |
MulVFNode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
219 |
virtual int Opcode() const;
|
|
220 |
};
|
|
221 |
|
|
222 |
//------------------------------MulVDNode---------------------------------------
|
|
223 |
// Vector multiply double
|
|
224 |
class MulVDNode : public VectorNode {
|
|
225 |
protected:
|
|
226 |
virtual BasicType elt_basic_type() const { return T_DOUBLE; }
|
|
227 |
public:
|
|
228 |
MulVDNode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
229 |
virtual int Opcode() const;
|
|
230 |
};
|
|
231 |
|
|
232 |
//------------------------------DivVFNode---------------------------------------
|
|
233 |
// Vector divide float
|
|
234 |
class DivVFNode : public VectorNode {
|
|
235 |
protected:
|
|
236 |
virtual BasicType elt_basic_type() const { return T_FLOAT; }
|
|
237 |
public:
|
|
238 |
DivVFNode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
239 |
virtual int Opcode() const;
|
|
240 |
};
|
|
241 |
|
|
242 |
//------------------------------DivVDNode---------------------------------------
|
|
243 |
// Vector Divide double
|
|
244 |
class DivVDNode : public VectorNode {
|
|
245 |
protected:
|
|
246 |
virtual BasicType elt_basic_type() const { return T_DOUBLE; }
|
|
247 |
public:
|
|
248 |
DivVDNode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
249 |
virtual int Opcode() const;
|
|
250 |
};
|
|
251 |
|
|
252 |
//------------------------------LShiftVBNode---------------------------------------
|
|
253 |
// Vector lshift byte
|
|
254 |
class LShiftVBNode : public VectorNode {
|
|
255 |
protected:
|
|
256 |
virtual BasicType elt_basic_type() const { return T_BYTE; }
|
|
257 |
public:
|
|
258 |
LShiftVBNode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
259 |
virtual int Opcode() const;
|
|
260 |
};
|
|
261 |
|
|
262 |
//------------------------------LShiftVCNode---------------------------------------
|
|
263 |
// Vector lshift chars
|
|
264 |
class LShiftVCNode : public VectorNode {
|
|
265 |
protected:
|
|
266 |
virtual BasicType elt_basic_type() const { return T_CHAR; }
|
|
267 |
public:
|
|
268 |
LShiftVCNode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
269 |
virtual int Opcode() const;
|
|
270 |
};
|
|
271 |
|
|
272 |
//------------------------------LShiftVSNode---------------------------------------
|
|
273 |
// Vector lshift shorts
|
|
274 |
class LShiftVSNode : public VectorNode {
|
|
275 |
protected:
|
|
276 |
virtual BasicType elt_basic_type() const { return T_SHORT; }
|
|
277 |
public:
|
|
278 |
LShiftVSNode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
279 |
virtual int Opcode() const;
|
|
280 |
};
|
|
281 |
|
|
282 |
//------------------------------LShiftVINode---------------------------------------
|
|
283 |
// Vector lshift ints
|
|
284 |
class LShiftVINode : public VectorNode {
|
|
285 |
protected:
|
|
286 |
virtual BasicType elt_basic_type() const { return T_INT; }
|
|
287 |
public:
|
|
288 |
LShiftVINode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
289 |
virtual int Opcode() const;
|
|
290 |
};
|
|
291 |
|
|
292 |
//------------------------------URShiftVBNode---------------------------------------
|
|
293 |
// Vector urshift bytes
|
|
294 |
class URShiftVBNode : public VectorNode {
|
|
295 |
protected:
|
|
296 |
virtual BasicType elt_basic_type() const { return T_BYTE; }
|
|
297 |
public:
|
|
298 |
URShiftVBNode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
299 |
virtual int Opcode() const;
|
|
300 |
};
|
|
301 |
|
|
302 |
//------------------------------URShiftVCNode---------------------------------------
|
|
303 |
// Vector urshift char
|
|
304 |
class URShiftVCNode : public VectorNode {
|
|
305 |
protected:
|
|
306 |
virtual BasicType elt_basic_type() const { return T_SHORT; }
|
|
307 |
public:
|
|
308 |
URShiftVCNode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
309 |
virtual int Opcode() const;
|
|
310 |
};
|
|
311 |
|
|
312 |
//------------------------------URShiftVSNode---------------------------------------
|
|
313 |
// Vector urshift shorts
|
|
314 |
class URShiftVSNode : public VectorNode {
|
|
315 |
protected:
|
|
316 |
virtual BasicType elt_basic_type() const { return T_SHORT; }
|
|
317 |
public:
|
|
318 |
URShiftVSNode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
319 |
virtual int Opcode() const;
|
|
320 |
};
|
|
321 |
|
|
322 |
//------------------------------URShiftVINode---------------------------------------
|
|
323 |
// Vector urshift ints
|
|
324 |
class URShiftVINode : public VectorNode {
|
|
325 |
protected:
|
|
326 |
virtual BasicType elt_basic_type() const { return T_INT; }
|
|
327 |
public:
|
|
328 |
URShiftVINode(Node* in1, Node* in2, uint vlen) : VectorNode(in1,in2,vlen) {}
|
|
329 |
virtual int Opcode() const;
|
|
330 |
};
|
|
331 |
|
|
332 |
//------------------------------AndVNode---------------------------------------
|
|
333 |
// Vector and
|
|
334 |
class AndVNode : public VectorNode {
|
|
335 |
protected:
|
|
336 |
BasicType _bt;
|
|
337 |
virtual BasicType elt_basic_type() const { return _bt; }
|
|
338 |
public:
|
|
339 |
AndVNode(Node* in1, Node* in2, uint vlen, BasicType bt) : VectorNode(in1,in2,vlen), _bt(bt) {}
|
|
340 |
virtual int Opcode() const;
|
|
341 |
};
|
|
342 |
|
|
343 |
//------------------------------OrVNode---------------------------------------
|
|
344 |
// Vector or
|
|
345 |
class OrVNode : public VectorNode {
|
|
346 |
protected:
|
|
347 |
BasicType _bt;
|
|
348 |
virtual BasicType elt_basic_type() const { return _bt; }
|
|
349 |
public:
|
|
350 |
OrVNode(Node* in1, Node* in2, uint vlen, BasicType bt) : VectorNode(in1,in2,vlen), _bt(bt) {}
|
|
351 |
virtual int Opcode() const;
|
|
352 |
};
|
|
353 |
|
|
354 |
//------------------------------XorVNode---------------------------------------
|
|
355 |
// Vector xor
|
|
356 |
class XorVNode : public VectorNode {
|
|
357 |
protected:
|
|
358 |
BasicType _bt;
|
|
359 |
virtual BasicType elt_basic_type() const { return _bt; }
|
|
360 |
public:
|
|
361 |
XorVNode(Node* in1, Node* in2, uint vlen, BasicType bt) : VectorNode(in1,in2,vlen), _bt(bt) {}
|
|
362 |
virtual int Opcode() const;
|
|
363 |
};
|
|
364 |
|
|
365 |
//================================= M E M O R Y ==================================
|
|
366 |
|
|
367 |
|
|
368 |
//------------------------------VectorLoadNode--------------------------------------
|
|
369 |
// Vector Load from memory
|
|
370 |
class VectorLoadNode : public LoadNode {
|
|
371 |
virtual uint size_of() const { return sizeof(*this); }
|
|
372 |
|
|
373 |
protected:
|
|
374 |
virtual BasicType elt_basic_type() const = 0; // Vector element basic type
|
|
375 |
// For use in constructor
|
|
376 |
static const Type* vect_type(const Type* elt_type, uint len) {
|
|
377 |
return VectorNode::vect_type(elt_type, len);
|
|
378 |
}
|
|
379 |
|
|
380 |
public:
|
|
381 |
VectorLoadNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const Type *rt)
|
|
382 |
: LoadNode(c,mem,adr,at,rt) {
|
|
383 |
init_flags(Flag_is_Vector);
|
|
384 |
}
|
|
385 |
virtual int Opcode() const;
|
|
386 |
|
|
387 |
virtual uint length() const = 0; // Vector length
|
|
388 |
|
|
389 |
// Element and vector type
|
|
390 |
const Type* elt_type() const { return Type::get_const_basic_type(elt_basic_type()); }
|
|
391 |
const Type* vect_type() const { return VectorNode::vect_type(elt_basic_type(), length()); }
|
|
392 |
|
|
393 |
virtual uint ideal_reg() const { return Matcher::vector_ideal_reg(); }
|
|
394 |
virtual BasicType memory_type() const { return T_VOID; }
|
|
395 |
virtual int memory_size() const { return length()*type2aelembytes[elt_basic_type()]; }
|
|
396 |
|
|
397 |
// Vector opcode from scalar opcode
|
|
398 |
static int opcode(int sopc, uint vlen);
|
|
399 |
|
|
400 |
static VectorLoadNode* make(Compile* C, int opc, Node* ctl, Node* mem,
|
|
401 |
Node* adr, const TypePtr* atyp, uint vlen);
|
|
402 |
};
|
|
403 |
|
|
404 |
//------------------------------Load16BNode--------------------------------------
|
|
405 |
// Vector load of 16 bytes (8bits signed) from memory
|
|
406 |
class Load16BNode : public VectorLoadNode {
|
|
407 |
protected:
|
|
408 |
virtual BasicType elt_basic_type() const { return T_BYTE; }
|
|
409 |
public:
|
|
410 |
Load16BNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeInt *ti = TypeInt::BYTE)
|
|
411 |
: VectorLoadNode(c,mem,adr,at,vect_type(ti,16)) {}
|
|
412 |
virtual int Opcode() const;
|
|
413 |
virtual int store_Opcode() const { return Op_Store16B; }
|
|
414 |
virtual uint length() const { return 16; }
|
|
415 |
};
|
|
416 |
|
|
417 |
//------------------------------Load8BNode--------------------------------------
|
|
418 |
// Vector load of 8 bytes (8bits signed) from memory
|
|
419 |
class Load8BNode : public VectorLoadNode {
|
|
420 |
protected:
|
|
421 |
virtual BasicType elt_basic_type() const { return T_BYTE; }
|
|
422 |
public:
|
|
423 |
Load8BNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeInt *ti = TypeInt::BYTE)
|
|
424 |
: VectorLoadNode(c,mem,adr,at,vect_type(ti,8)) {}
|
|
425 |
virtual int Opcode() const;
|
|
426 |
virtual int store_Opcode() const { return Op_Store8B; }
|
|
427 |
virtual uint length() const { return 8; }
|
|
428 |
};
|
|
429 |
|
|
430 |
//------------------------------Load4BNode--------------------------------------
|
|
431 |
// Vector load of 4 bytes (8bits signed) from memory
|
|
432 |
class Load4BNode : public VectorLoadNode {
|
|
433 |
protected:
|
|
434 |
virtual BasicType elt_basic_type() const { return T_BYTE; }
|
|
435 |
public:
|
|
436 |
Load4BNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeInt *ti = TypeInt::BYTE)
|
|
437 |
: VectorLoadNode(c,mem,adr,at,vect_type(ti,4)) {}
|
|
438 |
virtual int Opcode() const;
|
|
439 |
virtual int store_Opcode() const { return Op_Store4B; }
|
|
440 |
virtual uint length() const { return 4; }
|
|
441 |
};
|
|
442 |
|
|
443 |
//------------------------------Load8CNode--------------------------------------
|
|
444 |
// Vector load of 8 chars (16bits unsigned) from memory
|
|
445 |
class Load8CNode : public VectorLoadNode {
|
|
446 |
protected:
|
|
447 |
virtual BasicType elt_basic_type() const { return T_CHAR; }
|
|
448 |
public:
|
|
449 |
Load8CNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeInt *ti = TypeInt::CHAR)
|
|
450 |
: VectorLoadNode(c,mem,adr,at,vect_type(ti,8)) {}
|
|
451 |
virtual int Opcode() const;
|
|
452 |
virtual int store_Opcode() const { return Op_Store8C; }
|
|
453 |
virtual uint length() const { return 8; }
|
|
454 |
};
|
|
455 |
|
|
456 |
//------------------------------Load4CNode--------------------------------------
|
|
457 |
// Vector load of 4 chars (16bits unsigned) from memory
|
|
458 |
class Load4CNode : public VectorLoadNode {
|
|
459 |
protected:
|
|
460 |
virtual BasicType elt_basic_type() const { return T_CHAR; }
|
|
461 |
public:
|
|
462 |
Load4CNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeInt *ti = TypeInt::CHAR)
|
|
463 |
: VectorLoadNode(c,mem,adr,at,vect_type(ti,4)) {}
|
|
464 |
virtual int Opcode() const;
|
|
465 |
virtual int store_Opcode() const { return Op_Store4C; }
|
|
466 |
virtual uint length() const { return 4; }
|
|
467 |
};
|
|
468 |
|
|
469 |
//------------------------------Load2CNode--------------------------------------
|
|
470 |
// Vector load of 2 chars (16bits unsigned) from memory
|
|
471 |
class Load2CNode : public VectorLoadNode {
|
|
472 |
protected:
|
|
473 |
virtual BasicType elt_basic_type() const { return T_CHAR; }
|
|
474 |
public:
|
|
475 |
Load2CNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeInt *ti = TypeInt::CHAR)
|
|
476 |
: VectorLoadNode(c,mem,adr,at,vect_type(ti,2)) {}
|
|
477 |
virtual int Opcode() const;
|
|
478 |
virtual int store_Opcode() const { return Op_Store2C; }
|
|
479 |
virtual uint length() const { return 2; }
|
|
480 |
};
|
|
481 |
|
|
482 |
//------------------------------Load8SNode--------------------------------------
|
|
483 |
// Vector load of 8 shorts (16bits signed) from memory
|
|
484 |
class Load8SNode : public VectorLoadNode {
|
|
485 |
protected:
|
|
486 |
virtual BasicType elt_basic_type() const { return T_SHORT; }
|
|
487 |
public:
|
|
488 |
Load8SNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeInt *ti = TypeInt::SHORT)
|
|
489 |
: VectorLoadNode(c,mem,adr,at,vect_type(ti,8)) {}
|
|
490 |
virtual int Opcode() const;
|
|
491 |
virtual int store_Opcode() const { return Op_Store8C; }
|
|
492 |
virtual uint length() const { return 8; }
|
|
493 |
};
|
|
494 |
|
|
495 |
//------------------------------Load4SNode--------------------------------------
|
|
496 |
// Vector load of 4 shorts (16bits signed) from memory
|
|
497 |
class Load4SNode : public VectorLoadNode {
|
|
498 |
protected:
|
|
499 |
virtual BasicType elt_basic_type() const { return T_SHORT; }
|
|
500 |
public:
|
|
501 |
Load4SNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeInt *ti = TypeInt::SHORT)
|
|
502 |
: VectorLoadNode(c,mem,adr,at,vect_type(ti,4)) {}
|
|
503 |
virtual int Opcode() const;
|
|
504 |
virtual int store_Opcode() const { return Op_Store4C; }
|
|
505 |
virtual uint length() const { return 4; }
|
|
506 |
};
|
|
507 |
|
|
508 |
//------------------------------Load2SNode--------------------------------------
|
|
509 |
// Vector load of 2 shorts (16bits signed) from memory
|
|
510 |
class Load2SNode : public VectorLoadNode {
|
|
511 |
protected:
|
|
512 |
virtual BasicType elt_basic_type() const { return T_SHORT; }
|
|
513 |
public:
|
|
514 |
Load2SNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeInt *ti = TypeInt::SHORT)
|
|
515 |
: VectorLoadNode(c,mem,adr,at,vect_type(ti,2)) {}
|
|
516 |
virtual int Opcode() const;
|
|
517 |
virtual int store_Opcode() const { return Op_Store2C; }
|
|
518 |
virtual uint length() const { return 2; }
|
|
519 |
};
|
|
520 |
|
|
521 |
//------------------------------Load4INode--------------------------------------
|
|
522 |
// Vector load of 4 integers (32bits signed) from memory
|
|
523 |
class Load4INode : public VectorLoadNode {
|
|
524 |
protected:
|
|
525 |
virtual BasicType elt_basic_type() const { return T_INT; }
|
|
526 |
public:
|
|
527 |
Load4INode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeInt *ti = TypeInt::INT)
|
|
528 |
: VectorLoadNode(c,mem,adr,at,vect_type(ti,4)) {}
|
|
529 |
virtual int Opcode() const;
|
|
530 |
virtual int store_Opcode() const { return Op_Store4I; }
|
|
531 |
virtual uint length() const { return 4; }
|
|
532 |
};
|
|
533 |
|
|
534 |
//------------------------------Load2INode--------------------------------------
|
|
535 |
// Vector load of 2 integers (32bits signed) from memory
|
|
536 |
class Load2INode : public VectorLoadNode {
|
|
537 |
protected:
|
|
538 |
virtual BasicType elt_basic_type() const { return T_INT; }
|
|
539 |
public:
|
|
540 |
Load2INode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeInt *ti = TypeInt::INT)
|
|
541 |
: VectorLoadNode(c,mem,adr,at,vect_type(ti,2)) {}
|
|
542 |
virtual int Opcode() const;
|
|
543 |
virtual int store_Opcode() const { return Op_Store2I; }
|
|
544 |
virtual uint length() const { return 2; }
|
|
545 |
};
|
|
546 |
|
|
547 |
//------------------------------Load2LNode--------------------------------------
|
|
548 |
// Vector load of 2 longs (64bits signed) from memory
|
|
549 |
class Load2LNode : public VectorLoadNode {
|
|
550 |
protected:
|
|
551 |
virtual BasicType elt_basic_type() const { return T_LONG; }
|
|
552 |
public:
|
|
553 |
Load2LNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeLong *tl = TypeLong::LONG)
|
|
554 |
: VectorLoadNode(c,mem,adr,at,vect_type(tl,2)) {}
|
|
555 |
virtual int Opcode() const;
|
|
556 |
virtual int store_Opcode() const { return Op_Store2L; }
|
|
557 |
virtual uint length() const { return 2; }
|
|
558 |
};
|
|
559 |
|
|
560 |
//------------------------------Load4FNode--------------------------------------
|
|
561 |
// Vector load of 4 floats (32bits) from memory
|
|
562 |
class Load4FNode : public VectorLoadNode {
|
|
563 |
protected:
|
|
564 |
virtual BasicType elt_basic_type() const { return T_FLOAT; }
|
|
565 |
public:
|
|
566 |
Load4FNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const Type *t = Type::FLOAT)
|
|
567 |
: VectorLoadNode(c,mem,adr,at,vect_type(t,4)) {}
|
|
568 |
virtual int Opcode() const;
|
|
569 |
virtual int store_Opcode() const { return Op_Store4F; }
|
|
570 |
virtual uint length() const { return 4; }
|
|
571 |
};
|
|
572 |
|
|
573 |
//------------------------------Load2FNode--------------------------------------
|
|
574 |
// Vector load of 2 floats (32bits) from memory
|
|
575 |
class Load2FNode : public VectorLoadNode {
|
|
576 |
protected:
|
|
577 |
virtual BasicType elt_basic_type() const { return T_FLOAT; }
|
|
578 |
public:
|
|
579 |
Load2FNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const Type *t = Type::FLOAT)
|
|
580 |
: VectorLoadNode(c,mem,adr,at,vect_type(t,2)) {}
|
|
581 |
virtual int Opcode() const;
|
|
582 |
virtual int store_Opcode() const { return Op_Store2F; }
|
|
583 |
virtual uint length() const { return 2; }
|
|
584 |
};
|
|
585 |
|
|
586 |
//------------------------------Load2DNode--------------------------------------
|
|
587 |
// Vector load of 2 doubles (64bits) from memory
|
|
588 |
class Load2DNode : public VectorLoadNode {
|
|
589 |
protected:
|
|
590 |
virtual BasicType elt_basic_type() const { return T_DOUBLE; }
|
|
591 |
public:
|
|
592 |
Load2DNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const Type *t = Type::DOUBLE)
|
|
593 |
: VectorLoadNode(c,mem,adr,at,vect_type(t,2)) {}
|
|
594 |
virtual int Opcode() const;
|
|
595 |
virtual int store_Opcode() const { return Op_Store2D; }
|
|
596 |
virtual uint length() const { return 2; }
|
|
597 |
};
|
|
598 |
|
|
599 |
|
|
600 |
//------------------------------VectorStoreNode--------------------------------------
|
|
601 |
// Vector Store to memory
|
|
602 |
class VectorStoreNode : public StoreNode {
|
|
603 |
virtual uint size_of() const { return sizeof(*this); }
|
|
604 |
|
|
605 |
protected:
|
|
606 |
virtual BasicType elt_basic_type() const = 0; // Vector element basic type
|
|
607 |
|
|
608 |
public:
|
|
609 |
VectorStoreNode(Node* c, Node* mem, Node* adr, const TypePtr* at, Node* val)
|
|
610 |
: StoreNode(c,mem,adr,at,val) {
|
|
611 |
init_flags(Flag_is_Vector);
|
|
612 |
}
|
|
613 |
virtual int Opcode() const;
|
|
614 |
|
|
615 |
virtual uint length() const = 0; // Vector length
|
|
616 |
|
|
617 |
// Element and vector type
|
|
618 |
const Type* elt_type() const { return Type::get_const_basic_type(elt_basic_type()); }
|
|
619 |
const Type* vect_type() const { return VectorNode::vect_type(elt_basic_type(), length()); }
|
|
620 |
|
|
621 |
virtual uint ideal_reg() const { return Matcher::vector_ideal_reg(); }
|
|
622 |
virtual BasicType memory_type() const { return T_VOID; }
|
|
623 |
virtual int memory_size() const { return length()*type2aelembytes[elt_basic_type()]; }
|
|
624 |
|
|
625 |
// Vector opcode from scalar opcode
|
|
626 |
static int opcode(int sopc, uint vlen);
|
|
627 |
|
|
628 |
static VectorStoreNode* make(Compile* C, int opc, Node* ctl, Node* mem,
|
|
629 |
Node* adr, const TypePtr* atyp, VectorNode* val,
|
|
630 |
uint vlen);
|
|
631 |
};
|
|
632 |
|
|
633 |
//------------------------------Store16BNode--------------------------------------
|
|
634 |
// Vector store of 16 bytes (8bits signed) to memory
|
|
635 |
class Store16BNode : public VectorStoreNode {
|
|
636 |
protected:
|
|
637 |
virtual BasicType elt_basic_type() const { return T_BYTE; }
|
|
638 |
public:
|
|
639 |
Store16BNode(Node* c, Node* mem, Node* adr, const TypePtr* at, Node* val)
|
|
640 |
: VectorStoreNode(c,mem,adr,at,val) {}
|
|
641 |
virtual int Opcode() const;
|
|
642 |
virtual uint length() const { return 16; }
|
|
643 |
};
|
|
644 |
|
|
645 |
//------------------------------Store8BNode--------------------------------------
|
|
646 |
// Vector store of 8 bytes (8bits signed) to memory
|
|
647 |
class Store8BNode : public VectorStoreNode {
|
|
648 |
protected:
|
|
649 |
virtual BasicType elt_basic_type() const { return T_BYTE; }
|
|
650 |
public:
|
|
651 |
Store8BNode(Node* c, Node* mem, Node* adr, const TypePtr* at, Node* val)
|
|
652 |
: VectorStoreNode(c,mem,adr,at,val) {}
|
|
653 |
virtual int Opcode() const;
|
|
654 |
virtual uint length() const { return 8; }
|
|
655 |
};
|
|
656 |
|
|
657 |
//------------------------------Store4BNode--------------------------------------
|
|
658 |
// Vector store of 4 bytes (8bits signed) to memory
|
|
659 |
class Store4BNode : public VectorStoreNode {
|
|
660 |
protected:
|
|
661 |
virtual BasicType elt_basic_type() const { return T_BYTE; }
|
|
662 |
public:
|
|
663 |
Store4BNode(Node* c, Node* mem, Node* adr, const TypePtr* at, Node* val)
|
|
664 |
: VectorStoreNode(c,mem,adr,at,val) {}
|
|
665 |
virtual int Opcode() const;
|
|
666 |
virtual uint length() const { return 4; }
|
|
667 |
};
|
|
668 |
|
|
669 |
//------------------------------Store8CNode--------------------------------------
|
|
670 |
// Vector store of 8 chars (16bits signed/unsigned) to memory
|
|
671 |
class Store8CNode : public VectorStoreNode {
|
|
672 |
protected:
|
|
673 |
virtual BasicType elt_basic_type() const { return T_CHAR; }
|
|
674 |
public:
|
|
675 |
Store8CNode(Node* c, Node* mem, Node* adr, const TypePtr* at, Node* val)
|
|
676 |
: VectorStoreNode(c,mem,adr,at,val) {}
|
|
677 |
virtual int Opcode() const;
|
|
678 |
virtual uint length() const { return 8; }
|
|
679 |
};
|
|
680 |
|
|
681 |
//------------------------------Store4CNode--------------------------------------
|
|
682 |
// Vector store of 4 chars (16bits signed/unsigned) to memory
|
|
683 |
class Store4CNode : public VectorStoreNode {
|
|
684 |
protected:
|
|
685 |
virtual BasicType elt_basic_type() const { return T_CHAR; }
|
|
686 |
public:
|
|
687 |
Store4CNode(Node* c, Node* mem, Node* adr, const TypePtr* at, Node* val)
|
|
688 |
: VectorStoreNode(c,mem,adr,at,val) {}
|
|
689 |
virtual int Opcode() const;
|
|
690 |
virtual uint length() const { return 4; }
|
|
691 |
};
|
|
692 |
|
|
693 |
//------------------------------Store2CNode--------------------------------------
|
|
694 |
// Vector store of 2 chars (16bits signed/unsigned) to memory
|
|
695 |
class Store2CNode : public VectorStoreNode {
|
|
696 |
protected:
|
|
697 |
virtual BasicType elt_basic_type() const { return T_CHAR; }
|
|
698 |
public:
|
|
699 |
Store2CNode(Node* c, Node* mem, Node* adr, const TypePtr* at, Node* val)
|
|
700 |
: VectorStoreNode(c,mem,adr,at,val) {}
|
|
701 |
virtual int Opcode() const;
|
|
702 |
virtual uint length() const { return 2; }
|
|
703 |
};
|
|
704 |
|
|
705 |
//------------------------------Store4INode--------------------------------------
|
|
706 |
// Vector store of 4 integers (32bits signed) to memory
|
|
707 |
class Store4INode : public VectorStoreNode {
|
|
708 |
protected:
|
|
709 |
virtual BasicType elt_basic_type() const { return T_INT; }
|
|
710 |
public:
|
|
711 |
Store4INode(Node* c, Node* mem, Node* adr, const TypePtr* at, Node* val)
|
|
712 |
: VectorStoreNode(c,mem,adr,at,val) {}
|
|
713 |
virtual int Opcode() const;
|
|
714 |
virtual uint length() const { return 4; }
|
|
715 |
};
|
|
716 |
|
|
717 |
//------------------------------Store2INode--------------------------------------
|
|
718 |
// Vector store of 2 integers (32bits signed) to memory
|
|
719 |
class Store2INode : public VectorStoreNode {
|
|
720 |
protected:
|
|
721 |
virtual BasicType elt_basic_type() const { return T_INT; }
|
|
722 |
public:
|
|
723 |
Store2INode(Node* c, Node* mem, Node* adr, const TypePtr* at, Node* val)
|
|
724 |
: VectorStoreNode(c,mem,adr,at,val) {}
|
|
725 |
virtual int Opcode() const;
|
|
726 |
virtual uint length() const { return 2; }
|
|
727 |
};
|
|
728 |
|
|
729 |
//------------------------------Store2LNode--------------------------------------
|
|
730 |
// Vector store of 2 longs (64bits signed) to memory
|
|
731 |
class Store2LNode : public VectorStoreNode {
|
|
732 |
protected:
|
|
733 |
virtual BasicType elt_basic_type() const { return T_LONG; }
|
|
734 |
public:
|
|
735 |
Store2LNode(Node* c, Node* mem, Node* adr, const TypePtr* at, Node* val)
|
|
736 |
: VectorStoreNode(c,mem,adr,at,val) {}
|
|
737 |
virtual int Opcode() const;
|
|
738 |
virtual uint length() const { return 2; }
|
|
739 |
};
|
|
740 |
|
|
741 |
//------------------------------Store4FNode--------------------------------------
|
|
742 |
// Vector store of 4 floats (32bits) to memory
|
|
743 |
class Store4FNode : public VectorStoreNode {
|
|
744 |
protected:
|
|
745 |
virtual BasicType elt_basic_type() const { return T_FLOAT; }
|
|
746 |
public:
|
|
747 |
Store4FNode(Node* c, Node* mem, Node* adr, const TypePtr* at, Node* val)
|
|
748 |
: VectorStoreNode(c,mem,adr,at,val) {}
|
|
749 |
virtual int Opcode() const;
|
|
750 |
virtual uint length() const { return 4; }
|
|
751 |
};
|
|
752 |
|
|
753 |
//------------------------------Store2FNode--------------------------------------
|
|
754 |
// Vector store of 2 floats (32bits) to memory
|
|
755 |
class Store2FNode : public VectorStoreNode {
|
|
756 |
protected:
|
|
757 |
virtual BasicType elt_basic_type() const { return T_FLOAT; }
|
|
758 |
public:
|
|
759 |
Store2FNode(Node* c, Node* mem, Node* adr, const TypePtr* at, Node* val)
|
|
760 |
: VectorStoreNode(c,mem,adr,at,val) {}
|
|
761 |
virtual int Opcode() const;
|
|
762 |
virtual uint length() const { return 2; }
|
|
763 |
};
|
|
764 |
|
|
765 |
//------------------------------Store2DNode--------------------------------------
|
|
766 |
// Vector store of 2 doubles (64bits) to memory
|
|
767 |
class Store2DNode : public VectorStoreNode {
|
|
768 |
protected:
|
|
769 |
virtual BasicType elt_basic_type() const { return T_DOUBLE; }
|
|
770 |
public:
|
|
771 |
Store2DNode(Node* c, Node* mem, Node* adr, const TypePtr* at, Node* val)
|
|
772 |
: VectorStoreNode(c,mem,adr,at,val) {}
|
|
773 |
virtual int Opcode() const;
|
|
774 |
virtual uint length() const { return 2; }
|
|
775 |
};
|
|
776 |
|
|
777 |
//=========================Promote_Scalar_to_Vector====================================
|
|
778 |
|
|
779 |
//------------------------------Replicate16BNode---------------------------------------
|
|
780 |
// Replicate byte scalar to be vector of 16 bytes
|
|
781 |
class Replicate16BNode : public VectorNode {
|
|
782 |
protected:
|
|
783 |
virtual BasicType elt_basic_type() const { return T_BYTE; }
|
|
784 |
public:
|
|
785 |
Replicate16BNode(Node* in1) : VectorNode(in1, 16) {}
|
|
786 |
virtual int Opcode() const;
|
|
787 |
};
|
|
788 |
|
|
789 |
//------------------------------Replicate8BNode---------------------------------------
|
|
790 |
// Replicate byte scalar to be vector of 8 bytes
|
|
791 |
class Replicate8BNode : public VectorNode {
|
|
792 |
protected:
|
|
793 |
virtual BasicType elt_basic_type() const { return T_BYTE; }
|
|
794 |
public:
|
|
795 |
Replicate8BNode(Node* in1) : VectorNode(in1, 8) {}
|
|
796 |
virtual int Opcode() const;
|
|
797 |
};
|
|
798 |
|
|
799 |
//------------------------------Replicate4BNode---------------------------------------
|
|
800 |
// Replicate byte scalar to be vector of 4 bytes
|
|
801 |
class Replicate4BNode : public VectorNode {
|
|
802 |
protected:
|
|
803 |
virtual BasicType elt_basic_type() const { return T_BYTE; }
|
|
804 |
public:
|
|
805 |
Replicate4BNode(Node* in1) : VectorNode(in1, 4) {}
|
|
806 |
virtual int Opcode() const;
|
|
807 |
};
|
|
808 |
|
|
809 |
//------------------------------Replicate8CNode---------------------------------------
|
|
810 |
// Replicate char scalar to be vector of 8 chars
|
|
811 |
class Replicate8CNode : public VectorNode {
|
|
812 |
protected:
|
|
813 |
virtual BasicType elt_basic_type() const { return T_CHAR; }
|
|
814 |
public:
|
|
815 |
Replicate8CNode(Node* in1) : VectorNode(in1, 8) {}
|
|
816 |
virtual int Opcode() const;
|
|
817 |
};
|
|
818 |
|
|
819 |
//------------------------------Replicate4CNode---------------------------------------
|
|
820 |
// Replicate char scalar to be vector of 4 chars
|
|
821 |
class Replicate4CNode : public VectorNode {
|
|
822 |
protected:
|
|
823 |
virtual BasicType elt_basic_type() const { return T_CHAR; }
|
|
824 |
public:
|
|
825 |
Replicate4CNode(Node* in1) : VectorNode(in1, 4) {}
|
|
826 |
virtual int Opcode() const;
|
|
827 |
};
|
|
828 |
|
|
829 |
//------------------------------Replicate2CNode---------------------------------------
|
|
830 |
// Replicate char scalar to be vector of 2 chars
|
|
831 |
class Replicate2CNode : public VectorNode {
|
|
832 |
protected:
|
|
833 |
virtual BasicType elt_basic_type() const { return T_CHAR; }
|
|
834 |
public:
|
|
835 |
Replicate2CNode(Node* in1) : VectorNode(in1, 2) {}
|
|
836 |
virtual int Opcode() const;
|
|
837 |
};
|
|
838 |
|
|
839 |
//------------------------------Replicate8SNode---------------------------------------
|
|
840 |
// Replicate short scalar to be vector of 8 shorts
|
|
841 |
class Replicate8SNode : public VectorNode {
|
|
842 |
protected:
|
|
843 |
virtual BasicType elt_basic_type() const { return T_SHORT; }
|
|
844 |
public:
|
|
845 |
Replicate8SNode(Node* in1) : VectorNode(in1, 8) {}
|
|
846 |
virtual int Opcode() const;
|
|
847 |
};
|
|
848 |
|
|
849 |
//------------------------------Replicate4SNode---------------------------------------
|
|
850 |
// Replicate short scalar to be vector of 4 shorts
|
|
851 |
class Replicate4SNode : public VectorNode {
|
|
852 |
protected:
|
|
853 |
virtual BasicType elt_basic_type() const { return T_SHORT; }
|
|
854 |
public:
|
|
855 |
Replicate4SNode(Node* in1) : VectorNode(in1, 4) {}
|
|
856 |
virtual int Opcode() const;
|
|
857 |
};
|
|
858 |
|
|
859 |
//------------------------------Replicate2SNode---------------------------------------
|
|
860 |
// Replicate short scalar to be vector of 2 shorts
|
|
861 |
class Replicate2SNode : public VectorNode {
|
|
862 |
protected:
|
|
863 |
virtual BasicType elt_basic_type() const { return T_SHORT; }
|
|
864 |
public:
|
|
865 |
Replicate2SNode(Node* in1) : VectorNode(in1, 2) {}
|
|
866 |
virtual int Opcode() const;
|
|
867 |
};
|
|
868 |
|
|
869 |
//------------------------------Replicate4INode---------------------------------------
|
|
870 |
// Replicate int scalar to be vector of 4 ints
|
|
871 |
class Replicate4INode : public VectorNode {
|
|
872 |
protected:
|
|
873 |
virtual BasicType elt_basic_type() const { return T_INT; }
|
|
874 |
public:
|
|
875 |
Replicate4INode(Node* in1) : VectorNode(in1, 4) {}
|
|
876 |
virtual int Opcode() const;
|
|
877 |
};
|
|
878 |
|
|
879 |
//------------------------------Replicate2INode---------------------------------------
|
|
880 |
// Replicate int scalar to be vector of 2 ints
|
|
881 |
class Replicate2INode : public VectorNode {
|
|
882 |
protected:
|
|
883 |
virtual BasicType elt_basic_type() const { return T_INT; }
|
|
884 |
public:
|
|
885 |
Replicate2INode(Node* in1) : VectorNode(in1, 2) {}
|
|
886 |
virtual int Opcode() const;
|
|
887 |
};
|
|
888 |
|
|
889 |
//------------------------------Replicate2LNode---------------------------------------
|
|
890 |
// Replicate long scalar to be vector of 2 longs
|
|
891 |
class Replicate2LNode : public VectorNode {
|
|
892 |
protected:
|
|
893 |
virtual BasicType elt_basic_type() const { return T_LONG; }
|
|
894 |
public:
|
|
895 |
Replicate2LNode(Node* in1) : VectorNode(in1, 2) {}
|
|
896 |
virtual int Opcode() const;
|
|
897 |
};
|
|
898 |
|
|
899 |
//------------------------------Replicate4FNode---------------------------------------
|
|
900 |
// Replicate float scalar to be vector of 4 floats
|
|
901 |
class Replicate4FNode : public VectorNode {
|
|
902 |
protected:
|
|
903 |
virtual BasicType elt_basic_type() const { return T_FLOAT; }
|
|
904 |
public:
|
|
905 |
Replicate4FNode(Node* in1) : VectorNode(in1, 4) {}
|
|
906 |
virtual int Opcode() const;
|
|
907 |
};
|
|
908 |
|
|
909 |
//------------------------------Replicate2FNode---------------------------------------
|
|
910 |
// Replicate float scalar to be vector of 2 floats
|
|
911 |
class Replicate2FNode : public VectorNode {
|
|
912 |
protected:
|
|
913 |
virtual BasicType elt_basic_type() const { return T_FLOAT; }
|
|
914 |
public:
|
|
915 |
Replicate2FNode(Node* in1) : VectorNode(in1, 2) {}
|
|
916 |
virtual int Opcode() const;
|
|
917 |
};
|
|
918 |
|
|
919 |
//------------------------------Replicate2DNode---------------------------------------
|
|
920 |
// Replicate double scalar to be vector of 2 doubles
|
|
921 |
class Replicate2DNode : public VectorNode {
|
|
922 |
protected:
|
|
923 |
virtual BasicType elt_basic_type() const { return T_DOUBLE; }
|
|
924 |
public:
|
|
925 |
Replicate2DNode(Node* in1) : VectorNode(in1, 2) {}
|
|
926 |
virtual int Opcode() const;
|
|
927 |
};
|
|
928 |
|
|
929 |
//========================Pack_Scalars_into_a_Vector==============================
|
|
930 |
|
|
931 |
//------------------------------PackNode---------------------------------------
|
|
932 |
// Pack parent class (not for code generation).
|
|
933 |
class PackNode : public VectorNode {
|
|
934 |
public:
|
|
935 |
PackNode(Node* in1) : VectorNode(in1, 1) {}
|
|
936 |
PackNode(Node* in1, Node* n2) : VectorNode(in1, n2, 2) {}
|
|
937 |
virtual int Opcode() const;
|
|
938 |
|
|
939 |
void add_opd(Node* n) {
|
|
940 |
add_req(n);
|
|
941 |
_length++;
|
|
942 |
assert(_length == req() - 1, "vector length matches edge count");
|
|
943 |
}
|
|
944 |
|
|
945 |
// Create a binary tree form for Packs. [lo, hi) (half-open) range
|
|
946 |
Node* binaryTreePack(Compile* C, int lo, int hi);
|
|
947 |
|
|
948 |
static PackNode* make(Compile* C, Node* s, const Type* elt_t);
|
|
949 |
};
|
|
950 |
|
|
951 |
//------------------------------PackBNode---------------------------------------
|
|
952 |
// Pack byte scalars into vector
|
|
953 |
class PackBNode : public PackNode {
|
|
954 |
protected:
|
|
955 |
virtual BasicType elt_basic_type() const { return T_BYTE; }
|
|
956 |
public:
|
|
957 |
PackBNode(Node* in1) : PackNode(in1) {}
|
|
958 |
virtual int Opcode() const;
|
|
959 |
};
|
|
960 |
|
|
961 |
//------------------------------PackCNode---------------------------------------
|
|
962 |
// Pack char scalars into vector
|
|
963 |
class PackCNode : public PackNode {
|
|
964 |
protected:
|
|
965 |
virtual BasicType elt_basic_type() const { return T_CHAR; }
|
|
966 |
public:
|
|
967 |
PackCNode(Node* in1) : PackNode(in1) {}
|
|
968 |
virtual int Opcode() const;
|
|
969 |
};
|
|
970 |
|
|
971 |
//------------------------------PackSNode---------------------------------------
|
|
972 |
// Pack short scalars into a vector
|
|
973 |
class PackSNode : public PackNode {
|
|
974 |
protected:
|
|
975 |
virtual BasicType elt_basic_type() const { return T_SHORT; }
|
|
976 |
public:
|
|
977 |
PackSNode(Node* in1) : PackNode(in1) {}
|
|
978 |
virtual int Opcode() const;
|
|
979 |
};
|
|
980 |
|
|
981 |
//------------------------------PackINode---------------------------------------
|
|
982 |
// Pack integer scalars into a vector
|
|
983 |
class PackINode : public PackNode {
|
|
984 |
protected:
|
|
985 |
virtual BasicType elt_basic_type() const { return T_INT; }
|
|
986 |
public:
|
|
987 |
PackINode(Node* in1) : PackNode(in1) {}
|
|
988 |
PackINode(Node* in1, Node* in2) : PackNode(in1, in2) {}
|
|
989 |
virtual int Opcode() const;
|
|
990 |
};
|
|
991 |
|
|
992 |
//------------------------------PackLNode---------------------------------------
|
|
993 |
// Pack long scalars into a vector
|
|
994 |
class PackLNode : public PackNode {
|
|
995 |
protected:
|
|
996 |
virtual BasicType elt_basic_type() const { return T_LONG; }
|
|
997 |
public:
|
|
998 |
PackLNode(Node* in1) : PackNode(in1) {}
|
|
999 |
PackLNode(Node* in1, Node* in2) : PackNode(in1, in2) {}
|
|
1000 |
virtual int Opcode() const;
|
|
1001 |
};
|
|
1002 |
|
|
1003 |
//------------------------------PackFNode---------------------------------------
|
|
1004 |
// Pack float scalars into vector
|
|
1005 |
class PackFNode : public PackNode {
|
|
1006 |
protected:
|
|
1007 |
virtual BasicType elt_basic_type() const { return T_FLOAT; }
|
|
1008 |
public:
|
|
1009 |
PackFNode(Node* in1) : PackNode(in1) {}
|
|
1010 |
PackFNode(Node* in1, Node* in2) : PackNode(in1, in2) {}
|
|
1011 |
virtual int Opcode() const;
|
|
1012 |
};
|
|
1013 |
|
|
1014 |
//------------------------------PackDNode---------------------------------------
|
|
1015 |
// Pack double scalars into a vector
|
|
1016 |
class PackDNode : public PackNode {
|
|
1017 |
protected:
|
|
1018 |
virtual BasicType elt_basic_type() const { return T_DOUBLE; }
|
|
1019 |
public:
|
|
1020 |
PackDNode(Node* in1) : PackNode(in1) {}
|
|
1021 |
PackDNode(Node* in1, Node* in2) : PackNode(in1, in2) {}
|
|
1022 |
virtual int Opcode() const;
|
|
1023 |
};
|
|
1024 |
|
|
1025 |
// The Pack2xN nodes assist code generation. They are created from
|
|
1026 |
// Pack4C, etc. nodes in final_graph_reshape in the form of a
|
|
1027 |
// balanced, binary tree.
|
|
1028 |
|
|
1029 |
//------------------------------Pack2x1BNode-----------------------------------------
|
|
1030 |
// Pack 2 1-byte integers into vector of 2 bytes
|
|
1031 |
class Pack2x1BNode : public PackNode {
|
|
1032 |
protected:
|
|
1033 |
virtual BasicType elt_basic_type() const { return T_BYTE; }
|
|
1034 |
public:
|
|
1035 |
Pack2x1BNode(Node *in1, Node* in2) : PackNode(in1, in2) {}
|
|
1036 |
virtual int Opcode() const;
|
|
1037 |
virtual uint ideal_reg() const { return Op_RegI; }
|
|
1038 |
};
|
|
1039 |
|
|
1040 |
//------------------------------Pack2x2BNode---------------------------------------
|
|
1041 |
// Pack 2 2-byte integers into vector of 4 bytes
|
|
1042 |
class Pack2x2BNode : public PackNode {
|
|
1043 |
protected:
|
|
1044 |
virtual BasicType elt_basic_type() const { return T_CHAR; }
|
|
1045 |
public:
|
|
1046 |
Pack2x2BNode(Node *in1, Node* in2) : PackNode(in1, in2) {}
|
|
1047 |
virtual int Opcode() const;
|
|
1048 |
virtual uint ideal_reg() const { return Op_RegI; }
|
|
1049 |
};
|
|
1050 |
|
|
1051 |
//========================Extract_Scalar_from_Vector===============================
|
|
1052 |
|
|
1053 |
//------------------------------ExtractNode---------------------------------------
|
|
1054 |
// Extract a scalar from a vector at position "pos"
|
|
1055 |
class ExtractNode : public Node {
|
|
1056 |
public:
|
|
1057 |
ExtractNode(Node* src, ConINode* pos) : Node(NULL, src, (Node*)pos) {
|
|
1058 |
assert(in(2)->get_int() >= 0, "positive constants");
|
|
1059 |
}
|
|
1060 |
virtual int Opcode() const;
|
|
1061 |
uint pos() const { return in(2)->get_int(); }
|
|
1062 |
|
|
1063 |
static Node* make(Compile* C, Node* v, uint position, const Type* opd_t);
|
|
1064 |
};
|
|
1065 |
|
|
1066 |
//------------------------------ExtractBNode---------------------------------------
|
|
1067 |
// Extract a byte from a vector at position "pos"
|
|
1068 |
class ExtractBNode : public ExtractNode {
|
|
1069 |
public:
|
|
1070 |
ExtractBNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
|
|
1071 |
virtual int Opcode() const;
|
|
1072 |
virtual const Type *bottom_type() const { return TypeInt::INT; }
|
|
1073 |
virtual uint ideal_reg() const { return Op_RegI; }
|
|
1074 |
};
|
|
1075 |
|
|
1076 |
//------------------------------ExtractCNode---------------------------------------
|
|
1077 |
// Extract a char from a vector at position "pos"
|
|
1078 |
class ExtractCNode : public ExtractNode {
|
|
1079 |
public:
|
|
1080 |
ExtractCNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
|
|
1081 |
virtual int Opcode() const;
|
|
1082 |
virtual const Type *bottom_type() const { return TypeInt::INT; }
|
|
1083 |
virtual uint ideal_reg() const { return Op_RegI; }
|
|
1084 |
};
|
|
1085 |
|
|
1086 |
//------------------------------ExtractSNode---------------------------------------
|
|
1087 |
// Extract a short from a vector at position "pos"
|
|
1088 |
class ExtractSNode : public ExtractNode {
|
|
1089 |
public:
|
|
1090 |
ExtractSNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
|
|
1091 |
virtual int Opcode() const;
|
|
1092 |
virtual const Type *bottom_type() const { return TypeInt::INT; }
|
|
1093 |
virtual uint ideal_reg() const { return Op_RegI; }
|
|
1094 |
};
|
|
1095 |
|
|
1096 |
//------------------------------ExtractINode---------------------------------------
|
|
1097 |
// Extract an int from a vector at position "pos"
|
|
1098 |
class ExtractINode : public ExtractNode {
|
|
1099 |
public:
|
|
1100 |
ExtractINode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
|
|
1101 |
virtual int Opcode() const;
|
|
1102 |
virtual const Type *bottom_type() const { return TypeInt::INT; }
|
|
1103 |
virtual uint ideal_reg() const { return Op_RegI; }
|
|
1104 |
};
|
|
1105 |
|
|
1106 |
//------------------------------ExtractLNode---------------------------------------
|
|
1107 |
// Extract a long from a vector at position "pos"
|
|
1108 |
class ExtractLNode : public ExtractNode {
|
|
1109 |
public:
|
|
1110 |
ExtractLNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
|
|
1111 |
virtual int Opcode() const;
|
|
1112 |
virtual const Type *bottom_type() const { return TypeLong::LONG; }
|
|
1113 |
virtual uint ideal_reg() const { return Op_RegL; }
|
|
1114 |
};
|
|
1115 |
|
|
1116 |
//------------------------------ExtractFNode---------------------------------------
|
|
1117 |
// Extract a float from a vector at position "pos"
|
|
1118 |
class ExtractFNode : public ExtractNode {
|
|
1119 |
public:
|
|
1120 |
ExtractFNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
|
|
1121 |
virtual int Opcode() const;
|
|
1122 |
virtual const Type *bottom_type() const { return Type::FLOAT; }
|
|
1123 |
virtual uint ideal_reg() const { return Op_RegF; }
|
|
1124 |
};
|
|
1125 |
|
|
1126 |
//------------------------------ExtractDNode---------------------------------------
|
|
1127 |
// Extract a double from a vector at position "pos"
|
|
1128 |
class ExtractDNode : public ExtractNode {
|
|
1129 |
public:
|
|
1130 |
ExtractDNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
|
|
1131 |
virtual int Opcode() const;
|
|
1132 |
virtual const Type *bottom_type() const { return Type::DOUBLE; }
|
|
1133 |
virtual uint ideal_reg() const { return Op_RegD; }
|
|
1134 |
};
|