Mercurial > hg > truffle
annotate src/share/vm/opto/vectornode.hpp @ 6273:4c8f2a12e757 hs24-b20
Merge
author | twisti |
---|---|
date | Fri, 10 Aug 2012 17:50:24 -0700 |
parents | 8c92982cbbc4 |
children | 006050192a5a |
rev | line source |
---|---|
0 | 1 /* |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
2 * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
196
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
196
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
196
diff
changeset
|
21 * questions. |
0 | 22 */ |
23 | |
1972 | 24 #ifndef SHARE_VM_OPTO_VECTORNODE_HPP |
25 #define SHARE_VM_OPTO_VECTORNODE_HPP | |
26 | |
27 #include "opto/matcher.hpp" | |
28 #include "opto/memnode.hpp" | |
29 #include "opto/node.hpp" | |
30 #include "opto/opcodes.hpp" | |
31 | |
0 | 32 //------------------------------VectorNode-------------------------------------- |
33 // Vector Operation | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
34 class VectorNode : public TypeNode { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
35 public: |
0 | 36 |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
37 VectorNode(Node* n1, const TypeVect* vt) : TypeNode(vt, 2) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
38 init_class_id(Class_Vector); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
39 init_req(1, n1); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
40 } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
41 VectorNode(Node* n1, Node* n2, const TypeVect* vt) : TypeNode(vt, 3) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
42 init_class_id(Class_Vector); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
43 init_req(1, n1); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
44 init_req(2, n2); |
0 | 45 } |
46 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
47 const TypeVect* vect_type() const { return type()->is_vect(); } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
48 uint length() const { return vect_type()->length(); } // Vector length |
0 | 49 |
50 virtual int Opcode() const; | |
51 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
52 virtual uint ideal_reg() const { return Matcher::vector_ideal_reg(vect_type()->length_in_bytes()); } |
0 | 53 |
54 static VectorNode* scalar2vector(Compile* C, Node* s, uint vlen, const Type* opd_t); | |
55 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
56 static VectorNode* make(Compile* C, int opc, Node* n1, Node* n2, uint vlen, BasicType bt); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
57 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
58 static int opcode(int opc, uint vlen, BasicType bt); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
59 static bool implemented(int opc, uint vlen, BasicType bt); |
0 | 60 |
61 }; | |
62 | |
63 //===========================Vector=ALU=Operations==================================== | |
64 | |
65 //------------------------------AddVBNode--------------------------------------- | |
66 // Vector add byte | |
67 class AddVBNode : public VectorNode { | |
68 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
69 AddVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 70 virtual int Opcode() const; |
71 }; | |
72 | |
73 //------------------------------AddVSNode--------------------------------------- | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
74 // Vector add char/short |
0 | 75 class AddVSNode : public VectorNode { |
76 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
77 AddVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 78 virtual int Opcode() const; |
79 }; | |
80 | |
81 //------------------------------AddVINode--------------------------------------- | |
82 // Vector add int | |
83 class AddVINode : public VectorNode { | |
84 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
85 AddVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 86 virtual int Opcode() const; |
87 }; | |
88 | |
89 //------------------------------AddVLNode--------------------------------------- | |
90 // Vector add long | |
91 class AddVLNode : public VectorNode { | |
92 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
93 AddVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 94 virtual int Opcode() const; |
95 }; | |
96 | |
97 //------------------------------AddVFNode--------------------------------------- | |
98 // Vector add float | |
99 class AddVFNode : public VectorNode { | |
100 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
101 AddVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 102 virtual int Opcode() const; |
103 }; | |
104 | |
105 //------------------------------AddVDNode--------------------------------------- | |
106 // Vector add double | |
107 class AddVDNode : public VectorNode { | |
108 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
109 AddVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 110 virtual int Opcode() const; |
111 }; | |
112 | |
113 //------------------------------SubVBNode--------------------------------------- | |
114 // Vector subtract byte | |
115 class SubVBNode : public VectorNode { | |
116 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
117 SubVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 118 virtual int Opcode() const; |
119 }; | |
120 | |
121 //------------------------------SubVSNode--------------------------------------- | |
122 // Vector subtract short | |
123 class SubVSNode : public VectorNode { | |
124 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
125 SubVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 126 virtual int Opcode() const; |
127 }; | |
128 | |
129 //------------------------------SubVINode--------------------------------------- | |
130 // Vector subtract int | |
131 class SubVINode : public VectorNode { | |
132 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
133 SubVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 134 virtual int Opcode() const; |
135 }; | |
136 | |
137 //------------------------------SubVLNode--------------------------------------- | |
138 // Vector subtract long | |
139 class SubVLNode : public VectorNode { | |
140 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
141 SubVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 142 virtual int Opcode() const; |
143 }; | |
144 | |
145 //------------------------------SubVFNode--------------------------------------- | |
146 // Vector subtract float | |
147 class SubVFNode : public VectorNode { | |
148 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
149 SubVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 150 virtual int Opcode() const; |
151 }; | |
152 | |
153 //------------------------------SubVDNode--------------------------------------- | |
154 // Vector subtract double | |
155 class SubVDNode : public VectorNode { | |
156 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
157 SubVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 158 virtual int Opcode() const; |
159 }; | |
160 | |
161 //------------------------------MulVFNode--------------------------------------- | |
162 // Vector multiply float | |
163 class MulVFNode : public VectorNode { | |
164 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
165 MulVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 166 virtual int Opcode() const; |
167 }; | |
168 | |
169 //------------------------------MulVDNode--------------------------------------- | |
170 // Vector multiply double | |
171 class MulVDNode : public VectorNode { | |
172 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
173 MulVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 174 virtual int Opcode() const; |
175 }; | |
176 | |
177 //------------------------------DivVFNode--------------------------------------- | |
178 // Vector divide float | |
179 class DivVFNode : public VectorNode { | |
180 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
181 DivVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 182 virtual int Opcode() const; |
183 }; | |
184 | |
185 //------------------------------DivVDNode--------------------------------------- | |
186 // Vector Divide double | |
187 class DivVDNode : public VectorNode { | |
188 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
189 DivVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 190 virtual int Opcode() const; |
191 }; | |
192 | |
193 //------------------------------LShiftVBNode--------------------------------------- | |
194 // Vector lshift byte | |
195 class LShiftVBNode : public VectorNode { | |
196 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
197 LShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 198 virtual int Opcode() const; |
199 }; | |
200 | |
201 //------------------------------LShiftVSNode--------------------------------------- | |
202 // Vector lshift shorts | |
203 class LShiftVSNode : public VectorNode { | |
204 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
205 LShiftVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 206 virtual int Opcode() const; |
207 }; | |
208 | |
209 //------------------------------LShiftVINode--------------------------------------- | |
210 // Vector lshift ints | |
211 class LShiftVINode : public VectorNode { | |
212 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
213 LShiftVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 214 virtual int Opcode() const; |
215 }; | |
216 | |
217 //------------------------------URShiftVBNode--------------------------------------- | |
218 // Vector urshift bytes | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
219 class RShiftVBNode : public VectorNode { |
0 | 220 public: |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
221 RShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 222 virtual int Opcode() const; |
223 }; | |
224 | |
225 //------------------------------URShiftVSNode--------------------------------------- | |
226 // Vector urshift shorts | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
227 class RShiftVSNode : public VectorNode { |
0 | 228 public: |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
229 RShiftVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 230 virtual int Opcode() const; |
231 }; | |
232 | |
233 //------------------------------URShiftVINode--------------------------------------- | |
234 // Vector urshift ints | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
235 class RShiftVINode : public VectorNode { |
0 | 236 public: |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
237 RShiftVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 238 virtual int Opcode() const; |
239 }; | |
240 | |
241 //------------------------------AndVNode--------------------------------------- | |
242 // Vector and | |
243 class AndVNode : public VectorNode { | |
244 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
245 AndVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 246 virtual int Opcode() const; |
247 }; | |
248 | |
249 //------------------------------OrVNode--------------------------------------- | |
250 // Vector or | |
251 class OrVNode : public VectorNode { | |
252 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
253 OrVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 254 virtual int Opcode() const; |
255 }; | |
256 | |
257 //------------------------------XorVNode--------------------------------------- | |
258 // Vector xor | |
259 class XorVNode : public VectorNode { | |
260 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
261 XorVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {} |
0 | 262 virtual int Opcode() const; |
263 }; | |
264 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
265 //================================= M E M O R Y =============================== |
0 | 266 |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
267 //------------------------------LoadVectorNode--------------------------------- |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
268 // Load Vector from memory |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
269 class LoadVectorNode : public LoadNode { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
270 public: |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
271 LoadVectorNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeVect* vt) |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
272 : LoadNode(c, mem, adr, at, vt) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
273 init_class_id(Class_LoadVector); |
0 | 274 } |
275 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
276 const TypeVect* vect_type() const { return type()->is_vect(); } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
277 uint length() const { return vect_type()->length(); } // Vector length |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
278 |
0 | 279 virtual int Opcode() const; |
280 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
281 virtual uint ideal_reg() const { return Matcher::vector_ideal_reg(memory_size()); } |
0 | 282 virtual BasicType memory_type() const { return T_VOID; } |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
283 virtual int memory_size() const { return vect_type()->length_in_bytes(); } |
0 | 284 |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
285 virtual int store_Opcode() const { return Op_StoreVector; } |
0 | 286 |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
287 static LoadVectorNode* make(Compile* C, int opc, Node* ctl, Node* mem, |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
288 Node* adr, const TypePtr* atyp, uint vlen, BasicType bt); |
0 | 289 }; |
290 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
291 //------------------------------StoreVectorNode-------------------------------- |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
292 // Store Vector to memory |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
293 class StoreVectorNode : public StoreNode { |
0 | 294 public: |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
295 StoreVectorNode(Node* c, Node* mem, Node* adr, const TypePtr* at, Node* val) |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
296 : StoreNode(c, mem, adr, at, val) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
297 assert(val->is_Vector() || val->is_LoadVector(), "sanity"); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
298 init_class_id(Class_StoreVector); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
299 } |
0 | 300 |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
301 const TypeVect* vect_type() const { return in(MemNode::ValueIn)->bottom_type()->is_vect(); } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
302 uint length() const { return vect_type()->length(); } // Vector length |
0 | 303 |
304 virtual int Opcode() const; | |
305 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
306 virtual uint ideal_reg() const { return Matcher::vector_ideal_reg(memory_size()); } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
307 virtual BasicType memory_type() const { return T_VOID; } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
308 virtual int memory_size() const { return vect_type()->length_in_bytes(); } |
0 | 309 |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
310 static StoreVectorNode* make(Compile* C, int opc, Node* ctl, Node* mem, |
3842 | 311 Node* adr, const TypePtr* atyp, Node* val, |
0 | 312 uint vlen); |
313 }; | |
314 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
315 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
316 //=========================Promote_Scalar_to_Vector============================ |
0 | 317 |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
318 //------------------------------ReplicateBNode--------------------------------- |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
319 // Replicate byte scalar to be vector |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
320 class ReplicateBNode : public VectorNode { |
0 | 321 public: |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
322 ReplicateBNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {} |
0 | 323 virtual int Opcode() const; |
324 }; | |
325 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
326 //------------------------------ReplicateSNode--------------------------------- |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
327 // Replicate short scalar to be vector |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
328 class ReplicateSNode : public VectorNode { |
0 | 329 public: |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
330 ReplicateSNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {} |
0 | 331 virtual int Opcode() const; |
332 }; | |
333 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
334 //------------------------------ReplicateINode--------------------------------- |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
335 // Replicate int scalar to be vector |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
336 class ReplicateINode : public VectorNode { |
0 | 337 public: |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
338 ReplicateINode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {} |
0 | 339 virtual int Opcode() const; |
340 }; | |
341 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
342 //------------------------------ReplicateLNode--------------------------------- |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
343 // Replicate long scalar to be vector |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
344 class ReplicateLNode : public VectorNode { |
0 | 345 public: |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
346 ReplicateLNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {} |
0 | 347 virtual int Opcode() const; |
348 }; | |
349 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
350 //------------------------------ReplicateFNode--------------------------------- |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
351 // Replicate float scalar to be vector |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
352 class ReplicateFNode : public VectorNode { |
0 | 353 public: |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
354 ReplicateFNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {} |
0 | 355 virtual int Opcode() const; |
356 }; | |
357 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
358 //------------------------------ReplicateDNode--------------------------------- |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
359 // Replicate double scalar to be vector |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
360 class ReplicateDNode : public VectorNode { |
0 | 361 public: |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
362 ReplicateDNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {} |
0 | 363 virtual int Opcode() const; |
364 }; | |
365 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
366 //========================Pack_Scalars_into_a_Vector=========================== |
0 | 367 |
368 //------------------------------PackNode--------------------------------------- | |
369 // Pack parent class (not for code generation). | |
370 class PackNode : public VectorNode { | |
371 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
372 PackNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {} |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
373 PackNode(Node* in1, Node* n2, const TypeVect* vt) : VectorNode(in1, n2, vt) {} |
0 | 374 virtual int Opcode() const; |
375 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
376 void add_opd(uint i, Node* n) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
377 init_req(i+1, n); |
0 | 378 } |
379 | |
380 // Create a binary tree form for Packs. [lo, hi) (half-open) range | |
381 Node* binaryTreePack(Compile* C, int lo, int hi); | |
382 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
383 static PackNode* make(Compile* C, Node* s, uint vlen, BasicType bt); |
0 | 384 }; |
385 | |
386 //------------------------------PackBNode--------------------------------------- | |
387 // Pack byte scalars into vector | |
388 class PackBNode : public PackNode { | |
389 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
390 PackBNode(Node* in1, const TypeVect* vt) : PackNode(in1, vt) {} |
0 | 391 virtual int Opcode() const; |
392 }; | |
393 | |
394 //------------------------------PackSNode--------------------------------------- | |
395 // Pack short scalars into a vector | |
396 class PackSNode : public PackNode { | |
397 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
398 PackSNode(Node* in1, const TypeVect* vt) : PackNode(in1, vt) {} |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
399 PackSNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {} |
0 | 400 virtual int Opcode() const; |
401 }; | |
402 | |
403 //------------------------------PackINode--------------------------------------- | |
404 // Pack integer scalars into a vector | |
405 class PackINode : public PackNode { | |
406 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
407 PackINode(Node* in1, const TypeVect* vt) : PackNode(in1, vt) {} |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
408 PackINode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {} |
0 | 409 virtual int Opcode() const; |
410 }; | |
411 | |
412 //------------------------------PackLNode--------------------------------------- | |
413 // Pack long scalars into a vector | |
414 class PackLNode : public PackNode { | |
415 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
416 PackLNode(Node* in1, const TypeVect* vt) : PackNode(in1, vt) {} |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
417 PackLNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {} |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
418 virtual int Opcode() const; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
419 }; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
420 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
421 //------------------------------Pack2LNode-------------------------------------- |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
422 // Pack 2 long scalars into a vector |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
423 class Pack2LNode : public PackNode { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
424 public: |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
425 Pack2LNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {} |
0 | 426 virtual int Opcode() const; |
427 }; | |
428 | |
429 //------------------------------PackFNode--------------------------------------- | |
430 // Pack float scalars into vector | |
431 class PackFNode : public PackNode { | |
432 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
433 PackFNode(Node* in1, const TypeVect* vt) : PackNode(in1, vt) {} |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
434 PackFNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {} |
0 | 435 virtual int Opcode() const; |
436 }; | |
437 | |
438 //------------------------------PackDNode--------------------------------------- | |
439 // Pack double scalars into a vector | |
440 class PackDNode : public PackNode { | |
441 public: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
442 PackDNode(Node* in1, const TypeVect* vt) : PackNode(in1, vt) {} |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
443 PackDNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {} |
0 | 444 virtual int Opcode() const; |
445 }; | |
446 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
447 //------------------------------Pack2DNode-------------------------------------- |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
448 // Pack 2 double scalars into a vector |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
449 class Pack2DNode : public PackNode { |
0 | 450 public: |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
451 Pack2DNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {} |
0 | 452 virtual int Opcode() const; |
453 }; | |
454 | |
455 | |
456 //========================Extract_Scalar_from_Vector=============================== | |
457 | |
458 //------------------------------ExtractNode--------------------------------------- | |
459 // Extract a scalar from a vector at position "pos" | |
460 class ExtractNode : public Node { | |
461 public: | |
462 ExtractNode(Node* src, ConINode* pos) : Node(NULL, src, (Node*)pos) { | |
463 assert(in(2)->get_int() >= 0, "positive constants"); | |
464 } | |
465 virtual int Opcode() const; | |
466 uint pos() const { return in(2)->get_int(); } | |
467 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
468 static Node* make(Compile* C, Node* v, uint position, BasicType bt); |
0 | 469 }; |
470 | |
471 //------------------------------ExtractBNode--------------------------------------- | |
472 // Extract a byte from a vector at position "pos" | |
473 class ExtractBNode : public ExtractNode { | |
474 public: | |
475 ExtractBNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} | |
476 virtual int Opcode() const; | |
477 virtual const Type *bottom_type() const { return TypeInt::INT; } | |
478 virtual uint ideal_reg() const { return Op_RegI; } | |
479 }; | |
480 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
481 //------------------------------ExtractUBNode-------------------------------------- |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
482 // Extract a boolean from a vector at position "pos" |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
483 class ExtractUBNode : public ExtractNode { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
484 public: |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
485 ExtractUBNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
486 virtual int Opcode() const; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
487 virtual const Type *bottom_type() const { return TypeInt::INT; } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
488 virtual uint ideal_reg() const { return Op_RegI; } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
489 }; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
490 |
0 | 491 //------------------------------ExtractCNode--------------------------------------- |
492 // Extract a char from a vector at position "pos" | |
493 class ExtractCNode : public ExtractNode { | |
494 public: | |
495 ExtractCNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} | |
496 virtual int Opcode() const; | |
497 virtual const Type *bottom_type() const { return TypeInt::INT; } | |
498 virtual uint ideal_reg() const { return Op_RegI; } | |
499 }; | |
500 | |
501 //------------------------------ExtractSNode--------------------------------------- | |
502 // Extract a short from a vector at position "pos" | |
503 class ExtractSNode : public ExtractNode { | |
504 public: | |
505 ExtractSNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} | |
506 virtual int Opcode() const; | |
507 virtual const Type *bottom_type() const { return TypeInt::INT; } | |
508 virtual uint ideal_reg() const { return Op_RegI; } | |
509 }; | |
510 | |
511 //------------------------------ExtractINode--------------------------------------- | |
512 // Extract an int from a vector at position "pos" | |
513 class ExtractINode : public ExtractNode { | |
514 public: | |
515 ExtractINode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} | |
516 virtual int Opcode() const; | |
517 virtual const Type *bottom_type() const { return TypeInt::INT; } | |
518 virtual uint ideal_reg() const { return Op_RegI; } | |
519 }; | |
520 | |
521 //------------------------------ExtractLNode--------------------------------------- | |
522 // Extract a long from a vector at position "pos" | |
523 class ExtractLNode : public ExtractNode { | |
524 public: | |
525 ExtractLNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} | |
526 virtual int Opcode() const; | |
527 virtual const Type *bottom_type() const { return TypeLong::LONG; } | |
528 virtual uint ideal_reg() const { return Op_RegL; } | |
529 }; | |
530 | |
531 //------------------------------ExtractFNode--------------------------------------- | |
532 // Extract a float from a vector at position "pos" | |
533 class ExtractFNode : public ExtractNode { | |
534 public: | |
535 ExtractFNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} | |
536 virtual int Opcode() const; | |
537 virtual const Type *bottom_type() const { return Type::FLOAT; } | |
538 virtual uint ideal_reg() const { return Op_RegF; } | |
539 }; | |
540 | |
541 //------------------------------ExtractDNode--------------------------------------- | |
542 // Extract a double from a vector at position "pos" | |
543 class ExtractDNode : public ExtractNode { | |
544 public: | |
545 ExtractDNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {} | |
546 virtual int Opcode() const; | |
547 virtual const Type *bottom_type() const { return Type::DOUBLE; } | |
548 virtual uint ideal_reg() const { return Op_RegD; } | |
549 }; | |
1972 | 550 |
551 #endif // SHARE_VM_OPTO_VECTORNODE_HPP |