author | lana |
Thu, 16 Oct 2014 14:15:58 -0700 | |
changeset 27113 | 28c10766cfac |
parent 26576 | a9429d24d429 |
child 27691 | 733f189ad1f7 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
15432 | 2 |
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5416
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5416
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5416
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#ifndef CPU_X86_VM_ASSEMBLER_X86_HPP |
26 |
#define CPU_X86_VM_ASSEMBLER_X86_HPP |
|
27 |
||
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
28 |
#include "asm/register.hpp" |
26576
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
29 |
#include "vm_version_x86.hpp" |
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
30 |
|
1 | 31 |
class BiasedLockingCounters; |
32 |
||
33 |
// Contains all the definitions needed for x86 assembly code generation. |
|
34 |
||
35 |
// Calling convention |
|
36 |
class Argument VALUE_OBJ_CLASS_SPEC { |
|
37 |
public: |
|
38 |
enum { |
|
39 |
#ifdef _LP64 |
|
40 |
#ifdef _WIN64 |
|
41 |
n_int_register_parameters_c = 4, // rcx, rdx, r8, r9 (c_rarg0, c_rarg1, ...) |
|
42 |
n_float_register_parameters_c = 4, // xmm0 - xmm3 (c_farg0, c_farg1, ... ) |
|
43 |
#else |
|
44 |
n_int_register_parameters_c = 6, // rdi, rsi, rdx, rcx, r8, r9 (c_rarg0, c_rarg1, ...) |
|
45 |
n_float_register_parameters_c = 8, // xmm0 - xmm7 (c_farg0, c_farg1, ... ) |
|
46 |
#endif // _WIN64 |
|
47 |
n_int_register_parameters_j = 6, // j_rarg0, j_rarg1, ... |
|
48 |
n_float_register_parameters_j = 8 // j_farg0, j_farg1, ... |
|
49 |
#else |
|
50 |
n_register_parameters = 0 // 0 registers used to pass arguments |
|
51 |
#endif // _LP64 |
|
52 |
}; |
|
53 |
}; |
|
54 |
||
55 |
||
56 |
#ifdef _LP64 |
|
57 |
// Symbolically name the register arguments used by the c calling convention. |
|
58 |
// Windows is different from linux/solaris. So much for standards... |
|
59 |
||
60 |
#ifdef _WIN64 |
|
61 |
||
62 |
REGISTER_DECLARATION(Register, c_rarg0, rcx); |
|
63 |
REGISTER_DECLARATION(Register, c_rarg1, rdx); |
|
64 |
REGISTER_DECLARATION(Register, c_rarg2, r8); |
|
65 |
REGISTER_DECLARATION(Register, c_rarg3, r9); |
|
66 |
||
1066 | 67 |
REGISTER_DECLARATION(XMMRegister, c_farg0, xmm0); |
68 |
REGISTER_DECLARATION(XMMRegister, c_farg1, xmm1); |
|
69 |
REGISTER_DECLARATION(XMMRegister, c_farg2, xmm2); |
|
70 |
REGISTER_DECLARATION(XMMRegister, c_farg3, xmm3); |
|
1 | 71 |
|
72 |
#else |
|
73 |
||
74 |
REGISTER_DECLARATION(Register, c_rarg0, rdi); |
|
75 |
REGISTER_DECLARATION(Register, c_rarg1, rsi); |
|
76 |
REGISTER_DECLARATION(Register, c_rarg2, rdx); |
|
77 |
REGISTER_DECLARATION(Register, c_rarg3, rcx); |
|
78 |
REGISTER_DECLARATION(Register, c_rarg4, r8); |
|
79 |
REGISTER_DECLARATION(Register, c_rarg5, r9); |
|
80 |
||
1066 | 81 |
REGISTER_DECLARATION(XMMRegister, c_farg0, xmm0); |
82 |
REGISTER_DECLARATION(XMMRegister, c_farg1, xmm1); |
|
83 |
REGISTER_DECLARATION(XMMRegister, c_farg2, xmm2); |
|
84 |
REGISTER_DECLARATION(XMMRegister, c_farg3, xmm3); |
|
85 |
REGISTER_DECLARATION(XMMRegister, c_farg4, xmm4); |
|
86 |
REGISTER_DECLARATION(XMMRegister, c_farg5, xmm5); |
|
87 |
REGISTER_DECLARATION(XMMRegister, c_farg6, xmm6); |
|
88 |
REGISTER_DECLARATION(XMMRegister, c_farg7, xmm7); |
|
1 | 89 |
|
90 |
#endif // _WIN64 |
|
91 |
||
92 |
// Symbolically name the register arguments used by the Java calling convention. |
|
93 |
// We have control over the convention for java so we can do what we please. |
|
94 |
// What pleases us is to offset the java calling convention so that when |
|
95 |
// we call a suitable jni method the arguments are lined up and we don't |
|
96 |
// have to do little shuffling. A suitable jni method is non-static and a |
|
97 |
// small number of arguments (two fewer args on windows) |
|
98 |
// |
|
99 |
// |-------------------------------------------------------| |
|
100 |
// | c_rarg0 c_rarg1 c_rarg2 c_rarg3 c_rarg4 c_rarg5 | |
|
101 |
// |-------------------------------------------------------| |
|
102 |
// | rcx rdx r8 r9 rdi* rsi* | windows (* not a c_rarg) |
|
103 |
// | rdi rsi rdx rcx r8 r9 | solaris/linux |
|
104 |
// |-------------------------------------------------------| |
|
105 |
// | j_rarg5 j_rarg0 j_rarg1 j_rarg2 j_rarg3 j_rarg4 | |
|
106 |
// |-------------------------------------------------------| |
|
107 |
||
108 |
REGISTER_DECLARATION(Register, j_rarg0, c_rarg1); |
|
109 |
REGISTER_DECLARATION(Register, j_rarg1, c_rarg2); |
|
110 |
REGISTER_DECLARATION(Register, j_rarg2, c_rarg3); |
|
111 |
// Windows runs out of register args here |
|
112 |
#ifdef _WIN64 |
|
113 |
REGISTER_DECLARATION(Register, j_rarg3, rdi); |
|
114 |
REGISTER_DECLARATION(Register, j_rarg4, rsi); |
|
115 |
#else |
|
116 |
REGISTER_DECLARATION(Register, j_rarg3, c_rarg4); |
|
117 |
REGISTER_DECLARATION(Register, j_rarg4, c_rarg5); |
|
118 |
#endif /* _WIN64 */ |
|
119 |
REGISTER_DECLARATION(Register, j_rarg5, c_rarg0); |
|
120 |
||
1066 | 121 |
REGISTER_DECLARATION(XMMRegister, j_farg0, xmm0); |
122 |
REGISTER_DECLARATION(XMMRegister, j_farg1, xmm1); |
|
123 |
REGISTER_DECLARATION(XMMRegister, j_farg2, xmm2); |
|
124 |
REGISTER_DECLARATION(XMMRegister, j_farg3, xmm3); |
|
125 |
REGISTER_DECLARATION(XMMRegister, j_farg4, xmm4); |
|
126 |
REGISTER_DECLARATION(XMMRegister, j_farg5, xmm5); |
|
127 |
REGISTER_DECLARATION(XMMRegister, j_farg6, xmm6); |
|
128 |
REGISTER_DECLARATION(XMMRegister, j_farg7, xmm7); |
|
1 | 129 |
|
130 |
REGISTER_DECLARATION(Register, rscratch1, r10); // volatile |
|
131 |
REGISTER_DECLARATION(Register, rscratch2, r11); // volatile |
|
132 |
||
1066 | 133 |
REGISTER_DECLARATION(Register, r12_heapbase, r12); // callee-saved |
1 | 134 |
REGISTER_DECLARATION(Register, r15_thread, r15); // callee-saved |
135 |
||
1066 | 136 |
#else |
137 |
// rscratch1 will apear in 32bit code that is dead but of course must compile |
|
138 |
// Using noreg ensures if the dead code is incorrectly live and executed it |
|
139 |
// will cause an assertion failure |
|
140 |
#define rscratch1 noreg |
|
7427 | 141 |
#define rscratch2 noreg |
1066 | 142 |
|
1 | 143 |
#endif // _LP64 |
144 |
||
5687 | 145 |
// JSR 292 fixed register usages: |
146 |
REGISTER_DECLARATION(Register, rbp_mh_SP_save, rbp); |
|
147 |
||
1 | 148 |
// Address is an abstraction used to represent a memory location |
149 |
// using any of the amd64 addressing modes with one object. |
|
150 |
// |
|
151 |
// Note: A register location is represented via a Register, not |
|
152 |
// via an address for efficiency & simplicity reasons. |
|
153 |
||
154 |
class ArrayAddress; |
|
155 |
||
156 |
class Address VALUE_OBJ_CLASS_SPEC { |
|
157 |
public: |
|
158 |
enum ScaleFactor { |
|
159 |
no_scale = -1, |
|
160 |
times_1 = 0, |
|
161 |
times_2 = 1, |
|
162 |
times_4 = 2, |
|
1066 | 163 |
times_8 = 3, |
164 |
times_ptr = LP64_ONLY(times_8) NOT_LP64(times_4) |
|
1 | 165 |
}; |
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
166 |
static ScaleFactor times(int size) { |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
167 |
assert(size >= 1 && size <= 8 && is_power_of_2(size), "bad scale size"); |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
168 |
if (size == 8) return times_8; |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
169 |
if (size == 4) return times_4; |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
170 |
if (size == 2) return times_2; |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
171 |
return times_1; |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
172 |
} |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
173 |
static int scale_size(ScaleFactor scale) { |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
174 |
assert(scale != no_scale, ""); |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
175 |
assert(((1 << (int)times_1) == 1 && |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
176 |
(1 << (int)times_2) == 2 && |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
177 |
(1 << (int)times_4) == 4 && |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
178 |
(1 << (int)times_8) == 8), ""); |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
179 |
return (1 << (int)scale); |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
180 |
} |
1 | 181 |
|
182 |
private: |
|
183 |
Register _base; |
|
184 |
Register _index; |
|
185 |
ScaleFactor _scale; |
|
186 |
int _disp; |
|
187 |
RelocationHolder _rspec; |
|
188 |
||
1066 | 189 |
// Easily misused constructors make them private |
190 |
// %%% can we make these go away? |
|
191 |
NOT_LP64(Address(address loc, RelocationHolder spec);) |
|
192 |
Address(int disp, address loc, relocInfo::relocType rtype); |
|
193 |
Address(int disp, address loc, RelocationHolder spec); |
|
1 | 194 |
|
195 |
public: |
|
1066 | 196 |
|
197 |
int disp() { return _disp; } |
|
1 | 198 |
// creation |
199 |
Address() |
|
200 |
: _base(noreg), |
|
201 |
_index(noreg), |
|
202 |
_scale(no_scale), |
|
203 |
_disp(0) { |
|
204 |
} |
|
205 |
||
206 |
// No default displacement otherwise Register can be implicitly |
|
207 |
// converted to 0(Register) which is quite a different animal. |
|
208 |
||
209 |
Address(Register base, int disp) |
|
210 |
: _base(base), |
|
211 |
_index(noreg), |
|
212 |
_scale(no_scale), |
|
213 |
_disp(disp) { |
|
214 |
} |
|
215 |
||
216 |
Address(Register base, Register index, ScaleFactor scale, int disp = 0) |
|
217 |
: _base (base), |
|
218 |
_index(index), |
|
219 |
_scale(scale), |
|
220 |
_disp (disp) { |
|
221 |
assert(!index->is_valid() == (scale == Address::no_scale), |
|
222 |
"inconsistent address"); |
|
223 |
} |
|
224 |
||
2332
5c7b6f4ce0a1
6814659: separable cleanups and subroutines for 6655638
jrose
parents:
2256
diff
changeset
|
225 |
Address(Register base, RegisterOrConstant index, ScaleFactor scale = times_1, int disp = 0) |
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
226 |
: _base (base), |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
227 |
_index(index.register_or_noreg()), |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
228 |
_scale(scale), |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
229 |
_disp (disp + (index.constant_or_zero() * scale_size(scale))) { |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
230 |
if (!index.is_register()) scale = Address::no_scale; |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
231 |
assert(!_index->is_valid() == (scale == Address::no_scale), |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
232 |
"inconsistent address"); |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
233 |
} |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
234 |
|
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
235 |
Address plus_disp(int disp) const { |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
236 |
Address a = (*this); |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
237 |
a._disp += disp; |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
238 |
return a; |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
239 |
} |
9630
d6419e4395e3
6939861: JVM should handle more conversion operations
never
parents:
9437
diff
changeset
|
240 |
Address plus_disp(RegisterOrConstant disp, ScaleFactor scale = times_1) const { |
d6419e4395e3
6939861: JVM should handle more conversion operations
never
parents:
9437
diff
changeset
|
241 |
Address a = (*this); |
d6419e4395e3
6939861: JVM should handle more conversion operations
never
parents:
9437
diff
changeset
|
242 |
a._disp += disp.constant_or_zero() * scale_size(scale); |
d6419e4395e3
6939861: JVM should handle more conversion operations
never
parents:
9437
diff
changeset
|
243 |
if (disp.is_register()) { |
d6419e4395e3
6939861: JVM should handle more conversion operations
never
parents:
9437
diff
changeset
|
244 |
assert(!a.index()->is_valid(), "competing indexes"); |
d6419e4395e3
6939861: JVM should handle more conversion operations
never
parents:
9437
diff
changeset
|
245 |
a._index = disp.as_register(); |
d6419e4395e3
6939861: JVM should handle more conversion operations
never
parents:
9437
diff
changeset
|
246 |
a._scale = scale; |
d6419e4395e3
6939861: JVM should handle more conversion operations
never
parents:
9437
diff
changeset
|
247 |
} |
d6419e4395e3
6939861: JVM should handle more conversion operations
never
parents:
9437
diff
changeset
|
248 |
return a; |
d6419e4395e3
6939861: JVM should handle more conversion operations
never
parents:
9437
diff
changeset
|
249 |
} |
d6419e4395e3
6939861: JVM should handle more conversion operations
never
parents:
9437
diff
changeset
|
250 |
bool is_same_address(Address a) const { |
d6419e4395e3
6939861: JVM should handle more conversion operations
never
parents:
9437
diff
changeset
|
251 |
// disregard _rspec |
d6419e4395e3
6939861: JVM should handle more conversion operations
never
parents:
9437
diff
changeset
|
252 |
return _base == a._base && _disp == a._disp && _index == a._index && _scale == a._scale; |
d6419e4395e3
6939861: JVM should handle more conversion operations
never
parents:
9437
diff
changeset
|
253 |
} |
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
254 |
|
1 | 255 |
// The following two overloads are used in connection with the |
256 |
// ByteSize type (see sizes.hpp). They simplify the use of |
|
257 |
// ByteSize'd arguments in assembly code. Note that their equivalent |
|
258 |
// for the optimized build are the member functions with int disp |
|
259 |
// argument since ByteSize is mapped to an int type in that case. |
|
260 |
// |
|
261 |
// Note: DO NOT introduce similar overloaded functions for WordSize |
|
262 |
// arguments as in the optimized mode, both ByteSize and WordSize |
|
263 |
// are mapped to the same type and thus the compiler cannot make a |
|
264 |
// distinction anymore (=> compiler errors). |
|
265 |
||
266 |
#ifdef ASSERT |
|
267 |
Address(Register base, ByteSize disp) |
|
268 |
: _base(base), |
|
269 |
_index(noreg), |
|
270 |
_scale(no_scale), |
|
271 |
_disp(in_bytes(disp)) { |
|
272 |
} |
|
273 |
||
274 |
Address(Register base, Register index, ScaleFactor scale, ByteSize disp) |
|
275 |
: _base(base), |
|
276 |
_index(index), |
|
277 |
_scale(scale), |
|
278 |
_disp(in_bytes(disp)) { |
|
279 |
assert(!index->is_valid() == (scale == Address::no_scale), |
|
280 |
"inconsistent address"); |
|
281 |
} |
|
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
282 |
|
2332
5c7b6f4ce0a1
6814659: separable cleanups and subroutines for 6655638
jrose
parents:
2256
diff
changeset
|
283 |
Address(Register base, RegisterOrConstant index, ScaleFactor scale, ByteSize disp) |
2148
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
284 |
: _base (base), |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
285 |
_index(index.register_or_noreg()), |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
286 |
_scale(scale), |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
287 |
_disp (in_bytes(disp) + (index.constant_or_zero() * scale_size(scale))) { |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
288 |
if (!index.is_register()) scale = Address::no_scale; |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
289 |
assert(!_index->is_valid() == (scale == Address::no_scale), |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
290 |
"inconsistent address"); |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
291 |
} |
09c7f703773b
6812678: macro assembler needs delayed binding of a few constants (for 6655638)
jrose
parents:
1500
diff
changeset
|
292 |
|
1 | 293 |
#endif // ASSERT |
294 |
||
295 |
// accessors |
|
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
244
diff
changeset
|
296 |
bool uses(Register reg) const { return _base == reg || _index == reg; } |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
244
diff
changeset
|
297 |
Register base() const { return _base; } |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
244
diff
changeset
|
298 |
Register index() const { return _index; } |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
244
diff
changeset
|
299 |
ScaleFactor scale() const { return _scale; } |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
244
diff
changeset
|
300 |
int disp() const { return _disp; } |
1 | 301 |
|
302 |
// Convert the raw encoding form into the form expected by the constructor for |
|
303 |
// Address. An index of 4 (rsp) corresponds to having no index, so convert |
|
304 |
// that to noreg for the Address constructor. |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13485
diff
changeset
|
305 |
static Address make_raw(int base, int index, int scale, int disp, relocInfo::relocType disp_reloc); |
1 | 306 |
|
307 |
static Address make_array(ArrayAddress); |
|
308 |
||
309 |
private: |
|
310 |
bool base_needs_rex() const { |
|
311 |
return _base != noreg && _base->encoding() >= 8; |
|
312 |
} |
|
313 |
||
314 |
bool index_needs_rex() const { |
|
315 |
return _index != noreg &&_index->encoding() >= 8; |
|
316 |
} |
|
317 |
||
318 |
relocInfo::relocType reloc() const { return _rspec.type(); } |
|
319 |
||
320 |
friend class Assembler; |
|
321 |
friend class MacroAssembler; |
|
322 |
friend class LIR_Assembler; // base/index/scale/disp |
|
323 |
}; |
|
324 |
||
325 |
// |
|
326 |
// AddressLiteral has been split out from Address because operands of this type |
|
327 |
// need to be treated specially on 32bit vs. 64bit platforms. By splitting it out |
|
328 |
// the few instructions that need to deal with address literals are unique and the |
|
329 |
// MacroAssembler does not have to implement every instruction in the Assembler |
|
330 |
// in order to search for address literals that may need special handling depending |
|
331 |
// on the instruction and the platform. As small step on the way to merging i486/amd64 |
|
332 |
// directories. |
|
333 |
// |
|
334 |
class AddressLiteral VALUE_OBJ_CLASS_SPEC { |
|
335 |
friend class ArrayAddress; |
|
336 |
RelocationHolder _rspec; |
|
337 |
// Typically we use AddressLiterals we want to use their rval |
|
338 |
// However in some situations we want the lval (effect address) of the item. |
|
339 |
// We provide a special factory for making those lvals. |
|
340 |
bool _is_lval; |
|
341 |
||
342 |
// If the target is far we'll need to load the ea of this to |
|
343 |
// a register to reach it. Otherwise if near we can do rip |
|
344 |
// relative addressing. |
|
345 |
||
346 |
address _target; |
|
347 |
||
348 |
protected: |
|
349 |
// creation |
|
350 |
AddressLiteral() |
|
351 |
: _is_lval(false), |
|
352 |
_target(NULL) |
|
353 |
{} |
|
354 |
||
355 |
public: |
|
356 |
||
357 |
||
358 |
AddressLiteral(address target, relocInfo::relocType rtype); |
|
359 |
||
360 |
AddressLiteral(address target, RelocationHolder const& rspec) |
|
361 |
: _rspec(rspec), |
|
362 |
_is_lval(false), |
|
363 |
_target(target) |
|
364 |
{} |
|
365 |
||
366 |
AddressLiteral addr() { |
|
367 |
AddressLiteral ret = *this; |
|
368 |
ret._is_lval = true; |
|
369 |
return ret; |
|
370 |
} |
|
371 |
||
372 |
||
373 |
private: |
|
374 |
||
375 |
address target() { return _target; } |
|
376 |
bool is_lval() { return _is_lval; } |
|
377 |
||
378 |
relocInfo::relocType reloc() const { return _rspec.type(); } |
|
379 |
const RelocationHolder& rspec() const { return _rspec; } |
|
380 |
||
381 |
friend class Assembler; |
|
382 |
friend class MacroAssembler; |
|
383 |
friend class Address; |
|
384 |
friend class LIR_Assembler; |
|
385 |
}; |
|
386 |
||
387 |
// Convience classes |
|
388 |
class RuntimeAddress: public AddressLiteral { |
|
389 |
||
390 |
public: |
|
391 |
||
392 |
RuntimeAddress(address target) : AddressLiteral(target, relocInfo::runtime_call_type) {} |
|
393 |
||
394 |
}; |
|
395 |
||
396 |
class ExternalAddress: public AddressLiteral { |
|
9111
c100c09c66f2
6777083: assert(target != __null,"must not be null")
never
parents:
8882
diff
changeset
|
397 |
private: |
c100c09c66f2
6777083: assert(target != __null,"must not be null")
never
parents:
8882
diff
changeset
|
398 |
static relocInfo::relocType reloc_for_target(address target) { |
c100c09c66f2
6777083: assert(target != __null,"must not be null")
never
parents:
8882
diff
changeset
|
399 |
// Sometimes ExternalAddress is used for values which aren't |
c100c09c66f2
6777083: assert(target != __null,"must not be null")
never
parents:
8882
diff
changeset
|
400 |
// exactly addresses, like the card table base. |
c100c09c66f2
6777083: assert(target != __null,"must not be null")
never
parents:
8882
diff
changeset
|
401 |
// external_word_type can't be used for values in the first page |
c100c09c66f2
6777083: assert(target != __null,"must not be null")
never
parents:
8882
diff
changeset
|
402 |
// so just skip the reloc in that case. |
c100c09c66f2
6777083: assert(target != __null,"must not be null")
never
parents:
8882
diff
changeset
|
403 |
return external_word_Relocation::can_be_relocated(target) ? relocInfo::external_word_type : relocInfo::none; |
c100c09c66f2
6777083: assert(target != __null,"must not be null")
never
parents:
8882
diff
changeset
|
404 |
} |
c100c09c66f2
6777083: assert(target != __null,"must not be null")
never
parents:
8882
diff
changeset
|
405 |
|
c100c09c66f2
6777083: assert(target != __null,"must not be null")
never
parents:
8882
diff
changeset
|
406 |
public: |
c100c09c66f2
6777083: assert(target != __null,"must not be null")
never
parents:
8882
diff
changeset
|
407 |
|
c100c09c66f2
6777083: assert(target != __null,"must not be null")
never
parents:
8882
diff
changeset
|
408 |
ExternalAddress(address target) : AddressLiteral(target, reloc_for_target(target)) {} |
1 | 409 |
|
410 |
}; |
|
411 |
||
412 |
class InternalAddress: public AddressLiteral { |
|
413 |
||
414 |
public: |
|
415 |
||
416 |
InternalAddress(address target) : AddressLiteral(target, relocInfo::internal_word_type) {} |
|
417 |
||
418 |
}; |
|
419 |
||
420 |
// x86 can do array addressing as a single operation since disp can be an absolute |
|
421 |
// address amd64 can't. We create a class that expresses the concept but does extra |
|
422 |
// magic on amd64 to get the final result |
|
423 |
||
424 |
class ArrayAddress VALUE_OBJ_CLASS_SPEC { |
|
425 |
private: |
|
426 |
||
427 |
AddressLiteral _base; |
|
428 |
Address _index; |
|
429 |
||
430 |
public: |
|
431 |
||
432 |
ArrayAddress() {}; |
|
433 |
ArrayAddress(AddressLiteral base, Address index): _base(base), _index(index) {}; |
|
434 |
AddressLiteral base() { return _base; } |
|
435 |
Address index() { return _index; } |
|
436 |
||
437 |
}; |
|
438 |
||
1066 | 439 |
const int FPUStateSizeInWords = NOT_LP64(27) LP64_ONLY( 512 / wordSize); |
1 | 440 |
|
441 |
// The Intel x86/Amd64 Assembler: Pure assembler doing NO optimizations on the instruction |
|
442 |
// level (e.g. mov rax, 0 is not translated into xor rax, rax!); i.e., what you write |
|
443 |
// is what you get. The Assembler is generating code into a CodeBuffer. |
|
444 |
||
445 |
class Assembler : public AbstractAssembler { |
|
446 |
friend class AbstractAssembler; // for the non-virtual hack |
|
447 |
friend class LIR_Assembler; // as_Address() |
|
1066 | 448 |
friend class StubGenerator; |
1 | 449 |
|
450 |
public: |
|
451 |
enum Condition { // The x86 condition codes used for conditional jumps/moves. |
|
452 |
zero = 0x4, |
|
453 |
notZero = 0x5, |
|
454 |
equal = 0x4, |
|
455 |
notEqual = 0x5, |
|
456 |
less = 0xc, |
|
457 |
lessEqual = 0xe, |
|
458 |
greater = 0xf, |
|
459 |
greaterEqual = 0xd, |
|
460 |
below = 0x2, |
|
461 |
belowEqual = 0x6, |
|
462 |
above = 0x7, |
|
463 |
aboveEqual = 0x3, |
|
464 |
overflow = 0x0, |
|
465 |
noOverflow = 0x1, |
|
466 |
carrySet = 0x2, |
|
467 |
carryClear = 0x3, |
|
468 |
negative = 0x8, |
|
469 |
positive = 0x9, |
|
470 |
parity = 0xa, |
|
471 |
noParity = 0xb |
|
472 |
}; |
|
473 |
||
474 |
enum Prefix { |
|
475 |
// segment overrides |
|
476 |
CS_segment = 0x2e, |
|
477 |
SS_segment = 0x36, |
|
478 |
DS_segment = 0x3e, |
|
479 |
ES_segment = 0x26, |
|
480 |
FS_segment = 0x64, |
|
481 |
GS_segment = 0x65, |
|
482 |
||
483 |
REX = 0x40, |
|
484 |
||
485 |
REX_B = 0x41, |
|
486 |
REX_X = 0x42, |
|
487 |
REX_XB = 0x43, |
|
488 |
REX_R = 0x44, |
|
489 |
REX_RB = 0x45, |
|
490 |
REX_RX = 0x46, |
|
491 |
REX_RXB = 0x47, |
|
492 |
||
493 |
REX_W = 0x48, |
|
494 |
||
495 |
REX_WB = 0x49, |
|
496 |
REX_WX = 0x4A, |
|
497 |
REX_WXB = 0x4B, |
|
498 |
REX_WR = 0x4C, |
|
499 |
REX_WRB = 0x4D, |
|
500 |
REX_WRX = 0x4E, |
|
11427 | 501 |
REX_WRXB = 0x4F, |
502 |
||
503 |
VEX_3bytes = 0xC4, |
|
504 |
VEX_2bytes = 0xC5 |
|
505 |
}; |
|
506 |
||
507 |
enum VexPrefix { |
|
508 |
VEX_B = 0x20, |
|
509 |
VEX_X = 0x40, |
|
510 |
VEX_R = 0x80, |
|
511 |
VEX_W = 0x80 |
|
512 |
}; |
|
513 |
||
514 |
enum VexSimdPrefix { |
|
515 |
VEX_SIMD_NONE = 0x0, |
|
516 |
VEX_SIMD_66 = 0x1, |
|
517 |
VEX_SIMD_F3 = 0x2, |
|
518 |
VEX_SIMD_F2 = 0x3 |
|
519 |
}; |
|
520 |
||
521 |
enum VexOpcode { |
|
522 |
VEX_OPCODE_NONE = 0x0, |
|
523 |
VEX_OPCODE_0F = 0x1, |
|
524 |
VEX_OPCODE_0F_38 = 0x2, |
|
525 |
VEX_OPCODE_0F_3A = 0x3 |
|
1 | 526 |
}; |
527 |
||
528 |
enum WhichOperand { |
|
529 |
// input to locate_operand, and format code for relocations |
|
1066 | 530 |
imm_operand = 0, // embedded 32-bit|64-bit immediate operand |
1 | 531 |
disp32_operand = 1, // embedded 32-bit displacement or address |
532 |
call32_operand = 2, // embedded 32-bit self-relative displacement |
|
1066 | 533 |
#ifndef _LP64 |
1 | 534 |
_WhichOperand_limit = 3 |
1066 | 535 |
#else |
536 |
narrow_oop_operand = 3, // embedded 32-bit immediate narrow oop |
|
537 |
_WhichOperand_limit = 4 |
|
538 |
#endif |
|
1 | 539 |
}; |
540 |
||
1066 | 541 |
|
542 |
||
543 |
// NOTE: The general philopsophy of the declarations here is that 64bit versions |
|
544 |
// of instructions are freely declared without the need for wrapping them an ifdef. |
|
545 |
// (Some dangerous instructions are ifdef's out of inappropriate jvm's.) |
|
546 |
// In the .cpp file the implementations are wrapped so that they are dropped out |
|
15432 | 547 |
// of the resulting jvm. This is done mostly to keep the footprint of MINIMAL |
1066 | 548 |
// to the size it was prior to merging up the 32bit and 64bit assemblers. |
549 |
// |
|
550 |
// This does mean you'll get a linker/runtime error if you use a 64bit only instruction |
|
551 |
// in a 32bit vm. This is somewhat unfortunate but keeps the ifdef noise down. |
|
552 |
||
553 |
private: |
|
554 |
||
555 |
||
556 |
// 64bit prefixes |
|
557 |
int prefix_and_encode(int reg_enc, bool byteinst = false); |
|
558 |
int prefixq_and_encode(int reg_enc); |
|
559 |
||
560 |
int prefix_and_encode(int dst_enc, int src_enc, bool byteinst = false); |
|
561 |
int prefixq_and_encode(int dst_enc, int src_enc); |
|
562 |
||
563 |
void prefix(Register reg); |
|
564 |
void prefix(Address adr); |
|
565 |
void prefixq(Address adr); |
|
566 |
||
567 |
void prefix(Address adr, Register reg, bool byteinst = false); |
|
11427 | 568 |
void prefix(Address adr, XMMRegister reg); |
1066 | 569 |
void prefixq(Address adr, Register reg); |
11427 | 570 |
void prefixq(Address adr, XMMRegister reg); |
1066 | 571 |
|
572 |
void prefetch_prefix(Address src); |
|
573 |
||
11427 | 574 |
void rex_prefix(Address adr, XMMRegister xreg, |
575 |
VexSimdPrefix pre, VexOpcode opc, bool rex_w); |
|
576 |
int rex_prefix_and_encode(int dst_enc, int src_enc, |
|
577 |
VexSimdPrefix pre, VexOpcode opc, bool rex_w); |
|
578 |
||
579 |
void vex_prefix(bool vex_r, bool vex_b, bool vex_x, bool vex_w, |
|
580 |
int nds_enc, VexSimdPrefix pre, VexOpcode opc, |
|
581 |
bool vector256); |
|
582 |
||
583 |
void vex_prefix(Address adr, int nds_enc, int xreg_enc, |
|
584 |
VexSimdPrefix pre, VexOpcode opc, |
|
585 |
bool vex_w, bool vector256); |
|
586 |
||
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
587 |
void vex_prefix(XMMRegister dst, XMMRegister nds, Address src, |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
588 |
VexSimdPrefix pre, bool vector256 = false) { |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
589 |
int dst_enc = dst->encoding(); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
590 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
591 |
vex_prefix(src, nds_enc, dst_enc, pre, VEX_OPCODE_0F, false, vector256); |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
592 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
593 |
|
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
594 |
void vex_prefix_0F38(Register dst, Register nds, Address src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
595 |
bool vex_w = false; |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
596 |
bool vector256 = false; |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
597 |
vex_prefix(src, nds->encoding(), dst->encoding(), |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
598 |
VEX_SIMD_NONE, VEX_OPCODE_0F_38, vex_w, vector256); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
599 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
600 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
601 |
void vex_prefix_0F38_q(Register dst, Register nds, Address src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
602 |
bool vex_w = true; |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
603 |
bool vector256 = false; |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
604 |
vex_prefix(src, nds->encoding(), dst->encoding(), |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
605 |
VEX_SIMD_NONE, VEX_OPCODE_0F_38, vex_w, vector256); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
606 |
} |
11427 | 607 |
int vex_prefix_and_encode(int dst_enc, int nds_enc, int src_enc, |
608 |
VexSimdPrefix pre, VexOpcode opc, |
|
609 |
bool vex_w, bool vector256); |
|
610 |
||
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
611 |
int vex_prefix_0F38_and_encode(Register dst, Register nds, Register src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
612 |
bool vex_w = false; |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
613 |
bool vector256 = false; |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
614 |
return vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
615 |
VEX_SIMD_NONE, VEX_OPCODE_0F_38, vex_w, vector256); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
616 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
617 |
int vex_prefix_0F38_and_encode_q(Register dst, Register nds, Register src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
618 |
bool vex_w = true; |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
619 |
bool vector256 = false; |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
620 |
return vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
621 |
VEX_SIMD_NONE, VEX_OPCODE_0F_38, vex_w, vector256); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
622 |
} |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
623 |
int vex_prefix_and_encode(XMMRegister dst, XMMRegister nds, XMMRegister src, |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
624 |
VexSimdPrefix pre, bool vector256 = false, |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
625 |
VexOpcode opc = VEX_OPCODE_0F) { |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
626 |
int src_enc = src->encoding(); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
627 |
int dst_enc = dst->encoding(); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
628 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
629 |
return vex_prefix_and_encode(dst_enc, nds_enc, src_enc, pre, opc, false, vector256); |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
630 |
} |
11427 | 631 |
|
632 |
void simd_prefix(XMMRegister xreg, XMMRegister nds, Address adr, |
|
633 |
VexSimdPrefix pre, VexOpcode opc = VEX_OPCODE_0F, |
|
634 |
bool rex_w = false, bool vector256 = false); |
|
635 |
||
636 |
void simd_prefix(XMMRegister dst, Address src, |
|
637 |
VexSimdPrefix pre, VexOpcode opc = VEX_OPCODE_0F) { |
|
638 |
simd_prefix(dst, xnoreg, src, pre, opc); |
|
639 |
} |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
640 |
|
11427 | 641 |
void simd_prefix(Address dst, XMMRegister src, VexSimdPrefix pre) { |
642 |
simd_prefix(src, dst, pre); |
|
643 |
} |
|
644 |
void simd_prefix_q(XMMRegister dst, XMMRegister nds, Address src, |
|
645 |
VexSimdPrefix pre) { |
|
646 |
bool rex_w = true; |
|
647 |
simd_prefix(dst, nds, src, pre, VEX_OPCODE_0F, rex_w); |
|
648 |
} |
|
649 |
||
650 |
int simd_prefix_and_encode(XMMRegister dst, XMMRegister nds, XMMRegister src, |
|
651 |
VexSimdPrefix pre, VexOpcode opc = VEX_OPCODE_0F, |
|
652 |
bool rex_w = false, bool vector256 = false); |
|
653 |
||
654 |
// Move/convert 32-bit integer value. |
|
655 |
int simd_prefix_and_encode(XMMRegister dst, XMMRegister nds, Register src, |
|
656 |
VexSimdPrefix pre) { |
|
657 |
// It is OK to cast from Register to XMMRegister to pass argument here |
|
658 |
// since only encoding is used in simd_prefix_and_encode() and number of |
|
659 |
// Gen and Xmm registers are the same. |
|
660 |
return simd_prefix_and_encode(dst, nds, as_XMMRegister(src->encoding()), pre); |
|
661 |
} |
|
662 |
int simd_prefix_and_encode(XMMRegister dst, Register src, VexSimdPrefix pre) { |
|
663 |
return simd_prefix_and_encode(dst, xnoreg, src, pre); |
|
664 |
} |
|
665 |
int simd_prefix_and_encode(Register dst, XMMRegister src, |
|
666 |
VexSimdPrefix pre, VexOpcode opc = VEX_OPCODE_0F) { |
|
667 |
return simd_prefix_and_encode(as_XMMRegister(dst->encoding()), xnoreg, src, pre, opc); |
|
668 |
} |
|
669 |
||
670 |
// Move/convert 64-bit integer value. |
|
671 |
int simd_prefix_and_encode_q(XMMRegister dst, XMMRegister nds, Register src, |
|
672 |
VexSimdPrefix pre) { |
|
673 |
bool rex_w = true; |
|
674 |
return simd_prefix_and_encode(dst, nds, as_XMMRegister(src->encoding()), pre, VEX_OPCODE_0F, rex_w); |
|
675 |
} |
|
676 |
int simd_prefix_and_encode_q(XMMRegister dst, Register src, VexSimdPrefix pre) { |
|
677 |
return simd_prefix_and_encode_q(dst, xnoreg, src, pre); |
|
678 |
} |
|
679 |
int simd_prefix_and_encode_q(Register dst, XMMRegister src, |
|
680 |
VexSimdPrefix pre, VexOpcode opc = VEX_OPCODE_0F) { |
|
681 |
bool rex_w = true; |
|
682 |
return simd_prefix_and_encode(as_XMMRegister(dst->encoding()), xnoreg, src, pre, opc, rex_w); |
|
683 |
} |
|
684 |
||
1066 | 685 |
// Helper functions for groups of instructions |
686 |
void emit_arith_b(int op1, int op2, Register dst, int imm8); |
|
687 |
||
688 |
void emit_arith(int op1, int op2, Register dst, int32_t imm32); |
|
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11429
diff
changeset
|
689 |
// Force generation of a 4 byte immediate value even if it fits into 8bit |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11429
diff
changeset
|
690 |
void emit_arith_imm32(int op1, int op2, Register dst, int32_t imm32); |
1066 | 691 |
void emit_arith(int op1, int op2, Register dst, Register src); |
692 |
||
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
693 |
void emit_simd_arith(int opcode, XMMRegister dst, Address src, VexSimdPrefix pre); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
694 |
void emit_simd_arith(int opcode, XMMRegister dst, XMMRegister src, VexSimdPrefix pre); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
695 |
void emit_simd_arith_nonds(int opcode, XMMRegister dst, Address src, VexSimdPrefix pre); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
696 |
void emit_simd_arith_nonds(int opcode, XMMRegister dst, XMMRegister src, VexSimdPrefix pre); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
697 |
void emit_vex_arith(int opcode, XMMRegister dst, XMMRegister nds, |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
698 |
Address src, VexSimdPrefix pre, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
699 |
void emit_vex_arith(int opcode, XMMRegister dst, XMMRegister nds, |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
700 |
XMMRegister src, VexSimdPrefix pre, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
701 |
|
1066 | 702 |
void emit_operand(Register reg, |
703 |
Register base, Register index, Address::ScaleFactor scale, |
|
704 |
int disp, |
|
705 |
RelocationHolder const& rspec, |
|
706 |
int rip_relative_correction = 0); |
|
707 |
||
708 |
void emit_operand(Register reg, Address adr, int rip_relative_correction = 0); |
|
709 |
||
710 |
// operands that only take the original 32bit registers |
|
711 |
void emit_operand32(Register reg, Address adr); |
|
712 |
||
713 |
void emit_operand(XMMRegister reg, |
|
714 |
Register base, Register index, Address::ScaleFactor scale, |
|
715 |
int disp, |
|
716 |
RelocationHolder const& rspec); |
|
717 |
||
718 |
void emit_operand(XMMRegister reg, Address adr); |
|
719 |
||
720 |
void emit_operand(MMXRegister reg, Address adr); |
|
721 |
||
722 |
// workaround gcc (3.2.1-7) bug |
|
723 |
void emit_operand(Address adr, MMXRegister reg); |
|
724 |
||
725 |
||
726 |
// Immediate-to-memory forms |
|
727 |
void emit_arith_operand(int op1, Register rm, Address adr, int32_t imm32); |
|
728 |
||
729 |
void emit_farith(int b1, int b2, int i); |
|
730 |
||
731 |
||
732 |
protected: |
|
733 |
#ifdef ASSERT |
|
734 |
void check_relocation(RelocationHolder const& rspec, int format); |
|
735 |
#endif |
|
736 |
||
737 |
void emit_data(jint data, relocInfo::relocType rtype, int format); |
|
738 |
void emit_data(jint data, RelocationHolder const& rspec, int format); |
|
739 |
void emit_data64(jlong data, relocInfo::relocType rtype, int format = 0); |
|
740 |
void emit_data64(jlong data, RelocationHolder const& rspec, int format = 0); |
|
741 |
||
742 |
bool reachable(AddressLiteral adr) NOT_LP64({ return true;}); |
|
743 |
||
744 |
// These are all easily abused and hence protected |
|
745 |
||
746 |
// 32BIT ONLY SECTION |
|
747 |
#ifndef _LP64 |
|
748 |
// Make these disappear in 64bit mode since they would never be correct |
|
749 |
void cmp_literal32(Register src1, int32_t imm32, RelocationHolder const& rspec); // 32BIT ONLY |
|
750 |
void cmp_literal32(Address src1, int32_t imm32, RelocationHolder const& rspec); // 32BIT ONLY |
|
751 |
||
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
752 |
void mov_literal32(Register dst, int32_t imm32, RelocationHolder const& rspec); // 32BIT ONLY |
1066 | 753 |
void mov_literal32(Address dst, int32_t imm32, RelocationHolder const& rspec); // 32BIT ONLY |
754 |
||
755 |
void push_literal32(int32_t imm32, RelocationHolder const& rspec); // 32BIT ONLY |
|
756 |
#else |
|
757 |
// 64BIT ONLY SECTION |
|
758 |
void mov_literal64(Register dst, intptr_t imm64, RelocationHolder const& rspec); // 64BIT ONLY |
|
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
759 |
|
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
760 |
void cmp_narrow_oop(Register src1, int32_t imm32, RelocationHolder const& rspec); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
761 |
void cmp_narrow_oop(Address src1, int32_t imm32, RelocationHolder const& rspec); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
762 |
|
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
763 |
void mov_narrow_oop(Register dst, int32_t imm32, RelocationHolder const& rspec); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
764 |
void mov_narrow_oop(Address dst, int32_t imm32, RelocationHolder const& rspec); |
1066 | 765 |
#endif // _LP64 |
766 |
||
767 |
// These are unique in that we are ensured by the caller that the 32bit |
|
768 |
// relative in these instructions will always be able to reach the potentially |
|
769 |
// 64bit address described by entry. Since they can take a 64bit address they |
|
770 |
// don't have the 32 suffix like the other instructions in this class. |
|
771 |
||
772 |
void call_literal(address entry, RelocationHolder const& rspec); |
|
773 |
void jmp_literal(address entry, RelocationHolder const& rspec); |
|
774 |
||
775 |
// Avoid using directly section |
|
776 |
// Instructions in this section are actually usable by anyone without danger |
|
777 |
// of failure but have performance issues that are addressed my enhanced |
|
778 |
// instructions which will do the proper thing base on the particular cpu. |
|
779 |
// We protect them because we don't trust you... |
|
780 |
||
781 |
// Don't use next inc() and dec() methods directly. INC & DEC instructions |
|
782 |
// could cause a partial flag stall since they don't set CF flag. |
|
783 |
// Use MacroAssembler::decrement() & MacroAssembler::increment() methods |
|
784 |
// which call inc() & dec() or add() & sub() in accordance with |
|
785 |
// the product flag UseIncDec value. |
|
786 |
||
787 |
void decl(Register dst); |
|
788 |
void decl(Address dst); |
|
789 |
void decq(Register dst); |
|
790 |
void decq(Address dst); |
|
791 |
||
792 |
void incl(Register dst); |
|
793 |
void incl(Address dst); |
|
794 |
void incq(Register dst); |
|
795 |
void incq(Address dst); |
|
796 |
||
797 |
// New cpus require use of movsd and movss to avoid partial register stall |
|
798 |
// when loading from memory. But for old Opteron use movlpd instead of movsd. |
|
799 |
// The selection is done in MacroAssembler::movdbl() and movflt(). |
|
800 |
||
801 |
// Move Scalar Single-Precision Floating-Point Values |
|
802 |
void movss(XMMRegister dst, Address src); |
|
803 |
void movss(XMMRegister dst, XMMRegister src); |
|
804 |
void movss(Address dst, XMMRegister src); |
|
805 |
||
806 |
// Move Scalar Double-Precision Floating-Point Values |
|
807 |
void movsd(XMMRegister dst, Address src); |
|
808 |
void movsd(XMMRegister dst, XMMRegister src); |
|
809 |
void movsd(Address dst, XMMRegister src); |
|
810 |
void movlpd(XMMRegister dst, Address src); |
|
811 |
||
812 |
// New cpus require use of movaps and movapd to avoid partial register stall |
|
813 |
// when moving between registers. |
|
814 |
void movaps(XMMRegister dst, XMMRegister src); |
|
815 |
void movapd(XMMRegister dst, XMMRegister src); |
|
816 |
||
817 |
// End avoid using directly |
|
818 |
||
819 |
||
820 |
// Instruction prefixes |
|
821 |
void prefix(Prefix p); |
|
822 |
||
1 | 823 |
public: |
824 |
||
825 |
// Creation |
|
826 |
Assembler(CodeBuffer* code) : AbstractAssembler(code) {} |
|
827 |
||
828 |
// Decoding |
|
829 |
static address locate_operand(address inst, WhichOperand which); |
|
830 |
static address locate_next_instruction(address inst); |
|
831 |
||
1066 | 832 |
// Utilities |
8871
5c3b26c4119e
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
8494
diff
changeset
|
833 |
static bool is_polling_page_far() NOT_LP64({ return false;}); |
5c3b26c4119e
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
8494
diff
changeset
|
834 |
|
1066 | 835 |
// Generic instructions |
836 |
// Does 32bit or 64bit as needed for the platform. In some sense these |
|
837 |
// belong in macro assembler but there is no need for both varieties to exist |
|
838 |
||
839 |
void lea(Register dst, Address src); |
|
840 |
||
841 |
void mov(Register dst, Register src); |
|
842 |
||
843 |
void pusha(); |
|
844 |
void popa(); |
|
845 |
||
846 |
void pushf(); |
|
847 |
void popf(); |
|
848 |
||
849 |
void push(int32_t imm32); |
|
850 |
||
851 |
void push(Register src); |
|
852 |
||
853 |
void pop(Register dst); |
|
854 |
||
855 |
// These are dummies to prevent surprise implicit conversions to Register |
|
856 |
void push(void* v); |
|
857 |
void pop(void* v); |
|
858 |
||
859 |
// These do register sized moves/scans |
|
860 |
void rep_mov(); |
|
15114
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14631
diff
changeset
|
861 |
void rep_stos(); |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14631
diff
changeset
|
862 |
void rep_stosb(); |
1066 | 863 |
void repne_scan(); |
864 |
#ifdef _LP64 |
|
865 |
void repne_scanl(); |
|
866 |
#endif |
|
867 |
||
868 |
// Vanilla instructions in lexical order |
|
869 |
||
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7433
diff
changeset
|
870 |
void adcl(Address dst, int32_t imm32); |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7433
diff
changeset
|
871 |
void adcl(Address dst, Register src); |
1066 | 872 |
void adcl(Register dst, int32_t imm32); |
1 | 873 |
void adcl(Register dst, Address src); |
874 |
void adcl(Register dst, Register src); |
|
875 |
||
1066 | 876 |
void adcq(Register dst, int32_t imm32); |
877 |
void adcq(Register dst, Address src); |
|
878 |
void adcq(Register dst, Register src); |
|
879 |
||
880 |
void addl(Address dst, int32_t imm32); |
|
1 | 881 |
void addl(Address dst, Register src); |
1066 | 882 |
void addl(Register dst, int32_t imm32); |
1 | 883 |
void addl(Register dst, Address src); |
884 |
void addl(Register dst, Register src); |
|
885 |
||
1066 | 886 |
void addq(Address dst, int32_t imm32); |
887 |
void addq(Address dst, Register src); |
|
888 |
void addq(Register dst, int32_t imm32); |
|
889 |
void addq(Register dst, Address src); |
|
890 |
void addq(Register dst, Register src); |
|
891 |
||
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
892 |
#ifdef _LP64 |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
893 |
//Add Unsigned Integers with Carry Flag |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
894 |
void adcxq(Register dst, Register src); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
895 |
|
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
896 |
//Add Unsigned Integers with Overflow Flag |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
897 |
void adoxq(Register dst, Register src); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
898 |
#endif |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
899 |
|
1 | 900 |
void addr_nop_4(); |
901 |
void addr_nop_5(); |
|
902 |
void addr_nop_7(); |
|
903 |
void addr_nop_8(); |
|
904 |
||
1066 | 905 |
// Add Scalar Double-Precision Floating-Point Values |
906 |
void addsd(XMMRegister dst, Address src); |
|
907 |
void addsd(XMMRegister dst, XMMRegister src); |
|
908 |
||
909 |
// Add Scalar Single-Precision Floating-Point Values |
|
910 |
void addss(XMMRegister dst, Address src); |
|
911 |
void addss(XMMRegister dst, XMMRegister src); |
|
912 |
||
14132 | 913 |
// AES instructions |
914 |
void aesdec(XMMRegister dst, Address src); |
|
915 |
void aesdec(XMMRegister dst, XMMRegister src); |
|
916 |
void aesdeclast(XMMRegister dst, Address src); |
|
917 |
void aesdeclast(XMMRegister dst, XMMRegister src); |
|
918 |
void aesenc(XMMRegister dst, Address src); |
|
919 |
void aesenc(XMMRegister dst, XMMRegister src); |
|
920 |
void aesenclast(XMMRegister dst, Address src); |
|
921 |
void aesenclast(XMMRegister dst, XMMRegister src); |
|
922 |
||
923 |
||
11427 | 924 |
void andl(Address dst, int32_t imm32); |
1066 | 925 |
void andl(Register dst, int32_t imm32); |
926 |
void andl(Register dst, Address src); |
|
927 |
void andl(Register dst, Register src); |
|
928 |
||
10006 | 929 |
void andq(Address dst, int32_t imm32); |
1066 | 930 |
void andq(Register dst, int32_t imm32); |
931 |
void andq(Register dst, Address src); |
|
932 |
void andq(Register dst, Register src); |
|
933 |
||
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
934 |
// BMI instructions |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
935 |
void andnl(Register dst, Register src1, Register src2); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
936 |
void andnl(Register dst, Register src1, Address src2); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
937 |
void andnq(Register dst, Register src1, Register src2); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
938 |
void andnq(Register dst, Register src1, Address src2); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
939 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
940 |
void blsil(Register dst, Register src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
941 |
void blsil(Register dst, Address src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
942 |
void blsiq(Register dst, Register src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
943 |
void blsiq(Register dst, Address src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
944 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
945 |
void blsmskl(Register dst, Register src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
946 |
void blsmskl(Register dst, Address src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
947 |
void blsmskq(Register dst, Register src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
948 |
void blsmskq(Register dst, Address src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
949 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
950 |
void blsrl(Register dst, Register src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
951 |
void blsrl(Register dst, Address src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
952 |
void blsrq(Register dst, Register src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
953 |
void blsrq(Register dst, Address src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
954 |
|
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
955 |
void bsfl(Register dst, Register src); |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
956 |
void bsrl(Register dst, Register src); |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
957 |
|
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
958 |
#ifdef _LP64 |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
959 |
void bsfq(Register dst, Register src); |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
960 |
void bsrq(Register dst, Register src); |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
961 |
#endif |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
962 |
|
1066 | 963 |
void bswapl(Register reg); |
964 |
||
965 |
void bswapq(Register reg); |
|
966 |
||
1 | 967 |
void call(Label& L, relocInfo::relocType rtype); |
968 |
void call(Register reg); // push pc; pc <- reg |
|
969 |
void call(Address adr); // push pc; pc <- adr |
|
970 |
||
1066 | 971 |
void cdql(); |
972 |
||
973 |
void cdqq(); |
|
974 |
||
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
975 |
void cld(); |
1066 | 976 |
|
977 |
void clflush(Address adr); |
|
978 |
||
979 |
void cmovl(Condition cc, Register dst, Register src); |
|
980 |
void cmovl(Condition cc, Register dst, Address src); |
|
981 |
||
982 |
void cmovq(Condition cc, Register dst, Register src); |
|
983 |
void cmovq(Condition cc, Register dst, Address src); |
|
984 |
||
985 |
||
986 |
void cmpb(Address dst, int imm8); |
|
987 |
||
988 |
void cmpl(Address dst, int32_t imm32); |
|
989 |
||
990 |
void cmpl(Register dst, int32_t imm32); |
|
991 |
void cmpl(Register dst, Register src); |
|
992 |
void cmpl(Register dst, Address src); |
|
993 |
||
994 |
void cmpq(Address dst, int32_t imm32); |
|
995 |
void cmpq(Address dst, Register src); |
|
996 |
||
997 |
void cmpq(Register dst, int32_t imm32); |
|
998 |
void cmpq(Register dst, Register src); |
|
999 |
void cmpq(Register dst, Address src); |
|
1000 |
||
1001 |
// these are dummies used to catch attempting to convert NULL to Register |
|
1002 |
void cmpl(Register dst, void* junk); // dummy |
|
1003 |
void cmpq(Register dst, void* junk); // dummy |
|
1004 |
||
1005 |
void cmpw(Address dst, int imm16); |
|
1006 |
||
1007 |
void cmpxchg8 (Address adr); |
|
1008 |
||
1009 |
void cmpxchgl(Register reg, Address adr); |
|
1010 |
||
1011 |
void cmpxchgq(Register reg, Address adr); |
|
1012 |
||
1013 |
// Ordered Compare Scalar Double-Precision Floating-Point Values and set EFLAGS |
|
1014 |
void comisd(XMMRegister dst, Address src); |
|
11427 | 1015 |
void comisd(XMMRegister dst, XMMRegister src); |
1066 | 1016 |
|
1017 |
// Ordered Compare Scalar Single-Precision Floating-Point Values and set EFLAGS |
|
1018 |
void comiss(XMMRegister dst, Address src); |
|
11427 | 1019 |
void comiss(XMMRegister dst, XMMRegister src); |
1066 | 1020 |
|
1021 |
// Identify processor type and features |
|
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1022 |
void cpuid(); |
1066 | 1023 |
|
1024 |
// Convert Scalar Double-Precision Floating-Point Value to Scalar Single-Precision Floating-Point Value |
|
1025 |
void cvtsd2ss(XMMRegister dst, XMMRegister src); |
|
11427 | 1026 |
void cvtsd2ss(XMMRegister dst, Address src); |
1066 | 1027 |
|
1028 |
// Convert Doubleword Integer to Scalar Double-Precision Floating-Point Value |
|
1029 |
void cvtsi2sdl(XMMRegister dst, Register src); |
|
11427 | 1030 |
void cvtsi2sdl(XMMRegister dst, Address src); |
1066 | 1031 |
void cvtsi2sdq(XMMRegister dst, Register src); |
11427 | 1032 |
void cvtsi2sdq(XMMRegister dst, Address src); |
1066 | 1033 |
|
1034 |
// Convert Doubleword Integer to Scalar Single-Precision Floating-Point Value |
|
1035 |
void cvtsi2ssl(XMMRegister dst, Register src); |
|
11427 | 1036 |
void cvtsi2ssl(XMMRegister dst, Address src); |
1066 | 1037 |
void cvtsi2ssq(XMMRegister dst, Register src); |
11427 | 1038 |
void cvtsi2ssq(XMMRegister dst, Address src); |
1066 | 1039 |
|
1040 |
// Convert Packed Signed Doubleword Integers to Packed Double-Precision Floating-Point Value |
|
1041 |
void cvtdq2pd(XMMRegister dst, XMMRegister src); |
|
1042 |
||
1043 |
// Convert Packed Signed Doubleword Integers to Packed Single-Precision Floating-Point Value |
|
1044 |
void cvtdq2ps(XMMRegister dst, XMMRegister src); |
|
1045 |
||
1046 |
// Convert Scalar Single-Precision Floating-Point Value to Scalar Double-Precision Floating-Point Value |
|
1047 |
void cvtss2sd(XMMRegister dst, XMMRegister src); |
|
11427 | 1048 |
void cvtss2sd(XMMRegister dst, Address src); |
1066 | 1049 |
|
1050 |
// Convert with Truncation Scalar Double-Precision Floating-Point Value to Doubleword Integer |
|
1051 |
void cvttsd2sil(Register dst, Address src); |
|
1052 |
void cvttsd2sil(Register dst, XMMRegister src); |
|
1053 |
void cvttsd2siq(Register dst, XMMRegister src); |
|
1054 |
||
1055 |
// Convert with Truncation Scalar Single-Precision Floating-Point Value to Doubleword Integer |
|
1056 |
void cvttss2sil(Register dst, XMMRegister src); |
|
1057 |
void cvttss2siq(Register dst, XMMRegister src); |
|
1058 |
||
1059 |
// Divide Scalar Double-Precision Floating-Point Values |
|
1060 |
void divsd(XMMRegister dst, Address src); |
|
1061 |
void divsd(XMMRegister dst, XMMRegister src); |
|
1062 |
||
1063 |
// Divide Scalar Single-Precision Floating-Point Values |
|
1064 |
void divss(XMMRegister dst, Address src); |
|
1065 |
void divss(XMMRegister dst, XMMRegister src); |
|
1066 |
||
1067 |
void emms(); |
|
1068 |
||
1069 |
void fabs(); |
|
1070 |
||
1071 |
void fadd(int i); |
|
1072 |
||
1073 |
void fadd_d(Address src); |
|
1074 |
void fadd_s(Address src); |
|
1075 |
||
1076 |
// "Alternate" versions of x87 instructions place result down in FPU |
|
1077 |
// stack instead of on TOS |
|
1078 |
||
1079 |
void fadda(int i); // "alternate" fadd |
|
1080 |
void faddp(int i = 1); |
|
1081 |
||
1082 |
void fchs(); |
|
1083 |
||
1084 |
void fcom(int i); |
|
1085 |
||
1086 |
void fcomp(int i = 1); |
|
1087 |
void fcomp_d(Address src); |
|
1088 |
void fcomp_s(Address src); |
|
1089 |
||
1090 |
void fcompp(); |
|
1091 |
||
1092 |
void fcos(); |
|
1093 |
||
1094 |
void fdecstp(); |
|
1095 |
||
1096 |
void fdiv(int i); |
|
1097 |
void fdiv_d(Address src); |
|
1098 |
void fdivr_s(Address src); |
|
1099 |
void fdiva(int i); // "alternate" fdiv |
|
1100 |
void fdivp(int i = 1); |
|
1101 |
||
1102 |
void fdivr(int i); |
|
1103 |
void fdivr_d(Address src); |
|
1104 |
void fdiv_s(Address src); |
|
1105 |
||
1106 |
void fdivra(int i); // "alternate" reversed fdiv |
|
1107 |
||
1108 |
void fdivrp(int i = 1); |
|
1109 |
||
1110 |
void ffree(int i = 0); |
|
1111 |
||
1112 |
void fild_d(Address adr); |
|
1113 |
void fild_s(Address adr); |
|
1114 |
||
1115 |
void fincstp(); |
|
1116 |
||
1117 |
void finit(); |
|
1118 |
||
1119 |
void fist_s (Address adr); |
|
1120 |
void fistp_d(Address adr); |
|
1121 |
void fistp_s(Address adr); |
|
1122 |
||
1123 |
void fld1(); |
|
1124 |
||
1125 |
void fld_d(Address adr); |
|
1126 |
void fld_s(Address adr); |
|
1127 |
void fld_s(int index); |
|
1128 |
void fld_x(Address adr); // extended-precision (80-bit) format |
|
1129 |
||
1130 |
void fldcw(Address src); |
|
1131 |
||
1132 |
void fldenv(Address src); |
|
1133 |
||
1134 |
void fldlg2(); |
|
1135 |
||
1136 |
void fldln2(); |
|
1137 |
||
1138 |
void fldz(); |
|
1139 |
||
1140 |
void flog(); |
|
1141 |
void flog10(); |
|
1142 |
||
1143 |
void fmul(int i); |
|
1144 |
||
1145 |
void fmul_d(Address src); |
|
1146 |
void fmul_s(Address src); |
|
1147 |
||
1148 |
void fmula(int i); // "alternate" fmul |
|
1149 |
||
1150 |
void fmulp(int i = 1); |
|
1151 |
||
1152 |
void fnsave(Address dst); |
|
1153 |
||
1154 |
void fnstcw(Address src); |
|
1155 |
||
1156 |
void fnstsw_ax(); |
|
1157 |
||
1158 |
void fprem(); |
|
1159 |
void fprem1(); |
|
1160 |
||
1161 |
void frstor(Address src); |
|
1162 |
||
1163 |
void fsin(); |
|
1164 |
||
1165 |
void fsqrt(); |
|
1166 |
||
1167 |
void fst_d(Address adr); |
|
1168 |
void fst_s(Address adr); |
|
1169 |
||
1170 |
void fstp_d(Address adr); |
|
1171 |
void fstp_d(int index); |
|
1172 |
void fstp_s(Address adr); |
|
1173 |
void fstp_x(Address adr); // extended-precision (80-bit) format |
|
1174 |
||
1175 |
void fsub(int i); |
|
1176 |
void fsub_d(Address src); |
|
1177 |
void fsub_s(Address src); |
|
1178 |
||
1179 |
void fsuba(int i); // "alternate" fsub |
|
1180 |
||
1181 |
void fsubp(int i = 1); |
|
1182 |
||
1183 |
void fsubr(int i); |
|
1184 |
void fsubr_d(Address src); |
|
1185 |
void fsubr_s(Address src); |
|
1186 |
||
1187 |
void fsubra(int i); // "alternate" reversed fsub |
|
1188 |
||
1189 |
void fsubrp(int i = 1); |
|
1190 |
||
1191 |
void ftan(); |
|
1192 |
||
1193 |
void ftst(); |
|
1194 |
||
1195 |
void fucomi(int i = 1); |
|
1196 |
void fucomip(int i = 1); |
|
1197 |
||
1198 |
void fwait(); |
|
1199 |
||
1200 |
void fxch(int i = 1); |
|
1201 |
||
1202 |
void fxrstor(Address src); |
|
1203 |
||
1204 |
void fxsave(Address dst); |
|
1205 |
||
1206 |
void fyl2x(); |
|
12739
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
11791
diff
changeset
|
1207 |
void frndint(); |
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
11791
diff
changeset
|
1208 |
void f2xm1(); |
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
11791
diff
changeset
|
1209 |
void fldl2e(); |
1066 | 1210 |
|
1211 |
void hlt(); |
|
1212 |
||
1213 |
void idivl(Register src); |
|
7121 | 1214 |
void divl(Register src); // Unsigned division |
1066 | 1215 |
|
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
1216 |
#ifdef _LP64 |
1066 | 1217 |
void idivq(Register src); |
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
1218 |
#endif |
1066 | 1219 |
|
1220 |
void imull(Register dst, Register src); |
|
1221 |
void imull(Register dst, Register src, int value); |
|
21105
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
18507
diff
changeset
|
1222 |
void imull(Register dst, Address src); |
1066 | 1223 |
|
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
1224 |
#ifdef _LP64 |
1066 | 1225 |
void imulq(Register dst, Register src); |
1226 |
void imulq(Register dst, Register src, int value); |
|
21105
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
18507
diff
changeset
|
1227 |
void imulq(Register dst, Address src); |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
18507
diff
changeset
|
1228 |
#endif |
1066 | 1229 |
|
1 | 1230 |
// jcc is the generic conditional branch generator to run- |
1231 |
// time routines, jcc is used for branches to labels. jcc |
|
1232 |
// takes a branch opcode (cc) and a label (L) and generates |
|
1233 |
// either a backward branch or a forward branch and links it |
|
1234 |
// to the label fixup chain. Usage: |
|
1235 |
// |
|
1236 |
// Label L; // unbound label |
|
1237 |
// jcc(cc, L); // forward branch to unbound label |
|
1238 |
// bind(L); // bind label to the current pc |
|
1239 |
// jcc(cc, L); // backward branch to bound label |
|
1240 |
// bind(L); // illegal: a label may be bound only once |
|
1241 |
// |
|
1242 |
// Note: The same Label can be used for forward and backward branches |
|
1243 |
// but it may be bound only once. |
|
1244 |
||
10264 | 1245 |
void jcc(Condition cc, Label& L, bool maybe_short = true); |
1 | 1246 |
|
1247 |
// Conditional jump to a 8-bit offset to L. |
|
1248 |
// WARNING: be very careful using this for forward jumps. If the label is |
|
1249 |
// not bound within an 8-bit offset of this instruction, a run-time error |
|
1250 |
// will occur. |
|
1251 |
void jccb(Condition cc, Label& L); |
|
1252 |
||
1066 | 1253 |
void jmp(Address entry); // pc <- entry |
1254 |
||
1255 |
// Label operations & relative jumps (PPUM Appendix D) |
|
10264 | 1256 |
void jmp(Label& L, bool maybe_short = true); // unconditional jump to L |
1066 | 1257 |
|
1258 |
void jmp(Register entry); // pc <- entry |
|
1259 |
||
1260 |
// Unconditional 8-bit offset jump to L. |
|
1261 |
// WARNING: be very careful using this for forward jumps. If the label is |
|
1262 |
// not bound within an 8-bit offset of this instruction, a run-time error |
|
1263 |
// will occur. |
|
1264 |
void jmpb(Label& L); |
|
1265 |
||
1266 |
void ldmxcsr( Address src ); |
|
1267 |
||
1268 |
void leal(Register dst, Address src); |
|
1269 |
||
1270 |
void leaq(Register dst, Address src); |
|
1271 |
||
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1272 |
void lfence(); |
1066 | 1273 |
|
1274 |
void lock(); |
|
1275 |
||
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1276 |
void lzcntl(Register dst, Register src); |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1277 |
|
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1278 |
#ifdef _LP64 |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1279 |
void lzcntq(Register dst, Register src); |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1280 |
#endif |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1281 |
|
1066 | 1282 |
enum Membar_mask_bits { |
1283 |
StoreStore = 1 << 3, |
|
1284 |
LoadStore = 1 << 2, |
|
1285 |
StoreLoad = 1 << 1, |
|
1286 |
LoadLoad = 1 << 0 |
|
1287 |
}; |
|
1288 |
||
2338
a8660a1b709b
6822204: volatile fences should prefer lock:addl to actual mfence instructions
never
parents:
2332
diff
changeset
|
1289 |
// Serializes memory and blows flags |
1066 | 1290 |
void membar(Membar_mask_bits order_constraint) { |
2338
a8660a1b709b
6822204: volatile fences should prefer lock:addl to actual mfence instructions
never
parents:
2332
diff
changeset
|
1291 |
if (os::is_MP()) { |
a8660a1b709b
6822204: volatile fences should prefer lock:addl to actual mfence instructions
never
parents:
2332
diff
changeset
|
1292 |
// We only have to handle StoreLoad |
a8660a1b709b
6822204: volatile fences should prefer lock:addl to actual mfence instructions
never
parents:
2332
diff
changeset
|
1293 |
if (order_constraint & StoreLoad) { |
a8660a1b709b
6822204: volatile fences should prefer lock:addl to actual mfence instructions
never
parents:
2332
diff
changeset
|
1294 |
// All usable chips support "locked" instructions which suffice |
a8660a1b709b
6822204: volatile fences should prefer lock:addl to actual mfence instructions
never
parents:
2332
diff
changeset
|
1295 |
// as barriers, and are much faster than the alternative of |
26576
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1296 |
// using cpuid instruction. We use here a locked add [esp-C],0. |
2338
a8660a1b709b
6822204: volatile fences should prefer lock:addl to actual mfence instructions
never
parents:
2332
diff
changeset
|
1297 |
// This is conveniently otherwise a no-op except for blowing |
26576
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1298 |
// flags, and introducing a false dependency on target memory |
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1299 |
// location. We can't do anything with flags, but we can avoid |
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1300 |
// memory dependencies in the current method by locked-adding |
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1301 |
// somewhere else on the stack. Doing [esp+C] will collide with |
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1302 |
// something on stack in current method, hence we go for [esp-C]. |
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1303 |
// It is convenient since it is almost always in data cache, for |
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1304 |
// any small C. We need to step back from SP to avoid data |
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1305 |
// dependencies with other things on below SP (callee-saves, for |
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1306 |
// example). Without a clear way to figure out the minimal safe |
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1307 |
// distance from SP, it makes sense to step back the complete |
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1308 |
// cache line, as this will also avoid possible second-order effects |
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1309 |
// with locked ops against the cache line. Our choice of offset |
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1310 |
// is bounded by x86 operand encoding, which should stay within |
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1311 |
// [-128; +127] to have the 8-byte displacement encoding. |
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1312 |
// |
2338
a8660a1b709b
6822204: volatile fences should prefer lock:addl to actual mfence instructions
never
parents:
2332
diff
changeset
|
1313 |
// Any change to this code may need to revisit other places in |
a8660a1b709b
6822204: volatile fences should prefer lock:addl to actual mfence instructions
never
parents:
2332
diff
changeset
|
1314 |
// the code where this idiom is used, in particular the |
a8660a1b709b
6822204: volatile fences should prefer lock:addl to actual mfence instructions
never
parents:
2332
diff
changeset
|
1315 |
// orderAccess code. |
26576
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1316 |
|
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1317 |
int offset = -VM_Version::L1_line_size(); |
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1318 |
if (offset < -128) { |
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1319 |
offset = -128; |
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1320 |
} |
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1321 |
|
2338
a8660a1b709b
6822204: volatile fences should prefer lock:addl to actual mfence instructions
never
parents:
2332
diff
changeset
|
1322 |
lock(); |
26576
a9429d24d429
8050147: StoreLoad barrier interferes with stack usages
shade
parents:
26434
diff
changeset
|
1323 |
addl(Address(rsp, offset), 0);// Assert the lock# signal here |
2338
a8660a1b709b
6822204: volatile fences should prefer lock:addl to actual mfence instructions
never
parents:
2332
diff
changeset
|
1324 |
} |
a8660a1b709b
6822204: volatile fences should prefer lock:addl to actual mfence instructions
never
parents:
2332
diff
changeset
|
1325 |
} |
1066 | 1326 |
} |
1327 |
||
1328 |
void mfence(); |
|
1329 |
||
1330 |
// Moves |
|
1331 |
||
1332 |
void mov64(Register dst, int64_t imm64); |
|
1333 |
||
1334 |
void movb(Address dst, Register src); |
|
1335 |
void movb(Address dst, int imm8); |
|
1336 |
void movb(Register dst, Address src); |
|
1337 |
||
1338 |
void movdl(XMMRegister dst, Register src); |
|
1339 |
void movdl(Register dst, XMMRegister src); |
|
8494
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
1340 |
void movdl(XMMRegister dst, Address src); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1341 |
void movdl(Address dst, XMMRegister src); |
1066 | 1342 |
|
1343 |
// Move Double Quadword |
|
1344 |
void movdq(XMMRegister dst, Register src); |
|
1345 |
void movdq(Register dst, XMMRegister src); |
|
1346 |
||
1347 |
// Move Aligned Double Quadword |
|
1348 |
void movdqa(XMMRegister dst, XMMRegister src); |
|
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15436
diff
changeset
|
1349 |
void movdqa(XMMRegister dst, Address src); |
1066 | 1350 |
|
1437 | 1351 |
// Move Unaligned Double Quadword |
1352 |
void movdqu(Address dst, XMMRegister src); |
|
1353 |
void movdqu(XMMRegister dst, Address src); |
|
1354 |
void movdqu(XMMRegister dst, XMMRegister src); |
|
1355 |
||
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1356 |
// Move Unaligned 256bit Vector |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1357 |
void vmovdqu(Address dst, XMMRegister src); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1358 |
void vmovdqu(XMMRegister dst, Address src); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1359 |
void vmovdqu(XMMRegister dst, XMMRegister src); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1360 |
|
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1361 |
// Move lower 64bit to high 64bit in 128bit register |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1362 |
void movlhps(XMMRegister dst, XMMRegister src); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1363 |
|
1066 | 1364 |
void movl(Register dst, int32_t imm32); |
1365 |
void movl(Address dst, int32_t imm32); |
|
1366 |
void movl(Register dst, Register src); |
|
1367 |
void movl(Register dst, Address src); |
|
1368 |
void movl(Address dst, Register src); |
|
1369 |
||
1370 |
// These dummies prevent using movl from converting a zero (like NULL) into Register |
|
1371 |
// by giving the compiler two choices it can't resolve |
|
1372 |
||
1373 |
void movl(Address dst, void* junk); |
|
1374 |
void movl(Register dst, void* junk); |
|
1375 |
||
1376 |
#ifdef _LP64 |
|
1377 |
void movq(Register dst, Register src); |
|
1378 |
void movq(Register dst, Address src); |
|
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7433
diff
changeset
|
1379 |
void movq(Address dst, Register src); |
1066 | 1380 |
#endif |
1381 |
||
1382 |
void movq(Address dst, MMXRegister src ); |
|
1383 |
void movq(MMXRegister dst, Address src ); |
|
1384 |
||
1385 |
#ifdef _LP64 |
|
1386 |
// These dummies prevent using movq from converting a zero (like NULL) into Register |
|
1387 |
// by giving the compiler two choices it can't resolve |
|
1388 |
||
1389 |
void movq(Address dst, void* dummy); |
|
1390 |
void movq(Register dst, void* dummy); |
|
1391 |
#endif |
|
1392 |
||
1393 |
// Move Quadword |
|
1394 |
void movq(Address dst, XMMRegister src); |
|
1395 |
void movq(XMMRegister dst, Address src); |
|
1396 |
||
1397 |
void movsbl(Register dst, Address src); |
|
1398 |
void movsbl(Register dst, Register src); |
|
1399 |
||
1400 |
#ifdef _LP64 |
|
2150 | 1401 |
void movsbq(Register dst, Address src); |
1402 |
void movsbq(Register dst, Register src); |
|
1403 |
||
1066 | 1404 |
// Move signed 32bit immediate to 64bit extending sign |
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7433
diff
changeset
|
1405 |
void movslq(Address dst, int32_t imm64); |
1066 | 1406 |
void movslq(Register dst, int32_t imm64); |
1407 |
||
1408 |
void movslq(Register dst, Address src); |
|
1409 |
void movslq(Register dst, Register src); |
|
1410 |
void movslq(Register dst, void* src); // Dummy declaration to cause NULL to be ambiguous |
|
1411 |
#endif |
|
1412 |
||
1413 |
void movswl(Register dst, Address src); |
|
1414 |
void movswl(Register dst, Register src); |
|
1415 |
||
2150 | 1416 |
#ifdef _LP64 |
1417 |
void movswq(Register dst, Address src); |
|
1418 |
void movswq(Register dst, Register src); |
|
1419 |
#endif |
|
1420 |
||
1066 | 1421 |
void movw(Address dst, int imm16); |
1422 |
void movw(Register dst, Address src); |
|
1423 |
void movw(Address dst, Register src); |
|
1424 |
||
1425 |
void movzbl(Register dst, Address src); |
|
1426 |
void movzbl(Register dst, Register src); |
|
1427 |
||
2150 | 1428 |
#ifdef _LP64 |
1429 |
void movzbq(Register dst, Address src); |
|
1430 |
void movzbq(Register dst, Register src); |
|
1431 |
#endif |
|
1432 |
||
1066 | 1433 |
void movzwl(Register dst, Address src); |
1434 |
void movzwl(Register dst, Register src); |
|
1435 |
||
2150 | 1436 |
#ifdef _LP64 |
1437 |
void movzwq(Register dst, Address src); |
|
1438 |
void movzwq(Register dst, Register src); |
|
1439 |
#endif |
|
1440 |
||
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
1441 |
// Unsigned multiply with RAX destination register |
1066 | 1442 |
void mull(Address src); |
1443 |
void mull(Register src); |
|
1444 |
||
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
1445 |
#ifdef _LP64 |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
1446 |
void mulq(Address src); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
1447 |
void mulq(Register src); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
1448 |
void mulxq(Register dst1, Register dst2, Register src); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
1449 |
#endif |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
1450 |
|
1066 | 1451 |
// Multiply Scalar Double-Precision Floating-Point Values |
1452 |
void mulsd(XMMRegister dst, Address src); |
|
1453 |
void mulsd(XMMRegister dst, XMMRegister src); |
|
1454 |
||
1455 |
// Multiply Scalar Single-Precision Floating-Point Values |
|
1456 |
void mulss(XMMRegister dst, Address src); |
|
1457 |
void mulss(XMMRegister dst, XMMRegister src); |
|
1458 |
||
1459 |
void negl(Register dst); |
|
1460 |
||
1461 |
#ifdef _LP64 |
|
1462 |
void negq(Register dst); |
|
1463 |
#endif |
|
1464 |
||
1465 |
void nop(int i = 1); |
|
1466 |
||
1467 |
void notl(Register dst); |
|
1468 |
||
1469 |
#ifdef _LP64 |
|
1470 |
void notq(Register dst); |
|
1471 |
#endif |
|
1472 |
||
1473 |
void orl(Address dst, int32_t imm32); |
|
1474 |
void orl(Register dst, int32_t imm32); |
|
1475 |
void orl(Register dst, Address src); |
|
1476 |
void orl(Register dst, Register src); |
|
1477 |
||
1478 |
void orq(Address dst, int32_t imm32); |
|
1479 |
void orq(Register dst, int32_t imm32); |
|
1480 |
void orq(Register dst, Address src); |
|
1481 |
void orq(Register dst, Register src); |
|
1482 |
||
11427 | 1483 |
// Pack with unsigned saturation |
1484 |
void packuswb(XMMRegister dst, XMMRegister src); |
|
1485 |
void packuswb(XMMRegister dst, Address src); |
|
15242
695bb216be99
6896617: Optimize sun.nio.cs.ISO_8859_1$Encode.encodeArrayLoop() on x86
kvn
parents:
15117
diff
changeset
|
1486 |
void vpackuswb(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
695bb216be99
6896617: Optimize sun.nio.cs.ISO_8859_1$Encode.encodeArrayLoop() on x86
kvn
parents:
15117
diff
changeset
|
1487 |
|
695bb216be99
6896617: Optimize sun.nio.cs.ISO_8859_1$Encode.encodeArrayLoop() on x86
kvn
parents:
15117
diff
changeset
|
1488 |
// Pemutation of 64bit words |
695bb216be99
6896617: Optimize sun.nio.cs.ISO_8859_1$Encode.encodeArrayLoop() on x86
kvn
parents:
15117
diff
changeset
|
1489 |
void vpermq(XMMRegister dst, XMMRegister src, int imm8, bool vector256); |
11427 | 1490 |
|
23491 | 1491 |
void pause(); |
1492 |
||
2348 | 1493 |
// SSE4.2 string instructions |
1494 |
void pcmpestri(XMMRegister xmm1, XMMRegister xmm2, int imm8); |
|
1495 |
void pcmpestri(XMMRegister xmm1, Address src, int imm8); |
|
1496 |
||
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15436
diff
changeset
|
1497 |
// SSE 4.1 extract |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15436
diff
changeset
|
1498 |
void pextrd(Register dst, XMMRegister src, int imm8); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15436
diff
changeset
|
1499 |
void pextrq(Register dst, XMMRegister src, int imm8); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15436
diff
changeset
|
1500 |
|
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15436
diff
changeset
|
1501 |
// SSE 4.1 insert |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15436
diff
changeset
|
1502 |
void pinsrd(XMMRegister dst, Register src, int imm8); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15436
diff
changeset
|
1503 |
void pinsrq(XMMRegister dst, Register src, int imm8); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15436
diff
changeset
|
1504 |
|
11427 | 1505 |
// SSE4.1 packed move |
1506 |
void pmovzxbw(XMMRegister dst, XMMRegister src); |
|
1507 |
void pmovzxbw(XMMRegister dst, Address src); |
|
1508 |
||
4430 | 1509 |
#ifndef _LP64 // no 32bit push/pop on amd64 |
1066 | 1510 |
void popl(Address dst); |
4430 | 1511 |
#endif |
1066 | 1512 |
|
1513 |
#ifdef _LP64 |
|
1514 |
void popq(Address dst); |
|
1515 |
#endif |
|
1516 |
||
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
1517 |
void popcntl(Register dst, Address src); |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
1518 |
void popcntl(Register dst, Register src); |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
1519 |
|
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
1520 |
#ifdef _LP64 |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
1521 |
void popcntq(Register dst, Address src); |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
1522 |
void popcntq(Register dst, Register src); |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
1523 |
#endif |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
1524 |
|
1066 | 1525 |
// Prefetches (SSE, SSE2, 3DNOW only) |
1526 |
||
1527 |
void prefetchnta(Address src); |
|
1528 |
void prefetchr(Address src); |
|
1529 |
void prefetcht0(Address src); |
|
1530 |
void prefetcht1(Address src); |
|
1531 |
void prefetcht2(Address src); |
|
1532 |
void prefetchw(Address src); |
|
1533 |
||
14132 | 1534 |
// Shuffle Bytes |
1535 |
void pshufb(XMMRegister dst, XMMRegister src); |
|
1536 |
void pshufb(XMMRegister dst, Address src); |
|
1537 |
||
1066 | 1538 |
// Shuffle Packed Doublewords |
1539 |
void pshufd(XMMRegister dst, XMMRegister src, int mode); |
|
1540 |
void pshufd(XMMRegister dst, Address src, int mode); |
|
1541 |
||
1542 |
// Shuffle Packed Low Words |
|
1543 |
void pshuflw(XMMRegister dst, XMMRegister src, int mode); |
|
1544 |
void pshuflw(XMMRegister dst, Address src, int mode); |
|
1545 |
||
8494
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
1546 |
// Shift Right by bytes Logical DoubleQuadword Immediate |
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
1547 |
void psrldq(XMMRegister dst, int shift); |
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
1548 |
|
15117
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15115
diff
changeset
|
1549 |
// Logical Compare 128bit |
2348 | 1550 |
void ptest(XMMRegister dst, XMMRegister src); |
1551 |
void ptest(XMMRegister dst, Address src); |
|
15117
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15115
diff
changeset
|
1552 |
// Logical Compare 256bit |
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15115
diff
changeset
|
1553 |
void vptest(XMMRegister dst, XMMRegister src); |
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15115
diff
changeset
|
1554 |
void vptest(XMMRegister dst, Address src); |
2348 | 1555 |
|
1066 | 1556 |
// Interleave Low Bytes |
1557 |
void punpcklbw(XMMRegister dst, XMMRegister src); |
|
11427 | 1558 |
void punpcklbw(XMMRegister dst, Address src); |
1559 |
||
1560 |
// Interleave Low Doublewords |
|
1561 |
void punpckldq(XMMRegister dst, XMMRegister src); |
|
1562 |
void punpckldq(XMMRegister dst, Address src); |
|
1066 | 1563 |
|
13294 | 1564 |
// Interleave Low Quadwords |
1565 |
void punpcklqdq(XMMRegister dst, XMMRegister src); |
|
1566 |
||
4430 | 1567 |
#ifndef _LP64 // no 32bit push/pop on amd64 |
1066 | 1568 |
void pushl(Address src); |
4430 | 1569 |
#endif |
1066 | 1570 |
|
1571 |
void pushq(Address src); |
|
1572 |
||
1573 |
void rcll(Register dst, int imm8); |
|
1574 |
||
1575 |
void rclq(Register dst, int imm8); |
|
1576 |
||
23491 | 1577 |
void rdtsc(); |
1578 |
||
1066 | 1579 |
void ret(int imm16); |
1 | 1580 |
|
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
1581 |
#ifdef _LP64 |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
1582 |
void rorq(Register dst, int imm8); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
1583 |
void rorxq(Register dst, Register src, int imm8); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
1584 |
#endif |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
1585 |
|
1 | 1586 |
void sahf(); |
1587 |
||
1066 | 1588 |
void sarl(Register dst, int imm8); |
1589 |
void sarl(Register dst); |
|
1590 |
||
1591 |
void sarq(Register dst, int imm8); |
|
1592 |
void sarq(Register dst); |
|
1593 |
||
1594 |
void sbbl(Address dst, int32_t imm32); |
|
1595 |
void sbbl(Register dst, int32_t imm32); |
|
1596 |
void sbbl(Register dst, Address src); |
|
1597 |
void sbbl(Register dst, Register src); |
|
1598 |
||
1599 |
void sbbq(Address dst, int32_t imm32); |
|
1600 |
void sbbq(Register dst, int32_t imm32); |
|
1601 |
void sbbq(Register dst, Address src); |
|
1602 |
void sbbq(Register dst, Register src); |
|
1603 |
||
1604 |
void setb(Condition cc, Register dst); |
|
1605 |
||
1606 |
void shldl(Register dst, Register src); |
|
1607 |
||
1608 |
void shll(Register dst, int imm8); |
|
1609 |
void shll(Register dst); |
|
1610 |
||
1611 |
void shlq(Register dst, int imm8); |
|
1612 |
void shlq(Register dst); |
|
1613 |
||
1614 |
void shrdl(Register dst, Register src); |
|
1615 |
||
1616 |
void shrl(Register dst, int imm8); |
|
1617 |
void shrl(Register dst); |
|
1618 |
||
1619 |
void shrq(Register dst, int imm8); |
|
1620 |
void shrq(Register dst); |
|
1621 |
||
1622 |
void smovl(); // QQQ generic? |
|
1623 |
||
1624 |
// Compute Square Root of Scalar Double-Precision Floating-Point Value |
|
1625 |
void sqrtsd(XMMRegister dst, Address src); |
|
1626 |
void sqrtsd(XMMRegister dst, XMMRegister src); |
|
1627 |
||
7433 | 1628 |
// Compute Square Root of Scalar Single-Precision Floating-Point Value |
1629 |
void sqrtss(XMMRegister dst, Address src); |
|
1630 |
void sqrtss(XMMRegister dst, XMMRegister src); |
|
1631 |
||
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1632 |
void std(); |
1066 | 1633 |
|
1634 |
void stmxcsr( Address dst ); |
|
1635 |
||
1636 |
void subl(Address dst, int32_t imm32); |
|
1637 |
void subl(Address dst, Register src); |
|
1638 |
void subl(Register dst, int32_t imm32); |
|
1639 |
void subl(Register dst, Address src); |
|
1640 |
void subl(Register dst, Register src); |
|
1641 |
||
1642 |
void subq(Address dst, int32_t imm32); |
|
1643 |
void subq(Address dst, Register src); |
|
1644 |
void subq(Register dst, int32_t imm32); |
|
1645 |
void subq(Register dst, Address src); |
|
1646 |
void subq(Register dst, Register src); |
|
1647 |
||
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11429
diff
changeset
|
1648 |
// Force generation of a 4 byte immediate value even if it fits into 8bit |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11429
diff
changeset
|
1649 |
void subl_imm32(Register dst, int32_t imm32); |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11429
diff
changeset
|
1650 |
void subq_imm32(Register dst, int32_t imm32); |
1066 | 1651 |
|
1652 |
// Subtract Scalar Double-Precision Floating-Point Values |
|
1653 |
void subsd(XMMRegister dst, Address src); |
|
1 | 1654 |
void subsd(XMMRegister dst, XMMRegister src); |
1655 |
||
1066 | 1656 |
// Subtract Scalar Single-Precision Floating-Point Values |
1657 |
void subss(XMMRegister dst, Address src); |
|
1658 |
void subss(XMMRegister dst, XMMRegister src); |
|
1659 |
||
1660 |
void testb(Register dst, int imm8); |
|
1661 |
||
1662 |
void testl(Register dst, int32_t imm32); |
|
1663 |
void testl(Register dst, Register src); |
|
1664 |
void testl(Register dst, Address src); |
|
1665 |
||
1666 |
void testq(Register dst, int32_t imm32); |
|
1667 |
void testq(Register dst, Register src); |
|
1668 |
||
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1669 |
// BMI - count trailing zeros |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1670 |
void tzcntl(Register dst, Register src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1671 |
void tzcntq(Register dst, Register src); |
1066 | 1672 |
|
1673 |
// Unordered Compare Scalar Double-Precision Floating-Point Values and set EFLAGS |
|
1674 |
void ucomisd(XMMRegister dst, Address src); |
|
1 | 1675 |
void ucomisd(XMMRegister dst, XMMRegister src); |
1676 |
||
1066 | 1677 |
// Unordered Compare Scalar Single-Precision Floating-Point Values and set EFLAGS |
1678 |
void ucomiss(XMMRegister dst, Address src); |
|
1679 |
void ucomiss(XMMRegister dst, XMMRegister src); |
|
1680 |
||
23491 | 1681 |
void xabort(int8_t imm8); |
1682 |
||
1066 | 1683 |
void xaddl(Address dst, Register src); |
1684 |
||
1685 |
void xaddq(Address dst, Register src); |
|
1686 |
||
23491 | 1687 |
void xbegin(Label& abort, relocInfo::relocType rtype = relocInfo::none); |
1688 |
||
1066 | 1689 |
void xchgl(Register reg, Address adr); |
1690 |
void xchgl(Register dst, Register src); |
|
1691 |
||
1692 |
void xchgq(Register reg, Address adr); |
|
1693 |
void xchgq(Register dst, Register src); |
|
1694 |
||
23491 | 1695 |
void xend(); |
1696 |
||
11427 | 1697 |
// Get Value of Extended Control Register |
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1698 |
void xgetbv(); |
11427 | 1699 |
|
1066 | 1700 |
void xorl(Register dst, int32_t imm32); |
1701 |
void xorl(Register dst, Address src); |
|
1702 |
void xorl(Register dst, Register src); |
|
1703 |
||
1704 |
void xorq(Register dst, Address src); |
|
1705 |
void xorq(Register dst, Register src); |
|
1706 |
||
1707 |
void set_byte_if_not_zero(Register dst); // sets reg to 1 if not zero, otherwise 0 |
|
11427 | 1708 |
|
13294 | 1709 |
// AVX 3-operands scalar instructions (encoded with VEX prefix) |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1710 |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
1711 |
void vaddsd(XMMRegister dst, XMMRegister nds, Address src); |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
1712 |
void vaddsd(XMMRegister dst, XMMRegister nds, XMMRegister src); |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
1713 |
void vaddss(XMMRegister dst, XMMRegister nds, Address src); |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
1714 |
void vaddss(XMMRegister dst, XMMRegister nds, XMMRegister src); |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
1715 |
void vdivsd(XMMRegister dst, XMMRegister nds, Address src); |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
1716 |
void vdivsd(XMMRegister dst, XMMRegister nds, XMMRegister src); |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
1717 |
void vdivss(XMMRegister dst, XMMRegister nds, Address src); |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
1718 |
void vdivss(XMMRegister dst, XMMRegister nds, XMMRegister src); |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
1719 |
void vmulsd(XMMRegister dst, XMMRegister nds, Address src); |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
1720 |
void vmulsd(XMMRegister dst, XMMRegister nds, XMMRegister src); |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
1721 |
void vmulss(XMMRegister dst, XMMRegister nds, Address src); |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
1722 |
void vmulss(XMMRegister dst, XMMRegister nds, XMMRegister src); |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
1723 |
void vsubsd(XMMRegister dst, XMMRegister nds, Address src); |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
1724 |
void vsubsd(XMMRegister dst, XMMRegister nds, XMMRegister src); |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
1725 |
void vsubss(XMMRegister dst, XMMRegister nds, Address src); |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
1726 |
void vsubss(XMMRegister dst, XMMRegister nds, XMMRegister src); |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
1727 |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1728 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1729 |
//====================VECTOR ARITHMETIC===================================== |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1730 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1731 |
// Add Packed Floating-Point Values |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1732 |
void addpd(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1733 |
void addps(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1734 |
void vaddpd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1735 |
void vaddps(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1736 |
void vaddpd(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1737 |
void vaddps(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1738 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1739 |
// Subtract Packed Floating-Point Values |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1740 |
void subpd(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1741 |
void subps(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1742 |
void vsubpd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1743 |
void vsubps(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1744 |
void vsubpd(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1745 |
void vsubps(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1746 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1747 |
// Multiply Packed Floating-Point Values |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1748 |
void mulpd(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1749 |
void mulps(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1750 |
void vmulpd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1751 |
void vmulps(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1752 |
void vmulpd(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1753 |
void vmulps(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1754 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1755 |
// Divide Packed Floating-Point Values |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1756 |
void divpd(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1757 |
void divps(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1758 |
void vdivpd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1759 |
void vdivps(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1760 |
void vdivpd(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1761 |
void vdivps(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1762 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1763 |
// Bitwise Logical AND of Packed Floating-Point Values |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1764 |
void andpd(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1765 |
void andps(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1766 |
void vandpd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1767 |
void vandps(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1768 |
void vandpd(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1769 |
void vandps(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1770 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1771 |
// Bitwise Logical XOR of Packed Floating-Point Values |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1772 |
void xorpd(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1773 |
void xorps(XMMRegister dst, XMMRegister src); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1774 |
void vxorpd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1775 |
void vxorps(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1776 |
void vxorpd(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1777 |
void vxorps(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1778 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1779 |
// Add packed integers |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1780 |
void paddb(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1781 |
void paddw(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1782 |
void paddd(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1783 |
void paddq(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1784 |
void vpaddb(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1785 |
void vpaddw(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1786 |
void vpaddd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1787 |
void vpaddq(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1788 |
void vpaddb(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1789 |
void vpaddw(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1790 |
void vpaddd(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1791 |
void vpaddq(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1792 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1793 |
// Sub packed integers |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1794 |
void psubb(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1795 |
void psubw(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1796 |
void psubd(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1797 |
void psubq(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1798 |
void vpsubb(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1799 |
void vpsubw(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1800 |
void vpsubd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1801 |
void vpsubq(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1802 |
void vpsubb(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1803 |
void vpsubw(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1804 |
void vpsubd(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1805 |
void vpsubq(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1806 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1807 |
// Multiply packed integers (only shorts and ints) |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1808 |
void pmullw(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1809 |
void pmulld(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1810 |
void vpmullw(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1811 |
void vpmulld(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1812 |
void vpmullw(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1813 |
void vpmulld(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1814 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1815 |
// Shift left packed integers |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1816 |
void psllw(XMMRegister dst, int shift); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1817 |
void pslld(XMMRegister dst, int shift); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1818 |
void psllq(XMMRegister dst, int shift); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1819 |
void psllw(XMMRegister dst, XMMRegister shift); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1820 |
void pslld(XMMRegister dst, XMMRegister shift); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1821 |
void psllq(XMMRegister dst, XMMRegister shift); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1822 |
void vpsllw(XMMRegister dst, XMMRegister src, int shift, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1823 |
void vpslld(XMMRegister dst, XMMRegister src, int shift, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1824 |
void vpsllq(XMMRegister dst, XMMRegister src, int shift, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1825 |
void vpsllw(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1826 |
void vpslld(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1827 |
void vpsllq(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1828 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1829 |
// Logical shift right packed integers |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1830 |
void psrlw(XMMRegister dst, int shift); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1831 |
void psrld(XMMRegister dst, int shift); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1832 |
void psrlq(XMMRegister dst, int shift); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1833 |
void psrlw(XMMRegister dst, XMMRegister shift); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1834 |
void psrld(XMMRegister dst, XMMRegister shift); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1835 |
void psrlq(XMMRegister dst, XMMRegister shift); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1836 |
void vpsrlw(XMMRegister dst, XMMRegister src, int shift, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1837 |
void vpsrld(XMMRegister dst, XMMRegister src, int shift, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1838 |
void vpsrlq(XMMRegister dst, XMMRegister src, int shift, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1839 |
void vpsrlw(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1840 |
void vpsrld(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1841 |
void vpsrlq(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1842 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1843 |
// Arithmetic shift right packed integers (only shorts and ints, no instructions for longs) |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1844 |
void psraw(XMMRegister dst, int shift); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1845 |
void psrad(XMMRegister dst, int shift); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1846 |
void psraw(XMMRegister dst, XMMRegister shift); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1847 |
void psrad(XMMRegister dst, XMMRegister shift); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1848 |
void vpsraw(XMMRegister dst, XMMRegister src, int shift, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1849 |
void vpsrad(XMMRegister dst, XMMRegister src, int shift, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1850 |
void vpsraw(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1851 |
void vpsrad(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1852 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1853 |
// And packed integers |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1854 |
void pand(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1855 |
void vpand(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1856 |
void vpand(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1857 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1858 |
// Or packed integers |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1859 |
void por(XMMRegister dst, XMMRegister src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1860 |
void vpor(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1861 |
void vpor(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1862 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1863 |
// Xor packed integers |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1864 |
void pxor(XMMRegister dst, XMMRegister src); |
13294 | 1865 |
void vpxor(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1866 |
void vpxor(XMMRegister dst, XMMRegister nds, Address src, bool vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1867 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1868 |
// Copy low 128bit into high 128bit of YMM registers. |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1869 |
void vinsertf128h(XMMRegister dst, XMMRegister nds, XMMRegister src); |
13294 | 1870 |
void vinserti128h(XMMRegister dst, XMMRegister nds, XMMRegister src); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1871 |
|
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13743
diff
changeset
|
1872 |
// Load/store high 128bit of YMM registers which does not destroy other half. |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13743
diff
changeset
|
1873 |
void vinsertf128h(XMMRegister dst, Address src); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13743
diff
changeset
|
1874 |
void vinserti128h(XMMRegister dst, Address src); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13743
diff
changeset
|
1875 |
void vextractf128h(Address dst, XMMRegister src); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13743
diff
changeset
|
1876 |
void vextracti128h(Address dst, XMMRegister src); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13743
diff
changeset
|
1877 |
|
15115
f8ef87f6f07f
8005544: Use 256bit YMM registers in arraycopy stubs on x86
kvn
parents:
15114
diff
changeset
|
1878 |
// duplicate 4-bytes integer data from src into 8 locations in dest |
f8ef87f6f07f
8005544: Use 256bit YMM registers in arraycopy stubs on x86
kvn
parents:
15114
diff
changeset
|
1879 |
void vpbroadcastd(XMMRegister dst, XMMRegister src); |
f8ef87f6f07f
8005544: Use 256bit YMM registers in arraycopy stubs on x86
kvn
parents:
15114
diff
changeset
|
1880 |
|
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15436
diff
changeset
|
1881 |
// Carry-Less Multiplication Quadword |
25932
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
23491
diff
changeset
|
1882 |
void pclmulqdq(XMMRegister dst, XMMRegister src, int mask); |
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15436
diff
changeset
|
1883 |
void vpclmulqdq(XMMRegister dst, XMMRegister nds, XMMRegister src, int mask); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
15436
diff
changeset
|
1884 |
|
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1885 |
// AVX instruction which is used to clear upper 128 bits of YMM registers and |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1886 |
// to avoid transaction penalty between AVX and SSE states. There is no |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1887 |
// penalty if legacy SSE instructions are encoded using VEX prefix because |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1888 |
// they always clear upper 128 bits. It should be used before calling |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1889 |
// runtime code and native libraries. |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1890 |
void vzeroupper(); |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
1891 |
|
11427 | 1892 |
protected: |
1893 |
// Next instructions require address alignment 16 bytes SSE mode. |
|
1894 |
// They should be called only from corresponding MacroAssembler instructions. |
|
1895 |
void andpd(XMMRegister dst, Address src); |
|
1896 |
void andps(XMMRegister dst, Address src); |
|
1897 |
void xorpd(XMMRegister dst, Address src); |
|
1898 |
void xorps(XMMRegister dst, Address src); |
|
1899 |
||
1 | 1900 |
}; |
1901 |
||
7397 | 1902 |
#endif // CPU_X86_VM_ASSEMBLER_X86_HPP |