Mercurial > hg > graal-compiler
annotate src/share/vm/opto/vectornode.cpp @ 6885:685df3c6f84b
7045397: NPG: Add freelists to class loader arenas.
Reviewed-by: coleenp, stefank, jprovino, ohair
author | jmasa |
---|---|
date | Tue, 18 Sep 2012 23:35:42 -0700 |
parents | 859c45fb8cea |
children | aaeb9add1ab3 |
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:
579
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
579
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:
579
diff
changeset
|
21 * questions. |
0 | 22 */ |
23 | |
1972 | 24 #include "precompiled.hpp" |
25 #include "memory/allocation.inline.hpp" | |
26 #include "opto/connode.hpp" | |
27 #include "opto/vectornode.hpp" | |
0 | 28 |
29 //------------------------------VectorNode-------------------------------------- | |
30 | |
31 // Return the vector operator for the specified scalar operation | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
32 // and vector length. Also used to check if the code generator |
0 | 33 // supports the vector operation. |
6619
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
34 int VectorNode::opcode(int sopc, BasicType bt) { |
0 | 35 switch (sopc) { |
36 case Op_AddI: | |
37 switch (bt) { | |
38 case T_BOOLEAN: | |
39 case T_BYTE: return Op_AddVB; | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
40 case T_CHAR: |
0 | 41 case T_SHORT: return Op_AddVS; |
42 case T_INT: return Op_AddVI; | |
43 } | |
44 ShouldNotReachHere(); | |
45 case Op_AddL: | |
46 assert(bt == T_LONG, "must be"); | |
47 return Op_AddVL; | |
48 case Op_AddF: | |
49 assert(bt == T_FLOAT, "must be"); | |
50 return Op_AddVF; | |
51 case Op_AddD: | |
52 assert(bt == T_DOUBLE, "must be"); | |
53 return Op_AddVD; | |
54 case Op_SubI: | |
55 switch (bt) { | |
56 case T_BOOLEAN: | |
57 case T_BYTE: return Op_SubVB; | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
58 case T_CHAR: |
0 | 59 case T_SHORT: return Op_SubVS; |
60 case T_INT: return Op_SubVI; | |
61 } | |
62 ShouldNotReachHere(); | |
63 case Op_SubL: | |
64 assert(bt == T_LONG, "must be"); | |
65 return Op_SubVL; | |
66 case Op_SubF: | |
67 assert(bt == T_FLOAT, "must be"); | |
68 return Op_SubVF; | |
69 case Op_SubD: | |
70 assert(bt == T_DOUBLE, "must be"); | |
71 return Op_SubVD; | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
72 case Op_MulI: |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
73 switch (bt) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
74 case T_BOOLEAN: |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
75 case T_BYTE: return 0; // Unimplemented |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
76 case T_CHAR: |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
77 case T_SHORT: return Op_MulVS; |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
78 case T_INT: return Matcher::match_rule_supported(Op_MulVI) ? Op_MulVI : 0; // SSE4_1 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
79 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
80 ShouldNotReachHere(); |
0 | 81 case Op_MulF: |
82 assert(bt == T_FLOAT, "must be"); | |
83 return Op_MulVF; | |
84 case Op_MulD: | |
85 assert(bt == T_DOUBLE, "must be"); | |
86 return Op_MulVD; | |
87 case Op_DivF: | |
88 assert(bt == T_FLOAT, "must be"); | |
89 return Op_DivVF; | |
90 case Op_DivD: | |
91 assert(bt == T_DOUBLE, "must be"); | |
92 return Op_DivVD; | |
93 case Op_LShiftI: | |
94 switch (bt) { | |
95 case T_BOOLEAN: | |
96 case T_BYTE: return Op_LShiftVB; | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
97 case T_CHAR: |
0 | 98 case T_SHORT: return Op_LShiftVS; |
99 case T_INT: return Op_LShiftVI; | |
100 } | |
101 ShouldNotReachHere(); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
102 case Op_LShiftL: |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
103 assert(bt == T_LONG, "must be"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
104 return Op_LShiftVL; |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
105 case Op_RShiftI: |
0 | 106 switch (bt) { |
107 case T_BOOLEAN: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
108 case T_BYTE: return Op_RShiftVB; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
109 case T_CHAR: |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
110 case T_SHORT: return Op_RShiftVS; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
111 case T_INT: return Op_RShiftVI; |
0 | 112 } |
113 ShouldNotReachHere(); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
114 case Op_RShiftL: |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
115 assert(bt == T_LONG, "must be"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
116 return Op_RShiftVL; |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
117 case Op_URShiftI: |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
118 switch (bt) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
119 case T_BOOLEAN: |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
120 case T_BYTE: return Op_URShiftVB; |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
121 case T_CHAR: |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
122 case T_SHORT: return Op_URShiftVS; |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
123 case T_INT: return Op_URShiftVI; |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
124 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
125 ShouldNotReachHere(); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
126 case Op_URShiftL: |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
127 assert(bt == T_LONG, "must be"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
128 return Op_URShiftVL; |
0 | 129 case Op_AndI: |
130 case Op_AndL: | |
131 return Op_AndV; | |
132 case Op_OrI: | |
133 case Op_OrL: | |
134 return Op_OrV; | |
135 case Op_XorI: | |
136 case Op_XorL: | |
137 return Op_XorV; | |
138 | |
139 case Op_LoadB: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
140 case Op_LoadUB: |
558
3b5ac9e7e6ea
6796746: rename LoadC (char) opcode class to LoadUS (unsigned short)
twisti
parents:
196
diff
changeset
|
141 case Op_LoadUS: |
0 | 142 case Op_LoadS: |
143 case Op_LoadI: | |
144 case Op_LoadL: | |
145 case Op_LoadF: | |
146 case Op_LoadD: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
147 return Op_LoadVector; |
0 | 148 |
149 case Op_StoreB: | |
150 case Op_StoreC: | |
151 case Op_StoreI: | |
152 case Op_StoreL: | |
153 case Op_StoreF: | |
154 case Op_StoreD: | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
155 return Op_StoreVector; |
0 | 156 } |
157 return 0; // Unimplemented | |
158 } | |
159 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
160 bool VectorNode::implemented(int opc, uint vlen, BasicType bt) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
161 if (is_java_primitive(bt) && |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
162 (vlen > 1) && is_power_of_2(vlen) && |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
163 Matcher::vector_size_supported(bt, vlen)) { |
6619
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
164 int vopc = VectorNode::opcode(opc, bt); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
165 return vopc > 0 && Matcher::has_match_rule(vopc); |
0 | 166 } |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
167 return false; |
0 | 168 } |
169 | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
170 bool VectorNode::is_shift(Node* n) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
171 switch (n->Opcode()) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
172 case Op_LShiftI: |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
173 case Op_LShiftL: |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
174 case Op_RShiftI: |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
175 case Op_RShiftL: |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
176 case Op_URShiftI: |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
177 case Op_URShiftL: |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
178 return true; |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
179 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
180 return false; |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
181 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
182 |
6617 | 183 // Check if input is loop invariant vector. |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
184 bool VectorNode::is_invariant_vector(Node* n) { |
6617 | 185 // Only Replicate vector nodes are loop invariant for now. |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
186 switch (n->Opcode()) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
187 case Op_ReplicateB: |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
188 case Op_ReplicateS: |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
189 case Op_ReplicateI: |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
190 case Op_ReplicateL: |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
191 case Op_ReplicateF: |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
192 case Op_ReplicateD: |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
193 return true; |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
194 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
195 return false; |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
196 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
197 |
6619
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
198 // [Start, end) half-open range defining which operands are vectors |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
199 void VectorNode::vector_operands(Node* n, uint* start, uint* end) { |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
200 switch (n->Opcode()) { |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
201 case Op_LoadB: case Op_LoadUB: |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
202 case Op_LoadS: case Op_LoadUS: |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
203 case Op_LoadI: case Op_LoadL: |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
204 case Op_LoadF: case Op_LoadD: |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
205 case Op_LoadP: case Op_LoadN: |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
206 *start = 0; |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
207 *end = 0; // no vector operands |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
208 break; |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
209 case Op_StoreB: case Op_StoreC: |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
210 case Op_StoreI: case Op_StoreL: |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
211 case Op_StoreF: case Op_StoreD: |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
212 case Op_StoreP: case Op_StoreN: |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
213 *start = MemNode::ValueIn; |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
214 *end = MemNode::ValueIn + 1; // 1 vector operand |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
215 break; |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
216 case Op_LShiftI: case Op_LShiftL: |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
217 case Op_RShiftI: case Op_RShiftL: |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
218 case Op_URShiftI: case Op_URShiftL: |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
219 *start = 1; |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
220 *end = 2; // 1 vector operand |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
221 break; |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
222 case Op_AddI: case Op_AddL: case Op_AddF: case Op_AddD: |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
223 case Op_SubI: case Op_SubL: case Op_SubF: case Op_SubD: |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
224 case Op_MulI: case Op_MulL: case Op_MulF: case Op_MulD: |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
225 case Op_DivF: case Op_DivD: |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
226 case Op_AndI: case Op_AndL: |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
227 case Op_OrI: case Op_OrL: |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
228 case Op_XorI: case Op_XorL: |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
229 *start = 1; |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
230 *end = 3; // 2 vector operands |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
231 break; |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
232 case Op_CMoveI: case Op_CMoveL: case Op_CMoveF: case Op_CMoveD: |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
233 *start = 2; |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
234 *end = n->req(); |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
235 break; |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
236 default: |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
237 *start = 1; |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
238 *end = n->req(); // default is all operands |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
239 } |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
240 } |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
241 |
0 | 242 // Return the vector version of a scalar operation node. |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
243 VectorNode* 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
|
244 const TypeVect* vt = TypeVect::make(bt, vlen); |
6619
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
245 int vopc = VectorNode::opcode(opc, bt); |
6823 | 246 // This method should not be called for unimplemented vectors. |
247 guarantee(vopc > 0, err_msg_res("Vector for '%s' is not implemented", NodeClassNames[opc])); | |
0 | 248 |
249 switch (vopc) { | |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
250 case Op_AddVB: return new (C) AddVBNode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
251 case Op_AddVS: return new (C) AddVSNode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
252 case Op_AddVI: return new (C) AddVINode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
253 case Op_AddVL: return new (C) AddVLNode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
254 case Op_AddVF: return new (C) AddVFNode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
255 case Op_AddVD: return new (C) AddVDNode(n1, n2, vt); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
256 |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
257 case Op_SubVB: return new (C) SubVBNode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
258 case Op_SubVS: return new (C) SubVSNode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
259 case Op_SubVI: return new (C) SubVINode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
260 case Op_SubVL: return new (C) SubVLNode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
261 case Op_SubVF: return new (C) SubVFNode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
262 case Op_SubVD: return new (C) SubVDNode(n1, n2, vt); |
0 | 263 |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
264 case Op_MulVS: return new (C) MulVSNode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
265 case Op_MulVI: return new (C) MulVINode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
266 case Op_MulVF: return new (C) MulVFNode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
267 case Op_MulVD: return new (C) MulVDNode(n1, n2, vt); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
268 |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
269 case Op_DivVF: return new (C) DivVFNode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
270 case Op_DivVD: return new (C) DivVDNode(n1, n2, vt); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
271 |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
272 case Op_LShiftVB: return new (C) LShiftVBNode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
273 case Op_LShiftVS: return new (C) LShiftVSNode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
274 case Op_LShiftVI: return new (C) LShiftVINode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
275 case Op_LShiftVL: return new (C) LShiftVLNode(n1, n2, vt); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
276 |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
277 case Op_RShiftVB: return new (C) RShiftVBNode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
278 case Op_RShiftVS: return new (C) RShiftVSNode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
279 case Op_RShiftVI: return new (C) RShiftVINode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
280 case Op_RShiftVL: return new (C) RShiftVLNode(n1, n2, vt); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6179
diff
changeset
|
281 |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
282 case Op_URShiftVB: return new (C) URShiftVBNode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
283 case Op_URShiftVS: return new (C) URShiftVSNode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
284 case Op_URShiftVI: return new (C) URShiftVINode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
285 case Op_URShiftVL: return new (C) URShiftVLNode(n1, n2, vt); |
0 | 286 |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
287 case Op_AndV: return new (C) AndVNode(n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
288 case Op_OrV: return new (C) OrVNode (n1, n2, vt); |
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
289 case Op_XorV: return new (C) XorVNode(n1, n2, vt); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
290 } |
6823 | 291 fatal(err_msg_res("Missed vector creation for '%s'", NodeClassNames[vopc])); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
292 return NULL; |
0 | 293 |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
294 } |
0 | 295 |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
296 // Scalar promotion |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
297 VectorNode* VectorNode::scalar2vector(Compile* C, Node* s, uint vlen, const Type* opd_t) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
298 BasicType bt = opd_t->array_element_basic_type(); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
299 const TypeVect* vt = opd_t->singleton() ? TypeVect::make(opd_t, vlen) |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
300 : TypeVect::make(bt, vlen); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
301 switch (bt) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
302 case T_BOOLEAN: |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
303 case T_BYTE: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
304 return new (C) ReplicateBNode(s, vt); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
305 case T_CHAR: |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
306 case T_SHORT: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
307 return new (C) ReplicateSNode(s, vt); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
308 case T_INT: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
309 return new (C) ReplicateINode(s, vt); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
310 case T_LONG: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
311 return new (C) ReplicateLNode(s, vt); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
312 case T_FLOAT: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
313 return new (C) ReplicateFNode(s, vt); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
314 case T_DOUBLE: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
315 return new (C) ReplicateDNode(s, vt); |
0 | 316 } |
6823 | 317 fatal(err_msg_res("Type '%s' is not supported for vectors", type2name(bt))); |
318 return NULL; | |
319 } | |
320 | |
321 VectorNode* VectorNode::shift_count(Compile* C, Node* shift, Node* cnt, uint vlen, BasicType bt) { | |
322 assert(VectorNode::is_shift(shift) && !cnt->is_Con(), "only variable shift count"); | |
323 // Match shift count type with shift vector type. | |
324 const TypeVect* vt = TypeVect::make(bt, vlen); | |
325 switch (shift->Opcode()) { | |
326 case Op_LShiftI: | |
327 case Op_LShiftL: | |
328 return new (C) LShiftCntVNode(cnt, vt); | |
329 case Op_RShiftI: | |
330 case Op_RShiftL: | |
331 case Op_URShiftI: | |
332 case Op_URShiftL: | |
333 return new (C) RShiftCntVNode(cnt, vt); | |
334 } | |
335 fatal(err_msg_res("Missed vector creation for '%s'", NodeClassNames[shift->Opcode()])); | |
0 | 336 return NULL; |
337 } | |
338 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
339 // Return initial Pack node. Additional operands added with add_opd() calls. |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
340 PackNode* PackNode::make(Compile* C, Node* s, uint vlen, BasicType bt) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
341 const TypeVect* vt = TypeVect::make(bt, vlen); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
342 switch (bt) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
343 case T_BOOLEAN: |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
344 case T_BYTE: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
345 return new (C) PackBNode(s, vt); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
346 case T_CHAR: |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
347 case T_SHORT: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
348 return new (C) PackSNode(s, vt); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
349 case T_INT: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
350 return new (C) PackINode(s, vt); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
351 case T_LONG: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
352 return new (C) PackLNode(s, vt); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
353 case T_FLOAT: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
354 return new (C) PackFNode(s, vt); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
355 case T_DOUBLE: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
356 return new (C) PackDNode(s, vt); |
0 | 357 } |
6823 | 358 fatal(err_msg_res("Type '%s' is not supported for vectors", type2name(bt))); |
0 | 359 return NULL; |
360 } | |
361 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
362 // Create a binary tree form for Packs. [lo, hi) (half-open) range |
6619
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
363 PackNode* PackNode::binary_tree_pack(Compile* C, int lo, int hi) { |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
364 int ct = hi - lo; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
365 assert(is_power_of_2(ct), "power of 2"); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
366 if (ct == 2) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
367 PackNode* pk = PackNode::make(C, in(lo), 2, vect_type()->element_basic_type()); |
6619
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
368 pk->add_opd(in(lo+1)); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
369 return pk; |
0 | 370 |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
371 } else { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
372 int mid = lo + ct/2; |
6619
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
373 PackNode* n1 = binary_tree_pack(C, lo, mid); |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
374 PackNode* n2 = binary_tree_pack(C, mid, hi ); |
0 | 375 |
6619
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
376 BasicType bt = n1->vect_type()->element_basic_type(); |
5af51c882207
7192963: assert(_in[req-1] == this) failed: Must pass arg count to 'new'
kvn
parents:
6617
diff
changeset
|
377 assert(bt == n2->vect_type()->element_basic_type(), "should be the same"); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
378 switch (bt) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
379 case T_BOOLEAN: |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
380 case T_BYTE: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
381 return new (C) PackSNode(n1, n2, TypeVect::make(T_SHORT, 2)); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
382 case T_CHAR: |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
383 case T_SHORT: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
384 return new (C) PackINode(n1, n2, TypeVect::make(T_INT, 2)); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
385 case T_INT: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
386 return new (C) PackLNode(n1, n2, TypeVect::make(T_LONG, 2)); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
387 case T_LONG: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
388 return new (C) Pack2LNode(n1, n2, TypeVect::make(T_LONG, 2)); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
389 case T_FLOAT: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
390 return new (C) PackDNode(n1, n2, TypeVect::make(T_DOUBLE, 2)); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
391 case T_DOUBLE: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
392 return new (C) Pack2DNode(n1, n2, TypeVect::make(T_DOUBLE, 2)); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
393 } |
6823 | 394 fatal(err_msg_res("Type '%s' is not supported for vectors", type2name(bt))); |
0 | 395 } |
396 return NULL; | |
397 } | |
398 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
399 // Return the vector version of a scalar load node. |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
400 LoadVectorNode* 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
|
401 Node* adr, const TypePtr* atyp, uint vlen, BasicType bt) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
402 const TypeVect* vt = TypeVect::make(bt, vlen); |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
403 return new (C) LoadVectorNode(ctl, mem, adr, atyp, vt); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
404 } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
405 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
406 // Return the vector version of a scalar store node. |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
407 StoreVectorNode* StoreVectorNode::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
|
408 Node* adr, const TypePtr* atyp, Node* val, |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
409 uint vlen) { |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
410 return new (C) StoreVectorNode(ctl, mem, adr, atyp, val); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
411 } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
412 |
0 | 413 // Extract a scalar element of vector. |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
414 Node* ExtractNode::make(Compile* C, Node* v, uint position, BasicType bt) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
415 assert((int)position < Matcher::max_vector_size(bt), "pos in range"); |
0 | 416 ConINode* pos = ConINode::make(C, (int)position); |
417 switch (bt) { | |
418 case T_BOOLEAN: | |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
419 return new (C) ExtractUBNode(v, pos); |
0 | 420 case T_BYTE: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
421 return new (C) ExtractBNode(v, pos); |
0 | 422 case T_CHAR: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
423 return new (C) ExtractCNode(v, pos); |
0 | 424 case T_SHORT: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
425 return new (C) ExtractSNode(v, pos); |
0 | 426 case T_INT: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
427 return new (C) ExtractINode(v, pos); |
0 | 428 case T_LONG: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
429 return new (C) ExtractLNode(v, pos); |
0 | 430 case T_FLOAT: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
431 return new (C) ExtractFNode(v, pos); |
0 | 432 case T_DOUBLE: |
6804
e626685e9f6c
7193318: C2: remove number of inputs requirement from Node's new operator
kvn
parents:
6619
diff
changeset
|
433 return new (C) ExtractDNode(v, pos); |
0 | 434 } |
6823 | 435 fatal(err_msg_res("Type '%s' is not supported for vectors", type2name(bt))); |
0 | 436 return NULL; |
437 } | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3842
diff
changeset
|
438 |