author | sviswanathan |
Tue, 07 May 2019 13:33:27 -0700 | |
changeset 54750 | 1851a532ddfe |
parent 54519 | a2795025f417 |
child 55490 | 3f3dc00a69a5 |
child 58678 | 9cf78a70fa4f |
permissions | -rw-r--r-- |
1 | 1 |
/* |
54022
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
2 |
* Copyright (c) 1997, 2019, 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:
5426
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5426
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:
5426
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#include "precompiled.hpp" |
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
26 |
#include "asm/assembler.hpp" |
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
27 |
#include "asm/assembler.inline.hpp" |
49455
848864ed9b17
8199604: Rename CardTableModRefBS to CardTableBarrierSet
eosterlund
parents:
49449
diff
changeset
|
28 |
#include "gc/shared/cardTableBarrierSet.hpp" |
30764 | 29 |
#include "gc/shared/collectedHeap.inline.hpp" |
7397 | 30 |
#include "interpreter/interpreter.hpp" |
31 |
#include "memory/resourceArea.hpp" |
|
32 |
#include "prims/methodHandles.hpp" |
|
33 |
#include "runtime/biasedLocking.hpp" |
|
34 |
#include "runtime/objectMonitor.hpp" |
|
35 |
#include "runtime/os.hpp" |
|
36 |
#include "runtime/sharedRuntime.hpp" |
|
37 |
#include "runtime/stubRoutines.hpp" |
|
15482
470d0b0c09f1
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
15117
diff
changeset
|
38 |
#include "utilities/macros.hpp" |
1 | 39 |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
40 |
#ifdef PRODUCT |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
41 |
#define BLOCK_COMMENT(str) /* nothing */ |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
42 |
#define STOP(error) stop(error) |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
43 |
#else |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
44 |
#define BLOCK_COMMENT(str) block_comment(str) |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
45 |
#define STOP(error) block_comment(error); stop(error) |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
46 |
#endif |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
47 |
|
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
48 |
#define BIND(label) bind(label); BLOCK_COMMENT(#label ":") |
1 | 49 |
// Implementation of AddressLiteral |
50 |
||
30624 | 51 |
// A 2-D table for managing compressed displacement(disp8) on EVEX enabled platforms. |
52 |
unsigned char tuple_table[Assembler::EVEX_ETUP + 1][Assembler::AVX_512bit + 1] = { |
|
53 |
// -----------------Table 4.5 -------------------- // |
|
54 |
16, 32, 64, // EVEX_FV(0) |
|
55 |
4, 4, 4, // EVEX_FV(1) - with Evex.b |
|
56 |
16, 32, 64, // EVEX_FV(2) - with Evex.w |
|
57 |
8, 8, 8, // EVEX_FV(3) - with Evex.w and Evex.b |
|
58 |
8, 16, 32, // EVEX_HV(0) |
|
59 |
4, 4, 4, // EVEX_HV(1) - with Evex.b |
|
60 |
// -----------------Table 4.6 -------------------- // |
|
61 |
16, 32, 64, // EVEX_FVM(0) |
|
62 |
1, 1, 1, // EVEX_T1S(0) |
|
63 |
2, 2, 2, // EVEX_T1S(1) |
|
64 |
4, 4, 4, // EVEX_T1S(2) |
|
65 |
8, 8, 8, // EVEX_T1S(3) |
|
66 |
4, 4, 4, // EVEX_T1F(0) |
|
67 |
8, 8, 8, // EVEX_T1F(1) |
|
68 |
8, 8, 8, // EVEX_T2(0) |
|
69 |
0, 16, 16, // EVEX_T2(1) |
|
70 |
0, 16, 16, // EVEX_T4(0) |
|
71 |
0, 0, 32, // EVEX_T4(1) |
|
72 |
0, 0, 32, // EVEX_T8(0) |
|
73 |
8, 16, 32, // EVEX_HVM(0) |
|
74 |
4, 8, 16, // EVEX_QVM(0) |
|
75 |
2, 4, 8, // EVEX_OVM(0) |
|
76 |
16, 16, 16, // EVEX_M128(0) |
|
77 |
8, 32, 64, // EVEX_DUP(0) |
|
78 |
0, 0, 0 // EVEX_NTUP |
|
79 |
}; |
|
80 |
||
1 | 81 |
AddressLiteral::AddressLiteral(address target, relocInfo::relocType rtype) { |
82 |
_is_lval = false; |
|
83 |
_target = target; |
|
84 |
switch (rtype) { |
|
85 |
case relocInfo::oop_type: |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13485
diff
changeset
|
86 |
case relocInfo::metadata_type: |
1 | 87 |
// Oops are a special case. Normally they would be their own section |
88 |
// but in cases like icBuffer they are literals in the code stream that |
|
89 |
// we don't have a section for. We use none so that we get a literal address |
|
90 |
// which is always patchable. |
|
91 |
break; |
|
92 |
case relocInfo::external_word_type: |
|
93 |
_rspec = external_word_Relocation::spec(target); |
|
94 |
break; |
|
95 |
case relocInfo::internal_word_type: |
|
96 |
_rspec = internal_word_Relocation::spec(target); |
|
97 |
break; |
|
98 |
case relocInfo::opt_virtual_call_type: |
|
99 |
_rspec = opt_virtual_call_Relocation::spec(); |
|
100 |
break; |
|
101 |
case relocInfo::static_call_type: |
|
102 |
_rspec = static_call_Relocation::spec(); |
|
103 |
break; |
|
104 |
case relocInfo::runtime_call_type: |
|
105 |
_rspec = runtime_call_Relocation::spec(); |
|
106 |
break; |
|
107 |
case relocInfo::poll_type: |
|
108 |
case relocInfo::poll_return_type: |
|
109 |
_rspec = Relocation::spec_simple(rtype); |
|
110 |
break; |
|
111 |
case relocInfo::none: |
|
112 |
break; |
|
113 |
default: |
|
114 |
ShouldNotReachHere(); |
|
115 |
break; |
|
116 |
} |
|
117 |
} |
|
118 |
||
119 |
// Implementation of Address |
|
120 |
||
1066 | 121 |
#ifdef _LP64 |
122 |
||
1 | 123 |
Address Address::make_array(ArrayAddress adr) { |
124 |
// Not implementable on 64bit machines |
|
125 |
// Should have been handled higher up the call chain. |
|
126 |
ShouldNotReachHere(); |
|
1066 | 127 |
return Address(); |
128 |
} |
|
129 |
||
130 |
// exceedingly dangerous constructor |
|
131 |
Address::Address(int disp, address loc, relocInfo::relocType rtype) { |
|
132 |
_base = noreg; |
|
133 |
_index = noreg; |
|
134 |
_scale = no_scale; |
|
135 |
_disp = disp; |
|
50860
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
136 |
_xmmindex = xnoreg; |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
137 |
_isxmmindex = false; |
1066 | 138 |
switch (rtype) { |
139 |
case relocInfo::external_word_type: |
|
140 |
_rspec = external_word_Relocation::spec(loc); |
|
141 |
break; |
|
142 |
case relocInfo::internal_word_type: |
|
143 |
_rspec = internal_word_Relocation::spec(loc); |
|
144 |
break; |
|
145 |
case relocInfo::runtime_call_type: |
|
146 |
// HMM |
|
147 |
_rspec = runtime_call_Relocation::spec(); |
|
148 |
break; |
|
149 |
case relocInfo::poll_type: |
|
150 |
case relocInfo::poll_return_type: |
|
151 |
_rspec = Relocation::spec_simple(rtype); |
|
152 |
break; |
|
153 |
case relocInfo::none: |
|
154 |
break; |
|
155 |
default: |
|
156 |
ShouldNotReachHere(); |
|
157 |
} |
|
158 |
} |
|
159 |
#else // LP64 |
|
160 |
||
161 |
Address Address::make_array(ArrayAddress adr) { |
|
1 | 162 |
AddressLiteral base = adr.base(); |
163 |
Address index = adr.index(); |
|
164 |
assert(index._disp == 0, "must not have disp"); // maybe it can? |
|
165 |
Address array(index._base, index._index, index._scale, (intptr_t) base.target()); |
|
166 |
array._rspec = base._rspec; |
|
167 |
return array; |
|
1066 | 168 |
} |
1 | 169 |
|
170 |
// exceedingly dangerous constructor |
|
171 |
Address::Address(address loc, RelocationHolder spec) { |
|
172 |
_base = noreg; |
|
173 |
_index = noreg; |
|
174 |
_scale = no_scale; |
|
175 |
_disp = (intptr_t) loc; |
|
176 |
_rspec = spec; |
|
50860
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
177 |
_xmmindex = xnoreg; |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
178 |
_isxmmindex = false; |
1 | 179 |
} |
1066 | 180 |
|
1 | 181 |
#endif // _LP64 |
182 |
||
1066 | 183 |
|
184 |
||
1 | 185 |
// Convert the raw encoding form into the form expected by the constructor for |
186 |
// Address. An index of 4 (rsp) corresponds to having no index, so convert |
|
187 |
// that to noreg for the Address constructor. |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13485
diff
changeset
|
188 |
Address Address::make_raw(int base, int index, int scale, int disp, relocInfo::relocType disp_reloc) { |
2150 | 189 |
RelocationHolder rspec; |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13485
diff
changeset
|
190 |
if (disp_reloc != relocInfo::none) { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13485
diff
changeset
|
191 |
rspec = Relocation::spec_simple(disp_reloc); |
2150 | 192 |
} |
1 | 193 |
bool valid_index = index != rsp->encoding(); |
194 |
if (valid_index) { |
|
195 |
Address madr(as_Register(base), as_Register(index), (Address::ScaleFactor)scale, in_ByteSize(disp)); |
|
2150 | 196 |
madr._rspec = rspec; |
1 | 197 |
return madr; |
198 |
} else { |
|
199 |
Address madr(as_Register(base), noreg, Address::no_scale, in_ByteSize(disp)); |
|
2150 | 200 |
madr._rspec = rspec; |
1 | 201 |
return madr; |
202 |
} |
|
203 |
} |
|
204 |
||
205 |
// Implementation of Assembler |
|
206 |
||
207 |
int AbstractAssembler::code_fill_byte() { |
|
208 |
return (u_char)'\xF4'; // hlt |
|
209 |
} |
|
210 |
||
211 |
// make this go away someday |
|
212 |
void Assembler::emit_data(jint data, relocInfo::relocType rtype, int format) { |
|
213 |
if (rtype == relocInfo::none) |
|
30624 | 214 |
emit_int32(data); |
215 |
else |
|
216 |
emit_data(data, Relocation::spec_simple(rtype), format); |
|
1 | 217 |
} |
218 |
||
219 |
void Assembler::emit_data(jint data, RelocationHolder const& rspec, int format) { |
|
1066 | 220 |
assert(imm_operand == 0, "default format must be immediate in this file"); |
1 | 221 |
assert(inst_mark() != NULL, "must be inside InstructionMark"); |
222 |
if (rspec.type() != relocInfo::none) { |
|
223 |
#ifdef ASSERT |
|
224 |
check_relocation(rspec, format); |
|
225 |
#endif |
|
226 |
// Do not use AbstractAssembler::relocate, which is not intended for |
|
227 |
// embedded words. Instead, relocate to the enclosing instruction. |
|
228 |
||
229 |
// hack. call32 is too wide for mask so use disp32 |
|
230 |
if (format == call32_operand) |
|
231 |
code_section()->relocate(inst_mark(), rspec, disp32_operand); |
|
232 |
else |
|
233 |
code_section()->relocate(inst_mark(), rspec, format); |
|
234 |
} |
|
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
235 |
emit_int32(data); |
1 | 236 |
} |
237 |
||
1066 | 238 |
static int encode(Register r) { |
239 |
int enc = r->encoding(); |
|
240 |
if (enc >= 8) { |
|
241 |
enc -= 8; |
|
242 |
} |
|
243 |
return enc; |
|
244 |
} |
|
245 |
||
1 | 246 |
void Assembler::emit_arith_b(int op1, int op2, Register dst, int imm8) { |
247 |
assert(dst->has_byte_register(), "must have byte register"); |
|
248 |
assert(isByte(op1) && isByte(op2), "wrong opcode"); |
|
249 |
assert(isByte(imm8), "not a byte"); |
|
250 |
assert((op1 & 0x01) == 0, "should be 8bit operation"); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
251 |
emit_int8(op1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
252 |
emit_int8(op2 | encode(dst)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
253 |
emit_int8(imm8); |
1 | 254 |
} |
255 |
||
256 |
||
1066 | 257 |
void Assembler::emit_arith(int op1, int op2, Register dst, int32_t imm32) { |
1 | 258 |
assert(isByte(op1) && isByte(op2), "wrong opcode"); |
259 |
assert((op1 & 0x01) == 1, "should be 32bit operation"); |
|
260 |
assert((op1 & 0x02) == 0, "sign-extension bit should not be set"); |
|
261 |
if (is8bit(imm32)) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
262 |
emit_int8(op1 | 0x02); // set sign bit |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
263 |
emit_int8(op2 | encode(dst)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
264 |
emit_int8(imm32 & 0xFF); |
1 | 265 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
266 |
emit_int8(op1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
267 |
emit_int8(op2 | encode(dst)); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
268 |
emit_int32(imm32); |
1 | 269 |
} |
270 |
} |
|
271 |
||
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
272 |
// 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:
11438
diff
changeset
|
273 |
void Assembler::emit_arith_imm32(int op1, int op2, Register dst, int32_t imm32) { |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
274 |
assert(isByte(op1) && isByte(op2), "wrong opcode"); |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
275 |
assert((op1 & 0x01) == 1, "should be 32bit operation"); |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
276 |
assert((op1 & 0x02) == 0, "sign-extension bit should not be set"); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
277 |
emit_int8(op1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
278 |
emit_int8(op2 | encode(dst)); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
279 |
emit_int32(imm32); |
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
280 |
} |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
281 |
|
1 | 282 |
// immediate-to-memory forms |
1066 | 283 |
void Assembler::emit_arith_operand(int op1, Register rm, Address adr, int32_t imm32) { |
1 | 284 |
assert((op1 & 0x01) == 1, "should be 32bit operation"); |
285 |
assert((op1 & 0x02) == 0, "sign-extension bit should not be set"); |
|
286 |
if (is8bit(imm32)) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
287 |
emit_int8(op1 | 0x02); // set sign bit |
1066 | 288 |
emit_operand(rm, adr, 1); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
289 |
emit_int8(imm32 & 0xFF); |
1 | 290 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
291 |
emit_int8(op1); |
1066 | 292 |
emit_operand(rm, adr, 4); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
293 |
emit_int32(imm32); |
1 | 294 |
} |
295 |
} |
|
296 |
||
297 |
||
298 |
void Assembler::emit_arith(int op1, int op2, Register dst, Register src) { |
|
299 |
assert(isByte(op1) && isByte(op2), "wrong opcode"); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
300 |
emit_int8(op1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
301 |
emit_int8(op2 | encode(dst) << 3 | encode(src)); |
1066 | 302 |
} |
303 |
||
304 |
||
30624 | 305 |
bool Assembler::query_compressed_disp_byte(int disp, bool is_evex_inst, int vector_len, |
306 |
int cur_tuple_type, int in_size_in_bits, int cur_encoding) { |
|
307 |
int mod_idx = 0; |
|
308 |
// We will test if the displacement fits the compressed format and if so |
|
309 |
// apply the compression to the displacment iff the result is8bit. |
|
310 |
if (VM_Version::supports_evex() && is_evex_inst) { |
|
311 |
switch (cur_tuple_type) { |
|
312 |
case EVEX_FV: |
|
313 |
if ((cur_encoding & VEX_W) == VEX_W) { |
|
34162 | 314 |
mod_idx = ((cur_encoding & EVEX_Rb) == EVEX_Rb) ? 3 : 2; |
30624 | 315 |
} else { |
316 |
mod_idx = ((cur_encoding & EVEX_Rb) == EVEX_Rb) ? 1 : 0; |
|
317 |
} |
|
318 |
break; |
|
319 |
||
320 |
case EVEX_HV: |
|
321 |
mod_idx = ((cur_encoding & EVEX_Rb) == EVEX_Rb) ? 1 : 0; |
|
322 |
break; |
|
323 |
||
324 |
case EVEX_FVM: |
|
325 |
break; |
|
326 |
||
327 |
case EVEX_T1S: |
|
328 |
switch (in_size_in_bits) { |
|
329 |
case EVEX_8bit: |
|
330 |
break; |
|
331 |
||
332 |
case EVEX_16bit: |
|
333 |
mod_idx = 1; |
|
334 |
break; |
|
335 |
||
336 |
case EVEX_32bit: |
|
337 |
mod_idx = 2; |
|
338 |
break; |
|
339 |
||
340 |
case EVEX_64bit: |
|
341 |
mod_idx = 3; |
|
342 |
break; |
|
343 |
} |
|
344 |
break; |
|
345 |
||
346 |
case EVEX_T1F: |
|
347 |
case EVEX_T2: |
|
348 |
case EVEX_T4: |
|
349 |
mod_idx = (in_size_in_bits == EVEX_64bit) ? 1 : 0; |
|
350 |
break; |
|
351 |
||
352 |
case EVEX_T8: |
|
353 |
break; |
|
354 |
||
355 |
case EVEX_HVM: |
|
356 |
break; |
|
357 |
||
358 |
case EVEX_QVM: |
|
359 |
break; |
|
360 |
||
361 |
case EVEX_OVM: |
|
362 |
break; |
|
363 |
||
364 |
case EVEX_M128: |
|
365 |
break; |
|
366 |
||
367 |
case EVEX_DUP: |
|
368 |
break; |
|
369 |
||
370 |
default: |
|
371 |
assert(0, "no valid evex tuple_table entry"); |
|
372 |
break; |
|
373 |
} |
|
374 |
||
375 |
if (vector_len >= AVX_128bit && vector_len <= AVX_512bit) { |
|
376 |
int disp_factor = tuple_table[cur_tuple_type + mod_idx][vector_len]; |
|
377 |
if ((disp % disp_factor) == 0) { |
|
378 |
int new_disp = disp / disp_factor; |
|
379 |
if ((-0x80 <= new_disp && new_disp < 0x80)) { |
|
380 |
disp = new_disp; |
|
381 |
} |
|
382 |
} else { |
|
383 |
return false; |
|
384 |
} |
|
385 |
} |
|
386 |
} |
|
387 |
return (-0x80 <= disp && disp < 0x80); |
|
388 |
} |
|
389 |
||
390 |
||
391 |
bool Assembler::emit_compressed_disp_byte(int &disp) { |
|
392 |
int mod_idx = 0; |
|
393 |
// We will test if the displacement fits the compressed format and if so |
|
394 |
// apply the compression to the displacment iff the result is8bit. |
|
36837 | 395 |
if (VM_Version::supports_evex() && _attributes && _attributes->is_evex_instruction()) { |
34162 | 396 |
int evex_encoding = _attributes->get_evex_encoding(); |
397 |
int tuple_type = _attributes->get_tuple_type(); |
|
398 |
switch (tuple_type) { |
|
30624 | 399 |
case EVEX_FV: |
34162 | 400 |
if ((evex_encoding & VEX_W) == VEX_W) { |
401 |
mod_idx = ((evex_encoding & EVEX_Rb) == EVEX_Rb) ? 3 : 2; |
|
30624 | 402 |
} else { |
34162 | 403 |
mod_idx = ((evex_encoding & EVEX_Rb) == EVEX_Rb) ? 1 : 0; |
30624 | 404 |
} |
405 |
break; |
|
406 |
||
407 |
case EVEX_HV: |
|
34162 | 408 |
mod_idx = ((evex_encoding & EVEX_Rb) == EVEX_Rb) ? 1 : 0; |
30624 | 409 |
break; |
410 |
||
411 |
case EVEX_FVM: |
|
412 |
break; |
|
413 |
||
414 |
case EVEX_T1S: |
|
34162 | 415 |
switch (_attributes->get_input_size()) { |
30624 | 416 |
case EVEX_8bit: |
417 |
break; |
|
418 |
||
419 |
case EVEX_16bit: |
|
420 |
mod_idx = 1; |
|
421 |
break; |
|
422 |
||
423 |
case EVEX_32bit: |
|
424 |
mod_idx = 2; |
|
425 |
break; |
|
426 |
||
427 |
case EVEX_64bit: |
|
428 |
mod_idx = 3; |
|
429 |
break; |
|
430 |
} |
|
431 |
break; |
|
432 |
||
433 |
case EVEX_T1F: |
|
434 |
case EVEX_T2: |
|
435 |
case EVEX_T4: |
|
34162 | 436 |
mod_idx = (_attributes->get_input_size() == EVEX_64bit) ? 1 : 0; |
30624 | 437 |
break; |
438 |
||
439 |
case EVEX_T8: |
|
440 |
break; |
|
441 |
||
442 |
case EVEX_HVM: |
|
443 |
break; |
|
444 |
||
445 |
case EVEX_QVM: |
|
446 |
break; |
|
447 |
||
448 |
case EVEX_OVM: |
|
449 |
break; |
|
450 |
||
451 |
case EVEX_M128: |
|
452 |
break; |
|
453 |
||
454 |
case EVEX_DUP: |
|
455 |
break; |
|
456 |
||
457 |
default: |
|
458 |
assert(0, "no valid evex tuple_table entry"); |
|
459 |
break; |
|
460 |
} |
|
461 |
||
34162 | 462 |
int vector_len = _attributes->get_vector_len(); |
463 |
if (vector_len >= AVX_128bit && vector_len <= AVX_512bit) { |
|
464 |
int disp_factor = tuple_table[tuple_type + mod_idx][vector_len]; |
|
30624 | 465 |
if ((disp % disp_factor) == 0) { |
466 |
int new_disp = disp / disp_factor; |
|
467 |
if (is8bit(new_disp)) { |
|
468 |
disp = new_disp; |
|
469 |
} |
|
470 |
} else { |
|
471 |
return false; |
|
472 |
} |
|
473 |
} |
|
474 |
} |
|
475 |
return is8bit(disp); |
|
476 |
} |
|
477 |
||
478 |
||
1066 | 479 |
void Assembler::emit_operand(Register reg, Register base, Register index, |
480 |
Address::ScaleFactor scale, int disp, |
|
481 |
RelocationHolder const& rspec, |
|
482 |
int rip_relative_correction) { |
|
1 | 483 |
relocInfo::relocType rtype = (relocInfo::relocType) rspec.type(); |
1066 | 484 |
|
485 |
// Encode the registers as needed in the fields they are used in |
|
486 |
||
487 |
int regenc = encode(reg) << 3; |
|
488 |
int indexenc = index->is_valid() ? encode(index) << 3 : 0; |
|
489 |
int baseenc = base->is_valid() ? encode(base) : 0; |
|
490 |
||
1 | 491 |
if (base->is_valid()) { |
492 |
if (index->is_valid()) { |
|
493 |
assert(scale != Address::no_scale, "inconsistent address"); |
|
494 |
// [base + index*scale + disp] |
|
1066 | 495 |
if (disp == 0 && rtype == relocInfo::none && |
496 |
base != rbp LP64_ONLY(&& base != r13)) { |
|
1 | 497 |
// [base + index*scale] |
498 |
// [00 reg 100][ss index base] |
|
499 |
assert(index != rsp, "illegal addressing mode"); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
500 |
emit_int8(0x04 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
501 |
emit_int8(scale << 6 | indexenc | baseenc); |
30624 | 502 |
} else if (emit_compressed_disp_byte(disp) && rtype == relocInfo::none) { |
1 | 503 |
// [base + index*scale + imm8] |
504 |
// [01 reg 100][ss index base] imm8 |
|
505 |
assert(index != rsp, "illegal addressing mode"); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
506 |
emit_int8(0x44 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
507 |
emit_int8(scale << 6 | indexenc | baseenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
508 |
emit_int8(disp & 0xFF); |
1 | 509 |
} else { |
1066 | 510 |
// [base + index*scale + disp32] |
511 |
// [10 reg 100][ss index base] disp32 |
|
1 | 512 |
assert(index != rsp, "illegal addressing mode"); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
513 |
emit_int8(0x84 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
514 |
emit_int8(scale << 6 | indexenc | baseenc); |
1 | 515 |
emit_data(disp, rspec, disp32_operand); |
516 |
} |
|
1066 | 517 |
} else if (base == rsp LP64_ONLY(|| base == r12)) { |
518 |
// [rsp + disp] |
|
1 | 519 |
if (disp == 0 && rtype == relocInfo::none) { |
1066 | 520 |
// [rsp] |
1 | 521 |
// [00 reg 100][00 100 100] |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
522 |
emit_int8(0x04 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
523 |
emit_int8(0x24); |
30624 | 524 |
} else if (emit_compressed_disp_byte(disp) && rtype == relocInfo::none) { |
1066 | 525 |
// [rsp + imm8] |
526 |
// [01 reg 100][00 100 100] disp8 |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
527 |
emit_int8(0x44 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
528 |
emit_int8(0x24); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
529 |
emit_int8(disp & 0xFF); |
1 | 530 |
} else { |
1066 | 531 |
// [rsp + imm32] |
532 |
// [10 reg 100][00 100 100] disp32 |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
533 |
emit_int8(0x84 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
534 |
emit_int8(0x24); |
1 | 535 |
emit_data(disp, rspec, disp32_operand); |
536 |
} |
|
537 |
} else { |
|
538 |
// [base + disp] |
|
1066 | 539 |
assert(base != rsp LP64_ONLY(&& base != r12), "illegal addressing mode"); |
540 |
if (disp == 0 && rtype == relocInfo::none && |
|
541 |
base != rbp LP64_ONLY(&& base != r13)) { |
|
1 | 542 |
// [base] |
543 |
// [00 reg base] |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
544 |
emit_int8(0x00 | regenc | baseenc); |
30624 | 545 |
} else if (emit_compressed_disp_byte(disp) && rtype == relocInfo::none) { |
1066 | 546 |
// [base + disp8] |
547 |
// [01 reg base] disp8 |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
548 |
emit_int8(0x40 | regenc | baseenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
549 |
emit_int8(disp & 0xFF); |
1 | 550 |
} else { |
1066 | 551 |
// [base + disp32] |
552 |
// [10 reg base] disp32 |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
553 |
emit_int8(0x80 | regenc | baseenc); |
1 | 554 |
emit_data(disp, rspec, disp32_operand); |
555 |
} |
|
556 |
} |
|
557 |
} else { |
|
558 |
if (index->is_valid()) { |
|
559 |
assert(scale != Address::no_scale, "inconsistent address"); |
|
560 |
// [index*scale + disp] |
|
1066 | 561 |
// [00 reg 100][ss index 101] disp32 |
1 | 562 |
assert(index != rsp, "illegal addressing mode"); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
563 |
emit_int8(0x04 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
564 |
emit_int8(scale << 6 | indexenc | 0x05); |
1 | 565 |
emit_data(disp, rspec, disp32_operand); |
1066 | 566 |
} else if (rtype != relocInfo::none ) { |
567 |
// [disp] (64bit) RIP-RELATIVE (32bit) abs |
|
568 |
// [00 000 101] disp32 |
|
569 |
||
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
570 |
emit_int8(0x05 | regenc); |
1066 | 571 |
// Note that the RIP-rel. correction applies to the generated |
572 |
// disp field, but _not_ to the target address in the rspec. |
|
573 |
||
574 |
// disp was created by converting the target address minus the pc |
|
575 |
// at the start of the instruction. That needs more correction here. |
|
576 |
// intptr_t disp = target - next_ip; |
|
577 |
assert(inst_mark() != NULL, "must be inside InstructionMark"); |
|
578 |
address next_ip = pc() + sizeof(int32_t) + rip_relative_correction; |
|
579 |
int64_t adjusted = disp; |
|
580 |
// Do rip-rel adjustment for 64bit |
|
581 |
LP64_ONLY(adjusted -= (next_ip - inst_mark())); |
|
582 |
assert(is_simm32(adjusted), |
|
583 |
"must be 32bit offset (RIP relative address)"); |
|
584 |
emit_data((int32_t) adjusted, rspec, disp32_operand); |
|
585 |
||
1 | 586 |
} else { |
1066 | 587 |
// 32bit never did this, did everything as the rip-rel/disp code above |
588 |
// [disp] ABSOLUTE |
|
589 |
// [00 reg 100][00 100 101] disp32 |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
590 |
emit_int8(0x04 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
591 |
emit_int8(0x25); |
1 | 592 |
emit_data(disp, rspec, disp32_operand); |
593 |
} |
|
594 |
} |
|
595 |
} |
|
596 |
||
1066 | 597 |
void Assembler::emit_operand(XMMRegister reg, Register base, Register index, |
598 |
Address::ScaleFactor scale, int disp, |
|
599 |
RelocationHolder const& rspec) { |
|
30624 | 600 |
if (UseAVX > 2) { |
601 |
int xreg_enc = reg->encoding(); |
|
602 |
if (xreg_enc > 15) { |
|
603 |
XMMRegister new_reg = as_XMMRegister(xreg_enc & 0xf); |
|
604 |
emit_operand((Register)new_reg, base, index, scale, disp, rspec); |
|
605 |
return; |
|
606 |
} |
|
607 |
} |
|
1066 | 608 |
emit_operand((Register)reg, base, index, scale, disp, rspec); |
609 |
} |
|
610 |
||
50860
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
611 |
void Assembler::emit_operand(XMMRegister reg, Register base, XMMRegister index, |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
612 |
Address::ScaleFactor scale, int disp, |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
613 |
RelocationHolder const& rspec) { |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
614 |
if (UseAVX > 2) { |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
615 |
int xreg_enc = reg->encoding(); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
616 |
int xmmindex_enc = index->encoding(); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
617 |
XMMRegister new_reg = as_XMMRegister(xreg_enc & 0xf); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
618 |
XMMRegister new_index = as_XMMRegister(xmmindex_enc & 0xf); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
619 |
emit_operand((Register)new_reg, base, (Register)new_index, scale, disp, rspec); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
620 |
} else { |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
621 |
emit_operand((Register)reg, base, (Register)index, scale, disp, rspec); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
622 |
} |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
623 |
} |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
624 |
|
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
625 |
|
1 | 626 |
// Secret local extension to Assembler::WhichOperand: |
627 |
#define end_pc_operand (_WhichOperand_limit) |
|
628 |
||
629 |
address Assembler::locate_operand(address inst, WhichOperand which) { |
|
630 |
// Decode the given instruction, and return the address of |
|
631 |
// an embedded 32-bit operand word. |
|
632 |
||
633 |
// If "which" is disp32_operand, selects the displacement portion |
|
634 |
// of an effective address specifier. |
|
1066 | 635 |
// If "which" is imm64_operand, selects the trailing immediate constant. |
1 | 636 |
// If "which" is call32_operand, selects the displacement of a call or jump. |
637 |
// Caller is responsible for ensuring that there is such an operand, |
|
1066 | 638 |
// and that it is 32/64 bits wide. |
1 | 639 |
|
640 |
// If "which" is end_pc_operand, find the end of the instruction. |
|
641 |
||
642 |
address ip = inst; |
|
1066 | 643 |
bool is_64bit = false; |
644 |
||
645 |
debug_only(bool has_disp32 = false); |
|
646 |
int tail_size = 0; // other random bytes (#32, #16, etc.) at end of insn |
|
647 |
||
648 |
again_after_prefix: |
|
1 | 649 |
switch (0xFF & *ip++) { |
650 |
||
651 |
// These convenience macros generate groups of "case" labels for the switch. |
|
1066 | 652 |
#define REP4(x) (x)+0: case (x)+1: case (x)+2: case (x)+3 |
653 |
#define REP8(x) (x)+0: case (x)+1: case (x)+2: case (x)+3: \ |
|
1 | 654 |
case (x)+4: case (x)+5: case (x)+6: case (x)+7 |
1066 | 655 |
#define REP16(x) REP8((x)+0): \ |
1 | 656 |
case REP8((x)+8) |
657 |
||
658 |
case CS_segment: |
|
659 |
case SS_segment: |
|
660 |
case DS_segment: |
|
661 |
case ES_segment: |
|
662 |
case FS_segment: |
|
663 |
case GS_segment: |
|
1066 | 664 |
// Seems dubious |
665 |
LP64_ONLY(assert(false, "shouldn't have that prefix")); |
|
1 | 666 |
assert(ip == inst+1, "only one prefix allowed"); |
667 |
goto again_after_prefix; |
|
668 |
||
1066 | 669 |
case 0x67: |
670 |
case REX: |
|
671 |
case REX_B: |
|
672 |
case REX_X: |
|
673 |
case REX_XB: |
|
674 |
case REX_R: |
|
675 |
case REX_RB: |
|
676 |
case REX_RX: |
|
677 |
case REX_RXB: |
|
678 |
NOT_LP64(assert(false, "64bit prefixes")); |
|
679 |
goto again_after_prefix; |
|
680 |
||
681 |
case REX_W: |
|
682 |
case REX_WB: |
|
683 |
case REX_WX: |
|
684 |
case REX_WXB: |
|
685 |
case REX_WR: |
|
686 |
case REX_WRB: |
|
687 |
case REX_WRX: |
|
688 |
case REX_WRXB: |
|
689 |
NOT_LP64(assert(false, "64bit prefixes")); |
|
690 |
is_64bit = true; |
|
691 |
goto again_after_prefix; |
|
692 |
||
693 |
case 0xFF: // pushq a; decl a; incl a; call a; jmp a |
|
1 | 694 |
case 0x88: // movb a, r |
695 |
case 0x89: // movl a, r |
|
696 |
case 0x8A: // movb r, a |
|
697 |
case 0x8B: // movl r, a |
|
698 |
case 0x8F: // popl a |
|
1066 | 699 |
debug_only(has_disp32 = true); |
1 | 700 |
break; |
701 |
||
1066 | 702 |
case 0x68: // pushq #32 |
703 |
if (which == end_pc_operand) { |
|
704 |
return ip + 4; |
|
705 |
} |
|
706 |
assert(which == imm_operand && !is_64bit, "pushl has no disp32 or 64bit immediate"); |
|
1 | 707 |
return ip; // not produced by emit_operand |
708 |
||
709 |
case 0x66: // movw ... (size prefix) |
|
1066 | 710 |
again_after_size_prefix2: |
1 | 711 |
switch (0xFF & *ip++) { |
1066 | 712 |
case REX: |
713 |
case REX_B: |
|
714 |
case REX_X: |
|
715 |
case REX_XB: |
|
716 |
case REX_R: |
|
717 |
case REX_RB: |
|
718 |
case REX_RX: |
|
719 |
case REX_RXB: |
|
720 |
case REX_W: |
|
721 |
case REX_WB: |
|
722 |
case REX_WX: |
|
723 |
case REX_WXB: |
|
724 |
case REX_WR: |
|
725 |
case REX_WRB: |
|
726 |
case REX_WRX: |
|
727 |
case REX_WRXB: |
|
728 |
NOT_LP64(assert(false, "64bit prefix found")); |
|
729 |
goto again_after_size_prefix2; |
|
1 | 730 |
case 0x8B: // movw r, a |
731 |
case 0x89: // movw a, r |
|
1066 | 732 |
debug_only(has_disp32 = true); |
1 | 733 |
break; |
734 |
case 0xC7: // movw a, #16 |
|
1066 | 735 |
debug_only(has_disp32 = true); |
1 | 736 |
tail_size = 2; // the imm16 |
737 |
break; |
|
738 |
case 0x0F: // several SSE/SSE2 variants |
|
739 |
ip--; // reparse the 0x0F |
|
740 |
goto again_after_prefix; |
|
741 |
default: |
|
742 |
ShouldNotReachHere(); |
|
743 |
} |
|
744 |
break; |
|
745 |
||
1066 | 746 |
case REP8(0xB8): // movl/q r, #32/#64(oop?) |
747 |
if (which == end_pc_operand) return ip + (is_64bit ? 8 : 4); |
|
748 |
// these asserts are somewhat nonsensical |
|
749 |
#ifndef _LP64 |
|
12268 | 750 |
assert(which == imm_operand || which == disp32_operand, |
33105
294e48b4f704
8080775: Better argument formatting for assert() and friends
david
parents:
32727
diff
changeset
|
751 |
"which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip)); |
1066 | 752 |
#else |
753 |
assert((which == call32_operand || which == imm_operand) && is_64bit || |
|
12268 | 754 |
which == narrow_oop_operand && !is_64bit, |
33105
294e48b4f704
8080775: Better argument formatting for assert() and friends
david
parents:
32727
diff
changeset
|
755 |
"which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip)); |
1066 | 756 |
#endif // _LP64 |
1 | 757 |
return ip; |
758 |
||
759 |
case 0x69: // imul r, a, #32 |
|
760 |
case 0xC7: // movl a, #32(oop?) |
|
761 |
tail_size = 4; |
|
1066 | 762 |
debug_only(has_disp32 = true); // has both kinds of operands! |
1 | 763 |
break; |
764 |
||
765 |
case 0x0F: // movx..., etc. |
|
766 |
switch (0xFF & *ip++) { |
|
11427 | 767 |
case 0x3A: // pcmpestri |
768 |
tail_size = 1; |
|
769 |
case 0x38: // ptest, pmovzxbw |
|
770 |
ip++; // skip opcode |
|
771 |
debug_only(has_disp32 = true); // has both kinds of operands! |
|
772 |
break; |
|
773 |
||
774 |
case 0x70: // pshufd r, r/a, #8 |
|
775 |
debug_only(has_disp32 = true); // has both kinds of operands! |
|
776 |
case 0x73: // psrldq r, #8 |
|
777 |
tail_size = 1; |
|
778 |
break; |
|
779 |
||
1 | 780 |
case 0x12: // movlps |
781 |
case 0x28: // movaps |
|
782 |
case 0x2E: // ucomiss |
|
783 |
case 0x2F: // comiss |
|
784 |
case 0x54: // andps |
|
785 |
case 0x55: // andnps |
|
786 |
case 0x56: // orps |
|
787 |
case 0x57: // xorps |
|
35146 | 788 |
case 0x58: // addpd |
34162 | 789 |
case 0x59: // mulpd |
1 | 790 |
case 0x6E: // movd |
791 |
case 0x7E: // movd |
|
11427 | 792 |
case 0xAE: // ldmxcsr, stmxcsr, fxrstor, fxsave, clflush |
36555 | 793 |
case 0xFE: // paddd |
1066 | 794 |
debug_only(has_disp32 = true); |
1 | 795 |
break; |
796 |
||
797 |
case 0xAD: // shrd r, a, %cl |
|
798 |
case 0xAF: // imul r, a |
|
1066 | 799 |
case 0xBE: // movsbl r, a (movsxb) |
800 |
case 0xBF: // movswl r, a (movsxw) |
|
801 |
case 0xB6: // movzbl r, a (movzxb) |
|
802 |
case 0xB7: // movzwl r, a (movzxw) |
|
1 | 803 |
case REP16(0x40): // cmovl cc, r, a |
804 |
case 0xB0: // cmpxchgb |
|
805 |
case 0xB1: // cmpxchg |
|
806 |
case 0xC1: // xaddl |
|
807 |
case 0xC7: // cmpxchg8 |
|
808 |
case REP16(0x90): // setcc a |
|
1066 | 809 |
debug_only(has_disp32 = true); |
1 | 810 |
// fall out of the switch to decode the address |
811 |
break; |
|
1066 | 812 |
|
11427 | 813 |
case 0xC4: // pinsrw r, a, #8 |
814 |
debug_only(has_disp32 = true); |
|
815 |
case 0xC5: // pextrw r, r, #8 |
|
816 |
tail_size = 1; // the imm8 |
|
817 |
break; |
|
818 |
||
1 | 819 |
case 0xAC: // shrd r, a, #8 |
1066 | 820 |
debug_only(has_disp32 = true); |
1 | 821 |
tail_size = 1; // the imm8 |
822 |
break; |
|
1066 | 823 |
|
1 | 824 |
case REP16(0x80): // jcc rdisp32 |
825 |
if (which == end_pc_operand) return ip + 4; |
|
1066 | 826 |
assert(which == call32_operand, "jcc has no disp32 or imm"); |
1 | 827 |
return ip; |
828 |
default: |
|
829 |
ShouldNotReachHere(); |
|
830 |
} |
|
831 |
break; |
|
832 |
||
833 |
case 0x81: // addl a, #32; addl r, #32 |
|
834 |
// also: orl, adcl, sbbl, andl, subl, xorl, cmpl |
|
1066 | 835 |
// on 32bit in the case of cmpl, the imm might be an oop |
1 | 836 |
tail_size = 4; |
1066 | 837 |
debug_only(has_disp32 = true); // has both kinds of operands! |
1 | 838 |
break; |
839 |
||
840 |
case 0x83: // addl a, #8; addl r, #8 |
|
841 |
// also: orl, adcl, sbbl, andl, subl, xorl, cmpl |
|
1066 | 842 |
debug_only(has_disp32 = true); // has both kinds of operands! |
1 | 843 |
tail_size = 1; |
844 |
break; |
|
845 |
||
846 |
case 0x9B: |
|
847 |
switch (0xFF & *ip++) { |
|
848 |
case 0xD9: // fnstcw a |
|
1066 | 849 |
debug_only(has_disp32 = true); |
1 | 850 |
break; |
851 |
default: |
|
852 |
ShouldNotReachHere(); |
|
853 |
} |
|
854 |
break; |
|
855 |
||
856 |
case REP4(0x00): // addb a, r; addl a, r; addb r, a; addl r, a |
|
857 |
case REP4(0x10): // adc... |
|
858 |
case REP4(0x20): // and... |
|
859 |
case REP4(0x30): // xor... |
|
860 |
case REP4(0x08): // or... |
|
861 |
case REP4(0x18): // sbb... |
|
862 |
case REP4(0x28): // sub... |
|
1066 | 863 |
case 0xF7: // mull a |
864 |
case 0x8D: // lea r, a |
|
865 |
case 0x87: // xchg r, a |
|
1 | 866 |
case REP4(0x38): // cmp... |
1066 | 867 |
case 0x85: // test r, a |
868 |
debug_only(has_disp32 = true); // has both kinds of operands! |
|
1 | 869 |
break; |
870 |
||
871 |
case 0xC1: // sal a, #8; sar a, #8; shl a, #8; shr a, #8 |
|
872 |
case 0xC6: // movb a, #8 |
|
873 |
case 0x80: // cmpb a, #8 |
|
874 |
case 0x6B: // imul r, a, #8 |
|
1066 | 875 |
debug_only(has_disp32 = true); // has both kinds of operands! |
1 | 876 |
tail_size = 1; // the imm8 |
877 |
break; |
|
878 |
||
11427 | 879 |
case 0xC4: // VEX_3bytes |
880 |
case 0xC5: // VEX_2bytes |
|
881 |
assert((UseAVX > 0), "shouldn't have VEX prefix"); |
|
882 |
assert(ip == inst+1, "no prefixes allowed"); |
|
883 |
// C4 and C5 are also used as opcodes for PINSRW and PEXTRW instructions |
|
884 |
// but they have prefix 0x0F and processed when 0x0F processed above. |
|
885 |
// |
|
886 |
// In 32-bit mode the VEX first byte C4 and C5 alias onto LDS and LES |
|
887 |
// instructions (these instructions are not supported in 64-bit mode). |
|
888 |
// To distinguish them bits [7:6] are set in the VEX second byte since |
|
889 |
// ModRM byte can not be of the form 11xxxxxx in 32-bit mode. To set |
|
890 |
// those VEX bits REX and vvvv bits are inverted. |
|
891 |
// |
|
892 |
// Fortunately C2 doesn't generate these instructions so we don't need |
|
893 |
// to check for them in product version. |
|
894 |
||
895 |
// Check second byte |
|
896 |
NOT_LP64(assert((0xC0 & *ip) == 0xC0, "shouldn't have LDS and LES instructions")); |
|
897 |
||
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
898 |
int vex_opcode; |
11427 | 899 |
// First byte |
900 |
if ((0xFF & *inst) == VEX_3bytes) { |
|
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
901 |
vex_opcode = VEX_OPCODE_MASK & *ip; |
11427 | 902 |
ip++; // third byte |
903 |
is_64bit = ((VEX_W & *ip) == VEX_W); |
|
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
904 |
} else { |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
905 |
vex_opcode = VEX_OPCODE_0F; |
11427 | 906 |
} |
907 |
ip++; // opcode |
|
908 |
// To find the end of instruction (which == end_pc_operand). |
|
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
909 |
switch (vex_opcode) { |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
910 |
case VEX_OPCODE_0F: |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
911 |
switch (0xFF & *ip) { |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
912 |
case 0x70: // pshufd r, r/a, #8 |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
913 |
case 0x71: // ps[rl|ra|ll]w r, #8 |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
914 |
case 0x72: // ps[rl|ra|ll]d r, #8 |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
915 |
case 0x73: // ps[rl|ra|ll]q r, #8 |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
916 |
case 0xC2: // cmp[ps|pd|ss|sd] r, r, r/a, #8 |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
917 |
case 0xC4: // pinsrw r, r, r/a, #8 |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
918 |
case 0xC5: // pextrw r/a, r, #8 |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
919 |
case 0xC6: // shufp[s|d] r, r, r/a, #8 |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
920 |
tail_size = 1; // the imm8 |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
921 |
break; |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
922 |
} |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
923 |
break; |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
924 |
case VEX_OPCODE_0F_3A: |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
925 |
tail_size = 1; |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
926 |
break; |
11427 | 927 |
} |
928 |
ip++; // skip opcode |
|
929 |
debug_only(has_disp32 = true); // has both kinds of operands! |
|
930 |
break; |
|
1 | 931 |
|
30624 | 932 |
case 0x62: // EVEX_4bytes |
44518
46f88691d812
8178033: C1 crashes with -XX:UseAVX = 3: "not a mov [reg+offs], reg instruction"
thartmann
parents:
42552
diff
changeset
|
933 |
assert(VM_Version::supports_evex(), "shouldn't have EVEX prefix"); |
30624 | 934 |
assert(ip == inst+1, "no prefixes allowed"); |
935 |
// no EVEX collisions, all instructions that have 0x62 opcodes |
|
936 |
// have EVEX versions and are subopcodes of 0x66 |
|
937 |
ip++; // skip P0 and exmaine W in P1 |
|
938 |
is_64bit = ((VEX_W & *ip) == VEX_W); |
|
939 |
ip++; // move to P2 |
|
940 |
ip++; // skip P2, move to opcode |
|
941 |
// To find the end of instruction (which == end_pc_operand). |
|
942 |
switch (0xFF & *ip) { |
|
36555 | 943 |
case 0x22: // pinsrd r, r/a, #8 |
30624 | 944 |
case 0x61: // pcmpestri r, r/a, #8 |
945 |
case 0x70: // pshufd r, r/a, #8 |
|
946 |
case 0x73: // psrldq r, #8 |
|
947 |
tail_size = 1; // the imm8 |
|
948 |
break; |
|
949 |
default: |
|
950 |
break; |
|
951 |
} |
|
952 |
ip++; // skip opcode |
|
953 |
debug_only(has_disp32 = true); // has both kinds of operands! |
|
954 |
break; |
|
955 |
||
1 | 956 |
case 0xD1: // sal a, 1; sar a, 1; shl a, 1; shr a, 1 |
957 |
case 0xD3: // sal a, %cl; sar a, %cl; shl a, %cl; shr a, %cl |
|
958 |
case 0xD9: // fld_s a; fst_s a; fstp_s a; fldcw a |
|
959 |
case 0xDD: // fld_d a; fst_d a; fstp_d a |
|
960 |
case 0xDB: // fild_s a; fistp_s a; fld_x a; fstp_x a |
|
961 |
case 0xDF: // fild_d a; fistp_d a |
|
962 |
case 0xD8: // fadd_s a; fsubr_s a; fmul_s a; fdivr_s a; fcomp_s a |
|
963 |
case 0xDC: // fadd_d a; fsubr_d a; fmul_d a; fdivr_d a; fcomp_d a |
|
964 |
case 0xDE: // faddp_d a; fsubrp_d a; fmulp_d a; fdivrp_d a; fcompp_d a |
|
1066 | 965 |
debug_only(has_disp32 = true); |
1 | 966 |
break; |
967 |
||
11427 | 968 |
case 0xE8: // call rdisp32 |
969 |
case 0xE9: // jmp rdisp32 |
|
970 |
if (which == end_pc_operand) return ip + 4; |
|
971 |
assert(which == call32_operand, "call has no disp32 or imm"); |
|
972 |
return ip; |
|
973 |
||
1500
bea9a90f3e8f
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
1437
diff
changeset
|
974 |
case 0xF0: // Lock |
bea9a90f3e8f
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
1437
diff
changeset
|
975 |
goto again_after_prefix; |
bea9a90f3e8f
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
1437
diff
changeset
|
976 |
|
1 | 977 |
case 0xF3: // For SSE |
978 |
case 0xF2: // For SSE2 |
|
1066 | 979 |
switch (0xFF & *ip++) { |
980 |
case REX: |
|
981 |
case REX_B: |
|
982 |
case REX_X: |
|
983 |
case REX_XB: |
|
984 |
case REX_R: |
|
985 |
case REX_RB: |
|
986 |
case REX_RX: |
|
987 |
case REX_RXB: |
|
988 |
case REX_W: |
|
989 |
case REX_WB: |
|
990 |
case REX_WX: |
|
991 |
case REX_WXB: |
|
992 |
case REX_WR: |
|
993 |
case REX_WRB: |
|
994 |
case REX_WRX: |
|
995 |
case REX_WRXB: |
|
996 |
NOT_LP64(assert(false, "found 64bit prefix")); |
|
997 |
ip++; |
|
998 |
default: |
|
999 |
ip++; |
|
1000 |
} |
|
1001 |
debug_only(has_disp32 = true); // has both kinds of operands! |
|
1 | 1002 |
break; |
1003 |
||
1004 |
default: |
|
1005 |
ShouldNotReachHere(); |
|
1006 |
||
1066 | 1007 |
#undef REP8 |
1008 |
#undef REP16 |
|
1 | 1009 |
} |
1010 |
||
1011 |
assert(which != call32_operand, "instruction is not a call, jmp, or jcc"); |
|
1066 | 1012 |
#ifdef _LP64 |
1013 |
assert(which != imm_operand, "instruction is not a movq reg, imm64"); |
|
1014 |
#else |
|
1015 |
// assert(which != imm_operand || has_imm32, "instruction has no imm32 field"); |
|
1016 |
assert(which != imm_operand || has_disp32, "instruction has no imm32 field"); |
|
1017 |
#endif // LP64 |
|
1018 |
assert(which != disp32_operand || has_disp32, "instruction has no disp32 field"); |
|
1 | 1019 |
|
1020 |
// parse the output of emit_operand |
|
1021 |
int op2 = 0xFF & *ip++; |
|
1022 |
int base = op2 & 0x07; |
|
1023 |
int op3 = -1; |
|
1024 |
const int b100 = 4; |
|
1025 |
const int b101 = 5; |
|
1026 |
if (base == b100 && (op2 >> 6) != 3) { |
|
1027 |
op3 = 0xFF & *ip++; |
|
1028 |
base = op3 & 0x07; // refetch the base |
|
1029 |
} |
|
1030 |
// now ip points at the disp (if any) |
|
1031 |
||
1032 |
switch (op2 >> 6) { |
|
1033 |
case 0: |
|
1034 |
// [00 reg 100][ss index base] |
|
1066 | 1035 |
// [00 reg 100][00 100 esp] |
1 | 1036 |
// [00 reg base] |
1037 |
// [00 reg 100][ss index 101][disp32] |
|
1038 |
// [00 reg 101] [disp32] |
|
1039 |
||
1040 |
if (base == b101) { |
|
1041 |
if (which == disp32_operand) |
|
1042 |
return ip; // caller wants the disp32 |
|
1043 |
ip += 4; // skip the disp32 |
|
1044 |
} |
|
1045 |
break; |
|
1046 |
||
1047 |
case 1: |
|
1048 |
// [01 reg 100][ss index base][disp8] |
|
1066 | 1049 |
// [01 reg 100][00 100 esp][disp8] |
1 | 1050 |
// [01 reg base] [disp8] |
1051 |
ip += 1; // skip the disp8 |
|
1052 |
break; |
|
1053 |
||
1054 |
case 2: |
|
1055 |
// [10 reg 100][ss index base][disp32] |
|
1066 | 1056 |
// [10 reg 100][00 100 esp][disp32] |
1 | 1057 |
// [10 reg base] [disp32] |
1058 |
if (which == disp32_operand) |
|
1059 |
return ip; // caller wants the disp32 |
|
1060 |
ip += 4; // skip the disp32 |
|
1061 |
break; |
|
1062 |
||
1063 |
case 3: |
|
1064 |
// [11 reg base] (not a memory addressing mode) |
|
1065 |
break; |
|
1066 |
} |
|
1067 |
||
1068 |
if (which == end_pc_operand) { |
|
1069 |
return ip + tail_size; |
|
1070 |
} |
|
1071 |
||
1066 | 1072 |
#ifdef _LP64 |
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
1073 |
assert(which == narrow_oop_operand && !is_64bit, "instruction is not a movl adr, imm32"); |
1066 | 1074 |
#else |
1075 |
assert(which == imm_operand, "instruction has only an imm field"); |
|
1076 |
#endif // LP64 |
|
1 | 1077 |
return ip; |
1078 |
} |
|
1079 |
||
1080 |
address Assembler::locate_next_instruction(address inst) { |
|
1081 |
// Secretly share code with locate_operand: |
|
1082 |
return locate_operand(inst, end_pc_operand); |
|
1083 |
} |
|
1084 |
||
1085 |
||
1086 |
#ifdef ASSERT |
|
1087 |
void Assembler::check_relocation(RelocationHolder const& rspec, int format) { |
|
1088 |
address inst = inst_mark(); |
|
1089 |
assert(inst != NULL && inst < pc(), "must point to beginning of instruction"); |
|
1090 |
address opnd; |
|
1091 |
||
1092 |
Relocation* r = rspec.reloc(); |
|
1093 |
if (r->type() == relocInfo::none) { |
|
1094 |
return; |
|
1095 |
} else if (r->is_call() || format == call32_operand) { |
|
1096 |
// assert(format == imm32_operand, "cannot specify a nonzero format"); |
|
1097 |
opnd = locate_operand(inst, call32_operand); |
|
1098 |
} else if (r->is_data()) { |
|
1066 | 1099 |
assert(format == imm_operand || format == disp32_operand |
1100 |
LP64_ONLY(|| format == narrow_oop_operand), "format ok"); |
|
1 | 1101 |
opnd = locate_operand(inst, (WhichOperand)format); |
1102 |
} else { |
|
1066 | 1103 |
assert(format == imm_operand, "cannot specify a format"); |
1 | 1104 |
return; |
1105 |
} |
|
1106 |
assert(opnd == pc(), "must put operand where relocs can find it"); |
|
1107 |
} |
|
1066 | 1108 |
#endif // ASSERT |
1109 |
||
1110 |
void Assembler::emit_operand32(Register reg, Address adr) { |
|
1111 |
assert(reg->encoding() < 8, "no extended registers"); |
|
1112 |
assert(!adr.base_needs_rex() && !adr.index_needs_rex(), "no extended registers"); |
|
1113 |
emit_operand(reg, adr._base, adr._index, adr._scale, adr._disp, |
|
1114 |
adr._rspec); |
|
1115 |
} |
|
1116 |
||
1117 |
void Assembler::emit_operand(Register reg, Address adr, |
|
1118 |
int rip_relative_correction) { |
|
1119 |
emit_operand(reg, adr._base, adr._index, adr._scale, adr._disp, |
|
1120 |
adr._rspec, |
|
1121 |
rip_relative_correction); |
|
1122 |
} |
|
1123 |
||
1124 |
void Assembler::emit_operand(XMMRegister reg, Address adr) { |
|
50860
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
1125 |
if (adr.isxmmindex()) { |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
1126 |
emit_operand(reg, adr._base, adr._xmmindex, adr._scale, adr._disp, adr._rspec); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
1127 |
} else { |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
1128 |
emit_operand(reg, adr._base, adr._index, adr._scale, adr._disp, |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
1129 |
adr._rspec); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
1130 |
} |
1066 | 1131 |
} |
1132 |
||
1133 |
// MMX operations |
|
1134 |
void Assembler::emit_operand(MMXRegister reg, Address adr) { |
|
1135 |
assert(!adr.base_needs_rex() && !adr.index_needs_rex(), "no extended registers"); |
|
1136 |
emit_operand((Register)reg, adr._base, adr._index, adr._scale, adr._disp, adr._rspec); |
|
1137 |
} |
|
1138 |
||
1139 |
// work around gcc (3.2.1-7a) bug |
|
1140 |
void Assembler::emit_operand(Address adr, MMXRegister reg) { |
|
1141 |
assert(!adr.base_needs_rex() && !adr.index_needs_rex(), "no extended registers"); |
|
1142 |
emit_operand((Register)reg, adr._base, adr._index, adr._scale, adr._disp, adr._rspec); |
|
1 | 1143 |
} |
1144 |
||
1145 |
||
1146 |
void Assembler::emit_farith(int b1, int b2, int i) { |
|
1147 |
assert(isByte(b1) && isByte(b2), "wrong opcode"); |
|
1148 |
assert(0 <= i && i < 8, "illegal stack offset"); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1149 |
emit_int8(b1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1150 |
emit_int8(b2 + i); |
1 | 1151 |
} |
1152 |
||
1153 |
||
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
1154 |
// Now the Assembler instructions (identical for 32/64 bits) |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
1155 |
|
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
1156 |
void Assembler::adcl(Address dst, int32_t imm32) { |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
1157 |
InstructionMark im(this); |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
1158 |
prefix(dst); |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
1159 |
emit_arith_operand(0x81, rdx, dst, imm32); |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
1160 |
} |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
1161 |
|
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
1162 |
void Assembler::adcl(Address dst, Register src) { |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
1163 |
InstructionMark im(this); |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
1164 |
prefix(dst, src); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1165 |
emit_int8(0x11); |
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
1166 |
emit_operand(src, dst); |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
1167 |
} |
1066 | 1168 |
|
1169 |
void Assembler::adcl(Register dst, int32_t imm32) { |
|
1170 |
prefix(dst); |
|
1 | 1171 |
emit_arith(0x81, 0xD0, dst, imm32); |
1172 |
} |
|
1173 |
||
1174 |
void Assembler::adcl(Register dst, Address src) { |
|
1175 |
InstructionMark im(this); |
|
1066 | 1176 |
prefix(src, dst); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1177 |
emit_int8(0x13); |
1 | 1178 |
emit_operand(dst, src); |
1179 |
} |
|
1180 |
||
1181 |
void Assembler::adcl(Register dst, Register src) { |
|
1066 | 1182 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
1 | 1183 |
emit_arith(0x13, 0xC0, dst, src); |
1184 |
} |
|
1185 |
||
1066 | 1186 |
void Assembler::addl(Address dst, int32_t imm32) { |
1187 |
InstructionMark im(this); |
|
1188 |
prefix(dst); |
|
1189 |
emit_arith_operand(0x81, rax, dst, imm32); |
|
1190 |
} |
|
1 | 1191 |
|
39419
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
1192 |
void Assembler::addb(Address dst, int imm8) { |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
1193 |
InstructionMark im(this); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
1194 |
prefix(dst); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
1195 |
emit_int8((unsigned char)0x80); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
1196 |
emit_operand(rax, dst, 1); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
1197 |
emit_int8(imm8); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
1198 |
} |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
1199 |
|
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
1200 |
void Assembler::addw(Address dst, int imm16) { |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
1201 |
InstructionMark im(this); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
1202 |
emit_int8(0x66); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
1203 |
prefix(dst); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
1204 |
emit_int8((unsigned char)0x81); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
1205 |
emit_operand(rax, dst, 2); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
1206 |
emit_int16(imm16); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
1207 |
} |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
1208 |
|
1 | 1209 |
void Assembler::addl(Address dst, Register src) { |
1210 |
InstructionMark im(this); |
|
1066 | 1211 |
prefix(dst, src); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1212 |
emit_int8(0x01); |
1 | 1213 |
emit_operand(src, dst); |
1214 |
} |
|
1215 |
||
1066 | 1216 |
void Assembler::addl(Register dst, int32_t imm32) { |
1217 |
prefix(dst); |
|
1 | 1218 |
emit_arith(0x81, 0xC0, dst, imm32); |
1219 |
} |
|
1220 |
||
1221 |
void Assembler::addl(Register dst, Address src) { |
|
1222 |
InstructionMark im(this); |
|
1066 | 1223 |
prefix(src, dst); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1224 |
emit_int8(0x03); |
1 | 1225 |
emit_operand(dst, src); |
1226 |
} |
|
1227 |
||
1228 |
void Assembler::addl(Register dst, Register src) { |
|
1066 | 1229 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
1 | 1230 |
emit_arith(0x03, 0xC0, dst, src); |
1231 |
} |
|
1232 |
||
1233 |
void Assembler::addr_nop_4() { |
|
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
1234 |
assert(UseAddressNop, "no CPU support"); |
1 | 1235 |
// 4 bytes: NOP DWORD PTR [EAX+0] |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1236 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1237 |
emit_int8(0x1F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1238 |
emit_int8(0x40); // emit_rm(cbuf, 0x1, EAX_enc, EAX_enc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1239 |
emit_int8(0); // 8-bits offset (1 byte) |
1 | 1240 |
} |
1241 |
||
1242 |
void Assembler::addr_nop_5() { |
|
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
1243 |
assert(UseAddressNop, "no CPU support"); |
1 | 1244 |
// 5 bytes: NOP DWORD PTR [EAX+EAX*0+0] 8-bits offset |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1245 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1246 |
emit_int8(0x1F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1247 |
emit_int8(0x44); // emit_rm(cbuf, 0x1, EAX_enc, 0x4); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1248 |
emit_int8(0x00); // emit_rm(cbuf, 0x0, EAX_enc, EAX_enc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1249 |
emit_int8(0); // 8-bits offset (1 byte) |
1 | 1250 |
} |
1251 |
||
1252 |
void Assembler::addr_nop_7() { |
|
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
1253 |
assert(UseAddressNop, "no CPU support"); |
1 | 1254 |
// 7 bytes: NOP DWORD PTR [EAX+0] 32-bits offset |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1255 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1256 |
emit_int8(0x1F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1257 |
emit_int8((unsigned char)0x80); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1258 |
// emit_rm(cbuf, 0x2, EAX_enc, EAX_enc); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
1259 |
emit_int32(0); // 32-bits offset (4 bytes) |
1 | 1260 |
} |
1261 |
||
1262 |
void Assembler::addr_nop_8() { |
|
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
1263 |
assert(UseAddressNop, "no CPU support"); |
1 | 1264 |
// 8 bytes: NOP DWORD PTR [EAX+EAX*0+0] 32-bits offset |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1265 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1266 |
emit_int8(0x1F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1267 |
emit_int8((unsigned char)0x84); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1268 |
// emit_rm(cbuf, 0x2, EAX_enc, 0x4); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1269 |
emit_int8(0x00); // emit_rm(cbuf, 0x0, EAX_enc, EAX_enc); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
1270 |
emit_int32(0); // 32-bits offset (4 bytes) |
1 | 1271 |
} |
1272 |
||
1066 | 1273 |
void Assembler::addsd(XMMRegister dst, XMMRegister src) { |
1274 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1275 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
38049 | 1276 |
attributes.set_rex_vex_w_reverted(); |
34162 | 1277 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
1278 |
emit_int8(0x58); |
|
1279 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 1280 |
} |
1281 |
||
1282 |
void Assembler::addsd(XMMRegister dst, Address src) { |
|
1283 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1284 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1285 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1286 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
38049 | 1287 |
attributes.set_rex_vex_w_reverted(); |
34162 | 1288 |
simd_prefix(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
1289 |
emit_int8(0x58); |
|
1290 |
emit_operand(dst, src); |
|
1066 | 1291 |
} |
1292 |
||
1293 |
void Assembler::addss(XMMRegister dst, XMMRegister src) { |
|
1294 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1295 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1296 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
1297 |
emit_int8(0x58); |
|
1298 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 1299 |
} |
1300 |
||
1301 |
void Assembler::addss(XMMRegister dst, Address src) { |
|
1302 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 1303 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1304 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1305 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
1306 |
simd_prefix(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
1307 |
emit_int8(0x58); |
|
1308 |
emit_operand(dst, src); |
|
1066 | 1309 |
} |
1310 |
||
14132 | 1311 |
void Assembler::aesdec(XMMRegister dst, Address src) { |
1312 |
assert(VM_Version::supports_aes(), ""); |
|
1313 |
InstructionMark im(this); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1314 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1315 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1316 |
emit_int8((unsigned char)0xDE); |
14132 | 1317 |
emit_operand(dst, src); |
1318 |
} |
|
1319 |
||
1320 |
void Assembler::aesdec(XMMRegister dst, XMMRegister src) { |
|
1321 |
assert(VM_Version::supports_aes(), ""); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1322 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1323 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1324 |
emit_int8((unsigned char)0xDE); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1325 |
emit_int8(0xC0 | encode); |
14132 | 1326 |
} |
1327 |
||
50699
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
1328 |
void Assembler::vaesdec(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
1329 |
assert(VM_Version::supports_vaes(), ""); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
1330 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
1331 |
attributes.set_is_evex_instruction(); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
1332 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
1333 |
emit_int8((unsigned char)0xDE); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
1334 |
emit_int8((unsigned char)(0xC0 | encode)); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
1335 |
} |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
1336 |
|
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
1337 |
|
14132 | 1338 |
void Assembler::aesdeclast(XMMRegister dst, Address src) { |
1339 |
assert(VM_Version::supports_aes(), ""); |
|
1340 |
InstructionMark im(this); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1341 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1342 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1343 |
emit_int8((unsigned char)0xDF); |
14132 | 1344 |
emit_operand(dst, src); |
1345 |
} |
|
1346 |
||
1347 |
void Assembler::aesdeclast(XMMRegister dst, XMMRegister src) { |
|
1348 |
assert(VM_Version::supports_aes(), ""); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1349 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1350 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1351 |
emit_int8((unsigned char)0xDF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1352 |
emit_int8((unsigned char)(0xC0 | encode)); |
14132 | 1353 |
} |
1354 |
||
50699
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
1355 |
void Assembler::vaesdeclast(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
1356 |
assert(VM_Version::supports_vaes(), ""); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
1357 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
1358 |
attributes.set_is_evex_instruction(); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
1359 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
1360 |
emit_int8((unsigned char)0xDF); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
1361 |
emit_int8((unsigned char)(0xC0 | encode)); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
1362 |
} |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
1363 |
|
14132 | 1364 |
void Assembler::aesenc(XMMRegister dst, Address src) { |
1365 |
assert(VM_Version::supports_aes(), ""); |
|
1366 |
InstructionMark im(this); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1367 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1368 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1369 |
emit_int8((unsigned char)0xDC); |
14132 | 1370 |
emit_operand(dst, src); |
1371 |
} |
|
1372 |
||
1373 |
void Assembler::aesenc(XMMRegister dst, XMMRegister src) { |
|
1374 |
assert(VM_Version::supports_aes(), ""); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1375 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1376 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1377 |
emit_int8((unsigned char)0xDC); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1378 |
emit_int8(0xC0 | encode); |
14132 | 1379 |
} |
1380 |
||
1381 |
void Assembler::aesenclast(XMMRegister dst, Address src) { |
|
1382 |
assert(VM_Version::supports_aes(), ""); |
|
1383 |
InstructionMark im(this); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1384 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1385 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1386 |
emit_int8((unsigned char)0xDD); |
14132 | 1387 |
emit_operand(dst, src); |
1388 |
} |
|
1389 |
||
1390 |
void Assembler::aesenclast(XMMRegister dst, XMMRegister src) { |
|
1391 |
assert(VM_Version::supports_aes(), ""); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1392 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1393 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1394 |
emit_int8((unsigned char)0xDD); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1395 |
emit_int8((unsigned char)(0xC0 | encode)); |
14132 | 1396 |
} |
1397 |
||
11427 | 1398 |
void Assembler::andl(Address dst, int32_t imm32) { |
1399 |
InstructionMark im(this); |
|
1400 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1401 |
emit_int8((unsigned char)0x81); |
11427 | 1402 |
emit_operand(rsp, dst, 4); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
1403 |
emit_int32(imm32); |
11427 | 1404 |
} |
1405 |
||
1066 | 1406 |
void Assembler::andl(Register dst, int32_t imm32) { |
1407 |
prefix(dst); |
|
1408 |
emit_arith(0x81, 0xE0, dst, imm32); |
|
1409 |
} |
|
1410 |
||
1411 |
void Assembler::andl(Register dst, Address src) { |
|
1412 |
InstructionMark im(this); |
|
1413 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1414 |
emit_int8(0x23); |
1066 | 1415 |
emit_operand(dst, src); |
1416 |
} |
|
1417 |
||
1418 |
void Assembler::andl(Register dst, Register src) { |
|
1419 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
|
1420 |
emit_arith(0x23, 0xC0, dst, src); |
|
1421 |
} |
|
1422 |
||
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1423 |
void Assembler::andnl(Register dst, Register src1, Register src2) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1424 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1425 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1426 |
int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_38, &attributes); |
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1427 |
emit_int8((unsigned char)0xF2); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1428 |
emit_int8((unsigned char)(0xC0 | encode)); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1429 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1430 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1431 |
void Assembler::andnl(Register dst, Register src1, Address src2) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1432 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 1433 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1434 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1435 |
vex_prefix(src2, src1->encoding(), dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_38, &attributes); |
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1436 |
emit_int8((unsigned char)0xF2); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1437 |
emit_operand(dst, src2); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1438 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1439 |
|
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1440 |
void Assembler::bsfl(Register dst, Register src) { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1441 |
int encode = prefix_and_encode(dst->encoding(), src->encoding()); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1442 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1443 |
emit_int8((unsigned char)0xBC); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1444 |
emit_int8((unsigned char)(0xC0 | encode)); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1445 |
} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1446 |
|
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1447 |
void Assembler::bsrl(Register dst, Register src) { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1448 |
int encode = prefix_and_encode(dst->encoding(), src->encoding()); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1449 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1450 |
emit_int8((unsigned char)0xBD); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1451 |
emit_int8((unsigned char)(0xC0 | encode)); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1452 |
} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1453 |
|
1066 | 1454 |
void Assembler::bswapl(Register reg) { // bswap |
1455 |
int encode = prefix_and_encode(reg->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1456 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1457 |
emit_int8((unsigned char)(0xC8 | encode)); |
1066 | 1458 |
} |
1459 |
||
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1460 |
void Assembler::blsil(Register dst, Register src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1461 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1462 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1463 |
int encode = vex_prefix_and_encode(rbx->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_38, &attributes); |
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1464 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1465 |
emit_int8((unsigned char)(0xC0 | encode)); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1466 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1467 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1468 |
void Assembler::blsil(Register dst, Address src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1469 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 1470 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1471 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1472 |
vex_prefix(src, dst->encoding(), rbx->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_38, &attributes); |
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1473 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1474 |
emit_operand(rbx, src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1475 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1476 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1477 |
void Assembler::blsmskl(Register dst, Register src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1478 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1479 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1480 |
int encode = vex_prefix_and_encode(rdx->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_38, &attributes); |
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1481 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1482 |
emit_int8((unsigned char)(0xC0 | encode)); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1483 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1484 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1485 |
void Assembler::blsmskl(Register dst, Address src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1486 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 1487 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1488 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1489 |
vex_prefix(src, dst->encoding(), rdx->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_38, &attributes); |
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1490 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1491 |
emit_operand(rdx, src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1492 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1493 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1494 |
void Assembler::blsrl(Register dst, Register src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1495 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1496 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1497 |
int encode = vex_prefix_and_encode(rcx->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_38, &attributes); |
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1498 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1499 |
emit_int8((unsigned char)(0xC0 | encode)); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1500 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1501 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1502 |
void Assembler::blsrl(Register dst, Address src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1503 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 1504 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1505 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1506 |
vex_prefix(src, dst->encoding(), rcx->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_38, &attributes); |
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1507 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1508 |
emit_operand(rcx, src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1509 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1510 |
|
1066 | 1511 |
void Assembler::call(Label& L, relocInfo::relocType rtype) { |
1512 |
// suspect disp32 is always good |
|
1513 |
int operand = LP64_ONLY(disp32_operand) NOT_LP64(imm_operand); |
|
1514 |
||
1515 |
if (L.is_bound()) { |
|
1516 |
const int long_size = 5; |
|
1517 |
int offs = (int)( target(L) - pc() ); |
|
1518 |
assert(offs <= 0, "assembler error"); |
|
1519 |
InstructionMark im(this); |
|
1520 |
// 1110 1000 #32-bit disp |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1521 |
emit_int8((unsigned char)0xE8); |
1066 | 1522 |
emit_data(offs - long_size, rtype, operand); |
1523 |
} else { |
|
1524 |
InstructionMark im(this); |
|
1525 |
// 1110 1000 #32-bit disp |
|
1526 |
L.add_patch_at(code(), locator()); |
|
1527 |
||
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1528 |
emit_int8((unsigned char)0xE8); |
1066 | 1529 |
emit_data(int(0), rtype, operand); |
1530 |
} |
|
1531 |
} |
|
1532 |
||
1533 |
void Assembler::call(Register dst) { |
|
11427 | 1534 |
int encode = prefix_and_encode(dst->encoding()); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1535 |
emit_int8((unsigned char)0xFF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1536 |
emit_int8((unsigned char)(0xD0 | encode)); |
1066 | 1537 |
} |
1538 |
||
1539 |
||
1540 |
void Assembler::call(Address adr) { |
|
1541 |
InstructionMark im(this); |
|
1542 |
prefix(adr); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1543 |
emit_int8((unsigned char)0xFF); |
1066 | 1544 |
emit_operand(rdx, adr); |
1545 |
} |
|
1546 |
||
1547 |
void Assembler::call_literal(address entry, RelocationHolder const& rspec) { |
|
1548 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1549 |
emit_int8((unsigned char)0xE8); |
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
1550 |
intptr_t disp = entry - (pc() + sizeof(int32_t)); |
48807
fd8ccb37fce9
8195776: [x86,sparc] A row of minor fixes and enhancements.
goetz
parents:
48489
diff
changeset
|
1551 |
// Entry is NULL in case of a scratch emit. |
fd8ccb37fce9
8195776: [x86,sparc] A row of minor fixes and enhancements.
goetz
parents:
48489
diff
changeset
|
1552 |
assert(entry == NULL || is_simm32(disp), "disp=" INTPTR_FORMAT " must be 32bit offset (call2)", disp); |
1066 | 1553 |
// Technically, should use call32_operand, but this format is |
1554 |
// implied by the fact that we're emitting a call instruction. |
|
1555 |
||
1556 |
int operand = LP64_ONLY(disp32_operand) NOT_LP64(call32_operand); |
|
1557 |
emit_data((int) disp, rspec, operand); |
|
1558 |
} |
|
1559 |
||
1560 |
void Assembler::cdql() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1561 |
emit_int8((unsigned char)0x99); |
1066 | 1562 |
} |
1563 |
||
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1564 |
void Assembler::cld() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1565 |
emit_int8((unsigned char)0xFC); |
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1566 |
} |
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1567 |
|
1066 | 1568 |
void Assembler::cmovl(Condition cc, Register dst, Register src) { |
1569 |
NOT_LP64(guarantee(VM_Version::supports_cmov(), "illegal instruction")); |
|
1570 |
int encode = prefix_and_encode(dst->encoding(), src->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1571 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1572 |
emit_int8(0x40 | cc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1573 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1574 |
} |
1575 |
||
1576 |
||
1577 |
void Assembler::cmovl(Condition cc, Register dst, Address src) { |
|
1578 |
NOT_LP64(guarantee(VM_Version::supports_cmov(), "illegal instruction")); |
|
1579 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1580 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1581 |
emit_int8(0x40 | cc); |
1066 | 1582 |
emit_operand(dst, src); |
1583 |
} |
|
1584 |
||
1585 |
void Assembler::cmpb(Address dst, int imm8) { |
|
1586 |
InstructionMark im(this); |
|
1587 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1588 |
emit_int8((unsigned char)0x80); |
1066 | 1589 |
emit_operand(rdi, dst, 1); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1590 |
emit_int8(imm8); |
1066 | 1591 |
} |
1592 |
||
1593 |
void Assembler::cmpl(Address dst, int32_t imm32) { |
|
1594 |
InstructionMark im(this); |
|
1595 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1596 |
emit_int8((unsigned char)0x81); |
1066 | 1597 |
emit_operand(rdi, dst, 4); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
1598 |
emit_int32(imm32); |
1066 | 1599 |
} |
1600 |
||
1601 |
void Assembler::cmpl(Register dst, int32_t imm32) { |
|
1602 |
prefix(dst); |
|
1603 |
emit_arith(0x81, 0xF8, dst, imm32); |
|
1604 |
} |
|
1605 |
||
1606 |
void Assembler::cmpl(Register dst, Register src) { |
|
1607 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
|
1608 |
emit_arith(0x3B, 0xC0, dst, src); |
|
1609 |
} |
|
1610 |
||
1611 |
void Assembler::cmpl(Register dst, Address src) { |
|
1612 |
InstructionMark im(this); |
|
1613 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1614 |
emit_int8((unsigned char)0x3B); |
1066 | 1615 |
emit_operand(dst, src); |
1616 |
} |
|
1617 |
||
1618 |
void Assembler::cmpw(Address dst, int imm16) { |
|
1619 |
InstructionMark im(this); |
|
1620 |
assert(!dst.base_needs_rex() && !dst.index_needs_rex(), "no extended registers"); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1621 |
emit_int8(0x66); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1622 |
emit_int8((unsigned char)0x81); |
1066 | 1623 |
emit_operand(rdi, dst, 2); |
14831
84828ee2a91c
8004536: replace AbstractAssembler emit_word with emit_int16
twisti
parents:
14626
diff
changeset
|
1624 |
emit_int16(imm16); |
1066 | 1625 |
} |
1626 |
||
1627 |
// The 32-bit cmpxchg compares the value at adr with the contents of rax, |
|
1628 |
// and stores reg into adr if so; otherwise, the value at adr is loaded into rax,. |
|
1629 |
// The ZF is set if the compared values were equal, and cleared otherwise. |
|
1630 |
void Assembler::cmpxchgl(Register reg, Address adr) { // cmpxchg |
|
13955 | 1631 |
InstructionMark im(this); |
1632 |
prefix(adr, reg); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1633 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1634 |
emit_int8((unsigned char)0xB1); |
13955 | 1635 |
emit_operand(reg, adr); |
1066 | 1636 |
} |
1637 |
||
27691
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
26434
diff
changeset
|
1638 |
// The 8-bit cmpxchg compares the value at adr with the contents of rax, |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
26434
diff
changeset
|
1639 |
// and stores reg into adr if so; otherwise, the value at adr is loaded into rax,. |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
26434
diff
changeset
|
1640 |
// The ZF is set if the compared values were equal, and cleared otherwise. |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
26434
diff
changeset
|
1641 |
void Assembler::cmpxchgb(Register reg, Address adr) { // cmpxchg |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
26434
diff
changeset
|
1642 |
InstructionMark im(this); |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
26434
diff
changeset
|
1643 |
prefix(adr, reg, true); |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
26434
diff
changeset
|
1644 |
emit_int8(0x0F); |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
26434
diff
changeset
|
1645 |
emit_int8((unsigned char)0xB0); |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
26434
diff
changeset
|
1646 |
emit_operand(reg, adr); |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
26434
diff
changeset
|
1647 |
} |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
26434
diff
changeset
|
1648 |
|
1066 | 1649 |
void Assembler::comisd(XMMRegister dst, Address src) { |
1650 |
// NOTE: dbx seems to decode this as comiss even though the |
|
1651 |
// 0x66 is there. Strangly ucomisd comes out correct |
|
1652 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1653 |
InstructionMark im(this); |
1654 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);; |
|
1655 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
38049 | 1656 |
attributes.set_rex_vex_w_reverted(); |
34162 | 1657 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
1658 |
emit_int8(0x2F); |
|
1659 |
emit_operand(dst, src); |
|
11427 | 1660 |
} |
1661 |
||
1662 |
void Assembler::comisd(XMMRegister dst, XMMRegister src) { |
|
1663 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1664 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
38049 | 1665 |
attributes.set_rex_vex_w_reverted(); |
34162 | 1666 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
1667 |
emit_int8(0x2F); |
|
1668 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 1669 |
} |
1670 |
||
1671 |
void Assembler::comiss(XMMRegister dst, Address src) { |
|
1672 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 1673 |
InstructionMark im(this); |
1674 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
1675 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
1676 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
1677 |
emit_int8(0x2F); |
|
1678 |
emit_operand(dst, src); |
|
1066 | 1679 |
} |
1680 |
||
11427 | 1681 |
void Assembler::comiss(XMMRegister dst, XMMRegister src) { |
1682 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 1683 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
1684 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
1685 |
emit_int8(0x2F); |
|
1686 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
11427 | 1687 |
} |
1688 |
||
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1689 |
void Assembler::cpuid() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1690 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1691 |
emit_int8((unsigned char)0xA2); |
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1692 |
} |
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1693 |
|
33066 | 1694 |
// Opcode / Instruction Op / En 64 - Bit Mode Compat / Leg Mode Description Implemented |
1695 |
// F2 0F 38 F0 / r CRC32 r32, r / m8 RM Valid Valid Accumulate CRC32 on r / m8. v |
|
1696 |
// F2 REX 0F 38 F0 / r CRC32 r32, r / m8* RM Valid N.E. Accumulate CRC32 on r / m8. - |
|
1697 |
// F2 REX.W 0F 38 F0 / r CRC32 r64, r / m8 RM Valid N.E. Accumulate CRC32 on r / m8. - |
|
1698 |
// |
|
1699 |
// F2 0F 38 F1 / r CRC32 r32, r / m16 RM Valid Valid Accumulate CRC32 on r / m16. v |
|
1700 |
// |
|
1701 |
// F2 0F 38 F1 / r CRC32 r32, r / m32 RM Valid Valid Accumulate CRC32 on r / m32. v |
|
1702 |
// |
|
1703 |
// F2 REX.W 0F 38 F1 / r CRC32 r64, r / m64 RM Valid N.E. Accumulate CRC32 on r / m64. v |
|
1704 |
void Assembler::crc32(Register crc, Register v, int8_t sizeInBytes) { |
|
1705 |
assert(VM_Version::supports_sse4_2(), ""); |
|
1706 |
int8_t w = 0x01; |
|
1707 |
Prefix p = Prefix_EMPTY; |
|
1708 |
||
1709 |
emit_int8((int8_t)0xF2); |
|
1710 |
switch (sizeInBytes) { |
|
1711 |
case 1: |
|
1712 |
w = 0; |
|
1713 |
break; |
|
1714 |
case 2: |
|
1715 |
case 4: |
|
1716 |
break; |
|
1717 |
LP64_ONLY(case 8:) |
|
1718 |
// This instruction is not valid in 32 bits |
|
1719 |
// Note: |
|
1720 |
// http://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf |
|
1721 |
// |
|
1722 |
// Page B - 72 Vol. 2C says |
|
1723 |
// qwreg2 to qwreg 1111 0010 : 0100 1R0B : 0000 1111 : 0011 1000 : 1111 0000 : 11 qwreg1 qwreg2 |
|
1724 |
// mem64 to qwreg 1111 0010 : 0100 1R0B : 0000 1111 : 0011 1000 : 1111 0000 : mod qwreg r / m |
|
1725 |
// F0!!! |
|
1726 |
// while 3 - 208 Vol. 2A |
|
1727 |
// F2 REX.W 0F 38 F1 / r CRC32 r64, r / m64 RM Valid N.E.Accumulate CRC32 on r / m64. |
|
1728 |
// |
|
1729 |
// the 0 on a last bit is reserved for a different flavor of this instruction : |
|
1730 |
// F2 REX.W 0F 38 F0 / r CRC32 r64, r / m8 RM Valid N.E.Accumulate CRC32 on r / m8. |
|
1731 |
p = REX_W; |
|
1732 |
break; |
|
1733 |
default: |
|
1734 |
assert(0, "Unsupported value for a sizeInBytes argument"); |
|
1735 |
break; |
|
1736 |
} |
|
1737 |
LP64_ONLY(prefix(crc, v, p);) |
|
1738 |
emit_int8((int8_t)0x0F); |
|
1739 |
emit_int8(0x38); |
|
1740 |
emit_int8((int8_t)(0xF0 | w)); |
|
1741 |
emit_int8(0xC0 | ((crc->encoding() & 0x7) << 3) | (v->encoding() & 7)); |
|
1742 |
} |
|
1743 |
||
1744 |
void Assembler::crc32(Register crc, Address adr, int8_t sizeInBytes) { |
|
1745 |
assert(VM_Version::supports_sse4_2(), ""); |
|
1746 |
InstructionMark im(this); |
|
1747 |
int8_t w = 0x01; |
|
1748 |
Prefix p = Prefix_EMPTY; |
|
1749 |
||
1750 |
emit_int8((int8_t)0xF2); |
|
1751 |
switch (sizeInBytes) { |
|
1752 |
case 1: |
|
1753 |
w = 0; |
|
1754 |
break; |
|
1755 |
case 2: |
|
1756 |
case 4: |
|
1757 |
break; |
|
1758 |
LP64_ONLY(case 8:) |
|
1759 |
// This instruction is not valid in 32 bits |
|
1760 |
p = REX_W; |
|
1761 |
break; |
|
1762 |
default: |
|
1763 |
assert(0, "Unsupported value for a sizeInBytes argument"); |
|
1764 |
break; |
|
1765 |
} |
|
1766 |
LP64_ONLY(prefix(crc, adr, p);) |
|
1767 |
emit_int8((int8_t)0x0F); |
|
1768 |
emit_int8(0x38); |
|
1769 |
emit_int8((int8_t)(0xF0 | w)); |
|
1770 |
emit_operand(crc, adr); |
|
1771 |
} |
|
1772 |
||
1066 | 1773 |
void Assembler::cvtdq2pd(XMMRegister dst, XMMRegister src) { |
1774 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
1775 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 1776 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
1777 |
emit_int8((unsigned char)0xE6); |
|
1778 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 1779 |
} |
1780 |
||
1781 |
void Assembler::cvtdq2ps(XMMRegister dst, XMMRegister src) { |
|
1782 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
1783 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 1784 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
1785 |
emit_int8(0x5B); |
|
1786 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 1787 |
} |
1788 |
||
1789 |
void Assembler::cvtsd2ss(XMMRegister dst, XMMRegister src) { |
|
1790 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1791 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
38049 | 1792 |
attributes.set_rex_vex_w_reverted(); |
34162 | 1793 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
1794 |
emit_int8(0x5A); |
|
1795 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 1796 |
} |
1797 |
||
11427 | 1798 |
void Assembler::cvtsd2ss(XMMRegister dst, Address src) { |
1799 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1800 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1801 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1802 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
38049 | 1803 |
attributes.set_rex_vex_w_reverted(); |
34162 | 1804 |
simd_prefix(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
1805 |
emit_int8(0x5A); |
|
1806 |
emit_operand(dst, src); |
|
11427 | 1807 |
} |
1808 |
||
1066 | 1809 |
void Assembler::cvtsi2sdl(XMMRegister dst, Register src) { |
1810 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1811 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
1812 |
int encode = simd_prefix_and_encode(dst, dst, as_XMMRegister(src->encoding()), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1813 |
emit_int8(0x2A); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1814 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1815 |
} |
1816 |
||
11427 | 1817 |
void Assembler::cvtsi2sdl(XMMRegister dst, Address src) { |
1818 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1819 |
InstructionMark im(this); |
1820 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
1821 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
1822 |
simd_prefix(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
1823 |
emit_int8(0x2A); |
|
1824 |
emit_operand(dst, src); |
|
11427 | 1825 |
} |
1826 |
||
1066 | 1827 |
void Assembler::cvtsi2ssl(XMMRegister dst, Register src) { |
1828 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 1829 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
1830 |
int encode = simd_prefix_and_encode(dst, dst, as_XMMRegister(src->encoding()), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1831 |
emit_int8(0x2A); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1832 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1833 |
} |
1834 |
||
11427 | 1835 |
void Assembler::cvtsi2ssl(XMMRegister dst, Address src) { |
1836 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 1837 |
InstructionMark im(this); |
1838 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
1839 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
1840 |
simd_prefix(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
1841 |
emit_int8(0x2A); |
|
1842 |
emit_operand(dst, src); |
|
11427 | 1843 |
} |
1844 |
||
32391
01e2f5e916c7
8076373: In 32-bit VM interpreter and compiled code process NaN values differently
zmajo
parents:
31410
diff
changeset
|
1845 |
void Assembler::cvtsi2ssq(XMMRegister dst, Register src) { |
01e2f5e916c7
8076373: In 32-bit VM interpreter and compiled code process NaN values differently
zmajo
parents:
31410
diff
changeset
|
1846 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
34162 | 1847 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
1848 |
int encode = simd_prefix_and_encode(dst, dst, as_XMMRegister(src->encoding()), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
32391
01e2f5e916c7
8076373: In 32-bit VM interpreter and compiled code process NaN values differently
zmajo
parents:
31410
diff
changeset
|
1849 |
emit_int8(0x2A); |
01e2f5e916c7
8076373: In 32-bit VM interpreter and compiled code process NaN values differently
zmajo
parents:
31410
diff
changeset
|
1850 |
emit_int8((unsigned char)(0xC0 | encode)); |
01e2f5e916c7
8076373: In 32-bit VM interpreter and compiled code process NaN values differently
zmajo
parents:
31410
diff
changeset
|
1851 |
} |
01e2f5e916c7
8076373: In 32-bit VM interpreter and compiled code process NaN values differently
zmajo
parents:
31410
diff
changeset
|
1852 |
|
1066 | 1853 |
void Assembler::cvtss2sd(XMMRegister dst, XMMRegister src) { |
1854 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1855 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1856 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
1857 |
emit_int8(0x5A); |
|
1858 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 1859 |
} |
1860 |
||
11427 | 1861 |
void Assembler::cvtss2sd(XMMRegister dst, Address src) { |
1862 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1863 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1864 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1865 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
1866 |
simd_prefix(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
1867 |
emit_int8(0x5A); |
|
1868 |
emit_operand(dst, src); |
|
11427 | 1869 |
} |
1870 |
||
1871 |
||
1066 | 1872 |
void Assembler::cvttsd2sil(Register dst, XMMRegister src) { |
1873 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1874 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
1875 |
int encode = simd_prefix_and_encode(as_XMMRegister(dst->encoding()), xnoreg, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1876 |
emit_int8(0x2C); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1877 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1878 |
} |
1879 |
||
1880 |
void Assembler::cvttss2sil(Register dst, XMMRegister src) { |
|
1881 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 1882 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
1883 |
int encode = simd_prefix_and_encode(as_XMMRegister(dst->encoding()), xnoreg, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1884 |
emit_int8(0x2C); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1885 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1886 |
} |
1887 |
||
38018
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
37293
diff
changeset
|
1888 |
void Assembler::cvttpd2dq(XMMRegister dst, XMMRegister src) { |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
37293
diff
changeset
|
1889 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
37293
diff
changeset
|
1890 |
int vector_len = VM_Version::supports_avx512novl() ? AVX_512bit : AVX_128bit; |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
1891 |
InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38018
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
37293
diff
changeset
|
1892 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
37293
diff
changeset
|
1893 |
emit_int8((unsigned char)0xE6); |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
37293
diff
changeset
|
1894 |
emit_int8((unsigned char)(0xC0 | encode)); |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
37293
diff
changeset
|
1895 |
} |
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
37293
diff
changeset
|
1896 |
|
54750 | 1897 |
void Assembler::pabsb(XMMRegister dst, XMMRegister src) { |
1898 |
assert(VM_Version::supports_ssse3(), ""); |
|
1899 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
|
1900 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
1901 |
emit_int8(0x1C); |
|
1902 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1903 |
} |
|
1904 |
||
1905 |
void Assembler::pabsw(XMMRegister dst, XMMRegister src) { |
|
1906 |
assert(VM_Version::supports_ssse3(), ""); |
|
1907 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
|
1908 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
1909 |
emit_int8(0x1D); |
|
1910 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1911 |
} |
|
1912 |
||
1913 |
void Assembler::pabsd(XMMRegister dst, XMMRegister src) { |
|
1914 |
assert(VM_Version::supports_ssse3(), ""); |
|
1915 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
|
1916 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
1917 |
emit_int8(0x1E); |
|
1918 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1919 |
} |
|
1920 |
||
1921 |
void Assembler::vpabsb(XMMRegister dst, XMMRegister src, int vector_len) { |
|
1922 |
assert(vector_len == AVX_128bit? VM_Version::supports_avx() : |
|
1923 |
vector_len == AVX_256bit? VM_Version::supports_avx2() : |
|
1924 |
vector_len == AVX_512bit? VM_Version::supports_avx512bw() : 0, ""); |
|
1925 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
|
1926 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
1927 |
emit_int8((unsigned char)0x1C); |
|
1928 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1929 |
} |
|
1930 |
||
1931 |
void Assembler::vpabsw(XMMRegister dst, XMMRegister src, int vector_len) { |
|
1932 |
assert(vector_len == AVX_128bit? VM_Version::supports_avx() : |
|
1933 |
vector_len == AVX_256bit? VM_Version::supports_avx2() : |
|
1934 |
vector_len == AVX_512bit? VM_Version::supports_avx512bw() : 0, ""); |
|
1935 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
|
1936 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
1937 |
emit_int8((unsigned char)0x1D); |
|
1938 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1939 |
} |
|
1940 |
||
1941 |
void Assembler::vpabsd(XMMRegister dst, XMMRegister src, int vector_len) { |
|
1942 |
assert(vector_len == AVX_128bit? VM_Version::supports_avx() : |
|
1943 |
vector_len == AVX_256bit? VM_Version::supports_avx2() : |
|
1944 |
vector_len == AVX_512bit? VM_Version::supports_evex() : 0, ""); |
|
1945 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
|
1946 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
1947 |
emit_int8((unsigned char)0x1E); |
|
1948 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1949 |
} |
|
1950 |
||
1951 |
void Assembler::evpabsq(XMMRegister dst, XMMRegister src, int vector_len) { |
|
1952 |
assert(UseAVX > 2, ""); |
|
1953 |
InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
|
1954 |
attributes.set_is_evex_instruction(); |
|
1955 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
1956 |
emit_int8((unsigned char)0x1F); |
|
1957 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1958 |
} |
|
1959 |
||
1066 | 1960 |
void Assembler::decl(Address dst) { |
1961 |
// Don't use it directly. Use MacroAssembler::decrement() instead. |
|
1962 |
InstructionMark im(this); |
|
1963 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1964 |
emit_int8((unsigned char)0xFF); |
1066 | 1965 |
emit_operand(rcx, dst); |
1966 |
} |
|
1967 |
||
1968 |
void Assembler::divsd(XMMRegister dst, Address src) { |
|
1969 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1970 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1971 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1972 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
38049 | 1973 |
attributes.set_rex_vex_w_reverted(); |
34162 | 1974 |
simd_prefix(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
1975 |
emit_int8(0x5E); |
|
1976 |
emit_operand(dst, src); |
|
1066 | 1977 |
} |
1978 |
||
1979 |
void Assembler::divsd(XMMRegister dst, XMMRegister src) { |
|
1980 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1981 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
38049 | 1982 |
attributes.set_rex_vex_w_reverted(); |
34162 | 1983 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
1984 |
emit_int8(0x5E); |
|
1985 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 1986 |
} |
1987 |
||
1988 |
void Assembler::divss(XMMRegister dst, Address src) { |
|
1989 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 1990 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
1991 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 1992 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
1993 |
simd_prefix(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
1994 |
emit_int8(0x5E); |
|
1995 |
emit_operand(dst, src); |
|
1066 | 1996 |
} |
1997 |
||
1998 |
void Assembler::divss(XMMRegister dst, XMMRegister src) { |
|
1999 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
2000 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 2001 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
2002 |
emit_int8(0x5E); |
|
2003 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 2004 |
} |
2005 |
||
2006 |
void Assembler::emms() { |
|
2007 |
NOT_LP64(assert(VM_Version::supports_mmx(), "")); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2008 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2009 |
emit_int8(0x77); |
1066 | 2010 |
} |
2011 |
||
2012 |
void Assembler::hlt() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2013 |
emit_int8((unsigned char)0xF4); |
1066 | 2014 |
} |
2015 |
||
2016 |
void Assembler::idivl(Register src) { |
|
2017 |
int encode = prefix_and_encode(src->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2018 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2019 |
emit_int8((unsigned char)(0xF8 | encode)); |
1066 | 2020 |
} |
2021 |
||
7121 | 2022 |
void Assembler::divl(Register src) { // Unsigned |
2023 |
int encode = prefix_and_encode(src->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2024 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2025 |
emit_int8((unsigned char)(0xF0 | encode)); |
7121 | 2026 |
} |
2027 |
||
35540
e001ad24dcdb
8143353: update for x86 sin and cos in the math lib
vdeshpande
parents:
35154
diff
changeset
|
2028 |
void Assembler::imull(Register src) { |
e001ad24dcdb
8143353: update for x86 sin and cos in the math lib
vdeshpande
parents:
35154
diff
changeset
|
2029 |
int encode = prefix_and_encode(src->encoding()); |
e001ad24dcdb
8143353: update for x86 sin and cos in the math lib
vdeshpande
parents:
35154
diff
changeset
|
2030 |
emit_int8((unsigned char)0xF7); |
e001ad24dcdb
8143353: update for x86 sin and cos in the math lib
vdeshpande
parents:
35154
diff
changeset
|
2031 |
emit_int8((unsigned char)(0xE8 | encode)); |
e001ad24dcdb
8143353: update for x86 sin and cos in the math lib
vdeshpande
parents:
35154
diff
changeset
|
2032 |
} |
e001ad24dcdb
8143353: update for x86 sin and cos in the math lib
vdeshpande
parents:
35154
diff
changeset
|
2033 |
|
1066 | 2034 |
void Assembler::imull(Register dst, Register src) { |
2035 |
int encode = prefix_and_encode(dst->encoding(), src->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2036 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2037 |
emit_int8((unsigned char)0xAF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2038 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 2039 |
} |
2040 |
||
2041 |
||
2042 |
void Assembler::imull(Register dst, Register src, int value) { |
|
2043 |
int encode = prefix_and_encode(dst->encoding(), src->encoding()); |
|
2044 |
if (is8bit(value)) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2045 |
emit_int8(0x6B); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2046 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2047 |
emit_int8(value & 0xFF); |
1066 | 2048 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2049 |
emit_int8(0x69); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2050 |
emit_int8((unsigned char)(0xC0 | encode)); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
2051 |
emit_int32(value); |
1066 | 2052 |
} |
2053 |
} |
|
2054 |
||
21105
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
2055 |
void Assembler::imull(Register dst, Address src) { |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
2056 |
InstructionMark im(this); |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
2057 |
prefix(src, dst); |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
2058 |
emit_int8(0x0F); |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
2059 |
emit_int8((unsigned char) 0xAF); |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
2060 |
emit_operand(dst, src); |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
2061 |
} |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
2062 |
|
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
2063 |
|
1066 | 2064 |
void Assembler::incl(Address dst) { |
2065 |
// Don't use it directly. Use MacroAssembler::increment() instead. |
|
2066 |
InstructionMark im(this); |
|
2067 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2068 |
emit_int8((unsigned char)0xFF); |
1066 | 2069 |
emit_operand(rax, dst); |
2070 |
} |
|
2071 |
||
10264 | 2072 |
void Assembler::jcc(Condition cc, Label& L, bool maybe_short) { |
2073 |
InstructionMark im(this); |
|
1066 | 2074 |
assert((0 <= cc) && (cc < 16), "illegal cc"); |
2075 |
if (L.is_bound()) { |
|
2076 |
address dst = target(L); |
|
2077 |
assert(dst != NULL, "jcc most probably wrong"); |
|
2078 |
||
2079 |
const int short_size = 2; |
|
2080 |
const int long_size = 6; |
|
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
2081 |
intptr_t offs = (intptr_t)dst - (intptr_t)pc(); |
10264 | 2082 |
if (maybe_short && is8bit(offs - short_size)) { |
1066 | 2083 |
// 0111 tttn #8-bit disp |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2084 |
emit_int8(0x70 | cc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2085 |
emit_int8((offs - short_size) & 0xFF); |
1066 | 2086 |
} else { |
2087 |
// 0000 1111 1000 tttn #32-bit disp |
|
2088 |
assert(is_simm32(offs - long_size), |
|
2089 |
"must be 32bit offset (call4)"); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2090 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2091 |
emit_int8((unsigned char)(0x80 | cc)); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
2092 |
emit_int32(offs - long_size); |
1066 | 2093 |
} |
2094 |
} else { |
|
2095 |
// Note: could eliminate cond. jumps to this jump if condition |
|
2096 |
// is the same however, seems to be rather unlikely case. |
|
2097 |
// Note: use jccb() if label to be bound is very close to get |
|
2098 |
// an 8-bit displacement |
|
2099 |
L.add_patch_at(code(), locator()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2100 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2101 |
emit_int8((unsigned char)(0x80 | cc)); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
2102 |
emit_int32(0); |
1066 | 2103 |
} |
2104 |
} |
|
2105 |
||
51633
21154cb84d2a
8209594: guarantee(this->is8bit(imm8)) failed: Short forward jump exceeds 8-bit offset
kvn
parents:
50860
diff
changeset
|
2106 |
void Assembler::jccb_0(Condition cc, Label& L, const char* file, int line) { |
1066 | 2107 |
if (L.is_bound()) { |
2108 |
const int short_size = 2; |
|
2109 |
address entry = target(L); |
|
11434
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
2110 |
#ifdef ASSERT |
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
2111 |
intptr_t dist = (intptr_t)entry - ((intptr_t)pc() + short_size); |
11434
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
2112 |
intptr_t delta = short_branch_delta(); |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
2113 |
if (delta != 0) { |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
2114 |
dist += (dist < 0 ? (-delta) :delta); |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
2115 |
} |
51633
21154cb84d2a
8209594: guarantee(this->is8bit(imm8)) failed: Short forward jump exceeds 8-bit offset
kvn
parents:
50860
diff
changeset
|
2116 |
assert(is8bit(dist), "Dispacement too large for a short jmp at %s:%d", file, line); |
11434
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
2117 |
#endif |
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
2118 |
intptr_t offs = (intptr_t)entry - (intptr_t)pc(); |
1066 | 2119 |
// 0111 tttn #8-bit disp |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2120 |
emit_int8(0x70 | cc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2121 |
emit_int8((offs - short_size) & 0xFF); |
1066 | 2122 |
} else { |
2123 |
InstructionMark im(this); |
|
51633
21154cb84d2a
8209594: guarantee(this->is8bit(imm8)) failed: Short forward jump exceeds 8-bit offset
kvn
parents:
50860
diff
changeset
|
2124 |
L.add_patch_at(code(), locator(), file, line); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2125 |
emit_int8(0x70 | cc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2126 |
emit_int8(0); |
1066 | 2127 |
} |
2128 |
} |
|
2129 |
||
2130 |
void Assembler::jmp(Address adr) { |
|
2131 |
InstructionMark im(this); |
|
2132 |
prefix(adr); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2133 |
emit_int8((unsigned char)0xFF); |
1066 | 2134 |
emit_operand(rsp, adr); |
2135 |
} |
|
2136 |
||
10264 | 2137 |
void Assembler::jmp(Label& L, bool maybe_short) { |
1066 | 2138 |
if (L.is_bound()) { |
2139 |
address entry = target(L); |
|
2140 |
assert(entry != NULL, "jmp most probably wrong"); |
|
2141 |
InstructionMark im(this); |
|
2142 |
const int short_size = 2; |
|
2143 |
const int long_size = 5; |
|
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
2144 |
intptr_t offs = entry - pc(); |
10264 | 2145 |
if (maybe_short && is8bit(offs - short_size)) { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2146 |
emit_int8((unsigned char)0xEB); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2147 |
emit_int8((offs - short_size) & 0xFF); |
1066 | 2148 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2149 |
emit_int8((unsigned char)0xE9); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
2150 |
emit_int32(offs - long_size); |
1066 | 2151 |
} |
2152 |
} else { |
|
2153 |
// By default, forward jumps are always 32-bit displacements, since |
|
2154 |
// we can't yet know where the label will be bound. If you're sure that |
|
2155 |
// the forward jump will not run beyond 256 bytes, use jmpb to |
|
2156 |
// force an 8-bit displacement. |
|
2157 |
InstructionMark im(this); |
|
2158 |
L.add_patch_at(code(), locator()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2159 |
emit_int8((unsigned char)0xE9); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
2160 |
emit_int32(0); |
1066 | 2161 |
} |
2162 |
} |
|
2163 |
||
2164 |
void Assembler::jmp(Register entry) { |
|
2165 |
int encode = prefix_and_encode(entry->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2166 |
emit_int8((unsigned char)0xFF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2167 |
emit_int8((unsigned char)(0xE0 | encode)); |
1066 | 2168 |
} |
2169 |
||
2170 |
void Assembler::jmp_literal(address dest, RelocationHolder const& rspec) { |
|
2171 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2172 |
emit_int8((unsigned char)0xE9); |
1066 | 2173 |
assert(dest != NULL, "must have a target"); |
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
2174 |
intptr_t disp = dest - (pc() + sizeof(int32_t)); |
1066 | 2175 |
assert(is_simm32(disp), "must be 32bit offset (jmp)"); |
2176 |
emit_data(disp, rspec.reloc(), call32_operand); |
|
2177 |
} |
|
2178 |
||
51633
21154cb84d2a
8209594: guarantee(this->is8bit(imm8)) failed: Short forward jump exceeds 8-bit offset
kvn
parents:
50860
diff
changeset
|
2179 |
void Assembler::jmpb_0(Label& L, const char* file, int line) { |
1066 | 2180 |
if (L.is_bound()) { |
2181 |
const int short_size = 2; |
|
2182 |
address entry = target(L); |
|
2183 |
assert(entry != NULL, "jmp most probably wrong"); |
|
11434
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
2184 |
#ifdef ASSERT |
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
2185 |
intptr_t dist = (intptr_t)entry - ((intptr_t)pc() + short_size); |
11434
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
2186 |
intptr_t delta = short_branch_delta(); |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
2187 |
if (delta != 0) { |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
2188 |
dist += (dist < 0 ? (-delta) :delta); |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
2189 |
} |
51633
21154cb84d2a
8209594: guarantee(this->is8bit(imm8)) failed: Short forward jump exceeds 8-bit offset
kvn
parents:
50860
diff
changeset
|
2190 |
assert(is8bit(dist), "Dispacement too large for a short jmp at %s:%d", file, line); |
11434
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
2191 |
#endif |
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
2192 |
intptr_t offs = entry - pc(); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2193 |
emit_int8((unsigned char)0xEB); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2194 |
emit_int8((offs - short_size) & 0xFF); |
1066 | 2195 |
} else { |
2196 |
InstructionMark im(this); |
|
51633
21154cb84d2a
8209594: guarantee(this->is8bit(imm8)) failed: Short forward jump exceeds 8-bit offset
kvn
parents:
50860
diff
changeset
|
2197 |
L.add_patch_at(code(), locator(), file, line); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2198 |
emit_int8((unsigned char)0xEB); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2199 |
emit_int8(0); |
1066 | 2200 |
} |
2201 |
} |
|
2202 |
||
2203 |
void Assembler::ldmxcsr( Address src) { |
|
46440
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
2204 |
if (UseAVX > 0 ) { |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
2205 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
2206 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
46440
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
2207 |
vex_prefix(src, 0, 0, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
2208 |
emit_int8((unsigned char)0xAE); |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
2209 |
emit_operand(as_Register(2), src); |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
2210 |
} else { |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
2211 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
2212 |
InstructionMark im(this); |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
2213 |
prefix(src); |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
2214 |
emit_int8(0x0F); |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
2215 |
emit_int8((unsigned char)0xAE); |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
2216 |
emit_operand(as_Register(2), src); |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
2217 |
} |
1066 | 2218 |
} |
2219 |
||
2220 |
void Assembler::leal(Register dst, Address src) { |
|
2221 |
InstructionMark im(this); |
|
2222 |
#ifdef _LP64 |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2223 |
emit_int8(0x67); // addr32 |
1066 | 2224 |
prefix(src, dst); |
2225 |
#endif // LP64 |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2226 |
emit_int8((unsigned char)0x8D); |
1066 | 2227 |
emit_operand(dst, src); |
2228 |
} |
|
2229 |
||
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
2230 |
void Assembler::lfence() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2231 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2232 |
emit_int8((unsigned char)0xAE); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2233 |
emit_int8((unsigned char)0xE8); |
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
2234 |
} |
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
2235 |
|
1066 | 2236 |
void Assembler::lock() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2237 |
emit_int8((unsigned char)0xF0); |
1066 | 2238 |
} |
2239 |
||
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
2240 |
void Assembler::lzcntl(Register dst, Register src) { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
2241 |
assert(VM_Version::supports_lzcnt(), "encoding is treated as BSR"); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2242 |
emit_int8((unsigned char)0xF3); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
2243 |
int encode = prefix_and_encode(dst->encoding(), src->encoding()); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2244 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2245 |
emit_int8((unsigned char)0xBD); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2246 |
emit_int8((unsigned char)(0xC0 | encode)); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
2247 |
} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
2248 |
|
2338
a8660a1b709b
6822204: volatile fences should prefer lock:addl to actual mfence instructions
never
parents:
2332
diff
changeset
|
2249 |
// Emit mfence instruction |
1066 | 2250 |
void Assembler::mfence() { |
2338
a8660a1b709b
6822204: volatile fences should prefer lock:addl to actual mfence instructions
never
parents:
2332
diff
changeset
|
2251 |
NOT_LP64(assert(VM_Version::supports_sse2(), "unsupported");) |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2252 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2253 |
emit_int8((unsigned char)0xAE); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2254 |
emit_int8((unsigned char)0xF0); |
1066 | 2255 |
} |
2256 |
||
2257 |
void Assembler::mov(Register dst, Register src) { |
|
2258 |
LP64_ONLY(movq(dst, src)) NOT_LP64(movl(dst, src)); |
|
2259 |
} |
|
2260 |
||
2261 |
void Assembler::movapd(XMMRegister dst, XMMRegister src) { |
|
2262 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 2263 |
int vector_len = VM_Version::supports_avx512novl() ? AVX_512bit : AVX_128bit; |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
2264 |
InstructionAttr attributes(vector_len, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 2265 |
attributes.set_rex_vex_w_reverted(); |
34162 | 2266 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
2267 |
emit_int8(0x28); |
|
2268 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 2269 |
} |
2270 |
||
2271 |
void Assembler::movaps(XMMRegister dst, XMMRegister src) { |
|
2272 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 2273 |
int vector_len = VM_Version::supports_avx512novl() ? AVX_512bit : AVX_128bit; |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
2274 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 2275 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
2276 |
emit_int8(0x28); |
|
2277 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 2278 |
} |
2279 |
||
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2280 |
void Assembler::movlhps(XMMRegister dst, XMMRegister src) { |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2281 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
51857 | 2282 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 2283 |
int encode = simd_prefix_and_encode(dst, src, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2284 |
emit_int8(0x16); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2285 |
emit_int8((unsigned char)(0xC0 | encode)); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2286 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2287 |
|
1066 | 2288 |
void Assembler::movb(Register dst, Address src) { |
2289 |
NOT_LP64(assert(dst->has_byte_register(), "must have byte register")); |
|
2290 |
InstructionMark im(this); |
|
2291 |
prefix(src, dst, true); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2292 |
emit_int8((unsigned char)0x8A); |
1066 | 2293 |
emit_operand(dst, src); |
2294 |
} |
|
2295 |
||
33465 | 2296 |
void Assembler::movddup(XMMRegister dst, XMMRegister src) { |
2297 |
NOT_LP64(assert(VM_Version::supports_sse3(), "")); |
|
36837 | 2298 |
int vector_len = VM_Version::supports_avx512novl() ? AVX_512bit : AVX_128bit; |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
2299 |
InstructionAttr attributes(vector_len, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 2300 |
attributes.set_rex_vex_w_reverted(); |
34162 | 2301 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
33465 | 2302 |
emit_int8(0x12); |
2303 |
emit_int8(0xC0 | encode); |
|
2304 |
} |
|
2305 |
||
35113 | 2306 |
void Assembler::kmovbl(KRegister dst, Register src) { |
2307 |
assert(VM_Version::supports_avx512dq(), ""); |
|
2308 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2309 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
2310 |
emit_int8((unsigned char)0x92); |
|
2311 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2312 |
} |
|
2313 |
||
2314 |
void Assembler::kmovbl(Register dst, KRegister src) { |
|
2315 |
assert(VM_Version::supports_avx512dq(), ""); |
|
34203 | 2316 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
35113 | 2317 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
2318 |
emit_int8((unsigned char)0x93); |
|
2319 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2320 |
} |
|
2321 |
||
2322 |
void Assembler::kmovwl(KRegister dst, Register src) { |
|
2323 |
assert(VM_Version::supports_evex(), ""); |
|
2324 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2325 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
34203 | 2326 |
emit_int8((unsigned char)0x92); |
2327 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2328 |
} |
|
2329 |
||
35113 | 2330 |
void Assembler::kmovwl(Register dst, KRegister src) { |
2331 |
assert(VM_Version::supports_evex(), ""); |
|
2332 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2333 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
2334 |
emit_int8((unsigned char)0x93); |
|
2335 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2336 |
} |
|
2337 |
||
38049 | 2338 |
void Assembler::kmovwl(KRegister dst, Address src) { |
2339 |
assert(VM_Version::supports_evex(), ""); |
|
2340 |
InstructionMark im(this); |
|
2341 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2342 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
2343 |
emit_int8((unsigned char)0x90); |
|
2344 |
emit_operand((Register)dst, src); |
|
2345 |
} |
|
2346 |
||
34203 | 2347 |
void Assembler::kmovdl(KRegister dst, Register src) { |
35113 | 2348 |
assert(VM_Version::supports_avx512bw(), ""); |
34203 | 2349 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
35113 | 2350 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
34203 | 2351 |
emit_int8((unsigned char)0x92); |
2352 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2353 |
} |
|
2354 |
||
35113 | 2355 |
void Assembler::kmovdl(Register dst, KRegister src) { |
2356 |
assert(VM_Version::supports_avx512bw(), ""); |
|
2357 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2358 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
2359 |
emit_int8((unsigned char)0x93); |
|
2360 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2361 |
} |
|
2362 |
||
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2363 |
void Assembler::kmovql(KRegister dst, KRegister src) { |
35113 | 2364 |
assert(VM_Version::supports_avx512bw(), ""); |
34162 | 2365 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
35113 | 2366 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
30624 | 2367 |
emit_int8((unsigned char)0x90); |
2368 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2369 |
} |
|
2370 |
||
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2371 |
void Assembler::kmovql(KRegister dst, Address src) { |
35113 | 2372 |
assert(VM_Version::supports_avx512bw(), ""); |
34162 | 2373 |
InstructionMark im(this); |
2374 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2375 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
30624 | 2376 |
emit_int8((unsigned char)0x90); |
2377 |
emit_operand((Register)dst, src); |
|
2378 |
} |
|
2379 |
||
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2380 |
void Assembler::kmovql(Address dst, KRegister src) { |
35113 | 2381 |
assert(VM_Version::supports_avx512bw(), ""); |
34162 | 2382 |
InstructionMark im(this); |
2383 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2384 |
vex_prefix(dst, 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
30624 | 2385 |
emit_int8((unsigned char)0x90); |
2386 |
emit_operand((Register)src, dst); |
|
2387 |
} |
|
2388 |
||
2389 |
void Assembler::kmovql(KRegister dst, Register src) { |
|
35113 | 2390 |
assert(VM_Version::supports_avx512bw(), ""); |
2391 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2392 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
30624 | 2393 |
emit_int8((unsigned char)0x92); |
2394 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2395 |
} |
|
2396 |
||
35113 | 2397 |
void Assembler::kmovql(Register dst, KRegister src) { |
2398 |
assert(VM_Version::supports_avx512bw(), ""); |
|
2399 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2400 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
2401 |
emit_int8((unsigned char)0x93); |
|
2402 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2403 |
} |
|
2404 |
||
38049 | 2405 |
void Assembler::knotwl(KRegister dst, KRegister src) { |
2406 |
assert(VM_Version::supports_evex(), ""); |
|
2407 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2408 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
2409 |
emit_int8((unsigned char)0x44); |
|
2410 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2411 |
} |
|
2412 |
||
34203 | 2413 |
// This instruction produces ZF or CF flags |
2414 |
void Assembler::kortestbl(KRegister src1, KRegister src2) { |
|
35113 | 2415 |
assert(VM_Version::supports_avx512dq(), ""); |
34162 | 2416 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
35113 | 2417 |
int encode = vex_prefix_and_encode(src1->encoding(), 0, src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34203 | 2418 |
emit_int8((unsigned char)0x98); |
2419 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2420 |
} |
|
2421 |
||
2422 |
// This instruction produces ZF or CF flags |
|
2423 |
void Assembler::kortestwl(KRegister src1, KRegister src2) { |
|
35113 | 2424 |
assert(VM_Version::supports_evex(), ""); |
34162 | 2425 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
35113 | 2426 |
int encode = vex_prefix_and_encode(src1->encoding(), 0, src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
34203 | 2427 |
emit_int8((unsigned char)0x98); |
2428 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2429 |
} |
|
2430 |
||
2431 |
// This instruction produces ZF or CF flags |
|
2432 |
void Assembler::kortestdl(KRegister src1, KRegister src2) { |
|
35113 | 2433 |
assert(VM_Version::supports_avx512bw(), ""); |
34203 | 2434 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
35113 | 2435 |
int encode = vex_prefix_and_encode(src1->encoding(), 0, src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34203 | 2436 |
emit_int8((unsigned char)0x98); |
2437 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2438 |
} |
|
2439 |
||
2440 |
// This instruction produces ZF or CF flags |
|
2441 |
void Assembler::kortestql(KRegister src1, KRegister src2) { |
|
35113 | 2442 |
assert(VM_Version::supports_avx512bw(), ""); |
34203 | 2443 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
35113 | 2444 |
int encode = vex_prefix_and_encode(src1->encoding(), 0, src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
34203 | 2445 |
emit_int8((unsigned char)0x98); |
30624 | 2446 |
emit_int8((unsigned char)(0xC0 | encode)); |
2447 |
} |
|
1066 | 2448 |
|
38138
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
2449 |
// This instruction produces ZF or CF flags |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
2450 |
void Assembler::ktestql(KRegister src1, KRegister src2) { |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
2451 |
assert(VM_Version::supports_avx512bw(), ""); |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
2452 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
2453 |
int encode = vex_prefix_and_encode(src1->encoding(), 0, src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
2454 |
emit_int8((unsigned char)0x99); |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
2455 |
emit_int8((unsigned char)(0xC0 | encode)); |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
2456 |
} |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
2457 |
|
38239
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2458 |
void Assembler::ktestq(KRegister src1, KRegister src2) { |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2459 |
assert(VM_Version::supports_avx512bw(), ""); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2460 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2461 |
int encode = vex_prefix_and_encode(src1->encoding(), 0, src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2462 |
emit_int8((unsigned char)0x99); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2463 |
emit_int8((unsigned char)(0xC0 | encode)); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2464 |
} |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2465 |
|
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2466 |
void Assembler::ktestd(KRegister src1, KRegister src2) { |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2467 |
assert(VM_Version::supports_avx512bw(), ""); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2468 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2469 |
int encode = vex_prefix_and_encode(src1->encoding(), 0, src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2470 |
emit_int8((unsigned char)0x99); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2471 |
emit_int8((unsigned char)(0xC0 | encode)); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2472 |
} |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2473 |
|
1066 | 2474 |
void Assembler::movb(Address dst, int imm8) { |
2475 |
InstructionMark im(this); |
|
2476 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2477 |
emit_int8((unsigned char)0xC6); |
1066 | 2478 |
emit_operand(rax, dst, 1); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2479 |
emit_int8(imm8); |
1066 | 2480 |
} |
2481 |
||
2482 |
||
2483 |
void Assembler::movb(Address dst, Register src) { |
|
2484 |
assert(src->has_byte_register(), "must have byte register"); |
|
2485 |
InstructionMark im(this); |
|
2486 |
prefix(dst, src, true); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2487 |
emit_int8((unsigned char)0x88); |
1066 | 2488 |
emit_operand(src, dst); |
2489 |
} |
|
2490 |
||
2491 |
void Assembler::movdl(XMMRegister dst, Register src) { |
|
2492 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 2493 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
2494 |
int encode = simd_prefix_and_encode(dst, xnoreg, as_XMMRegister(src->encoding()), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2495 |
emit_int8(0x6E); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2496 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 2497 |
} |
2498 |
||
2499 |
void Assembler::movdl(Register dst, XMMRegister src) { |
|
2500 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 2501 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
1066 | 2502 |
// swap src/dst to get correct prefix |
34162 | 2503 |
int encode = simd_prefix_and_encode(src, xnoreg, as_XMMRegister(dst->encoding()), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2504 |
emit_int8(0x7E); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2505 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 2506 |
} |
2507 |
||
8494
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
2508 |
void Assembler::movdl(XMMRegister dst, Address src) { |
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
2509 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 2510 |
InstructionMark im(this); |
2511 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2512 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
2513 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2514 |
emit_int8(0x6E); |
8494
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
2515 |
emit_operand(dst, src); |
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
2516 |
} |
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
2517 |
|
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2518 |
void Assembler::movdl(Address dst, XMMRegister src) { |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2519 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 2520 |
InstructionMark im(this); |
2521 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2522 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
2523 |
simd_prefix(src, xnoreg, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2524 |
emit_int8(0x7E); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2525 |
emit_operand(src, dst); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2526 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2527 |
|
1066 | 2528 |
void Assembler::movdqa(XMMRegister dst, XMMRegister src) { |
2529 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
2530 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 2531 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
2532 |
emit_int8(0x6F); |
|
2533 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 2534 |
} |
2535 |
||
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
2536 |
void Assembler::movdqa(XMMRegister dst, Address src) { |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
2537 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 2538 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
2539 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 2540 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
2541 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
2542 |
emit_int8(0x6F); |
|
2543 |
emit_operand(dst, src); |
|
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
2544 |
} |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
2545 |
|
1437 | 2546 |
void Assembler::movdqu(XMMRegister dst, Address src) { |
2547 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 2548 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
2549 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 2550 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
2551 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
2552 |
emit_int8(0x6F); |
|
2553 |
emit_operand(dst, src); |
|
1437 | 2554 |
} |
2555 |
||
2556 |
void Assembler::movdqu(XMMRegister dst, XMMRegister src) { |
|
2557 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
2558 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 2559 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
2560 |
emit_int8(0x6F); |
|
2561 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1437 | 2562 |
} |
2563 |
||
2564 |
void Assembler::movdqu(Address dst, XMMRegister src) { |
|
2565 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 2566 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
2567 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 2568 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
42014
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
2569 |
attributes.reset_is_clear_context(); |
34162 | 2570 |
simd_prefix(src, xnoreg, dst, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2571 |
emit_int8(0x7F); |
1437 | 2572 |
emit_operand(src, dst); |
2573 |
} |
|
2574 |
||
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2575 |
// Move Unaligned 256bit Vector |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2576 |
void Assembler::vmovdqu(XMMRegister dst, XMMRegister src) { |
24325 | 2577 |
assert(UseAVX > 0, ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
2578 |
InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 2579 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2580 |
emit_int8(0x6F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2581 |
emit_int8((unsigned char)(0xC0 | encode)); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2582 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2583 |
|
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2584 |
void Assembler::vmovdqu(XMMRegister dst, Address src) { |
24325 | 2585 |
assert(UseAVX > 0, ""); |
34162 | 2586 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
2587 |
InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 2588 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
2589 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2590 |
emit_int8(0x6F); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2591 |
emit_operand(dst, src); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2592 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2593 |
|
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2594 |
void Assembler::vmovdqu(Address dst, XMMRegister src) { |
24325 | 2595 |
assert(UseAVX > 0, ""); |
34162 | 2596 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
2597 |
InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 2598 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
42014
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
2599 |
attributes.reset_is_clear_context(); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2600 |
// swap src<->dst for encoding |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2601 |
assert(src != xnoreg, "sanity"); |
34162 | 2602 |
vex_prefix(dst, 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
30624 | 2603 |
emit_int8(0x7F); |
2604 |
emit_operand(src, dst); |
|
2605 |
} |
|
2606 |
||
2607 |
// Move Unaligned EVEX enabled Vector (programmable : 8,16,32,64) |
|
34203 | 2608 |
void Assembler::evmovdqub(XMMRegister dst, XMMRegister src, int vector_len) { |
2609 |
assert(VM_Version::supports_evex(), ""); |
|
35113 | 2610 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 2611 |
attributes.set_is_evex_instruction(); |
36837 | 2612 |
int prefix = (_legacy_mode_bw) ? VEX_SIMD_F2 : VEX_SIMD_F3; |
2613 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), (Assembler::VexSimdPrefix)prefix, VEX_OPCODE_0F, &attributes); |
|
34203 | 2614 |
emit_int8(0x6F); |
2615 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2616 |
} |
|
2617 |
||
2618 |
void Assembler::evmovdqub(XMMRegister dst, Address src, int vector_len) { |
|
2619 |
assert(VM_Version::supports_evex(), ""); |
|
2620 |
InstructionMark im(this); |
|
2621 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
|
36837 | 2622 |
int prefix = (_legacy_mode_bw) ? VEX_SIMD_F2 : VEX_SIMD_F3; |
34203 | 2623 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
38049 | 2624 |
attributes.set_is_evex_instruction(); |
36837 | 2625 |
vex_prefix(src, 0, dst->encoding(), (Assembler::VexSimdPrefix)prefix, VEX_OPCODE_0F, &attributes); |
34203 | 2626 |
emit_int8(0x6F); |
2627 |
emit_operand(dst, src); |
|
2628 |
} |
|
2629 |
||
2630 |
void Assembler::evmovdqub(Address dst, XMMRegister src, int vector_len) { |
|
2631 |
assert(VM_Version::supports_evex(), ""); |
|
2632 |
assert(src != xnoreg, "sanity"); |
|
2633 |
InstructionMark im(this); |
|
35113 | 2634 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
36837 | 2635 |
int prefix = (_legacy_mode_bw) ? VEX_SIMD_F2 : VEX_SIMD_F3; |
34203 | 2636 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
38049 | 2637 |
attributes.set_is_evex_instruction(); |
36837 | 2638 |
vex_prefix(dst, 0, src->encoding(), (Assembler::VexSimdPrefix)prefix, VEX_OPCODE_0F, &attributes); |
34203 | 2639 |
emit_int8(0x7F); |
2640 |
emit_operand(src, dst); |
|
2641 |
} |
|
2642 |
||
38239
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2643 |
void Assembler::evmovdqub(XMMRegister dst, KRegister mask, Address src, int vector_len) { |
38138
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
2644 |
assert(VM_Version::supports_avx512vlbw(), ""); |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
2645 |
InstructionMark im(this); |
51857 | 2646 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
38138
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
2647 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
2648 |
attributes.set_embedded_opmask_register_specifier(mask); |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
2649 |
attributes.set_is_evex_instruction(); |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
2650 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
2651 |
emit_int8(0x6F); |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
2652 |
emit_operand(dst, src); |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
2653 |
} |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
2654 |
|
34203 | 2655 |
void Assembler::evmovdquw(XMMRegister dst, Address src, int vector_len) { |
2656 |
assert(VM_Version::supports_evex(), ""); |
|
2657 |
InstructionMark im(this); |
|
2658 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
|
2659 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
|
38049 | 2660 |
attributes.set_is_evex_instruction(); |
36837 | 2661 |
int prefix = (_legacy_mode_bw) ? VEX_SIMD_F2 : VEX_SIMD_F3; |
2662 |
vex_prefix(src, 0, dst->encoding(), (Assembler::VexSimdPrefix)prefix, VEX_OPCODE_0F, &attributes); |
|
34203 | 2663 |
emit_int8(0x6F); |
2664 |
emit_operand(dst, src); |
|
2665 |
} |
|
2666 |
||
38239
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2667 |
void Assembler::evmovdquw(XMMRegister dst, KRegister mask, Address src, int vector_len) { |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2668 |
assert(VM_Version::supports_avx512vlbw(), ""); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2669 |
InstructionMark im(this); |
51857 | 2670 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
38239
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2671 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2672 |
attributes.set_embedded_opmask_register_specifier(mask); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2673 |
attributes.set_is_evex_instruction(); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2674 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2675 |
emit_int8(0x6F); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2676 |
emit_operand(dst, src); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2677 |
} |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2678 |
|
34203 | 2679 |
void Assembler::evmovdquw(Address dst, XMMRegister src, int vector_len) { |
2680 |
assert(VM_Version::supports_evex(), ""); |
|
2681 |
assert(src != xnoreg, "sanity"); |
|
2682 |
InstructionMark im(this); |
|
35113 | 2683 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34203 | 2684 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
38049 | 2685 |
attributes.set_is_evex_instruction(); |
36837 | 2686 |
int prefix = (_legacy_mode_bw) ? VEX_SIMD_F2 : VEX_SIMD_F3; |
2687 |
vex_prefix(dst, 0, src->encoding(), (Assembler::VexSimdPrefix)prefix, VEX_OPCODE_0F, &attributes); |
|
34203 | 2688 |
emit_int8(0x7F); |
2689 |
emit_operand(src, dst); |
|
2690 |
} |
|
36837 | 2691 |
|
38239
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2692 |
void Assembler::evmovdquw(Address dst, KRegister mask, XMMRegister src, int vector_len) { |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2693 |
assert(VM_Version::supports_avx512vlbw(), ""); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2694 |
assert(src != xnoreg, "sanity"); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2695 |
InstructionMark im(this); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2696 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2697 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
42014
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
2698 |
attributes.reset_is_clear_context(); |
38239
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2699 |
attributes.set_embedded_opmask_register_specifier(mask); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2700 |
attributes.set_is_evex_instruction(); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2701 |
vex_prefix(dst, 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2702 |
emit_int8(0x7F); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2703 |
emit_operand(src, dst); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2704 |
} |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
2705 |
|
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2706 |
void Assembler::evmovdqul(XMMRegister dst, XMMRegister src, int vector_len) { |
34162 | 2707 |
assert(VM_Version::supports_evex(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
2708 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
36837 | 2709 |
attributes.set_is_evex_instruction(); |
34162 | 2710 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
30624 | 2711 |
emit_int8(0x6F); |
2712 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2713 |
} |
|
2714 |
||
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2715 |
void Assembler::evmovdqul(XMMRegister dst, Address src, int vector_len) { |
34162 | 2716 |
assert(VM_Version::supports_evex(), ""); |
2717 |
InstructionMark im(this); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
2718 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true , /* uses_vl */ true); |
34162 | 2719 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
36837 | 2720 |
attributes.set_is_evex_instruction(); |
34162 | 2721 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
30624 | 2722 |
emit_int8(0x6F); |
2723 |
emit_operand(dst, src); |
|
2724 |
} |
|
2725 |
||
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2726 |
void Assembler::evmovdqul(Address dst, XMMRegister src, int vector_len) { |
34162 | 2727 |
assert(VM_Version::supports_evex(), ""); |
30624 | 2728 |
assert(src != xnoreg, "sanity"); |
34162 | 2729 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
2730 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 2731 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
42014
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
2732 |
attributes.reset_is_clear_context(); |
36837 | 2733 |
attributes.set_is_evex_instruction(); |
34162 | 2734 |
vex_prefix(dst, 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2735 |
emit_int8(0x7F); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2736 |
emit_operand(src, dst); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2737 |
} |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2738 |
|
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2739 |
void Assembler::evmovdquq(XMMRegister dst, XMMRegister src, int vector_len) { |
34162 | 2740 |
assert(VM_Version::supports_evex(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
2741 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
36837 | 2742 |
attributes.set_is_evex_instruction(); |
34162 | 2743 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2744 |
emit_int8(0x6F); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2745 |
emit_int8((unsigned char)(0xC0 | encode)); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2746 |
} |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2747 |
|
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2748 |
void Assembler::evmovdquq(XMMRegister dst, Address src, int vector_len) { |
34162 | 2749 |
assert(VM_Version::supports_evex(), ""); |
2750 |
InstructionMark im(this); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
2751 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 2752 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
36837 | 2753 |
attributes.set_is_evex_instruction(); |
34162 | 2754 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2755 |
emit_int8(0x6F); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2756 |
emit_operand(dst, src); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2757 |
} |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2758 |
|
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2759 |
void Assembler::evmovdquq(Address dst, XMMRegister src, int vector_len) { |
34162 | 2760 |
assert(VM_Version::supports_evex(), ""); |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2761 |
assert(src != xnoreg, "sanity"); |
34162 | 2762 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
2763 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 2764 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
42014
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
2765 |
attributes.reset_is_clear_context(); |
36837 | 2766 |
attributes.set_is_evex_instruction(); |
34162 | 2767 |
vex_prefix(dst, 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2768 |
emit_int8(0x7F); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2769 |
emit_operand(src, dst); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2770 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2771 |
|
1066 | 2772 |
// Uses zero extension on 64bit |
2773 |
||
2774 |
void Assembler::movl(Register dst, int32_t imm32) { |
|
2775 |
int encode = prefix_and_encode(dst->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2776 |
emit_int8((unsigned char)(0xB8 | encode)); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
2777 |
emit_int32(imm32); |
1066 | 2778 |
} |
2779 |
||
2780 |
void Assembler::movl(Register dst, Register src) { |
|
2781 |
int encode = prefix_and_encode(dst->encoding(), src->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2782 |
emit_int8((unsigned char)0x8B); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2783 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 2784 |
} |
2785 |
||
2786 |
void Assembler::movl(Register dst, Address src) { |
|
2787 |
InstructionMark im(this); |
|
2788 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2789 |
emit_int8((unsigned char)0x8B); |
1066 | 2790 |
emit_operand(dst, src); |
2791 |
} |
|
2792 |
||
2793 |
void Assembler::movl(Address dst, int32_t imm32) { |
|
2794 |
InstructionMark im(this); |
|
2795 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2796 |
emit_int8((unsigned char)0xC7); |
1066 | 2797 |
emit_operand(rax, dst, 4); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
2798 |
emit_int32(imm32); |
1066 | 2799 |
} |
2800 |
||
2801 |
void Assembler::movl(Address dst, Register src) { |
|
2802 |
InstructionMark im(this); |
|
2803 |
prefix(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2804 |
emit_int8((unsigned char)0x89); |
1066 | 2805 |
emit_operand(src, dst); |
2806 |
} |
|
2807 |
||
2808 |
// New cpus require to use movsd and movss to avoid partial register stall |
|
2809 |
// when loading from memory. But for old Opteron use movlpd instead of movsd. |
|
2810 |
// The selection is done in MacroAssembler::movdbl() and movflt(). |
|
2811 |
void Assembler::movlpd(XMMRegister dst, Address src) { |
|
2812 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 2813 |
InstructionMark im(this); |
51857 | 2814 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38134
7435f311b441
8154896: xml.transform fails intermittently on SKX
mcberg
parents:
38049
diff
changeset
|
2815 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
38049 | 2816 |
attributes.set_rex_vex_w_reverted(); |
34162 | 2817 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
2818 |
emit_int8(0x12); |
|
2819 |
emit_operand(dst, src); |
|
1066 | 2820 |
} |
2821 |
||
2822 |
void Assembler::movq( MMXRegister dst, Address src ) { |
|
2823 |
assert( VM_Version::supports_mmx(), "" ); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2824 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2825 |
emit_int8(0x6F); |
1066 | 2826 |
emit_operand(dst, src); |
2827 |
} |
|
2828 |
||
2829 |
void Assembler::movq( Address dst, MMXRegister src ) { |
|
2830 |
assert( VM_Version::supports_mmx(), "" ); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2831 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2832 |
emit_int8(0x7F); |
1066 | 2833 |
// workaround gcc (3.2.1-7a) bug |
2834 |
// In that version of gcc with only an emit_operand(MMX, Address) |
|
2835 |
// gcc will tail jump and try and reverse the parameters completely |
|
2836 |
// obliterating dst in the process. By having a version available |
|
2837 |
// that doesn't need to swap the args at the tail jump the bug is |
|
2838 |
// avoided. |
|
2839 |
emit_operand(dst, src); |
|
2840 |
} |
|
2841 |
||
2842 |
void Assembler::movq(XMMRegister dst, Address src) { |
|
2843 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
2844 |
InstructionMark im(this); |
|
34162 | 2845 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
2846 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
38049 | 2847 |
attributes.set_rex_vex_w_reverted(); |
34162 | 2848 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2849 |
emit_int8(0x7E); |
1066 | 2850 |
emit_operand(dst, src); |
2851 |
} |
|
2852 |
||
2853 |
void Assembler::movq(Address dst, XMMRegister src) { |
|
2854 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
2855 |
InstructionMark im(this); |
|
34162 | 2856 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
2857 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
38049 | 2858 |
attributes.set_rex_vex_w_reverted(); |
34162 | 2859 |
simd_prefix(src, xnoreg, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2860 |
emit_int8((unsigned char)0xD6); |
1066 | 2861 |
emit_operand(src, dst); |
2862 |
} |
|
2863 |
||
2864 |
void Assembler::movsbl(Register dst, Address src) { // movsxb |
|
2865 |
InstructionMark im(this); |
|
2866 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2867 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2868 |
emit_int8((unsigned char)0xBE); |
1066 | 2869 |
emit_operand(dst, src); |
2870 |
} |
|
2871 |
||
2872 |
void Assembler::movsbl(Register dst, Register src) { // movsxb |
|
2873 |
NOT_LP64(assert(src->has_byte_register(), "must have byte register")); |
|
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
2874 |
int encode = prefix_and_encode(dst->encoding(), false, src->encoding(), true); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2875 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2876 |
emit_int8((unsigned char)0xBE); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2877 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 2878 |
} |
2879 |
||
2880 |
void Assembler::movsd(XMMRegister dst, XMMRegister src) { |
|
2881 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
2882 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
38049 | 2883 |
attributes.set_rex_vex_w_reverted(); |
34162 | 2884 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
2885 |
emit_int8(0x10); |
|
2886 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 2887 |
} |
2888 |
||
2889 |
void Assembler::movsd(XMMRegister dst, Address src) { |
|
2890 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 2891 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
2892 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 2893 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
38049 | 2894 |
attributes.set_rex_vex_w_reverted(); |
34162 | 2895 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
2896 |
emit_int8(0x10); |
|
2897 |
emit_operand(dst, src); |
|
1066 | 2898 |
} |
2899 |
||
2900 |
void Assembler::movsd(Address dst, XMMRegister src) { |
|
2901 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
2902 |
InstructionMark im(this); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
2903 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 2904 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
42014
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
2905 |
attributes.reset_is_clear_context(); |
38049 | 2906 |
attributes.set_rex_vex_w_reverted(); |
34162 | 2907 |
simd_prefix(src, xnoreg, dst, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2908 |
emit_int8(0x11); |
1066 | 2909 |
emit_operand(src, dst); |
2910 |
} |
|
2911 |
||
2912 |
void Assembler::movss(XMMRegister dst, XMMRegister src) { |
|
2913 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
2914 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 2915 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
2916 |
emit_int8(0x10); |
|
2917 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 2918 |
} |
2919 |
||
2920 |
void Assembler::movss(XMMRegister dst, Address src) { |
|
2921 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 2922 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
2923 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 2924 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
2925 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
2926 |
emit_int8(0x10); |
|
2927 |
emit_operand(dst, src); |
|
1066 | 2928 |
} |
2929 |
||
2930 |
void Assembler::movss(Address dst, XMMRegister src) { |
|
2931 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 2932 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
2933 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 2934 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
42014
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
2935 |
attributes.reset_is_clear_context(); |
34162 | 2936 |
simd_prefix(src, xnoreg, dst, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2937 |
emit_int8(0x11); |
1066 | 2938 |
emit_operand(src, dst); |
2939 |
} |
|
2940 |
||
2941 |
void Assembler::movswl(Register dst, Address src) { // movsxw |
|
2942 |
InstructionMark im(this); |
|
2943 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2944 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2945 |
emit_int8((unsigned char)0xBF); |
1066 | 2946 |
emit_operand(dst, src); |
2947 |
} |
|
2948 |
||
2949 |
void Assembler::movswl(Register dst, Register src) { // movsxw |
|
2950 |
int encode = prefix_and_encode(dst->encoding(), src->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2951 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2952 |
emit_int8((unsigned char)0xBF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2953 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 2954 |
} |
2955 |
||
2956 |
void Assembler::movw(Address dst, int imm16) { |
|
2957 |
InstructionMark im(this); |
|
2958 |
||
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2959 |
emit_int8(0x66); // switch to 16-bit mode |
1066 | 2960 |
prefix(dst); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2961 |
emit_int8((unsigned char)0xC7); |
1066 | 2962 |
emit_operand(rax, dst, 2); |
14831
84828ee2a91c
8004536: replace AbstractAssembler emit_word with emit_int16
twisti
parents:
14626
diff
changeset
|
2963 |
emit_int16(imm16); |
1066 | 2964 |
} |
2965 |
||
2966 |
void Assembler::movw(Register dst, Address src) { |
|
2967 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2968 |
emit_int8(0x66); |
1066 | 2969 |
prefix(src, dst); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2970 |
emit_int8((unsigned char)0x8B); |
1066 | 2971 |
emit_operand(dst, src); |
2972 |
} |
|
2973 |
||
2974 |
void Assembler::movw(Address dst, Register src) { |
|
2975 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2976 |
emit_int8(0x66); |
1066 | 2977 |
prefix(dst, src); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2978 |
emit_int8((unsigned char)0x89); |
1066 | 2979 |
emit_operand(src, dst); |
2980 |
} |
|
2981 |
||
2982 |
void Assembler::movzbl(Register dst, Address src) { // movzxb |
|
2983 |
InstructionMark im(this); |
|
2984 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2985 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2986 |
emit_int8((unsigned char)0xB6); |
1066 | 2987 |
emit_operand(dst, src); |
2988 |
} |
|
2989 |
||
2990 |
void Assembler::movzbl(Register dst, Register src) { // movzxb |
|
2991 |
NOT_LP64(assert(src->has_byte_register(), "must have byte register")); |
|
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
2992 |
int encode = prefix_and_encode(dst->encoding(), false, src->encoding(), true); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2993 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2994 |
emit_int8((unsigned char)0xB6); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2995 |
emit_int8(0xC0 | encode); |
1066 | 2996 |
} |
2997 |
||
2998 |
void Assembler::movzwl(Register dst, Address src) { // movzxw |
|
2999 |
InstructionMark im(this); |
|
3000 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3001 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3002 |
emit_int8((unsigned char)0xB7); |
1066 | 3003 |
emit_operand(dst, src); |
3004 |
} |
|
3005 |
||
3006 |
void Assembler::movzwl(Register dst, Register src) { // movzxw |
|
3007 |
int encode = prefix_and_encode(dst->encoding(), src->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3008 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3009 |
emit_int8((unsigned char)0xB7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3010 |
emit_int8(0xC0 | encode); |
1066 | 3011 |
} |
3012 |
||
3013 |
void Assembler::mull(Address src) { |
|
3014 |
InstructionMark im(this); |
|
3015 |
prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3016 |
emit_int8((unsigned char)0xF7); |
1066 | 3017 |
emit_operand(rsp, src); |
3018 |
} |
|
3019 |
||
3020 |
void Assembler::mull(Register src) { |
|
3021 |
int encode = prefix_and_encode(src->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3022 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3023 |
emit_int8((unsigned char)(0xE0 | encode)); |
1066 | 3024 |
} |
3025 |
||
3026 |
void Assembler::mulsd(XMMRegister dst, Address src) { |
|
3027 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 3028 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
3029 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 3030 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
38049 | 3031 |
attributes.set_rex_vex_w_reverted(); |
34162 | 3032 |
simd_prefix(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
3033 |
emit_int8(0x59); |
|
3034 |
emit_operand(dst, src); |
|
1066 | 3035 |
} |
3036 |
||
3037 |
void Assembler::mulsd(XMMRegister dst, XMMRegister src) { |
|
3038 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
3039 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
38049 | 3040 |
attributes.set_rex_vex_w_reverted(); |
34162 | 3041 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
3042 |
emit_int8(0x59); |
|
3043 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 3044 |
} |
3045 |
||
3046 |
void Assembler::mulss(XMMRegister dst, Address src) { |
|
3047 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 3048 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
3049 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 3050 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
3051 |
simd_prefix(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
3052 |
emit_int8(0x59); |
|
3053 |
emit_operand(dst, src); |
|
1066 | 3054 |
} |
3055 |
||
3056 |
void Assembler::mulss(XMMRegister dst, XMMRegister src) { |
|
3057 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
3058 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 3059 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
3060 |
emit_int8(0x59); |
|
3061 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 3062 |
} |
3063 |
||
3064 |
void Assembler::negl(Register dst) { |
|
3065 |
int encode = prefix_and_encode(dst->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3066 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3067 |
emit_int8((unsigned char)(0xD8 | encode)); |
1066 | 3068 |
} |
3069 |
||
1 | 3070 |
void Assembler::nop(int i) { |
1066 | 3071 |
#ifdef ASSERT |
1 | 3072 |
assert(i > 0, " "); |
1066 | 3073 |
// The fancy nops aren't currently recognized by debuggers making it a |
3074 |
// pain to disassemble code while debugging. If asserts are on clearly |
|
3075 |
// speed is not an issue so simply use the single byte traditional nop |
|
3076 |
// to do alignment. |
|
3077 |
||
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3078 |
for (; i > 0 ; i--) emit_int8((unsigned char)0x90); |
1066 | 3079 |
return; |
3080 |
||
3081 |
#endif // ASSERT |
|
3082 |
||
1 | 3083 |
if (UseAddressNop && VM_Version::is_intel()) { |
3084 |
// |
|
3085 |
// Using multi-bytes nops "0x0F 0x1F [address]" for Intel |
|
3086 |
// 1: 0x90 |
|
3087 |
// 2: 0x66 0x90 |
|
3088 |
// 3: 0x66 0x66 0x90 (don't use "0x0F 0x1F 0x00" - need patching safe padding) |
|
3089 |
// 4: 0x0F 0x1F 0x40 0x00 |
|
3090 |
// 5: 0x0F 0x1F 0x44 0x00 0x00 |
|
3091 |
// 6: 0x66 0x0F 0x1F 0x44 0x00 0x00 |
|
3092 |
// 7: 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 |
|
3093 |
// 8: 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
3094 |
// 9: 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
3095 |
// 10: 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
3096 |
// 11: 0x66 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
3097 |
||
3098 |
// The rest coding is Intel specific - don't use consecutive address nops |
|
3099 |
||
3100 |
// 12: 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x66 0x66 0x66 0x90 |
|
3101 |
// 13: 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x66 0x66 0x66 0x90 |
|
3102 |
// 14: 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x66 0x66 0x66 0x90 |
|
3103 |
// 15: 0x66 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x66 0x66 0x66 0x90 |
|
3104 |
||
3105 |
while(i >= 15) { |
|
3106 |
// For Intel don't generate consecutive addess nops (mix with regular nops) |
|
3107 |
i -= 15; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3108 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3109 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3110 |
emit_int8(0x66); // size prefix |
1 | 3111 |
addr_nop_8(); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3112 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3113 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3114 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3115 |
emit_int8((unsigned char)0x90); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3116 |
// nop |
1 | 3117 |
} |
3118 |
switch (i) { |
|
3119 |
case 14: |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3120 |
emit_int8(0x66); // size prefix |
1 | 3121 |
case 13: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3122 |
emit_int8(0x66); // size prefix |
1 | 3123 |
case 12: |
3124 |
addr_nop_8(); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3125 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3126 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3127 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3128 |
emit_int8((unsigned char)0x90); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3129 |
// nop |
1 | 3130 |
break; |
3131 |
case 11: |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3132 |
emit_int8(0x66); // size prefix |
1 | 3133 |
case 10: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3134 |
emit_int8(0x66); // size prefix |
1 | 3135 |
case 9: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3136 |
emit_int8(0x66); // size prefix |
1 | 3137 |
case 8: |
3138 |
addr_nop_8(); |
|
3139 |
break; |
|
3140 |
case 7: |
|
3141 |
addr_nop_7(); |
|
3142 |
break; |
|
3143 |
case 6: |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3144 |
emit_int8(0x66); // size prefix |
1 | 3145 |
case 5: |
3146 |
addr_nop_5(); |
|
3147 |
break; |
|
3148 |
case 4: |
|
3149 |
addr_nop_4(); |
|
3150 |
break; |
|
3151 |
case 3: |
|
3152 |
// Don't use "0x0F 0x1F 0x00" - need patching safe padding |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3153 |
emit_int8(0x66); // size prefix |
1 | 3154 |
case 2: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3155 |
emit_int8(0x66); // size prefix |
1 | 3156 |
case 1: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3157 |
emit_int8((unsigned char)0x90); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3158 |
// nop |
1 | 3159 |
break; |
3160 |
default: |
|
3161 |
assert(i == 0, " "); |
|
3162 |
} |
|
3163 |
return; |
|
3164 |
} |
|
54519 | 3165 |
if (UseAddressNop && VM_Version::is_amd_family()) { |
1 | 3166 |
// |
3167 |
// Using multi-bytes nops "0x0F 0x1F [address]" for AMD. |
|
3168 |
// 1: 0x90 |
|
3169 |
// 2: 0x66 0x90 |
|
3170 |
// 3: 0x66 0x66 0x90 (don't use "0x0F 0x1F 0x00" - need patching safe padding) |
|
3171 |
// 4: 0x0F 0x1F 0x40 0x00 |
|
3172 |
// 5: 0x0F 0x1F 0x44 0x00 0x00 |
|
3173 |
// 6: 0x66 0x0F 0x1F 0x44 0x00 0x00 |
|
3174 |
// 7: 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 |
|
3175 |
// 8: 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
3176 |
// 9: 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
3177 |
// 10: 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
3178 |
// 11: 0x66 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
3179 |
||
3180 |
// The rest coding is AMD specific - use consecutive address nops |
|
3181 |
||
3182 |
// 12: 0x66 0x0F 0x1F 0x44 0x00 0x00 0x66 0x0F 0x1F 0x44 0x00 0x00 |
|
3183 |
// 13: 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 0x66 0x0F 0x1F 0x44 0x00 0x00 |
|
3184 |
// 14: 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 |
|
3185 |
// 15: 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 |
|
3186 |
// 16: 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
3187 |
// Size prefixes (0x66) are added for larger sizes |
|
3188 |
||
3189 |
while(i >= 22) { |
|
3190 |
i -= 11; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3191 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3192 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3193 |
emit_int8(0x66); // size prefix |
1 | 3194 |
addr_nop_8(); |
3195 |
} |
|
3196 |
// Generate first nop for size between 21-12 |
|
3197 |
switch (i) { |
|
3198 |
case 21: |
|
3199 |
i -= 1; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3200 |
emit_int8(0x66); // size prefix |
1 | 3201 |
case 20: |
3202 |
case 19: |
|
3203 |
i -= 1; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3204 |
emit_int8(0x66); // size prefix |
1 | 3205 |
case 18: |
3206 |
case 17: |
|
3207 |
i -= 1; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3208 |
emit_int8(0x66); // size prefix |
1 | 3209 |
case 16: |
3210 |
case 15: |
|
3211 |
i -= 8; |
|
3212 |
addr_nop_8(); |
|
3213 |
break; |
|
3214 |
case 14: |
|
3215 |
case 13: |
|
3216 |
i -= 7; |
|
3217 |
addr_nop_7(); |
|
3218 |
break; |
|
3219 |
case 12: |
|
3220 |
i -= 6; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3221 |
emit_int8(0x66); // size prefix |
1 | 3222 |
addr_nop_5(); |
3223 |
break; |
|
3224 |
default: |
|
3225 |
assert(i < 12, " "); |
|
3226 |
} |
|
3227 |
||
3228 |
// Generate second nop for size between 11-1 |
|
3229 |
switch (i) { |
|
3230 |
case 11: |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3231 |
emit_int8(0x66); // size prefix |
1 | 3232 |
case 10: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3233 |
emit_int8(0x66); // size prefix |
1 | 3234 |
case 9: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3235 |
emit_int8(0x66); // size prefix |
1 | 3236 |
case 8: |
3237 |
addr_nop_8(); |
|
3238 |
break; |
|
3239 |
case 7: |
|
3240 |
addr_nop_7(); |
|
3241 |
break; |
|
3242 |
case 6: |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3243 |
emit_int8(0x66); // size prefix |
1 | 3244 |
case 5: |
3245 |
addr_nop_5(); |
|
3246 |
break; |
|
3247 |
case 4: |
|
3248 |
addr_nop_4(); |
|
3249 |
break; |
|
3250 |
case 3: |
|
3251 |
// Don't use "0x0F 0x1F 0x00" - need patching safe padding |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3252 |
emit_int8(0x66); // size prefix |
1 | 3253 |
case 2: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3254 |
emit_int8(0x66); // size prefix |
1 | 3255 |
case 1: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3256 |
emit_int8((unsigned char)0x90); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3257 |
// nop |
1 | 3258 |
break; |
3259 |
default: |
|
3260 |
assert(i == 0, " "); |
|
3261 |
} |
|
3262 |
return; |
|
3263 |
} |
|
3264 |
||
48489
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3265 |
if (UseAddressNop && VM_Version::is_zx()) { |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3266 |
// |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3267 |
// Using multi-bytes nops "0x0F 0x1F [address]" for ZX |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3268 |
// 1: 0x90 |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3269 |
// 2: 0x66 0x90 |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3270 |
// 3: 0x66 0x66 0x90 (don't use "0x0F 0x1F 0x00" - need patching safe padding) |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3271 |
// 4: 0x0F 0x1F 0x40 0x00 |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3272 |
// 5: 0x0F 0x1F 0x44 0x00 0x00 |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3273 |
// 6: 0x66 0x0F 0x1F 0x44 0x00 0x00 |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3274 |
// 7: 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3275 |
// 8: 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3276 |
// 9: 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3277 |
// 10: 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3278 |
// 11: 0x66 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3279 |
|
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3280 |
// The rest coding is ZX specific - don't use consecutive address nops |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3281 |
|
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3282 |
// 12: 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x66 0x66 0x66 0x90 |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3283 |
// 13: 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x66 0x66 0x66 0x90 |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3284 |
// 14: 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x66 0x66 0x66 0x90 |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3285 |
// 15: 0x66 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x66 0x66 0x66 0x90 |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3286 |
|
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3287 |
while (i >= 15) { |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3288 |
// For ZX don't generate consecutive addess nops (mix with regular nops) |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3289 |
i -= 15; |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3290 |
emit_int8(0x66); // size prefix |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3291 |
emit_int8(0x66); // size prefix |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3292 |
emit_int8(0x66); // size prefix |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3293 |
addr_nop_8(); |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3294 |
emit_int8(0x66); // size prefix |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3295 |
emit_int8(0x66); // size prefix |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3296 |
emit_int8(0x66); // size prefix |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3297 |
emit_int8((unsigned char)0x90); |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3298 |
// nop |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3299 |
} |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3300 |
switch (i) { |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3301 |
case 14: |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3302 |
emit_int8(0x66); // size prefix |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3303 |
case 13: |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3304 |
emit_int8(0x66); // size prefix |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3305 |
case 12: |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3306 |
addr_nop_8(); |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3307 |
emit_int8(0x66); // size prefix |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3308 |
emit_int8(0x66); // size prefix |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3309 |
emit_int8(0x66); // size prefix |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3310 |
emit_int8((unsigned char)0x90); |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3311 |
// nop |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3312 |
break; |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3313 |
case 11: |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3314 |
emit_int8(0x66); // size prefix |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3315 |
case 10: |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3316 |
emit_int8(0x66); // size prefix |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3317 |
case 9: |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3318 |
emit_int8(0x66); // size prefix |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3319 |
case 8: |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3320 |
addr_nop_8(); |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3321 |
break; |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3322 |
case 7: |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3323 |
addr_nop_7(); |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3324 |
break; |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3325 |
case 6: |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3326 |
emit_int8(0x66); // size prefix |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3327 |
case 5: |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3328 |
addr_nop_5(); |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3329 |
break; |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3330 |
case 4: |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3331 |
addr_nop_4(); |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3332 |
break; |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3333 |
case 3: |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3334 |
// Don't use "0x0F 0x1F 0x00" - need patching safe padding |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3335 |
emit_int8(0x66); // size prefix |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3336 |
case 2: |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3337 |
emit_int8(0x66); // size prefix |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3338 |
case 1: |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3339 |
emit_int8((unsigned char)0x90); |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3340 |
// nop |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3341 |
break; |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3342 |
default: |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3343 |
assert(i == 0, " "); |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3344 |
} |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3345 |
return; |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3346 |
} |
a5548cf24286
8194279: support zhaoxin x86 cpu vendor ids CentaurHauls and Shanghai
dholmes
parents:
48309
diff
changeset
|
3347 |
|
1 | 3348 |
// Using nops with size prefixes "0x66 0x90". |
3349 |
// From AMD Optimization Guide: |
|
3350 |
// 1: 0x90 |
|
3351 |
// 2: 0x66 0x90 |
|
3352 |
// 3: 0x66 0x66 0x90 |
|
3353 |
// 4: 0x66 0x66 0x66 0x90 |
|
3354 |
// 5: 0x66 0x66 0x90 0x66 0x90 |
|
3355 |
// 6: 0x66 0x66 0x90 0x66 0x66 0x90 |
|
3356 |
// 7: 0x66 0x66 0x66 0x90 0x66 0x66 0x90 |
|
3357 |
// 8: 0x66 0x66 0x66 0x90 0x66 0x66 0x66 0x90 |
|
3358 |
// 9: 0x66 0x66 0x90 0x66 0x66 0x90 0x66 0x66 0x90 |
|
3359 |
// 10: 0x66 0x66 0x66 0x90 0x66 0x66 0x90 0x66 0x66 0x90 |
|
3360 |
// |
|
3361 |
while(i > 12) { |
|
3362 |
i -= 4; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3363 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3364 |
emit_int8(0x66); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3365 |
emit_int8(0x66); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3366 |
emit_int8((unsigned char)0x90); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3367 |
// nop |
1 | 3368 |
} |
3369 |
// 1 - 12 nops |
|
3370 |
if(i > 8) { |
|
3371 |
if(i > 9) { |
|
3372 |
i -= 1; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3373 |
emit_int8(0x66); |
1 | 3374 |
} |
3375 |
i -= 3; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3376 |
emit_int8(0x66); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3377 |
emit_int8(0x66); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3378 |
emit_int8((unsigned char)0x90); |
1 | 3379 |
} |
3380 |
// 1 - 8 nops |
|
3381 |
if(i > 4) { |
|
3382 |
if(i > 6) { |
|
3383 |
i -= 1; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3384 |
emit_int8(0x66); |
1 | 3385 |
} |
3386 |
i -= 3; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3387 |
emit_int8(0x66); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3388 |
emit_int8(0x66); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3389 |
emit_int8((unsigned char)0x90); |
1 | 3390 |
} |
3391 |
switch (i) { |
|
3392 |
case 4: |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3393 |
emit_int8(0x66); |
1 | 3394 |
case 3: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3395 |
emit_int8(0x66); |
1 | 3396 |
case 2: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3397 |
emit_int8(0x66); |
1 | 3398 |
case 1: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3399 |
emit_int8((unsigned char)0x90); |
1 | 3400 |
break; |
3401 |
default: |
|
3402 |
assert(i == 0, " "); |
|
3403 |
} |
|
3404 |
} |
|
3405 |
||
1066 | 3406 |
void Assembler::notl(Register dst) { |
3407 |
int encode = prefix_and_encode(dst->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3408 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3409 |
emit_int8((unsigned char)(0xD0 | encode)); |
1066 | 3410 |
} |
3411 |
||
3412 |
void Assembler::orl(Address dst, int32_t imm32) { |
|
3413 |
InstructionMark im(this); |
|
3414 |
prefix(dst); |
|
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
3415 |
emit_arith_operand(0x81, rcx, dst, imm32); |
1066 | 3416 |
} |
3417 |
||
3418 |
void Assembler::orl(Register dst, int32_t imm32) { |
|
3419 |
prefix(dst); |
|
3420 |
emit_arith(0x81, 0xC8, dst, imm32); |
|
3421 |
} |
|
3422 |
||
3423 |
void Assembler::orl(Register dst, Address src) { |
|
3424 |
InstructionMark im(this); |
|
3425 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3426 |
emit_int8(0x0B); |
1066 | 3427 |
emit_operand(dst, src); |
3428 |
} |
|
3429 |
||
3430 |
void Assembler::orl(Register dst, Register src) { |
|
3431 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
|
3432 |
emit_arith(0x0B, 0xC0, dst, src); |
|
3433 |
} |
|
3434 |
||
31129
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
3435 |
void Assembler::orl(Address dst, Register src) { |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
3436 |
InstructionMark im(this); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
3437 |
prefix(dst, src); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
3438 |
emit_int8(0x09); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
3439 |
emit_operand(src, dst); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
3440 |
} |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
3441 |
|
50577
bf7e2684cd0a
8204240: Extend MDO to allow more reasons to be recorded per bci
roland
parents:
50103
diff
changeset
|
3442 |
void Assembler::orb(Address dst, int imm8) { |
bf7e2684cd0a
8204240: Extend MDO to allow more reasons to be recorded per bci
roland
parents:
50103
diff
changeset
|
3443 |
InstructionMark im(this); |
bf7e2684cd0a
8204240: Extend MDO to allow more reasons to be recorded per bci
roland
parents:
50103
diff
changeset
|
3444 |
prefix(dst); |
bf7e2684cd0a
8204240: Extend MDO to allow more reasons to be recorded per bci
roland
parents:
50103
diff
changeset
|
3445 |
emit_int8((unsigned char)0x80); |
bf7e2684cd0a
8204240: Extend MDO to allow more reasons to be recorded per bci
roland
parents:
50103
diff
changeset
|
3446 |
emit_operand(rcx, dst, 1); |
bf7e2684cd0a
8204240: Extend MDO to allow more reasons to be recorded per bci
roland
parents:
50103
diff
changeset
|
3447 |
emit_int8(imm8); |
bf7e2684cd0a
8204240: Extend MDO to allow more reasons to be recorded per bci
roland
parents:
50103
diff
changeset
|
3448 |
} |
bf7e2684cd0a
8204240: Extend MDO to allow more reasons to be recorded per bci
roland
parents:
50103
diff
changeset
|
3449 |
|
11427 | 3450 |
void Assembler::packuswb(XMMRegister dst, Address src) { |
3451 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
3452 |
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); |
|
34162 | 3453 |
InstructionMark im(this); |
35113 | 3454 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 3455 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
3456 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3457 |
emit_int8(0x67); |
|
3458 |
emit_operand(dst, src); |
|
11427 | 3459 |
} |
3460 |
||
3461 |
void Assembler::packuswb(XMMRegister dst, XMMRegister src) { |
|
3462 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
35113 | 3463 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 3464 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
3465 |
emit_int8(0x67); |
|
3466 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 3467 |
} |
3468 |
||
3469 |
void Assembler::vpackuswb(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
3470 |
assert(UseAVX > 0, "some form of AVX must be enabled"); |
|
35113 | 3471 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
3472 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 3473 |
emit_int8(0x67); |
3474 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 3475 |
} |
3476 |
||
3477 |
void Assembler::vpermq(XMMRegister dst, XMMRegister src, int imm8, int vector_len) { |
|
15612
d4073ad8ce3d
8007708: compiler/6855215 assert(VM_Version::supports_sse4_2())
kvn
parents:
15483
diff
changeset
|
3478 |
assert(VM_Version::supports_avx2(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
3479 |
InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
3480 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
15612
d4073ad8ce3d
8007708: compiler/6855215 assert(VM_Version::supports_sse4_2())
kvn
parents:
15483
diff
changeset
|
3481 |
emit_int8(0x00); |
54750 | 3482 |
emit_int8((unsigned char)(0xC0 | encode)); |
15612
d4073ad8ce3d
8007708: compiler/6855215 assert(VM_Version::supports_sse4_2())
kvn
parents:
15483
diff
changeset
|
3483 |
emit_int8(imm8); |
15242
695bb216be99
6896617: Optimize sun.nio.cs.ISO_8859_1$Encode.encodeArrayLoop() on x86
kvn
parents:
15117
diff
changeset
|
3484 |
} |
695bb216be99
6896617: Optimize sun.nio.cs.ISO_8859_1$Encode.encodeArrayLoop() on x86
kvn
parents:
15117
diff
changeset
|
3485 |
|
54750 | 3486 |
void Assembler::vpermq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
3487 |
assert(UseAVX > 2, "requires AVX512F"); |
|
3488 |
InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
|
3489 |
attributes.set_is_evex_instruction(); |
|
3490 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
3491 |
emit_int8((unsigned char)0x36); |
|
3492 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3493 |
} |
|
3494 |
||
38135
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
3495 |
void Assembler::vperm2i128(XMMRegister dst, XMMRegister nds, XMMRegister src, int imm8) { |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
3496 |
assert(VM_Version::supports_avx2(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
3497 |
InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
38135
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
3498 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
3499 |
emit_int8(0x46); |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
3500 |
emit_int8(0xC0 | encode); |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
3501 |
emit_int8(imm8); |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
3502 |
} |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
3503 |
|
42039 | 3504 |
void Assembler::vperm2f128(XMMRegister dst, XMMRegister nds, XMMRegister src, int imm8) { |
3505 |
assert(VM_Version::supports_avx(), ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
3506 |
InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
42039 | 3507 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
3508 |
emit_int8(0x06); |
|
3509 |
emit_int8(0xC0 | encode); |
|
3510 |
emit_int8(imm8); |
|
3511 |
} |
|
3512 |
||
50860
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
3513 |
void Assembler::evpermi2q(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
3514 |
assert(VM_Version::supports_evex(), ""); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
3515 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
3516 |
attributes.set_is_evex_instruction(); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
3517 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
3518 |
emit_int8(0x76); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
3519 |
emit_int8((unsigned char)(0xC0 | encode)); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
3520 |
} |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
3521 |
|
38135
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
3522 |
|
23491 | 3523 |
void Assembler::pause() { |
3524 |
emit_int8((unsigned char)0xF3); |
|
3525 |
emit_int8((unsigned char)0x90); |
|
3526 |
} |
|
3527 |
||
46525
3a5c833a43de
8176506: C2: loop unswitching and unsafe accesses cause crash
roland
parents:
46440
diff
changeset
|
3528 |
void Assembler::ud2() { |
3a5c833a43de
8176506: C2: loop unswitching and unsafe accesses cause crash
roland
parents:
46440
diff
changeset
|
3529 |
emit_int8(0x0F); |
3a5c833a43de
8176506: C2: loop unswitching and unsafe accesses cause crash
roland
parents:
46440
diff
changeset
|
3530 |
emit_int8(0x0B); |
3a5c833a43de
8176506: C2: loop unswitching and unsafe accesses cause crash
roland
parents:
46440
diff
changeset
|
3531 |
} |
3a5c833a43de
8176506: C2: loop unswitching and unsafe accesses cause crash
roland
parents:
46440
diff
changeset
|
3532 |
|
2348 | 3533 |
void Assembler::pcmpestri(XMMRegister dst, Address src, int imm8) { |
3534 |
assert(VM_Version::supports_sse4_2(), ""); |
|
11427 | 3535 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
3536 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 3537 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3538 |
emit_int8(0x61); |
2348 | 3539 |
emit_operand(dst, src); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3540 |
emit_int8(imm8); |
2348 | 3541 |
} |
3542 |
||
3543 |
void Assembler::pcmpestri(XMMRegister dst, XMMRegister src, int imm8) { |
|
3544 |
assert(VM_Version::supports_sse4_2(), ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
3545 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 3546 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3547 |
emit_int8(0x61); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3548 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3549 |
emit_int8(imm8); |
2348 | 3550 |
} |
3551 |
||
34203 | 3552 |
// In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst |
3553 |
void Assembler::pcmpeqb(XMMRegister dst, XMMRegister src) { |
|
35113 | 3554 |
assert(VM_Version::supports_sse2(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
3555 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34203 | 3556 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
3557 |
emit_int8(0x74); |
|
3558 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3559 |
} |
|
3560 |
||
3561 |
// In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst |
|
3562 |
void Assembler::vpcmpeqb(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
3563 |
assert(VM_Version::supports_avx(), ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
3564 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
3565 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34203 | 3566 |
emit_int8(0x74); |
3567 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3568 |
} |
|
3569 |
||
3570 |
// In this context, kdst is written the mask used to process the equal components |
|
3571 |
void Assembler::evpcmpeqb(KRegister kdst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
3572 |
assert(VM_Version::supports_avx512bw(), ""); |
|
35113 | 3573 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
36837 | 3574 |
attributes.set_is_evex_instruction(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
3575 |
int encode = vex_prefix_and_encode(kdst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34203 | 3576 |
emit_int8(0x74); |
3577 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3578 |
} |
|
3579 |
||
38239
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3580 |
void Assembler::evpcmpgtb(KRegister kdst, XMMRegister nds, Address src, int vector_len) { |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3581 |
assert(VM_Version::supports_avx512vlbw(), ""); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3582 |
InstructionMark im(this); |
51857 | 3583 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38239
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3584 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3585 |
attributes.set_is_evex_instruction(); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3586 |
int dst_enc = kdst->encoding(); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3587 |
vex_prefix(src, nds->encoding(), dst_enc, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3588 |
emit_int8(0x64); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3589 |
emit_operand(as_Register(dst_enc), src); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3590 |
} |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3591 |
|
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3592 |
void Assembler::evpcmpgtb(KRegister kdst, KRegister mask, XMMRegister nds, Address src, int vector_len) { |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3593 |
assert(VM_Version::supports_avx512vlbw(), ""); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3594 |
InstructionMark im(this); |
51857 | 3595 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
38239
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3596 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
42014
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
3597 |
attributes.reset_is_clear_context(); |
38239
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3598 |
attributes.set_embedded_opmask_register_specifier(mask); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3599 |
attributes.set_is_evex_instruction(); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3600 |
int dst_enc = kdst->encoding(); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3601 |
vex_prefix(src, nds->encoding(), dst_enc, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3602 |
emit_int8(0x64); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3603 |
emit_operand(as_Register(dst_enc), src); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3604 |
} |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3605 |
|
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3606 |
void Assembler::evpcmpuw(KRegister kdst, XMMRegister nds, XMMRegister src, ComparisonPredicate vcc, int vector_len) { |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3607 |
assert(VM_Version::supports_avx512vlbw(), ""); |
51857 | 3608 |
InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38239
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3609 |
attributes.set_is_evex_instruction(); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3610 |
int encode = vex_prefix_and_encode(kdst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3611 |
emit_int8(0x3E); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3612 |
emit_int8((unsigned char)(0xC0 | encode)); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3613 |
emit_int8(vcc); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3614 |
} |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3615 |
|
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3616 |
void Assembler::evpcmpuw(KRegister kdst, KRegister mask, XMMRegister nds, XMMRegister src, ComparisonPredicate vcc, int vector_len) { |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3617 |
assert(VM_Version::supports_avx512vlbw(), ""); |
51857 | 3618 |
InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
42014
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
3619 |
attributes.reset_is_clear_context(); |
38239
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3620 |
attributes.set_embedded_opmask_register_specifier(mask); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3621 |
attributes.set_is_evex_instruction(); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3622 |
int encode = vex_prefix_and_encode(kdst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3623 |
emit_int8(0x3E); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3624 |
emit_int8((unsigned char)(0xC0 | encode)); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3625 |
emit_int8(vcc); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3626 |
} |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3627 |
|
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3628 |
void Assembler::evpcmpuw(KRegister kdst, XMMRegister nds, Address src, ComparisonPredicate vcc, int vector_len) { |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3629 |
assert(VM_Version::supports_avx512vlbw(), ""); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3630 |
InstructionMark im(this); |
51857 | 3631 |
InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38239
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3632 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3633 |
attributes.set_is_evex_instruction(); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3634 |
int dst_enc = kdst->encoding(); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3635 |
vex_prefix(src, nds->encoding(), kdst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3636 |
emit_int8(0x3E); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3637 |
emit_operand(as_Register(dst_enc), src); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3638 |
emit_int8(vcc); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3639 |
} |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3640 |
|
35113 | 3641 |
void Assembler::evpcmpeqb(KRegister kdst, XMMRegister nds, Address src, int vector_len) { |
3642 |
assert(VM_Version::supports_avx512bw(), ""); |
|
3643 |
InstructionMark im(this); |
|
51857 | 3644 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
36837 | 3645 |
attributes.set_is_evex_instruction(); |
35113 | 3646 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
3647 |
int dst_enc = kdst->encoding(); |
|
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
3648 |
vex_prefix(src, nds->encoding(), dst_enc, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
35113 | 3649 |
emit_int8(0x74); |
3650 |
emit_operand(as_Register(dst_enc), src); |
|
3651 |
} |
|
3652 |
||
38239
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3653 |
void Assembler::evpcmpeqb(KRegister kdst, KRegister mask, XMMRegister nds, Address src, int vector_len) { |
38138
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
3654 |
assert(VM_Version::supports_avx512vlbw(), ""); |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
3655 |
InstructionMark im(this); |
51857 | 3656 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_reg_mask */ false, /* uses_vl */ true); |
38138
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
3657 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
42014
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
3658 |
attributes.reset_is_clear_context(); |
38138
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
3659 |
attributes.set_embedded_opmask_register_specifier(mask); |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
3660 |
attributes.set_is_evex_instruction(); |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
3661 |
vex_prefix(src, nds->encoding(), kdst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
3662 |
emit_int8(0x74); |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
3663 |
emit_operand(as_Register(kdst->encoding()), src); |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
3664 |
} |
8514e24123c8
8154975: Update for vectorizedMismatch with AVX512
vdeshpande
parents:
38135
diff
changeset
|
3665 |
|
34203 | 3666 |
// In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst |
33628 | 3667 |
void Assembler::pcmpeqw(XMMRegister dst, XMMRegister src) { |
35113 | 3668 |
assert(VM_Version::supports_sse2(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
3669 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 3670 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
3671 |
emit_int8(0x75); |
|
3672 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
33628 | 3673 |
} |
3674 |
||
34203 | 3675 |
// In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst |
33628 | 3676 |
void Assembler::vpcmpeqw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
34162 | 3677 |
assert(VM_Version::supports_avx(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
3678 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
3679 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 3680 |
emit_int8(0x75); |
3681 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
33628 | 3682 |
} |
3683 |
||
34203 | 3684 |
// In this context, kdst is written the mask used to process the equal components |
3685 |
void Assembler::evpcmpeqw(KRegister kdst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
3686 |
assert(VM_Version::supports_avx512bw(), ""); |
|
35113 | 3687 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
36837 | 3688 |
attributes.set_is_evex_instruction(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
3689 |
int encode = vex_prefix_and_encode(kdst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34203 | 3690 |
emit_int8(0x75); |
3691 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3692 |
} |
|
3693 |
||
35113 | 3694 |
void Assembler::evpcmpeqw(KRegister kdst, XMMRegister nds, Address src, int vector_len) { |
3695 |
assert(VM_Version::supports_avx512bw(), ""); |
|
3696 |
InstructionMark im(this); |
|
3697 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
|
3698 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
|
36837 | 3699 |
attributes.set_is_evex_instruction(); |
35113 | 3700 |
int dst_enc = kdst->encoding(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
3701 |
vex_prefix(src, nds->encoding(), dst_enc, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
35113 | 3702 |
emit_int8(0x75); |
3703 |
emit_operand(as_Register(dst_enc), src); |
|
3704 |
} |
|
3705 |
||
34203 | 3706 |
// In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst |
3707 |
void Assembler::pcmpeqd(XMMRegister dst, XMMRegister src) { |
|
35113 | 3708 |
assert(VM_Version::supports_sse2(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
3709 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34203 | 3710 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
3711 |
emit_int8(0x76); |
|
3712 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3713 |
} |
|
3714 |
||
3715 |
// In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst |
|
3716 |
void Assembler::vpcmpeqd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
3717 |
assert(VM_Version::supports_avx(), ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
3718 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
3719 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34203 | 3720 |
emit_int8(0x76); |
3721 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3722 |
} |
|
3723 |
||
3724 |
// In this context, kdst is written the mask used to process the equal components |
|
3725 |
void Assembler::evpcmpeqd(KRegister kdst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
3726 |
assert(VM_Version::supports_evex(), ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
3727 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
36837 | 3728 |
attributes.set_is_evex_instruction(); |
42014
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
3729 |
attributes.reset_is_clear_context(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
3730 |
int encode = vex_prefix_and_encode(kdst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34203 | 3731 |
emit_int8(0x76); |
3732 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3733 |
} |
|
3734 |
||
35113 | 3735 |
void Assembler::evpcmpeqd(KRegister kdst, XMMRegister nds, Address src, int vector_len) { |
3736 |
assert(VM_Version::supports_evex(), ""); |
|
3737 |
InstructionMark im(this); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
3738 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
35113 | 3739 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
42014
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
3740 |
attributes.reset_is_clear_context(); |
36837 | 3741 |
attributes.set_is_evex_instruction(); |
35113 | 3742 |
int dst_enc = kdst->encoding(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
3743 |
vex_prefix(src, nds->encoding(), dst_enc, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
35113 | 3744 |
emit_int8(0x76); |
3745 |
emit_operand(as_Register(dst_enc), src); |
|
3746 |
} |
|
3747 |
||
34203 | 3748 |
// In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst |
3749 |
void Assembler::pcmpeqq(XMMRegister dst, XMMRegister src) { |
|
35113 | 3750 |
assert(VM_Version::supports_sse4_1(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
3751 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34203 | 3752 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
3753 |
emit_int8(0x29); |
|
3754 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3755 |
} |
|
3756 |
||
3757 |
// In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst |
|
3758 |
void Assembler::vpcmpeqq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
3759 |
assert(VM_Version::supports_avx(), ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
3760 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
3761 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
34203 | 3762 |
emit_int8(0x29); |
3763 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3764 |
} |
|
3765 |
||
3766 |
// In this context, kdst is written the mask used to process the equal components |
|
3767 |
void Assembler::evpcmpeqq(KRegister kdst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
3768 |
assert(VM_Version::supports_evex(), ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
3769 |
InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
42014
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
3770 |
attributes.reset_is_clear_context(); |
36837 | 3771 |
attributes.set_is_evex_instruction(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
3772 |
int encode = vex_prefix_and_encode(kdst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
34203 | 3773 |
emit_int8(0x29); |
3774 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3775 |
} |
|
3776 |
||
3777 |
// In this context, kdst is written the mask used to process the equal components |
|
3778 |
void Assembler::evpcmpeqq(KRegister kdst, XMMRegister nds, Address src, int vector_len) { |
|
3779 |
assert(VM_Version::supports_evex(), ""); |
|
3780 |
InstructionMark im(this); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
3781 |
InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
42014
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
3782 |
attributes.reset_is_clear_context(); |
36837 | 3783 |
attributes.set_is_evex_instruction(); |
34203 | 3784 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
3785 |
int dst_enc = kdst->encoding(); |
|
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
3786 |
vex_prefix(src, nds->encoding(), dst_enc, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
34203 | 3787 |
emit_int8(0x29); |
3788 |
emit_operand(as_Register(dst_enc), src); |
|
3789 |
} |
|
3790 |
||
33628 | 3791 |
void Assembler::pmovmskb(Register dst, XMMRegister src) { |
3792 |
assert(VM_Version::supports_sse2(), ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
3793 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 3794 |
int encode = simd_prefix_and_encode(as_XMMRegister(dst->encoding()), xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
33628 | 3795 |
emit_int8((unsigned char)0xD7); |
3796 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3797 |
} |
|
3798 |
||
3799 |
void Assembler::vpmovmskb(Register dst, XMMRegister src) { |
|
3800 |
assert(VM_Version::supports_avx2(), ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
3801 |
InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 3802 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
33628 | 3803 |
emit_int8((unsigned char)0xD7); |
3804 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3805 |
} |
|
3806 |
||
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3807 |
void Assembler::pextrd(Register dst, XMMRegister src, int imm8) { |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3808 |
assert(VM_Version::supports_sse4_1(), ""); |
51857 | 3809 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
35154 | 3810 |
int encode = simd_prefix_and_encode(src, xnoreg, as_XMMRegister(dst->encoding()), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3811 |
emit_int8(0x16); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3812 |
emit_int8((unsigned char)(0xC0 | encode)); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3813 |
emit_int8(imm8); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3814 |
} |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3815 |
|
35154 | 3816 |
void Assembler::pextrd(Address dst, XMMRegister src, int imm8) { |
3817 |
assert(VM_Version::supports_sse4_1(), ""); |
|
51857 | 3818 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
35154 | 3819 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
3820 |
simd_prefix(src, xnoreg, dst, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
3821 |
emit_int8(0x16); |
|
3822 |
emit_operand(src, dst); |
|
3823 |
emit_int8(imm8); |
|
3824 |
} |
|
3825 |
||
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3826 |
void Assembler::pextrq(Register dst, XMMRegister src, int imm8) { |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3827 |
assert(VM_Version::supports_sse4_1(), ""); |
51857 | 3828 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
35154 | 3829 |
int encode = simd_prefix_and_encode(src, xnoreg, as_XMMRegister(dst->encoding()), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3830 |
emit_int8(0x16); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3831 |
emit_int8((unsigned char)(0xC0 | encode)); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3832 |
emit_int8(imm8); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3833 |
} |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3834 |
|
35154 | 3835 |
void Assembler::pextrq(Address dst, XMMRegister src, int imm8) { |
3836 |
assert(VM_Version::supports_sse4_1(), ""); |
|
51857 | 3837 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
35154 | 3838 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
3839 |
simd_prefix(src, xnoreg, dst, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
3840 |
emit_int8(0x16); |
|
3841 |
emit_operand(src, dst); |
|
3842 |
emit_int8(imm8); |
|
3843 |
} |
|
3844 |
||
33089 | 3845 |
void Assembler::pextrw(Register dst, XMMRegister src, int imm8) { |
3846 |
assert(VM_Version::supports_sse2(), ""); |
|
51857 | 3847 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 3848 |
int encode = simd_prefix_and_encode(as_XMMRegister(dst->encoding()), xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
33169
d9dc5d6fdb31
8139454: java/lang/Math/WorstCaseTests.java crashes on Linux-amd64
iveresov
parents:
33160
diff
changeset
|
3849 |
emit_int8((unsigned char)0xC5); |
33089 | 3850 |
emit_int8((unsigned char)(0xC0 | encode)); |
3851 |
emit_int8(imm8); |
|
3852 |
} |
|
3853 |
||
35154 | 3854 |
void Assembler::pextrw(Address dst, XMMRegister src, int imm8) { |
3855 |
assert(VM_Version::supports_sse4_1(), ""); |
|
51857 | 3856 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
35154 | 3857 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_16bit); |
3858 |
simd_prefix(src, xnoreg, dst, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
3859 |
emit_int8((unsigned char)0x15); |
|
3860 |
emit_operand(src, dst); |
|
3861 |
emit_int8(imm8); |
|
3862 |
} |
|
3863 |
||
3864 |
void Assembler::pextrb(Address dst, XMMRegister src, int imm8) { |
|
3865 |
assert(VM_Version::supports_sse4_1(), ""); |
|
51857 | 3866 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
35154 | 3867 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_8bit); |
3868 |
simd_prefix(src, xnoreg, dst, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
3869 |
emit_int8(0x14); |
|
3870 |
emit_operand(src, dst); |
|
3871 |
emit_int8(imm8); |
|
3872 |
} |
|
3873 |
||
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3874 |
void Assembler::pinsrd(XMMRegister dst, Register src, int imm8) { |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3875 |
assert(VM_Version::supports_sse4_1(), ""); |
51857 | 3876 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 3877 |
int encode = simd_prefix_and_encode(dst, dst, as_XMMRegister(src->encoding()), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3878 |
emit_int8(0x22); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3879 |
emit_int8((unsigned char)(0xC0 | encode)); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3880 |
emit_int8(imm8); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3881 |
} |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3882 |
|
35154 | 3883 |
void Assembler::pinsrd(XMMRegister dst, Address src, int imm8) { |
3884 |
assert(VM_Version::supports_sse4_1(), ""); |
|
51857 | 3885 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
35154 | 3886 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
3887 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
3888 |
emit_int8(0x22); |
|
3889 |
emit_operand(dst,src); |
|
3890 |
emit_int8(imm8); |
|
3891 |
} |
|
3892 |
||
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3893 |
void Assembler::pinsrq(XMMRegister dst, Register src, int imm8) { |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3894 |
assert(VM_Version::supports_sse4_1(), ""); |
51857 | 3895 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 3896 |
int encode = simd_prefix_and_encode(dst, dst, as_XMMRegister(src->encoding()), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3897 |
emit_int8(0x22); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3898 |
emit_int8((unsigned char)(0xC0 | encode)); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3899 |
emit_int8(imm8); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3900 |
} |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3901 |
|
35154 | 3902 |
void Assembler::pinsrq(XMMRegister dst, Address src, int imm8) { |
3903 |
assert(VM_Version::supports_sse4_1(), ""); |
|
51857 | 3904 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
35154 | 3905 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
3906 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
3907 |
emit_int8(0x22); |
|
3908 |
emit_operand(dst, src); |
|
3909 |
emit_int8(imm8); |
|
3910 |
} |
|
3911 |
||
33089 | 3912 |
void Assembler::pinsrw(XMMRegister dst, Register src, int imm8) { |
3913 |
assert(VM_Version::supports_sse2(), ""); |
|
51857 | 3914 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 3915 |
int encode = simd_prefix_and_encode(dst, dst, as_XMMRegister(src->encoding()), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
33089 | 3916 |
emit_int8((unsigned char)0xC4); |
3917 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3918 |
emit_int8(imm8); |
|
3919 |
} |
|
3920 |
||
35154 | 3921 |
void Assembler::pinsrw(XMMRegister dst, Address src, int imm8) { |
3922 |
assert(VM_Version::supports_sse2(), ""); |
|
51857 | 3923 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
35154 | 3924 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_16bit); |
3925 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3926 |
emit_int8((unsigned char)0xC4); |
|
3927 |
emit_operand(dst, src); |
|
3928 |
emit_int8(imm8); |
|
3929 |
} |
|
3930 |
||
3931 |
void Assembler::pinsrb(XMMRegister dst, Address src, int imm8) { |
|
3932 |
assert(VM_Version::supports_sse4_1(), ""); |
|
51857 | 3933 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
35154 | 3934 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_8bit); |
3935 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
3936 |
emit_int8(0x20); |
|
3937 |
emit_operand(dst, src); |
|
3938 |
emit_int8(imm8); |
|
3939 |
} |
|
3940 |
||
11427 | 3941 |
void Assembler::pmovzxbw(XMMRegister dst, Address src) { |
3942 |
assert(VM_Version::supports_sse4_1(), ""); |
|
34162 | 3943 |
InstructionMark im(this); |
51857 | 3944 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 3945 |
attributes.set_address_attributes(/* tuple_type */ EVEX_HVM, /* input_size_in_bits */ EVEX_NObit); |
3946 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3947 |
emit_int8(0x30); |
11427 | 3948 |
emit_operand(dst, src); |
3949 |
} |
|
3950 |
||
3951 |
void Assembler::pmovzxbw(XMMRegister dst, XMMRegister src) { |
|
3952 |
assert(VM_Version::supports_sse4_1(), ""); |
|
51857 | 3953 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 3954 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3955 |
emit_int8(0x30); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3956 |
emit_int8((unsigned char)(0xC0 | encode)); |
11427 | 3957 |
} |
3958 |
||
54750 | 3959 |
void Assembler::pmovsxbw(XMMRegister dst, XMMRegister src) { |
3960 |
assert(VM_Version::supports_sse4_1(), ""); |
|
3961 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
|
3962 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
3963 |
emit_int8(0x20); |
|
3964 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3965 |
} |
|
3966 |
||
34203 | 3967 |
void Assembler::vpmovzxbw(XMMRegister dst, Address src, int vector_len) { |
33628 | 3968 |
assert(VM_Version::supports_avx(), ""); |
3969 |
InstructionMark im(this); |
|
3970 |
assert(dst != xnoreg, "sanity"); |
|
51857 | 3971 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 3972 |
attributes.set_address_attributes(/* tuple_type */ EVEX_HVM, /* input_size_in_bits */ EVEX_NObit); |
3973 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
33628 | 3974 |
emit_int8(0x30); |
3975 |
emit_operand(dst, src); |
|
3976 |
} |
|
3977 |
||
50860
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
3978 |
void Assembler::vpmovzxbw(XMMRegister dst, XMMRegister src, int vector_len) { |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
3979 |
assert(vector_len == AVX_128bit? VM_Version::supports_avx() : |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
3980 |
vector_len == AVX_256bit? VM_Version::supports_avx2() : |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
3981 |
vector_len == AVX_512bit? VM_Version::supports_avx512bw() : 0, ""); |
51857 | 3982 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
50860
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
3983 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
3984 |
emit_int8(0x30); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
3985 |
emit_int8((unsigned char) (0xC0 | encode)); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
3986 |
} |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
3987 |
|
54750 | 3988 |
void Assembler::vpmovsxbw(XMMRegister dst, XMMRegister src, int vector_len) { |
3989 |
assert(vector_len == AVX_128bit? VM_Version::supports_avx() : |
|
3990 |
vector_len == AVX_256bit? VM_Version::supports_avx2() : |
|
3991 |
vector_len == AVX_512bit? VM_Version::supports_avx512bw() : 0, ""); |
|
3992 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
|
3993 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
3994 |
emit_int8(0x20); |
|
3995 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3996 |
} |
|
50860
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
3997 |
|
38239
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3998 |
void Assembler::evpmovzxbw(XMMRegister dst, KRegister mask, Address src, int vector_len) { |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
3999 |
assert(VM_Version::supports_avx512vlbw(), ""); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4000 |
assert(dst != xnoreg, "sanity"); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4001 |
InstructionMark im(this); |
51857 | 4002 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
38239
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4003 |
attributes.set_address_attributes(/* tuple_type */ EVEX_HVM, /* input_size_in_bits */ EVEX_NObit); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4004 |
attributes.set_embedded_opmask_register_specifier(mask); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4005 |
attributes.set_is_evex_instruction(); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4006 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4007 |
emit_int8(0x30); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4008 |
emit_operand(dst, src); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4009 |
} |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4010 |
void Assembler::evpmovwb(Address dst, XMMRegister src, int vector_len) { |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4011 |
assert(VM_Version::supports_avx512vlbw(), ""); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4012 |
assert(src != xnoreg, "sanity"); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4013 |
InstructionMark im(this); |
51857 | 4014 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38239
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4015 |
attributes.set_address_attributes(/* tuple_type */ EVEX_HVM, /* input_size_in_bits */ EVEX_NObit); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4016 |
attributes.set_is_evex_instruction(); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4017 |
vex_prefix(dst, 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F_38, &attributes); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4018 |
emit_int8(0x30); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4019 |
emit_operand(src, dst); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4020 |
} |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4021 |
|
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4022 |
void Assembler::evpmovwb(Address dst, KRegister mask, XMMRegister src, int vector_len) { |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4023 |
assert(VM_Version::supports_avx512vlbw(), ""); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4024 |
assert(src != xnoreg, "sanity"); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4025 |
InstructionMark im(this); |
51857 | 4026 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
38239
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4027 |
attributes.set_address_attributes(/* tuple_type */ EVEX_HVM, /* input_size_in_bits */ EVEX_NObit); |
42014
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
4028 |
attributes.reset_is_clear_context(); |
38239
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4029 |
attributes.set_embedded_opmask_register_specifier(mask); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4030 |
attributes.set_is_evex_instruction(); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4031 |
vex_prefix(dst, 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F_38, &attributes); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4032 |
emit_int8(0x30); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4033 |
emit_operand(src, dst); |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4034 |
} |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
4035 |
|
50860
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
4036 |
void Assembler::evpmovdb(Address dst, XMMRegister src, int vector_len) { |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
4037 |
assert(VM_Version::supports_evex(), ""); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
4038 |
assert(src != xnoreg, "sanity"); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
4039 |
InstructionMark im(this); |
51857 | 4040 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
50860
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
4041 |
attributes.set_address_attributes(/* tuple_type */ EVEX_QVM, /* input_size_in_bits */ EVEX_NObit); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
4042 |
attributes.set_is_evex_instruction(); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
4043 |
vex_prefix(dst, 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F_38, &attributes); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
4044 |
emit_int8(0x31); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
4045 |
emit_operand(src, dst); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
4046 |
} |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
4047 |
|
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
4048 |
void Assembler::vpmovzxwd(XMMRegister dst, XMMRegister src, int vector_len) { |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
4049 |
assert(vector_len == AVX_128bit? VM_Version::supports_avx() : |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
4050 |
vector_len == AVX_256bit? VM_Version::supports_avx2() : |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
4051 |
vector_len == AVX_512bit? VM_Version::supports_evex() : 0, " "); |
51857 | 4052 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
50860
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
4053 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
4054 |
emit_int8(0x33); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
4055 |
emit_int8((unsigned char)(0xC0 | encode)); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
4056 |
} |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
4057 |
|
52992 | 4058 |
void Assembler::pmaddwd(XMMRegister dst, XMMRegister src) { |
4059 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
4060 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
|
4061 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4062 |
emit_int8((unsigned char)0xF5); |
|
4063 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
4064 |
} |
|
4065 |
||
4066 |
void Assembler::vpmaddwd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
4067 |
assert(vector_len == AVX_128bit ? VM_Version::supports_avx() : |
|
4068 |
(vector_len == AVX_256bit ? VM_Version::supports_avx2() : |
|
4069 |
(vector_len == AVX_512bit ? VM_Version::supports_evex() : 0)), ""); |
|
4070 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
|
4071 |
int encode = simd_prefix_and_encode(dst, nds, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4072 |
emit_int8((unsigned char)0xF5); |
|
4073 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
4074 |
} |
|
4075 |
||
4076 |
void Assembler::evpdpwssd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
4077 |
assert(VM_Version::supports_evex(), ""); |
|
4078 |
assert(VM_Version::supports_vnni(), "must support vnni"); |
|
4079 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
|
4080 |
attributes.set_is_evex_instruction(); |
|
4081 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
4082 |
emit_int8(0x52); |
|
4083 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
4084 |
} |
|
4085 |
||
1066 | 4086 |
// generic |
4087 |
void Assembler::pop(Register dst) { |
|
4088 |
int encode = prefix_and_encode(dst->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4089 |
emit_int8(0x58 | encode); |
1066 | 4090 |
} |
4091 |
||
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
4092 |
void Assembler::popcntl(Register dst, Address src) { |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
4093 |
assert(VM_Version::supports_popcnt(), "must support"); |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
4094 |
InstructionMark im(this); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4095 |
emit_int8((unsigned char)0xF3); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
4096 |
prefix(src, dst); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4097 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4098 |
emit_int8((unsigned char)0xB8); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
4099 |
emit_operand(dst, src); |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
4100 |
} |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
4101 |
|
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
4102 |
void Assembler::popcntl(Register dst, Register src) { |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
4103 |
assert(VM_Version::supports_popcnt(), "must support"); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4104 |
emit_int8((unsigned char)0xF3); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
4105 |
int encode = prefix_and_encode(dst->encoding(), src->encoding()); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4106 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4107 |
emit_int8((unsigned char)0xB8); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4108 |
emit_int8((unsigned char)(0xC0 | encode)); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
4109 |
} |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
4110 |
|
49396
647ee5457fd1
8199603: Build failures after JDK-8199421 "Add support for vector popcount"
shade
parents:
49384
diff
changeset
|
4111 |
void Assembler::vpopcntd(XMMRegister dst, XMMRegister src, int vector_len) { |
647ee5457fd1
8199603: Build failures after JDK-8199421 "Add support for vector popcount"
shade
parents:
49384
diff
changeset
|
4112 |
assert(VM_Version::supports_vpopcntdq(), "must support vpopcntdq feature"); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
4113 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
49396
647ee5457fd1
8199603: Build failures after JDK-8199421 "Add support for vector popcount"
shade
parents:
49384
diff
changeset
|
4114 |
attributes.set_is_evex_instruction(); |
647ee5457fd1
8199603: Build failures after JDK-8199421 "Add support for vector popcount"
shade
parents:
49384
diff
changeset
|
4115 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
647ee5457fd1
8199603: Build failures after JDK-8199421 "Add support for vector popcount"
shade
parents:
49384
diff
changeset
|
4116 |
emit_int8(0x55); |
647ee5457fd1
8199603: Build failures after JDK-8199421 "Add support for vector popcount"
shade
parents:
49384
diff
changeset
|
4117 |
emit_int8((unsigned char)(0xC0 | encode)); |
647ee5457fd1
8199603: Build failures after JDK-8199421 "Add support for vector popcount"
shade
parents:
49384
diff
changeset
|
4118 |
} |
647ee5457fd1
8199603: Build failures after JDK-8199421 "Add support for vector popcount"
shade
parents:
49384
diff
changeset
|
4119 |
|
1066 | 4120 |
void Assembler::popf() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4121 |
emit_int8((unsigned char)0x9D); |
1066 | 4122 |
} |
4123 |
||
4430 | 4124 |
#ifndef _LP64 // no 32bit push/pop on amd64 |
1066 | 4125 |
void Assembler::popl(Address dst) { |
4126 |
// NOTE: this will adjust stack by 8byte on 64bits |
|
4127 |
InstructionMark im(this); |
|
4128 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4129 |
emit_int8((unsigned char)0x8F); |
1066 | 4130 |
emit_operand(rax, dst); |
4131 |
} |
|
4430 | 4132 |
#endif |
1066 | 4133 |
|
4134 |
void Assembler::prefetch_prefix(Address src) { |
|
4135 |
prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4136 |
emit_int8(0x0F); |
1066 | 4137 |
} |
4138 |
||
4139 |
void Assembler::prefetchnta(Address src) { |
|
10286
74b0f625d56a
7081926: assert(VM_Version::supports_sse2()) failed: must support
kvn
parents:
10268
diff
changeset
|
4140 |
NOT_LP64(assert(VM_Version::supports_sse(), "must support")); |
1066 | 4141 |
InstructionMark im(this); |
4142 |
prefetch_prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4143 |
emit_int8(0x18); |
1066 | 4144 |
emit_operand(rax, src); // 0, src |
4145 |
} |
|
4146 |
||
4147 |
void Assembler::prefetchr(Address src) { |
|
10267 | 4148 |
assert(VM_Version::supports_3dnow_prefetch(), "must support"); |
1066 | 4149 |
InstructionMark im(this); |
4150 |
prefetch_prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4151 |
emit_int8(0x0D); |
1066 | 4152 |
emit_operand(rax, src); // 0, src |
4153 |
} |
|
4154 |
||
4155 |
void Assembler::prefetcht0(Address src) { |
|
4156 |
NOT_LP64(assert(VM_Version::supports_sse(), "must support")); |
|
4157 |
InstructionMark im(this); |
|
4158 |
prefetch_prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4159 |
emit_int8(0x18); |
1066 | 4160 |
emit_operand(rcx, src); // 1, src |
4161 |
} |
|
4162 |
||
4163 |
void Assembler::prefetcht1(Address src) { |
|
4164 |
NOT_LP64(assert(VM_Version::supports_sse(), "must support")); |
|
4165 |
InstructionMark im(this); |
|
4166 |
prefetch_prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4167 |
emit_int8(0x18); |
1066 | 4168 |
emit_operand(rdx, src); // 2, src |
4169 |
} |
|
4170 |
||
4171 |
void Assembler::prefetcht2(Address src) { |
|
4172 |
NOT_LP64(assert(VM_Version::supports_sse(), "must support")); |
|
4173 |
InstructionMark im(this); |
|
4174 |
prefetch_prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4175 |
emit_int8(0x18); |
1066 | 4176 |
emit_operand(rbx, src); // 3, src |
4177 |
} |
|
4178 |
||
4179 |
void Assembler::prefetchw(Address src) { |
|
10267 | 4180 |
assert(VM_Version::supports_3dnow_prefetch(), "must support"); |
1066 | 4181 |
InstructionMark im(this); |
4182 |
prefetch_prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4183 |
emit_int8(0x0D); |
1066 | 4184 |
emit_operand(rcx, src); // 1, src |
4185 |
} |
|
4186 |
||
4187 |
void Assembler::prefix(Prefix p) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4188 |
emit_int8(p); |
1066 | 4189 |
} |
4190 |
||
14132 | 4191 |
void Assembler::pshufb(XMMRegister dst, XMMRegister src) { |
4192 |
assert(VM_Version::supports_ssse3(), ""); |
|
51857 | 4193 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 4194 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4195 |
emit_int8(0x00); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4196 |
emit_int8((unsigned char)(0xC0 | encode)); |
14132 | 4197 |
} |
4198 |
||
38135
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4199 |
void Assembler::vpshufb(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4200 |
assert(vector_len == AVX_128bit? VM_Version::supports_avx() : |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4201 |
vector_len == AVX_256bit? VM_Version::supports_avx2() : |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4202 |
0, ""); |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4203 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4204 |
int encode = simd_prefix_and_encode(dst, nds, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4205 |
emit_int8(0x00); |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4206 |
emit_int8((unsigned char)(0xC0 | encode)); |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4207 |
} |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4208 |
|
14132 | 4209 |
void Assembler::pshufb(XMMRegister dst, Address src) { |
4210 |
assert(VM_Version::supports_ssse3(), ""); |
|
34162 | 4211 |
InstructionMark im(this); |
51857 | 4212 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 4213 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
4214 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4215 |
emit_int8(0x00); |
14132 | 4216 |
emit_operand(dst, src); |
4217 |
} |
|
4218 |
||
1066 | 4219 |
void Assembler::pshufd(XMMRegister dst, XMMRegister src, int mode) { |
4220 |
assert(isByte(mode), "invalid value"); |
|
4221 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
36837 | 4222 |
int vector_len = VM_Version::supports_avx512novl() ? AVX_512bit : AVX_128bit; |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
4223 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 4224 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
4225 |
emit_int8(0x70); |
|
4226 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4227 |
emit_int8(mode & 0xFF); |
1066 | 4228 |
} |
4229 |
||
38135
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4230 |
void Assembler::vpshufd(XMMRegister dst, XMMRegister src, int mode, int vector_len) { |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4231 |
assert(vector_len == AVX_128bit? VM_Version::supports_avx() : |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4232 |
vector_len == AVX_256bit? VM_Version::supports_avx2() : |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4233 |
0, ""); |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4234 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
4235 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38135
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4236 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4237 |
emit_int8(0x70); |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4238 |
emit_int8((unsigned char)(0xC0 | encode)); |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4239 |
emit_int8(mode & 0xFF); |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4240 |
} |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4241 |
|
1066 | 4242 |
void Assembler::pshufd(XMMRegister dst, Address src, int mode) { |
4243 |
assert(isByte(mode), "invalid value"); |
|
4244 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
11427 | 4245 |
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); |
34162 | 4246 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
4247 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 4248 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
4249 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4250 |
emit_int8(0x70); |
1066 | 4251 |
emit_operand(dst, src); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4252 |
emit_int8(mode & 0xFF); |
1066 | 4253 |
} |
4254 |
||
4255 |
void Assembler::pshuflw(XMMRegister dst, XMMRegister src, int mode) { |
|
4256 |
assert(isByte(mode), "invalid value"); |
|
4257 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
51857 | 4258 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 4259 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
4260 |
emit_int8(0x70); |
|
4261 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4262 |
emit_int8(mode & 0xFF); |
1066 | 4263 |
} |
4264 |
||
4265 |
void Assembler::pshuflw(XMMRegister dst, Address src, int mode) { |
|
4266 |
assert(isByte(mode), "invalid value"); |
|
4267 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
11427 | 4268 |
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); |
34162 | 4269 |
InstructionMark im(this); |
51857 | 4270 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 4271 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
4272 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4273 |
emit_int8(0x70); |
1066 | 4274 |
emit_operand(dst, src); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4275 |
emit_int8(mode & 0xFF); |
1066 | 4276 |
} |
49614
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
4277 |
void Assembler::evshufi64x2(XMMRegister dst, XMMRegister nds, XMMRegister src, int imm8, int vector_len) { |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
4278 |
assert(VM_Version::supports_evex(), "requires EVEX support"); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
4279 |
assert(vector_len == Assembler::AVX_256bit || vector_len == Assembler::AVX_512bit, ""); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
4280 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
4281 |
attributes.set_is_evex_instruction(); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
4282 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
4283 |
emit_int8(0x43); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
4284 |
emit_int8((unsigned char)(0xC0 | encode)); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
4285 |
emit_int8(imm8 & 0xFF); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
4286 |
} |
1066 | 4287 |
|
8494
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
4288 |
void Assembler::psrldq(XMMRegister dst, int shift) { |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
4289 |
// Shift left 128 bit value in dst XMMRegister by shift number of bytes. |
8494
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
4290 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51857 | 4291 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 4292 |
int encode = simd_prefix_and_encode(xmm3, dst, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
31404
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
4293 |
emit_int8(0x73); |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
4294 |
emit_int8((unsigned char)(0xC0 | encode)); |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
4295 |
emit_int8(shift); |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
4296 |
} |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
4297 |
|
52990
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4298 |
void Assembler::vpsrldq(XMMRegister dst, XMMRegister src, int shift, int vector_len) { |
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4299 |
assert(vector_len == AVX_128bit ? VM_Version::supports_avx() : |
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4300 |
vector_len == AVX_256bit ? VM_Version::supports_avx2() : |
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4301 |
vector_len == AVX_512bit ? VM_Version::supports_avx512bw() : 0, ""); |
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4302 |
InstructionAttr attributes(vector_len, /*vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4303 |
int encode = vex_prefix_and_encode(xmm3->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4304 |
emit_int8(0x73); |
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4305 |
emit_int8((unsigned char)(0xC0 | encode)); |
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4306 |
emit_int8(shift & 0xFF); |
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4307 |
} |
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4308 |
|
31404
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
4309 |
void Assembler::pslldq(XMMRegister dst, int shift) { |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
4310 |
// Shift left 128 bit value in dst XMMRegister by shift number of bytes. |
31404
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
4311 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51857 | 4312 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
4313 |
// XMM7 is for /7 encoding: 66 0F 73 /7 ib |
34162 | 4314 |
int encode = simd_prefix_and_encode(xmm7, dst, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4315 |
emit_int8(0x73); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4316 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4317 |
emit_int8(shift); |
8494
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
4318 |
} |
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
4319 |
|
52990
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4320 |
void Assembler::vpslldq(XMMRegister dst, XMMRegister src, int shift, int vector_len) { |
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4321 |
assert(vector_len == AVX_128bit ? VM_Version::supports_avx() : |
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4322 |
vector_len == AVX_256bit ? VM_Version::supports_avx2() : |
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4323 |
vector_len == AVX_512bit ? VM_Version::supports_avx512bw() : 0, ""); |
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4324 |
InstructionAttr attributes(vector_len, /*vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4325 |
int encode = vex_prefix_and_encode(xmm7->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4326 |
emit_int8(0x73); |
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4327 |
emit_int8((unsigned char)(0xC0 | encode)); |
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4328 |
emit_int8(shift & 0xFF); |
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4329 |
} |
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4330 |
|
2348 | 4331 |
void Assembler::ptest(XMMRegister dst, Address src) { |
4332 |
assert(VM_Version::supports_sse4_1(), ""); |
|
11427 | 4333 |
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); |
4334 |
InstructionMark im(this); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
4335 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 4336 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4337 |
emit_int8(0x17); |
2348 | 4338 |
emit_operand(dst, src); |
4339 |
} |
|
4340 |
||
4341 |
void Assembler::ptest(XMMRegister dst, XMMRegister src) { |
|
52990
1ed8de9045a7
8214074: Ghash optimization using AVX instructions
ascarpino
parents:
51996
diff
changeset
|
4342 |
assert(VM_Version::supports_sse4_1() || VM_Version::supports_avx(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
4343 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 4344 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4345 |
emit_int8(0x17); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4346 |
emit_int8((unsigned char)(0xC0 | encode)); |
2348 | 4347 |
} |
4348 |
||
15117
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
4349 |
void Assembler::vptest(XMMRegister dst, Address src) { |
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
4350 |
assert(VM_Version::supports_avx(), ""); |
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
4351 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
4352 |
InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
15117
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
4353 |
assert(dst != xnoreg, "sanity"); |
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
4354 |
// swap src<->dst for encoding |
34162 | 4355 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
15117
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
4356 |
emit_int8(0x17); |
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
4357 |
emit_operand(dst, src); |
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
4358 |
} |
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
4359 |
|
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
4360 |
void Assembler::vptest(XMMRegister dst, XMMRegister src) { |
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
4361 |
assert(VM_Version::supports_avx(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
4362 |
InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 4363 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
15117
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
4364 |
emit_int8(0x17); |
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
4365 |
emit_int8((unsigned char)(0xC0 | encode)); |
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
4366 |
} |
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
4367 |
|
11427 | 4368 |
void Assembler::punpcklbw(XMMRegister dst, Address src) { |
4369 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
4370 |
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); |
|
34162 | 4371 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
4372 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_vlbw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 4373 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
4374 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4375 |
emit_int8(0x60); |
|
4376 |
emit_operand(dst, src); |
|
11427 | 4377 |
} |
4378 |
||
1066 | 4379 |
void Assembler::punpcklbw(XMMRegister dst, XMMRegister src) { |
4380 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
4381 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_vlbw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 4382 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
4383 |
emit_int8(0x60); |
|
4384 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 4385 |
} |
4386 |
||
11427 | 4387 |
void Assembler::punpckldq(XMMRegister dst, Address src) { |
4388 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
4389 |
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); |
|
34162 | 4390 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
4391 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 4392 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
4393 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4394 |
emit_int8(0x62); |
|
4395 |
emit_operand(dst, src); |
|
11427 | 4396 |
} |
4397 |
||
4398 |
void Assembler::punpckldq(XMMRegister dst, XMMRegister src) { |
|
4399 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
4400 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 4401 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
4402 |
emit_int8(0x62); |
|
4403 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
11427 | 4404 |
} |
4405 |
||
13294 | 4406 |
void Assembler::punpcklqdq(XMMRegister dst, XMMRegister src) { |
4407 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
4408 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 4409 |
attributes.set_rex_vex_w_reverted(); |
34162 | 4410 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
4411 |
emit_int8(0x6C); |
|
4412 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13294 | 4413 |
} |
4414 |
||
1066 | 4415 |
void Assembler::push(int32_t imm32) { |
4416 |
// in 64bits we push 64bits onto the stack but only |
|
4417 |
// take a 32bit immediate |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4418 |
emit_int8(0x68); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
4419 |
emit_int32(imm32); |
1066 | 4420 |
} |
4421 |
||
4422 |
void Assembler::push(Register src) { |
|
4423 |
int encode = prefix_and_encode(src->encoding()); |
|
4424 |
||
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4425 |
emit_int8(0x50 | encode); |
1066 | 4426 |
} |
4427 |
||
4428 |
void Assembler::pushf() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4429 |
emit_int8((unsigned char)0x9C); |
1066 | 4430 |
} |
4431 |
||
4430 | 4432 |
#ifndef _LP64 // no 32bit push/pop on amd64 |
1066 | 4433 |
void Assembler::pushl(Address src) { |
4434 |
// Note this will push 64bit on 64bit |
|
4435 |
InstructionMark im(this); |
|
4436 |
prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4437 |
emit_int8((unsigned char)0xFF); |
1066 | 4438 |
emit_operand(rsi, src); |
4439 |
} |
|
4430 | 4440 |
#endif |
1066 | 4441 |
|
4442 |
void Assembler::rcll(Register dst, int imm8) { |
|
4443 |
assert(isShiftCount(imm8), "illegal shift count"); |
|
4444 |
int encode = prefix_and_encode(dst->encoding()); |
|
4445 |
if (imm8 == 1) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4446 |
emit_int8((unsigned char)0xD1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4447 |
emit_int8((unsigned char)(0xD0 | encode)); |
1066 | 4448 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4449 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4450 |
emit_int8((unsigned char)0xD0 | encode); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4451 |
emit_int8(imm8); |
1066 | 4452 |
} |
4453 |
} |
|
4454 |
||
33465 | 4455 |
void Assembler::rcpps(XMMRegister dst, XMMRegister src) { |
4456 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
4457 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 4458 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
33465 | 4459 |
emit_int8(0x53); |
34162 | 4460 |
emit_int8((unsigned char)(0xC0 | encode)); |
33465 | 4461 |
} |
4462 |
||
4463 |
void Assembler::rcpss(XMMRegister dst, XMMRegister src) { |
|
4464 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
4465 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 4466 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
33465 | 4467 |
emit_int8(0x53); |
34162 | 4468 |
emit_int8((unsigned char)(0xC0 | encode)); |
33465 | 4469 |
} |
4470 |
||
23491 | 4471 |
void Assembler::rdtsc() { |
4472 |
emit_int8((unsigned char)0x0F); |
|
4473 |
emit_int8((unsigned char)0x31); |
|
4474 |
} |
|
4475 |
||
1066 | 4476 |
// copies data from [esi] to [edi] using rcx pointer sized words |
4477 |
// generic |
|
4478 |
void Assembler::rep_mov() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4479 |
emit_int8((unsigned char)0xF3); |
1066 | 4480 |
// MOVSQ |
4481 |
LP64_ONLY(prefix(REX_W)); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4482 |
emit_int8((unsigned char)0xA5); |
1066 | 4483 |
} |
4484 |
||
15114
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
4485 |
// sets rcx bytes with rax, value at [edi] |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
4486 |
void Assembler::rep_stosb() { |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
4487 |
emit_int8((unsigned char)0xF3); // REP |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
4488 |
LP64_ONLY(prefix(REX_W)); |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
4489 |
emit_int8((unsigned char)0xAA); // STOSB |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
4490 |
} |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
4491 |
|
1066 | 4492 |
// sets rcx pointer sized words with rax, value at [edi] |
4493 |
// generic |
|
15114
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
4494 |
void Assembler::rep_stos() { |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
4495 |
emit_int8((unsigned char)0xF3); // REP |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
4496 |
LP64_ONLY(prefix(REX_W)); // LP64:STOSQ, LP32:STOSD |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4497 |
emit_int8((unsigned char)0xAB); |
1066 | 4498 |
} |
4499 |
||
4500 |
// scans rcx pointer sized words at [edi] for occurance of rax, |
|
4501 |
// generic |
|
4502 |
void Assembler::repne_scan() { // repne_scan |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4503 |
emit_int8((unsigned char)0xF2); |
1066 | 4504 |
// SCASQ |
4505 |
LP64_ONLY(prefix(REX_W)); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4506 |
emit_int8((unsigned char)0xAF); |
1066 | 4507 |
} |
4508 |
||
4509 |
#ifdef _LP64 |
|
4510 |
// scans rcx 4 byte words at [edi] for occurance of rax, |
|
4511 |
// generic |
|
4512 |
void Assembler::repne_scanl() { // repne_scan |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4513 |
emit_int8((unsigned char)0xF2); |
1066 | 4514 |
// SCASL |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4515 |
emit_int8((unsigned char)0xAF); |
1066 | 4516 |
} |
4517 |
#endif |
|
4518 |
||
1 | 4519 |
void Assembler::ret(int imm16) { |
4520 |
if (imm16 == 0) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4521 |
emit_int8((unsigned char)0xC3); |
1 | 4522 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4523 |
emit_int8((unsigned char)0xC2); |
14831
84828ee2a91c
8004536: replace AbstractAssembler emit_word with emit_int16
twisti
parents:
14626
diff
changeset
|
4524 |
emit_int16(imm16); |
1 | 4525 |
} |
4526 |
} |
|
4527 |
||
1066 | 4528 |
void Assembler::sahf() { |
4529 |
#ifdef _LP64 |
|
4530 |
// Not supported in 64bit mode |
|
4531 |
ShouldNotReachHere(); |
|
4532 |
#endif |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4533 |
emit_int8((unsigned char)0x9E); |
1066 | 4534 |
} |
4535 |
||
4536 |
void Assembler::sarl(Register dst, int imm8) { |
|
4537 |
int encode = prefix_and_encode(dst->encoding()); |
|
4538 |
assert(isShiftCount(imm8), "illegal shift count"); |
|
4539 |
if (imm8 == 1) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4540 |
emit_int8((unsigned char)0xD1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4541 |
emit_int8((unsigned char)(0xF8 | encode)); |
1066 | 4542 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4543 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4544 |
emit_int8((unsigned char)(0xF8 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4545 |
emit_int8(imm8); |
1066 | 4546 |
} |
4547 |
} |
|
4548 |
||
4549 |
void Assembler::sarl(Register dst) { |
|
4550 |
int encode = prefix_and_encode(dst->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4551 |
emit_int8((unsigned char)0xD3); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4552 |
emit_int8((unsigned char)(0xF8 | encode)); |
1066 | 4553 |
} |
4554 |
||
4555 |
void Assembler::sbbl(Address dst, int32_t imm32) { |
|
4556 |
InstructionMark im(this); |
|
4557 |
prefix(dst); |
|
4558 |
emit_arith_operand(0x81, rbx, dst, imm32); |
|
4559 |
} |
|
4560 |
||
4561 |
void Assembler::sbbl(Register dst, int32_t imm32) { |
|
4562 |
prefix(dst); |
|
4563 |
emit_arith(0x81, 0xD8, dst, imm32); |
|
4564 |
} |
|
4565 |
||
4566 |
||
4567 |
void Assembler::sbbl(Register dst, Address src) { |
|
4568 |
InstructionMark im(this); |
|
4569 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4570 |
emit_int8(0x1B); |
1066 | 4571 |
emit_operand(dst, src); |
4572 |
} |
|
4573 |
||
4574 |
void Assembler::sbbl(Register dst, Register src) { |
|
4575 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
|
4576 |
emit_arith(0x1B, 0xC0, dst, src); |
|
4577 |
} |
|
4578 |
||
4579 |
void Assembler::setb(Condition cc, Register dst) { |
|
4580 |
assert(0 <= cc && cc < 16, "illegal cc"); |
|
4581 |
int encode = prefix_and_encode(dst->encoding(), true); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4582 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4583 |
emit_int8((unsigned char)0x90 | cc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4584 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 4585 |
} |
4586 |
||
36555 | 4587 |
void Assembler::palignr(XMMRegister dst, XMMRegister src, int imm8) { |
4588 |
assert(VM_Version::supports_ssse3(), ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
4589 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
36555 | 4590 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
4591 |
emit_int8((unsigned char)0x0F); |
|
4592 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
4593 |
emit_int8(imm8); |
|
4594 |
} |
|
4595 |
||
38135
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4596 |
void Assembler::vpalignr(XMMRegister dst, XMMRegister nds, XMMRegister src, int imm8, int vector_len) { |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4597 |
assert(vector_len == AVX_128bit? VM_Version::supports_avx() : |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4598 |
vector_len == AVX_256bit? VM_Version::supports_avx2() : |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4599 |
0, ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
4600 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
38135
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4601 |
int encode = simd_prefix_and_encode(dst, nds, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4602 |
emit_int8((unsigned char)0x0F); |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4603 |
emit_int8((unsigned char)(0xC0 | encode)); |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4604 |
emit_int8(imm8); |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4605 |
} |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
4606 |
|
50699
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
4607 |
void Assembler::evalignq(XMMRegister dst, XMMRegister nds, XMMRegister src, uint8_t imm8) { |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
4608 |
assert(VM_Version::supports_evex(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
4609 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
51857 | 4610 |
attributes.set_is_evex_instruction(); |
50699
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
4611 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
4612 |
emit_int8(0x3); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
4613 |
emit_int8((unsigned char)(0xC0 | encode)); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
4614 |
emit_int8(imm8); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
4615 |
} |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
4616 |
|
36555 | 4617 |
void Assembler::pblendw(XMMRegister dst, XMMRegister src, int imm8) { |
4618 |
assert(VM_Version::supports_sse4_1(), ""); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
4619 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
4620 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
36555 | 4621 |
emit_int8((unsigned char)0x0E); |
4622 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
4623 |
emit_int8(imm8); |
|
4624 |
} |
|
4625 |
||
4626 |
void Assembler::sha1rnds4(XMMRegister dst, XMMRegister src, int imm8) { |
|
4627 |
assert(VM_Version::supports_sha(), ""); |
|
42552
584f6c668be7
8167067: Fix x86 SHA instructions to be non Vex encoded
kvn
parents:
42039
diff
changeset
|
4628 |
int encode = rex_prefix_and_encode(dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_3A, /* rex_w */ false); |
36555 | 4629 |
emit_int8((unsigned char)0xCC); |
4630 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
4631 |
emit_int8((unsigned char)imm8); |
|
4632 |
} |
|
4633 |
||
4634 |
void Assembler::sha1nexte(XMMRegister dst, XMMRegister src) { |
|
4635 |
assert(VM_Version::supports_sha(), ""); |
|
42552
584f6c668be7
8167067: Fix x86 SHA instructions to be non Vex encoded
kvn
parents:
42039
diff
changeset
|
4636 |
int encode = rex_prefix_and_encode(dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_38, /* rex_w */ false); |
36555 | 4637 |
emit_int8((unsigned char)0xC8); |
4638 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
4639 |
} |
|
4640 |
||
4641 |
void Assembler::sha1msg1(XMMRegister dst, XMMRegister src) { |
|
4642 |
assert(VM_Version::supports_sha(), ""); |
|
42552
584f6c668be7
8167067: Fix x86 SHA instructions to be non Vex encoded
kvn
parents:
42039
diff
changeset
|
4643 |
int encode = rex_prefix_and_encode(dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_38, /* rex_w */ false); |
36555 | 4644 |
emit_int8((unsigned char)0xC9); |
4645 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
4646 |
} |
|
4647 |
||
4648 |
void Assembler::sha1msg2(XMMRegister dst, XMMRegister src) { |
|
4649 |
assert(VM_Version::supports_sha(), ""); |
|
42552
584f6c668be7
8167067: Fix x86 SHA instructions to be non Vex encoded
kvn
parents:
42039
diff
changeset
|
4650 |
int encode = rex_prefix_and_encode(dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_38, /* rex_w */ false); |
36555 | 4651 |
emit_int8((unsigned char)0xCA); |
4652 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
4653 |
} |
|
4654 |
||
4655 |
// xmm0 is implicit additional source to this instruction. |
|
4656 |
void Assembler::sha256rnds2(XMMRegister dst, XMMRegister src) { |
|
4657 |
assert(VM_Version::supports_sha(), ""); |
|
42552
584f6c668be7
8167067: Fix x86 SHA instructions to be non Vex encoded
kvn
parents:
42039
diff
changeset
|
4658 |
int encode = rex_prefix_and_encode(dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_38, /* rex_w */ false); |
36555 | 4659 |
emit_int8((unsigned char)0xCB); |
4660 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
4661 |
} |
|
4662 |
||
4663 |
void Assembler::sha256msg1(XMMRegister dst, XMMRegister src) { |
|
4664 |
assert(VM_Version::supports_sha(), ""); |
|
42552
584f6c668be7
8167067: Fix x86 SHA instructions to be non Vex encoded
kvn
parents:
42039
diff
changeset
|
4665 |
int encode = rex_prefix_and_encode(dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_38, /* rex_w */ false); |
36555 | 4666 |
emit_int8((unsigned char)0xCC); |
4667 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
4668 |
} |
|
4669 |
||
4670 |
void Assembler::sha256msg2(XMMRegister dst, XMMRegister src) { |
|
4671 |
assert(VM_Version::supports_sha(), ""); |
|
42552
584f6c668be7
8167067: Fix x86 SHA instructions to be non Vex encoded
kvn
parents:
42039
diff
changeset
|
4672 |
int encode = rex_prefix_and_encode(dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_38, /* rex_w */ false); |
36555 | 4673 |
emit_int8((unsigned char)0xCD); |
4674 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
4675 |
} |
|
4676 |
||
4677 |
||
1066 | 4678 |
void Assembler::shll(Register dst, int imm8) { |
4679 |
assert(isShiftCount(imm8), "illegal shift count"); |
|
4680 |
int encode = prefix_and_encode(dst->encoding()); |
|
4681 |
if (imm8 == 1 ) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4682 |
emit_int8((unsigned char)0xD1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4683 |
emit_int8((unsigned char)(0xE0 | encode)); |
1066 | 4684 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4685 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4686 |
emit_int8((unsigned char)(0xE0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4687 |
emit_int8(imm8); |
1066 | 4688 |
} |
4689 |
} |
|
4690 |
||
4691 |
void Assembler::shll(Register dst) { |
|
4692 |
int encode = prefix_and_encode(dst->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4693 |
emit_int8((unsigned char)0xD3); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4694 |
emit_int8((unsigned char)(0xE0 | encode)); |
1066 | 4695 |
} |
4696 |
||
4697 |
void Assembler::shrl(Register dst, int imm8) { |
|
4698 |
assert(isShiftCount(imm8), "illegal shift count"); |
|
4699 |
int encode = prefix_and_encode(dst->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4700 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4701 |
emit_int8((unsigned char)(0xE8 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4702 |
emit_int8(imm8); |
1066 | 4703 |
} |
4704 |
||
4705 |
void Assembler::shrl(Register dst) { |
|
4706 |
int encode = prefix_and_encode(dst->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4707 |
emit_int8((unsigned char)0xD3); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4708 |
emit_int8((unsigned char)(0xE8 | encode)); |
1066 | 4709 |
} |
1 | 4710 |
|
4711 |
// copies a single word from [esi] to [edi] |
|
4712 |
void Assembler::smovl() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4713 |
emit_int8((unsigned char)0xA5); |
1 | 4714 |
} |
4715 |
||
1066 | 4716 |
void Assembler::sqrtsd(XMMRegister dst, XMMRegister src) { |
4717 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
4718 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
38049 | 4719 |
attributes.set_rex_vex_w_reverted(); |
34162 | 4720 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
4721 |
emit_int8(0x51); |
|
4722 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 4723 |
} |
4724 |
||
7433 | 4725 |
void Assembler::sqrtsd(XMMRegister dst, Address src) { |
4726 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 4727 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
4728 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 4729 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
38049 | 4730 |
attributes.set_rex_vex_w_reverted(); |
34162 | 4731 |
simd_prefix(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
4732 |
emit_int8(0x51); |
|
4733 |
emit_operand(dst, src); |
|
7433 | 4734 |
} |
4735 |
||
4736 |
void Assembler::sqrtss(XMMRegister dst, XMMRegister src) { |
|
11427 | 4737 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
4738 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 4739 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
4740 |
emit_int8(0x51); |
|
4741 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
7433 | 4742 |
} |
4743 |
||
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
4744 |
void Assembler::std() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4745 |
emit_int8((unsigned char)0xFD); |
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
4746 |
} |
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
4747 |
|
7433 | 4748 |
void Assembler::sqrtss(XMMRegister dst, Address src) { |
11427 | 4749 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
34162 | 4750 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
4751 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 4752 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
4753 |
simd_prefix(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
4754 |
emit_int8(0x51); |
|
4755 |
emit_operand(dst, src); |
|
7433 | 4756 |
} |
4757 |
||
1066 | 4758 |
void Assembler::stmxcsr( Address dst) { |
46440
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
4759 |
if (UseAVX > 0 ) { |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
4760 |
assert(VM_Version::supports_avx(), ""); |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
4761 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
4762 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
46440
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
4763 |
vex_prefix(dst, 0, 0, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
4764 |
emit_int8((unsigned char)0xAE); |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
4765 |
emit_operand(as_Register(3), dst); |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
4766 |
} else { |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
4767 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
4768 |
InstructionMark im(this); |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
4769 |
prefix(dst); |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
4770 |
emit_int8(0x0F); |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
4771 |
emit_int8((unsigned char)0xAE); |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
4772 |
emit_operand(as_Register(3), dst); |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
4773 |
} |
1066 | 4774 |
} |
4775 |
||
4776 |
void Assembler::subl(Address dst, int32_t imm32) { |
|
4777 |
InstructionMark im(this); |
|
4778 |
prefix(dst); |
|
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
4779 |
emit_arith_operand(0x81, rbp, dst, imm32); |
1066 | 4780 |
} |
4781 |
||
4782 |
void Assembler::subl(Address dst, Register src) { |
|
4783 |
InstructionMark im(this); |
|
4784 |
prefix(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4785 |
emit_int8(0x29); |
1066 | 4786 |
emit_operand(src, dst); |
4787 |
} |
|
4788 |
||
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
4789 |
void Assembler::subl(Register dst, int32_t imm32) { |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
4790 |
prefix(dst); |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
4791 |
emit_arith(0x81, 0xE8, dst, imm32); |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
4792 |
} |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
4793 |
|
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
4794 |
// 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:
11438
diff
changeset
|
4795 |
void Assembler::subl_imm32(Register dst, int32_t imm32) { |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
4796 |
prefix(dst); |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
4797 |
emit_arith_imm32(0x81, 0xE8, dst, imm32); |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
4798 |
} |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
4799 |
|
1066 | 4800 |
void Assembler::subl(Register dst, Address src) { |
4801 |
InstructionMark im(this); |
|
4802 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4803 |
emit_int8(0x2B); |
1066 | 4804 |
emit_operand(dst, src); |
4805 |
} |
|
4806 |
||
4807 |
void Assembler::subl(Register dst, Register src) { |
|
4808 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
|
4809 |
emit_arith(0x2B, 0xC0, dst, src); |
|
4810 |
} |
|
4811 |
||
4812 |
void Assembler::subsd(XMMRegister dst, XMMRegister src) { |
|
4813 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
4814 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
38049 | 4815 |
attributes.set_rex_vex_w_reverted(); |
34162 | 4816 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
4817 |
emit_int8(0x5C); |
|
4818 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 4819 |
} |
4820 |
||
4821 |
void Assembler::subsd(XMMRegister dst, Address src) { |
|
4822 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 4823 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
4824 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 4825 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
38049 | 4826 |
attributes.set_rex_vex_w_reverted(); |
34162 | 4827 |
simd_prefix(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
4828 |
emit_int8(0x5C); |
|
4829 |
emit_operand(dst, src); |
|
1066 | 4830 |
} |
4831 |
||
4832 |
void Assembler::subss(XMMRegister dst, XMMRegister src) { |
|
4833 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
4834 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true , /* uses_vl */ false); |
34162 | 4835 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
4836 |
emit_int8(0x5C); |
|
4837 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 4838 |
} |
4839 |
||
4840 |
void Assembler::subss(XMMRegister dst, Address src) { |
|
4841 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 4842 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
4843 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 4844 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
4845 |
simd_prefix(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
4846 |
emit_int8(0x5C); |
|
4847 |
emit_operand(dst, src); |
|
1066 | 4848 |
} |
4849 |
||
4850 |
void Assembler::testb(Register dst, int imm8) { |
|
4851 |
NOT_LP64(assert(dst->has_byte_register(), "must have byte register")); |
|
4852 |
(void) prefix_and_encode(dst->encoding(), true); |
|
4853 |
emit_arith_b(0xF6, 0xC0, dst, imm8); |
|
4854 |
} |
|
4855 |
||
35540
e001ad24dcdb
8143353: update for x86 sin and cos in the math lib
vdeshpande
parents:
35154
diff
changeset
|
4856 |
void Assembler::testb(Address dst, int imm8) { |
e001ad24dcdb
8143353: update for x86 sin and cos in the math lib
vdeshpande
parents:
35154
diff
changeset
|
4857 |
InstructionMark im(this); |
e001ad24dcdb
8143353: update for x86 sin and cos in the math lib
vdeshpande
parents:
35154
diff
changeset
|
4858 |
prefix(dst); |
e001ad24dcdb
8143353: update for x86 sin and cos in the math lib
vdeshpande
parents:
35154
diff
changeset
|
4859 |
emit_int8((unsigned char)0xF6); |
e001ad24dcdb
8143353: update for x86 sin and cos in the math lib
vdeshpande
parents:
35154
diff
changeset
|
4860 |
emit_operand(rax, dst, 1); |
e001ad24dcdb
8143353: update for x86 sin and cos in the math lib
vdeshpande
parents:
35154
diff
changeset
|
4861 |
emit_int8(imm8); |
e001ad24dcdb
8143353: update for x86 sin and cos in the math lib
vdeshpande
parents:
35154
diff
changeset
|
4862 |
} |
e001ad24dcdb
8143353: update for x86 sin and cos in the math lib
vdeshpande
parents:
35154
diff
changeset
|
4863 |
|
1066 | 4864 |
void Assembler::testl(Register dst, int32_t imm32) { |
4865 |
// not using emit_arith because test |
|
4866 |
// doesn't support sign-extension of |
|
4867 |
// 8bit operands |
|
4868 |
int encode = dst->encoding(); |
|
4869 |
if (encode == 0) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4870 |
emit_int8((unsigned char)0xA9); |
1066 | 4871 |
} else { |
4872 |
encode = prefix_and_encode(encode); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4873 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4874 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 4875 |
} |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
4876 |
emit_int32(imm32); |
1066 | 4877 |
} |
4878 |
||
4879 |
void Assembler::testl(Register dst, Register src) { |
|
4880 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
|
4881 |
emit_arith(0x85, 0xC0, dst, src); |
|
4882 |
} |
|
4883 |
||
34162 | 4884 |
void Assembler::testl(Register dst, Address src) { |
1066 | 4885 |
InstructionMark im(this); |
4886 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4887 |
emit_int8((unsigned char)0x85); |
1066 | 4888 |
emit_operand(dst, src); |
4889 |
} |
|
4890 |
||
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4891 |
void Assembler::tzcntl(Register dst, Register src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4892 |
assert(VM_Version::supports_bmi1(), "tzcnt instruction not supported"); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4893 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4894 |
int encode = prefix_and_encode(dst->encoding(), src->encoding()); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4895 |
emit_int8(0x0F); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4896 |
emit_int8((unsigned char)0xBC); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4897 |
emit_int8((unsigned char)0xC0 | encode); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4898 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4899 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4900 |
void Assembler::tzcntq(Register dst, Register src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4901 |
assert(VM_Version::supports_bmi1(), "tzcnt instruction not supported"); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4902 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4903 |
int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4904 |
emit_int8(0x0F); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4905 |
emit_int8((unsigned char)0xBC); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4906 |
emit_int8((unsigned char)(0xC0 | encode)); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4907 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4908 |
|
1066 | 4909 |
void Assembler::ucomisd(XMMRegister dst, Address src) { |
4910 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 4911 |
InstructionMark im(this); |
4912 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
4913 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
38049 | 4914 |
attributes.set_rex_vex_w_reverted(); |
34162 | 4915 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
4916 |
emit_int8(0x2E); |
|
4917 |
emit_operand(dst, src); |
|
1066 | 4918 |
} |
4919 |
||
4920 |
void Assembler::ucomisd(XMMRegister dst, XMMRegister src) { |
|
4921 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 4922 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
38049 | 4923 |
attributes.set_rex_vex_w_reverted(); |
34162 | 4924 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
4925 |
emit_int8(0x2E); |
|
4926 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 4927 |
} |
4928 |
||
4929 |
void Assembler::ucomiss(XMMRegister dst, Address src) { |
|
4930 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 4931 |
InstructionMark im(this); |
4932 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
4933 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
4934 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4935 |
emit_int8(0x2E); |
|
4936 |
emit_operand(dst, src); |
|
1066 | 4937 |
} |
4938 |
||
4939 |
void Assembler::ucomiss(XMMRegister dst, XMMRegister src) { |
|
4940 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 4941 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
4942 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4943 |
emit_int8(0x2E); |
|
4944 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 4945 |
} |
4946 |
||
23491 | 4947 |
void Assembler::xabort(int8_t imm8) { |
4948 |
emit_int8((unsigned char)0xC6); |
|
4949 |
emit_int8((unsigned char)0xF8); |
|
4950 |
emit_int8((unsigned char)(imm8 & 0xFF)); |
|
4951 |
} |
|
1066 | 4952 |
|
39419
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
4953 |
void Assembler::xaddb(Address dst, Register src) { |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
4954 |
InstructionMark im(this); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
4955 |
prefix(dst, src, true); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
4956 |
emit_int8(0x0F); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
4957 |
emit_int8((unsigned char)0xC0); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
4958 |
emit_operand(src, dst); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
4959 |
} |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
4960 |
|
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
4961 |
void Assembler::xaddw(Address dst, Register src) { |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
4962 |
InstructionMark im(this); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
4963 |
emit_int8(0x66); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
4964 |
prefix(dst, src); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
4965 |
emit_int8(0x0F); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
4966 |
emit_int8((unsigned char)0xC1); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
4967 |
emit_operand(src, dst); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
4968 |
} |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
4969 |
|
1066 | 4970 |
void Assembler::xaddl(Address dst, Register src) { |
4971 |
InstructionMark im(this); |
|
4972 |
prefix(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4973 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4974 |
emit_int8((unsigned char)0xC1); |
1066 | 4975 |
emit_operand(src, dst); |
4976 |
} |
|
4977 |
||
23491 | 4978 |
void Assembler::xbegin(Label& abort, relocInfo::relocType rtype) { |
4979 |
InstructionMark im(this); |
|
4980 |
relocate(rtype); |
|
4981 |
if (abort.is_bound()) { |
|
4982 |
address entry = target(abort); |
|
4983 |
assert(entry != NULL, "abort entry NULL"); |
|
4984 |
intptr_t offset = entry - pc(); |
|
4985 |
emit_int8((unsigned char)0xC7); |
|
4986 |
emit_int8((unsigned char)0xF8); |
|
4987 |
emit_int32(offset - 6); // 2 opcode + 4 address |
|
4988 |
} else { |
|
4989 |
abort.add_patch_at(code(), locator()); |
|
4990 |
emit_int8((unsigned char)0xC7); |
|
4991 |
emit_int8((unsigned char)0xF8); |
|
4992 |
emit_int32(0); |
|
4993 |
} |
|
4994 |
} |
|
4995 |
||
39419
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
4996 |
void Assembler::xchgb(Register dst, Address src) { // xchg |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
4997 |
InstructionMark im(this); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
4998 |
prefix(src, dst, true); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
4999 |
emit_int8((unsigned char)0x86); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
5000 |
emit_operand(dst, src); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
5001 |
} |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
5002 |
|
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
5003 |
void Assembler::xchgw(Register dst, Address src) { // xchg |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
5004 |
InstructionMark im(this); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
5005 |
emit_int8(0x66); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
5006 |
prefix(src, dst); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
5007 |
emit_int8((unsigned char)0x87); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
5008 |
emit_operand(dst, src); |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
5009 |
} |
cc993a4ab581
8157726: VarHandles/Unsafe should support sub-word atomic ops
shade
parents:
38239
diff
changeset
|
5010 |
|
1066 | 5011 |
void Assembler::xchgl(Register dst, Address src) { // xchg |
5012 |
InstructionMark im(this); |
|
5013 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5014 |
emit_int8((unsigned char)0x87); |
1066 | 5015 |
emit_operand(dst, src); |
5016 |
} |
|
5017 |
||
5018 |
void Assembler::xchgl(Register dst, Register src) { |
|
5019 |
int encode = prefix_and_encode(dst->encoding(), src->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5020 |
emit_int8((unsigned char)0x87); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5021 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 5022 |
} |
5023 |
||
23491 | 5024 |
void Assembler::xend() { |
5025 |
emit_int8((unsigned char)0x0F); |
|
5026 |
emit_int8((unsigned char)0x01); |
|
5027 |
emit_int8((unsigned char)0xD5); |
|
5028 |
} |
|
5029 |
||
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
5030 |
void Assembler::xgetbv() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5031 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5032 |
emit_int8(0x01); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5033 |
emit_int8((unsigned char)0xD0); |
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
5034 |
} |
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
5035 |
|
1066 | 5036 |
void Assembler::xorl(Register dst, int32_t imm32) { |
5037 |
prefix(dst); |
|
5038 |
emit_arith(0x81, 0xF0, dst, imm32); |
|
5039 |
} |
|
5040 |
||
5041 |
void Assembler::xorl(Register dst, Address src) { |
|
5042 |
InstructionMark im(this); |
|
5043 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5044 |
emit_int8(0x33); |
1066 | 5045 |
emit_operand(dst, src); |
5046 |
} |
|
5047 |
||
5048 |
void Assembler::xorl(Register dst, Register src) { |
|
5049 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
|
5050 |
emit_arith(0x33, 0xC0, dst, src); |
|
5051 |
} |
|
5052 |
||
35154 | 5053 |
void Assembler::xorb(Register dst, Address src) { |
5054 |
InstructionMark im(this); |
|
5055 |
prefix(src, dst); |
|
5056 |
emit_int8(0x32); |
|
5057 |
emit_operand(dst, src); |
|
5058 |
} |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5059 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5060 |
// AVX 3-operands scalar float-point arithmetic instructions |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5061 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5062 |
void Assembler::vaddsd(XMMRegister dst, XMMRegister nds, Address src) { |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5063 |
assert(VM_Version::supports_avx(), ""); |
34162 | 5064 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
5065 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 5066 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
38049 | 5067 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5068 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
34162 | 5069 |
emit_int8(0x58); |
5070 |
emit_operand(dst, src); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5071 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5072 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5073 |
void Assembler::vaddsd(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5074 |
assert(VM_Version::supports_avx(), ""); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
5075 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
38049 | 5076 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5077 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
34162 | 5078 |
emit_int8(0x58); |
5079 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5080 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5081 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5082 |
void Assembler::vaddss(XMMRegister dst, XMMRegister nds, Address src) { |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5083 |
assert(VM_Version::supports_avx(), ""); |
34162 | 5084 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
5085 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 5086 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5087 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
34162 | 5088 |
emit_int8(0x58); |
5089 |
emit_operand(dst, src); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5090 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5091 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5092 |
void Assembler::vaddss(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5093 |
assert(VM_Version::supports_avx(), ""); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
5094 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5095 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
34162 | 5096 |
emit_int8(0x58); |
5097 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5098 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5099 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5100 |
void Assembler::vdivsd(XMMRegister dst, XMMRegister nds, Address src) { |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5101 |
assert(VM_Version::supports_avx(), ""); |
34162 | 5102 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
5103 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 5104 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
38049 | 5105 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5106 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
34162 | 5107 |
emit_int8(0x5E); |
5108 |
emit_operand(dst, src); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5109 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5110 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5111 |
void Assembler::vdivsd(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5112 |
assert(VM_Version::supports_avx(), ""); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
5113 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
38049 | 5114 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5115 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
34162 | 5116 |
emit_int8(0x5E); |
5117 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5118 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5119 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5120 |
void Assembler::vdivss(XMMRegister dst, XMMRegister nds, Address src) { |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5121 |
assert(VM_Version::supports_avx(), ""); |
34162 | 5122 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
5123 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 5124 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5125 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
34162 | 5126 |
emit_int8(0x5E); |
5127 |
emit_operand(dst, src); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5128 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5129 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5130 |
void Assembler::vdivss(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5131 |
assert(VM_Version::supports_avx(), ""); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
5132 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5133 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
34162 | 5134 |
emit_int8(0x5E); |
5135 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5136 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5137 |
|
41323 | 5138 |
void Assembler::vfmadd231sd(XMMRegister dst, XMMRegister src1, XMMRegister src2) { |
5139 |
assert(VM_Version::supports_fma(), ""); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
5140 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
41323 | 5141 |
int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
5142 |
emit_int8((unsigned char)0xB9); |
|
5143 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5144 |
} |
|
5145 |
||
5146 |
void Assembler::vfmadd231ss(XMMRegister dst, XMMRegister src1, XMMRegister src2) { |
|
5147 |
assert(VM_Version::supports_fma(), ""); |
|
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
5148 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
41323 | 5149 |
int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
5150 |
emit_int8((unsigned char)0xB9); |
|
5151 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5152 |
} |
|
5153 |
||
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5154 |
void Assembler::vmulsd(XMMRegister dst, XMMRegister nds, Address src) { |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5155 |
assert(VM_Version::supports_avx(), ""); |
34162 | 5156 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
5157 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 5158 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
38049 | 5159 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5160 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
34162 | 5161 |
emit_int8(0x59); |
5162 |
emit_operand(dst, src); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5163 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5164 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5165 |
void Assembler::vmulsd(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5166 |
assert(VM_Version::supports_avx(), ""); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
5167 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
38049 | 5168 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5169 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
34162 | 5170 |
emit_int8(0x59); |
5171 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5172 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5173 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5174 |
void Assembler::vmulss(XMMRegister dst, XMMRegister nds, Address src) { |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5175 |
assert(VM_Version::supports_avx(), ""); |
34162 | 5176 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
5177 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 5178 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5179 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
34162 | 5180 |
emit_int8(0x59); |
5181 |
emit_operand(dst, src); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5182 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5183 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5184 |
void Assembler::vmulss(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5185 |
assert(VM_Version::supports_avx(), ""); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
5186 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5187 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
34162 | 5188 |
emit_int8(0x59); |
5189 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5190 |
} |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5191 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5192 |
void Assembler::vsubsd(XMMRegister dst, XMMRegister nds, Address src) { |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5193 |
assert(VM_Version::supports_avx(), ""); |
34162 | 5194 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
5195 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 5196 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
38049 | 5197 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5198 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
34162 | 5199 |
emit_int8(0x5C); |
5200 |
emit_operand(dst, src); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5201 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5202 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5203 |
void Assembler::vsubsd(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5204 |
assert(VM_Version::supports_avx(), ""); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
5205 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
38049 | 5206 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5207 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
34162 | 5208 |
emit_int8(0x5C); |
5209 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5210 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5211 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5212 |
void Assembler::vsubss(XMMRegister dst, XMMRegister nds, Address src) { |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5213 |
assert(VM_Version::supports_avx(), ""); |
34162 | 5214 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
5215 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 5216 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5217 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
34162 | 5218 |
emit_int8(0x5C); |
5219 |
emit_operand(dst, src); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5220 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5221 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5222 |
void Assembler::vsubss(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5223 |
assert(VM_Version::supports_avx(), ""); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
5224 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5225 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
34162 | 5226 |
emit_int8(0x5C); |
5227 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5228 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5229 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5230 |
//====================VECTOR ARITHMETIC===================================== |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5231 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5232 |
// Float-point vector arithmetic |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5233 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5234 |
void Assembler::addpd(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5235 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5236 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 5237 |
attributes.set_rex_vex_w_reverted(); |
34162 | 5238 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5239 |
emit_int8(0x58); |
|
5240 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5241 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5242 |
|
35146 | 5243 |
void Assembler::addpd(XMMRegister dst, Address src) { |
5244 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
5245 |
InstructionMark im(this); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5246 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 5247 |
attributes.set_rex_vex_w_reverted(); |
35146 | 5248 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
5249 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5250 |
emit_int8(0x58); |
|
5251 |
emit_operand(dst, src); |
|
5252 |
} |
|
5253 |
||
5254 |
||
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5255 |
void Assembler::addps(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5256 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5257 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5258 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
5259 |
emit_int8(0x58); |
|
5260 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5261 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5262 |
|
30624 | 5263 |
void Assembler::vaddpd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5264 |
assert(VM_Version::supports_avx(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5265 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 5266 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5267 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5268 |
emit_int8(0x58); |
5269 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5270 |
} |
5271 |
||
5272 |
void Assembler::vaddps(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
5273 |
assert(VM_Version::supports_avx(), ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5274 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5275 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
34162 | 5276 |
emit_int8(0x58); |
5277 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5278 |
} |
5279 |
||
5280 |
void Assembler::vaddpd(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5281 |
assert(VM_Version::supports_avx(), ""); |
34162 | 5282 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5283 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5284 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
38049 | 5285 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5286 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5287 |
emit_int8(0x58); |
5288 |
emit_operand(dst, src); |
|
30624 | 5289 |
} |
5290 |
||
5291 |
void Assembler::vaddps(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5292 |
assert(VM_Version::supports_avx(), ""); |
34162 | 5293 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5294 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5295 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5296 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
34162 | 5297 |
emit_int8(0x58); |
5298 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5299 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5300 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5301 |
void Assembler::subpd(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5302 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5303 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 5304 |
attributes.set_rex_vex_w_reverted(); |
34162 | 5305 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5306 |
emit_int8(0x5C); |
|
5307 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5308 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5309 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5310 |
void Assembler::subps(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5311 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5312 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5313 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
5314 |
emit_int8(0x5C); |
|
5315 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5316 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5317 |
|
30624 | 5318 |
void Assembler::vsubpd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5319 |
assert(VM_Version::supports_avx(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5320 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 5321 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5322 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5323 |
emit_int8(0x5C); |
5324 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5325 |
} |
5326 |
||
5327 |
void Assembler::vsubps(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
5328 |
assert(VM_Version::supports_avx(), ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5329 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5330 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
34162 | 5331 |
emit_int8(0x5C); |
5332 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5333 |
} |
5334 |
||
5335 |
void Assembler::vsubpd(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5336 |
assert(VM_Version::supports_avx(), ""); |
34162 | 5337 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5338 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5339 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
38049 | 5340 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5341 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5342 |
emit_int8(0x5C); |
5343 |
emit_operand(dst, src); |
|
30624 | 5344 |
} |
5345 |
||
5346 |
void Assembler::vsubps(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5347 |
assert(VM_Version::supports_avx(), ""); |
34162 | 5348 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5349 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5350 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5351 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
34162 | 5352 |
emit_int8(0x5C); |
5353 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5354 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5355 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5356 |
void Assembler::mulpd(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5357 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5358 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 5359 |
attributes.set_rex_vex_w_reverted(); |
34162 | 5360 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5361 |
emit_int8(0x59); |
|
5362 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5363 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5364 |
|
33089 | 5365 |
void Assembler::mulpd(XMMRegister dst, Address src) { |
5366 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 5367 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5368 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5369 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
38049 | 5370 |
attributes.set_rex_vex_w_reverted(); |
34162 | 5371 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5372 |
emit_int8(0x59); |
|
5373 |
emit_operand(dst, src); |
|
33089 | 5374 |
} |
5375 |
||
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5376 |
void Assembler::mulps(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5377 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5378 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5379 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
5380 |
emit_int8(0x59); |
|
5381 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5382 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5383 |
|
30624 | 5384 |
void Assembler::vmulpd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5385 |
assert(VM_Version::supports_avx(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5386 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 5387 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5388 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5389 |
emit_int8(0x59); |
5390 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5391 |
} |
5392 |
||
5393 |
void Assembler::vmulps(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
5394 |
assert(VM_Version::supports_avx(), ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5395 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5396 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
34162 | 5397 |
emit_int8(0x59); |
5398 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5399 |
} |
5400 |
||
5401 |
void Assembler::vmulpd(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5402 |
assert(VM_Version::supports_avx(), ""); |
34162 | 5403 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5404 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5405 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
38049 | 5406 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5407 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5408 |
emit_int8(0x59); |
5409 |
emit_operand(dst, src); |
|
30624 | 5410 |
} |
5411 |
||
5412 |
void Assembler::vmulps(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
5413 |
assert(VM_Version::supports_avx(), ""); |
34162 | 5414 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5415 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5416 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5417 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
34162 | 5418 |
emit_int8(0x59); |
5419 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5420 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5421 |
|
46528 | 5422 |
void Assembler::vfmadd231pd(XMMRegister dst, XMMRegister src1, XMMRegister src2, int vector_len) { |
5423 |
assert(VM_Version::supports_fma(), ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5424 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
46528 | 5425 |
int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
5426 |
emit_int8((unsigned char)0xB8); |
|
5427 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5428 |
} |
|
5429 |
||
5430 |
void Assembler::vfmadd231ps(XMMRegister dst, XMMRegister src1, XMMRegister src2, int vector_len) { |
|
5431 |
assert(VM_Version::supports_fma(), ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5432 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
46528 | 5433 |
int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
5434 |
emit_int8((unsigned char)0xB8); |
|
5435 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5436 |
} |
|
5437 |
||
5438 |
void Assembler::vfmadd231pd(XMMRegister dst, XMMRegister src1, Address src2, int vector_len) { |
|
5439 |
assert(VM_Version::supports_fma(), ""); |
|
5440 |
InstructionMark im(this); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5441 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
46528 | 5442 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
5443 |
vex_prefix(src2, src1->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
5444 |
emit_int8((unsigned char)0xB8); |
|
5445 |
emit_operand(dst, src2); |
|
5446 |
} |
|
5447 |
||
5448 |
void Assembler::vfmadd231ps(XMMRegister dst, XMMRegister src1, Address src2, int vector_len) { |
|
5449 |
assert(VM_Version::supports_fma(), ""); |
|
5450 |
InstructionMark im(this); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5451 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
46528 | 5452 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
5453 |
vex_prefix(src2, src1->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
5454 |
emit_int8((unsigned char)0xB8); |
|
5455 |
emit_operand(dst, src2); |
|
5456 |
} |
|
5457 |
||
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5458 |
void Assembler::divpd(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5459 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5460 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 5461 |
attributes.set_rex_vex_w_reverted(); |
34162 | 5462 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5463 |
emit_int8(0x5E); |
|
5464 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5465 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5466 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5467 |
void Assembler::divps(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5468 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5469 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5470 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
5471 |
emit_int8(0x5E); |
|
5472 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5473 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5474 |
|
30624 | 5475 |
void Assembler::vdivpd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5476 |
assert(VM_Version::supports_avx(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5477 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 5478 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5479 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5480 |
emit_int8(0x5E); |
5481 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5482 |
} |
5483 |
||
5484 |
void Assembler::vdivps(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
5485 |
assert(VM_Version::supports_avx(), ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5486 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5487 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
34162 | 5488 |
emit_int8(0x5E); |
5489 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5490 |
} |
5491 |
||
5492 |
void Assembler::vdivpd(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5493 |
assert(VM_Version::supports_avx(), ""); |
34162 | 5494 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5495 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5496 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
38049 | 5497 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5498 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5499 |
emit_int8(0x5E); |
5500 |
emit_operand(dst, src); |
|
30624 | 5501 |
} |
5502 |
||
5503 |
void Assembler::vdivps(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5504 |
assert(VM_Version::supports_avx(), ""); |
34162 | 5505 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5506 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5507 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5508 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
34162 | 5509 |
emit_int8(0x5E); |
5510 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5511 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5512 |
|
32723
56534fb3d71a
8135028: support for vectorizing double precision sqrt
mcberg
parents:
32391
diff
changeset
|
5513 |
void Assembler::vsqrtpd(XMMRegister dst, XMMRegister src, int vector_len) { |
56534fb3d71a
8135028: support for vectorizing double precision sqrt
mcberg
parents:
32391
diff
changeset
|
5514 |
assert(VM_Version::supports_avx(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5515 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 5516 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5517 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5518 |
emit_int8(0x51); |
5519 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
32723
56534fb3d71a
8135028: support for vectorizing double precision sqrt
mcberg
parents:
32391
diff
changeset
|
5520 |
} |
56534fb3d71a
8135028: support for vectorizing double precision sqrt
mcberg
parents:
32391
diff
changeset
|
5521 |
|
56534fb3d71a
8135028: support for vectorizing double precision sqrt
mcberg
parents:
32391
diff
changeset
|
5522 |
void Assembler::vsqrtpd(XMMRegister dst, Address src, int vector_len) { |
56534fb3d71a
8135028: support for vectorizing double precision sqrt
mcberg
parents:
32391
diff
changeset
|
5523 |
assert(VM_Version::supports_avx(), ""); |
34162 | 5524 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5525 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5526 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
38049 | 5527 |
attributes.set_rex_vex_w_reverted(); |
34162 | 5528 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5529 |
emit_int8(0x51); |
|
5530 |
emit_operand(dst, src); |
|
32723
56534fb3d71a
8135028: support for vectorizing double precision sqrt
mcberg
parents:
32391
diff
changeset
|
5531 |
} |
56534fb3d71a
8135028: support for vectorizing double precision sqrt
mcberg
parents:
32391
diff
changeset
|
5532 |
|
48089
22c9856fc2c2
8190800: Support vectorization of Math.sqrt() on floats
rlupusoru
parents:
47216
diff
changeset
|
5533 |
void Assembler::vsqrtps(XMMRegister dst, XMMRegister src, int vector_len) { |
22c9856fc2c2
8190800: Support vectorization of Math.sqrt() on floats
rlupusoru
parents:
47216
diff
changeset
|
5534 |
assert(VM_Version::supports_avx(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5535 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
48089
22c9856fc2c2
8190800: Support vectorization of Math.sqrt() on floats
rlupusoru
parents:
47216
diff
changeset
|
5536 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
22c9856fc2c2
8190800: Support vectorization of Math.sqrt() on floats
rlupusoru
parents:
47216
diff
changeset
|
5537 |
emit_int8(0x51); |
22c9856fc2c2
8190800: Support vectorization of Math.sqrt() on floats
rlupusoru
parents:
47216
diff
changeset
|
5538 |
emit_int8((unsigned char)(0xC0 | encode)); |
22c9856fc2c2
8190800: Support vectorization of Math.sqrt() on floats
rlupusoru
parents:
47216
diff
changeset
|
5539 |
} |
22c9856fc2c2
8190800: Support vectorization of Math.sqrt() on floats
rlupusoru
parents:
47216
diff
changeset
|
5540 |
|
22c9856fc2c2
8190800: Support vectorization of Math.sqrt() on floats
rlupusoru
parents:
47216
diff
changeset
|
5541 |
void Assembler::vsqrtps(XMMRegister dst, Address src, int vector_len) { |
22c9856fc2c2
8190800: Support vectorization of Math.sqrt() on floats
rlupusoru
parents:
47216
diff
changeset
|
5542 |
assert(VM_Version::supports_avx(), ""); |
22c9856fc2c2
8190800: Support vectorization of Math.sqrt() on floats
rlupusoru
parents:
47216
diff
changeset
|
5543 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5544 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
48089
22c9856fc2c2
8190800: Support vectorization of Math.sqrt() on floats
rlupusoru
parents:
47216
diff
changeset
|
5545 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
22c9856fc2c2
8190800: Support vectorization of Math.sqrt() on floats
rlupusoru
parents:
47216
diff
changeset
|
5546 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
22c9856fc2c2
8190800: Support vectorization of Math.sqrt() on floats
rlupusoru
parents:
47216
diff
changeset
|
5547 |
emit_int8(0x51); |
22c9856fc2c2
8190800: Support vectorization of Math.sqrt() on floats
rlupusoru
parents:
47216
diff
changeset
|
5548 |
emit_operand(dst, src); |
22c9856fc2c2
8190800: Support vectorization of Math.sqrt() on floats
rlupusoru
parents:
47216
diff
changeset
|
5549 |
} |
22c9856fc2c2
8190800: Support vectorization of Math.sqrt() on floats
rlupusoru
parents:
47216
diff
changeset
|
5550 |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5551 |
void Assembler::andpd(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5552 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5553 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 5554 |
attributes.set_rex_vex_w_reverted(); |
34162 | 5555 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5556 |
emit_int8(0x54); |
|
5557 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5558 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5559 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5560 |
void Assembler::andps(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5561 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5562 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5563 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
5564 |
emit_int8(0x54); |
|
5565 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5566 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5567 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5568 |
void Assembler::andps(XMMRegister dst, Address src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5569 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
34162 | 5570 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5571 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5572 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
5573 |
simd_prefix(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
5574 |
emit_int8(0x54); |
|
5575 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5576 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5577 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5578 |
void Assembler::andpd(XMMRegister dst, Address src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5579 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 5580 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5581 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5582 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
38049 | 5583 |
attributes.set_rex_vex_w_reverted(); |
34162 | 5584 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5585 |
emit_int8(0x54); |
|
5586 |
emit_operand(dst, src); |
|
30624 | 5587 |
} |
5588 |
||
5589 |
void Assembler::vandpd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5590 |
assert(VM_Version::supports_avx(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5591 |
InstructionAttr attributes(vector_len, /* vex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 5592 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5593 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5594 |
emit_int8(0x54); |
5595 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5596 |
} |
5597 |
||
5598 |
void Assembler::vandps(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5599 |
assert(VM_Version::supports_avx(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5600 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5601 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
34162 | 5602 |
emit_int8(0x54); |
5603 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5604 |
} |
5605 |
||
5606 |
void Assembler::vandpd(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5607 |
assert(VM_Version::supports_avx(), ""); |
34162 | 5608 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5609 |
InstructionAttr attributes(vector_len, /* vex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5610 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
38049 | 5611 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5612 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5613 |
emit_int8(0x54); |
5614 |
emit_operand(dst, src); |
|
30624 | 5615 |
} |
5616 |
||
5617 |
void Assembler::vandps(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5618 |
assert(VM_Version::supports_avx(), ""); |
34162 | 5619 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5620 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5621 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5622 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
34162 | 5623 |
emit_int8(0x54); |
5624 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5625 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5626 |
|
33089 | 5627 |
void Assembler::unpckhpd(XMMRegister dst, XMMRegister src) { |
5628 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5629 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 5630 |
attributes.set_rex_vex_w_reverted(); |
34162 | 5631 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5632 |
emit_int8(0x15); |
|
5633 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
33089 | 5634 |
} |
5635 |
||
5636 |
void Assembler::unpcklpd(XMMRegister dst, XMMRegister src) { |
|
5637 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5638 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 5639 |
attributes.set_rex_vex_w_reverted(); |
34162 | 5640 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5641 |
emit_int8(0x14); |
|
5642 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
33089 | 5643 |
} |
5644 |
||
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5645 |
void Assembler::xorpd(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5646 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5647 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 5648 |
attributes.set_rex_vex_w_reverted(); |
34162 | 5649 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5650 |
emit_int8(0x57); |
|
5651 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5652 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5653 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5654 |
void Assembler::xorps(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5655 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5656 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5657 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
5658 |
emit_int8(0x57); |
|
5659 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5660 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5661 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5662 |
void Assembler::xorpd(XMMRegister dst, Address src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5663 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 5664 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5665 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5666 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
38049 | 5667 |
attributes.set_rex_vex_w_reverted(); |
34162 | 5668 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5669 |
emit_int8(0x57); |
|
5670 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5671 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5672 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5673 |
void Assembler::xorps(XMMRegister dst, Address src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5674 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
34162 | 5675 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5676 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5677 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
5678 |
simd_prefix(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
5679 |
emit_int8(0x57); |
|
5680 |
emit_operand(dst, src); |
|
30624 | 5681 |
} |
5682 |
||
5683 |
void Assembler::vxorpd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
5684 |
assert(VM_Version::supports_avx(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5685 |
InstructionAttr attributes(vector_len, /* vex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 5686 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5687 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5688 |
emit_int8(0x57); |
5689 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5690 |
} |
5691 |
||
5692 |
void Assembler::vxorps(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
5693 |
assert(VM_Version::supports_avx(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5694 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5695 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
34162 | 5696 |
emit_int8(0x57); |
5697 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5698 |
} |
5699 |
||
5700 |
void Assembler::vxorpd(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5701 |
assert(VM_Version::supports_avx(), ""); |
34162 | 5702 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5703 |
InstructionAttr attributes(vector_len, /* vex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5704 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
38049 | 5705 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5706 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5707 |
emit_int8(0x57); |
5708 |
emit_operand(dst, src); |
|
30624 | 5709 |
} |
5710 |
||
5711 |
void Assembler::vxorps(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5712 |
assert(VM_Version::supports_avx(), ""); |
34162 | 5713 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5714 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5715 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5716 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
34162 | 5717 |
emit_int8(0x57); |
5718 |
emit_operand(dst, src); |
|
30624 | 5719 |
} |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5720 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5721 |
// Integer vector arithmetic |
30624 | 5722 |
void Assembler::vphaddw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
5723 |
assert(VM_Version::supports_avx() && (vector_len == 0) || |
|
5724 |
VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
|
51857 | 5725 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5726 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
30211 | 5727 |
emit_int8(0x01); |
5728 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5729 |
} |
|
5730 |
||
30624 | 5731 |
void Assembler::vphaddd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
5732 |
assert(VM_Version::supports_avx() && (vector_len == 0) || |
|
5733 |
VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5734 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5735 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
30211 | 5736 |
emit_int8(0x02); |
5737 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5738 |
} |
|
5739 |
||
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5740 |
void Assembler::paddb(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5741 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
35113 | 5742 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5743 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5744 |
emit_int8((unsigned char)0xFC); |
|
5745 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5746 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5747 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5748 |
void Assembler::paddw(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5749 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
35113 | 5750 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5751 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5752 |
emit_int8((unsigned char)0xFD); |
|
5753 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5754 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5755 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5756 |
void Assembler::paddd(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5757 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5758 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5759 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5760 |
emit_int8((unsigned char)0xFE); |
|
5761 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5762 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5763 |
|
36555 | 5764 |
void Assembler::paddd(XMMRegister dst, Address src) { |
5765 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
5766 |
InstructionMark im(this); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5767 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5768 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
36555 | 5769 |
emit_int8((unsigned char)0xFE); |
5770 |
emit_operand(dst, src); |
|
5771 |
} |
|
5772 |
||
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5773 |
void Assembler::paddq(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5774 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5775 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 5776 |
attributes.set_rex_vex_w_reverted(); |
34162 | 5777 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5778 |
emit_int8((unsigned char)0xD4); |
|
5779 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5780 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5781 |
|
30211 | 5782 |
void Assembler::phaddw(XMMRegister dst, XMMRegister src) { |
38018
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
37293
diff
changeset
|
5783 |
assert(VM_Version::supports_sse3(), ""); |
51857 | 5784 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5785 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
30211 | 5786 |
emit_int8(0x01); |
5787 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5788 |
} |
|
5789 |
||
5790 |
void Assembler::phaddd(XMMRegister dst, XMMRegister src) { |
|
38018
1dc6c6f21231
8152907: Update for x86 tan and log10 in the math lib
vdeshpande
parents:
37293
diff
changeset
|
5791 |
assert(VM_Version::supports_sse3(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5792 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5793 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
30211 | 5794 |
emit_int8(0x02); |
5795 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5796 |
} |
|
5797 |
||
30624 | 5798 |
void Assembler::vpaddb(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
5799 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
35113 | 5800 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5801 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5802 |
emit_int8((unsigned char)0xFC); |
5803 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5804 |
} |
5805 |
||
5806 |
void Assembler::vpaddw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
5807 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
35113 | 5808 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5809 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5810 |
emit_int8((unsigned char)0xFD); |
5811 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5812 |
} |
5813 |
||
5814 |
void Assembler::vpaddd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
5815 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5816 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5817 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5818 |
emit_int8((unsigned char)0xFE); |
5819 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5820 |
} |
5821 |
||
5822 |
void Assembler::vpaddq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
5823 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5824 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 5825 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5826 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5827 |
emit_int8((unsigned char)0xD4); |
5828 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5829 |
} |
5830 |
||
5831 |
void Assembler::vpaddb(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
5832 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5833 |
InstructionMark im(this); |
35113 | 5834 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5835 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5836 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5837 |
emit_int8((unsigned char)0xFC); |
5838 |
emit_operand(dst, src); |
|
30624 | 5839 |
} |
5840 |
||
5841 |
void Assembler::vpaddw(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
5842 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5843 |
InstructionMark im(this); |
35113 | 5844 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5845 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5846 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5847 |
emit_int8((unsigned char)0xFD); |
5848 |
emit_operand(dst, src); |
|
30624 | 5849 |
} |
5850 |
||
5851 |
void Assembler::vpaddd(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
5852 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5853 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5854 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5855 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5856 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5857 |
emit_int8((unsigned char)0xFE); |
5858 |
emit_operand(dst, src); |
|
30624 | 5859 |
} |
5860 |
||
5861 |
void Assembler::vpaddq(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
5862 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5863 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5864 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5865 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
38049 | 5866 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5867 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5868 |
emit_int8((unsigned char)0xD4); |
5869 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5870 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5871 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5872 |
void Assembler::psubb(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5873 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
35113 | 5874 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5875 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5876 |
emit_int8((unsigned char)0xF8); |
|
5877 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5878 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5879 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5880 |
void Assembler::psubw(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5881 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
35113 | 5882 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5883 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5884 |
emit_int8((unsigned char)0xF9); |
|
5885 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5886 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5887 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5888 |
void Assembler::psubd(XMMRegister dst, XMMRegister src) { |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5889 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5890 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5891 |
emit_int8((unsigned char)0xFA); |
|
5892 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5893 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5894 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5895 |
void Assembler::psubq(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5896 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5897 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 5898 |
attributes.set_rex_vex_w_reverted(); |
34162 | 5899 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5900 |
emit_int8((unsigned char)0xFB); |
|
5901 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5902 |
} |
5903 |
||
5904 |
void Assembler::vpsubb(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
5905 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
35113 | 5906 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5907 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5908 |
emit_int8((unsigned char)0xF8); |
5909 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5910 |
} |
5911 |
||
5912 |
void Assembler::vpsubw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
5913 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
35113 | 5914 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5915 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5916 |
emit_int8((unsigned char)0xF9); |
5917 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5918 |
} |
5919 |
||
5920 |
void Assembler::vpsubd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
5921 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5922 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5923 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5924 |
emit_int8((unsigned char)0xFA); |
5925 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5926 |
} |
5927 |
||
5928 |
void Assembler::vpsubq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
5929 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5930 |
InstructionAttr attributes(vector_len, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 5931 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5932 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5933 |
emit_int8((unsigned char)0xFB); |
5934 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5935 |
} |
5936 |
||
5937 |
void Assembler::vpsubb(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
5938 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5939 |
InstructionMark im(this); |
35113 | 5940 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5941 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5942 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5943 |
emit_int8((unsigned char)0xF8); |
5944 |
emit_operand(dst, src); |
|
30624 | 5945 |
} |
5946 |
||
5947 |
void Assembler::vpsubw(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
5948 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5949 |
InstructionMark im(this); |
35113 | 5950 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5951 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5952 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5953 |
emit_int8((unsigned char)0xF9); |
5954 |
emit_operand(dst, src); |
|
30624 | 5955 |
} |
5956 |
||
5957 |
void Assembler::vpsubd(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
5958 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5959 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5960 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5961 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5962 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5963 |
emit_int8((unsigned char)0xFA); |
5964 |
emit_operand(dst, src); |
|
30624 | 5965 |
} |
5966 |
||
5967 |
void Assembler::vpsubq(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
5968 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5969 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5970 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5971 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
38049 | 5972 |
attributes.set_rex_vex_w_reverted(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5973 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5974 |
emit_int8((unsigned char)0xFB); |
5975 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5976 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5977 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5978 |
void Assembler::pmullw(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5979 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
35113 | 5980 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5981 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5982 |
emit_int8((unsigned char)0xD5); |
|
5983 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5984 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5985 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5986 |
void Assembler::pmulld(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5987 |
assert(VM_Version::supports_sse4_1(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
5988 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5989 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
30624 | 5990 |
emit_int8(0x40); |
5991 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5992 |
} |
|
5993 |
||
5994 |
void Assembler::vpmullw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
5995 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
35113 | 5996 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
5997 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 5998 |
emit_int8((unsigned char)0xD5); |
5999 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 6000 |
} |
6001 |
||
6002 |
void Assembler::vpmulld(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
6003 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6004 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6005 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6006 |
emit_int8(0x40); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6007 |
emit_int8((unsigned char)(0xC0 | encode)); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6008 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6009 |
|
30624 | 6010 |
void Assembler::vpmullq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
38049 | 6011 |
assert(UseAVX > 2, "requires some form of EVEX"); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6012 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 6013 |
attributes.set_is_evex_instruction(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6014 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6015 |
emit_int8(0x40); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6016 |
emit_int8((unsigned char)(0xC0 | encode)); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6017 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6018 |
|
30624 | 6019 |
void Assembler::vpmullw(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
6020 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 6021 |
InstructionMark im(this); |
35113 | 6022 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6023 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6024 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 6025 |
emit_int8((unsigned char)0xD5); |
6026 |
emit_operand(dst, src); |
|
30624 | 6027 |
} |
6028 |
||
6029 |
void Assembler::vpmulld(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
6030 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 6031 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6032 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6033 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6034 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
30624 | 6035 |
emit_int8(0x40); |
6036 |
emit_operand(dst, src); |
|
6037 |
} |
|
6038 |
||
6039 |
void Assembler::vpmullq(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
38049 | 6040 |
assert(UseAVX > 2, "requires some form of EVEX"); |
34162 | 6041 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6042 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6043 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
38049 | 6044 |
attributes.set_is_evex_instruction(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6045 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6046 |
emit_int8(0x40); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6047 |
emit_operand(dst, src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6048 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6049 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6050 |
// Shift packed integers left by specified number of bits. |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6051 |
void Assembler::psllw(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6052 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
35113 | 6053 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6054 |
// XMM6 is for /6 encoding: 66 0F 71 /6 ib |
34162 | 6055 |
int encode = simd_prefix_and_encode(xmm6, dst, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6056 |
emit_int8(0x71); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6057 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6058 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6059 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6060 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6061 |
void Assembler::pslld(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6062 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6063 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6064 |
// XMM6 is for /6 encoding: 66 0F 72 /6 ib |
34162 | 6065 |
int encode = simd_prefix_and_encode(xmm6, dst, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6066 |
emit_int8(0x72); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6067 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6068 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6069 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6070 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6071 |
void Assembler::psllq(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6072 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6073 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6074 |
// XMM6 is for /6 encoding: 66 0F 73 /6 ib |
34162 | 6075 |
int encode = simd_prefix_and_encode(xmm6, dst, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6076 |
emit_int8(0x73); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6077 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6078 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6079 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6080 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6081 |
void Assembler::psllw(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6082 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
35113 | 6083 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6084 |
int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6085 |
emit_int8((unsigned char)0xF1); |
|
6086 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6087 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6088 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6089 |
void Assembler::pslld(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6090 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6091 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6092 |
int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6093 |
emit_int8((unsigned char)0xF2); |
|
6094 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6095 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6096 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6097 |
void Assembler::psllq(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6098 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6099 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 6100 |
attributes.set_rex_vex_w_reverted(); |
34162 | 6101 |
int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6102 |
emit_int8((unsigned char)0xF3); |
|
6103 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 6104 |
} |
6105 |
||
6106 |
void Assembler::vpsllw(XMMRegister dst, XMMRegister src, int shift, int vector_len) { |
|
6107 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
35113 | 6108 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6109 |
// XMM6 is for /6 encoding: 66 0F 71 /6 ib |
34162 | 6110 |
int encode = vex_prefix_and_encode(xmm6->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6111 |
emit_int8(0x71); |
|
6112 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6113 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6114 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6115 |
|
30624 | 6116 |
void Assembler::vpslld(XMMRegister dst, XMMRegister src, int shift, int vector_len) { |
6117 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 6118 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6119 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6120 |
// XMM6 is for /6 encoding: 66 0F 72 /6 ib |
34162 | 6121 |
int encode = vex_prefix_and_encode(xmm6->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6122 |
emit_int8(0x72); |
|
6123 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6124 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6125 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6126 |
|
30624 | 6127 |
void Assembler::vpsllq(XMMRegister dst, XMMRegister src, int shift, int vector_len) { |
6128 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6129 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 6130 |
attributes.set_rex_vex_w_reverted(); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6131 |
// XMM6 is for /6 encoding: 66 0F 73 /6 ib |
34162 | 6132 |
int encode = vex_prefix_and_encode(xmm6->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6133 |
emit_int8(0x73); |
|
6134 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6135 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6136 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6137 |
|
30624 | 6138 |
void Assembler::vpsllw(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { |
6139 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
35113 | 6140 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6141 |
int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6142 |
emit_int8((unsigned char)0xF1); |
|
6143 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 6144 |
} |
6145 |
||
6146 |
void Assembler::vpslld(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { |
|
6147 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6148 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6149 |
int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6150 |
emit_int8((unsigned char)0xF2); |
|
6151 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 6152 |
} |
6153 |
||
6154 |
void Assembler::vpsllq(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { |
|
6155 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6156 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 6157 |
attributes.set_rex_vex_w_reverted(); |
34162 | 6158 |
int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6159 |
emit_int8((unsigned char)0xF3); |
|
6160 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6161 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6162 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6163 |
// Shift packed integers logically right by specified number of bits. |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6164 |
void Assembler::psrlw(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6165 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
35113 | 6166 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6167 |
// XMM2 is for /2 encoding: 66 0F 71 /2 ib |
34162 | 6168 |
int encode = simd_prefix_and_encode(xmm2, dst, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6169 |
emit_int8(0x71); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6170 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6171 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6172 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6173 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6174 |
void Assembler::psrld(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6175 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6176 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6177 |
// XMM2 is for /2 encoding: 66 0F 72 /2 ib |
34162 | 6178 |
int encode = simd_prefix_and_encode(xmm2, dst, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6179 |
emit_int8(0x72); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6180 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6181 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6182 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6183 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6184 |
void Assembler::psrlq(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6185 |
// Do not confuse it with psrldq SSE2 instruction which |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6186 |
// shifts 128 bit value in xmm register by number of bytes. |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6187 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6188 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 6189 |
attributes.set_rex_vex_w_reverted(); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6190 |
// XMM2 is for /2 encoding: 66 0F 73 /2 ib |
34162 | 6191 |
int encode = simd_prefix_and_encode(xmm2, dst, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6192 |
emit_int8(0x73); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6193 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6194 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6195 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6196 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6197 |
void Assembler::psrlw(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6198 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
35113 | 6199 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6200 |
int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6201 |
emit_int8((unsigned char)0xD1); |
|
6202 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6203 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6204 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6205 |
void Assembler::psrld(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6206 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6207 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6208 |
int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6209 |
emit_int8((unsigned char)0xD2); |
|
6210 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6211 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6212 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6213 |
void Assembler::psrlq(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6214 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6215 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 6216 |
attributes.set_rex_vex_w_reverted(); |
34162 | 6217 |
int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6218 |
emit_int8((unsigned char)0xD3); |
|
6219 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 6220 |
} |
6221 |
||
6222 |
void Assembler::vpsrlw(XMMRegister dst, XMMRegister src, int shift, int vector_len) { |
|
6223 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
35113 | 6224 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6225 |
// XMM2 is for /2 encoding: 66 0F 71 /2 ib |
34162 | 6226 |
int encode = vex_prefix_and_encode(xmm2->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6227 |
emit_int8(0x71); |
|
6228 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6229 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6230 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6231 |
|
30624 | 6232 |
void Assembler::vpsrld(XMMRegister dst, XMMRegister src, int shift, int vector_len) { |
6233 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6234 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6235 |
// XMM2 is for /2 encoding: 66 0F 72 /2 ib |
34162 | 6236 |
int encode = vex_prefix_and_encode(xmm2->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6237 |
emit_int8(0x72); |
|
6238 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6239 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6240 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6241 |
|
30624 | 6242 |
void Assembler::vpsrlq(XMMRegister dst, XMMRegister src, int shift, int vector_len) { |
6243 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6244 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 6245 |
attributes.set_rex_vex_w_reverted(); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6246 |
// XMM2 is for /2 encoding: 66 0F 73 /2 ib |
34162 | 6247 |
int encode = vex_prefix_and_encode(xmm2->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6248 |
emit_int8(0x73); |
|
6249 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6250 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6251 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6252 |
|
30624 | 6253 |
void Assembler::vpsrlw(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { |
6254 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
35113 | 6255 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6256 |
int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6257 |
emit_int8((unsigned char)0xD1); |
|
6258 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 6259 |
} |
6260 |
||
6261 |
void Assembler::vpsrld(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { |
|
6262 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6263 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6264 |
int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6265 |
emit_int8((unsigned char)0xD2); |
|
6266 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 6267 |
} |
6268 |
||
6269 |
void Assembler::vpsrlq(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { |
|
6270 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6271 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 6272 |
attributes.set_rex_vex_w_reverted(); |
34162 | 6273 |
int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6274 |
emit_int8((unsigned char)0xD3); |
|
6275 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6276 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6277 |
|
50860
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6278 |
void Assembler::evpsrlvw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6279 |
assert(VM_Version::supports_avx512bw(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6280 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
50860
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6281 |
attributes.set_is_evex_instruction(); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6282 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6283 |
emit_int8(0x10); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6284 |
emit_int8((unsigned char)(0xC0 | encode)); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6285 |
} |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6286 |
|
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6287 |
void Assembler::evpsllvw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6288 |
assert(VM_Version::supports_avx512bw(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6289 |
InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
50860
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6290 |
attributes.set_is_evex_instruction(); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6291 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6292 |
emit_int8(0x12); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6293 |
emit_int8((unsigned char)(0xC0 | encode)); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6294 |
} |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6295 |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6296 |
// Shift packed integers arithmetically right by specified number of bits. |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6297 |
void Assembler::psraw(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6298 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
35113 | 6299 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6300 |
// XMM4 is for /4 encoding: 66 0F 71 /4 ib |
34162 | 6301 |
int encode = simd_prefix_and_encode(xmm4, dst, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6302 |
emit_int8(0x71); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6303 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6304 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6305 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6306 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6307 |
void Assembler::psrad(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6308 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6309 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6310 |
// XMM4 is for /4 encoding: 66 0F 72 /4 ib |
34162 | 6311 |
int encode = simd_prefix_and_encode(xmm4, dst, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6312 |
emit_int8(0x72); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6313 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6314 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6315 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6316 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6317 |
void Assembler::psraw(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6318 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
35113 | 6319 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6320 |
int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6321 |
emit_int8((unsigned char)0xE1); |
|
6322 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6323 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6324 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6325 |
void Assembler::psrad(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6326 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6327 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6328 |
int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6329 |
emit_int8((unsigned char)0xE2); |
|
6330 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6331 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6332 |
|
30624 | 6333 |
void Assembler::vpsraw(XMMRegister dst, XMMRegister src, int shift, int vector_len) { |
6334 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
35113 | 6335 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6336 |
// XMM4 is for /4 encoding: 66 0F 71 /4 ib |
34162 | 6337 |
int encode = vex_prefix_and_encode(xmm4->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6338 |
emit_int8(0x71); |
|
6339 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6340 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6341 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6342 |
|
30624 | 6343 |
void Assembler::vpsrad(XMMRegister dst, XMMRegister src, int shift, int vector_len) { |
6344 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6345 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6346 |
// XMM4 is for /4 encoding: 66 0F 71 /4 ib |
34162 | 6347 |
int encode = vex_prefix_and_encode(xmm4->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6348 |
emit_int8(0x72); |
|
6349 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6350 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6351 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6352 |
|
30624 | 6353 |
void Assembler::vpsraw(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { |
6354 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
35113 | 6355 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6356 |
int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6357 |
emit_int8((unsigned char)0xE1); |
|
6358 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 6359 |
} |
6360 |
||
6361 |
void Assembler::vpsrad(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { |
|
6362 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6363 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6364 |
int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6365 |
emit_int8((unsigned char)0xE2); |
|
6366 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6367 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6368 |
|
54750 | 6369 |
void Assembler::evpsraq(XMMRegister dst, XMMRegister src, int shift, int vector_len) { |
6370 |
assert(UseAVX > 2, "requires AVX512"); |
|
6371 |
assert ((VM_Version::supports_avx512vl() || vector_len == 2), "requires AVX512vl"); |
|
6372 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
|
6373 |
attributes.set_is_evex_instruction(); |
|
6374 |
int encode = vex_prefix_and_encode(xmm4->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
6375 |
emit_int8((unsigned char)0x72); |
|
6376 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
6377 |
emit_int8(shift & 0xFF); |
|
6378 |
} |
|
6379 |
||
6380 |
void Assembler::evpsraq(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { |
|
6381 |
assert(UseAVX > 2, "requires AVX512"); |
|
6382 |
assert ((VM_Version::supports_avx512vl() || vector_len == 2), "requires AVX512vl"); |
|
6383 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
|
6384 |
attributes.set_is_evex_instruction(); |
|
6385 |
int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
6386 |
emit_int8((unsigned char)0xE2); |
|
6387 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
6388 |
} |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6389 |
|
33089 | 6390 |
// logical operations packed integers |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6391 |
void Assembler::pand(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6392 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6393 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6394 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6395 |
emit_int8((unsigned char)0xDB); |
|
6396 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6397 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6398 |
|
30624 | 6399 |
void Assembler::vpand(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
6400 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6401 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6402 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 6403 |
emit_int8((unsigned char)0xDB); |
6404 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 6405 |
} |
6406 |
||
6407 |
void Assembler::vpand(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
6408 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 6409 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6410 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6411 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6412 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 6413 |
emit_int8((unsigned char)0xDB); |
6414 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6415 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6416 |
|
50860
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6417 |
void Assembler::vpandq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6418 |
assert(VM_Version::supports_evex(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6419 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
50860
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6420 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6421 |
emit_int8((unsigned char)0xDB); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6422 |
emit_int8((unsigned char)(0xC0 | encode)); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6423 |
} |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6424 |
|
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6425 |
|
33089 | 6426 |
void Assembler::pandn(XMMRegister dst, XMMRegister src) { |
6427 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6428 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 6429 |
attributes.set_rex_vex_w_reverted(); |
34162 | 6430 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6431 |
emit_int8((unsigned char)0xDF); |
|
6432 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
33089 | 6433 |
} |
6434 |
||
51857 | 6435 |
void Assembler::vpandn(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
6436 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6437 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
51857 | 6438 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6439 |
emit_int8((unsigned char)0xDF); |
|
6440 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
6441 |
} |
|
6442 |
||
6443 |
||
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6444 |
void Assembler::por(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6445 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6446 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6447 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6448 |
emit_int8((unsigned char)0xEB); |
|
6449 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6450 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6451 |
|
30624 | 6452 |
void Assembler::vpor(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
6453 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6454 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6455 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 6456 |
emit_int8((unsigned char)0xEB); |
6457 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 6458 |
} |
6459 |
||
6460 |
void Assembler::vpor(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
6461 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 6462 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6463 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6464 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6465 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 6466 |
emit_int8((unsigned char)0xEB); |
6467 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6468 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6469 |
|
50860
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6470 |
void Assembler::vporq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6471 |
assert(VM_Version::supports_evex(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6472 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
50860
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6473 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6474 |
emit_int8((unsigned char)0xEB); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6475 |
emit_int8((unsigned char)(0xC0 | encode)); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6476 |
} |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6477 |
|
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
6478 |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6479 |
void Assembler::pxor(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6480 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6481 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6482 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
6483 |
emit_int8((unsigned char)0xEF); |
|
6484 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
6485 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
6486 |
|
30624 | 6487 |
void Assembler::vpxor(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
6488 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6489 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6490 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 6491 |
emit_int8((unsigned char)0xEF); |
6492 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 6493 |
} |
6494 |
||
6495 |
void Assembler::vpxor(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
6496 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 6497 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6498 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6499 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6500 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34162 | 6501 |
emit_int8((unsigned char)0xEF); |
6502 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6503 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
6504 |
|
49614
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
6505 |
void Assembler::evpxorq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
6506 |
assert(VM_Version::supports_evex(), "requires EVEX support"); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
6507 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
6508 |
attributes.set_is_evex_instruction(); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
6509 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
6510 |
emit_int8((unsigned char)0xEF); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
6511 |
emit_int8((unsigned char)(0xC0 | encode)); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
6512 |
} |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
6513 |
|
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
6514 |
void Assembler::evpxorq(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
6515 |
assert(VM_Version::supports_evex(), "requires EVEX support"); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
6516 |
assert(dst != xnoreg, "sanity"); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
6517 |
InstructionMark im(this); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
6518 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
6519 |
attributes.set_is_evex_instruction(); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
6520 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
6521 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
6522 |
emit_int8((unsigned char)0xEF); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
6523 |
emit_operand(dst, src); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
6524 |
} |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
6525 |
|
13294 | 6526 |
|
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6527 |
// vinserti forms |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6528 |
|
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6529 |
void Assembler::vinserti128(XMMRegister dst, XMMRegister nds, XMMRegister src, uint8_t imm8) { |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6530 |
assert(VM_Version::supports_avx2(), ""); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6531 |
assert(imm8 <= 0x01, "imm8: %u", imm8); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6532 |
InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6533 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6534 |
emit_int8(0x38); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6535 |
emit_int8((unsigned char)(0xC0 | encode)); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6536 |
// 0x00 - insert into lower 128 bits |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6537 |
// 0x01 - insert into upper 128 bits |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6538 |
emit_int8(imm8 & 0x01); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6539 |
} |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6540 |
|
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6541 |
void Assembler::vinserti128(XMMRegister dst, XMMRegister nds, Address src, uint8_t imm8) { |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6542 |
assert(VM_Version::supports_avx2(), ""); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6543 |
assert(dst != xnoreg, "sanity"); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6544 |
assert(imm8 <= 0x01, "imm8: %u", imm8); |
51857 | 6545 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6546 |
InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6547 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6548 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6549 |
emit_int8(0x38); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6550 |
emit_operand(dst, src); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6551 |
// 0x00 - insert into lower 128 bits |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6552 |
// 0x01 - insert into upper 128 bits |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6553 |
emit_int8(imm8 & 0x01); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6554 |
} |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6555 |
|
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6556 |
void Assembler::vinserti32x4(XMMRegister dst, XMMRegister nds, XMMRegister src, uint8_t imm8) { |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6557 |
assert(VM_Version::supports_evex(), ""); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6558 |
assert(imm8 <= 0x03, "imm8: %u", imm8); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6559 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
51857 | 6560 |
attributes.set_is_evex_instruction(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6561 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6562 |
emit_int8(0x38); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6563 |
emit_int8((unsigned char)(0xC0 | encode)); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6564 |
// 0x00 - insert into q0 128 bits (0..127) |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6565 |
// 0x01 - insert into q1 128 bits (128..255) |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6566 |
// 0x02 - insert into q2 128 bits (256..383) |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6567 |
// 0x03 - insert into q3 128 bits (384..511) |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6568 |
emit_int8(imm8 & 0x03); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6569 |
} |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6570 |
|
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6571 |
void Assembler::vinserti32x4(XMMRegister dst, XMMRegister nds, Address src, uint8_t imm8) { |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6572 |
assert(VM_Version::supports_avx(), ""); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6573 |
assert(dst != xnoreg, "sanity"); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6574 |
assert(imm8 <= 0x03, "imm8: %u", imm8); |
51857 | 6575 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6576 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6577 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit); |
51857 | 6578 |
attributes.set_is_evex_instruction(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6579 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6580 |
emit_int8(0x18); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6581 |
emit_operand(dst, src); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6582 |
// 0x00 - insert into q0 128 bits (0..127) |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6583 |
// 0x01 - insert into q1 128 bits (128..255) |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6584 |
// 0x02 - insert into q2 128 bits (256..383) |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6585 |
// 0x03 - insert into q3 128 bits (384..511) |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6586 |
emit_int8(imm8 & 0x03); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6587 |
} |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6588 |
|
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6589 |
void Assembler::vinserti64x4(XMMRegister dst, XMMRegister nds, XMMRegister src, uint8_t imm8) { |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6590 |
assert(VM_Version::supports_evex(), ""); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6591 |
assert(imm8 <= 0x01, "imm8: %u", imm8); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6592 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
51857 | 6593 |
attributes.set_is_evex_instruction(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6594 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
51857 | 6595 |
emit_int8(0x3A); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6596 |
emit_int8((unsigned char)(0xC0 | encode)); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6597 |
// 0x00 - insert into lower 256 bits |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6598 |
// 0x01 - insert into upper 256 bits |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6599 |
emit_int8(imm8 & 0x01); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6600 |
} |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6601 |
|
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6602 |
|
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6603 |
// vinsertf forms |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6604 |
|
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6605 |
void Assembler::vinsertf128(XMMRegister dst, XMMRegister nds, XMMRegister src, uint8_t imm8) { |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
6606 |
assert(VM_Version::supports_avx(), ""); |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6607 |
assert(imm8 <= 0x01, "imm8: %u", imm8); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6608 |
InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6609 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6610 |
emit_int8(0x18); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6611 |
emit_int8((unsigned char)(0xC0 | encode)); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
6612 |
// 0x00 - insert into lower 128 bits |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
6613 |
// 0x01 - insert into upper 128 bits |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6614 |
emit_int8(imm8 & 0x01); |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6615 |
} |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6616 |
|
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6617 |
void Assembler::vinsertf128(XMMRegister dst, XMMRegister nds, Address src, uint8_t imm8) { |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6618 |
assert(VM_Version::supports_avx(), ""); |
30624 | 6619 |
assert(dst != xnoreg, "sanity"); |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6620 |
assert(imm8 <= 0x01, "imm8: %u", imm8); |
51857 | 6621 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6622 |
InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6623 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6624 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6625 |
emit_int8(0x18); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6626 |
emit_operand(dst, src); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6627 |
// 0x00 - insert into lower 128 bits |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6628 |
// 0x01 - insert into upper 128 bits |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6629 |
emit_int8(imm8 & 0x01); |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6630 |
} |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6631 |
|
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6632 |
void Assembler::vinsertf32x4(XMMRegister dst, XMMRegister nds, XMMRegister src, uint8_t imm8) { |
51857 | 6633 |
assert(VM_Version::supports_avx2(), ""); |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6634 |
assert(imm8 <= 0x03, "imm8: %u", imm8); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6635 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6636 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6637 |
emit_int8(0x18); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6638 |
emit_int8((unsigned char)(0xC0 | encode)); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6639 |
// 0x00 - insert into q0 128 bits (0..127) |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6640 |
// 0x01 - insert into q1 128 bits (128..255) |
51857 | 6641 |
// 0x02 - insert into q0 128 bits (256..383) |
6642 |
// 0x03 - insert into q1 128 bits (384..512) |
|
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6643 |
emit_int8(imm8 & 0x03); |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6644 |
} |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6645 |
|
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6646 |
void Assembler::vinsertf32x4(XMMRegister dst, XMMRegister nds, Address src, uint8_t imm8) { |
34162 | 6647 |
assert(VM_Version::supports_avx(), ""); |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6648 |
assert(dst != xnoreg, "sanity"); |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6649 |
assert(imm8 <= 0x03, "imm8: %u", imm8); |
51857 | 6650 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6651 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6652 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6653 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6654 |
emit_int8(0x18); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6655 |
emit_operand(dst, src); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6656 |
// 0x00 - insert into q0 128 bits (0..127) |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6657 |
// 0x01 - insert into q1 128 bits (128..255) |
51857 | 6658 |
// 0x02 - insert into q0 128 bits (256..383) |
6659 |
// 0x03 - insert into q1 128 bits (384..512) |
|
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6660 |
emit_int8(imm8 & 0x03); |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6661 |
} |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6662 |
|
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6663 |
void Assembler::vinsertf64x4(XMMRegister dst, XMMRegister nds, XMMRegister src, uint8_t imm8) { |
30624 | 6664 |
assert(VM_Version::supports_evex(), ""); |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6665 |
assert(imm8 <= 0x01, "imm8: %u", imm8); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6666 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
51857 | 6667 |
attributes.set_is_evex_instruction(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6668 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6669 |
emit_int8(0x1A); |
30624 | 6670 |
emit_int8((unsigned char)(0xC0 | encode)); |
6671 |
// 0x00 - insert into lower 256 bits |
|
6672 |
// 0x01 - insert into upper 256 bits |
|
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6673 |
emit_int8(imm8 & 0x01); |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6674 |
} |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6675 |
|
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6676 |
void Assembler::vinsertf64x4(XMMRegister dst, XMMRegister nds, Address src, uint8_t imm8) { |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6677 |
assert(VM_Version::supports_evex(), ""); |
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
6678 |
assert(dst != xnoreg, "sanity"); |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6679 |
assert(imm8 <= 0x01, "imm8: %u", imm8); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6680 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6681 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6682 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_64bit); |
51857 | 6683 |
attributes.set_is_evex_instruction(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6684 |
vex_prefix(src, nds->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6685 |
emit_int8(0x1A); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6686 |
emit_operand(dst, src); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6687 |
// 0x00 - insert into lower 256 bits |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6688 |
// 0x01 - insert into upper 256 bits |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6689 |
emit_int8(imm8 & 0x01); |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6690 |
} |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6691 |
|
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6692 |
|
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6693 |
// vextracti forms |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6694 |
|
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6695 |
void Assembler::vextracti128(XMMRegister dst, XMMRegister src, uint8_t imm8) { |
51857 | 6696 |
assert(VM_Version::supports_avx2(), ""); |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6697 |
assert(imm8 <= 0x01, "imm8: %u", imm8); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6698 |
InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6699 |
int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
30624 | 6700 |
emit_int8(0x39); |
6701 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6702 |
// 0x00 - extract from lower 128 bits |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6703 |
// 0x01 - extract from upper 128 bits |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6704 |
emit_int8(imm8 & 0x01); |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6705 |
} |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6706 |
|
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6707 |
void Assembler::vextracti128(Address dst, XMMRegister src, uint8_t imm8) { |
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
6708 |
assert(VM_Version::supports_avx2(), ""); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
6709 |
assert(src != xnoreg, "sanity"); |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6710 |
assert(imm8 <= 0x01, "imm8: %u", imm8); |
51857 | 6711 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6712 |
InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6713 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit); |
42014
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
6714 |
attributes.reset_is_clear_context(); |
34162 | 6715 |
vex_prefix(dst, 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6716 |
emit_int8(0x39); |
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
6717 |
emit_operand(src, dst); |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6718 |
// 0x00 - extract from lower 128 bits |
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
6719 |
// 0x01 - extract from upper 128 bits |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6720 |
emit_int8(imm8 & 0x01); |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6721 |
} |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6722 |
|
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6723 |
void Assembler::vextracti32x4(XMMRegister dst, XMMRegister src, uint8_t imm8) { |
51857 | 6724 |
assert(VM_Version::supports_evex(), ""); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6725 |
assert(imm8 <= 0x03, "imm8: %u", imm8); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6726 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
51857 | 6727 |
attributes.set_is_evex_instruction(); |
34162 | 6728 |
int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6729 |
emit_int8(0x39); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6730 |
emit_int8((unsigned char)(0xC0 | encode)); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6731 |
// 0x00 - extract from bits 127:0 |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6732 |
// 0x01 - extract from bits 255:128 |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6733 |
// 0x02 - extract from bits 383:256 |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6734 |
// 0x03 - extract from bits 511:384 |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6735 |
emit_int8(imm8 & 0x03); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6736 |
} |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6737 |
|
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6738 |
void Assembler::vextracti32x4(Address dst, XMMRegister src, uint8_t imm8) { |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6739 |
assert(VM_Version::supports_evex(), ""); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6740 |
assert(src != xnoreg, "sanity"); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6741 |
assert(imm8 <= 0x03, "imm8: %u", imm8); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6742 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6743 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6744 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit); |
42014
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
6745 |
attributes.reset_is_clear_context(); |
51857 | 6746 |
attributes.set_is_evex_instruction(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6747 |
vex_prefix(dst, 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6748 |
emit_int8(0x39); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6749 |
emit_operand(src, dst); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6750 |
// 0x00 - extract from bits 127:0 |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6751 |
// 0x01 - extract from bits 255:128 |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6752 |
// 0x02 - extract from bits 383:256 |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6753 |
// 0x03 - extract from bits 511:384 |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6754 |
emit_int8(imm8 & 0x03); |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6755 |
} |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6756 |
|
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6757 |
void Assembler::vextracti64x2(XMMRegister dst, XMMRegister src, uint8_t imm8) { |
38049 | 6758 |
assert(VM_Version::supports_avx512dq(), ""); |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6759 |
assert(imm8 <= 0x03, "imm8: %u", imm8); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6760 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
51857 | 6761 |
attributes.set_is_evex_instruction(); |
34162 | 6762 |
int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
30624 | 6763 |
emit_int8(0x39); |
6764 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6765 |
// 0x00 - extract from bits 127:0 |
30624 | 6766 |
// 0x01 - extract from bits 255:128 |
6767 |
// 0x02 - extract from bits 383:256 |
|
6768 |
// 0x03 - extract from bits 511:384 |
|
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6769 |
emit_int8(imm8 & 0x03); |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6770 |
} |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6771 |
|
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6772 |
void Assembler::vextracti64x4(XMMRegister dst, XMMRegister src, uint8_t imm8) { |
30624 | 6773 |
assert(VM_Version::supports_evex(), ""); |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6774 |
assert(imm8 <= 0x01, "imm8: %u", imm8); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6775 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
51857 | 6776 |
attributes.set_is_evex_instruction(); |
34162 | 6777 |
int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6778 |
emit_int8(0x3B); |
30624 | 6779 |
emit_int8((unsigned char)(0xC0 | encode)); |
34162 | 6780 |
// 0x00 - extract from lower 256 bits |
30624 | 6781 |
// 0x01 - extract from upper 256 bits |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6782 |
emit_int8(imm8 & 0x01); |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6783 |
} |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6784 |
|
51857 | 6785 |
void Assembler::vextracti64x4(Address dst, XMMRegister src, uint8_t imm8) { |
6786 |
assert(VM_Version::supports_evex(), ""); |
|
6787 |
assert(src != xnoreg, "sanity"); |
|
6788 |
assert(imm8 <= 0x01, "imm8: %u", imm8); |
|
6789 |
InstructionMark im(this); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6790 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
51857 | 6791 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_64bit); |
6792 |
attributes.reset_is_clear_context(); |
|
6793 |
attributes.set_is_evex_instruction(); |
|
6794 |
vex_prefix(dst, 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
6795 |
emit_int8(0x38); |
|
6796 |
emit_operand(src, dst); |
|
6797 |
// 0x00 - extract from lower 256 bits |
|
6798 |
// 0x01 - extract from upper 256 bits |
|
6799 |
emit_int8(imm8 & 0x01); |
|
6800 |
} |
|
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6801 |
// vextractf forms |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6802 |
|
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6803 |
void Assembler::vextractf128(XMMRegister dst, XMMRegister src, uint8_t imm8) { |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6804 |
assert(VM_Version::supports_avx(), ""); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6805 |
assert(imm8 <= 0x01, "imm8: %u", imm8); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6806 |
InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6807 |
int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6808 |
emit_int8(0x19); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6809 |
emit_int8((unsigned char)(0xC0 | encode)); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6810 |
// 0x00 - extract from lower 128 bits |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6811 |
// 0x01 - extract from upper 128 bits |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6812 |
emit_int8(imm8 & 0x01); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6813 |
} |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6814 |
|
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6815 |
void Assembler::vextractf128(Address dst, XMMRegister src, uint8_t imm8) { |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6816 |
assert(VM_Version::supports_avx(), ""); |
30624 | 6817 |
assert(src != xnoreg, "sanity"); |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6818 |
assert(imm8 <= 0x01, "imm8: %u", imm8); |
51857 | 6819 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6820 |
InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6821 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit); |
42014
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
6822 |
attributes.reset_is_clear_context(); |
34162 | 6823 |
vex_prefix(dst, 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6824 |
emit_int8(0x19); |
30624 | 6825 |
emit_operand(src, dst); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6826 |
// 0x00 - extract from lower 128 bits |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6827 |
// 0x01 - extract from upper 128 bits |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6828 |
emit_int8(imm8 & 0x01); |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6829 |
} |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6830 |
|
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6831 |
void Assembler::vextractf32x4(XMMRegister dst, XMMRegister src, uint8_t imm8) { |
51857 | 6832 |
assert(VM_Version::supports_evex(), ""); |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6833 |
assert(imm8 <= 0x03, "imm8: %u", imm8); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6834 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
51857 | 6835 |
attributes.set_is_evex_instruction(); |
34162 | 6836 |
int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
30624 | 6837 |
emit_int8(0x19); |
6838 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6839 |
// 0x00 - extract from bits 127:0 |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6840 |
// 0x01 - extract from bits 255:128 |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6841 |
// 0x02 - extract from bits 383:256 |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6842 |
// 0x03 - extract from bits 511:384 |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6843 |
emit_int8(imm8 & 0x03); |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6844 |
} |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6845 |
|
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6846 |
void Assembler::vextractf32x4(Address dst, XMMRegister src, uint8_t imm8) { |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6847 |
assert(VM_Version::supports_evex(), ""); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6848 |
assert(src != xnoreg, "sanity"); |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6849 |
assert(imm8 <= 0x03, "imm8: %u", imm8); |
34162 | 6850 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6851 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6852 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit); |
42014
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
6853 |
attributes.reset_is_clear_context(); |
51857 | 6854 |
attributes.set_is_evex_instruction(); |
34162 | 6855 |
vex_prefix(dst, 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6856 |
emit_int8(0x19); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6857 |
emit_operand(src, dst); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6858 |
// 0x00 - extract from bits 127:0 |
30624 | 6859 |
// 0x01 - extract from bits 255:128 |
6860 |
// 0x02 - extract from bits 383:256 |
|
6861 |
// 0x03 - extract from bits 511:384 |
|
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6862 |
emit_int8(imm8 & 0x03); |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6863 |
} |
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6864 |
|
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6865 |
void Assembler::vextractf64x2(XMMRegister dst, XMMRegister src, uint8_t imm8) { |
38049 | 6866 |
assert(VM_Version::supports_avx512dq(), ""); |
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6867 |
assert(imm8 <= 0x03, "imm8: %u", imm8); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6868 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
51857 | 6869 |
attributes.set_is_evex_instruction(); |
34162 | 6870 |
int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
30624 | 6871 |
emit_int8(0x19); |
6872 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6873 |
// 0x00 - extract from bits 127:0 |
30624 | 6874 |
// 0x01 - extract from bits 255:128 |
6875 |
// 0x02 - extract from bits 383:256 |
|
6876 |
// 0x03 - extract from bits 511:384 |
|
36561
b18243f4d955
8151002: Make Assembler methods vextract and vinsert match actual instructions
mikael
parents:
36555
diff
changeset
|
6877 |
emit_int8(imm8 & 0x03); |
30624 | 6878 |
} |
6879 |
||
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6880 |
void Assembler::vextractf64x4(XMMRegister dst, XMMRegister src, uint8_t imm8) { |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6881 |
assert(VM_Version::supports_evex(), ""); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6882 |
assert(imm8 <= 0x01, "imm8: %u", imm8); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6883 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
51857 | 6884 |
attributes.set_is_evex_instruction(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6885 |
int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6886 |
emit_int8(0x1B); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6887 |
emit_int8((unsigned char)(0xC0 | encode)); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6888 |
// 0x00 - extract from lower 256 bits |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6889 |
// 0x01 - extract from upper 256 bits |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6890 |
emit_int8(imm8 & 0x01); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6891 |
} |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6892 |
|
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6893 |
void Assembler::vextractf64x4(Address dst, XMMRegister src, uint8_t imm8) { |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6894 |
assert(VM_Version::supports_evex(), ""); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6895 |
assert(src != xnoreg, "sanity"); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6896 |
assert(imm8 <= 0x01, "imm8: %u", imm8); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6897 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6898 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6899 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T4,/* input_size_in_bits */ EVEX_64bit); |
42014
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
6900 |
attributes.reset_is_clear_context(); |
51857 | 6901 |
attributes.set_is_evex_instruction(); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6902 |
vex_prefix(dst, 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6903 |
emit_int8(0x1B); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6904 |
emit_operand(src, dst); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6905 |
// 0x00 - extract from lower 256 bits |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6906 |
// 0x01 - extract from upper 256 bits |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6907 |
emit_int8(imm8 & 0x01); |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6908 |
} |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6909 |
|
51857 | 6910 |
// duplicate 1-byte integer data from src into programmed locations in dest : requires AVX512BW and AVX512VL |
6911 |
void Assembler::vpbroadcastb(XMMRegister dst, XMMRegister src, int vector_len) { |
|
34162 | 6912 |
assert(VM_Version::supports_avx2(), ""); |
36066 | 6913 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6914 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
31410 | 6915 |
emit_int8(0x78); |
6916 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
6917 |
} |
|
6918 |
||
51857 | 6919 |
void Assembler::vpbroadcastb(XMMRegister dst, Address src, int vector_len) { |
6920 |
assert(VM_Version::supports_avx2(), ""); |
|
31410 | 6921 |
assert(dst != xnoreg, "sanity"); |
34162 | 6922 |
InstructionMark im(this); |
36066 | 6923 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6924 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_8bit); |
31410 | 6925 |
// swap src<->dst for encoding |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6926 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
31410 | 6927 |
emit_int8(0x78); |
6928 |
emit_operand(dst, src); |
|
6929 |
} |
|
6930 |
||
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6931 |
// duplicate 2-byte integer data from src into programmed locations in dest : requires AVX512BW and AVX512VL |
51857 | 6932 |
void Assembler::vpbroadcastw(XMMRegister dst, XMMRegister src, int vector_len) { |
6933 |
assert(VM_Version::supports_avx2(), ""); |
|
36066 | 6934 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6935 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
31410 | 6936 |
emit_int8(0x79); |
6937 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
6938 |
} |
|
6939 |
||
51857 | 6940 |
void Assembler::vpbroadcastw(XMMRegister dst, Address src, int vector_len) { |
6941 |
assert(VM_Version::supports_avx2(), ""); |
|
31410 | 6942 |
assert(dst != xnoreg, "sanity"); |
34162 | 6943 |
InstructionMark im(this); |
36066 | 6944 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6945 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_16bit); |
31410 | 6946 |
// swap src<->dst for encoding |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6947 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
31410 | 6948 |
emit_int8(0x79); |
6949 |
emit_operand(dst, src); |
|
6950 |
} |
|
6951 |
||
51857 | 6952 |
// xmm/mem sourced byte/word/dword/qword replicate |
6953 |
||
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6954 |
// duplicate 4-byte integer data from src into programmed locations in dest : requires AVX512VL |
51857 | 6955 |
void Assembler::vpbroadcastd(XMMRegister dst, XMMRegister src, int vector_len) { |
6956 |
assert(UseAVX >= 2, ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6957 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6958 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
15115
f8ef87f6f07f
8005544: Use 256bit YMM registers in arraycopy stubs on x86
kvn
parents:
15114
diff
changeset
|
6959 |
emit_int8(0x58); |
f8ef87f6f07f
8005544: Use 256bit YMM registers in arraycopy stubs on x86
kvn
parents:
15114
diff
changeset
|
6960 |
emit_int8((unsigned char)(0xC0 | encode)); |
f8ef87f6f07f
8005544: Use 256bit YMM registers in arraycopy stubs on x86
kvn
parents:
15114
diff
changeset
|
6961 |
} |
f8ef87f6f07f
8005544: Use 256bit YMM registers in arraycopy stubs on x86
kvn
parents:
15114
diff
changeset
|
6962 |
|
51857 | 6963 |
void Assembler::vpbroadcastd(XMMRegister dst, Address src, int vector_len) { |
6964 |
assert(VM_Version::supports_avx2(), ""); |
|
31410 | 6965 |
assert(dst != xnoreg, "sanity"); |
34162 | 6966 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6967 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 6968 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
31410 | 6969 |
// swap src<->dst for encoding |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6970 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
31410 | 6971 |
emit_int8(0x58); |
6972 |
emit_operand(dst, src); |
|
6973 |
} |
|
6974 |
||
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6975 |
// duplicate 8-byte integer data from src into programmed locations in dest : requires AVX512VL |
51857 | 6976 |
void Assembler::vpbroadcastq(XMMRegister dst, XMMRegister src, int vector_len) { |
6977 |
assert(VM_Version::supports_avx2(), ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6978 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 6979 |
attributes.set_rex_vex_w_reverted(); |
34162 | 6980 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
31410 | 6981 |
emit_int8(0x59); |
6982 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
6983 |
} |
|
6984 |
||
51857 | 6985 |
void Assembler::vpbroadcastq(XMMRegister dst, Address src, int vector_len) { |
6986 |
assert(VM_Version::supports_avx2(), ""); |
|
31410 | 6987 |
assert(dst != xnoreg, "sanity"); |
34162 | 6988 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
6989 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 6990 |
attributes.set_rex_vex_w_reverted(); |
34162 | 6991 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
31410 | 6992 |
// swap src<->dst for encoding |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
6993 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
31410 | 6994 |
emit_int8(0x59); |
6995 |
emit_operand(dst, src); |
|
6996 |
} |
|
50699
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
6997 |
void Assembler::evbroadcasti64x2(XMMRegister dst, XMMRegister src, int vector_len) { |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
6998 |
assert(vector_len != Assembler::AVX_128bit, ""); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
6999 |
assert(VM_Version::supports_avx512dq(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
7000 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
50699
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
7001 |
attributes.set_rex_vex_w_reverted(); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
7002 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
7003 |
emit_int8(0x5A); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
7004 |
emit_int8((unsigned char)(0xC0 | encode)); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
7005 |
} |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
7006 |
|
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
7007 |
void Assembler::evbroadcasti64x2(XMMRegister dst, Address src, int vector_len) { |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
7008 |
assert(vector_len != Assembler::AVX_128bit, ""); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
7009 |
assert(VM_Version::supports_avx512dq(), ""); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
7010 |
assert(dst != xnoreg, "sanity"); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
7011 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
7012 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
50699
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
7013 |
attributes.set_rex_vex_w_reverted(); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
7014 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T2, /* input_size_in_bits */ EVEX_64bit); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
7015 |
// swap src<->dst for encoding |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
7016 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
7017 |
emit_int8(0x5A); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
7018 |
emit_operand(dst, src); |
cc7fc46cc8c1
8205398: AES-CBC decryption algorithm using AVX512 instructions
kvn
parents:
50577
diff
changeset
|
7019 |
} |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
7020 |
|
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
7021 |
// scalar single/double precision replicate |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
7022 |
|
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
7023 |
// duplicate single precision data from src into programmed locations in dest : requires AVX512VL |
51857 | 7024 |
void Assembler::vpbroadcastss(XMMRegister dst, XMMRegister src, int vector_len) { |
7025 |
assert(VM_Version::supports_avx(), ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
7026 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 7027 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
31410 | 7028 |
emit_int8(0x18); |
7029 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
7030 |
} |
|
7031 |
||
51857 | 7032 |
void Assembler::vpbroadcastss(XMMRegister dst, Address src, int vector_len) { |
7033 |
assert(VM_Version::supports_avx(), ""); |
|
31410 | 7034 |
assert(dst != xnoreg, "sanity"); |
34162 | 7035 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
7036 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 7037 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
31410 | 7038 |
// swap src<->dst for encoding |
34162 | 7039 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
31410 | 7040 |
emit_int8(0x18); |
7041 |
emit_operand(dst, src); |
|
7042 |
} |
|
7043 |
||
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
7044 |
// duplicate double precision data from src into programmed locations in dest : requires AVX512VL |
51857 | 7045 |
void Assembler::vpbroadcastsd(XMMRegister dst, XMMRegister src, int vector_len) { |
7046 |
assert(VM_Version::supports_avx(), ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
7047 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 7048 |
attributes.set_rex_vex_w_reverted(); |
34162 | 7049 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
31410 | 7050 |
emit_int8(0x19); |
7051 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
7052 |
} |
|
7053 |
||
51857 | 7054 |
void Assembler::vpbroadcastsd(XMMRegister dst, Address src, int vector_len) { |
7055 |
assert(VM_Version::supports_avx(), ""); |
|
31410 | 7056 |
assert(dst != xnoreg, "sanity"); |
34162 | 7057 |
InstructionMark im(this); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
7058 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 7059 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
38049 | 7060 |
attributes.set_rex_vex_w_reverted(); |
31410 | 7061 |
// swap src<->dst for encoding |
34162 | 7062 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
31410 | 7063 |
emit_int8(0x19); |
7064 |
emit_operand(dst, src); |
|
7065 |
} |
|
7066 |
||
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
7067 |
|
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
7068 |
// gpr source broadcast forms |
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
7069 |
|
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
7070 |
// duplicate 1-byte integer data from src into programmed locations in dest : requires AVX512BW and AVX512VL |
31410 | 7071 |
void Assembler::evpbroadcastb(XMMRegister dst, Register src, int vector_len) { |
51857 | 7072 |
assert(VM_Version::supports_avx512bw(), ""); |
36066 | 7073 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 7074 |
attributes.set_is_evex_instruction(); |
34162 | 7075 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
38049 | 7076 |
emit_int8(0x7A); |
31410 | 7077 |
emit_int8((unsigned char)(0xC0 | encode)); |
7078 |
} |
|
7079 |
||
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
7080 |
// duplicate 2-byte integer data from src into programmed locations in dest : requires AVX512BW and AVX512VL |
31410 | 7081 |
void Assembler::evpbroadcastw(XMMRegister dst, Register src, int vector_len) { |
51857 | 7082 |
assert(VM_Version::supports_avx512bw(), ""); |
36066 | 7083 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 7084 |
attributes.set_is_evex_instruction(); |
34162 | 7085 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
38049 | 7086 |
emit_int8(0x7B); |
31410 | 7087 |
emit_int8((unsigned char)(0xC0 | encode)); |
7088 |
} |
|
7089 |
||
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
7090 |
// duplicate 4-byte integer data from src into programmed locations in dest : requires AVX512VL |
31410 | 7091 |
void Assembler::evpbroadcastd(XMMRegister dst, Register src, int vector_len) { |
7092 |
assert(VM_Version::supports_evex(), ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
7093 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 7094 |
attributes.set_is_evex_instruction(); |
34162 | 7095 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
38049 | 7096 |
emit_int8(0x7C); |
31410 | 7097 |
emit_int8((unsigned char)(0xC0 | encode)); |
7098 |
} |
|
7099 |
||
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
7100 |
// duplicate 8-byte integer data from src into programmed locations in dest : requires AVX512VL |
31410 | 7101 |
void Assembler::evpbroadcastq(XMMRegister dst, Register src, int vector_len) { |
7102 |
assert(VM_Version::supports_evex(), ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
7103 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 7104 |
attributes.set_is_evex_instruction(); |
34162 | 7105 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
38049 | 7106 |
emit_int8(0x7C); |
31410 | 7107 |
emit_int8((unsigned char)(0xC0 | encode)); |
7108 |
} |
|
7109 |
||
50860
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7110 |
void Assembler::evpgatherdd(XMMRegister dst, KRegister mask, Address src, int vector_len) { |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7111 |
assert(VM_Version::supports_evex(), ""); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7112 |
assert(dst != xnoreg, "sanity"); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7113 |
InstructionMark im(this); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7114 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7115 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7116 |
attributes.reset_is_clear_context(); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7117 |
attributes.set_embedded_opmask_register_specifier(mask); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7118 |
attributes.set_is_evex_instruction(); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7119 |
// swap src<->dst for encoding |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7120 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7121 |
emit_int8((unsigned char)0x90); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7122 |
emit_operand(dst, src); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7123 |
} |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
7124 |
|
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
7125 |
// Carry-Less Multiplication Quadword |
25932
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
24424
diff
changeset
|
7126 |
void Assembler::pclmulqdq(XMMRegister dst, XMMRegister src, int mask) { |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
24424
diff
changeset
|
7127 |
assert(VM_Version::supports_clmul(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
7128 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 7129 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
25932
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
24424
diff
changeset
|
7130 |
emit_int8(0x44); |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
24424
diff
changeset
|
7131 |
emit_int8((unsigned char)(0xC0 | encode)); |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
24424
diff
changeset
|
7132 |
emit_int8((unsigned char)mask); |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
24424
diff
changeset
|
7133 |
} |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
24424
diff
changeset
|
7134 |
|
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
24424
diff
changeset
|
7135 |
// Carry-Less Multiplication Quadword |
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
7136 |
void Assembler::vpclmulqdq(XMMRegister dst, XMMRegister nds, XMMRegister src, int mask) { |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
7137 |
assert(VM_Version::supports_avx() && VM_Version::supports_clmul(), ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
7138 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
7139 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
7140 |
emit_int8(0x44); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
7141 |
emit_int8((unsigned char)(0xC0 | encode)); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
7142 |
emit_int8((unsigned char)mask); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
7143 |
} |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
7144 |
|
49614
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
7145 |
void Assembler::evpclmulqdq(XMMRegister dst, XMMRegister nds, XMMRegister src, int mask, int vector_len) { |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
7146 |
assert(VM_Version::supports_vpclmulqdq(), "Requires vector carryless multiplication support"); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
7147 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
7148 |
attributes.set_is_evex_instruction(); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
7149 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
7150 |
emit_int8(0x44); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
7151 |
emit_int8((unsigned char)(0xC0 | encode)); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
7152 |
emit_int8((unsigned char)mask); |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
7153 |
} |
3b1570be8557
8200067: Add support for vpclmulqdq for crc32
srukmannagar
parents:
49455
diff
changeset
|
7154 |
|
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
7155 |
void Assembler::vzeroupper() { |
46440
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
7156 |
if (VM_Version::supports_vzeroupper()) { |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
7157 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
46440
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
7158 |
(void)vex_prefix_and_encode(0, 0, 0, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
7159 |
emit_int8(0x77); |
61025eecb743
8178811: Minimize the AVX <-> SSE transition penalty through generation of vzeroupper instruction on x86
vdeshpande
parents:
44518
diff
changeset
|
7160 |
} |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
7161 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
7162 |
|
1066 | 7163 |
#ifndef _LP64 |
7164 |
// 32bit only pieces of the assembler |
|
7165 |
||
7166 |
void Assembler::cmp_literal32(Register src1, int32_t imm32, RelocationHolder const& rspec) { |
|
7167 |
// NO PREFIX AS NEVER 64BIT |
|
7168 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7169 |
emit_int8((unsigned char)0x81); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7170 |
emit_int8((unsigned char)(0xF8 | src1->encoding())); |
1066 | 7171 |
emit_data(imm32, rspec, 0); |
7172 |
} |
|
7173 |
||
7174 |
void Assembler::cmp_literal32(Address src1, int32_t imm32, RelocationHolder const& rspec) { |
|
7175 |
// NO PREFIX AS NEVER 64BIT (not even 32bit versions of 64bit regs |
|
7176 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7177 |
emit_int8((unsigned char)0x81); |
1066 | 7178 |
emit_operand(rdi, src1); |
7179 |
emit_data(imm32, rspec, 0); |
|
7180 |
} |
|
7181 |
||
7182 |
// The 64-bit (32bit platform) cmpxchg compares the value at adr with the contents of rdx:rax, |
|
7183 |
// and stores rcx:rbx into adr if so; otherwise, the value at adr is loaded |
|
7184 |
// into rdx:rax. The ZF is set if the compared values were equal, and cleared otherwise. |
|
7185 |
void Assembler::cmpxchg8(Address adr) { |
|
7186 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7187 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7188 |
emit_int8((unsigned char)0xC7); |
1066 | 7189 |
emit_operand(rcx, adr); |
7190 |
} |
|
7191 |
||
7192 |
void Assembler::decl(Register dst) { |
|
7193 |
// Don't use it directly. Use MacroAssembler::decrementl() instead. |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7194 |
emit_int8(0x48 | dst->encoding()); |
1066 | 7195 |
} |
7196 |
||
7197 |
#endif // _LP64 |
|
7198 |
||
7199 |
// 64bit typically doesn't use the x87 but needs to for the trig funcs |
|
7200 |
||
7201 |
void Assembler::fabs() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7202 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7203 |
emit_int8((unsigned char)0xE1); |
1066 | 7204 |
} |
7205 |
||
7206 |
void Assembler::fadd(int i) { |
|
7207 |
emit_farith(0xD8, 0xC0, i); |
|
7208 |
} |
|
7209 |
||
7210 |
void Assembler::fadd_d(Address src) { |
|
7211 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7212 |
emit_int8((unsigned char)0xDC); |
1066 | 7213 |
emit_operand32(rax, src); |
7214 |
} |
|
7215 |
||
7216 |
void Assembler::fadd_s(Address src) { |
|
7217 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7218 |
emit_int8((unsigned char)0xD8); |
1066 | 7219 |
emit_operand32(rax, src); |
7220 |
} |
|
7221 |
||
7222 |
void Assembler::fadda(int i) { |
|
7223 |
emit_farith(0xDC, 0xC0, i); |
|
7224 |
} |
|
7225 |
||
7226 |
void Assembler::faddp(int i) { |
|
7227 |
emit_farith(0xDE, 0xC0, i); |
|
7228 |
} |
|
7229 |
||
7230 |
void Assembler::fchs() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7231 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7232 |
emit_int8((unsigned char)0xE0); |
1066 | 7233 |
} |
7234 |
||
7235 |
void Assembler::fcom(int i) { |
|
7236 |
emit_farith(0xD8, 0xD0, i); |
|
7237 |
} |
|
7238 |
||
7239 |
void Assembler::fcomp(int i) { |
|
7240 |
emit_farith(0xD8, 0xD8, i); |
|
7241 |
} |
|
7242 |
||
7243 |
void Assembler::fcomp_d(Address src) { |
|
7244 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7245 |
emit_int8((unsigned char)0xDC); |
1066 | 7246 |
emit_operand32(rbx, src); |
7247 |
} |
|
7248 |
||
7249 |
void Assembler::fcomp_s(Address src) { |
|
7250 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7251 |
emit_int8((unsigned char)0xD8); |
1066 | 7252 |
emit_operand32(rbx, src); |
7253 |
} |
|
7254 |
||
7255 |
void Assembler::fcompp() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7256 |
emit_int8((unsigned char)0xDE); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7257 |
emit_int8((unsigned char)0xD9); |
1066 | 7258 |
} |
7259 |
||
7260 |
void Assembler::fcos() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7261 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7262 |
emit_int8((unsigned char)0xFF); |
1066 | 7263 |
} |
7264 |
||
7265 |
void Assembler::fdecstp() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7266 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7267 |
emit_int8((unsigned char)0xF6); |
1066 | 7268 |
} |
7269 |
||
7270 |
void Assembler::fdiv(int i) { |
|
7271 |
emit_farith(0xD8, 0xF0, i); |
|
7272 |
} |
|
7273 |
||
7274 |
void Assembler::fdiv_d(Address src) { |
|
7275 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7276 |
emit_int8((unsigned char)0xDC); |
1066 | 7277 |
emit_operand32(rsi, src); |
7278 |
} |
|
7279 |
||
7280 |
void Assembler::fdiv_s(Address src) { |
|
7281 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7282 |
emit_int8((unsigned char)0xD8); |
1066 | 7283 |
emit_operand32(rsi, src); |
7284 |
} |
|
7285 |
||
7286 |
void Assembler::fdiva(int i) { |
|
7287 |
emit_farith(0xDC, 0xF8, i); |
|
7288 |
} |
|
7289 |
||
7290 |
// Note: The Intel manual (Pentium Processor User's Manual, Vol.3, 1994) |
|
7291 |
// is erroneous for some of the floating-point instructions below. |
|
7292 |
||
7293 |
void Assembler::fdivp(int i) { |
|
7294 |
emit_farith(0xDE, 0xF8, i); // ST(0) <- ST(0) / ST(1) and pop (Intel manual wrong) |
|
7295 |
} |
|
7296 |
||
7297 |
void Assembler::fdivr(int i) { |
|
7298 |
emit_farith(0xD8, 0xF8, i); |
|
7299 |
} |
|
7300 |
||
7301 |
void Assembler::fdivr_d(Address src) { |
|
7302 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7303 |
emit_int8((unsigned char)0xDC); |
1066 | 7304 |
emit_operand32(rdi, src); |
7305 |
} |
|
7306 |
||
7307 |
void Assembler::fdivr_s(Address src) { |
|
7308 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7309 |
emit_int8((unsigned char)0xD8); |
1066 | 7310 |
emit_operand32(rdi, src); |
7311 |
} |
|
7312 |
||
7313 |
void Assembler::fdivra(int i) { |
|
7314 |
emit_farith(0xDC, 0xF0, i); |
|
7315 |
} |
|
7316 |
||
7317 |
void Assembler::fdivrp(int i) { |
|
7318 |
emit_farith(0xDE, 0xF0, i); // ST(0) <- ST(1) / ST(0) and pop (Intel manual wrong) |
|
7319 |
} |
|
7320 |
||
7321 |
void Assembler::ffree(int i) { |
|
7322 |
emit_farith(0xDD, 0xC0, i); |
|
7323 |
} |
|
7324 |
||
7325 |
void Assembler::fild_d(Address adr) { |
|
7326 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7327 |
emit_int8((unsigned char)0xDF); |
1066 | 7328 |
emit_operand32(rbp, adr); |
7329 |
} |
|
7330 |
||
7331 |
void Assembler::fild_s(Address adr) { |
|
7332 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7333 |
emit_int8((unsigned char)0xDB); |
1066 | 7334 |
emit_operand32(rax, adr); |
7335 |
} |
|
7336 |
||
7337 |
void Assembler::fincstp() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7338 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7339 |
emit_int8((unsigned char)0xF7); |
1066 | 7340 |
} |
7341 |
||
7342 |
void Assembler::finit() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7343 |
emit_int8((unsigned char)0x9B); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7344 |
emit_int8((unsigned char)0xDB); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7345 |
emit_int8((unsigned char)0xE3); |
1066 | 7346 |
} |
7347 |
||
7348 |
void Assembler::fist_s(Address adr) { |
|
7349 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7350 |
emit_int8((unsigned char)0xDB); |
1066 | 7351 |
emit_operand32(rdx, adr); |
7352 |
} |
|
7353 |
||
7354 |
void Assembler::fistp_d(Address adr) { |
|
7355 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7356 |
emit_int8((unsigned char)0xDF); |
1066 | 7357 |
emit_operand32(rdi, adr); |
7358 |
} |
|
7359 |
||
7360 |
void Assembler::fistp_s(Address adr) { |
|
7361 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7362 |
emit_int8((unsigned char)0xDB); |
1066 | 7363 |
emit_operand32(rbx, adr); |
7364 |
} |
|
1 | 7365 |
|
7366 |
void Assembler::fld1() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7367 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7368 |
emit_int8((unsigned char)0xE8); |
1 | 7369 |
} |
7370 |
||
1066 | 7371 |
void Assembler::fld_d(Address adr) { |
7372 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7373 |
emit_int8((unsigned char)0xDD); |
1066 | 7374 |
emit_operand32(rax, adr); |
7375 |
} |
|
1 | 7376 |
|
7377 |
void Assembler::fld_s(Address adr) { |
|
7378 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7379 |
emit_int8((unsigned char)0xD9); |
1066 | 7380 |
emit_operand32(rax, adr); |
7381 |
} |
|
7382 |
||
7383 |
||
7384 |
void Assembler::fld_s(int index) { |
|
1 | 7385 |
emit_farith(0xD9, 0xC0, index); |
7386 |
} |
|
7387 |
||
7388 |
void Assembler::fld_x(Address adr) { |
|
7389 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7390 |
emit_int8((unsigned char)0xDB); |
1066 | 7391 |
emit_operand32(rbp, adr); |
7392 |
} |
|
7393 |
||
7394 |
void Assembler::fldcw(Address src) { |
|
7395 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7396 |
emit_int8((unsigned char)0xD9); |
1066 | 7397 |
emit_operand32(rbp, src); |
7398 |
} |
|
7399 |
||
7400 |
void Assembler::fldenv(Address src) { |
|
1 | 7401 |
InstructionMark im(this); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7402 |
emit_int8((unsigned char)0xD9); |
1066 | 7403 |
emit_operand32(rsp, src); |
7404 |
} |
|
7405 |
||
7406 |
void Assembler::fldlg2() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7407 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7408 |
emit_int8((unsigned char)0xEC); |
1066 | 7409 |
} |
1 | 7410 |
|
7411 |
void Assembler::fldln2() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7412 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7413 |
emit_int8((unsigned char)0xED); |
1 | 7414 |
} |
7415 |
||
1066 | 7416 |
void Assembler::fldz() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7417 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7418 |
emit_int8((unsigned char)0xEE); |
1066 | 7419 |
} |
1 | 7420 |
|
7421 |
void Assembler::flog() { |
|
7422 |
fldln2(); |
|
7423 |
fxch(); |
|
7424 |
fyl2x(); |
|
7425 |
} |
|
7426 |
||
7427 |
void Assembler::flog10() { |
|
7428 |
fldlg2(); |
|
7429 |
fxch(); |
|
7430 |
fyl2x(); |
|
7431 |
} |
|
7432 |
||
1066 | 7433 |
void Assembler::fmul(int i) { |
7434 |
emit_farith(0xD8, 0xC8, i); |
|
7435 |
} |
|
7436 |
||
7437 |
void Assembler::fmul_d(Address src) { |
|
7438 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7439 |
emit_int8((unsigned char)0xDC); |
1066 | 7440 |
emit_operand32(rcx, src); |
7441 |
} |
|
7442 |
||
7443 |
void Assembler::fmul_s(Address src) { |
|
7444 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7445 |
emit_int8((unsigned char)0xD8); |
1066 | 7446 |
emit_operand32(rcx, src); |
7447 |
} |
|
7448 |
||
7449 |
void Assembler::fmula(int i) { |
|
7450 |
emit_farith(0xDC, 0xC8, i); |
|
7451 |
} |
|
7452 |
||
7453 |
void Assembler::fmulp(int i) { |
|
7454 |
emit_farith(0xDE, 0xC8, i); |
|
7455 |
} |
|
7456 |
||
7457 |
void Assembler::fnsave(Address dst) { |
|
7458 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7459 |
emit_int8((unsigned char)0xDD); |
1066 | 7460 |
emit_operand32(rsi, dst); |
7461 |
} |
|
7462 |
||
7463 |
void Assembler::fnstcw(Address src) { |
|
7464 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7465 |
emit_int8((unsigned char)0x9B); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7466 |
emit_int8((unsigned char)0xD9); |
1066 | 7467 |
emit_operand32(rdi, src); |
7468 |
} |
|
7469 |
||
7470 |
void Assembler::fnstsw_ax() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7471 |
emit_int8((unsigned char)0xDF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7472 |
emit_int8((unsigned char)0xE0); |
1066 | 7473 |
} |
7474 |
||
7475 |
void Assembler::fprem() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7476 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7477 |
emit_int8((unsigned char)0xF8); |
1066 | 7478 |
} |
7479 |
||
7480 |
void Assembler::fprem1() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7481 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7482 |
emit_int8((unsigned char)0xF5); |
1066 | 7483 |
} |
7484 |
||
7485 |
void Assembler::frstor(Address src) { |
|
7486 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7487 |
emit_int8((unsigned char)0xDD); |
1066 | 7488 |
emit_operand32(rsp, src); |
7489 |
} |
|
1 | 7490 |
|
7491 |
void Assembler::fsin() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7492 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7493 |
emit_int8((unsigned char)0xFE); |
1 | 7494 |
} |
7495 |
||
1066 | 7496 |
void Assembler::fsqrt() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7497 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7498 |
emit_int8((unsigned char)0xFA); |
1066 | 7499 |
} |
7500 |
||
7501 |
void Assembler::fst_d(Address adr) { |
|
7502 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7503 |
emit_int8((unsigned char)0xDD); |
1066 | 7504 |
emit_operand32(rdx, adr); |
7505 |
} |
|
7506 |
||
7507 |
void Assembler::fst_s(Address adr) { |
|
7508 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7509 |
emit_int8((unsigned char)0xD9); |
1066 | 7510 |
emit_operand32(rdx, adr); |
7511 |
} |
|
7512 |
||
7513 |
void Assembler::fstp_d(Address adr) { |
|
7514 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7515 |
emit_int8((unsigned char)0xDD); |
1066 | 7516 |
emit_operand32(rbx, adr); |
7517 |
} |
|
7518 |
||
7519 |
void Assembler::fstp_d(int index) { |
|
7520 |
emit_farith(0xDD, 0xD8, index); |
|
7521 |
} |
|
7522 |
||
7523 |
void Assembler::fstp_s(Address adr) { |
|
7524 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7525 |
emit_int8((unsigned char)0xD9); |
1066 | 7526 |
emit_operand32(rbx, adr); |
7527 |
} |
|
7528 |
||
7529 |
void Assembler::fstp_x(Address adr) { |
|
7530 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7531 |
emit_int8((unsigned char)0xDB); |
1066 | 7532 |
emit_operand32(rdi, adr); |
7533 |
} |
|
7534 |
||
7535 |
void Assembler::fsub(int i) { |
|
7536 |
emit_farith(0xD8, 0xE0, i); |
|
7537 |
} |
|
7538 |
||
7539 |
void Assembler::fsub_d(Address src) { |
|
7540 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7541 |
emit_int8((unsigned char)0xDC); |
1066 | 7542 |
emit_operand32(rsp, src); |
7543 |
} |
|
7544 |
||
7545 |
void Assembler::fsub_s(Address src) { |
|
7546 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7547 |
emit_int8((unsigned char)0xD8); |
1066 | 7548 |
emit_operand32(rsp, src); |
7549 |
} |
|
7550 |
||
7551 |
void Assembler::fsuba(int i) { |
|
7552 |
emit_farith(0xDC, 0xE8, i); |
|
7553 |
} |
|
7554 |
||
7555 |
void Assembler::fsubp(int i) { |
|
7556 |
emit_farith(0xDE, 0xE8, i); // ST(0) <- ST(0) - ST(1) and pop (Intel manual wrong) |
|
7557 |
} |
|
7558 |
||
7559 |
void Assembler::fsubr(int i) { |
|
7560 |
emit_farith(0xD8, 0xE8, i); |
|
7561 |
} |
|
7562 |
||
7563 |
void Assembler::fsubr_d(Address src) { |
|
7564 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7565 |
emit_int8((unsigned char)0xDC); |
1066 | 7566 |
emit_operand32(rbp, src); |
7567 |
} |
|
7568 |
||
7569 |
void Assembler::fsubr_s(Address src) { |
|
7570 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7571 |
emit_int8((unsigned char)0xD8); |
1066 | 7572 |
emit_operand32(rbp, src); |
7573 |
} |
|
7574 |
||
7575 |
void Assembler::fsubra(int i) { |
|
7576 |
emit_farith(0xDC, 0xE0, i); |
|
7577 |
} |
|
7578 |
||
7579 |
void Assembler::fsubrp(int i) { |
|
7580 |
emit_farith(0xDE, 0xE0, i); // ST(0) <- ST(1) - ST(0) and pop (Intel manual wrong) |
|
1 | 7581 |
} |
7582 |
||
7583 |
void Assembler::ftan() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7584 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7585 |
emit_int8((unsigned char)0xF2); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7586 |
emit_int8((unsigned char)0xDD); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7587 |
emit_int8((unsigned char)0xD8); |
1 | 7588 |
} |
7589 |
||
1066 | 7590 |
void Assembler::ftst() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7591 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7592 |
emit_int8((unsigned char)0xE4); |
1066 | 7593 |
} |
1 | 7594 |
|
7595 |
void Assembler::fucomi(int i) { |
|
7596 |
// make sure the instruction is supported (introduced for P6, together with cmov) |
|
7597 |
guarantee(VM_Version::supports_cmov(), "illegal instruction"); |
|
7598 |
emit_farith(0xDB, 0xE8, i); |
|
7599 |
} |
|
7600 |
||
7601 |
void Assembler::fucomip(int i) { |
|
7602 |
// make sure the instruction is supported (introduced for P6, together with cmov) |
|
7603 |
guarantee(VM_Version::supports_cmov(), "illegal instruction"); |
|
7604 |
emit_farith(0xDF, 0xE8, i); |
|
7605 |
} |
|
7606 |
||
7607 |
void Assembler::fwait() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7608 |
emit_int8((unsigned char)0x9B); |
1 | 7609 |
} |
7610 |
||
1066 | 7611 |
void Assembler::fxch(int i) { |
7612 |
emit_farith(0xD9, 0xC8, i); |
|
7613 |
} |
|
7614 |
||
7615 |
void Assembler::fyl2x() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7616 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7617 |
emit_int8((unsigned char)0xF1); |
1066 | 7618 |
} |
7619 |
||
12739
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
7620 |
void Assembler::frndint() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7621 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7622 |
emit_int8((unsigned char)0xFC); |
12739
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
7623 |
} |
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
7624 |
|
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
7625 |
void Assembler::f2xm1() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7626 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7627 |
emit_int8((unsigned char)0xF0); |
12739
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
7628 |
} |
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
7629 |
|
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
7630 |
void Assembler::fldl2e() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7631 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7632 |
emit_int8((unsigned char)0xEA); |
12739
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
7633 |
} |
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
7634 |
|
11427 | 7635 |
// SSE SIMD prefix byte values corresponding to VexSimdPrefix encoding. |
7636 |
static int simd_pre[4] = { 0, 0x66, 0xF3, 0xF2 }; |
|
7637 |
// SSE opcode second byte values (first is 0x0F) corresponding to VexOpcode encoding. |
|
7638 |
static int simd_opc[4] = { 0, 0, 0x38, 0x3A }; |
|
7639 |
||
7640 |
// Generate SSE legacy REX prefix and SIMD opcode based on VEX encoding. |
|
7641 |
void Assembler::rex_prefix(Address adr, XMMRegister xreg, VexSimdPrefix pre, VexOpcode opc, bool rex_w) { |
|
7642 |
if (pre > 0) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7643 |
emit_int8(simd_pre[pre]); |
11427 | 7644 |
} |
7645 |
if (rex_w) { |
|
7646 |
prefixq(adr, xreg); |
|
7647 |
} else { |
|
7648 |
prefix(adr, xreg); |
|
7649 |
} |
|
7650 |
if (opc > 0) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7651 |
emit_int8(0x0F); |
11427 | 7652 |
int opc2 = simd_opc[opc]; |
7653 |
if (opc2 > 0) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7654 |
emit_int8(opc2); |
11427 | 7655 |
} |
7656 |
} |
|
7657 |
} |
|
7658 |
||
7659 |
int Assembler::rex_prefix_and_encode(int dst_enc, int src_enc, VexSimdPrefix pre, VexOpcode opc, bool rex_w) { |
|
7660 |
if (pre > 0) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7661 |
emit_int8(simd_pre[pre]); |
11427 | 7662 |
} |
34162 | 7663 |
int encode = (rex_w) ? prefixq_and_encode(dst_enc, src_enc) : prefix_and_encode(dst_enc, src_enc); |
11427 | 7664 |
if (opc > 0) { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7665 |
emit_int8(0x0F); |
11427 | 7666 |
int opc2 = simd_opc[opc]; |
7667 |
if (opc2 > 0) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7668 |
emit_int8(opc2); |
11427 | 7669 |
} |
7670 |
} |
|
7671 |
return encode; |
|
7672 |
} |
|
7673 |
||
7674 |
||
34162 | 7675 |
void Assembler::vex_prefix(bool vex_r, bool vex_b, bool vex_x, int nds_enc, VexSimdPrefix pre, VexOpcode opc) { |
7676 |
int vector_len = _attributes->get_vector_len(); |
|
7677 |
bool vex_w = _attributes->is_rex_vex_w(); |
|
11427 | 7678 |
if (vex_b || vex_x || vex_w || (opc == VEX_OPCODE_0F_38) || (opc == VEX_OPCODE_0F_3A)) { |
7679 |
prefix(VEX_3bytes); |
|
7680 |
||
7681 |
int byte1 = (vex_r ? VEX_R : 0) | (vex_x ? VEX_X : 0) | (vex_b ? VEX_B : 0); |
|
7682 |
byte1 = (~byte1) & 0xE0; |
|
7683 |
byte1 |= opc; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7684 |
emit_int8(byte1); |
11427 | 7685 |
|
7686 |
int byte2 = ((~nds_enc) & 0xf) << 3; |
|
30624 | 7687 |
byte2 |= (vex_w ? VEX_W : 0) | ((vector_len > 0) ? 4 : 0) | pre; |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7688 |
emit_int8(byte2); |
11427 | 7689 |
} else { |
7690 |
prefix(VEX_2bytes); |
|
7691 |
||
7692 |
int byte1 = vex_r ? VEX_R : 0; |
|
7693 |
byte1 = (~byte1) & 0x80; |
|
7694 |
byte1 |= ((~nds_enc) & 0xf) << 3; |
|
30624 | 7695 |
byte1 |= ((vector_len > 0 ) ? 4 : 0) | pre; |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7696 |
emit_int8(byte1); |
11427 | 7697 |
} |
7698 |
} |
|
7699 |
||
30624 | 7700 |
// This is a 4 byte encoding |
34162 | 7701 |
void Assembler::evex_prefix(bool vex_r, bool vex_b, bool vex_x, bool evex_r, bool evex_v, int nds_enc, VexSimdPrefix pre, VexOpcode opc){ |
30624 | 7702 |
// EVEX 0x62 prefix |
7703 |
prefix(EVEX_4bytes); |
|
34162 | 7704 |
bool vex_w = _attributes->is_rex_vex_w(); |
7705 |
int evex_encoding = (vex_w ? VEX_W : 0); |
|
7706 |
// EVEX.b is not currently used for broadcast of single element or data rounding modes |
|
7707 |
_attributes->set_evex_encoding(evex_encoding); |
|
30624 | 7708 |
|
7709 |
// P0: byte 2, initialized to RXBR`00mm |
|
7710 |
// instead of not'd |
|
7711 |
int byte2 = (vex_r ? VEX_R : 0) | (vex_x ? VEX_X : 0) | (vex_b ? VEX_B : 0) | (evex_r ? EVEX_Rb : 0); |
|
7712 |
byte2 = (~byte2) & 0xF0; |
|
7713 |
// confine opc opcode extensions in mm bits to lower two bits |
|
7714 |
// of form {0F, 0F_38, 0F_3A} |
|
7715 |
byte2 |= opc; |
|
7716 |
emit_int8(byte2); |
|
7717 |
||
7718 |
// P1: byte 3 as Wvvvv1pp |
|
7719 |
int byte3 = ((~nds_enc) & 0xf) << 3; |
|
7720 |
// p[10] is always 1 |
|
7721 |
byte3 |= EVEX_F; |
|
7722 |
byte3 |= (vex_w & 1) << 7; |
|
7723 |
// confine pre opcode extensions in pp bits to lower two bits |
|
7724 |
// of form {66, F3, F2} |
|
7725 |
byte3 |= pre; |
|
7726 |
emit_int8(byte3); |
|
7727 |
||
7728 |
// P2: byte 4 as zL'Lbv'aaa |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
7729 |
// kregs are implemented in the low 3 bits as aaa |
38239
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
7730 |
int byte4 = (_attributes->is_no_reg_mask()) ? |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
7731 |
0 : |
4d8b8ba74fea
8154974: AVX-512 equipped inflate, has_negatives & compress intrinsics
kvn
parents:
38138
diff
changeset
|
7732 |
_attributes->get_embedded_opmask_register_specifier(); |
30624 | 7733 |
// EVEX.v` for extending EVEX.vvvv or VIDX |
7734 |
byte4 |= (evex_v ? 0: EVEX_V); |
|
7735 |
// third EXEC.b for broadcast actions |
|
34162 | 7736 |
byte4 |= (_attributes->is_extended_context() ? EVEX_Rb : 0); |
30624 | 7737 |
// fourth EVEX.L'L for vector length : 0 is 128, 1 is 256, 2 is 512, currently we do not support 1024 |
34162 | 7738 |
byte4 |= ((_attributes->get_vector_len())& 0x3) << 5; |
30624 | 7739 |
// last is EVEX.z for zero/merge actions |
42014
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
7740 |
if (_attributes->is_no_reg_mask() == false) { |
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
7741 |
byte4 |= (_attributes->is_clear_context() ? EVEX_Z : 0); |
cc32438a1003
8167987: change merge context to clear for mask register usage model
mcberg
parents:
41323
diff
changeset
|
7742 |
} |
30624 | 7743 |
emit_int8(byte4); |
7744 |
} |
|
7745 |
||
34162 | 7746 |
void Assembler::vex_prefix(Address adr, int nds_enc, int xreg_enc, VexSimdPrefix pre, VexOpcode opc, InstructionAttr *attributes) { |
31410 | 7747 |
bool vex_r = ((xreg_enc & 8) == 8) ? 1 : 0; |
11427 | 7748 |
bool vex_b = adr.base_needs_rex(); |
50860
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7749 |
bool vex_x; |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7750 |
if (adr.isxmmindex()) { |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7751 |
vex_x = adr.xmmindex_needs_rex(); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7752 |
} else { |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7753 |
vex_x = adr.index_needs_rex(); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7754 |
} |
34162 | 7755 |
set_attributes(attributes); |
7756 |
attributes->set_current_assembler(this); |
|
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
7757 |
|
51857 | 7758 |
// For EVEX instruction (which is not marked as pure EVEX instruction) check and see if this instruction |
7759 |
// is allowed in legacy mode and has resources which will fit in it. |
|
7760 |
// Pure EVEX instructions will have is_evex_instruction set in their definition. |
|
7761 |
if (!attributes->is_legacy_mode()) { |
|
7762 |
if (UseAVX > 2 && !attributes->is_evex_instruction() && !_is_managed) { |
|
7763 |
if ((attributes->get_vector_len() != AVX_512bit) && (nds_enc < 16) && (xreg_enc < 16)) { |
|
7764 |
attributes->set_is_legacy_mode(); |
|
7765 |
} |
|
30624 | 7766 |
} |
7767 |
} |
|
7768 |
||
51857 | 7769 |
if (UseAVX > 2) { |
7770 |
assert(((!attributes->uses_vl()) || |
|
7771 |
(attributes->get_vector_len() == AVX_512bit) || |
|
7772 |
(!_legacy_mode_vl) || |
|
7773 |
(attributes->is_legacy_mode())),"XMM register should be 0-15"); |
|
7774 |
assert(((nds_enc < 16 && xreg_enc < 16) || (!attributes->is_legacy_mode())),"XMM register should be 0-15"); |
|
36837 | 7775 |
} |
7776 |
||
7777 |
_is_managed = false; |
|
7778 |
if (UseAVX > 2 && !attributes->is_legacy_mode()) |
|
30624 | 7779 |
{ |
7780 |
bool evex_r = (xreg_enc >= 16); |
|
50860
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7781 |
bool evex_v; |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7782 |
// EVEX.V' is set to true when VSIB is used as we may need to use higher order XMM registers (16-31) |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7783 |
if (adr.isxmmindex()) { |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7784 |
evex_v = ((adr._xmmindex->encoding() > 15) ? true : false); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7785 |
} else { |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7786 |
evex_v = (nds_enc >= 16); |
480a96a43b62
8205528: Base64 encoding algorithm using AVX512 instructions
kvn
parents:
50699
diff
changeset
|
7787 |
} |
34162 | 7788 |
attributes->set_is_evex_instruction(); |
7789 |
evex_prefix(vex_r, vex_b, vex_x, evex_r, evex_v, nds_enc, pre, opc); |
|
30624 | 7790 |
} else { |
38049 | 7791 |
if (UseAVX > 2 && attributes->is_rex_vex_w_reverted()) { |
7792 |
attributes->set_rex_vex_w(false); |
|
7793 |
} |
|
34162 | 7794 |
vex_prefix(vex_r, vex_b, vex_x, nds_enc, pre, opc); |
30624 | 7795 |
} |
34162 | 7796 |
} |
7797 |
||
7798 |
int Assembler::vex_prefix_and_encode(int dst_enc, int nds_enc, int src_enc, VexSimdPrefix pre, VexOpcode opc, InstructionAttr *attributes) { |
|
31410 | 7799 |
bool vex_r = ((dst_enc & 8) == 8) ? 1 : 0; |
7800 |
bool vex_b = ((src_enc & 8) == 8) ? 1 : 0; |
|
11427 | 7801 |
bool vex_x = false; |
34162 | 7802 |
set_attributes(attributes); |
7803 |
attributes->set_current_assembler(this); |
|
51857 | 7804 |
|
7805 |
// For EVEX instruction (which is not marked as pure EVEX instruction) check and see if this instruction |
|
7806 |
// is allowed in legacy mode and has resources which will fit in it. |
|
7807 |
// Pure EVEX instructions will have is_evex_instruction set in their definition. |
|
7808 |
if (!attributes->is_legacy_mode()) { |
|
7809 |
if (UseAVX > 2 && !attributes->is_evex_instruction() && !_is_managed) { |
|
7810 |
if ((!attributes->uses_vl() || (attributes->get_vector_len() != AVX_512bit)) && |
|
7811 |
(dst_enc < 16) && (nds_enc < 16) && (src_enc < 16)) { |
|
36837 | 7812 |
attributes->set_is_legacy_mode(); |
34162 | 7813 |
} |
30624 | 7814 |
} |
7815 |
} |
|
7816 |
||
51857 | 7817 |
if (UseAVX > 2) { |
7818 |
// All the scalar fp instructions (with uses_vl as false) can have legacy_mode as false |
|
7819 |
// Instruction with uses_vl true are vector instructions |
|
7820 |
// All the vector instructions with AVX_512bit length can have legacy_mode as false |
|
7821 |
// All the vector instructions with < AVX_512bit length can have legacy_mode as false if AVX512vl() is supported |
|
7822 |
// Rest all should have legacy_mode set as true |
|
7823 |
assert(((!attributes->uses_vl()) || |
|
7824 |
(attributes->get_vector_len() == AVX_512bit) || |
|
7825 |
(!_legacy_mode_vl) || |
|
7826 |
(attributes->is_legacy_mode())),"XMM register should be 0-15"); |
|
7827 |
// Instruction with legacy_mode true should have dst, nds and src < 15 |
|
7828 |
assert(((dst_enc < 16 && nds_enc < 16 && src_enc < 16) || (!attributes->is_legacy_mode())),"XMM register should be 0-15"); |
|
36837 | 7829 |
} |
7830 |
||
7831 |
_is_managed = false; |
|
7832 |
if (UseAVX > 2 && !attributes->is_legacy_mode()) |
|
30624 | 7833 |
{ |
7834 |
bool evex_r = (dst_enc >= 16); |
|
7835 |
bool evex_v = (nds_enc >= 16); |
|
7836 |
// can use vex_x as bank extender on rm encoding |
|
7837 |
vex_x = (src_enc >= 16); |
|
34162 | 7838 |
attributes->set_is_evex_instruction(); |
7839 |
evex_prefix(vex_r, vex_b, vex_x, evex_r, evex_v, nds_enc, pre, opc); |
|
30624 | 7840 |
} else { |
38049 | 7841 |
if (UseAVX > 2 && attributes->is_rex_vex_w_reverted()) { |
7842 |
attributes->set_rex_vex_w(false); |
|
7843 |
} |
|
34162 | 7844 |
vex_prefix(vex_r, vex_b, vex_x, nds_enc, pre, opc); |
30624 | 7845 |
} |
7846 |
||
7847 |
// return modrm byte components for operands |
|
11427 | 7848 |
return (((dst_enc & 7) << 3) | (src_enc & 7)); |
7849 |
} |
|
7850 |
||
7851 |
||
30624 | 7852 |
void Assembler::simd_prefix(XMMRegister xreg, XMMRegister nds, Address adr, VexSimdPrefix pre, |
34162 | 7853 |
VexOpcode opc, InstructionAttr *attributes) { |
11427 | 7854 |
if (UseAVX > 0) { |
7855 |
int xreg_enc = xreg->encoding(); |
|
34162 | 7856 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
7857 |
vex_prefix(adr, nds_enc, xreg_enc, pre, opc, attributes); |
|
11427 | 7858 |
} else { |
7859 |
assert((nds == xreg) || (nds == xnoreg), "wrong sse encoding"); |
|
34162 | 7860 |
rex_prefix(adr, xreg, pre, opc, attributes->is_rex_vex_w()); |
11427 | 7861 |
} |
7862 |
} |
|
7863 |
||
30624 | 7864 |
int Assembler::simd_prefix_and_encode(XMMRegister dst, XMMRegister nds, XMMRegister src, VexSimdPrefix pre, |
34162 | 7865 |
VexOpcode opc, InstructionAttr *attributes) { |
11427 | 7866 |
int dst_enc = dst->encoding(); |
7867 |
int src_enc = src->encoding(); |
|
7868 |
if (UseAVX > 0) { |
|
7869 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
34162 | 7870 |
return vex_prefix_and_encode(dst_enc, nds_enc, src_enc, pre, opc, attributes); |
11427 | 7871 |
} else { |
7872 |
assert((nds == dst) || (nds == src) || (nds == xnoreg), "wrong sse encoding"); |
|
34162 | 7873 |
return rex_prefix_and_encode(dst_enc, src_enc, pre, opc, attributes->is_rex_vex_w()); |
11427 | 7874 |
} |
7875 |
} |
|
1066 | 7876 |
|
54022
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7877 |
void Assembler::vmaxss(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7878 |
assert(VM_Version::supports_avx(), ""); |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7879 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7880 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7881 |
emit_int8(0x5F); |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7882 |
emit_int8((unsigned char)(0xC0 | encode)); |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7883 |
} |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7884 |
|
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7885 |
void Assembler::vmaxsd(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7886 |
assert(VM_Version::supports_avx(), ""); |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7887 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7888 |
attributes.set_rex_vex_w_reverted(); |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7889 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7890 |
emit_int8(0x5F); |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7891 |
emit_int8((unsigned char)(0xC0 | encode)); |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7892 |
} |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7893 |
|
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7894 |
void Assembler::vminss(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7895 |
assert(VM_Version::supports_avx(), ""); |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7896 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7897 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7898 |
emit_int8(0x5D); |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7899 |
emit_int8((unsigned char)(0xC0 | encode)); |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7900 |
} |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7901 |
|
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7902 |
void Assembler::vminsd(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7903 |
assert(VM_Version::supports_avx(), ""); |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7904 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7905 |
attributes.set_rex_vex_w_reverted(); |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7906 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7907 |
emit_int8(0x5D); |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7908 |
emit_int8((unsigned char)(0xC0 | encode)); |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7909 |
} |
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7910 |
|
33469
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
7911 |
void Assembler::cmppd(XMMRegister dst, XMMRegister nds, XMMRegister src, int cop, int vector_len) { |
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
7912 |
assert(VM_Version::supports_avx(), ""); |
54022
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7913 |
assert(vector_len <= AVX_256bit, ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
7914 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 7915 |
int encode = simd_prefix_and_encode(dst, nds, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
33469
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
7916 |
emit_int8((unsigned char)0xC2); |
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
7917 |
emit_int8((unsigned char)(0xC0 | encode)); |
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
7918 |
emit_int8((unsigned char)(0xF & cop)); |
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
7919 |
} |
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
7920 |
|
42039 | 7921 |
void Assembler::blendvpd(XMMRegister dst, XMMRegister nds, XMMRegister src1, XMMRegister src2, int vector_len) { |
33469
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
7922 |
assert(VM_Version::supports_avx(), ""); |
54022
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7923 |
assert(vector_len <= AVX_256bit, ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
7924 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true); |
37293
c010188d360f
8151003: Remove nds->is_valid() checks from assembler_x86.cpp
mcberg
parents:
36837
diff
changeset
|
7925 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src1->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
33469
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
7926 |
emit_int8((unsigned char)0x4B); |
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
7927 |
emit_int8((unsigned char)(0xC0 | encode)); |
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
7928 |
int src2_enc = src2->encoding(); |
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
7929 |
emit_int8((unsigned char)(0xF0 & src2_enc<<4)); |
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
7930 |
} |
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
7931 |
|
48309 | 7932 |
void Assembler::cmpps(XMMRegister dst, XMMRegister nds, XMMRegister src, int cop, int vector_len) { |
7933 |
assert(VM_Version::supports_avx(), ""); |
|
54022
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7934 |
assert(vector_len <= AVX_256bit, ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
7935 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true); |
48309 | 7936 |
int encode = simd_prefix_and_encode(dst, nds, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
7937 |
emit_int8((unsigned char)0xC2); |
|
7938 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
7939 |
emit_int8((unsigned char)(0xF & cop)); |
|
7940 |
} |
|
7941 |
||
7942 |
void Assembler::blendvps(XMMRegister dst, XMMRegister nds, XMMRegister src1, XMMRegister src2, int vector_len) { |
|
7943 |
assert(VM_Version::supports_avx(), ""); |
|
54022
ff399127078a
8217561: X86: Add floating-point Math.min/max intrinsics
bsrbnd
parents:
52992
diff
changeset
|
7944 |
assert(vector_len <= AVX_256bit, ""); |
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
7945 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true); |
48309 | 7946 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src1->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
7947 |
emit_int8((unsigned char)0x4A); |
|
7948 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
7949 |
int src2_enc = src2->encoding(); |
|
7950 |
emit_int8((unsigned char)(0xF0 & src2_enc<<4)); |
|
7951 |
} |
|
7952 |
||
42039 | 7953 |
void Assembler::vpblendd(XMMRegister dst, XMMRegister nds, XMMRegister src, int imm8, int vector_len) { |
7954 |
assert(VM_Version::supports_avx2(), ""); |
|
51976
390f529f4f22
8211251: Default mask register for avx512 instructions
kvn
parents:
51857
diff
changeset
|
7955 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true); |
42039 | 7956 |
int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
7957 |
emit_int8((unsigned char)0x02); |
|
7958 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
7959 |
emit_int8((unsigned char)imm8); |
|
7960 |
} |
|
7961 |
||
38049 | 7962 |
void Assembler::shlxl(Register dst, Register src1, Register src2) { |
7963 |
assert(VM_Version::supports_bmi2(), ""); |
|
51857 | 7964 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 7965 |
int encode = vex_prefix_and_encode(dst->encoding(), src2->encoding(), src1->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
7966 |
emit_int8((unsigned char)0xF7); |
|
7967 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
7968 |
} |
|
7969 |
||
7970 |
void Assembler::shlxq(Register dst, Register src1, Register src2) { |
|
7971 |
assert(VM_Version::supports_bmi2(), ""); |
|
51857 | 7972 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ true); |
38049 | 7973 |
int encode = vex_prefix_and_encode(dst->encoding(), src2->encoding(), src1->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
7974 |
emit_int8((unsigned char)0xF7); |
|
7975 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
7976 |
} |
|
33469
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
7977 |
|
1066 | 7978 |
#ifndef _LP64 |
7979 |
||
7980 |
void Assembler::incl(Register dst) { |
|
7981 |
// Don't use it directly. Use MacroAssembler::incrementl() instead. |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7982 |
emit_int8(0x40 | dst->encoding()); |
1066 | 7983 |
} |
7984 |
||
7985 |
void Assembler::lea(Register dst, Address src) { |
|
7986 |
leal(dst, src); |
|
7987 |
} |
|
7988 |
||
34162 | 7989 |
void Assembler::mov_literal32(Address dst, int32_t imm32, RelocationHolder const& rspec) { |
1066 | 7990 |
InstructionMark im(this); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7991 |
emit_int8((unsigned char)0xC7); |
1066 | 7992 |
emit_operand(rax, dst); |
7993 |
emit_data((int)imm32, rspec, 0); |
|
7994 |
} |
|
7995 |
||
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
7996 |
void Assembler::mov_literal32(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
|
7997 |
InstructionMark im(this); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
7998 |
int encode = prefix_and_encode(dst->encoding()); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7999 |
emit_int8((unsigned char)(0xB8 | encode)); |
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8000 |
emit_data((int)imm32, rspec, 0); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8001 |
} |
1066 | 8002 |
|
8003 |
void Assembler::popa() { // 32bit |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8004 |
emit_int8(0x61); |
1066 | 8005 |
} |
8006 |
||
8007 |
void Assembler::push_literal32(int32_t imm32, RelocationHolder const& rspec) { |
|
8008 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8009 |
emit_int8(0x68); |
1066 | 8010 |
emit_data(imm32, rspec, 0); |
8011 |
} |
|
8012 |
||
8013 |
void Assembler::pusha() { // 32bit |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8014 |
emit_int8(0x60); |
1066 | 8015 |
} |
8016 |
||
8017 |
void Assembler::set_byte_if_not_zero(Register dst) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8018 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8019 |
emit_int8((unsigned char)0x95); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8020 |
emit_int8((unsigned char)(0xE0 | dst->encoding())); |
1066 | 8021 |
} |
8022 |
||
8023 |
void Assembler::shldl(Register dst, Register src) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8024 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8025 |
emit_int8((unsigned char)0xA5); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8026 |
emit_int8((unsigned char)(0xC0 | src->encoding() << 3 | dst->encoding())); |
1066 | 8027 |
} |
8028 |
||
33066 | 8029 |
// 0F A4 / r ib |
8030 |
void Assembler::shldl(Register dst, Register src, int8_t imm8) { |
|
8031 |
emit_int8(0x0F); |
|
8032 |
emit_int8((unsigned char)0xA4); |
|
8033 |
emit_int8((unsigned char)(0xC0 | src->encoding() << 3 | dst->encoding())); |
|
8034 |
emit_int8(imm8); |
|
8035 |
} |
|
8036 |
||
1066 | 8037 |
void Assembler::shrdl(Register dst, Register src) { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8038 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8039 |
emit_int8((unsigned char)0xAD); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8040 |
emit_int8((unsigned char)(0xC0 | src->encoding() << 3 | dst->encoding())); |
1066 | 8041 |
} |
8042 |
||
8043 |
#else // LP64 |
|
8044 |
||
5253 | 8045 |
void Assembler::set_byte_if_not_zero(Register dst) { |
8046 |
int enc = prefix_and_encode(dst->encoding(), true); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8047 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8048 |
emit_int8((unsigned char)0x95); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8049 |
emit_int8((unsigned char)(0xE0 | enc)); |
5253 | 8050 |
} |
8051 |
||
1066 | 8052 |
// 64bit only pieces of the assembler |
8053 |
// This should only be used by 64bit instructions that can use rip-relative |
|
8054 |
// it cannot be used by instructions that want an immediate value. |
|
8055 |
||
8056 |
bool Assembler::reachable(AddressLiteral adr) { |
|
8057 |
int64_t disp; |
|
8058 |
// None will force a 64bit literal to the code stream. Likely a placeholder |
|
8059 |
// for something that will be patched later and we need to certain it will |
|
8060 |
// always be reachable. |
|
8061 |
if (adr.reloc() == relocInfo::none) { |
|
8062 |
return false; |
|
8063 |
} |
|
8064 |
if (adr.reloc() == relocInfo::internal_word_type) { |
|
8065 |
// This should be rip relative and easily reachable. |
|
8066 |
return true; |
|
8067 |
} |
|
8068 |
if (adr.reloc() == relocInfo::virtual_call_type || |
|
8069 |
adr.reloc() == relocInfo::opt_virtual_call_type || |
|
8070 |
adr.reloc() == relocInfo::static_call_type || |
|
8071 |
adr.reloc() == relocInfo::static_stub_type ) { |
|
8072 |
// This should be rip relative within the code cache and easily |
|
8073 |
// reachable until we get huge code caches. (At which point |
|
8074 |
// ic code is going to have issues). |
|
8075 |
return true; |
|
8076 |
} |
|
8077 |
if (adr.reloc() != relocInfo::external_word_type && |
|
8078 |
adr.reloc() != relocInfo::poll_return_type && // these are really external_word but need special |
|
8079 |
adr.reloc() != relocInfo::poll_type && // relocs to identify them |
|
8080 |
adr.reloc() != relocInfo::runtime_call_type ) { |
|
8081 |
return false; |
|
8082 |
} |
|
8083 |
||
8084 |
// Stress the correction code |
|
8085 |
if (ForceUnreachable) { |
|
8086 |
// Must be runtimecall reloc, see if it is in the codecache |
|
8087 |
// Flipping stuff in the codecache to be unreachable causes issues |
|
8088 |
// with things like inline caches where the additional instructions |
|
8089 |
// are not handled. |
|
8090 |
if (CodeCache::find_blob(adr._target) == NULL) { |
|
8091 |
return false; |
|
8092 |
} |
|
8093 |
} |
|
8094 |
// For external_word_type/runtime_call_type if it is reachable from where we |
|
8095 |
// are now (possibly a temp buffer) and where we might end up |
|
8096 |
// anywhere in the codeCache then we are always reachable. |
|
8097 |
// This would have to change if we ever save/restore shared code |
|
8098 |
// to be more pessimistic. |
|
8099 |
disp = (int64_t)adr._target - ((int64_t)CodeCache::low_bound() + sizeof(int)); |
|
8100 |
if (!is_simm32(disp)) return false; |
|
8101 |
disp = (int64_t)adr._target - ((int64_t)CodeCache::high_bound() + sizeof(int)); |
|
8102 |
if (!is_simm32(disp)) return false; |
|
8103 |
||
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
8104 |
disp = (int64_t)adr._target - ((int64_t)pc() + sizeof(int)); |
1066 | 8105 |
|
8106 |
// Because rip relative is a disp + address_of_next_instruction and we |
|
8107 |
// don't know the value of address_of_next_instruction we apply a fudge factor |
|
8108 |
// to make sure we will be ok no matter the size of the instruction we get placed into. |
|
8109 |
// We don't have to fudge the checks above here because they are already worst case. |
|
8110 |
||
8111 |
// 12 == override/rex byte, opcode byte, rm byte, sib byte, a 4-byte disp , 4-byte literal |
|
8112 |
// + 4 because better safe than sorry. |
|
8113 |
const int fudge = 12 + 4; |
|
8114 |
if (disp < 0) { |
|
8115 |
disp -= fudge; |
|
8116 |
} else { |
|
8117 |
disp += fudge; |
|
8118 |
} |
|
8119 |
return is_simm32(disp); |
|
8120 |
} |
|
8121 |
||
8871
5c3b26c4119e
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
8676
diff
changeset
|
8122 |
// Check if the polling page is not reachable from the code cache using rip-relative |
5c3b26c4119e
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
8676
diff
changeset
|
8123 |
// addressing. |
5c3b26c4119e
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
8676
diff
changeset
|
8124 |
bool Assembler::is_polling_page_far() { |
5c3b26c4119e
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
8676
diff
changeset
|
8125 |
intptr_t addr = (intptr_t)os::get_polling_page(); |
11194
ee1235a09fc3
7110489: C1: 64-bit tiered with ForceUnreachable: assert(reachable(src)) failed: Address should be reachable
never
parents:
10546
diff
changeset
|
8126 |
return ForceUnreachable || |
ee1235a09fc3
7110489: C1: 64-bit tiered with ForceUnreachable: assert(reachable(src)) failed: Address should be reachable
never
parents:
10546
diff
changeset
|
8127 |
!is_simm32(addr - (intptr_t)CodeCache::low_bound()) || |
8871
5c3b26c4119e
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
8676
diff
changeset
|
8128 |
!is_simm32(addr - (intptr_t)CodeCache::high_bound()); |
5c3b26c4119e
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
8676
diff
changeset
|
8129 |
} |
5c3b26c4119e
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
8676
diff
changeset
|
8130 |
|
1066 | 8131 |
void Assembler::emit_data64(jlong data, |
8132 |
relocInfo::relocType rtype, |
|
8133 |
int format) { |
|
8134 |
if (rtype == relocInfo::none) { |
|
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
8135 |
emit_int64(data); |
1066 | 8136 |
} else { |
8137 |
emit_data64(data, Relocation::spec_simple(rtype), format); |
|
8138 |
} |
|
8139 |
} |
|
8140 |
||
8141 |
void Assembler::emit_data64(jlong data, |
|
8142 |
RelocationHolder const& rspec, |
|
8143 |
int format) { |
|
8144 |
assert(imm_operand == 0, "default format must be immediate in this file"); |
|
8145 |
assert(imm_operand == format, "must be immediate"); |
|
8146 |
assert(inst_mark() != NULL, "must be inside InstructionMark"); |
|
8147 |
// Do not use AbstractAssembler::relocate, which is not intended for |
|
8148 |
// embedded words. Instead, relocate to the enclosing instruction. |
|
8149 |
code_section()->relocate(inst_mark(), rspec, format); |
|
8150 |
#ifdef ASSERT |
|
8151 |
check_relocation(rspec, format); |
|
8152 |
#endif |
|
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
8153 |
emit_int64(data); |
1066 | 8154 |
} |
8155 |
||
8156 |
int Assembler::prefix_and_encode(int reg_enc, bool byteinst) { |
|
8157 |
if (reg_enc >= 8) { |
|
8158 |
prefix(REX_B); |
|
8159 |
reg_enc -= 8; |
|
8160 |
} else if (byteinst && reg_enc >= 4) { |
|
8161 |
prefix(REX); |
|
8162 |
} |
|
8163 |
return reg_enc; |
|
8164 |
} |
|
8165 |
||
8166 |
int Assembler::prefixq_and_encode(int reg_enc) { |
|
8167 |
if (reg_enc < 8) { |
|
8168 |
prefix(REX_W); |
|
8169 |
} else { |
|
8170 |
prefix(REX_WB); |
|
8171 |
reg_enc -= 8; |
|
8172 |
} |
|
8173 |
return reg_enc; |
|
8174 |
} |
|
8175 |
||
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
8176 |
int Assembler::prefix_and_encode(int dst_enc, bool dst_is_byte, int src_enc, bool src_is_byte) { |
1066 | 8177 |
if (dst_enc < 8) { |
8178 |
if (src_enc >= 8) { |
|
8179 |
prefix(REX_B); |
|
8180 |
src_enc -= 8; |
|
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
8181 |
} else if ((src_is_byte && src_enc >= 4) || (dst_is_byte && dst_enc >= 4)) { |
1066 | 8182 |
prefix(REX); |
8183 |
} |
|
8184 |
} else { |
|
8185 |
if (src_enc < 8) { |
|
8186 |
prefix(REX_R); |
|
8187 |
} else { |
|
8188 |
prefix(REX_RB); |
|
8189 |
src_enc -= 8; |
|
8190 |
} |
|
8191 |
dst_enc -= 8; |
|
8192 |
} |
|
8193 |
return dst_enc << 3 | src_enc; |
|
8194 |
} |
|
8195 |
||
8196 |
int Assembler::prefixq_and_encode(int dst_enc, int src_enc) { |
|
8197 |
if (dst_enc < 8) { |
|
8198 |
if (src_enc < 8) { |
|
8199 |
prefix(REX_W); |
|
8200 |
} else { |
|
8201 |
prefix(REX_WB); |
|
8202 |
src_enc -= 8; |
|
8203 |
} |
|
8204 |
} else { |
|
8205 |
if (src_enc < 8) { |
|
8206 |
prefix(REX_WR); |
|
8207 |
} else { |
|
8208 |
prefix(REX_WRB); |
|
8209 |
src_enc -= 8; |
|
8210 |
} |
|
8211 |
dst_enc -= 8; |
|
8212 |
} |
|
8213 |
return dst_enc << 3 | src_enc; |
|
8214 |
} |
|
8215 |
||
8216 |
void Assembler::prefix(Register reg) { |
|
8217 |
if (reg->encoding() >= 8) { |
|
8218 |
prefix(REX_B); |
|
8219 |
} |
|
8220 |
} |
|
8221 |
||
33066 | 8222 |
void Assembler::prefix(Register dst, Register src, Prefix p) { |
8223 |
if (src->encoding() >= 8) { |
|
8224 |
p = (Prefix)(p | REX_B); |
|
8225 |
} |
|
8226 |
if (dst->encoding() >= 8) { |
|
8227 |
p = (Prefix)( p | REX_R); |
|
8228 |
} |
|
8229 |
if (p != Prefix_EMPTY) { |
|
8230 |
// do not generate an empty prefix |
|
8231 |
prefix(p); |
|
8232 |
} |
|
8233 |
} |
|
8234 |
||
8235 |
void Assembler::prefix(Register dst, Address adr, Prefix p) { |
|
8236 |
if (adr.base_needs_rex()) { |
|
8237 |
if (adr.index_needs_rex()) { |
|
8238 |
assert(false, "prefix(Register dst, Address adr, Prefix p) does not support handling of an X"); |
|
8239 |
} else { |
|
8240 |
prefix(REX_B); |
|
8241 |
} |
|
8242 |
} else { |
|
8243 |
if (adr.index_needs_rex()) { |
|
8244 |
assert(false, "prefix(Register dst, Address adr, Prefix p) does not support handling of an X"); |
|
8245 |
} |
|
8246 |
} |
|
8247 |
if (dst->encoding() >= 8) { |
|
8248 |
p = (Prefix)(p | REX_R); |
|
8249 |
} |
|
8250 |
if (p != Prefix_EMPTY) { |
|
8251 |
// do not generate an empty prefix |
|
8252 |
prefix(p); |
|
8253 |
} |
|
8254 |
} |
|
8255 |
||
1066 | 8256 |
void Assembler::prefix(Address adr) { |
8257 |
if (adr.base_needs_rex()) { |
|
8258 |
if (adr.index_needs_rex()) { |
|
8259 |
prefix(REX_XB); |
|
8260 |
} else { |
|
8261 |
prefix(REX_B); |
|
8262 |
} |
|
8263 |
} else { |
|
8264 |
if (adr.index_needs_rex()) { |
|
8265 |
prefix(REX_X); |
|
8266 |
} |
|
8267 |
} |
|
8268 |
} |
|
8269 |
||
8270 |
void Assembler::prefixq(Address adr) { |
|
8271 |
if (adr.base_needs_rex()) { |
|
8272 |
if (adr.index_needs_rex()) { |
|
8273 |
prefix(REX_WXB); |
|
8274 |
} else { |
|
8275 |
prefix(REX_WB); |
|
8276 |
} |
|
8277 |
} else { |
|
8278 |
if (adr.index_needs_rex()) { |
|
8279 |
prefix(REX_WX); |
|
8280 |
} else { |
|
8281 |
prefix(REX_W); |
|
8282 |
} |
|
8283 |
} |
|
8284 |
} |
|
8285 |
||
8286 |
||
8287 |
void Assembler::prefix(Address adr, Register reg, bool byteinst) { |
|
8288 |
if (reg->encoding() < 8) { |
|
8289 |
if (adr.base_needs_rex()) { |
|
8290 |
if (adr.index_needs_rex()) { |
|
8291 |
prefix(REX_XB); |
|
8292 |
} else { |
|
8293 |
prefix(REX_B); |
|
8294 |
} |
|
8295 |
} else { |
|
8296 |
if (adr.index_needs_rex()) { |
|
8297 |
prefix(REX_X); |
|
10268 | 8298 |
} else if (byteinst && reg->encoding() >= 4 ) { |
1066 | 8299 |
prefix(REX); |
8300 |
} |
|
8301 |
} |
|
8302 |
} else { |
|
8303 |
if (adr.base_needs_rex()) { |
|
8304 |
if (adr.index_needs_rex()) { |
|
8305 |
prefix(REX_RXB); |
|
8306 |
} else { |
|
8307 |
prefix(REX_RB); |
|
8308 |
} |
|
8309 |
} else { |
|
8310 |
if (adr.index_needs_rex()) { |
|
8311 |
prefix(REX_RX); |
|
8312 |
} else { |
|
8313 |
prefix(REX_R); |
|
8314 |
} |
|
8315 |
} |
|
8316 |
} |
|
8317 |
} |
|
8318 |
||
8319 |
void Assembler::prefixq(Address adr, Register src) { |
|
8320 |
if (src->encoding() < 8) { |
|
8321 |
if (adr.base_needs_rex()) { |
|
8322 |
if (adr.index_needs_rex()) { |
|
8323 |
prefix(REX_WXB); |
|
8324 |
} else { |
|
8325 |
prefix(REX_WB); |
|
8326 |
} |
|
8327 |
} else { |
|
8328 |
if (adr.index_needs_rex()) { |
|
8329 |
prefix(REX_WX); |
|
8330 |
} else { |
|
8331 |
prefix(REX_W); |
|
8332 |
} |
|
8333 |
} |
|
8334 |
} else { |
|
8335 |
if (adr.base_needs_rex()) { |
|
8336 |
if (adr.index_needs_rex()) { |
|
8337 |
prefix(REX_WRXB); |
|
8338 |
} else { |
|
8339 |
prefix(REX_WRB); |
|
8340 |
} |
|
8341 |
} else { |
|
8342 |
if (adr.index_needs_rex()) { |
|
8343 |
prefix(REX_WRX); |
|
8344 |
} else { |
|
8345 |
prefix(REX_WR); |
|
8346 |
} |
|
8347 |
} |
|
8348 |
} |
|
8349 |
} |
|
8350 |
||
8351 |
void Assembler::prefix(Address adr, XMMRegister reg) { |
|
8352 |
if (reg->encoding() < 8) { |
|
8353 |
if (adr.base_needs_rex()) { |
|
8354 |
if (adr.index_needs_rex()) { |
|
8355 |
prefix(REX_XB); |
|
8356 |
} else { |
|
8357 |
prefix(REX_B); |
|
8358 |
} |
|
8359 |
} else { |
|
8360 |
if (adr.index_needs_rex()) { |
|
8361 |
prefix(REX_X); |
|
8362 |
} |
|
8363 |
} |
|
8364 |
} else { |
|
8365 |
if (adr.base_needs_rex()) { |
|
8366 |
if (adr.index_needs_rex()) { |
|
8367 |
prefix(REX_RXB); |
|
8368 |
} else { |
|
8369 |
prefix(REX_RB); |
|
8370 |
} |
|
8371 |
} else { |
|
8372 |
if (adr.index_needs_rex()) { |
|
8373 |
prefix(REX_RX); |
|
8374 |
} else { |
|
8375 |
prefix(REX_R); |
|
8376 |
} |
|
8377 |
} |
|
8378 |
} |
|
8379 |
} |
|
8380 |
||
11427 | 8381 |
void Assembler::prefixq(Address adr, XMMRegister src) { |
8382 |
if (src->encoding() < 8) { |
|
8383 |
if (adr.base_needs_rex()) { |
|
8384 |
if (adr.index_needs_rex()) { |
|
8385 |
prefix(REX_WXB); |
|
8386 |
} else { |
|
8387 |
prefix(REX_WB); |
|
8388 |
} |
|
8389 |
} else { |
|
8390 |
if (adr.index_needs_rex()) { |
|
8391 |
prefix(REX_WX); |
|
8392 |
} else { |
|
8393 |
prefix(REX_W); |
|
8394 |
} |
|
8395 |
} |
|
8396 |
} else { |
|
8397 |
if (adr.base_needs_rex()) { |
|
8398 |
if (adr.index_needs_rex()) { |
|
8399 |
prefix(REX_WRXB); |
|
8400 |
} else { |
|
8401 |
prefix(REX_WRB); |
|
8402 |
} |
|
8403 |
} else { |
|
8404 |
if (adr.index_needs_rex()) { |
|
8405 |
prefix(REX_WRX); |
|
8406 |
} else { |
|
8407 |
prefix(REX_WR); |
|
8408 |
} |
|
8409 |
} |
|
8410 |
} |
|
8411 |
} |
|
8412 |
||
1066 | 8413 |
void Assembler::adcq(Register dst, int32_t imm32) { |
8414 |
(void) prefixq_and_encode(dst->encoding()); |
|
8415 |
emit_arith(0x81, 0xD0, dst, imm32); |
|
8416 |
} |
|
8417 |
||
8418 |
void Assembler::adcq(Register dst, Address src) { |
|
8419 |
InstructionMark im(this); |
|
8420 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8421 |
emit_int8(0x13); |
1066 | 8422 |
emit_operand(dst, src); |
8423 |
} |
|
8424 |
||
8425 |
void Assembler::adcq(Register dst, Register src) { |
|
20295 | 8426 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
1066 | 8427 |
emit_arith(0x13, 0xC0, dst, src); |
8428 |
} |
|
8429 |
||
8430 |
void Assembler::addq(Address dst, int32_t imm32) { |
|
8431 |
InstructionMark im(this); |
|
8432 |
prefixq(dst); |
|
8433 |
emit_arith_operand(0x81, rax, dst,imm32); |
|
8434 |
} |
|
8435 |
||
8436 |
void Assembler::addq(Address dst, Register src) { |
|
8437 |
InstructionMark im(this); |
|
8438 |
prefixq(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8439 |
emit_int8(0x01); |
1066 | 8440 |
emit_operand(src, dst); |
8441 |
} |
|
8442 |
||
8443 |
void Assembler::addq(Register dst, int32_t imm32) { |
|
8444 |
(void) prefixq_and_encode(dst->encoding()); |
|
8445 |
emit_arith(0x81, 0xC0, dst, imm32); |
|
8446 |
} |
|
8447 |
||
8448 |
void Assembler::addq(Register dst, Address src) { |
|
8449 |
InstructionMark im(this); |
|
8450 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8451 |
emit_int8(0x03); |
1066 | 8452 |
emit_operand(dst, src); |
8453 |
} |
|
8454 |
||
8455 |
void Assembler::addq(Register dst, Register src) { |
|
8456 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
8457 |
emit_arith(0x03, 0xC0, dst, src); |
|
8458 |
} |
|
8459 |
||
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
8460 |
void Assembler::adcxq(Register dst, Register src) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
8461 |
//assert(VM_Version::supports_adx(), "adx instructions not supported"); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
8462 |
emit_int8((unsigned char)0x66); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
8463 |
int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
8464 |
emit_int8(0x0F); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
8465 |
emit_int8(0x38); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
8466 |
emit_int8((unsigned char)0xF6); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
8467 |
emit_int8((unsigned char)(0xC0 | encode)); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
8468 |
} |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
8469 |
|
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
8470 |
void Assembler::adoxq(Register dst, Register src) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
8471 |
//assert(VM_Version::supports_adx(), "adx instructions not supported"); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
8472 |
emit_int8((unsigned char)0xF3); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
8473 |
int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
8474 |
emit_int8(0x0F); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
8475 |
emit_int8(0x38); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
8476 |
emit_int8((unsigned char)0xF6); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
8477 |
emit_int8((unsigned char)(0xC0 | encode)); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
8478 |
} |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
8479 |
|
10006 | 8480 |
void Assembler::andq(Address dst, int32_t imm32) { |
8481 |
InstructionMark im(this); |
|
8482 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8483 |
emit_int8((unsigned char)0x81); |
10006 | 8484 |
emit_operand(rsp, dst, 4); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
8485 |
emit_int32(imm32); |
10006 | 8486 |
} |
8487 |
||
1066 | 8488 |
void Assembler::andq(Register dst, int32_t imm32) { |
8489 |
(void) prefixq_and_encode(dst->encoding()); |
|
8490 |
emit_arith(0x81, 0xE0, dst, imm32); |
|
8491 |
} |
|
8492 |
||
8493 |
void Assembler::andq(Register dst, Address src) { |
|
8494 |
InstructionMark im(this); |
|
8495 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8496 |
emit_int8(0x23); |
1066 | 8497 |
emit_operand(dst, src); |
8498 |
} |
|
8499 |
||
8500 |
void Assembler::andq(Register dst, Register src) { |
|
20295 | 8501 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
1066 | 8502 |
emit_arith(0x23, 0xC0, dst, src); |
8503 |
} |
|
8504 |
||
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8505 |
void Assembler::andnq(Register dst, Register src1, Register src2) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8506 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
8507 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 8508 |
int encode = vex_prefix_and_encode(dst->encoding(), src1->encoding(), src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_38, &attributes); |
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8509 |
emit_int8((unsigned char)0xF2); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8510 |
emit_int8((unsigned char)(0xC0 | encode)); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8511 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8512 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8513 |
void Assembler::andnq(Register dst, Register src1, Address src2) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8514 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 8515 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
8516 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 8517 |
vex_prefix(src2, src1->encoding(), dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_38, &attributes); |
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8518 |
emit_int8((unsigned char)0xF2); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8519 |
emit_operand(dst, src2); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8520 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8521 |
|
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
8522 |
void Assembler::bsfq(Register dst, Register src) { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
8523 |
int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8524 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8525 |
emit_int8((unsigned char)0xBC); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8526 |
emit_int8((unsigned char)(0xC0 | encode)); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
8527 |
} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
8528 |
|
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
8529 |
void Assembler::bsrq(Register dst, Register src) { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
8530 |
int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8531 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8532 |
emit_int8((unsigned char)0xBD); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8533 |
emit_int8((unsigned char)(0xC0 | encode)); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
8534 |
} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
8535 |
|
1066 | 8536 |
void Assembler::bswapq(Register reg) { |
8537 |
int encode = prefixq_and_encode(reg->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8538 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8539 |
emit_int8((unsigned char)(0xC8 | encode)); |
1066 | 8540 |
} |
8541 |
||
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8542 |
void Assembler::blsiq(Register dst, Register src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8543 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
8544 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 8545 |
int encode = vex_prefix_and_encode(rbx->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_38, &attributes); |
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8546 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8547 |
emit_int8((unsigned char)(0xC0 | encode)); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8548 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8549 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8550 |
void Assembler::blsiq(Register dst, Address src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8551 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 8552 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
8553 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 8554 |
vex_prefix(src, dst->encoding(), rbx->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_38, &attributes); |
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8555 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8556 |
emit_operand(rbx, src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8557 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8558 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8559 |
void Assembler::blsmskq(Register dst, Register src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8560 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
8561 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 8562 |
int encode = vex_prefix_and_encode(rdx->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_38, &attributes); |
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8563 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8564 |
emit_int8((unsigned char)(0xC0 | encode)); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8565 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8566 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8567 |
void Assembler::blsmskq(Register dst, Address src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8568 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 8569 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
8570 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 8571 |
vex_prefix(src, dst->encoding(), rdx->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_38, &attributes); |
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8572 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8573 |
emit_operand(rdx, src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8574 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8575 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8576 |
void Assembler::blsrq(Register dst, Register src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8577 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
8578 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 8579 |
int encode = vex_prefix_and_encode(rcx->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_38, &attributes); |
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8580 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8581 |
emit_int8((unsigned char)(0xC0 | encode)); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8582 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8583 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8584 |
void Assembler::blsrq(Register dst, Address src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8585 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 8586 |
InstructionMark im(this); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
8587 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 8588 |
vex_prefix(src, dst->encoding(), rcx->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F_38, &attributes); |
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8589 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8590 |
emit_operand(rcx, src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8591 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
8592 |
|
1066 | 8593 |
void Assembler::cdqq() { |
8594 |
prefix(REX_W); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8595 |
emit_int8((unsigned char)0x99); |
1066 | 8596 |
} |
8597 |
||
8598 |
void Assembler::clflush(Address adr) { |
|
8599 |
prefix(adr); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8600 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8601 |
emit_int8((unsigned char)0xAE); |
1066 | 8602 |
emit_operand(rdi, adr); |
8603 |
} |
|
8604 |
||
8605 |
void Assembler::cmovq(Condition cc, Register dst, Register src) { |
|
8606 |
int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8607 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8608 |
emit_int8(0x40 | cc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8609 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 8610 |
} |
8611 |
||
8612 |
void Assembler::cmovq(Condition cc, Register dst, Address src) { |
|
8613 |
InstructionMark im(this); |
|
8614 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8615 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8616 |
emit_int8(0x40 | cc); |
1066 | 8617 |
emit_operand(dst, src); |
8618 |
} |
|
8619 |
||
8620 |
void Assembler::cmpq(Address dst, int32_t imm32) { |
|
8621 |
InstructionMark im(this); |
|
8622 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8623 |
emit_int8((unsigned char)0x81); |
1066 | 8624 |
emit_operand(rdi, dst, 4); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
8625 |
emit_int32(imm32); |
1066 | 8626 |
} |
8627 |
||
8628 |
void Assembler::cmpq(Register dst, int32_t imm32) { |
|
8629 |
(void) prefixq_and_encode(dst->encoding()); |
|
8630 |
emit_arith(0x81, 0xF8, dst, imm32); |
|
8631 |
} |
|
8632 |
||
8633 |
void Assembler::cmpq(Address dst, Register src) { |
|
8634 |
InstructionMark im(this); |
|
8635 |
prefixq(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8636 |
emit_int8(0x3B); |
1066 | 8637 |
emit_operand(src, dst); |
8638 |
} |
|
8639 |
||
8640 |
void Assembler::cmpq(Register dst, Register src) { |
|
8641 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
8642 |
emit_arith(0x3B, 0xC0, dst, src); |
|
8643 |
} |
|
8644 |
||
8645 |
void Assembler::cmpq(Register dst, Address src) { |
|
8646 |
InstructionMark im(this); |
|
8647 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8648 |
emit_int8(0x3B); |
1066 | 8649 |
emit_operand(dst, src); |
8650 |
} |
|
8651 |
||
8652 |
void Assembler::cmpxchgq(Register reg, Address adr) { |
|
8653 |
InstructionMark im(this); |
|
8654 |
prefixq(adr, reg); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8655 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8656 |
emit_int8((unsigned char)0xB1); |
1066 | 8657 |
emit_operand(reg, adr); |
8658 |
} |
|
8659 |
||
8660 |
void Assembler::cvtsi2sdq(XMMRegister dst, Register src) { |
|
8661 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 8662 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
8663 |
int encode = simd_prefix_and_encode(dst, dst, as_XMMRegister(src->encoding()), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8664 |
emit_int8(0x2A); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8665 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 8666 |
} |
8667 |
||
11427 | 8668 |
void Assembler::cvtsi2sdq(XMMRegister dst, Address src) { |
8669 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 8670 |
InstructionMark im(this); |
8671 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
8672 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
8673 |
simd_prefix(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8674 |
emit_int8(0x2A); |
11427 | 8675 |
emit_operand(dst, src); |
8676 |
} |
|
8677 |
||
8678 |
void Assembler::cvtsi2ssq(XMMRegister dst, Address src) { |
|
8679 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 8680 |
InstructionMark im(this); |
8681 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
8682 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
8683 |
simd_prefix(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8684 |
emit_int8(0x2A); |
11427 | 8685 |
emit_operand(dst, src); |
8686 |
} |
|
8687 |
||
1066 | 8688 |
void Assembler::cvttsd2siq(Register dst, XMMRegister src) { |
8689 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 8690 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
8691 |
int encode = simd_prefix_and_encode(as_XMMRegister(dst->encoding()), xnoreg, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8692 |
emit_int8(0x2C); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8693 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 8694 |
} |
8695 |
||
8696 |
void Assembler::cvttss2siq(Register dst, XMMRegister src) { |
|
8697 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 8698 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
8699 |
int encode = simd_prefix_and_encode(as_XMMRegister(dst->encoding()), xnoreg, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8700 |
emit_int8(0x2C); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8701 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 8702 |
} |
8703 |
||
8704 |
void Assembler::decl(Register dst) { |
|
8705 |
// Don't use it directly. Use MacroAssembler::decrementl() instead. |
|
8706 |
// Use two-byte form (one-byte form is a REX prefix in 64-bit mode) |
|
8707 |
int encode = prefix_and_encode(dst->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8708 |
emit_int8((unsigned char)0xFF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8709 |
emit_int8((unsigned char)(0xC8 | encode)); |
1066 | 8710 |
} |
8711 |
||
8712 |
void Assembler::decq(Register dst) { |
|
8713 |
// Don't use it directly. Use MacroAssembler::decrementq() instead. |
|
8714 |
// Use two-byte form (one-byte from is a REX prefix in 64-bit mode) |
|
8715 |
int encode = prefixq_and_encode(dst->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8716 |
emit_int8((unsigned char)0xFF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8717 |
emit_int8(0xC8 | encode); |
1066 | 8718 |
} |
8719 |
||
8720 |
void Assembler::decq(Address dst) { |
|
8721 |
// Don't use it directly. Use MacroAssembler::decrementq() instead. |
|
8722 |
InstructionMark im(this); |
|
8723 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8724 |
emit_int8((unsigned char)0xFF); |
1066 | 8725 |
emit_operand(rcx, dst); |
8726 |
} |
|
8727 |
||
8728 |
void Assembler::fxrstor(Address src) { |
|
8729 |
prefixq(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8730 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8731 |
emit_int8((unsigned char)0xAE); |
1066 | 8732 |
emit_operand(as_Register(1), src); |
8733 |
} |
|
8734 |
||
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
8735 |
void Assembler::xrstor(Address src) { |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
8736 |
prefixq(src); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
8737 |
emit_int8(0x0F); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
8738 |
emit_int8((unsigned char)0xAE); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
8739 |
emit_operand(as_Register(5), src); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
8740 |
} |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
8741 |
|
1066 | 8742 |
void Assembler::fxsave(Address dst) { |
8743 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8744 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8745 |
emit_int8((unsigned char)0xAE); |
1066 | 8746 |
emit_operand(as_Register(0), dst); |
8747 |
} |
|
8748 |
||
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
8749 |
void Assembler::xsave(Address dst) { |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
8750 |
prefixq(dst); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
8751 |
emit_int8(0x0F); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
8752 |
emit_int8((unsigned char)0xAE); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
8753 |
emit_operand(as_Register(4), dst); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
8754 |
} |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
8755 |
|
1066 | 8756 |
void Assembler::idivq(Register src) { |
8757 |
int encode = prefixq_and_encode(src->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8758 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8759 |
emit_int8((unsigned char)(0xF8 | encode)); |
1066 | 8760 |
} |
8761 |
||
8762 |
void Assembler::imulq(Register dst, Register src) { |
|
8763 |
int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8764 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8765 |
emit_int8((unsigned char)0xAF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8766 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 8767 |
} |
8768 |
||
8769 |
void Assembler::imulq(Register dst, Register src, int value) { |
|
8770 |
int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
|
8771 |
if (is8bit(value)) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8772 |
emit_int8(0x6B); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8773 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8774 |
emit_int8(value & 0xFF); |
1066 | 8775 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8776 |
emit_int8(0x69); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8777 |
emit_int8((unsigned char)(0xC0 | encode)); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
8778 |
emit_int32(value); |
1066 | 8779 |
} |
8780 |
} |
|
8781 |
||
21105
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
8782 |
void Assembler::imulq(Register dst, Address src) { |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
8783 |
InstructionMark im(this); |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
8784 |
prefixq(src, dst); |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
8785 |
emit_int8(0x0F); |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
8786 |
emit_int8((unsigned char) 0xAF); |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
8787 |
emit_operand(dst, src); |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
8788 |
} |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
8789 |
|
1066 | 8790 |
void Assembler::incl(Register dst) { |
8791 |
// Don't use it directly. Use MacroAssembler::incrementl() instead. |
|
8792 |
// Use two-byte form (one-byte from is a REX prefix in 64-bit mode) |
|
8793 |
int encode = prefix_and_encode(dst->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8794 |
emit_int8((unsigned char)0xFF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8795 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 8796 |
} |
8797 |
||
8798 |
void Assembler::incq(Register dst) { |
|
8799 |
// Don't use it directly. Use MacroAssembler::incrementq() instead. |
|
8800 |
// Use two-byte form (one-byte from is a REX prefix in 64-bit mode) |
|
8801 |
int encode = prefixq_and_encode(dst->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8802 |
emit_int8((unsigned char)0xFF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8803 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 8804 |
} |
8805 |
||
8806 |
void Assembler::incq(Address dst) { |
|
8807 |
// Don't use it directly. Use MacroAssembler::incrementq() instead. |
|
8808 |
InstructionMark im(this); |
|
8809 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8810 |
emit_int8((unsigned char)0xFF); |
1066 | 8811 |
emit_operand(rax, dst); |
8812 |
} |
|
8813 |
||
8814 |
void Assembler::lea(Register dst, Address src) { |
|
8815 |
leaq(dst, src); |
|
8816 |
} |
|
8817 |
||
8818 |
void Assembler::leaq(Register dst, Address src) { |
|
8819 |
InstructionMark im(this); |
|
8820 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8821 |
emit_int8((unsigned char)0x8D); |
1066 | 8822 |
emit_operand(dst, src); |
8823 |
} |
|
8824 |
||
8825 |
void Assembler::mov64(Register dst, int64_t imm64) { |
|
8826 |
InstructionMark im(this); |
|
8827 |
int encode = prefixq_and_encode(dst->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8828 |
emit_int8((unsigned char)(0xB8 | encode)); |
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
8829 |
emit_int64(imm64); |
1066 | 8830 |
} |
8831 |
||
8832 |
void Assembler::mov_literal64(Register dst, intptr_t imm64, RelocationHolder const& rspec) { |
|
8833 |
InstructionMark im(this); |
|
8834 |
int encode = prefixq_and_encode(dst->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8835 |
emit_int8(0xB8 | encode); |
1066 | 8836 |
emit_data64(imm64, rspec); |
8837 |
} |
|
8838 |
||
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8839 |
void Assembler::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
|
8840 |
InstructionMark im(this); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8841 |
int encode = prefix_and_encode(dst->encoding()); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8842 |
emit_int8((unsigned char)(0xB8 | encode)); |
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8843 |
emit_data((int)imm32, rspec, narrow_oop_operand); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8844 |
} |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8845 |
|
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8846 |
void Assembler::mov_narrow_oop(Address dst, int32_t imm32, RelocationHolder const& rspec) { |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8847 |
InstructionMark im(this); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8848 |
prefix(dst); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8849 |
emit_int8((unsigned char)0xC7); |
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8850 |
emit_operand(rax, dst, 4); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8851 |
emit_data((int)imm32, rspec, narrow_oop_operand); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8852 |
} |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8853 |
|
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8854 |
void Assembler::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
|
8855 |
InstructionMark im(this); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8856 |
int encode = prefix_and_encode(src1->encoding()); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8857 |
emit_int8((unsigned char)0x81); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8858 |
emit_int8((unsigned char)(0xF8 | encode)); |
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8859 |
emit_data((int)imm32, rspec, narrow_oop_operand); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8860 |
} |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8861 |
|
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8862 |
void Assembler::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
|
8863 |
InstructionMark im(this); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8864 |
prefix(src1); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8865 |
emit_int8((unsigned char)0x81); |
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8866 |
emit_operand(rax, src1, 4); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8867 |
emit_data((int)imm32, rspec, narrow_oop_operand); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8868 |
} |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
8869 |
|
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
8870 |
void Assembler::lzcntq(Register dst, Register src) { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
8871 |
assert(VM_Version::supports_lzcnt(), "encoding is treated as BSR"); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8872 |
emit_int8((unsigned char)0xF3); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
8873 |
int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8874 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8875 |
emit_int8((unsigned char)0xBD); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8876 |
emit_int8((unsigned char)(0xC0 | encode)); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
8877 |
} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
8878 |
|
1066 | 8879 |
void Assembler::movdq(XMMRegister dst, Register src) { |
8880 |
// table D-1 says MMX/SSE2 |
|
11427 | 8881 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 8882 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
8883 |
int encode = simd_prefix_and_encode(dst, xnoreg, as_XMMRegister(src->encoding()), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8884 |
emit_int8(0x6E); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8885 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 8886 |
} |
8887 |
||
8888 |
void Assembler::movdq(Register dst, XMMRegister src) { |
|
8889 |
// table D-1 says MMX/SSE2 |
|
11427 | 8890 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 8891 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
1066 | 8892 |
// swap src/dst to get correct prefix |
34162 | 8893 |
int encode = simd_prefix_and_encode(src, xnoreg, as_XMMRegister(dst->encoding()), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8894 |
emit_int8(0x7E); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8895 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 8896 |
} |
8897 |
||
8898 |
void Assembler::movq(Register dst, Register src) { |
|
8899 |
int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8900 |
emit_int8((unsigned char)0x8B); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8901 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 8902 |
} |
8903 |
||
8904 |
void Assembler::movq(Register dst, Address src) { |
|
8905 |
InstructionMark im(this); |
|
8906 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8907 |
emit_int8((unsigned char)0x8B); |
1066 | 8908 |
emit_operand(dst, src); |
8909 |
} |
|
8910 |
||
8911 |
void Assembler::movq(Address dst, Register src) { |
|
8912 |
InstructionMark im(this); |
|
8913 |
prefixq(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8914 |
emit_int8((unsigned char)0x89); |
1066 | 8915 |
emit_operand(src, dst); |
8916 |
} |
|
8917 |
||
2150 | 8918 |
void Assembler::movsbq(Register dst, Address src) { |
8919 |
InstructionMark im(this); |
|
8920 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8921 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8922 |
emit_int8((unsigned char)0xBE); |
2150 | 8923 |
emit_operand(dst, src); |
8924 |
} |
|
8925 |
||
8926 |
void Assembler::movsbq(Register dst, Register src) { |
|
8927 |
int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8928 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8929 |
emit_int8((unsigned char)0xBE); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8930 |
emit_int8((unsigned char)(0xC0 | encode)); |
2150 | 8931 |
} |
8932 |
||
1066 | 8933 |
void Assembler::movslq(Register dst, int32_t imm32) { |
8934 |
// dbx shows movslq(rcx, 3) as movq $0x0000000049000000,(%rbx) |
|
8935 |
// and movslq(r8, 3); as movl $0x0000000048000000,(%rbx) |
|
8936 |
// as a result we shouldn't use until tested at runtime... |
|
8937 |
ShouldNotReachHere(); |
|
8938 |
InstructionMark im(this); |
|
8939 |
int encode = prefixq_and_encode(dst->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8940 |
emit_int8((unsigned char)(0xC7 | encode)); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
8941 |
emit_int32(imm32); |
1066 | 8942 |
} |
8943 |
||
8944 |
void Assembler::movslq(Address dst, int32_t imm32) { |
|
8945 |
assert(is_simm32(imm32), "lost bits"); |
|
8946 |
InstructionMark im(this); |
|
8947 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8948 |
emit_int8((unsigned char)0xC7); |
1066 | 8949 |
emit_operand(rax, dst, 4); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
8950 |
emit_int32(imm32); |
1066 | 8951 |
} |
8952 |
||
8953 |
void Assembler::movslq(Register dst, Address src) { |
|
8954 |
InstructionMark im(this); |
|
8955 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8956 |
emit_int8(0x63); |
1066 | 8957 |
emit_operand(dst, src); |
8958 |
} |
|
8959 |
||
8960 |
void Assembler::movslq(Register dst, Register src) { |
|
8961 |
int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8962 |
emit_int8(0x63); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8963 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 8964 |
} |
8965 |
||
2150 | 8966 |
void Assembler::movswq(Register dst, Address src) { |
8967 |
InstructionMark im(this); |
|
8968 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8969 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8970 |
emit_int8((unsigned char)0xBF); |
2150 | 8971 |
emit_operand(dst, src); |
8972 |
} |
|
8973 |
||
8974 |
void Assembler::movswq(Register dst, Register src) { |
|
8975 |
int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8976 |
emit_int8((unsigned char)0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8977 |
emit_int8((unsigned char)0xBF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8978 |
emit_int8((unsigned char)(0xC0 | encode)); |
2150 | 8979 |
} |
8980 |
||
8981 |
void Assembler::movzbq(Register dst, Address src) { |
|
8982 |
InstructionMark im(this); |
|
8983 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8984 |
emit_int8((unsigned char)0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8985 |
emit_int8((unsigned char)0xB6); |
2150 | 8986 |
emit_operand(dst, src); |
8987 |
} |
|
8988 |
||
8989 |
void Assembler::movzbq(Register dst, Register src) { |
|
8990 |
int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8991 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8992 |
emit_int8((unsigned char)0xB6); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8993 |
emit_int8(0xC0 | encode); |
2150 | 8994 |
} |
8995 |
||
8996 |
void Assembler::movzwq(Register dst, Address src) { |
|
8997 |
InstructionMark im(this); |
|
8998 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8999 |
emit_int8((unsigned char)0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9000 |
emit_int8((unsigned char)0xB7); |
2150 | 9001 |
emit_operand(dst, src); |
9002 |
} |
|
9003 |
||
9004 |
void Assembler::movzwq(Register dst, Register src) { |
|
9005 |
int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9006 |
emit_int8((unsigned char)0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9007 |
emit_int8((unsigned char)0xB7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9008 |
emit_int8((unsigned char)(0xC0 | encode)); |
2150 | 9009 |
} |
9010 |
||
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9011 |
void Assembler::mulq(Address src) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9012 |
InstructionMark im(this); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9013 |
prefixq(src); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9014 |
emit_int8((unsigned char)0xF7); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9015 |
emit_operand(rsp, src); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9016 |
} |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9017 |
|
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9018 |
void Assembler::mulq(Register src) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9019 |
int encode = prefixq_and_encode(src->encoding()); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9020 |
emit_int8((unsigned char)0xF7); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9021 |
emit_int8((unsigned char)(0xE0 | encode)); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9022 |
} |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9023 |
|
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9024 |
void Assembler::mulxq(Register dst1, Register dst2, Register src) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9025 |
assert(VM_Version::supports_bmi2(), "bit manipulation instructions not supported"); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
9026 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 9027 |
int encode = vex_prefix_and_encode(dst1->encoding(), dst2->encoding(), src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F_38, &attributes); |
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9028 |
emit_int8((unsigned char)0xF6); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9029 |
emit_int8((unsigned char)(0xC0 | encode)); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9030 |
} |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9031 |
|
1066 | 9032 |
void Assembler::negq(Register dst) { |
9033 |
int encode = prefixq_and_encode(dst->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9034 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9035 |
emit_int8((unsigned char)(0xD8 | encode)); |
1066 | 9036 |
} |
9037 |
||
9038 |
void Assembler::notq(Register dst) { |
|
9039 |
int encode = prefixq_and_encode(dst->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9040 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9041 |
emit_int8((unsigned char)(0xD0 | encode)); |
1066 | 9042 |
} |
9043 |
||
9044 |
void Assembler::orq(Address dst, int32_t imm32) { |
|
9045 |
InstructionMark im(this); |
|
9046 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9047 |
emit_int8((unsigned char)0x81); |
1066 | 9048 |
emit_operand(rcx, dst, 4); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
9049 |
emit_int32(imm32); |
1066 | 9050 |
} |
9051 |
||
9052 |
void Assembler::orq(Register dst, int32_t imm32) { |
|
9053 |
(void) prefixq_and_encode(dst->encoding()); |
|
9054 |
emit_arith(0x81, 0xC8, dst, imm32); |
|
9055 |
} |
|
9056 |
||
9057 |
void Assembler::orq(Register dst, Address src) { |
|
9058 |
InstructionMark im(this); |
|
9059 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9060 |
emit_int8(0x0B); |
1066 | 9061 |
emit_operand(dst, src); |
9062 |
} |
|
9063 |
||
9064 |
void Assembler::orq(Register dst, Register src) { |
|
9065 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
9066 |
emit_arith(0x0B, 0xC0, dst, src); |
|
9067 |
} |
|
9068 |
||
9069 |
void Assembler::popa() { // 64bit |
|
9070 |
movq(r15, Address(rsp, 0)); |
|
9071 |
movq(r14, Address(rsp, wordSize)); |
|
9072 |
movq(r13, Address(rsp, 2 * wordSize)); |
|
9073 |
movq(r12, Address(rsp, 3 * wordSize)); |
|
9074 |
movq(r11, Address(rsp, 4 * wordSize)); |
|
9075 |
movq(r10, Address(rsp, 5 * wordSize)); |
|
9076 |
movq(r9, Address(rsp, 6 * wordSize)); |
|
9077 |
movq(r8, Address(rsp, 7 * wordSize)); |
|
9078 |
movq(rdi, Address(rsp, 8 * wordSize)); |
|
9079 |
movq(rsi, Address(rsp, 9 * wordSize)); |
|
9080 |
movq(rbp, Address(rsp, 10 * wordSize)); |
|
9081 |
// skip rsp |
|
9082 |
movq(rbx, Address(rsp, 12 * wordSize)); |
|
9083 |
movq(rdx, Address(rsp, 13 * wordSize)); |
|
9084 |
movq(rcx, Address(rsp, 14 * wordSize)); |
|
9085 |
movq(rax, Address(rsp, 15 * wordSize)); |
|
9086 |
||
9087 |
addq(rsp, 16 * wordSize); |
|
9088 |
} |
|
9089 |
||
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
9090 |
void Assembler::popcntq(Register dst, Address src) { |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
9091 |
assert(VM_Version::supports_popcnt(), "must support"); |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
9092 |
InstructionMark im(this); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9093 |
emit_int8((unsigned char)0xF3); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
9094 |
prefixq(src, dst); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9095 |
emit_int8((unsigned char)0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9096 |
emit_int8((unsigned char)0xB8); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
9097 |
emit_operand(dst, src); |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
9098 |
} |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
9099 |
|
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
9100 |
void Assembler::popcntq(Register dst, Register src) { |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
9101 |
assert(VM_Version::supports_popcnt(), "must support"); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9102 |
emit_int8((unsigned char)0xF3); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
9103 |
int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9104 |
emit_int8((unsigned char)0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9105 |
emit_int8((unsigned char)0xB8); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9106 |
emit_int8((unsigned char)(0xC0 | encode)); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
9107 |
} |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
9108 |
|
1066 | 9109 |
void Assembler::popq(Address dst) { |
9110 |
InstructionMark im(this); |
|
9111 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9112 |
emit_int8((unsigned char)0x8F); |
1066 | 9113 |
emit_operand(rax, dst); |
9114 |
} |
|
9115 |
||
9116 |
void Assembler::pusha() { // 64bit |
|
9117 |
// we have to store original rsp. ABI says that 128 bytes |
|
9118 |
// below rsp are local scratch. |
|
9119 |
movq(Address(rsp, -5 * wordSize), rsp); |
|
9120 |
||
9121 |
subq(rsp, 16 * wordSize); |
|
9122 |
||
9123 |
movq(Address(rsp, 15 * wordSize), rax); |
|
9124 |
movq(Address(rsp, 14 * wordSize), rcx); |
|
9125 |
movq(Address(rsp, 13 * wordSize), rdx); |
|
9126 |
movq(Address(rsp, 12 * wordSize), rbx); |
|
9127 |
// skip rsp |
|
9128 |
movq(Address(rsp, 10 * wordSize), rbp); |
|
9129 |
movq(Address(rsp, 9 * wordSize), rsi); |
|
9130 |
movq(Address(rsp, 8 * wordSize), rdi); |
|
9131 |
movq(Address(rsp, 7 * wordSize), r8); |
|
9132 |
movq(Address(rsp, 6 * wordSize), r9); |
|
9133 |
movq(Address(rsp, 5 * wordSize), r10); |
|
9134 |
movq(Address(rsp, 4 * wordSize), r11); |
|
9135 |
movq(Address(rsp, 3 * wordSize), r12); |
|
9136 |
movq(Address(rsp, 2 * wordSize), r13); |
|
9137 |
movq(Address(rsp, wordSize), r14); |
|
9138 |
movq(Address(rsp, 0), r15); |
|
9139 |
} |
|
9140 |
||
9141 |
void Assembler::pushq(Address src) { |
|
9142 |
InstructionMark im(this); |
|
9143 |
prefixq(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9144 |
emit_int8((unsigned char)0xFF); |
1066 | 9145 |
emit_operand(rsi, src); |
9146 |
} |
|
9147 |
||
9148 |
void Assembler::rclq(Register dst, int imm8) { |
|
9149 |
assert(isShiftCount(imm8 >> 1), "illegal shift count"); |
|
9150 |
int encode = prefixq_and_encode(dst->encoding()); |
|
9151 |
if (imm8 == 1) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9152 |
emit_int8((unsigned char)0xD1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9153 |
emit_int8((unsigned char)(0xD0 | encode)); |
1066 | 9154 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9155 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9156 |
emit_int8((unsigned char)(0xD0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9157 |
emit_int8(imm8); |
1066 | 9158 |
} |
9159 |
} |
|
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9160 |
|
31129
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
9161 |
void Assembler::rcrq(Register dst, int imm8) { |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
9162 |
assert(isShiftCount(imm8 >> 1), "illegal shift count"); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
9163 |
int encode = prefixq_and_encode(dst->encoding()); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
9164 |
if (imm8 == 1) { |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
9165 |
emit_int8((unsigned char)0xD1); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
9166 |
emit_int8((unsigned char)(0xD8 | encode)); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
9167 |
} else { |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
9168 |
emit_int8((unsigned char)0xC1); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
9169 |
emit_int8((unsigned char)(0xD8 | encode)); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
9170 |
emit_int8(imm8); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
9171 |
} |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
9172 |
} |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
9173 |
|
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9174 |
void Assembler::rorq(Register dst, int imm8) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9175 |
assert(isShiftCount(imm8 >> 1), "illegal shift count"); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9176 |
int encode = prefixq_and_encode(dst->encoding()); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9177 |
if (imm8 == 1) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9178 |
emit_int8((unsigned char)0xD1); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9179 |
emit_int8((unsigned char)(0xC8 | encode)); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9180 |
} else { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9181 |
emit_int8((unsigned char)0xC1); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9182 |
emit_int8((unsigned char)(0xc8 | encode)); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9183 |
emit_int8(imm8); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9184 |
} |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9185 |
} |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9186 |
|
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9187 |
void Assembler::rorxq(Register dst, Register src, int imm8) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9188 |
assert(VM_Version::supports_bmi2(), "bit manipulation instructions not supported"); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
9189 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 9190 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F_3A, &attributes); |
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9191 |
emit_int8((unsigned char)0xF0); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9192 |
emit_int8((unsigned char)(0xC0 | encode)); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9193 |
emit_int8(imm8); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9194 |
} |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
9195 |
|
38135
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
9196 |
void Assembler::rorxd(Register dst, Register src, int imm8) { |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
9197 |
assert(VM_Version::supports_bmi2(), "bit manipulation instructions not supported"); |
48194
09b7b32b244f
8190494: Different results with UseAVX=3 when calling AVX-512 native function via JNI
vdeshpande
parents:
48089
diff
changeset
|
9198 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
38135
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
9199 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F_3A, &attributes); |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
9200 |
emit_int8((unsigned char)0xF0); |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
9201 |
emit_int8((unsigned char)(0xC0 | encode)); |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
9202 |
emit_int8(imm8); |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
9203 |
} |
e06e2d071465
8154495: SHA256 AVX2 intrinsic (when no supports_sha() available)
jcivlin
parents:
38134
diff
changeset
|
9204 |
|
1066 | 9205 |
void Assembler::sarq(Register dst, int imm8) { |
9206 |
assert(isShiftCount(imm8 >> 1), "illegal shift count"); |
|
9207 |
int encode = prefixq_and_encode(dst->encoding()); |
|
9208 |
if (imm8 == 1) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9209 |
emit_int8((unsigned char)0xD1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9210 |
emit_int8((unsigned char)(0xF8 | encode)); |
1066 | 9211 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9212 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9213 |
emit_int8((unsigned char)(0xF8 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9214 |
emit_int8(imm8); |
1066 | 9215 |
} |
9216 |
} |
|
9217 |
||
9218 |
void Assembler::sarq(Register dst) { |
|
9219 |
int encode = prefixq_and_encode(dst->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9220 |
emit_int8((unsigned char)0xD3); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9221 |
emit_int8((unsigned char)(0xF8 | encode)); |
1066 | 9222 |
} |
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
9223 |
|
1066 | 9224 |
void Assembler::sbbq(Address dst, int32_t imm32) { |
9225 |
InstructionMark im(this); |
|
9226 |
prefixq(dst); |
|
9227 |
emit_arith_operand(0x81, rbx, dst, imm32); |
|
9228 |
} |
|
9229 |
||
9230 |
void Assembler::sbbq(Register dst, int32_t imm32) { |
|
9231 |
(void) prefixq_and_encode(dst->encoding()); |
|
9232 |
emit_arith(0x81, 0xD8, dst, imm32); |
|
9233 |
} |
|
9234 |
||
9235 |
void Assembler::sbbq(Register dst, Address src) { |
|
9236 |
InstructionMark im(this); |
|
9237 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9238 |
emit_int8(0x1B); |
1066 | 9239 |
emit_operand(dst, src); |
9240 |
} |
|
9241 |
||
9242 |
void Assembler::sbbq(Register dst, Register src) { |
|
9243 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
9244 |
emit_arith(0x1B, 0xC0, dst, src); |
|
9245 |
} |
|
9246 |
||
9247 |
void Assembler::shlq(Register dst, int imm8) { |
|
9248 |
assert(isShiftCount(imm8 >> 1), "illegal shift count"); |
|
9249 |
int encode = prefixq_and_encode(dst->encoding()); |
|
9250 |
if (imm8 == 1) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9251 |
emit_int8((unsigned char)0xD1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9252 |
emit_int8((unsigned char)(0xE0 | encode)); |
1066 | 9253 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9254 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9255 |
emit_int8((unsigned char)(0xE0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9256 |
emit_int8(imm8); |
1066 | 9257 |
} |
9258 |
} |
|
9259 |
||
9260 |
void Assembler::shlq(Register dst) { |
|
9261 |
int encode = prefixq_and_encode(dst->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9262 |
emit_int8((unsigned char)0xD3); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9263 |
emit_int8((unsigned char)(0xE0 | encode)); |
1066 | 9264 |
} |
9265 |
||
9266 |
void Assembler::shrq(Register dst, int imm8) { |
|
9267 |
assert(isShiftCount(imm8 >> 1), "illegal shift count"); |
|
9268 |
int encode = prefixq_and_encode(dst->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9269 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9270 |
emit_int8((unsigned char)(0xE8 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9271 |
emit_int8(imm8); |
1066 | 9272 |
} |
9273 |
||
9274 |
void Assembler::shrq(Register dst) { |
|
9275 |
int encode = prefixq_and_encode(dst->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9276 |
emit_int8((unsigned char)0xD3); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9277 |
emit_int8(0xE8 | encode); |
1066 | 9278 |
} |
9279 |
||
9280 |
void Assembler::subq(Address dst, int32_t imm32) { |
|
9281 |
InstructionMark im(this); |
|
9282 |
prefixq(dst); |
|
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
9283 |
emit_arith_operand(0x81, rbp, dst, imm32); |
1066 | 9284 |
} |
9285 |
||
9286 |
void Assembler::subq(Address dst, Register src) { |
|
9287 |
InstructionMark im(this); |
|
9288 |
prefixq(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9289 |
emit_int8(0x29); |
1066 | 9290 |
emit_operand(src, dst); |
9291 |
} |
|
9292 |
||
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
9293 |
void Assembler::subq(Register dst, int32_t imm32) { |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
9294 |
(void) prefixq_and_encode(dst->encoding()); |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
9295 |
emit_arith(0x81, 0xE8, dst, imm32); |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
9296 |
} |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
9297 |
|
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
9298 |
// 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:
11438
diff
changeset
|
9299 |
void Assembler::subq_imm32(Register dst, int32_t imm32) { |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
9300 |
(void) prefixq_and_encode(dst->encoding()); |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
9301 |
emit_arith_imm32(0x81, 0xE8, dst, imm32); |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
9302 |
} |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
9303 |
|
1066 | 9304 |
void Assembler::subq(Register dst, Address src) { |
9305 |
InstructionMark im(this); |
|
9306 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9307 |
emit_int8(0x2B); |
1066 | 9308 |
emit_operand(dst, src); |
9309 |
} |
|
9310 |
||
9311 |
void Assembler::subq(Register dst, Register src) { |
|
9312 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
9313 |
emit_arith(0x2B, 0xC0, dst, src); |
|
9314 |
} |
|
9315 |
||
9316 |
void Assembler::testq(Register dst, int32_t imm32) { |
|
9317 |
// not using emit_arith because test |
|
9318 |
// doesn't support sign-extension of |
|
9319 |
// 8bit operands |
|
9320 |
int encode = dst->encoding(); |
|
9321 |
if (encode == 0) { |
|
9322 |
prefix(REX_W); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9323 |
emit_int8((unsigned char)0xA9); |
1066 | 9324 |
} else { |
9325 |
encode = prefixq_and_encode(encode); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9326 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9327 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 9328 |
} |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
9329 |
emit_int32(imm32); |
1066 | 9330 |
} |
9331 |
||
9332 |
void Assembler::testq(Register dst, Register src) { |
|
9333 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
9334 |
emit_arith(0x85, 0xC0, dst, src); |
|
9335 |
} |
|
9336 |
||
50103
b99e90f885bf
8202993: Add support for x86 testptr/testq with register and address
pliden
parents:
49982
diff
changeset
|
9337 |
void Assembler::testq(Register dst, Address src) { |
b99e90f885bf
8202993: Add support for x86 testptr/testq with register and address
pliden
parents:
49982
diff
changeset
|
9338 |
InstructionMark im(this); |
b99e90f885bf
8202993: Add support for x86 testptr/testq with register and address
pliden
parents:
49982
diff
changeset
|
9339 |
prefixq(src, dst); |
b99e90f885bf
8202993: Add support for x86 testptr/testq with register and address
pliden
parents:
49982
diff
changeset
|
9340 |
emit_int8((unsigned char)0x85); |
b99e90f885bf
8202993: Add support for x86 testptr/testq with register and address
pliden
parents:
49982
diff
changeset
|
9341 |
emit_operand(dst, src); |
b99e90f885bf
8202993: Add support for x86 testptr/testq with register and address
pliden
parents:
49982
diff
changeset
|
9342 |
} |
b99e90f885bf
8202993: Add support for x86 testptr/testq with register and address
pliden
parents:
49982
diff
changeset
|
9343 |
|
1066 | 9344 |
void Assembler::xaddq(Address dst, Register src) { |
9345 |
InstructionMark im(this); |
|
9346 |
prefixq(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9347 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9348 |
emit_int8((unsigned char)0xC1); |
1066 | 9349 |
emit_operand(src, dst); |
9350 |
} |
|
9351 |
||
9352 |
void Assembler::xchgq(Register dst, Address src) { |
|
9353 |
InstructionMark im(this); |
|
9354 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9355 |
emit_int8((unsigned char)0x87); |
1066 | 9356 |
emit_operand(dst, src); |
9357 |
} |
|
9358 |
||
9359 |
void Assembler::xchgq(Register dst, Register src) { |
|
9360 |
int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9361 |
emit_int8((unsigned char)0x87); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9362 |
emit_int8((unsigned char)(0xc0 | encode)); |
1066 | 9363 |
} |
9364 |
||
9365 |
void Assembler::xorq(Register dst, Register src) { |
|
9366 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
9367 |
emit_arith(0x33, 0xC0, dst, src); |
|
9368 |
} |
|
9369 |
||
9370 |
void Assembler::xorq(Register dst, Address src) { |
|
9371 |
InstructionMark im(this); |
|
9372 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
9373 |
emit_int8(0x33); |
1066 | 9374 |
emit_operand(dst, src); |
9375 |
} |
|
9376 |
||
9377 |
#endif // !LP64 |