author | kvn |
Mon, 28 Dec 2015 23:11:01 -0800 | |
changeset 35154 | a9b3c1984a01 |
parent 35146 | 9ebfec283f56 |
child 35540 | e001ad24dcdb |
permissions | -rw-r--r-- |
1 | 1 |
/* |
30764 | 2 |
* Copyright (c) 1997, 2015, 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" |
30764 | 28 |
#include "gc/shared/cardTableModRefBS.hpp" |
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/interfaceSupport.hpp" |
|
35 |
#include "runtime/objectMonitor.hpp" |
|
36 |
#include "runtime/os.hpp" |
|
37 |
#include "runtime/sharedRuntime.hpp" |
|
38 |
#include "runtime/stubRoutines.hpp" |
|
15482
470d0b0c09f1
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
15117
diff
changeset
|
39 |
#include "utilities/macros.hpp" |
470d0b0c09f1
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
15117
diff
changeset
|
40 |
#if INCLUDE_ALL_GCS |
30764 | 41 |
#include "gc/g1/g1CollectedHeap.inline.hpp" |
42 |
#include "gc/g1/g1SATBCardTableModRefBS.hpp" |
|
43 |
#include "gc/g1/heapRegion.hpp" |
|
15482
470d0b0c09f1
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
15117
diff
changeset
|
44 |
#endif // INCLUDE_ALL_GCS |
1 | 45 |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
46 |
#ifdef PRODUCT |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
47 |
#define BLOCK_COMMENT(str) /* nothing */ |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
48 |
#define STOP(error) stop(error) |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
49 |
#else |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
50 |
#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
|
51 |
#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
|
52 |
#endif |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
53 |
|
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
54 |
#define BIND(label) bind(label); BLOCK_COMMENT(#label ":") |
1 | 55 |
// Implementation of AddressLiteral |
56 |
||
30624 | 57 |
// A 2-D table for managing compressed displacement(disp8) on EVEX enabled platforms. |
58 |
unsigned char tuple_table[Assembler::EVEX_ETUP + 1][Assembler::AVX_512bit + 1] = { |
|
59 |
// -----------------Table 4.5 -------------------- // |
|
60 |
16, 32, 64, // EVEX_FV(0) |
|
61 |
4, 4, 4, // EVEX_FV(1) - with Evex.b |
|
62 |
16, 32, 64, // EVEX_FV(2) - with Evex.w |
|
63 |
8, 8, 8, // EVEX_FV(3) - with Evex.w and Evex.b |
|
64 |
8, 16, 32, // EVEX_HV(0) |
|
65 |
4, 4, 4, // EVEX_HV(1) - with Evex.b |
|
66 |
// -----------------Table 4.6 -------------------- // |
|
67 |
16, 32, 64, // EVEX_FVM(0) |
|
68 |
1, 1, 1, // EVEX_T1S(0) |
|
69 |
2, 2, 2, // EVEX_T1S(1) |
|
70 |
4, 4, 4, // EVEX_T1S(2) |
|
71 |
8, 8, 8, // EVEX_T1S(3) |
|
72 |
4, 4, 4, // EVEX_T1F(0) |
|
73 |
8, 8, 8, // EVEX_T1F(1) |
|
74 |
8, 8, 8, // EVEX_T2(0) |
|
75 |
0, 16, 16, // EVEX_T2(1) |
|
76 |
0, 16, 16, // EVEX_T4(0) |
|
77 |
0, 0, 32, // EVEX_T4(1) |
|
78 |
0, 0, 32, // EVEX_T8(0) |
|
79 |
8, 16, 32, // EVEX_HVM(0) |
|
80 |
4, 8, 16, // EVEX_QVM(0) |
|
81 |
2, 4, 8, // EVEX_OVM(0) |
|
82 |
16, 16, 16, // EVEX_M128(0) |
|
83 |
8, 32, 64, // EVEX_DUP(0) |
|
84 |
0, 0, 0 // EVEX_NTUP |
|
85 |
}; |
|
86 |
||
1 | 87 |
AddressLiteral::AddressLiteral(address target, relocInfo::relocType rtype) { |
88 |
_is_lval = false; |
|
89 |
_target = target; |
|
90 |
switch (rtype) { |
|
91 |
case relocInfo::oop_type: |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13485
diff
changeset
|
92 |
case relocInfo::metadata_type: |
1 | 93 |
// Oops are a special case. Normally they would be their own section |
94 |
// but in cases like icBuffer they are literals in the code stream that |
|
95 |
// we don't have a section for. We use none so that we get a literal address |
|
96 |
// which is always patchable. |
|
97 |
break; |
|
98 |
case relocInfo::external_word_type: |
|
99 |
_rspec = external_word_Relocation::spec(target); |
|
100 |
break; |
|
101 |
case relocInfo::internal_word_type: |
|
102 |
_rspec = internal_word_Relocation::spec(target); |
|
103 |
break; |
|
104 |
case relocInfo::opt_virtual_call_type: |
|
105 |
_rspec = opt_virtual_call_Relocation::spec(); |
|
106 |
break; |
|
107 |
case relocInfo::static_call_type: |
|
108 |
_rspec = static_call_Relocation::spec(); |
|
109 |
break; |
|
110 |
case relocInfo::runtime_call_type: |
|
111 |
_rspec = runtime_call_Relocation::spec(); |
|
112 |
break; |
|
113 |
case relocInfo::poll_type: |
|
114 |
case relocInfo::poll_return_type: |
|
115 |
_rspec = Relocation::spec_simple(rtype); |
|
116 |
break; |
|
117 |
case relocInfo::none: |
|
118 |
break; |
|
119 |
default: |
|
120 |
ShouldNotReachHere(); |
|
121 |
break; |
|
122 |
} |
|
123 |
} |
|
124 |
||
125 |
// Implementation of Address |
|
126 |
||
1066 | 127 |
#ifdef _LP64 |
128 |
||
1 | 129 |
Address Address::make_array(ArrayAddress adr) { |
130 |
// Not implementable on 64bit machines |
|
131 |
// Should have been handled higher up the call chain. |
|
132 |
ShouldNotReachHere(); |
|
1066 | 133 |
return Address(); |
134 |
} |
|
135 |
||
136 |
// exceedingly dangerous constructor |
|
137 |
Address::Address(int disp, address loc, relocInfo::relocType rtype) { |
|
138 |
_base = noreg; |
|
139 |
_index = noreg; |
|
140 |
_scale = no_scale; |
|
141 |
_disp = disp; |
|
142 |
switch (rtype) { |
|
143 |
case relocInfo::external_word_type: |
|
144 |
_rspec = external_word_Relocation::spec(loc); |
|
145 |
break; |
|
146 |
case relocInfo::internal_word_type: |
|
147 |
_rspec = internal_word_Relocation::spec(loc); |
|
148 |
break; |
|
149 |
case relocInfo::runtime_call_type: |
|
150 |
// HMM |
|
151 |
_rspec = runtime_call_Relocation::spec(); |
|
152 |
break; |
|
153 |
case relocInfo::poll_type: |
|
154 |
case relocInfo::poll_return_type: |
|
155 |
_rspec = Relocation::spec_simple(rtype); |
|
156 |
break; |
|
157 |
case relocInfo::none: |
|
158 |
break; |
|
159 |
default: |
|
160 |
ShouldNotReachHere(); |
|
161 |
} |
|
162 |
} |
|
163 |
#else // LP64 |
|
164 |
||
165 |
Address Address::make_array(ArrayAddress adr) { |
|
1 | 166 |
AddressLiteral base = adr.base(); |
167 |
Address index = adr.index(); |
|
168 |
assert(index._disp == 0, "must not have disp"); // maybe it can? |
|
169 |
Address array(index._base, index._index, index._scale, (intptr_t) base.target()); |
|
170 |
array._rspec = base._rspec; |
|
171 |
return array; |
|
1066 | 172 |
} |
1 | 173 |
|
174 |
// exceedingly dangerous constructor |
|
175 |
Address::Address(address loc, RelocationHolder spec) { |
|
176 |
_base = noreg; |
|
177 |
_index = noreg; |
|
178 |
_scale = no_scale; |
|
179 |
_disp = (intptr_t) loc; |
|
180 |
_rspec = spec; |
|
181 |
} |
|
1066 | 182 |
|
1 | 183 |
#endif // _LP64 |
184 |
||
1066 | 185 |
|
186 |
||
1 | 187 |
// Convert the raw encoding form into the form expected by the constructor for |
188 |
// Address. An index of 4 (rsp) corresponds to having no index, so convert |
|
189 |
// that to noreg for the Address constructor. |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13485
diff
changeset
|
190 |
Address Address::make_raw(int base, int index, int scale, int disp, relocInfo::relocType disp_reloc) { |
2150 | 191 |
RelocationHolder rspec; |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13485
diff
changeset
|
192 |
if (disp_reloc != relocInfo::none) { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13485
diff
changeset
|
193 |
rspec = Relocation::spec_simple(disp_reloc); |
2150 | 194 |
} |
1 | 195 |
bool valid_index = index != rsp->encoding(); |
196 |
if (valid_index) { |
|
197 |
Address madr(as_Register(base), as_Register(index), (Address::ScaleFactor)scale, in_ByteSize(disp)); |
|
2150 | 198 |
madr._rspec = rspec; |
1 | 199 |
return madr; |
200 |
} else { |
|
201 |
Address madr(as_Register(base), noreg, Address::no_scale, in_ByteSize(disp)); |
|
2150 | 202 |
madr._rspec = rspec; |
1 | 203 |
return madr; |
204 |
} |
|
205 |
} |
|
206 |
||
207 |
// Implementation of Assembler |
|
208 |
||
209 |
int AbstractAssembler::code_fill_byte() { |
|
210 |
return (u_char)'\xF4'; // hlt |
|
211 |
} |
|
212 |
||
213 |
// make this go away someday |
|
214 |
void Assembler::emit_data(jint data, relocInfo::relocType rtype, int format) { |
|
215 |
if (rtype == relocInfo::none) |
|
30624 | 216 |
emit_int32(data); |
217 |
else |
|
218 |
emit_data(data, Relocation::spec_simple(rtype), format); |
|
1 | 219 |
} |
220 |
||
221 |
void Assembler::emit_data(jint data, RelocationHolder const& rspec, int format) { |
|
1066 | 222 |
assert(imm_operand == 0, "default format must be immediate in this file"); |
1 | 223 |
assert(inst_mark() != NULL, "must be inside InstructionMark"); |
224 |
if (rspec.type() != relocInfo::none) { |
|
225 |
#ifdef ASSERT |
|
226 |
check_relocation(rspec, format); |
|
227 |
#endif |
|
228 |
// Do not use AbstractAssembler::relocate, which is not intended for |
|
229 |
// embedded words. Instead, relocate to the enclosing instruction. |
|
230 |
||
231 |
// hack. call32 is too wide for mask so use disp32 |
|
232 |
if (format == call32_operand) |
|
233 |
code_section()->relocate(inst_mark(), rspec, disp32_operand); |
|
234 |
else |
|
235 |
code_section()->relocate(inst_mark(), rspec, format); |
|
236 |
} |
|
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
237 |
emit_int32(data); |
1 | 238 |
} |
239 |
||
1066 | 240 |
static int encode(Register r) { |
241 |
int enc = r->encoding(); |
|
242 |
if (enc >= 8) { |
|
243 |
enc -= 8; |
|
244 |
} |
|
245 |
return enc; |
|
246 |
} |
|
247 |
||
1 | 248 |
void Assembler::emit_arith_b(int op1, int op2, Register dst, int imm8) { |
249 |
assert(dst->has_byte_register(), "must have byte register"); |
|
250 |
assert(isByte(op1) && isByte(op2), "wrong opcode"); |
|
251 |
assert(isByte(imm8), "not a byte"); |
|
252 |
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
|
253 |
emit_int8(op1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
254 |
emit_int8(op2 | encode(dst)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
255 |
emit_int8(imm8); |
1 | 256 |
} |
257 |
||
258 |
||
1066 | 259 |
void Assembler::emit_arith(int op1, int op2, Register dst, int32_t imm32) { |
1 | 260 |
assert(isByte(op1) && isByte(op2), "wrong opcode"); |
261 |
assert((op1 & 0x01) == 1, "should be 32bit operation"); |
|
262 |
assert((op1 & 0x02) == 0, "sign-extension bit should not be set"); |
|
263 |
if (is8bit(imm32)) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
264 |
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
|
265 |
emit_int8(op2 | encode(dst)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
266 |
emit_int8(imm32 & 0xFF); |
1 | 267 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
268 |
emit_int8(op1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
269 |
emit_int8(op2 | encode(dst)); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
270 |
emit_int32(imm32); |
1 | 271 |
} |
272 |
} |
|
273 |
||
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
274 |
// 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
|
275 |
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
|
276 |
assert(isByte(op1) && isByte(op2), "wrong opcode"); |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
277 |
assert((op1 & 0x01) == 1, "should be 32bit operation"); |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
278 |
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
|
279 |
emit_int8(op1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
280 |
emit_int8(op2 | encode(dst)); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
281 |
emit_int32(imm32); |
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
282 |
} |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
283 |
|
1 | 284 |
// immediate-to-memory forms |
1066 | 285 |
void Assembler::emit_arith_operand(int op1, Register rm, Address adr, int32_t imm32) { |
1 | 286 |
assert((op1 & 0x01) == 1, "should be 32bit operation"); |
287 |
assert((op1 & 0x02) == 0, "sign-extension bit should not be set"); |
|
288 |
if (is8bit(imm32)) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
289 |
emit_int8(op1 | 0x02); // set sign bit |
1066 | 290 |
emit_operand(rm, adr, 1); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
291 |
emit_int8(imm32 & 0xFF); |
1 | 292 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
293 |
emit_int8(op1); |
1066 | 294 |
emit_operand(rm, adr, 4); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
295 |
emit_int32(imm32); |
1 | 296 |
} |
297 |
} |
|
298 |
||
299 |
||
300 |
void Assembler::emit_arith(int op1, int op2, Register dst, Register src) { |
|
301 |
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
|
302 |
emit_int8(op1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
303 |
emit_int8(op2 | encode(dst) << 3 | encode(src)); |
1066 | 304 |
} |
305 |
||
306 |
||
30624 | 307 |
bool Assembler::query_compressed_disp_byte(int disp, bool is_evex_inst, int vector_len, |
308 |
int cur_tuple_type, int in_size_in_bits, int cur_encoding) { |
|
309 |
int mod_idx = 0; |
|
310 |
// We will test if the displacement fits the compressed format and if so |
|
311 |
// apply the compression to the displacment iff the result is8bit. |
|
312 |
if (VM_Version::supports_evex() && is_evex_inst) { |
|
313 |
switch (cur_tuple_type) { |
|
314 |
case EVEX_FV: |
|
315 |
if ((cur_encoding & VEX_W) == VEX_W) { |
|
34162 | 316 |
mod_idx = ((cur_encoding & EVEX_Rb) == EVEX_Rb) ? 3 : 2; |
30624 | 317 |
} else { |
318 |
mod_idx = ((cur_encoding & EVEX_Rb) == EVEX_Rb) ? 1 : 0; |
|
319 |
} |
|
320 |
break; |
|
321 |
||
322 |
case EVEX_HV: |
|
323 |
mod_idx = ((cur_encoding & EVEX_Rb) == EVEX_Rb) ? 1 : 0; |
|
324 |
break; |
|
325 |
||
326 |
case EVEX_FVM: |
|
327 |
break; |
|
328 |
||
329 |
case EVEX_T1S: |
|
330 |
switch (in_size_in_bits) { |
|
331 |
case EVEX_8bit: |
|
332 |
break; |
|
333 |
||
334 |
case EVEX_16bit: |
|
335 |
mod_idx = 1; |
|
336 |
break; |
|
337 |
||
338 |
case EVEX_32bit: |
|
339 |
mod_idx = 2; |
|
340 |
break; |
|
341 |
||
342 |
case EVEX_64bit: |
|
343 |
mod_idx = 3; |
|
344 |
break; |
|
345 |
} |
|
346 |
break; |
|
347 |
||
348 |
case EVEX_T1F: |
|
349 |
case EVEX_T2: |
|
350 |
case EVEX_T4: |
|
351 |
mod_idx = (in_size_in_bits == EVEX_64bit) ? 1 : 0; |
|
352 |
break; |
|
353 |
||
354 |
case EVEX_T8: |
|
355 |
break; |
|
356 |
||
357 |
case EVEX_HVM: |
|
358 |
break; |
|
359 |
||
360 |
case EVEX_QVM: |
|
361 |
break; |
|
362 |
||
363 |
case EVEX_OVM: |
|
364 |
break; |
|
365 |
||
366 |
case EVEX_M128: |
|
367 |
break; |
|
368 |
||
369 |
case EVEX_DUP: |
|
370 |
break; |
|
371 |
||
372 |
default: |
|
373 |
assert(0, "no valid evex tuple_table entry"); |
|
374 |
break; |
|
375 |
} |
|
376 |
||
377 |
if (vector_len >= AVX_128bit && vector_len <= AVX_512bit) { |
|
378 |
int disp_factor = tuple_table[cur_tuple_type + mod_idx][vector_len]; |
|
379 |
if ((disp % disp_factor) == 0) { |
|
380 |
int new_disp = disp / disp_factor; |
|
381 |
if ((-0x80 <= new_disp && new_disp < 0x80)) { |
|
382 |
disp = new_disp; |
|
383 |
} |
|
384 |
} else { |
|
385 |
return false; |
|
386 |
} |
|
387 |
} |
|
388 |
} |
|
389 |
return (-0x80 <= disp && disp < 0x80); |
|
390 |
} |
|
391 |
||
392 |
||
393 |
bool Assembler::emit_compressed_disp_byte(int &disp) { |
|
394 |
int mod_idx = 0; |
|
395 |
// We will test if the displacement fits the compressed format and if so |
|
396 |
// apply the compression to the displacment iff the result is8bit. |
|
34162 | 397 |
if (VM_Version::supports_evex() && (_attributes != NULL) && _attributes->is_evex_instruction()) { |
398 |
int evex_encoding = _attributes->get_evex_encoding(); |
|
399 |
int tuple_type = _attributes->get_tuple_type(); |
|
400 |
switch (tuple_type) { |
|
30624 | 401 |
case EVEX_FV: |
34162 | 402 |
if ((evex_encoding & VEX_W) == VEX_W) { |
403 |
mod_idx = ((evex_encoding & EVEX_Rb) == EVEX_Rb) ? 3 : 2; |
|
30624 | 404 |
} else { |
34162 | 405 |
mod_idx = ((evex_encoding & EVEX_Rb) == EVEX_Rb) ? 1 : 0; |
30624 | 406 |
} |
407 |
break; |
|
408 |
||
409 |
case EVEX_HV: |
|
34162 | 410 |
mod_idx = ((evex_encoding & EVEX_Rb) == EVEX_Rb) ? 1 : 0; |
30624 | 411 |
break; |
412 |
||
413 |
case EVEX_FVM: |
|
414 |
break; |
|
415 |
||
416 |
case EVEX_T1S: |
|
34162 | 417 |
switch (_attributes->get_input_size()) { |
30624 | 418 |
case EVEX_8bit: |
419 |
break; |
|
420 |
||
421 |
case EVEX_16bit: |
|
422 |
mod_idx = 1; |
|
423 |
break; |
|
424 |
||
425 |
case EVEX_32bit: |
|
426 |
mod_idx = 2; |
|
427 |
break; |
|
428 |
||
429 |
case EVEX_64bit: |
|
430 |
mod_idx = 3; |
|
431 |
break; |
|
432 |
} |
|
433 |
break; |
|
434 |
||
435 |
case EVEX_T1F: |
|
436 |
case EVEX_T2: |
|
437 |
case EVEX_T4: |
|
34162 | 438 |
mod_idx = (_attributes->get_input_size() == EVEX_64bit) ? 1 : 0; |
30624 | 439 |
break; |
440 |
||
441 |
case EVEX_T8: |
|
442 |
break; |
|
443 |
||
444 |
case EVEX_HVM: |
|
445 |
break; |
|
446 |
||
447 |
case EVEX_QVM: |
|
448 |
break; |
|
449 |
||
450 |
case EVEX_OVM: |
|
451 |
break; |
|
452 |
||
453 |
case EVEX_M128: |
|
454 |
break; |
|
455 |
||
456 |
case EVEX_DUP: |
|
457 |
break; |
|
458 |
||
459 |
default: |
|
460 |
assert(0, "no valid evex tuple_table entry"); |
|
461 |
break; |
|
462 |
} |
|
463 |
||
34162 | 464 |
int vector_len = _attributes->get_vector_len(); |
465 |
if (vector_len >= AVX_128bit && vector_len <= AVX_512bit) { |
|
466 |
int disp_factor = tuple_table[tuple_type + mod_idx][vector_len]; |
|
30624 | 467 |
if ((disp % disp_factor) == 0) { |
468 |
int new_disp = disp / disp_factor; |
|
469 |
if (is8bit(new_disp)) { |
|
470 |
disp = new_disp; |
|
471 |
} |
|
472 |
} else { |
|
473 |
return false; |
|
474 |
} |
|
475 |
} |
|
476 |
} |
|
477 |
return is8bit(disp); |
|
478 |
} |
|
479 |
||
480 |
||
1066 | 481 |
void Assembler::emit_operand(Register reg, Register base, Register index, |
482 |
Address::ScaleFactor scale, int disp, |
|
483 |
RelocationHolder const& rspec, |
|
484 |
int rip_relative_correction) { |
|
1 | 485 |
relocInfo::relocType rtype = (relocInfo::relocType) rspec.type(); |
1066 | 486 |
|
487 |
// Encode the registers as needed in the fields they are used in |
|
488 |
||
489 |
int regenc = encode(reg) << 3; |
|
490 |
int indexenc = index->is_valid() ? encode(index) << 3 : 0; |
|
491 |
int baseenc = base->is_valid() ? encode(base) : 0; |
|
492 |
||
1 | 493 |
if (base->is_valid()) { |
494 |
if (index->is_valid()) { |
|
495 |
assert(scale != Address::no_scale, "inconsistent address"); |
|
496 |
// [base + index*scale + disp] |
|
1066 | 497 |
if (disp == 0 && rtype == relocInfo::none && |
498 |
base != rbp LP64_ONLY(&& base != r13)) { |
|
1 | 499 |
// [base + index*scale] |
500 |
// [00 reg 100][ss index base] |
|
501 |
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
|
502 |
emit_int8(0x04 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
503 |
emit_int8(scale << 6 | indexenc | baseenc); |
30624 | 504 |
} else if (emit_compressed_disp_byte(disp) && rtype == relocInfo::none) { |
1 | 505 |
// [base + index*scale + imm8] |
506 |
// [01 reg 100][ss index base] imm8 |
|
507 |
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
|
508 |
emit_int8(0x44 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
509 |
emit_int8(scale << 6 | indexenc | baseenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
510 |
emit_int8(disp & 0xFF); |
1 | 511 |
} else { |
1066 | 512 |
// [base + index*scale + disp32] |
513 |
// [10 reg 100][ss index base] disp32 |
|
1 | 514 |
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
|
515 |
emit_int8(0x84 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
516 |
emit_int8(scale << 6 | indexenc | baseenc); |
1 | 517 |
emit_data(disp, rspec, disp32_operand); |
518 |
} |
|
1066 | 519 |
} else if (base == rsp LP64_ONLY(|| base == r12)) { |
520 |
// [rsp + disp] |
|
1 | 521 |
if (disp == 0 && rtype == relocInfo::none) { |
1066 | 522 |
// [rsp] |
1 | 523 |
// [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
|
524 |
emit_int8(0x04 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
525 |
emit_int8(0x24); |
30624 | 526 |
} else if (emit_compressed_disp_byte(disp) && rtype == relocInfo::none) { |
1066 | 527 |
// [rsp + imm8] |
528 |
// [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
|
529 |
emit_int8(0x44 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
530 |
emit_int8(0x24); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
531 |
emit_int8(disp & 0xFF); |
1 | 532 |
} else { |
1066 | 533 |
// [rsp + imm32] |
534 |
// [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
|
535 |
emit_int8(0x84 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
536 |
emit_int8(0x24); |
1 | 537 |
emit_data(disp, rspec, disp32_operand); |
538 |
} |
|
539 |
} else { |
|
540 |
// [base + disp] |
|
1066 | 541 |
assert(base != rsp LP64_ONLY(&& base != r12), "illegal addressing mode"); |
542 |
if (disp == 0 && rtype == relocInfo::none && |
|
543 |
base != rbp LP64_ONLY(&& base != r13)) { |
|
1 | 544 |
// [base] |
545 |
// [00 reg base] |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
546 |
emit_int8(0x00 | regenc | baseenc); |
30624 | 547 |
} else if (emit_compressed_disp_byte(disp) && rtype == relocInfo::none) { |
1066 | 548 |
// [base + disp8] |
549 |
// [01 reg base] disp8 |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
550 |
emit_int8(0x40 | regenc | baseenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
551 |
emit_int8(disp & 0xFF); |
1 | 552 |
} else { |
1066 | 553 |
// [base + disp32] |
554 |
// [10 reg base] disp32 |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
555 |
emit_int8(0x80 | regenc | baseenc); |
1 | 556 |
emit_data(disp, rspec, disp32_operand); |
557 |
} |
|
558 |
} |
|
559 |
} else { |
|
560 |
if (index->is_valid()) { |
|
561 |
assert(scale != Address::no_scale, "inconsistent address"); |
|
562 |
// [index*scale + disp] |
|
1066 | 563 |
// [00 reg 100][ss index 101] disp32 |
1 | 564 |
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
|
565 |
emit_int8(0x04 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
566 |
emit_int8(scale << 6 | indexenc | 0x05); |
1 | 567 |
emit_data(disp, rspec, disp32_operand); |
1066 | 568 |
} else if (rtype != relocInfo::none ) { |
569 |
// [disp] (64bit) RIP-RELATIVE (32bit) abs |
|
570 |
// [00 000 101] disp32 |
|
571 |
||
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
572 |
emit_int8(0x05 | regenc); |
1066 | 573 |
// Note that the RIP-rel. correction applies to the generated |
574 |
// disp field, but _not_ to the target address in the rspec. |
|
575 |
||
576 |
// disp was created by converting the target address minus the pc |
|
577 |
// at the start of the instruction. That needs more correction here. |
|
578 |
// intptr_t disp = target - next_ip; |
|
579 |
assert(inst_mark() != NULL, "must be inside InstructionMark"); |
|
580 |
address next_ip = pc() + sizeof(int32_t) + rip_relative_correction; |
|
581 |
int64_t adjusted = disp; |
|
582 |
// Do rip-rel adjustment for 64bit |
|
583 |
LP64_ONLY(adjusted -= (next_ip - inst_mark())); |
|
584 |
assert(is_simm32(adjusted), |
|
585 |
"must be 32bit offset (RIP relative address)"); |
|
586 |
emit_data((int32_t) adjusted, rspec, disp32_operand); |
|
587 |
||
1 | 588 |
} else { |
1066 | 589 |
// 32bit never did this, did everything as the rip-rel/disp code above |
590 |
// [disp] ABSOLUTE |
|
591 |
// [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
|
592 |
emit_int8(0x04 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
593 |
emit_int8(0x25); |
1 | 594 |
emit_data(disp, rspec, disp32_operand); |
595 |
} |
|
596 |
} |
|
597 |
} |
|
598 |
||
1066 | 599 |
void Assembler::emit_operand(XMMRegister reg, Register base, Register index, |
600 |
Address::ScaleFactor scale, int disp, |
|
601 |
RelocationHolder const& rspec) { |
|
30624 | 602 |
if (UseAVX > 2) { |
603 |
int xreg_enc = reg->encoding(); |
|
604 |
if (xreg_enc > 15) { |
|
605 |
XMMRegister new_reg = as_XMMRegister(xreg_enc & 0xf); |
|
606 |
emit_operand((Register)new_reg, base, index, scale, disp, rspec); |
|
607 |
return; |
|
608 |
} |
|
609 |
} |
|
1066 | 610 |
emit_operand((Register)reg, base, index, scale, disp, rspec); |
611 |
} |
|
612 |
||
1 | 613 |
// Secret local extension to Assembler::WhichOperand: |
614 |
#define end_pc_operand (_WhichOperand_limit) |
|
615 |
||
616 |
address Assembler::locate_operand(address inst, WhichOperand which) { |
|
617 |
// Decode the given instruction, and return the address of |
|
618 |
// an embedded 32-bit operand word. |
|
619 |
||
620 |
// If "which" is disp32_operand, selects the displacement portion |
|
621 |
// of an effective address specifier. |
|
1066 | 622 |
// If "which" is imm64_operand, selects the trailing immediate constant. |
1 | 623 |
// If "which" is call32_operand, selects the displacement of a call or jump. |
624 |
// Caller is responsible for ensuring that there is such an operand, |
|
1066 | 625 |
// and that it is 32/64 bits wide. |
1 | 626 |
|
627 |
// If "which" is end_pc_operand, find the end of the instruction. |
|
628 |
||
629 |
address ip = inst; |
|
1066 | 630 |
bool is_64bit = false; |
631 |
||
632 |
debug_only(bool has_disp32 = false); |
|
633 |
int tail_size = 0; // other random bytes (#32, #16, etc.) at end of insn |
|
634 |
||
635 |
again_after_prefix: |
|
1 | 636 |
switch (0xFF & *ip++) { |
637 |
||
638 |
// These convenience macros generate groups of "case" labels for the switch. |
|
1066 | 639 |
#define REP4(x) (x)+0: case (x)+1: case (x)+2: case (x)+3 |
640 |
#define REP8(x) (x)+0: case (x)+1: case (x)+2: case (x)+3: \ |
|
1 | 641 |
case (x)+4: case (x)+5: case (x)+6: case (x)+7 |
1066 | 642 |
#define REP16(x) REP8((x)+0): \ |
1 | 643 |
case REP8((x)+8) |
644 |
||
645 |
case CS_segment: |
|
646 |
case SS_segment: |
|
647 |
case DS_segment: |
|
648 |
case ES_segment: |
|
649 |
case FS_segment: |
|
650 |
case GS_segment: |
|
1066 | 651 |
// Seems dubious |
652 |
LP64_ONLY(assert(false, "shouldn't have that prefix")); |
|
1 | 653 |
assert(ip == inst+1, "only one prefix allowed"); |
654 |
goto again_after_prefix; |
|
655 |
||
1066 | 656 |
case 0x67: |
657 |
case REX: |
|
658 |
case REX_B: |
|
659 |
case REX_X: |
|
660 |
case REX_XB: |
|
661 |
case REX_R: |
|
662 |
case REX_RB: |
|
663 |
case REX_RX: |
|
664 |
case REX_RXB: |
|
665 |
NOT_LP64(assert(false, "64bit prefixes")); |
|
666 |
goto again_after_prefix; |
|
667 |
||
668 |
case REX_W: |
|
669 |
case REX_WB: |
|
670 |
case REX_WX: |
|
671 |
case REX_WXB: |
|
672 |
case REX_WR: |
|
673 |
case REX_WRB: |
|
674 |
case REX_WRX: |
|
675 |
case REX_WRXB: |
|
676 |
NOT_LP64(assert(false, "64bit prefixes")); |
|
677 |
is_64bit = true; |
|
678 |
goto again_after_prefix; |
|
679 |
||
680 |
case 0xFF: // pushq a; decl a; incl a; call a; jmp a |
|
1 | 681 |
case 0x88: // movb a, r |
682 |
case 0x89: // movl a, r |
|
683 |
case 0x8A: // movb r, a |
|
684 |
case 0x8B: // movl r, a |
|
685 |
case 0x8F: // popl a |
|
1066 | 686 |
debug_only(has_disp32 = true); |
1 | 687 |
break; |
688 |
||
1066 | 689 |
case 0x68: // pushq #32 |
690 |
if (which == end_pc_operand) { |
|
691 |
return ip + 4; |
|
692 |
} |
|
693 |
assert(which == imm_operand && !is_64bit, "pushl has no disp32 or 64bit immediate"); |
|
1 | 694 |
return ip; // not produced by emit_operand |
695 |
||
696 |
case 0x66: // movw ... (size prefix) |
|
1066 | 697 |
again_after_size_prefix2: |
1 | 698 |
switch (0xFF & *ip++) { |
1066 | 699 |
case REX: |
700 |
case REX_B: |
|
701 |
case REX_X: |
|
702 |
case REX_XB: |
|
703 |
case REX_R: |
|
704 |
case REX_RB: |
|
705 |
case REX_RX: |
|
706 |
case REX_RXB: |
|
707 |
case REX_W: |
|
708 |
case REX_WB: |
|
709 |
case REX_WX: |
|
710 |
case REX_WXB: |
|
711 |
case REX_WR: |
|
712 |
case REX_WRB: |
|
713 |
case REX_WRX: |
|
714 |
case REX_WRXB: |
|
715 |
NOT_LP64(assert(false, "64bit prefix found")); |
|
716 |
goto again_after_size_prefix2; |
|
1 | 717 |
case 0x8B: // movw r, a |
718 |
case 0x89: // movw a, r |
|
1066 | 719 |
debug_only(has_disp32 = true); |
1 | 720 |
break; |
721 |
case 0xC7: // movw a, #16 |
|
1066 | 722 |
debug_only(has_disp32 = true); |
1 | 723 |
tail_size = 2; // the imm16 |
724 |
break; |
|
725 |
case 0x0F: // several SSE/SSE2 variants |
|
726 |
ip--; // reparse the 0x0F |
|
727 |
goto again_after_prefix; |
|
728 |
default: |
|
729 |
ShouldNotReachHere(); |
|
730 |
} |
|
731 |
break; |
|
732 |
||
1066 | 733 |
case REP8(0xB8): // movl/q r, #32/#64(oop?) |
734 |
if (which == end_pc_operand) return ip + (is_64bit ? 8 : 4); |
|
735 |
// these asserts are somewhat nonsensical |
|
736 |
#ifndef _LP64 |
|
12268 | 737 |
assert(which == imm_operand || which == disp32_operand, |
33105
294e48b4f704
8080775: Better argument formatting for assert() and friends
david
parents:
32727
diff
changeset
|
738 |
"which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip)); |
1066 | 739 |
#else |
740 |
assert((which == call32_operand || which == imm_operand) && is_64bit || |
|
12268 | 741 |
which == narrow_oop_operand && !is_64bit, |
33105
294e48b4f704
8080775: Better argument formatting for assert() and friends
david
parents:
32727
diff
changeset
|
742 |
"which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip)); |
1066 | 743 |
#endif // _LP64 |
1 | 744 |
return ip; |
745 |
||
746 |
case 0x69: // imul r, a, #32 |
|
747 |
case 0xC7: // movl a, #32(oop?) |
|
748 |
tail_size = 4; |
|
1066 | 749 |
debug_only(has_disp32 = true); // has both kinds of operands! |
1 | 750 |
break; |
751 |
||
752 |
case 0x0F: // movx..., etc. |
|
753 |
switch (0xFF & *ip++) { |
|
11427 | 754 |
case 0x3A: // pcmpestri |
755 |
tail_size = 1; |
|
756 |
case 0x38: // ptest, pmovzxbw |
|
757 |
ip++; // skip opcode |
|
758 |
debug_only(has_disp32 = true); // has both kinds of operands! |
|
759 |
break; |
|
760 |
||
761 |
case 0x70: // pshufd r, r/a, #8 |
|
762 |
debug_only(has_disp32 = true); // has both kinds of operands! |
|
763 |
case 0x73: // psrldq r, #8 |
|
764 |
tail_size = 1; |
|
765 |
break; |
|
766 |
||
1 | 767 |
case 0x12: // movlps |
768 |
case 0x28: // movaps |
|
769 |
case 0x2E: // ucomiss |
|
770 |
case 0x2F: // comiss |
|
771 |
case 0x54: // andps |
|
772 |
case 0x55: // andnps |
|
773 |
case 0x56: // orps |
|
774 |
case 0x57: // xorps |
|
35146 | 775 |
case 0x58: // addpd |
34162 | 776 |
case 0x59: // mulpd |
1 | 777 |
case 0x6E: // movd |
778 |
case 0x7E: // movd |
|
11427 | 779 |
case 0xAE: // ldmxcsr, stmxcsr, fxrstor, fxsave, clflush |
1066 | 780 |
debug_only(has_disp32 = true); |
1 | 781 |
break; |
782 |
||
783 |
case 0xAD: // shrd r, a, %cl |
|
784 |
case 0xAF: // imul r, a |
|
1066 | 785 |
case 0xBE: // movsbl r, a (movsxb) |
786 |
case 0xBF: // movswl r, a (movsxw) |
|
787 |
case 0xB6: // movzbl r, a (movzxb) |
|
788 |
case 0xB7: // movzwl r, a (movzxw) |
|
1 | 789 |
case REP16(0x40): // cmovl cc, r, a |
790 |
case 0xB0: // cmpxchgb |
|
791 |
case 0xB1: // cmpxchg |
|
792 |
case 0xC1: // xaddl |
|
793 |
case 0xC7: // cmpxchg8 |
|
794 |
case REP16(0x90): // setcc a |
|
1066 | 795 |
debug_only(has_disp32 = true); |
1 | 796 |
// fall out of the switch to decode the address |
797 |
break; |
|
1066 | 798 |
|
11427 | 799 |
case 0xC4: // pinsrw r, a, #8 |
800 |
debug_only(has_disp32 = true); |
|
801 |
case 0xC5: // pextrw r, r, #8 |
|
802 |
tail_size = 1; // the imm8 |
|
803 |
break; |
|
804 |
||
1 | 805 |
case 0xAC: // shrd r, a, #8 |
1066 | 806 |
debug_only(has_disp32 = true); |
1 | 807 |
tail_size = 1; // the imm8 |
808 |
break; |
|
1066 | 809 |
|
1 | 810 |
case REP16(0x80): // jcc rdisp32 |
811 |
if (which == end_pc_operand) return ip + 4; |
|
1066 | 812 |
assert(which == call32_operand, "jcc has no disp32 or imm"); |
1 | 813 |
return ip; |
814 |
default: |
|
815 |
ShouldNotReachHere(); |
|
816 |
} |
|
817 |
break; |
|
818 |
||
819 |
case 0x81: // addl a, #32; addl r, #32 |
|
820 |
// also: orl, adcl, sbbl, andl, subl, xorl, cmpl |
|
1066 | 821 |
// on 32bit in the case of cmpl, the imm might be an oop |
1 | 822 |
tail_size = 4; |
1066 | 823 |
debug_only(has_disp32 = true); // has both kinds of operands! |
1 | 824 |
break; |
825 |
||
826 |
case 0x83: // addl a, #8; addl r, #8 |
|
827 |
// also: orl, adcl, sbbl, andl, subl, xorl, cmpl |
|
1066 | 828 |
debug_only(has_disp32 = true); // has both kinds of operands! |
1 | 829 |
tail_size = 1; |
830 |
break; |
|
831 |
||
832 |
case 0x9B: |
|
833 |
switch (0xFF & *ip++) { |
|
834 |
case 0xD9: // fnstcw a |
|
1066 | 835 |
debug_only(has_disp32 = true); |
1 | 836 |
break; |
837 |
default: |
|
838 |
ShouldNotReachHere(); |
|
839 |
} |
|
840 |
break; |
|
841 |
||
842 |
case REP4(0x00): // addb a, r; addl a, r; addb r, a; addl r, a |
|
843 |
case REP4(0x10): // adc... |
|
844 |
case REP4(0x20): // and... |
|
845 |
case REP4(0x30): // xor... |
|
846 |
case REP4(0x08): // or... |
|
847 |
case REP4(0x18): // sbb... |
|
848 |
case REP4(0x28): // sub... |
|
1066 | 849 |
case 0xF7: // mull a |
850 |
case 0x8D: // lea r, a |
|
851 |
case 0x87: // xchg r, a |
|
1 | 852 |
case REP4(0x38): // cmp... |
1066 | 853 |
case 0x85: // test r, a |
854 |
debug_only(has_disp32 = true); // has both kinds of operands! |
|
1 | 855 |
break; |
856 |
||
857 |
case 0xC1: // sal a, #8; sar a, #8; shl a, #8; shr a, #8 |
|
858 |
case 0xC6: // movb a, #8 |
|
859 |
case 0x80: // cmpb a, #8 |
|
860 |
case 0x6B: // imul r, a, #8 |
|
1066 | 861 |
debug_only(has_disp32 = true); // has both kinds of operands! |
1 | 862 |
tail_size = 1; // the imm8 |
863 |
break; |
|
864 |
||
11427 | 865 |
case 0xC4: // VEX_3bytes |
866 |
case 0xC5: // VEX_2bytes |
|
867 |
assert((UseAVX > 0), "shouldn't have VEX prefix"); |
|
868 |
assert(ip == inst+1, "no prefixes allowed"); |
|
869 |
// C4 and C5 are also used as opcodes for PINSRW and PEXTRW instructions |
|
870 |
// but they have prefix 0x0F and processed when 0x0F processed above. |
|
871 |
// |
|
872 |
// In 32-bit mode the VEX first byte C4 and C5 alias onto LDS and LES |
|
873 |
// instructions (these instructions are not supported in 64-bit mode). |
|
874 |
// To distinguish them bits [7:6] are set in the VEX second byte since |
|
875 |
// ModRM byte can not be of the form 11xxxxxx in 32-bit mode. To set |
|
876 |
// those VEX bits REX and vvvv bits are inverted. |
|
877 |
// |
|
878 |
// Fortunately C2 doesn't generate these instructions so we don't need |
|
879 |
// to check for them in product version. |
|
880 |
||
881 |
// Check second byte |
|
882 |
NOT_LP64(assert((0xC0 & *ip) == 0xC0, "shouldn't have LDS and LES instructions")); |
|
883 |
||
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
884 |
int vex_opcode; |
11427 | 885 |
// First byte |
886 |
if ((0xFF & *inst) == VEX_3bytes) { |
|
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
887 |
vex_opcode = VEX_OPCODE_MASK & *ip; |
11427 | 888 |
ip++; // third byte |
889 |
is_64bit = ((VEX_W & *ip) == VEX_W); |
|
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
890 |
} else { |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
891 |
vex_opcode = VEX_OPCODE_0F; |
11427 | 892 |
} |
893 |
ip++; // opcode |
|
894 |
// 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
|
895 |
switch (vex_opcode) { |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
896 |
case VEX_OPCODE_0F: |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
897 |
switch (0xFF & *ip) { |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
898 |
case 0x70: // pshufd r, r/a, #8 |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
899 |
case 0x71: // ps[rl|ra|ll]w r, #8 |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
900 |
case 0x72: // ps[rl|ra|ll]d r, #8 |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
901 |
case 0x73: // ps[rl|ra|ll]q r, #8 |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
902 |
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
|
903 |
case 0xC4: // pinsrw r, r, r/a, #8 |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
904 |
case 0xC5: // pextrw r/a, r, #8 |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
905 |
case 0xC6: // shufp[s|d] r, r, r/a, #8 |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
906 |
tail_size = 1; // the imm8 |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
907 |
break; |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
908 |
} |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
909 |
break; |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
910 |
case VEX_OPCODE_0F_3A: |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
911 |
tail_size = 1; |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
912 |
break; |
11427 | 913 |
} |
914 |
ip++; // skip opcode |
|
915 |
debug_only(has_disp32 = true); // has both kinds of operands! |
|
916 |
break; |
|
1 | 917 |
|
30624 | 918 |
case 0x62: // EVEX_4bytes |
919 |
assert((UseAVX > 0), "shouldn't have EVEX prefix"); |
|
920 |
assert(ip == inst+1, "no prefixes allowed"); |
|
921 |
// no EVEX collisions, all instructions that have 0x62 opcodes |
|
922 |
// have EVEX versions and are subopcodes of 0x66 |
|
923 |
ip++; // skip P0 and exmaine W in P1 |
|
924 |
is_64bit = ((VEX_W & *ip) == VEX_W); |
|
925 |
ip++; // move to P2 |
|
926 |
ip++; // skip P2, move to opcode |
|
927 |
// To find the end of instruction (which == end_pc_operand). |
|
928 |
switch (0xFF & *ip) { |
|
929 |
case 0x61: // pcmpestri r, r/a, #8 |
|
930 |
case 0x70: // pshufd r, r/a, #8 |
|
931 |
case 0x73: // psrldq r, #8 |
|
932 |
tail_size = 1; // the imm8 |
|
933 |
break; |
|
934 |
default: |
|
935 |
break; |
|
936 |
} |
|
937 |
ip++; // skip opcode |
|
938 |
debug_only(has_disp32 = true); // has both kinds of operands! |
|
939 |
break; |
|
940 |
||
1 | 941 |
case 0xD1: // sal a, 1; sar a, 1; shl a, 1; shr a, 1 |
942 |
case 0xD3: // sal a, %cl; sar a, %cl; shl a, %cl; shr a, %cl |
|
943 |
case 0xD9: // fld_s a; fst_s a; fstp_s a; fldcw a |
|
944 |
case 0xDD: // fld_d a; fst_d a; fstp_d a |
|
945 |
case 0xDB: // fild_s a; fistp_s a; fld_x a; fstp_x a |
|
946 |
case 0xDF: // fild_d a; fistp_d a |
|
947 |
case 0xD8: // fadd_s a; fsubr_s a; fmul_s a; fdivr_s a; fcomp_s a |
|
948 |
case 0xDC: // fadd_d a; fsubr_d a; fmul_d a; fdivr_d a; fcomp_d a |
|
949 |
case 0xDE: // faddp_d a; fsubrp_d a; fmulp_d a; fdivrp_d a; fcompp_d a |
|
1066 | 950 |
debug_only(has_disp32 = true); |
1 | 951 |
break; |
952 |
||
11427 | 953 |
case 0xE8: // call rdisp32 |
954 |
case 0xE9: // jmp rdisp32 |
|
955 |
if (which == end_pc_operand) return ip + 4; |
|
956 |
assert(which == call32_operand, "call has no disp32 or imm"); |
|
957 |
return ip; |
|
958 |
||
1500
bea9a90f3e8f
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
1437
diff
changeset
|
959 |
case 0xF0: // Lock |
bea9a90f3e8f
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
1437
diff
changeset
|
960 |
assert(os::is_MP(), "only on MP"); |
bea9a90f3e8f
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
1437
diff
changeset
|
961 |
goto again_after_prefix; |
bea9a90f3e8f
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
1437
diff
changeset
|
962 |
|
1 | 963 |
case 0xF3: // For SSE |
964 |
case 0xF2: // For SSE2 |
|
1066 | 965 |
switch (0xFF & *ip++) { |
966 |
case REX: |
|
967 |
case REX_B: |
|
968 |
case REX_X: |
|
969 |
case REX_XB: |
|
970 |
case REX_R: |
|
971 |
case REX_RB: |
|
972 |
case REX_RX: |
|
973 |
case REX_RXB: |
|
974 |
case REX_W: |
|
975 |
case REX_WB: |
|
976 |
case REX_WX: |
|
977 |
case REX_WXB: |
|
978 |
case REX_WR: |
|
979 |
case REX_WRB: |
|
980 |
case REX_WRX: |
|
981 |
case REX_WRXB: |
|
982 |
NOT_LP64(assert(false, "found 64bit prefix")); |
|
983 |
ip++; |
|
984 |
default: |
|
985 |
ip++; |
|
986 |
} |
|
987 |
debug_only(has_disp32 = true); // has both kinds of operands! |
|
1 | 988 |
break; |
989 |
||
990 |
default: |
|
991 |
ShouldNotReachHere(); |
|
992 |
||
1066 | 993 |
#undef REP8 |
994 |
#undef REP16 |
|
1 | 995 |
} |
996 |
||
997 |
assert(which != call32_operand, "instruction is not a call, jmp, or jcc"); |
|
1066 | 998 |
#ifdef _LP64 |
999 |
assert(which != imm_operand, "instruction is not a movq reg, imm64"); |
|
1000 |
#else |
|
1001 |
// assert(which != imm_operand || has_imm32, "instruction has no imm32 field"); |
|
1002 |
assert(which != imm_operand || has_disp32, "instruction has no imm32 field"); |
|
1003 |
#endif // LP64 |
|
1004 |
assert(which != disp32_operand || has_disp32, "instruction has no disp32 field"); |
|
1 | 1005 |
|
1006 |
// parse the output of emit_operand |
|
1007 |
int op2 = 0xFF & *ip++; |
|
1008 |
int base = op2 & 0x07; |
|
1009 |
int op3 = -1; |
|
1010 |
const int b100 = 4; |
|
1011 |
const int b101 = 5; |
|
1012 |
if (base == b100 && (op2 >> 6) != 3) { |
|
1013 |
op3 = 0xFF & *ip++; |
|
1014 |
base = op3 & 0x07; // refetch the base |
|
1015 |
} |
|
1016 |
// now ip points at the disp (if any) |
|
1017 |
||
1018 |
switch (op2 >> 6) { |
|
1019 |
case 0: |
|
1020 |
// [00 reg 100][ss index base] |
|
1066 | 1021 |
// [00 reg 100][00 100 esp] |
1 | 1022 |
// [00 reg base] |
1023 |
// [00 reg 100][ss index 101][disp32] |
|
1024 |
// [00 reg 101] [disp32] |
|
1025 |
||
1026 |
if (base == b101) { |
|
1027 |
if (which == disp32_operand) |
|
1028 |
return ip; // caller wants the disp32 |
|
1029 |
ip += 4; // skip the disp32 |
|
1030 |
} |
|
1031 |
break; |
|
1032 |
||
1033 |
case 1: |
|
1034 |
// [01 reg 100][ss index base][disp8] |
|
1066 | 1035 |
// [01 reg 100][00 100 esp][disp8] |
1 | 1036 |
// [01 reg base] [disp8] |
1037 |
ip += 1; // skip the disp8 |
|
1038 |
break; |
|
1039 |
||
1040 |
case 2: |
|
1041 |
// [10 reg 100][ss index base][disp32] |
|
1066 | 1042 |
// [10 reg 100][00 100 esp][disp32] |
1 | 1043 |
// [10 reg base] [disp32] |
1044 |
if (which == disp32_operand) |
|
1045 |
return ip; // caller wants the disp32 |
|
1046 |
ip += 4; // skip the disp32 |
|
1047 |
break; |
|
1048 |
||
1049 |
case 3: |
|
1050 |
// [11 reg base] (not a memory addressing mode) |
|
1051 |
break; |
|
1052 |
} |
|
1053 |
||
1054 |
if (which == end_pc_operand) { |
|
1055 |
return ip + tail_size; |
|
1056 |
} |
|
1057 |
||
1066 | 1058 |
#ifdef _LP64 |
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
1059 |
assert(which == narrow_oop_operand && !is_64bit, "instruction is not a movl adr, imm32"); |
1066 | 1060 |
#else |
1061 |
assert(which == imm_operand, "instruction has only an imm field"); |
|
1062 |
#endif // LP64 |
|
1 | 1063 |
return ip; |
1064 |
} |
|
1065 |
||
1066 |
address Assembler::locate_next_instruction(address inst) { |
|
1067 |
// Secretly share code with locate_operand: |
|
1068 |
return locate_operand(inst, end_pc_operand); |
|
1069 |
} |
|
1070 |
||
1071 |
||
1072 |
#ifdef ASSERT |
|
1073 |
void Assembler::check_relocation(RelocationHolder const& rspec, int format) { |
|
1074 |
address inst = inst_mark(); |
|
1075 |
assert(inst != NULL && inst < pc(), "must point to beginning of instruction"); |
|
1076 |
address opnd; |
|
1077 |
||
1078 |
Relocation* r = rspec.reloc(); |
|
1079 |
if (r->type() == relocInfo::none) { |
|
1080 |
return; |
|
1081 |
} else if (r->is_call() || format == call32_operand) { |
|
1082 |
// assert(format == imm32_operand, "cannot specify a nonzero format"); |
|
1083 |
opnd = locate_operand(inst, call32_operand); |
|
1084 |
} else if (r->is_data()) { |
|
1066 | 1085 |
assert(format == imm_operand || format == disp32_operand |
1086 |
LP64_ONLY(|| format == narrow_oop_operand), "format ok"); |
|
1 | 1087 |
opnd = locate_operand(inst, (WhichOperand)format); |
1088 |
} else { |
|
1066 | 1089 |
assert(format == imm_operand, "cannot specify a format"); |
1 | 1090 |
return; |
1091 |
} |
|
1092 |
assert(opnd == pc(), "must put operand where relocs can find it"); |
|
1093 |
} |
|
1066 | 1094 |
#endif // ASSERT |
1095 |
||
1096 |
void Assembler::emit_operand32(Register reg, Address adr) { |
|
1097 |
assert(reg->encoding() < 8, "no extended registers"); |
|
1098 |
assert(!adr.base_needs_rex() && !adr.index_needs_rex(), "no extended registers"); |
|
1099 |
emit_operand(reg, adr._base, adr._index, adr._scale, adr._disp, |
|
1100 |
adr._rspec); |
|
1101 |
} |
|
1102 |
||
1103 |
void Assembler::emit_operand(Register reg, Address adr, |
|
1104 |
int rip_relative_correction) { |
|
1105 |
emit_operand(reg, adr._base, adr._index, adr._scale, adr._disp, |
|
1106 |
adr._rspec, |
|
1107 |
rip_relative_correction); |
|
1108 |
} |
|
1109 |
||
1110 |
void Assembler::emit_operand(XMMRegister reg, Address adr) { |
|
1111 |
emit_operand(reg, adr._base, adr._index, adr._scale, adr._disp, |
|
1112 |
adr._rspec); |
|
1113 |
} |
|
1114 |
||
1115 |
// MMX operations |
|
1116 |
void Assembler::emit_operand(MMXRegister reg, Address adr) { |
|
1117 |
assert(!adr.base_needs_rex() && !adr.index_needs_rex(), "no extended registers"); |
|
1118 |
emit_operand((Register)reg, adr._base, adr._index, adr._scale, adr._disp, adr._rspec); |
|
1119 |
} |
|
1120 |
||
1121 |
// work around gcc (3.2.1-7a) bug |
|
1122 |
void Assembler::emit_operand(Address adr, MMXRegister reg) { |
|
1123 |
assert(!adr.base_needs_rex() && !adr.index_needs_rex(), "no extended registers"); |
|
1124 |
emit_operand((Register)reg, adr._base, adr._index, adr._scale, adr._disp, adr._rspec); |
|
1 | 1125 |
} |
1126 |
||
1127 |
||
1128 |
void Assembler::emit_farith(int b1, int b2, int i) { |
|
1129 |
assert(isByte(b1) && isByte(b2), "wrong opcode"); |
|
1130 |
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
|
1131 |
emit_int8(b1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1132 |
emit_int8(b2 + i); |
1 | 1133 |
} |
1134 |
||
1135 |
||
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
1136 |
// 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
|
1137 |
|
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
1138 |
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
|
1139 |
InstructionMark im(this); |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
1140 |
prefix(dst); |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
1141 |
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
|
1142 |
} |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
1143 |
|
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
1144 |
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
|
1145 |
InstructionMark im(this); |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
1146 |
prefix(dst, src); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1147 |
emit_int8(0x11); |
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
1148 |
emit_operand(src, dst); |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
1149 |
} |
1066 | 1150 |
|
1151 |
void Assembler::adcl(Register dst, int32_t imm32) { |
|
1152 |
prefix(dst); |
|
1 | 1153 |
emit_arith(0x81, 0xD0, dst, imm32); |
1154 |
} |
|
1155 |
||
1156 |
void Assembler::adcl(Register dst, Address src) { |
|
1157 |
InstructionMark im(this); |
|
1066 | 1158 |
prefix(src, dst); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1159 |
emit_int8(0x13); |
1 | 1160 |
emit_operand(dst, src); |
1161 |
} |
|
1162 |
||
1163 |
void Assembler::adcl(Register dst, Register src) { |
|
1066 | 1164 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
1 | 1165 |
emit_arith(0x13, 0xC0, dst, src); |
1166 |
} |
|
1167 |
||
1066 | 1168 |
void Assembler::addl(Address dst, int32_t imm32) { |
1169 |
InstructionMark im(this); |
|
1170 |
prefix(dst); |
|
1171 |
emit_arith_operand(0x81, rax, dst, imm32); |
|
1172 |
} |
|
1 | 1173 |
|
1174 |
void Assembler::addl(Address dst, Register src) { |
|
1175 |
InstructionMark im(this); |
|
1066 | 1176 |
prefix(dst, src); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1177 |
emit_int8(0x01); |
1 | 1178 |
emit_operand(src, dst); |
1179 |
} |
|
1180 |
||
1066 | 1181 |
void Assembler::addl(Register dst, int32_t imm32) { |
1182 |
prefix(dst); |
|
1 | 1183 |
emit_arith(0x81, 0xC0, dst, imm32); |
1184 |
} |
|
1185 |
||
1186 |
void Assembler::addl(Register dst, Address src) { |
|
1187 |
InstructionMark im(this); |
|
1066 | 1188 |
prefix(src, dst); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1189 |
emit_int8(0x03); |
1 | 1190 |
emit_operand(dst, src); |
1191 |
} |
|
1192 |
||
1193 |
void Assembler::addl(Register dst, Register src) { |
|
1066 | 1194 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
1 | 1195 |
emit_arith(0x03, 0xC0, dst, src); |
1196 |
} |
|
1197 |
||
1198 |
void Assembler::addr_nop_4() { |
|
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
1199 |
assert(UseAddressNop, "no CPU support"); |
1 | 1200 |
// 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
|
1201 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1202 |
emit_int8(0x1F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1203 |
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
|
1204 |
emit_int8(0); // 8-bits offset (1 byte) |
1 | 1205 |
} |
1206 |
||
1207 |
void Assembler::addr_nop_5() { |
|
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
1208 |
assert(UseAddressNop, "no CPU support"); |
1 | 1209 |
// 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
|
1210 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1211 |
emit_int8(0x1F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1212 |
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
|
1213 |
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
|
1214 |
emit_int8(0); // 8-bits offset (1 byte) |
1 | 1215 |
} |
1216 |
||
1217 |
void Assembler::addr_nop_7() { |
|
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
1218 |
assert(UseAddressNop, "no CPU support"); |
1 | 1219 |
// 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
|
1220 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1221 |
emit_int8(0x1F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1222 |
emit_int8((unsigned char)0x80); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1223 |
// emit_rm(cbuf, 0x2, EAX_enc, EAX_enc); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
1224 |
emit_int32(0); // 32-bits offset (4 bytes) |
1 | 1225 |
} |
1226 |
||
1227 |
void Assembler::addr_nop_8() { |
|
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
1228 |
assert(UseAddressNop, "no CPU support"); |
1 | 1229 |
// 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
|
1230 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1231 |
emit_int8(0x1F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1232 |
emit_int8((unsigned char)0x84); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1233 |
// 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
|
1234 |
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
|
1235 |
emit_int32(0); // 32-bits offset (4 bytes) |
1 | 1236 |
} |
1237 |
||
1066 | 1238 |
void Assembler::addsd(XMMRegister dst, XMMRegister src) { |
1239 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1240 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
1241 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
1242 |
emit_int8(0x58); |
|
1243 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 1244 |
} |
1245 |
||
1246 |
void Assembler::addsd(XMMRegister dst, Address src) { |
|
1247 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1248 |
InstructionMark im(this); |
1249 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
|
1250 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
1251 |
simd_prefix(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
1252 |
emit_int8(0x58); |
|
1253 |
emit_operand(dst, src); |
|
1066 | 1254 |
} |
1255 |
||
1256 |
void Assembler::addss(XMMRegister dst, XMMRegister src) { |
|
1257 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 1258 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
1259 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
1260 |
emit_int8(0x58); |
|
1261 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 1262 |
} |
1263 |
||
1264 |
void Assembler::addss(XMMRegister dst, Address src) { |
|
1265 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 1266 |
InstructionMark im(this); |
1267 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
|
1268 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
1269 |
simd_prefix(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
1270 |
emit_int8(0x58); |
|
1271 |
emit_operand(dst, src); |
|
1066 | 1272 |
} |
1273 |
||
14132 | 1274 |
void Assembler::aesdec(XMMRegister dst, Address src) { |
1275 |
assert(VM_Version::supports_aes(), ""); |
|
1276 |
InstructionMark im(this); |
|
34162 | 1277 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
1278 |
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
|
1279 |
emit_int8((unsigned char)0xDE); |
14132 | 1280 |
emit_operand(dst, src); |
1281 |
} |
|
1282 |
||
1283 |
void Assembler::aesdec(XMMRegister dst, XMMRegister src) { |
|
1284 |
assert(VM_Version::supports_aes(), ""); |
|
34162 | 1285 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
1286 |
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
|
1287 |
emit_int8((unsigned char)0xDE); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1288 |
emit_int8(0xC0 | encode); |
14132 | 1289 |
} |
1290 |
||
1291 |
void Assembler::aesdeclast(XMMRegister dst, Address src) { |
|
1292 |
assert(VM_Version::supports_aes(), ""); |
|
1293 |
InstructionMark im(this); |
|
34162 | 1294 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
1295 |
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
|
1296 |
emit_int8((unsigned char)0xDF); |
14132 | 1297 |
emit_operand(dst, src); |
1298 |
} |
|
1299 |
||
1300 |
void Assembler::aesdeclast(XMMRegister dst, XMMRegister src) { |
|
1301 |
assert(VM_Version::supports_aes(), ""); |
|
34162 | 1302 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
1303 |
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
|
1304 |
emit_int8((unsigned char)0xDF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1305 |
emit_int8((unsigned char)(0xC0 | encode)); |
14132 | 1306 |
} |
1307 |
||
1308 |
void Assembler::aesenc(XMMRegister dst, Address src) { |
|
1309 |
assert(VM_Version::supports_aes(), ""); |
|
1310 |
InstructionMark im(this); |
|
34162 | 1311 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
1312 |
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
|
1313 |
emit_int8((unsigned char)0xDC); |
14132 | 1314 |
emit_operand(dst, src); |
1315 |
} |
|
1316 |
||
1317 |
void Assembler::aesenc(XMMRegister dst, XMMRegister src) { |
|
1318 |
assert(VM_Version::supports_aes(), ""); |
|
34162 | 1319 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
1320 |
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
|
1321 |
emit_int8((unsigned char)0xDC); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1322 |
emit_int8(0xC0 | encode); |
14132 | 1323 |
} |
1324 |
||
1325 |
void Assembler::aesenclast(XMMRegister dst, Address src) { |
|
1326 |
assert(VM_Version::supports_aes(), ""); |
|
1327 |
InstructionMark im(this); |
|
34162 | 1328 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
1329 |
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
|
1330 |
emit_int8((unsigned char)0xDD); |
14132 | 1331 |
emit_operand(dst, src); |
1332 |
} |
|
1333 |
||
1334 |
void Assembler::aesenclast(XMMRegister dst, XMMRegister src) { |
|
1335 |
assert(VM_Version::supports_aes(), ""); |
|
34162 | 1336 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
1337 |
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
|
1338 |
emit_int8((unsigned char)0xDD); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1339 |
emit_int8((unsigned char)(0xC0 | encode)); |
14132 | 1340 |
} |
1341 |
||
11427 | 1342 |
void Assembler::andl(Address dst, int32_t imm32) { |
1343 |
InstructionMark im(this); |
|
1344 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1345 |
emit_int8((unsigned char)0x81); |
11427 | 1346 |
emit_operand(rsp, dst, 4); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
1347 |
emit_int32(imm32); |
11427 | 1348 |
} |
1349 |
||
1066 | 1350 |
void Assembler::andl(Register dst, int32_t imm32) { |
1351 |
prefix(dst); |
|
1352 |
emit_arith(0x81, 0xE0, dst, imm32); |
|
1353 |
} |
|
1354 |
||
1355 |
void Assembler::andl(Register dst, Address src) { |
|
1356 |
InstructionMark im(this); |
|
1357 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1358 |
emit_int8(0x23); |
1066 | 1359 |
emit_operand(dst, src); |
1360 |
} |
|
1361 |
||
1362 |
void Assembler::andl(Register dst, Register src) { |
|
1363 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
|
1364 |
emit_arith(0x23, 0xC0, dst, src); |
|
1365 |
} |
|
1366 |
||
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1367 |
void Assembler::andnl(Register dst, Register src1, Register src2) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1368 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 1369 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
1370 |
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
|
1371 |
emit_int8((unsigned char)0xF2); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1372 |
emit_int8((unsigned char)(0xC0 | encode)); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1373 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1374 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1375 |
void Assembler::andnl(Register dst, Register src1, Address src2) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1376 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 1377 |
InstructionMark im(this); |
1378 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
|
1379 |
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
|
1380 |
emit_int8((unsigned char)0xF2); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1381 |
emit_operand(dst, src2); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1382 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1383 |
|
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1384 |
void Assembler::bsfl(Register dst, Register src) { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1385 |
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
|
1386 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1387 |
emit_int8((unsigned char)0xBC); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1388 |
emit_int8((unsigned char)(0xC0 | encode)); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1389 |
} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1390 |
|
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1391 |
void Assembler::bsrl(Register dst, Register src) { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1392 |
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
|
1393 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1394 |
emit_int8((unsigned char)0xBD); |
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)); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1396 |
} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1397 |
|
1066 | 1398 |
void Assembler::bswapl(Register reg) { // bswap |
1399 |
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
|
1400 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1401 |
emit_int8((unsigned char)(0xC8 | encode)); |
1066 | 1402 |
} |
1403 |
||
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1404 |
void Assembler::blsil(Register dst, Register src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1405 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 1406 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
1407 |
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
|
1408 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1409 |
emit_int8((unsigned char)(0xC0 | encode)); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1410 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1411 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1412 |
void Assembler::blsil(Register dst, Address src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1413 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 1414 |
InstructionMark im(this); |
1415 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
|
1416 |
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
|
1417 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1418 |
emit_operand(rbx, src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1419 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1420 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1421 |
void Assembler::blsmskl(Register dst, Register src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1422 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 1423 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
1424 |
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
|
1425 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1426 |
emit_int8((unsigned char)(0xC0 | encode)); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1427 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1428 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1429 |
void Assembler::blsmskl(Register dst, Address src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1430 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 1431 |
InstructionMark im(this); |
1432 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
|
1433 |
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
|
1434 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1435 |
emit_operand(rdx, src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1436 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1437 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1438 |
void Assembler::blsrl(Register dst, Register src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1439 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 1440 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
1441 |
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
|
1442 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1443 |
emit_int8((unsigned char)(0xC0 | encode)); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1444 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1445 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1446 |
void Assembler::blsrl(Register dst, Address src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1447 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 1448 |
InstructionMark im(this); |
1449 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
|
1450 |
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
|
1451 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1452 |
emit_operand(rcx, src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1453 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
1454 |
|
1066 | 1455 |
void Assembler::call(Label& L, relocInfo::relocType rtype) { |
1456 |
// suspect disp32 is always good |
|
1457 |
int operand = LP64_ONLY(disp32_operand) NOT_LP64(imm_operand); |
|
1458 |
||
1459 |
if (L.is_bound()) { |
|
1460 |
const int long_size = 5; |
|
1461 |
int offs = (int)( target(L) - pc() ); |
|
1462 |
assert(offs <= 0, "assembler error"); |
|
1463 |
InstructionMark im(this); |
|
1464 |
// 1110 1000 #32-bit disp |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1465 |
emit_int8((unsigned char)0xE8); |
1066 | 1466 |
emit_data(offs - long_size, rtype, operand); |
1467 |
} else { |
|
1468 |
InstructionMark im(this); |
|
1469 |
// 1110 1000 #32-bit disp |
|
1470 |
L.add_patch_at(code(), locator()); |
|
1471 |
||
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1472 |
emit_int8((unsigned char)0xE8); |
1066 | 1473 |
emit_data(int(0), rtype, operand); |
1474 |
} |
|
1475 |
} |
|
1476 |
||
1477 |
void Assembler::call(Register dst) { |
|
11427 | 1478 |
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
|
1479 |
emit_int8((unsigned char)0xFF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1480 |
emit_int8((unsigned char)(0xD0 | encode)); |
1066 | 1481 |
} |
1482 |
||
1483 |
||
1484 |
void Assembler::call(Address adr) { |
|
1485 |
InstructionMark im(this); |
|
1486 |
prefix(adr); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1487 |
emit_int8((unsigned char)0xFF); |
1066 | 1488 |
emit_operand(rdx, adr); |
1489 |
} |
|
1490 |
||
1491 |
void Assembler::call_literal(address entry, RelocationHolder const& rspec) { |
|
1492 |
assert(entry != NULL, "call most probably wrong"); |
|
1493 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1494 |
emit_int8((unsigned char)0xE8); |
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
1495 |
intptr_t disp = entry - (pc() + sizeof(int32_t)); |
1066 | 1496 |
assert(is_simm32(disp), "must be 32bit offset (call2)"); |
1497 |
// Technically, should use call32_operand, but this format is |
|
1498 |
// implied by the fact that we're emitting a call instruction. |
|
1499 |
||
1500 |
int operand = LP64_ONLY(disp32_operand) NOT_LP64(call32_operand); |
|
1501 |
emit_data((int) disp, rspec, operand); |
|
1502 |
} |
|
1503 |
||
1504 |
void Assembler::cdql() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1505 |
emit_int8((unsigned char)0x99); |
1066 | 1506 |
} |
1507 |
||
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1508 |
void Assembler::cld() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1509 |
emit_int8((unsigned char)0xFC); |
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1510 |
} |
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1511 |
|
1066 | 1512 |
void Assembler::cmovl(Condition cc, Register dst, Register src) { |
1513 |
NOT_LP64(guarantee(VM_Version::supports_cmov(), "illegal instruction")); |
|
1514 |
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
|
1515 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1516 |
emit_int8(0x40 | cc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1517 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1518 |
} |
1519 |
||
1520 |
||
1521 |
void Assembler::cmovl(Condition cc, Register dst, Address src) { |
|
1522 |
NOT_LP64(guarantee(VM_Version::supports_cmov(), "illegal instruction")); |
|
1523 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1524 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1525 |
emit_int8(0x40 | cc); |
1066 | 1526 |
emit_operand(dst, src); |
1527 |
} |
|
1528 |
||
1529 |
void Assembler::cmpb(Address dst, int imm8) { |
|
1530 |
InstructionMark im(this); |
|
1531 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1532 |
emit_int8((unsigned char)0x80); |
1066 | 1533 |
emit_operand(rdi, dst, 1); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1534 |
emit_int8(imm8); |
1066 | 1535 |
} |
1536 |
||
1537 |
void Assembler::cmpl(Address dst, int32_t imm32) { |
|
1538 |
InstructionMark im(this); |
|
1539 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1540 |
emit_int8((unsigned char)0x81); |
1066 | 1541 |
emit_operand(rdi, dst, 4); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
1542 |
emit_int32(imm32); |
1066 | 1543 |
} |
1544 |
||
1545 |
void Assembler::cmpl(Register dst, int32_t imm32) { |
|
1546 |
prefix(dst); |
|
1547 |
emit_arith(0x81, 0xF8, dst, imm32); |
|
1548 |
} |
|
1549 |
||
1550 |
void Assembler::cmpl(Register dst, Register src) { |
|
1551 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
|
1552 |
emit_arith(0x3B, 0xC0, dst, src); |
|
1553 |
} |
|
1554 |
||
1555 |
void Assembler::cmpl(Register dst, Address src) { |
|
1556 |
InstructionMark im(this); |
|
1557 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1558 |
emit_int8((unsigned char)0x3B); |
1066 | 1559 |
emit_operand(dst, src); |
1560 |
} |
|
1561 |
||
1562 |
void Assembler::cmpw(Address dst, int imm16) { |
|
1563 |
InstructionMark im(this); |
|
1564 |
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
|
1565 |
emit_int8(0x66); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1566 |
emit_int8((unsigned char)0x81); |
1066 | 1567 |
emit_operand(rdi, dst, 2); |
14831
84828ee2a91c
8004536: replace AbstractAssembler emit_word with emit_int16
twisti
parents:
14626
diff
changeset
|
1568 |
emit_int16(imm16); |
1066 | 1569 |
} |
1570 |
||
1571 |
// The 32-bit cmpxchg compares the value at adr with the contents of rax, |
|
1572 |
// and stores reg into adr if so; otherwise, the value at adr is loaded into rax,. |
|
1573 |
// The ZF is set if the compared values were equal, and cleared otherwise. |
|
1574 |
void Assembler::cmpxchgl(Register reg, Address adr) { // cmpxchg |
|
13955 | 1575 |
InstructionMark im(this); |
1576 |
prefix(adr, reg); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1577 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1578 |
emit_int8((unsigned char)0xB1); |
13955 | 1579 |
emit_operand(reg, adr); |
1066 | 1580 |
} |
1581 |
||
27691
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
26434
diff
changeset
|
1582 |
// 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
|
1583 |
// 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
|
1584 |
// 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
|
1585 |
void Assembler::cmpxchgb(Register reg, Address adr) { // cmpxchg |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
26434
diff
changeset
|
1586 |
InstructionMark im(this); |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
26434
diff
changeset
|
1587 |
prefix(adr, reg, true); |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
26434
diff
changeset
|
1588 |
emit_int8(0x0F); |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
26434
diff
changeset
|
1589 |
emit_int8((unsigned char)0xB0); |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
26434
diff
changeset
|
1590 |
emit_operand(reg, adr); |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
26434
diff
changeset
|
1591 |
} |
733f189ad1f7
8058255: Native jbyte Atomic::cmpxchg for supported x86 platforms
jwilhelm
parents:
26434
diff
changeset
|
1592 |
|
1066 | 1593 |
void Assembler::comisd(XMMRegister dst, Address src) { |
1594 |
// NOTE: dbx seems to decode this as comiss even though the |
|
1595 |
// 0x66 is there. Strangly ucomisd comes out correct |
|
1596 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1597 |
InstructionMark im(this); |
1598 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);; |
|
1599 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
1600 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
1601 |
emit_int8(0x2F); |
|
1602 |
emit_operand(dst, src); |
|
11427 | 1603 |
} |
1604 |
||
1605 |
void Assembler::comisd(XMMRegister dst, XMMRegister src) { |
|
1606 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1607 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
1608 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
1609 |
emit_int8(0x2F); |
|
1610 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 1611 |
} |
1612 |
||
1613 |
void Assembler::comiss(XMMRegister dst, Address src) { |
|
1614 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 1615 |
InstructionMark im(this); |
1616 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
1617 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
1618 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
1619 |
emit_int8(0x2F); |
|
1620 |
emit_operand(dst, src); |
|
1066 | 1621 |
} |
1622 |
||
11427 | 1623 |
void Assembler::comiss(XMMRegister dst, XMMRegister src) { |
1624 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 1625 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
1626 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
1627 |
emit_int8(0x2F); |
|
1628 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
11427 | 1629 |
} |
1630 |
||
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1631 |
void Assembler::cpuid() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1632 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1633 |
emit_int8((unsigned char)0xA2); |
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1634 |
} |
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1635 |
|
33066 | 1636 |
// Opcode / Instruction Op / En 64 - Bit Mode Compat / Leg Mode Description Implemented |
1637 |
// F2 0F 38 F0 / r CRC32 r32, r / m8 RM Valid Valid Accumulate CRC32 on r / m8. v |
|
1638 |
// F2 REX 0F 38 F0 / r CRC32 r32, r / m8* RM Valid N.E. Accumulate CRC32 on r / m8. - |
|
1639 |
// F2 REX.W 0F 38 F0 / r CRC32 r64, r / m8 RM Valid N.E. Accumulate CRC32 on r / m8. - |
|
1640 |
// |
|
1641 |
// F2 0F 38 F1 / r CRC32 r32, r / m16 RM Valid Valid Accumulate CRC32 on r / m16. v |
|
1642 |
// |
|
1643 |
// F2 0F 38 F1 / r CRC32 r32, r / m32 RM Valid Valid Accumulate CRC32 on r / m32. v |
|
1644 |
// |
|
1645 |
// F2 REX.W 0F 38 F1 / r CRC32 r64, r / m64 RM Valid N.E. Accumulate CRC32 on r / m64. v |
|
1646 |
void Assembler::crc32(Register crc, Register v, int8_t sizeInBytes) { |
|
1647 |
assert(VM_Version::supports_sse4_2(), ""); |
|
1648 |
int8_t w = 0x01; |
|
1649 |
Prefix p = Prefix_EMPTY; |
|
1650 |
||
1651 |
emit_int8((int8_t)0xF2); |
|
1652 |
switch (sizeInBytes) { |
|
1653 |
case 1: |
|
1654 |
w = 0; |
|
1655 |
break; |
|
1656 |
case 2: |
|
1657 |
case 4: |
|
1658 |
break; |
|
1659 |
LP64_ONLY(case 8:) |
|
1660 |
// This instruction is not valid in 32 bits |
|
1661 |
// Note: |
|
1662 |
// http://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf |
|
1663 |
// |
|
1664 |
// Page B - 72 Vol. 2C says |
|
1665 |
// qwreg2 to qwreg 1111 0010 : 0100 1R0B : 0000 1111 : 0011 1000 : 1111 0000 : 11 qwreg1 qwreg2 |
|
1666 |
// mem64 to qwreg 1111 0010 : 0100 1R0B : 0000 1111 : 0011 1000 : 1111 0000 : mod qwreg r / m |
|
1667 |
// F0!!! |
|
1668 |
// while 3 - 208 Vol. 2A |
|
1669 |
// F2 REX.W 0F 38 F1 / r CRC32 r64, r / m64 RM Valid N.E.Accumulate CRC32 on r / m64. |
|
1670 |
// |
|
1671 |
// the 0 on a last bit is reserved for a different flavor of this instruction : |
|
1672 |
// F2 REX.W 0F 38 F0 / r CRC32 r64, r / m8 RM Valid N.E.Accumulate CRC32 on r / m8. |
|
1673 |
p = REX_W; |
|
1674 |
break; |
|
1675 |
default: |
|
1676 |
assert(0, "Unsupported value for a sizeInBytes argument"); |
|
1677 |
break; |
|
1678 |
} |
|
1679 |
LP64_ONLY(prefix(crc, v, p);) |
|
1680 |
emit_int8((int8_t)0x0F); |
|
1681 |
emit_int8(0x38); |
|
1682 |
emit_int8((int8_t)(0xF0 | w)); |
|
1683 |
emit_int8(0xC0 | ((crc->encoding() & 0x7) << 3) | (v->encoding() & 7)); |
|
1684 |
} |
|
1685 |
||
1686 |
void Assembler::crc32(Register crc, Address adr, int8_t sizeInBytes) { |
|
1687 |
assert(VM_Version::supports_sse4_2(), ""); |
|
1688 |
InstructionMark im(this); |
|
1689 |
int8_t w = 0x01; |
|
1690 |
Prefix p = Prefix_EMPTY; |
|
1691 |
||
1692 |
emit_int8((int8_t)0xF2); |
|
1693 |
switch (sizeInBytes) { |
|
1694 |
case 1: |
|
1695 |
w = 0; |
|
1696 |
break; |
|
1697 |
case 2: |
|
1698 |
case 4: |
|
1699 |
break; |
|
1700 |
LP64_ONLY(case 8:) |
|
1701 |
// This instruction is not valid in 32 bits |
|
1702 |
p = REX_W; |
|
1703 |
break; |
|
1704 |
default: |
|
1705 |
assert(0, "Unsupported value for a sizeInBytes argument"); |
|
1706 |
break; |
|
1707 |
} |
|
1708 |
LP64_ONLY(prefix(crc, adr, p);) |
|
1709 |
emit_int8((int8_t)0x0F); |
|
1710 |
emit_int8(0x38); |
|
1711 |
emit_int8((int8_t)(0xF0 | w)); |
|
1712 |
emit_operand(crc, adr); |
|
1713 |
} |
|
1714 |
||
1066 | 1715 |
void Assembler::cvtdq2pd(XMMRegister dst, XMMRegister src) { |
1716 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1717 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
1718 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
1719 |
emit_int8((unsigned char)0xE6); |
|
1720 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 1721 |
} |
1722 |
||
1723 |
void Assembler::cvtdq2ps(XMMRegister dst, XMMRegister src) { |
|
1724 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1725 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
1726 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
1727 |
emit_int8(0x5B); |
|
1728 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 1729 |
} |
1730 |
||
1731 |
void Assembler::cvtsd2ss(XMMRegister dst, XMMRegister src) { |
|
1732 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1733 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
1734 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
1735 |
emit_int8(0x5A); |
|
1736 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 1737 |
} |
1738 |
||
11427 | 1739 |
void Assembler::cvtsd2ss(XMMRegister dst, Address src) { |
1740 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1741 |
InstructionMark im(this); |
1742 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
|
1743 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
1744 |
simd_prefix(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
1745 |
emit_int8(0x5A); |
|
1746 |
emit_operand(dst, src); |
|
11427 | 1747 |
} |
1748 |
||
1066 | 1749 |
void Assembler::cvtsi2sdl(XMMRegister dst, Register src) { |
1750 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1751 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
1752 |
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
|
1753 |
emit_int8(0x2A); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1754 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1755 |
} |
1756 |
||
11427 | 1757 |
void Assembler::cvtsi2sdl(XMMRegister dst, Address src) { |
1758 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1759 |
InstructionMark im(this); |
1760 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
1761 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
1762 |
simd_prefix(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
1763 |
emit_int8(0x2A); |
|
1764 |
emit_operand(dst, src); |
|
11427 | 1765 |
} |
1766 |
||
1066 | 1767 |
void Assembler::cvtsi2ssl(XMMRegister dst, Register src) { |
1768 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 1769 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
1770 |
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
|
1771 |
emit_int8(0x2A); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1772 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1773 |
} |
1774 |
||
11427 | 1775 |
void Assembler::cvtsi2ssl(XMMRegister dst, Address src) { |
1776 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 1777 |
InstructionMark im(this); |
1778 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
1779 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
1780 |
simd_prefix(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
1781 |
emit_int8(0x2A); |
|
1782 |
emit_operand(dst, src); |
|
11427 | 1783 |
} |
1784 |
||
32391
01e2f5e916c7
8076373: In 32-bit VM interpreter and compiled code process NaN values differently
zmajo
parents:
31410
diff
changeset
|
1785 |
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
|
1786 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
34162 | 1787 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
1788 |
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
|
1789 |
emit_int8(0x2A); |
01e2f5e916c7
8076373: In 32-bit VM interpreter and compiled code process NaN values differently
zmajo
parents:
31410
diff
changeset
|
1790 |
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
|
1791 |
} |
01e2f5e916c7
8076373: In 32-bit VM interpreter and compiled code process NaN values differently
zmajo
parents:
31410
diff
changeset
|
1792 |
|
1066 | 1793 |
void Assembler::cvtss2sd(XMMRegister dst, XMMRegister src) { |
1794 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1795 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
1796 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
1797 |
emit_int8(0x5A); |
|
1798 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 1799 |
} |
1800 |
||
11427 | 1801 |
void Assembler::cvtss2sd(XMMRegister dst, Address src) { |
1802 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1803 |
InstructionMark im(this); |
1804 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
|
1805 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
1806 |
simd_prefix(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
1807 |
emit_int8(0x5A); |
|
1808 |
emit_operand(dst, src); |
|
11427 | 1809 |
} |
1810 |
||
1811 |
||
1066 | 1812 |
void Assembler::cvttsd2sil(Register dst, XMMRegister src) { |
1813 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1814 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
1815 |
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
|
1816 |
emit_int8(0x2C); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1817 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1818 |
} |
1819 |
||
1820 |
void Assembler::cvttss2sil(Register dst, XMMRegister src) { |
|
1821 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 1822 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
1823 |
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
|
1824 |
emit_int8(0x2C); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1825 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1826 |
} |
1827 |
||
1828 |
void Assembler::decl(Address dst) { |
|
1829 |
// Don't use it directly. Use MacroAssembler::decrement() instead. |
|
1830 |
InstructionMark im(this); |
|
1831 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1832 |
emit_int8((unsigned char)0xFF); |
1066 | 1833 |
emit_operand(rcx, dst); |
1834 |
} |
|
1835 |
||
1836 |
void Assembler::divsd(XMMRegister dst, Address src) { |
|
1837 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1838 |
InstructionMark im(this); |
1839 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
|
1840 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
1841 |
simd_prefix(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
1842 |
emit_int8(0x5E); |
|
1843 |
emit_operand(dst, src); |
|
1066 | 1844 |
} |
1845 |
||
1846 |
void Assembler::divsd(XMMRegister dst, XMMRegister src) { |
|
1847 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 1848 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
1849 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
1850 |
emit_int8(0x5E); |
|
1851 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 1852 |
} |
1853 |
||
1854 |
void Assembler::divss(XMMRegister dst, Address src) { |
|
1855 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 1856 |
InstructionMark im(this); |
1857 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
|
1858 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
1859 |
simd_prefix(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
1860 |
emit_int8(0x5E); |
|
1861 |
emit_operand(dst, src); |
|
1066 | 1862 |
} |
1863 |
||
1864 |
void Assembler::divss(XMMRegister dst, XMMRegister src) { |
|
1865 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 1866 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
1867 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
1868 |
emit_int8(0x5E); |
|
1869 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 1870 |
} |
1871 |
||
1872 |
void Assembler::emms() { |
|
1873 |
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
|
1874 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1875 |
emit_int8(0x77); |
1066 | 1876 |
} |
1877 |
||
1878 |
void Assembler::hlt() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1879 |
emit_int8((unsigned char)0xF4); |
1066 | 1880 |
} |
1881 |
||
1882 |
void Assembler::idivl(Register src) { |
|
1883 |
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
|
1884 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1885 |
emit_int8((unsigned char)(0xF8 | encode)); |
1066 | 1886 |
} |
1887 |
||
7121 | 1888 |
void Assembler::divl(Register src) { // Unsigned |
1889 |
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
|
1890 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1891 |
emit_int8((unsigned char)(0xF0 | encode)); |
7121 | 1892 |
} |
1893 |
||
1066 | 1894 |
void Assembler::imull(Register dst, Register src) { |
1895 |
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
|
1896 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1897 |
emit_int8((unsigned char)0xAF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1898 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1899 |
} |
1900 |
||
1901 |
||
1902 |
void Assembler::imull(Register dst, Register src, int value) { |
|
1903 |
int encode = prefix_and_encode(dst->encoding(), src->encoding()); |
|
1904 |
if (is8bit(value)) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1905 |
emit_int8(0x6B); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1906 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1907 |
emit_int8(value & 0xFF); |
1066 | 1908 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1909 |
emit_int8(0x69); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1910 |
emit_int8((unsigned char)(0xC0 | encode)); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
1911 |
emit_int32(value); |
1066 | 1912 |
} |
1913 |
} |
|
1914 |
||
21105
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
1915 |
void Assembler::imull(Register dst, Address src) { |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
1916 |
InstructionMark im(this); |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
1917 |
prefix(src, dst); |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
1918 |
emit_int8(0x0F); |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
1919 |
emit_int8((unsigned char) 0xAF); |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
1920 |
emit_operand(dst, src); |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
1921 |
} |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
1922 |
|
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
1923 |
|
1066 | 1924 |
void Assembler::incl(Address dst) { |
1925 |
// Don't use it directly. Use MacroAssembler::increment() instead. |
|
1926 |
InstructionMark im(this); |
|
1927 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1928 |
emit_int8((unsigned char)0xFF); |
1066 | 1929 |
emit_operand(rax, dst); |
1930 |
} |
|
1931 |
||
10264 | 1932 |
void Assembler::jcc(Condition cc, Label& L, bool maybe_short) { |
1933 |
InstructionMark im(this); |
|
1066 | 1934 |
assert((0 <= cc) && (cc < 16), "illegal cc"); |
1935 |
if (L.is_bound()) { |
|
1936 |
address dst = target(L); |
|
1937 |
assert(dst != NULL, "jcc most probably wrong"); |
|
1938 |
||
1939 |
const int short_size = 2; |
|
1940 |
const int long_size = 6; |
|
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
1941 |
intptr_t offs = (intptr_t)dst - (intptr_t)pc(); |
10264 | 1942 |
if (maybe_short && is8bit(offs - short_size)) { |
1066 | 1943 |
// 0111 tttn #8-bit disp |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1944 |
emit_int8(0x70 | cc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1945 |
emit_int8((offs - short_size) & 0xFF); |
1066 | 1946 |
} else { |
1947 |
// 0000 1111 1000 tttn #32-bit disp |
|
1948 |
assert(is_simm32(offs - long_size), |
|
1949 |
"must be 32bit offset (call4)"); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1950 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1951 |
emit_int8((unsigned char)(0x80 | cc)); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
1952 |
emit_int32(offs - long_size); |
1066 | 1953 |
} |
1954 |
} else { |
|
1955 |
// Note: could eliminate cond. jumps to this jump if condition |
|
1956 |
// is the same however, seems to be rather unlikely case. |
|
1957 |
// Note: use jccb() if label to be bound is very close to get |
|
1958 |
// an 8-bit displacement |
|
1959 |
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
|
1960 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1961 |
emit_int8((unsigned char)(0x80 | cc)); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
1962 |
emit_int32(0); |
1066 | 1963 |
} |
1964 |
} |
|
1965 |
||
1966 |
void Assembler::jccb(Condition cc, Label& L) { |
|
1967 |
if (L.is_bound()) { |
|
1968 |
const int short_size = 2; |
|
1969 |
address entry = target(L); |
|
11434
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
1970 |
#ifdef ASSERT |
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
1971 |
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
|
1972 |
intptr_t delta = short_branch_delta(); |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
1973 |
if (delta != 0) { |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
1974 |
dist += (dist < 0 ? (-delta) :delta); |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
1975 |
} |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
1976 |
assert(is8bit(dist), "Dispacement too large for a short jmp"); |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
1977 |
#endif |
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
1978 |
intptr_t offs = (intptr_t)entry - (intptr_t)pc(); |
1066 | 1979 |
// 0111 tttn #8-bit disp |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1980 |
emit_int8(0x70 | cc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1981 |
emit_int8((offs - short_size) & 0xFF); |
1066 | 1982 |
} else { |
1983 |
InstructionMark im(this); |
|
1984 |
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
|
1985 |
emit_int8(0x70 | cc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1986 |
emit_int8(0); |
1066 | 1987 |
} |
1988 |
} |
|
1989 |
||
1990 |
void Assembler::jmp(Address adr) { |
|
1991 |
InstructionMark im(this); |
|
1992 |
prefix(adr); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1993 |
emit_int8((unsigned char)0xFF); |
1066 | 1994 |
emit_operand(rsp, adr); |
1995 |
} |
|
1996 |
||
10264 | 1997 |
void Assembler::jmp(Label& L, bool maybe_short) { |
1066 | 1998 |
if (L.is_bound()) { |
1999 |
address entry = target(L); |
|
2000 |
assert(entry != NULL, "jmp most probably wrong"); |
|
2001 |
InstructionMark im(this); |
|
2002 |
const int short_size = 2; |
|
2003 |
const int long_size = 5; |
|
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
2004 |
intptr_t offs = entry - pc(); |
10264 | 2005 |
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
|
2006 |
emit_int8((unsigned char)0xEB); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2007 |
emit_int8((offs - short_size) & 0xFF); |
1066 | 2008 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2009 |
emit_int8((unsigned char)0xE9); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
2010 |
emit_int32(offs - long_size); |
1066 | 2011 |
} |
2012 |
} else { |
|
2013 |
// By default, forward jumps are always 32-bit displacements, since |
|
2014 |
// we can't yet know where the label will be bound. If you're sure that |
|
2015 |
// the forward jump will not run beyond 256 bytes, use jmpb to |
|
2016 |
// force an 8-bit displacement. |
|
2017 |
InstructionMark im(this); |
|
2018 |
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
|
2019 |
emit_int8((unsigned char)0xE9); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
2020 |
emit_int32(0); |
1066 | 2021 |
} |
2022 |
} |
|
2023 |
||
2024 |
void Assembler::jmp(Register entry) { |
|
2025 |
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
|
2026 |
emit_int8((unsigned char)0xFF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2027 |
emit_int8((unsigned char)(0xE0 | encode)); |
1066 | 2028 |
} |
2029 |
||
2030 |
void Assembler::jmp_literal(address dest, RelocationHolder const& rspec) { |
|
2031 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2032 |
emit_int8((unsigned char)0xE9); |
1066 | 2033 |
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
|
2034 |
intptr_t disp = dest - (pc() + sizeof(int32_t)); |
1066 | 2035 |
assert(is_simm32(disp), "must be 32bit offset (jmp)"); |
2036 |
emit_data(disp, rspec.reloc(), call32_operand); |
|
2037 |
} |
|
2038 |
||
2039 |
void Assembler::jmpb(Label& L) { |
|
2040 |
if (L.is_bound()) { |
|
2041 |
const int short_size = 2; |
|
2042 |
address entry = target(L); |
|
2043 |
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
|
2044 |
#ifdef ASSERT |
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
2045 |
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
|
2046 |
intptr_t delta = short_branch_delta(); |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
2047 |
if (delta != 0) { |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
2048 |
dist += (dist < 0 ? (-delta) :delta); |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
2049 |
} |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
2050 |
assert(is8bit(dist), "Dispacement too large for a short jmp"); |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
2051 |
#endif |
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
2052 |
intptr_t offs = entry - pc(); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2053 |
emit_int8((unsigned char)0xEB); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2054 |
emit_int8((offs - short_size) & 0xFF); |
1066 | 2055 |
} else { |
2056 |
InstructionMark im(this); |
|
2057 |
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
|
2058 |
emit_int8((unsigned char)0xEB); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2059 |
emit_int8(0); |
1066 | 2060 |
} |
2061 |
} |
|
2062 |
||
2063 |
void Assembler::ldmxcsr( Address src) { |
|
2064 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
2065 |
InstructionMark im(this); |
|
2066 |
prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2067 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2068 |
emit_int8((unsigned char)0xAE); |
1066 | 2069 |
emit_operand(as_Register(2), src); |
2070 |
} |
|
2071 |
||
2072 |
void Assembler::leal(Register dst, Address src) { |
|
2073 |
InstructionMark im(this); |
|
2074 |
#ifdef _LP64 |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2075 |
emit_int8(0x67); // addr32 |
1066 | 2076 |
prefix(src, dst); |
2077 |
#endif // LP64 |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2078 |
emit_int8((unsigned char)0x8D); |
1066 | 2079 |
emit_operand(dst, src); |
2080 |
} |
|
2081 |
||
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
2082 |
void Assembler::lfence() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2083 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2084 |
emit_int8((unsigned char)0xAE); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2085 |
emit_int8((unsigned char)0xE8); |
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
2086 |
} |
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
2087 |
|
1066 | 2088 |
void Assembler::lock() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2089 |
emit_int8((unsigned char)0xF0); |
1066 | 2090 |
} |
2091 |
||
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
2092 |
void Assembler::lzcntl(Register dst, Register src) { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
2093 |
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
|
2094 |
emit_int8((unsigned char)0xF3); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
2095 |
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
|
2096 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2097 |
emit_int8((unsigned char)0xBD); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2098 |
emit_int8((unsigned char)(0xC0 | encode)); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
2099 |
} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
2100 |
|
2338
a8660a1b709b
6822204: volatile fences should prefer lock:addl to actual mfence instructions
never
parents:
2332
diff
changeset
|
2101 |
// Emit mfence instruction |
1066 | 2102 |
void Assembler::mfence() { |
2338
a8660a1b709b
6822204: volatile fences should prefer lock:addl to actual mfence instructions
never
parents:
2332
diff
changeset
|
2103 |
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
|
2104 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2105 |
emit_int8((unsigned char)0xAE); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2106 |
emit_int8((unsigned char)0xF0); |
1066 | 2107 |
} |
2108 |
||
2109 |
void Assembler::mov(Register dst, Register src) { |
|
2110 |
LP64_ONLY(movq(dst, src)) NOT_LP64(movl(dst, src)); |
|
2111 |
} |
|
2112 |
||
2113 |
void Assembler::movapd(XMMRegister dst, XMMRegister src) { |
|
2114 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 2115 |
int vector_len = VM_Version::supports_avx512novl() ? AVX_512bit : AVX_128bit; |
2116 |
InstructionAttr attributes(vector_len, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
|
2117 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
2118 |
emit_int8(0x28); |
|
2119 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 2120 |
} |
2121 |
||
2122 |
void Assembler::movaps(XMMRegister dst, XMMRegister src) { |
|
2123 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 2124 |
int vector_len = VM_Version::supports_avx512novl() ? AVX_512bit : AVX_128bit; |
2125 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
|
2126 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
2127 |
emit_int8(0x28); |
|
2128 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 2129 |
} |
2130 |
||
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2131 |
void Assembler::movlhps(XMMRegister dst, XMMRegister src) { |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2132 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
34162 | 2133 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
2134 |
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
|
2135 |
emit_int8(0x16); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2136 |
emit_int8((unsigned char)(0xC0 | encode)); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2137 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2138 |
|
1066 | 2139 |
void Assembler::movb(Register dst, Address src) { |
2140 |
NOT_LP64(assert(dst->has_byte_register(), "must have byte register")); |
|
2141 |
InstructionMark im(this); |
|
2142 |
prefix(src, dst, true); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2143 |
emit_int8((unsigned char)0x8A); |
1066 | 2144 |
emit_operand(dst, src); |
2145 |
} |
|
2146 |
||
33465 | 2147 |
void Assembler::movddup(XMMRegister dst, XMMRegister src) { |
2148 |
NOT_LP64(assert(VM_Version::supports_sse3(), "")); |
|
34162 | 2149 |
int vector_len = VM_Version::supports_evex() ? AVX_512bit : AVX_128bit; |
2150 |
InstructionAttr attributes(vector_len, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
2151 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
33465 | 2152 |
emit_int8(0x12); |
2153 |
emit_int8(0xC0 | encode); |
|
2154 |
} |
|
2155 |
||
35113 | 2156 |
void Assembler::kmovbl(KRegister dst, Register src) { |
2157 |
assert(VM_Version::supports_avx512dq(), ""); |
|
2158 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2159 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
2160 |
emit_int8((unsigned char)0x92); |
|
2161 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2162 |
} |
|
2163 |
||
2164 |
void Assembler::kmovbl(Register dst, KRegister src) { |
|
2165 |
assert(VM_Version::supports_avx512dq(), ""); |
|
34203 | 2166 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
35113 | 2167 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
2168 |
emit_int8((unsigned char)0x93); |
|
2169 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2170 |
} |
|
2171 |
||
2172 |
void Assembler::kmovwl(KRegister dst, Register src) { |
|
2173 |
assert(VM_Version::supports_evex(), ""); |
|
2174 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2175 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
34203 | 2176 |
emit_int8((unsigned char)0x92); |
2177 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2178 |
} |
|
2179 |
||
35113 | 2180 |
void Assembler::kmovwl(Register dst, KRegister src) { |
2181 |
assert(VM_Version::supports_evex(), ""); |
|
2182 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2183 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
2184 |
emit_int8((unsigned char)0x93); |
|
2185 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2186 |
} |
|
2187 |
||
34203 | 2188 |
void Assembler::kmovdl(KRegister dst, Register src) { |
35113 | 2189 |
assert(VM_Version::supports_avx512bw(), ""); |
34203 | 2190 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
35113 | 2191 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
34203 | 2192 |
emit_int8((unsigned char)0x92); |
2193 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2194 |
} |
|
2195 |
||
35113 | 2196 |
void Assembler::kmovdl(Register dst, KRegister src) { |
2197 |
assert(VM_Version::supports_avx512bw(), ""); |
|
2198 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2199 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
2200 |
emit_int8((unsigned char)0x93); |
|
2201 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2202 |
} |
|
2203 |
||
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2204 |
void Assembler::kmovql(KRegister dst, KRegister src) { |
35113 | 2205 |
assert(VM_Version::supports_avx512bw(), ""); |
34162 | 2206 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
35113 | 2207 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
30624 | 2208 |
emit_int8((unsigned char)0x90); |
2209 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2210 |
} |
|
2211 |
||
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2212 |
void Assembler::kmovql(KRegister dst, Address src) { |
35113 | 2213 |
assert(VM_Version::supports_avx512bw(), ""); |
34162 | 2214 |
InstructionMark im(this); |
2215 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2216 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
30624 | 2217 |
emit_int8((unsigned char)0x90); |
2218 |
emit_operand((Register)dst, src); |
|
2219 |
} |
|
2220 |
||
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2221 |
void Assembler::kmovql(Address dst, KRegister src) { |
35113 | 2222 |
assert(VM_Version::supports_avx512bw(), ""); |
34162 | 2223 |
InstructionMark im(this); |
2224 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2225 |
vex_prefix(dst, 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
30624 | 2226 |
emit_int8((unsigned char)0x90); |
2227 |
emit_operand((Register)src, dst); |
|
2228 |
} |
|
2229 |
||
2230 |
void Assembler::kmovql(KRegister dst, Register src) { |
|
35113 | 2231 |
assert(VM_Version::supports_avx512bw(), ""); |
2232 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2233 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
30624 | 2234 |
emit_int8((unsigned char)0x92); |
2235 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2236 |
} |
|
2237 |
||
35113 | 2238 |
void Assembler::kmovql(Register dst, KRegister src) { |
2239 |
assert(VM_Version::supports_avx512bw(), ""); |
|
2240 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2241 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
2242 |
emit_int8((unsigned char)0x93); |
|
2243 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2244 |
} |
|
2245 |
||
34203 | 2246 |
// This instruction produces ZF or CF flags |
2247 |
void Assembler::kortestbl(KRegister src1, KRegister src2) { |
|
35113 | 2248 |
assert(VM_Version::supports_avx512dq(), ""); |
34162 | 2249 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
35113 | 2250 |
int encode = vex_prefix_and_encode(src1->encoding(), 0, src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34203 | 2251 |
emit_int8((unsigned char)0x98); |
2252 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2253 |
} |
|
2254 |
||
2255 |
// This instruction produces ZF or CF flags |
|
2256 |
void Assembler::kortestwl(KRegister src1, KRegister src2) { |
|
35113 | 2257 |
assert(VM_Version::supports_evex(), ""); |
34162 | 2258 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
35113 | 2259 |
int encode = vex_prefix_and_encode(src1->encoding(), 0, src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
34203 | 2260 |
emit_int8((unsigned char)0x98); |
2261 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2262 |
} |
|
2263 |
||
2264 |
// This instruction produces ZF or CF flags |
|
2265 |
void Assembler::kortestdl(KRegister src1, KRegister src2) { |
|
35113 | 2266 |
assert(VM_Version::supports_avx512bw(), ""); |
34203 | 2267 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
35113 | 2268 |
int encode = vex_prefix_and_encode(src1->encoding(), 0, src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
34203 | 2269 |
emit_int8((unsigned char)0x98); |
2270 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2271 |
} |
|
2272 |
||
2273 |
// This instruction produces ZF or CF flags |
|
2274 |
void Assembler::kortestql(KRegister src1, KRegister src2) { |
|
35113 | 2275 |
assert(VM_Version::supports_avx512bw(), ""); |
34203 | 2276 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); |
35113 | 2277 |
int encode = vex_prefix_and_encode(src1->encoding(), 0, src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
34203 | 2278 |
emit_int8((unsigned char)0x98); |
30624 | 2279 |
emit_int8((unsigned char)(0xC0 | encode)); |
2280 |
} |
|
1066 | 2281 |
|
2282 |
void Assembler::movb(Address dst, int imm8) { |
|
2283 |
InstructionMark im(this); |
|
2284 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2285 |
emit_int8((unsigned char)0xC6); |
1066 | 2286 |
emit_operand(rax, dst, 1); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2287 |
emit_int8(imm8); |
1066 | 2288 |
} |
2289 |
||
2290 |
||
2291 |
void Assembler::movb(Address dst, Register src) { |
|
2292 |
assert(src->has_byte_register(), "must have byte register"); |
|
2293 |
InstructionMark im(this); |
|
2294 |
prefix(dst, src, true); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2295 |
emit_int8((unsigned char)0x88); |
1066 | 2296 |
emit_operand(src, dst); |
2297 |
} |
|
2298 |
||
2299 |
void Assembler::movdl(XMMRegister dst, Register src) { |
|
2300 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 2301 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
2302 |
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
|
2303 |
emit_int8(0x6E); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2304 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 2305 |
} |
2306 |
||
2307 |
void Assembler::movdl(Register dst, XMMRegister src) { |
|
2308 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 2309 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
1066 | 2310 |
// swap src/dst to get correct prefix |
34162 | 2311 |
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
|
2312 |
emit_int8(0x7E); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2313 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 2314 |
} |
2315 |
||
8494
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
2316 |
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
|
2317 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 2318 |
InstructionMark im(this); |
2319 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2320 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
2321 |
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
|
2322 |
emit_int8(0x6E); |
8494
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
2323 |
emit_operand(dst, src); |
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
2324 |
} |
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
2325 |
|
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2326 |
void Assembler::movdl(Address dst, XMMRegister src) { |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2327 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 2328 |
InstructionMark im(this); |
2329 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2330 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
2331 |
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
|
2332 |
emit_int8(0x7E); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2333 |
emit_operand(src, dst); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2334 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2335 |
|
1066 | 2336 |
void Assembler::movdqa(XMMRegister dst, XMMRegister src) { |
2337 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 2338 |
int vector_len = VM_Version::supports_avx512novl() ? AVX_512bit : AVX_128bit; |
2339 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
2340 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
2341 |
emit_int8(0x6F); |
|
2342 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 2343 |
} |
2344 |
||
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
2345 |
void Assembler::movdqa(XMMRegister dst, Address src) { |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
2346 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 2347 |
InstructionMark im(this); |
2348 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
2349 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
|
2350 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
2351 |
emit_int8(0x6F); |
|
2352 |
emit_operand(dst, src); |
|
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
2353 |
} |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
2354 |
|
1437 | 2355 |
void Assembler::movdqu(XMMRegister dst, Address src) { |
2356 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 2357 |
InstructionMark im(this); |
2358 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
|
2359 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
|
2360 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
2361 |
emit_int8(0x6F); |
|
2362 |
emit_operand(dst, src); |
|
1437 | 2363 |
} |
2364 |
||
2365 |
void Assembler::movdqu(XMMRegister dst, XMMRegister src) { |
|
2366 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 2367 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
2368 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
2369 |
emit_int8(0x6F); |
|
2370 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1437 | 2371 |
} |
2372 |
||
2373 |
void Assembler::movdqu(Address dst, XMMRegister src) { |
|
2374 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 2375 |
InstructionMark im(this); |
2376 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
2377 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
|
2378 |
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
|
2379 |
emit_int8(0x7F); |
1437 | 2380 |
emit_operand(src, dst); |
2381 |
} |
|
2382 |
||
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2383 |
// Move Unaligned 256bit Vector |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2384 |
void Assembler::vmovdqu(XMMRegister dst, XMMRegister src) { |
24325 | 2385 |
assert(UseAVX > 0, ""); |
34162 | 2386 |
InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
2387 |
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
|
2388 |
emit_int8(0x6F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2389 |
emit_int8((unsigned char)(0xC0 | encode)); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2390 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2391 |
|
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2392 |
void Assembler::vmovdqu(XMMRegister dst, Address src) { |
24325 | 2393 |
assert(UseAVX > 0, ""); |
34162 | 2394 |
InstructionMark im(this); |
2395 |
InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
|
2396 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
|
2397 |
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
|
2398 |
emit_int8(0x6F); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2399 |
emit_operand(dst, src); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2400 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2401 |
|
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2402 |
void Assembler::vmovdqu(Address dst, XMMRegister src) { |
24325 | 2403 |
assert(UseAVX > 0, ""); |
34162 | 2404 |
InstructionMark im(this); |
2405 |
InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
2406 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
|
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2407 |
// swap src<->dst for encoding |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2408 |
assert(src != xnoreg, "sanity"); |
34162 | 2409 |
vex_prefix(dst, 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
30624 | 2410 |
emit_int8(0x7F); |
2411 |
emit_operand(src, dst); |
|
2412 |
} |
|
2413 |
||
2414 |
// Move Unaligned EVEX enabled Vector (programmable : 8,16,32,64) |
|
34203 | 2415 |
void Assembler::evmovdqub(XMMRegister dst, XMMRegister src, int vector_len) { |
2416 |
assert(VM_Version::supports_evex(), ""); |
|
35113 | 2417 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34203 | 2418 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
2419 |
emit_int8(0x6F); |
|
2420 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2421 |
} |
|
2422 |
||
2423 |
void Assembler::evmovdqub(XMMRegister dst, Address src, int vector_len) { |
|
2424 |
assert(VM_Version::supports_evex(), ""); |
|
2425 |
InstructionMark im(this); |
|
2426 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
|
2427 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
|
2428 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
2429 |
emit_int8(0x6F); |
|
2430 |
emit_operand(dst, src); |
|
2431 |
} |
|
2432 |
||
2433 |
void Assembler::evmovdqub(Address dst, XMMRegister src, int vector_len) { |
|
2434 |
assert(VM_Version::supports_evex(), ""); |
|
2435 |
assert(src != xnoreg, "sanity"); |
|
2436 |
InstructionMark im(this); |
|
35113 | 2437 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34203 | 2438 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
2439 |
vex_prefix(dst, 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
2440 |
emit_int8(0x7F); |
|
2441 |
emit_operand(src, dst); |
|
2442 |
} |
|
2443 |
||
2444 |
void Assembler::evmovdquw(XMMRegister dst, XMMRegister src, int vector_len) { |
|
2445 |
assert(VM_Version::supports_evex(), ""); |
|
35113 | 2446 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34203 | 2447 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
2448 |
emit_int8(0x6F); |
|
2449 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2450 |
} |
|
2451 |
||
2452 |
void Assembler::evmovdquw(XMMRegister dst, Address src, int vector_len) { |
|
2453 |
assert(VM_Version::supports_evex(), ""); |
|
2454 |
InstructionMark im(this); |
|
2455 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
|
2456 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
|
2457 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
2458 |
emit_int8(0x6F); |
|
2459 |
emit_operand(dst, src); |
|
2460 |
} |
|
2461 |
||
2462 |
void Assembler::evmovdquw(Address dst, XMMRegister src, int vector_len) { |
|
2463 |
assert(VM_Version::supports_evex(), ""); |
|
2464 |
assert(src != xnoreg, "sanity"); |
|
2465 |
InstructionMark im(this); |
|
35113 | 2466 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34203 | 2467 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
2468 |
vex_prefix(dst, 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
2469 |
emit_int8(0x7F); |
|
2470 |
emit_operand(src, dst); |
|
2471 |
} |
|
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2472 |
void Assembler::evmovdqul(XMMRegister dst, XMMRegister src, int vector_len) { |
34162 | 2473 |
assert(VM_Version::supports_evex(), ""); |
2474 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
2475 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
30624 | 2476 |
emit_int8(0x6F); |
2477 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
2478 |
} |
|
2479 |
||
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2480 |
void Assembler::evmovdqul(XMMRegister dst, Address src, int vector_len) { |
34162 | 2481 |
assert(VM_Version::supports_evex(), ""); |
2482 |
InstructionMark im(this); |
|
2483 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
|
2484 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
|
2485 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
30624 | 2486 |
emit_int8(0x6F); |
2487 |
emit_operand(dst, src); |
|
2488 |
} |
|
2489 |
||
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2490 |
void Assembler::evmovdqul(Address dst, XMMRegister src, int vector_len) { |
34162 | 2491 |
assert(VM_Version::supports_evex(), ""); |
30624 | 2492 |
assert(src != xnoreg, "sanity"); |
34162 | 2493 |
InstructionMark im(this); |
2494 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
2495 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
|
2496 |
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
|
2497 |
emit_int8(0x7F); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2498 |
emit_operand(src, dst); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2499 |
} |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2500 |
|
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2501 |
void Assembler::evmovdquq(XMMRegister dst, XMMRegister src, int vector_len) { |
34162 | 2502 |
assert(VM_Version::supports_evex(), ""); |
2503 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
2504 |
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
|
2505 |
emit_int8(0x6F); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2506 |
emit_int8((unsigned char)(0xC0 | encode)); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2507 |
} |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2508 |
|
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2509 |
void Assembler::evmovdquq(XMMRegister dst, Address src, int vector_len) { |
34162 | 2510 |
assert(VM_Version::supports_evex(), ""); |
2511 |
InstructionMark im(this); |
|
2512 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
|
2513 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
|
2514 |
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
|
2515 |
emit_int8(0x6F); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2516 |
emit_operand(dst, src); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2517 |
} |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2518 |
|
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2519 |
void Assembler::evmovdquq(Address dst, XMMRegister src, int vector_len) { |
34162 | 2520 |
assert(VM_Version::supports_evex(), ""); |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
2521 |
assert(src != xnoreg, "sanity"); |
34162 | 2522 |
InstructionMark im(this); |
2523 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
2524 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
|
2525 |
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
|
2526 |
emit_int8(0x7F); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2527 |
emit_operand(src, dst); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2528 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
2529 |
|
1066 | 2530 |
// Uses zero extension on 64bit |
2531 |
||
2532 |
void Assembler::movl(Register dst, int32_t imm32) { |
|
2533 |
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
|
2534 |
emit_int8((unsigned char)(0xB8 | encode)); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
2535 |
emit_int32(imm32); |
1066 | 2536 |
} |
2537 |
||
2538 |
void Assembler::movl(Register dst, Register src) { |
|
2539 |
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
|
2540 |
emit_int8((unsigned char)0x8B); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2541 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 2542 |
} |
2543 |
||
2544 |
void Assembler::movl(Register dst, Address src) { |
|
2545 |
InstructionMark im(this); |
|
2546 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2547 |
emit_int8((unsigned char)0x8B); |
1066 | 2548 |
emit_operand(dst, src); |
2549 |
} |
|
2550 |
||
2551 |
void Assembler::movl(Address dst, int32_t imm32) { |
|
2552 |
InstructionMark im(this); |
|
2553 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2554 |
emit_int8((unsigned char)0xC7); |
1066 | 2555 |
emit_operand(rax, dst, 4); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
2556 |
emit_int32(imm32); |
1066 | 2557 |
} |
2558 |
||
2559 |
void Assembler::movl(Address dst, Register src) { |
|
2560 |
InstructionMark im(this); |
|
2561 |
prefix(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2562 |
emit_int8((unsigned char)0x89); |
1066 | 2563 |
emit_operand(src, dst); |
2564 |
} |
|
2565 |
||
2566 |
// New cpus require to use movsd and movss to avoid partial register stall |
|
2567 |
// when loading from memory. But for old Opteron use movlpd instead of movsd. |
|
2568 |
// The selection is done in MacroAssembler::movdbl() and movflt(). |
|
2569 |
void Assembler::movlpd(XMMRegister dst, Address src) { |
|
2570 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 2571 |
InstructionMark im(this); |
2572 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2573 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
2574 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
2575 |
emit_int8(0x12); |
|
2576 |
emit_operand(dst, src); |
|
1066 | 2577 |
} |
2578 |
||
2579 |
void Assembler::movq( MMXRegister dst, Address src ) { |
|
2580 |
assert( VM_Version::supports_mmx(), "" ); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2581 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2582 |
emit_int8(0x6F); |
1066 | 2583 |
emit_operand(dst, src); |
2584 |
} |
|
2585 |
||
2586 |
void Assembler::movq( Address dst, MMXRegister src ) { |
|
2587 |
assert( VM_Version::supports_mmx(), "" ); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2588 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2589 |
emit_int8(0x7F); |
1066 | 2590 |
// workaround gcc (3.2.1-7a) bug |
2591 |
// In that version of gcc with only an emit_operand(MMX, Address) |
|
2592 |
// gcc will tail jump and try and reverse the parameters completely |
|
2593 |
// obliterating dst in the process. By having a version available |
|
2594 |
// that doesn't need to swap the args at the tail jump the bug is |
|
2595 |
// avoided. |
|
2596 |
emit_operand(dst, src); |
|
2597 |
} |
|
2598 |
||
2599 |
void Assembler::movq(XMMRegister dst, Address src) { |
|
2600 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
2601 |
InstructionMark im(this); |
|
34162 | 2602 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
2603 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
2604 |
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
|
2605 |
emit_int8(0x7E); |
1066 | 2606 |
emit_operand(dst, src); |
2607 |
} |
|
2608 |
||
2609 |
void Assembler::movq(Address dst, XMMRegister src) { |
|
2610 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
2611 |
InstructionMark im(this); |
|
34162 | 2612 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
2613 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
2614 |
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
|
2615 |
emit_int8((unsigned char)0xD6); |
1066 | 2616 |
emit_operand(src, dst); |
2617 |
} |
|
2618 |
||
2619 |
void Assembler::movsbl(Register dst, Address src) { // movsxb |
|
2620 |
InstructionMark im(this); |
|
2621 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2622 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2623 |
emit_int8((unsigned char)0xBE); |
1066 | 2624 |
emit_operand(dst, src); |
2625 |
} |
|
2626 |
||
2627 |
void Assembler::movsbl(Register dst, Register src) { // movsxb |
|
2628 |
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
|
2629 |
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
|
2630 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2631 |
emit_int8((unsigned char)0xBE); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2632 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 2633 |
} |
2634 |
||
2635 |
void Assembler::movsd(XMMRegister dst, XMMRegister src) { |
|
2636 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 2637 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
2638 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
2639 |
emit_int8(0x10); |
|
2640 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 2641 |
} |
2642 |
||
2643 |
void Assembler::movsd(XMMRegister dst, Address src) { |
|
2644 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 2645 |
InstructionMark im(this); |
2646 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2647 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
2648 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
2649 |
emit_int8(0x10); |
|
2650 |
emit_operand(dst, src); |
|
1066 | 2651 |
} |
2652 |
||
2653 |
void Assembler::movsd(Address dst, XMMRegister src) { |
|
2654 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
2655 |
InstructionMark im(this); |
|
34162 | 2656 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
2657 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
2658 |
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
|
2659 |
emit_int8(0x11); |
1066 | 2660 |
emit_operand(src, dst); |
2661 |
} |
|
2662 |
||
2663 |
void Assembler::movss(XMMRegister dst, XMMRegister src) { |
|
2664 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 2665 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
2666 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
2667 |
emit_int8(0x10); |
|
2668 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 2669 |
} |
2670 |
||
2671 |
void Assembler::movss(XMMRegister dst, Address src) { |
|
2672 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 2673 |
InstructionMark im(this); |
2674 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2675 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
2676 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
2677 |
emit_int8(0x10); |
|
2678 |
emit_operand(dst, src); |
|
1066 | 2679 |
} |
2680 |
||
2681 |
void Assembler::movss(Address dst, XMMRegister src) { |
|
2682 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 2683 |
InstructionMark im(this); |
2684 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
|
2685 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
2686 |
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
|
2687 |
emit_int8(0x11); |
1066 | 2688 |
emit_operand(src, dst); |
2689 |
} |
|
2690 |
||
2691 |
void Assembler::movswl(Register dst, Address src) { // movsxw |
|
2692 |
InstructionMark im(this); |
|
2693 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2694 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2695 |
emit_int8((unsigned char)0xBF); |
1066 | 2696 |
emit_operand(dst, src); |
2697 |
} |
|
2698 |
||
2699 |
void Assembler::movswl(Register dst, Register src) { // movsxw |
|
2700 |
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
|
2701 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2702 |
emit_int8((unsigned char)0xBF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2703 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 2704 |
} |
2705 |
||
2706 |
void Assembler::movw(Address dst, int imm16) { |
|
2707 |
InstructionMark im(this); |
|
2708 |
||
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2709 |
emit_int8(0x66); // switch to 16-bit mode |
1066 | 2710 |
prefix(dst); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2711 |
emit_int8((unsigned char)0xC7); |
1066 | 2712 |
emit_operand(rax, dst, 2); |
14831
84828ee2a91c
8004536: replace AbstractAssembler emit_word with emit_int16
twisti
parents:
14626
diff
changeset
|
2713 |
emit_int16(imm16); |
1066 | 2714 |
} |
2715 |
||
2716 |
void Assembler::movw(Register dst, Address src) { |
|
2717 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2718 |
emit_int8(0x66); |
1066 | 2719 |
prefix(src, dst); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2720 |
emit_int8((unsigned char)0x8B); |
1066 | 2721 |
emit_operand(dst, src); |
2722 |
} |
|
2723 |
||
2724 |
void Assembler::movw(Address dst, Register src) { |
|
2725 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2726 |
emit_int8(0x66); |
1066 | 2727 |
prefix(dst, src); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2728 |
emit_int8((unsigned char)0x89); |
1066 | 2729 |
emit_operand(src, dst); |
2730 |
} |
|
2731 |
||
2732 |
void Assembler::movzbl(Register dst, Address src) { // movzxb |
|
2733 |
InstructionMark im(this); |
|
2734 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2735 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2736 |
emit_int8((unsigned char)0xB6); |
1066 | 2737 |
emit_operand(dst, src); |
2738 |
} |
|
2739 |
||
2740 |
void Assembler::movzbl(Register dst, Register src) { // movzxb |
|
2741 |
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
|
2742 |
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
|
2743 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2744 |
emit_int8((unsigned char)0xB6); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2745 |
emit_int8(0xC0 | encode); |
1066 | 2746 |
} |
2747 |
||
2748 |
void Assembler::movzwl(Register dst, Address src) { // movzxw |
|
2749 |
InstructionMark im(this); |
|
2750 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2751 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2752 |
emit_int8((unsigned char)0xB7); |
1066 | 2753 |
emit_operand(dst, src); |
2754 |
} |
|
2755 |
||
2756 |
void Assembler::movzwl(Register dst, Register src) { // movzxw |
|
2757 |
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
|
2758 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2759 |
emit_int8((unsigned char)0xB7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2760 |
emit_int8(0xC0 | encode); |
1066 | 2761 |
} |
2762 |
||
2763 |
void Assembler::mull(Address src) { |
|
2764 |
InstructionMark im(this); |
|
2765 |
prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2766 |
emit_int8((unsigned char)0xF7); |
1066 | 2767 |
emit_operand(rsp, src); |
2768 |
} |
|
2769 |
||
2770 |
void Assembler::mull(Register src) { |
|
2771 |
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
|
2772 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2773 |
emit_int8((unsigned char)(0xE0 | encode)); |
1066 | 2774 |
} |
2775 |
||
2776 |
void Assembler::mulsd(XMMRegister dst, Address src) { |
|
2777 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 2778 |
InstructionMark im(this); |
2779 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2780 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
2781 |
simd_prefix(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
2782 |
emit_int8(0x59); |
|
2783 |
emit_operand(dst, src); |
|
1066 | 2784 |
} |
2785 |
||
2786 |
void Assembler::mulsd(XMMRegister dst, XMMRegister src) { |
|
2787 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 2788 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
2789 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
2790 |
emit_int8(0x59); |
|
2791 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 2792 |
} |
2793 |
||
2794 |
void Assembler::mulss(XMMRegister dst, Address src) { |
|
2795 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 2796 |
InstructionMark im(this); |
2797 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
2798 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
2799 |
simd_prefix(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
2800 |
emit_int8(0x59); |
|
2801 |
emit_operand(dst, src); |
|
1066 | 2802 |
} |
2803 |
||
2804 |
void Assembler::mulss(XMMRegister dst, XMMRegister src) { |
|
2805 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 2806 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
2807 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
2808 |
emit_int8(0x59); |
|
2809 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 2810 |
} |
2811 |
||
2812 |
void Assembler::negl(Register dst) { |
|
2813 |
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
|
2814 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2815 |
emit_int8((unsigned char)(0xD8 | encode)); |
1066 | 2816 |
} |
2817 |
||
1 | 2818 |
void Assembler::nop(int i) { |
1066 | 2819 |
#ifdef ASSERT |
1 | 2820 |
assert(i > 0, " "); |
1066 | 2821 |
// The fancy nops aren't currently recognized by debuggers making it a |
2822 |
// pain to disassemble code while debugging. If asserts are on clearly |
|
2823 |
// speed is not an issue so simply use the single byte traditional nop |
|
2824 |
// to do alignment. |
|
2825 |
||
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2826 |
for (; i > 0 ; i--) emit_int8((unsigned char)0x90); |
1066 | 2827 |
return; |
2828 |
||
2829 |
#endif // ASSERT |
|
2830 |
||
1 | 2831 |
if (UseAddressNop && VM_Version::is_intel()) { |
2832 |
// |
|
2833 |
// Using multi-bytes nops "0x0F 0x1F [address]" for Intel |
|
2834 |
// 1: 0x90 |
|
2835 |
// 2: 0x66 0x90 |
|
2836 |
// 3: 0x66 0x66 0x90 (don't use "0x0F 0x1F 0x00" - need patching safe padding) |
|
2837 |
// 4: 0x0F 0x1F 0x40 0x00 |
|
2838 |
// 5: 0x0F 0x1F 0x44 0x00 0x00 |
|
2839 |
// 6: 0x66 0x0F 0x1F 0x44 0x00 0x00 |
|
2840 |
// 7: 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 |
|
2841 |
// 8: 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
2842 |
// 9: 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
2843 |
// 10: 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
2844 |
// 11: 0x66 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
2845 |
||
2846 |
// The rest coding is Intel specific - don't use consecutive address nops |
|
2847 |
||
2848 |
// 12: 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x66 0x66 0x66 0x90 |
|
2849 |
// 13: 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x66 0x66 0x66 0x90 |
|
2850 |
// 14: 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x66 0x66 0x66 0x90 |
|
2851 |
// 15: 0x66 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x66 0x66 0x66 0x90 |
|
2852 |
||
2853 |
while(i >= 15) { |
|
2854 |
// For Intel don't generate consecutive addess nops (mix with regular nops) |
|
2855 |
i -= 15; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2856 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2857 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2858 |
emit_int8(0x66); // size prefix |
1 | 2859 |
addr_nop_8(); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2860 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2861 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2862 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2863 |
emit_int8((unsigned char)0x90); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2864 |
// nop |
1 | 2865 |
} |
2866 |
switch (i) { |
|
2867 |
case 14: |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2868 |
emit_int8(0x66); // size prefix |
1 | 2869 |
case 13: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2870 |
emit_int8(0x66); // size prefix |
1 | 2871 |
case 12: |
2872 |
addr_nop_8(); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2873 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2874 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2875 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2876 |
emit_int8((unsigned char)0x90); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2877 |
// nop |
1 | 2878 |
break; |
2879 |
case 11: |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2880 |
emit_int8(0x66); // size prefix |
1 | 2881 |
case 10: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2882 |
emit_int8(0x66); // size prefix |
1 | 2883 |
case 9: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2884 |
emit_int8(0x66); // size prefix |
1 | 2885 |
case 8: |
2886 |
addr_nop_8(); |
|
2887 |
break; |
|
2888 |
case 7: |
|
2889 |
addr_nop_7(); |
|
2890 |
break; |
|
2891 |
case 6: |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2892 |
emit_int8(0x66); // size prefix |
1 | 2893 |
case 5: |
2894 |
addr_nop_5(); |
|
2895 |
break; |
|
2896 |
case 4: |
|
2897 |
addr_nop_4(); |
|
2898 |
break; |
|
2899 |
case 3: |
|
2900 |
// 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
|
2901 |
emit_int8(0x66); // size prefix |
1 | 2902 |
case 2: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2903 |
emit_int8(0x66); // size prefix |
1 | 2904 |
case 1: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2905 |
emit_int8((unsigned char)0x90); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2906 |
// nop |
1 | 2907 |
break; |
2908 |
default: |
|
2909 |
assert(i == 0, " "); |
|
2910 |
} |
|
2911 |
return; |
|
2912 |
} |
|
2913 |
if (UseAddressNop && VM_Version::is_amd()) { |
|
2914 |
// |
|
2915 |
// Using multi-bytes nops "0x0F 0x1F [address]" for AMD. |
|
2916 |
// 1: 0x90 |
|
2917 |
// 2: 0x66 0x90 |
|
2918 |
// 3: 0x66 0x66 0x90 (don't use "0x0F 0x1F 0x00" - need patching safe padding) |
|
2919 |
// 4: 0x0F 0x1F 0x40 0x00 |
|
2920 |
// 5: 0x0F 0x1F 0x44 0x00 0x00 |
|
2921 |
// 6: 0x66 0x0F 0x1F 0x44 0x00 0x00 |
|
2922 |
// 7: 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 |
|
2923 |
// 8: 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
2924 |
// 9: 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
2925 |
// 10: 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
2926 |
// 11: 0x66 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
2927 |
||
2928 |
// The rest coding is AMD specific - use consecutive address nops |
|
2929 |
||
2930 |
// 12: 0x66 0x0F 0x1F 0x44 0x00 0x00 0x66 0x0F 0x1F 0x44 0x00 0x00 |
|
2931 |
// 13: 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 0x66 0x0F 0x1F 0x44 0x00 0x00 |
|
2932 |
// 14: 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 |
|
2933 |
// 15: 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 |
|
2934 |
// 16: 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
2935 |
// Size prefixes (0x66) are added for larger sizes |
|
2936 |
||
2937 |
while(i >= 22) { |
|
2938 |
i -= 11; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2939 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2940 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2941 |
emit_int8(0x66); // size prefix |
1 | 2942 |
addr_nop_8(); |
2943 |
} |
|
2944 |
// Generate first nop for size between 21-12 |
|
2945 |
switch (i) { |
|
2946 |
case 21: |
|
2947 |
i -= 1; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2948 |
emit_int8(0x66); // size prefix |
1 | 2949 |
case 20: |
2950 |
case 19: |
|
2951 |
i -= 1; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2952 |
emit_int8(0x66); // size prefix |
1 | 2953 |
case 18: |
2954 |
case 17: |
|
2955 |
i -= 1; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2956 |
emit_int8(0x66); // size prefix |
1 | 2957 |
case 16: |
2958 |
case 15: |
|
2959 |
i -= 8; |
|
2960 |
addr_nop_8(); |
|
2961 |
break; |
|
2962 |
case 14: |
|
2963 |
case 13: |
|
2964 |
i -= 7; |
|
2965 |
addr_nop_7(); |
|
2966 |
break; |
|
2967 |
case 12: |
|
2968 |
i -= 6; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2969 |
emit_int8(0x66); // size prefix |
1 | 2970 |
addr_nop_5(); |
2971 |
break; |
|
2972 |
default: |
|
2973 |
assert(i < 12, " "); |
|
2974 |
} |
|
2975 |
||
2976 |
// Generate second nop for size between 11-1 |
|
2977 |
switch (i) { |
|
2978 |
case 11: |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2979 |
emit_int8(0x66); // size prefix |
1 | 2980 |
case 10: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2981 |
emit_int8(0x66); // size prefix |
1 | 2982 |
case 9: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2983 |
emit_int8(0x66); // size prefix |
1 | 2984 |
case 8: |
2985 |
addr_nop_8(); |
|
2986 |
break; |
|
2987 |
case 7: |
|
2988 |
addr_nop_7(); |
|
2989 |
break; |
|
2990 |
case 6: |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2991 |
emit_int8(0x66); // size prefix |
1 | 2992 |
case 5: |
2993 |
addr_nop_5(); |
|
2994 |
break; |
|
2995 |
case 4: |
|
2996 |
addr_nop_4(); |
|
2997 |
break; |
|
2998 |
case 3: |
|
2999 |
// 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
|
3000 |
emit_int8(0x66); // size prefix |
1 | 3001 |
case 2: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3002 |
emit_int8(0x66); // size prefix |
1 | 3003 |
case 1: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3004 |
emit_int8((unsigned char)0x90); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3005 |
// nop |
1 | 3006 |
break; |
3007 |
default: |
|
3008 |
assert(i == 0, " "); |
|
3009 |
} |
|
3010 |
return; |
|
3011 |
} |
|
3012 |
||
3013 |
// Using nops with size prefixes "0x66 0x90". |
|
3014 |
// From AMD Optimization Guide: |
|
3015 |
// 1: 0x90 |
|
3016 |
// 2: 0x66 0x90 |
|
3017 |
// 3: 0x66 0x66 0x90 |
|
3018 |
// 4: 0x66 0x66 0x66 0x90 |
|
3019 |
// 5: 0x66 0x66 0x90 0x66 0x90 |
|
3020 |
// 6: 0x66 0x66 0x90 0x66 0x66 0x90 |
|
3021 |
// 7: 0x66 0x66 0x66 0x90 0x66 0x66 0x90 |
|
3022 |
// 8: 0x66 0x66 0x66 0x90 0x66 0x66 0x66 0x90 |
|
3023 |
// 9: 0x66 0x66 0x90 0x66 0x66 0x90 0x66 0x66 0x90 |
|
3024 |
// 10: 0x66 0x66 0x66 0x90 0x66 0x66 0x90 0x66 0x66 0x90 |
|
3025 |
// |
|
3026 |
while(i > 12) { |
|
3027 |
i -= 4; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3028 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3029 |
emit_int8(0x66); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3030 |
emit_int8(0x66); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3031 |
emit_int8((unsigned char)0x90); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3032 |
// nop |
1 | 3033 |
} |
3034 |
// 1 - 12 nops |
|
3035 |
if(i > 8) { |
|
3036 |
if(i > 9) { |
|
3037 |
i -= 1; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3038 |
emit_int8(0x66); |
1 | 3039 |
} |
3040 |
i -= 3; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3041 |
emit_int8(0x66); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3042 |
emit_int8(0x66); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3043 |
emit_int8((unsigned char)0x90); |
1 | 3044 |
} |
3045 |
// 1 - 8 nops |
|
3046 |
if(i > 4) { |
|
3047 |
if(i > 6) { |
|
3048 |
i -= 1; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3049 |
emit_int8(0x66); |
1 | 3050 |
} |
3051 |
i -= 3; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3052 |
emit_int8(0x66); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3053 |
emit_int8(0x66); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3054 |
emit_int8((unsigned char)0x90); |
1 | 3055 |
} |
3056 |
switch (i) { |
|
3057 |
case 4: |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3058 |
emit_int8(0x66); |
1 | 3059 |
case 3: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3060 |
emit_int8(0x66); |
1 | 3061 |
case 2: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3062 |
emit_int8(0x66); |
1 | 3063 |
case 1: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3064 |
emit_int8((unsigned char)0x90); |
1 | 3065 |
break; |
3066 |
default: |
|
3067 |
assert(i == 0, " "); |
|
3068 |
} |
|
3069 |
} |
|
3070 |
||
1066 | 3071 |
void Assembler::notl(Register dst) { |
3072 |
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
|
3073 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3074 |
emit_int8((unsigned char)(0xD0 | encode)); |
1066 | 3075 |
} |
3076 |
||
3077 |
void Assembler::orl(Address dst, int32_t imm32) { |
|
3078 |
InstructionMark im(this); |
|
3079 |
prefix(dst); |
|
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
3080 |
emit_arith_operand(0x81, rcx, dst, imm32); |
1066 | 3081 |
} |
3082 |
||
3083 |
void Assembler::orl(Register dst, int32_t imm32) { |
|
3084 |
prefix(dst); |
|
3085 |
emit_arith(0x81, 0xC8, dst, imm32); |
|
3086 |
} |
|
3087 |
||
3088 |
void Assembler::orl(Register dst, Address src) { |
|
3089 |
InstructionMark im(this); |
|
3090 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3091 |
emit_int8(0x0B); |
1066 | 3092 |
emit_operand(dst, src); |
3093 |
} |
|
3094 |
||
3095 |
void Assembler::orl(Register dst, Register src) { |
|
3096 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
|
3097 |
emit_arith(0x0B, 0xC0, dst, src); |
|
3098 |
} |
|
3099 |
||
31129
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
3100 |
void Assembler::orl(Address dst, Register src) { |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
3101 |
InstructionMark im(this); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
3102 |
prefix(dst, src); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
3103 |
emit_int8(0x09); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
3104 |
emit_operand(src, dst); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
3105 |
} |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
3106 |
|
11427 | 3107 |
void Assembler::packuswb(XMMRegister dst, Address src) { |
3108 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
3109 |
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); |
|
34162 | 3110 |
InstructionMark im(this); |
35113 | 3111 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 3112 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
3113 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3114 |
emit_int8(0x67); |
|
3115 |
emit_operand(dst, src); |
|
11427 | 3116 |
} |
3117 |
||
3118 |
void Assembler::packuswb(XMMRegister dst, XMMRegister src) { |
|
3119 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
35113 | 3120 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 3121 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
3122 |
emit_int8(0x67); |
|
3123 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 3124 |
} |
3125 |
||
3126 |
void Assembler::vpackuswb(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
3127 |
assert(UseAVX > 0, "some form of AVX must be enabled"); |
|
35113 | 3128 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 3129 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
3130 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3131 |
emit_int8(0x67); |
|
3132 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 3133 |
} |
3134 |
||
3135 |
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
|
3136 |
assert(VM_Version::supports_avx2(), ""); |
34162 | 3137 |
InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
3138 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
15612
d4073ad8ce3d
8007708: compiler/6855215 assert(VM_Version::supports_sse4_2())
kvn
parents:
15483
diff
changeset
|
3139 |
emit_int8(0x00); |
d4073ad8ce3d
8007708: compiler/6855215 assert(VM_Version::supports_sse4_2())
kvn
parents:
15483
diff
changeset
|
3140 |
emit_int8(0xC0 | encode); |
d4073ad8ce3d
8007708: compiler/6855215 assert(VM_Version::supports_sse4_2())
kvn
parents:
15483
diff
changeset
|
3141 |
emit_int8(imm8); |
15242
695bb216be99
6896617: Optimize sun.nio.cs.ISO_8859_1$Encode.encodeArrayLoop() on x86
kvn
parents:
15117
diff
changeset
|
3142 |
} |
695bb216be99
6896617: Optimize sun.nio.cs.ISO_8859_1$Encode.encodeArrayLoop() on x86
kvn
parents:
15117
diff
changeset
|
3143 |
|
23491 | 3144 |
void Assembler::pause() { |
3145 |
emit_int8((unsigned char)0xF3); |
|
3146 |
emit_int8((unsigned char)0x90); |
|
3147 |
} |
|
3148 |
||
2348 | 3149 |
void Assembler::pcmpestri(XMMRegister dst, Address src, int imm8) { |
3150 |
assert(VM_Version::supports_sse4_2(), ""); |
|
11427 | 3151 |
InstructionMark im(this); |
34162 | 3152 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
3153 |
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
|
3154 |
emit_int8(0x61); |
2348 | 3155 |
emit_operand(dst, src); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3156 |
emit_int8(imm8); |
2348 | 3157 |
} |
3158 |
||
3159 |
void Assembler::pcmpestri(XMMRegister dst, XMMRegister src, int imm8) { |
|
3160 |
assert(VM_Version::supports_sse4_2(), ""); |
|
34162 | 3161 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
3162 |
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
|
3163 |
emit_int8(0x61); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3164 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3165 |
emit_int8(imm8); |
2348 | 3166 |
} |
3167 |
||
34203 | 3168 |
// In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst |
3169 |
void Assembler::pcmpeqb(XMMRegister dst, XMMRegister src) { |
|
35113 | 3170 |
assert(VM_Version::supports_sse2(), ""); |
34203 | 3171 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
3172 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3173 |
emit_int8(0x74); |
|
3174 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3175 |
} |
|
3176 |
||
3177 |
// In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst |
|
3178 |
void Assembler::vpcmpeqb(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
3179 |
assert(VM_Version::supports_avx(), ""); |
|
3180 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
|
3181 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
3182 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3183 |
emit_int8(0x74); |
|
3184 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3185 |
} |
|
3186 |
||
3187 |
// In this context, kdst is written the mask used to process the equal components |
|
3188 |
void Assembler::evpcmpeqb(KRegister kdst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
3189 |
assert(VM_Version::supports_avx512bw(), ""); |
|
35113 | 3190 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34203 | 3191 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
3192 |
int encode = vex_prefix_and_encode(kdst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3193 |
emit_int8(0x74); |
|
3194 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3195 |
} |
|
3196 |
||
35113 | 3197 |
void Assembler::evpcmpeqb(KRegister kdst, XMMRegister nds, Address src, int vector_len) { |
3198 |
assert(VM_Version::supports_avx512bw(), ""); |
|
3199 |
InstructionMark im(this); |
|
3200 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
|
3201 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
|
3202 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
3203 |
int dst_enc = kdst->encoding(); |
|
3204 |
vex_prefix(src, nds_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3205 |
emit_int8(0x74); |
|
3206 |
emit_operand(as_Register(dst_enc), src); |
|
3207 |
} |
|
3208 |
||
34203 | 3209 |
// In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst |
33628 | 3210 |
void Assembler::pcmpeqw(XMMRegister dst, XMMRegister src) { |
35113 | 3211 |
assert(VM_Version::supports_sse2(), ""); |
34162 | 3212 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
3213 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3214 |
emit_int8(0x75); |
|
3215 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
33628 | 3216 |
} |
3217 |
||
34203 | 3218 |
// In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst |
33628 | 3219 |
void Assembler::vpcmpeqw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
34162 | 3220 |
assert(VM_Version::supports_avx(), ""); |
3221 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
|
3222 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
3223 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3224 |
emit_int8(0x75); |
|
3225 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
33628 | 3226 |
} |
3227 |
||
34203 | 3228 |
// In this context, kdst is written the mask used to process the equal components |
3229 |
void Assembler::evpcmpeqw(KRegister kdst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
3230 |
assert(VM_Version::supports_avx512bw(), ""); |
|
35113 | 3231 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
34203 | 3232 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
3233 |
int encode = vex_prefix_and_encode(kdst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3234 |
emit_int8(0x75); |
|
3235 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3236 |
} |
|
3237 |
||
35113 | 3238 |
void Assembler::evpcmpeqw(KRegister kdst, XMMRegister nds, Address src, int vector_len) { |
3239 |
assert(VM_Version::supports_avx512bw(), ""); |
|
3240 |
InstructionMark im(this); |
|
3241 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); |
|
3242 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
|
3243 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
3244 |
int dst_enc = kdst->encoding(); |
|
3245 |
vex_prefix(src, nds_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3246 |
emit_int8(0x75); |
|
3247 |
emit_operand(as_Register(dst_enc), src); |
|
3248 |
} |
|
3249 |
||
34203 | 3250 |
// In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst |
3251 |
void Assembler::pcmpeqd(XMMRegister dst, XMMRegister src) { |
|
35113 | 3252 |
assert(VM_Version::supports_sse2(), ""); |
34203 | 3253 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
3254 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3255 |
emit_int8(0x76); |
|
3256 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3257 |
} |
|
3258 |
||
3259 |
// In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst |
|
3260 |
void Assembler::vpcmpeqd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
3261 |
assert(VM_Version::supports_avx(), ""); |
|
3262 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
|
3263 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
3264 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3265 |
emit_int8(0x76); |
|
3266 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3267 |
} |
|
3268 |
||
3269 |
// In this context, kdst is written the mask used to process the equal components |
|
3270 |
void Assembler::evpcmpeqd(KRegister kdst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
3271 |
assert(VM_Version::supports_evex(), ""); |
|
3272 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
3273 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
3274 |
int encode = vex_prefix_and_encode(kdst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3275 |
emit_int8(0x76); |
|
3276 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3277 |
} |
|
3278 |
||
35113 | 3279 |
void Assembler::evpcmpeqd(KRegister kdst, XMMRegister nds, Address src, int vector_len) { |
3280 |
assert(VM_Version::supports_evex(), ""); |
|
3281 |
InstructionMark im(this); |
|
3282 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
3283 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
|
3284 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
3285 |
int dst_enc = kdst->encoding(); |
|
3286 |
vex_prefix(src, nds_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3287 |
emit_int8(0x76); |
|
3288 |
emit_operand(as_Register(dst_enc), src); |
|
3289 |
} |
|
3290 |
||
34203 | 3291 |
// In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst |
3292 |
void Assembler::pcmpeqq(XMMRegister dst, XMMRegister src) { |
|
35113 | 3293 |
assert(VM_Version::supports_sse4_1(), ""); |
34203 | 3294 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
3295 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
3296 |
emit_int8(0x29); |
|
3297 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3298 |
} |
|
3299 |
||
3300 |
// In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst |
|
3301 |
void Assembler::vpcmpeqq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
3302 |
assert(VM_Version::supports_avx(), ""); |
|
3303 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
|
3304 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
3305 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
3306 |
emit_int8(0x29); |
|
3307 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3308 |
} |
|
3309 |
||
3310 |
// In this context, kdst is written the mask used to process the equal components |
|
3311 |
void Assembler::evpcmpeqq(KRegister kdst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
3312 |
assert(VM_Version::supports_evex(), ""); |
|
3313 |
InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
3314 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
3315 |
int encode = vex_prefix_and_encode(kdst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
3316 |
emit_int8(0x29); |
|
3317 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3318 |
} |
|
3319 |
||
3320 |
// In this context, kdst is written the mask used to process the equal components |
|
3321 |
void Assembler::evpcmpeqq(KRegister kdst, XMMRegister nds, Address src, int vector_len) { |
|
3322 |
assert(VM_Version::supports_evex(), ""); |
|
3323 |
InstructionMark im(this); |
|
3324 |
InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
3325 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
|
3326 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
3327 |
int dst_enc = kdst->encoding(); |
|
3328 |
vex_prefix(src, nds_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
3329 |
emit_int8(0x29); |
|
3330 |
emit_operand(as_Register(dst_enc), src); |
|
3331 |
} |
|
3332 |
||
33628 | 3333 |
void Assembler::pmovmskb(Register dst, XMMRegister src) { |
3334 |
assert(VM_Version::supports_sse2(), ""); |
|
34162 | 3335 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
3336 |
int encode = simd_prefix_and_encode(as_XMMRegister(dst->encoding()), xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
33628 | 3337 |
emit_int8((unsigned char)0xD7); |
3338 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3339 |
} |
|
3340 |
||
3341 |
void Assembler::vpmovmskb(Register dst, XMMRegister src) { |
|
3342 |
assert(VM_Version::supports_avx2(), ""); |
|
34162 | 3343 |
InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
3344 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
33628 | 3345 |
emit_int8((unsigned char)0xD7); |
3346 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3347 |
} |
|
3348 |
||
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3349 |
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
|
3350 |
assert(VM_Version::supports_sse4_1(), ""); |
34162 | 3351 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); |
35154 | 3352 |
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
|
3353 |
emit_int8(0x16); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3354 |
emit_int8((unsigned char)(0xC0 | encode)); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3355 |
emit_int8(imm8); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3356 |
} |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3357 |
|
35154 | 3358 |
void Assembler::pextrd(Address dst, XMMRegister src, int imm8) { |
3359 |
assert(VM_Version::supports_sse4_1(), ""); |
|
3360 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); |
|
3361 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
3362 |
simd_prefix(src, xnoreg, dst, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
3363 |
emit_int8(0x16); |
|
3364 |
emit_operand(src, dst); |
|
3365 |
emit_int8(imm8); |
|
3366 |
} |
|
3367 |
||
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3368 |
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
|
3369 |
assert(VM_Version::supports_sse4_1(), ""); |
34162 | 3370 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); |
35154 | 3371 |
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
|
3372 |
emit_int8(0x16); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3373 |
emit_int8((unsigned char)(0xC0 | encode)); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3374 |
emit_int8(imm8); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3375 |
} |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3376 |
|
35154 | 3377 |
void Assembler::pextrq(Address dst, XMMRegister src, int imm8) { |
3378 |
assert(VM_Version::supports_sse4_1(), ""); |
|
3379 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); |
|
3380 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
3381 |
simd_prefix(src, xnoreg, dst, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
3382 |
emit_int8(0x16); |
|
3383 |
emit_operand(src, dst); |
|
3384 |
emit_int8(imm8); |
|
3385 |
} |
|
3386 |
||
33089 | 3387 |
void Assembler::pextrw(Register dst, XMMRegister src, int imm8) { |
3388 |
assert(VM_Version::supports_sse2(), ""); |
|
34162 | 3389 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); |
3390 |
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
|
3391 |
emit_int8((unsigned char)0xC5); |
33089 | 3392 |
emit_int8((unsigned char)(0xC0 | encode)); |
3393 |
emit_int8(imm8); |
|
3394 |
} |
|
3395 |
||
35154 | 3396 |
void Assembler::pextrw(Address dst, XMMRegister src, int imm8) { |
3397 |
assert(VM_Version::supports_sse4_1(), ""); |
|
3398 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); |
|
3399 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_16bit); |
|
3400 |
simd_prefix(src, xnoreg, dst, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
3401 |
emit_int8((unsigned char)0x15); |
|
3402 |
emit_operand(src, dst); |
|
3403 |
emit_int8(imm8); |
|
3404 |
} |
|
3405 |
||
3406 |
void Assembler::pextrb(Address dst, XMMRegister src, int imm8) { |
|
3407 |
assert(VM_Version::supports_sse4_1(), ""); |
|
3408 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); |
|
3409 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_8bit); |
|
3410 |
simd_prefix(src, xnoreg, dst, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
3411 |
emit_int8(0x14); |
|
3412 |
emit_operand(src, dst); |
|
3413 |
emit_int8(imm8); |
|
3414 |
} |
|
3415 |
||
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3416 |
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
|
3417 |
assert(VM_Version::supports_sse4_1(), ""); |
34162 | 3418 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); |
3419 |
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
|
3420 |
emit_int8(0x22); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3421 |
emit_int8((unsigned char)(0xC0 | encode)); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3422 |
emit_int8(imm8); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3423 |
} |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3424 |
|
35154 | 3425 |
void Assembler::pinsrd(XMMRegister dst, Address src, int imm8) { |
3426 |
assert(VM_Version::supports_sse4_1(), ""); |
|
3427 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); |
|
3428 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
3429 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
3430 |
emit_int8(0x22); |
|
3431 |
emit_operand(dst,src); |
|
3432 |
emit_int8(imm8); |
|
3433 |
} |
|
3434 |
||
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3435 |
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
|
3436 |
assert(VM_Version::supports_sse4_1(), ""); |
34162 | 3437 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); |
3438 |
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
|
3439 |
emit_int8(0x22); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3440 |
emit_int8((unsigned char)(0xC0 | encode)); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3441 |
emit_int8(imm8); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3442 |
} |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
3443 |
|
35154 | 3444 |
void Assembler::pinsrq(XMMRegister dst, Address src, int imm8) { |
3445 |
assert(VM_Version::supports_sse4_1(), ""); |
|
3446 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); |
|
3447 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
3448 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
3449 |
emit_int8(0x22); |
|
3450 |
emit_operand(dst, src); |
|
3451 |
emit_int8(imm8); |
|
3452 |
} |
|
3453 |
||
33089 | 3454 |
void Assembler::pinsrw(XMMRegister dst, Register src, int imm8) { |
3455 |
assert(VM_Version::supports_sse2(), ""); |
|
34162 | 3456 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); |
3457 |
int encode = simd_prefix_and_encode(dst, dst, as_XMMRegister(src->encoding()), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
33089 | 3458 |
emit_int8((unsigned char)0xC4); |
3459 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
3460 |
emit_int8(imm8); |
|
3461 |
} |
|
3462 |
||
35154 | 3463 |
void Assembler::pinsrw(XMMRegister dst, Address src, int imm8) { |
3464 |
assert(VM_Version::supports_sse2(), ""); |
|
3465 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); |
|
3466 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_16bit); |
|
3467 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3468 |
emit_int8((unsigned char)0xC4); |
|
3469 |
emit_operand(dst, src); |
|
3470 |
emit_int8(imm8); |
|
3471 |
} |
|
3472 |
||
3473 |
void Assembler::pinsrb(XMMRegister dst, Address src, int imm8) { |
|
3474 |
assert(VM_Version::supports_sse4_1(), ""); |
|
3475 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); |
|
3476 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_8bit); |
|
3477 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
3478 |
emit_int8(0x20); |
|
3479 |
emit_operand(dst, src); |
|
3480 |
emit_int8(imm8); |
|
3481 |
} |
|
3482 |
||
11427 | 3483 |
void Assembler::pmovzxbw(XMMRegister dst, Address src) { |
3484 |
assert(VM_Version::supports_sse4_1(), ""); |
|
34162 | 3485 |
InstructionMark im(this); |
35113 | 3486 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 3487 |
attributes.set_address_attributes(/* tuple_type */ EVEX_HVM, /* input_size_in_bits */ EVEX_NObit); |
3488 |
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
|
3489 |
emit_int8(0x30); |
11427 | 3490 |
emit_operand(dst, src); |
3491 |
} |
|
3492 |
||
3493 |
void Assembler::pmovzxbw(XMMRegister dst, XMMRegister src) { |
|
3494 |
assert(VM_Version::supports_sse4_1(), ""); |
|
35113 | 3495 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 3496 |
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
|
3497 |
emit_int8(0x30); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3498 |
emit_int8((unsigned char)(0xC0 | encode)); |
11427 | 3499 |
} |
3500 |
||
34203 | 3501 |
void Assembler::vpmovzxbw(XMMRegister dst, Address src, int vector_len) { |
33628 | 3502 |
assert(VM_Version::supports_avx(), ""); |
3503 |
InstructionMark im(this); |
|
3504 |
assert(dst != xnoreg, "sanity"); |
|
35113 | 3505 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 3506 |
attributes.set_address_attributes(/* tuple_type */ EVEX_HVM, /* input_size_in_bits */ EVEX_NObit); |
3507 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
33628 | 3508 |
emit_int8(0x30); |
3509 |
emit_operand(dst, src); |
|
3510 |
} |
|
3511 |
||
1066 | 3512 |
// generic |
3513 |
void Assembler::pop(Register dst) { |
|
3514 |
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
|
3515 |
emit_int8(0x58 | encode); |
1066 | 3516 |
} |
3517 |
||
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
3518 |
void Assembler::popcntl(Register dst, Address src) { |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
3519 |
assert(VM_Version::supports_popcnt(), "must support"); |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
3520 |
InstructionMark im(this); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3521 |
emit_int8((unsigned char)0xF3); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
3522 |
prefix(src, dst); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3523 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3524 |
emit_int8((unsigned char)0xB8); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
3525 |
emit_operand(dst, src); |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
3526 |
} |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
3527 |
|
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
3528 |
void Assembler::popcntl(Register dst, Register src) { |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
3529 |
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
|
3530 |
emit_int8((unsigned char)0xF3); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
3531 |
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
|
3532 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3533 |
emit_int8((unsigned char)0xB8); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3534 |
emit_int8((unsigned char)(0xC0 | encode)); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
3535 |
} |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
3536 |
|
1066 | 3537 |
void Assembler::popf() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3538 |
emit_int8((unsigned char)0x9D); |
1066 | 3539 |
} |
3540 |
||
4430 | 3541 |
#ifndef _LP64 // no 32bit push/pop on amd64 |
1066 | 3542 |
void Assembler::popl(Address dst) { |
3543 |
// NOTE: this will adjust stack by 8byte on 64bits |
|
3544 |
InstructionMark im(this); |
|
3545 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3546 |
emit_int8((unsigned char)0x8F); |
1066 | 3547 |
emit_operand(rax, dst); |
3548 |
} |
|
4430 | 3549 |
#endif |
1066 | 3550 |
|
3551 |
void Assembler::prefetch_prefix(Address src) { |
|
3552 |
prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3553 |
emit_int8(0x0F); |
1066 | 3554 |
} |
3555 |
||
3556 |
void Assembler::prefetchnta(Address src) { |
|
10286
74b0f625d56a
7081926: assert(VM_Version::supports_sse2()) failed: must support
kvn
parents:
10268
diff
changeset
|
3557 |
NOT_LP64(assert(VM_Version::supports_sse(), "must support")); |
1066 | 3558 |
InstructionMark im(this); |
3559 |
prefetch_prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3560 |
emit_int8(0x18); |
1066 | 3561 |
emit_operand(rax, src); // 0, src |
3562 |
} |
|
3563 |
||
3564 |
void Assembler::prefetchr(Address src) { |
|
10267 | 3565 |
assert(VM_Version::supports_3dnow_prefetch(), "must support"); |
1066 | 3566 |
InstructionMark im(this); |
3567 |
prefetch_prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3568 |
emit_int8(0x0D); |
1066 | 3569 |
emit_operand(rax, src); // 0, src |
3570 |
} |
|
3571 |
||
3572 |
void Assembler::prefetcht0(Address src) { |
|
3573 |
NOT_LP64(assert(VM_Version::supports_sse(), "must support")); |
|
3574 |
InstructionMark im(this); |
|
3575 |
prefetch_prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3576 |
emit_int8(0x18); |
1066 | 3577 |
emit_operand(rcx, src); // 1, src |
3578 |
} |
|
3579 |
||
3580 |
void Assembler::prefetcht1(Address src) { |
|
3581 |
NOT_LP64(assert(VM_Version::supports_sse(), "must support")); |
|
3582 |
InstructionMark im(this); |
|
3583 |
prefetch_prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3584 |
emit_int8(0x18); |
1066 | 3585 |
emit_operand(rdx, src); // 2, src |
3586 |
} |
|
3587 |
||
3588 |
void Assembler::prefetcht2(Address src) { |
|
3589 |
NOT_LP64(assert(VM_Version::supports_sse(), "must support")); |
|
3590 |
InstructionMark im(this); |
|
3591 |
prefetch_prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3592 |
emit_int8(0x18); |
1066 | 3593 |
emit_operand(rbx, src); // 3, src |
3594 |
} |
|
3595 |
||
3596 |
void Assembler::prefetchw(Address src) { |
|
10267 | 3597 |
assert(VM_Version::supports_3dnow_prefetch(), "must support"); |
1066 | 3598 |
InstructionMark im(this); |
3599 |
prefetch_prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3600 |
emit_int8(0x0D); |
1066 | 3601 |
emit_operand(rcx, src); // 1, src |
3602 |
} |
|
3603 |
||
3604 |
void Assembler::prefix(Prefix p) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3605 |
emit_int8(p); |
1066 | 3606 |
} |
3607 |
||
14132 | 3608 |
void Assembler::pshufb(XMMRegister dst, XMMRegister src) { |
3609 |
assert(VM_Version::supports_ssse3(), ""); |
|
35113 | 3610 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 3611 |
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
|
3612 |
emit_int8(0x00); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3613 |
emit_int8((unsigned char)(0xC0 | encode)); |
14132 | 3614 |
} |
3615 |
||
3616 |
void Assembler::pshufb(XMMRegister dst, Address src) { |
|
3617 |
assert(VM_Version::supports_ssse3(), ""); |
|
34162 | 3618 |
InstructionMark im(this); |
35113 | 3619 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 3620 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
3621 |
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
|
3622 |
emit_int8(0x00); |
14132 | 3623 |
emit_operand(dst, src); |
3624 |
} |
|
3625 |
||
1066 | 3626 |
void Assembler::pshufd(XMMRegister dst, XMMRegister src, int mode) { |
3627 |
assert(isByte(mode), "invalid value"); |
|
3628 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 3629 |
int vector_len = VM_Version::supports_evex() ? AVX_512bit : AVX_128bit; |
3630 |
InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
3631 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3632 |
emit_int8(0x70); |
|
3633 |
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
|
3634 |
emit_int8(mode & 0xFF); |
1066 | 3635 |
} |
3636 |
||
3637 |
void Assembler::pshufd(XMMRegister dst, Address src, int mode) { |
|
3638 |
assert(isByte(mode), "invalid value"); |
|
3639 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
11427 | 3640 |
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); |
34162 | 3641 |
InstructionMark im(this); |
3642 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
3643 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
|
3644 |
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
|
3645 |
emit_int8(0x70); |
1066 | 3646 |
emit_operand(dst, src); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3647 |
emit_int8(mode & 0xFF); |
1066 | 3648 |
} |
3649 |
||
3650 |
void Assembler::pshuflw(XMMRegister dst, XMMRegister src, int mode) { |
|
3651 |
assert(isByte(mode), "invalid value"); |
|
3652 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
35113 | 3653 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 3654 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
3655 |
emit_int8(0x70); |
|
3656 |
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
|
3657 |
emit_int8(mode & 0xFF); |
1066 | 3658 |
} |
3659 |
||
3660 |
void Assembler::pshuflw(XMMRegister dst, Address src, int mode) { |
|
3661 |
assert(isByte(mode), "invalid value"); |
|
3662 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
11427 | 3663 |
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); |
34162 | 3664 |
InstructionMark im(this); |
35113 | 3665 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); |
34162 | 3666 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
3667 |
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
|
3668 |
emit_int8(0x70); |
1066 | 3669 |
emit_operand(dst, src); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3670 |
emit_int8(mode & 0xFF); |
1066 | 3671 |
} |
3672 |
||
8494
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
3673 |
void Assembler::psrldq(XMMRegister dst, int shift) { |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
3674 |
// 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
|
3675 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 3676 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
3677 |
// XMM3 is for /3 encoding: 66 0F 73 /3 ib |
34162 | 3678 |
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
|
3679 |
emit_int8(0x73); |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
3680 |
emit_int8((unsigned char)(0xC0 | encode)); |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
3681 |
emit_int8(shift); |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
3682 |
} |
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
3683 |
|
63e8fcd70bfc
8073108: Use x86 and SPARC CPU instructions for GHASH acceleration
ascarpino
parents:
31129
diff
changeset
|
3684 |
void Assembler::pslldq(XMMRegister dst, int shift) { |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
3685 |
// 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
|
3686 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 3687 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
3688 |
// XMM7 is for /7 encoding: 66 0F 73 /7 ib |
34162 | 3689 |
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
|
3690 |
emit_int8(0x73); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3691 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3692 |
emit_int8(shift); |
8494
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
3693 |
} |
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
3694 |
|
2348 | 3695 |
void Assembler::ptest(XMMRegister dst, Address src) { |
3696 |
assert(VM_Version::supports_sse4_1(), ""); |
|
11427 | 3697 |
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); |
3698 |
InstructionMark im(this); |
|
34162 | 3699 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
3700 |
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
|
3701 |
emit_int8(0x17); |
2348 | 3702 |
emit_operand(dst, src); |
3703 |
} |
|
3704 |
||
3705 |
void Assembler::ptest(XMMRegister dst, XMMRegister src) { |
|
3706 |
assert(VM_Version::supports_sse4_1(), ""); |
|
34162 | 3707 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
3708 |
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
|
3709 |
emit_int8(0x17); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3710 |
emit_int8((unsigned char)(0xC0 | encode)); |
2348 | 3711 |
} |
3712 |
||
15117
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
3713 |
void Assembler::vptest(XMMRegister dst, Address src) { |
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
3714 |
assert(VM_Version::supports_avx(), ""); |
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
3715 |
InstructionMark im(this); |
34162 | 3716 |
InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
15117
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
3717 |
assert(dst != xnoreg, "sanity"); |
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
3718 |
// swap src<->dst for encoding |
34162 | 3719 |
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
|
3720 |
emit_int8(0x17); |
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
3721 |
emit_operand(dst, src); |
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
3722 |
} |
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
3723 |
|
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
3724 |
void Assembler::vptest(XMMRegister dst, XMMRegister src) { |
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
3725 |
assert(VM_Version::supports_avx(), ""); |
34162 | 3726 |
InstructionAttr attributes(AVX_256bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
3727 |
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
|
3728 |
emit_int8(0x17); |
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
3729 |
emit_int8((unsigned char)(0xC0 | encode)); |
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
3730 |
} |
625397df6f4f
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
15116
diff
changeset
|
3731 |
|
11427 | 3732 |
void Assembler::punpcklbw(XMMRegister dst, Address src) { |
3733 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
3734 |
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); |
|
34162 | 3735 |
InstructionMark im(this); |
3736 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_vlbw, /* no_mask_reg */ false, /* uses_vl */ true); |
|
3737 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
|
3738 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3739 |
emit_int8(0x60); |
|
3740 |
emit_operand(dst, src); |
|
11427 | 3741 |
} |
3742 |
||
1066 | 3743 |
void Assembler::punpcklbw(XMMRegister dst, XMMRegister src) { |
3744 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 3745 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_vlbw, /* no_mask_reg */ false, /* uses_vl */ true); |
3746 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3747 |
emit_int8(0x60); |
|
3748 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 3749 |
} |
3750 |
||
11427 | 3751 |
void Assembler::punpckldq(XMMRegister dst, Address src) { |
3752 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
3753 |
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); |
|
34162 | 3754 |
InstructionMark im(this); |
3755 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
3756 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
|
3757 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3758 |
emit_int8(0x62); |
|
3759 |
emit_operand(dst, src); |
|
11427 | 3760 |
} |
3761 |
||
3762 |
void Assembler::punpckldq(XMMRegister dst, XMMRegister src) { |
|
3763 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 3764 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
3765 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3766 |
emit_int8(0x62); |
|
3767 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
11427 | 3768 |
} |
3769 |
||
13294 | 3770 |
void Assembler::punpcklqdq(XMMRegister dst, XMMRegister src) { |
3771 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 3772 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
3773 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
3774 |
emit_int8(0x6C); |
|
3775 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13294 | 3776 |
} |
3777 |
||
1066 | 3778 |
void Assembler::push(int32_t imm32) { |
3779 |
// in 64bits we push 64bits onto the stack but only |
|
3780 |
// take a 32bit immediate |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3781 |
emit_int8(0x68); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
3782 |
emit_int32(imm32); |
1066 | 3783 |
} |
3784 |
||
3785 |
void Assembler::push(Register src) { |
|
3786 |
int encode = prefix_and_encode(src->encoding()); |
|
3787 |
||
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3788 |
emit_int8(0x50 | encode); |
1066 | 3789 |
} |
3790 |
||
3791 |
void Assembler::pushf() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3792 |
emit_int8((unsigned char)0x9C); |
1066 | 3793 |
} |
3794 |
||
4430 | 3795 |
#ifndef _LP64 // no 32bit push/pop on amd64 |
1066 | 3796 |
void Assembler::pushl(Address src) { |
3797 |
// Note this will push 64bit on 64bit |
|
3798 |
InstructionMark im(this); |
|
3799 |
prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3800 |
emit_int8((unsigned char)0xFF); |
1066 | 3801 |
emit_operand(rsi, src); |
3802 |
} |
|
4430 | 3803 |
#endif |
1066 | 3804 |
|
3805 |
void Assembler::rcll(Register dst, int imm8) { |
|
3806 |
assert(isShiftCount(imm8), "illegal shift count"); |
|
3807 |
int encode = prefix_and_encode(dst->encoding()); |
|
3808 |
if (imm8 == 1) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3809 |
emit_int8((unsigned char)0xD1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3810 |
emit_int8((unsigned char)(0xD0 | encode)); |
1066 | 3811 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3812 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3813 |
emit_int8((unsigned char)0xD0 | encode); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3814 |
emit_int8(imm8); |
1066 | 3815 |
} |
3816 |
} |
|
3817 |
||
33465 | 3818 |
void Assembler::rcpps(XMMRegister dst, XMMRegister src) { |
3819 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 3820 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
3821 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
33465 | 3822 |
emit_int8(0x53); |
34162 | 3823 |
emit_int8((unsigned char)(0xC0 | encode)); |
33465 | 3824 |
} |
3825 |
||
3826 |
void Assembler::rcpss(XMMRegister dst, XMMRegister src) { |
|
3827 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 3828 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
3829 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
33465 | 3830 |
emit_int8(0x53); |
34162 | 3831 |
emit_int8((unsigned char)(0xC0 | encode)); |
33465 | 3832 |
} |
3833 |
||
23491 | 3834 |
void Assembler::rdtsc() { |
3835 |
emit_int8((unsigned char)0x0F); |
|
3836 |
emit_int8((unsigned char)0x31); |
|
3837 |
} |
|
3838 |
||
1066 | 3839 |
// copies data from [esi] to [edi] using rcx pointer sized words |
3840 |
// generic |
|
3841 |
void Assembler::rep_mov() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3842 |
emit_int8((unsigned char)0xF3); |
1066 | 3843 |
// MOVSQ |
3844 |
LP64_ONLY(prefix(REX_W)); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3845 |
emit_int8((unsigned char)0xA5); |
1066 | 3846 |
} |
3847 |
||
15114
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
3848 |
// sets rcx bytes with rax, value at [edi] |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
3849 |
void Assembler::rep_stosb() { |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
3850 |
emit_int8((unsigned char)0xF3); // REP |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
3851 |
LP64_ONLY(prefix(REX_W)); |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
3852 |
emit_int8((unsigned char)0xAA); // STOSB |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
3853 |
} |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
3854 |
|
1066 | 3855 |
// sets rcx pointer sized words with rax, value at [edi] |
3856 |
// generic |
|
15114
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
3857 |
void Assembler::rep_stos() { |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
3858 |
emit_int8((unsigned char)0xF3); // REP |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
3859 |
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
|
3860 |
emit_int8((unsigned char)0xAB); |
1066 | 3861 |
} |
3862 |
||
3863 |
// scans rcx pointer sized words at [edi] for occurance of rax, |
|
3864 |
// generic |
|
3865 |
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
|
3866 |
emit_int8((unsigned char)0xF2); |
1066 | 3867 |
// SCASQ |
3868 |
LP64_ONLY(prefix(REX_W)); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3869 |
emit_int8((unsigned char)0xAF); |
1066 | 3870 |
} |
3871 |
||
3872 |
#ifdef _LP64 |
|
3873 |
// scans rcx 4 byte words at [edi] for occurance of rax, |
|
3874 |
// generic |
|
3875 |
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
|
3876 |
emit_int8((unsigned char)0xF2); |
1066 | 3877 |
// SCASL |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3878 |
emit_int8((unsigned char)0xAF); |
1066 | 3879 |
} |
3880 |
#endif |
|
3881 |
||
1 | 3882 |
void Assembler::ret(int imm16) { |
3883 |
if (imm16 == 0) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3884 |
emit_int8((unsigned char)0xC3); |
1 | 3885 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3886 |
emit_int8((unsigned char)0xC2); |
14831
84828ee2a91c
8004536: replace AbstractAssembler emit_word with emit_int16
twisti
parents:
14626
diff
changeset
|
3887 |
emit_int16(imm16); |
1 | 3888 |
} |
3889 |
} |
|
3890 |
||
1066 | 3891 |
void Assembler::sahf() { |
3892 |
#ifdef _LP64 |
|
3893 |
// Not supported in 64bit mode |
|
3894 |
ShouldNotReachHere(); |
|
3895 |
#endif |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3896 |
emit_int8((unsigned char)0x9E); |
1066 | 3897 |
} |
3898 |
||
3899 |
void Assembler::sarl(Register dst, int imm8) { |
|
3900 |
int encode = prefix_and_encode(dst->encoding()); |
|
3901 |
assert(isShiftCount(imm8), "illegal shift count"); |
|
3902 |
if (imm8 == 1) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3903 |
emit_int8((unsigned char)0xD1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3904 |
emit_int8((unsigned char)(0xF8 | encode)); |
1066 | 3905 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3906 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3907 |
emit_int8((unsigned char)(0xF8 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3908 |
emit_int8(imm8); |
1066 | 3909 |
} |
3910 |
} |
|
3911 |
||
3912 |
void Assembler::sarl(Register dst) { |
|
3913 |
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
|
3914 |
emit_int8((unsigned char)0xD3); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3915 |
emit_int8((unsigned char)(0xF8 | encode)); |
1066 | 3916 |
} |
3917 |
||
3918 |
void Assembler::sbbl(Address dst, int32_t imm32) { |
|
3919 |
InstructionMark im(this); |
|
3920 |
prefix(dst); |
|
3921 |
emit_arith_operand(0x81, rbx, dst, imm32); |
|
3922 |
} |
|
3923 |
||
3924 |
void Assembler::sbbl(Register dst, int32_t imm32) { |
|
3925 |
prefix(dst); |
|
3926 |
emit_arith(0x81, 0xD8, dst, imm32); |
|
3927 |
} |
|
3928 |
||
3929 |
||
3930 |
void Assembler::sbbl(Register dst, Address src) { |
|
3931 |
InstructionMark im(this); |
|
3932 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3933 |
emit_int8(0x1B); |
1066 | 3934 |
emit_operand(dst, src); |
3935 |
} |
|
3936 |
||
3937 |
void Assembler::sbbl(Register dst, Register src) { |
|
3938 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
|
3939 |
emit_arith(0x1B, 0xC0, dst, src); |
|
3940 |
} |
|
3941 |
||
3942 |
void Assembler::setb(Condition cc, Register dst) { |
|
3943 |
assert(0 <= cc && cc < 16, "illegal cc"); |
|
3944 |
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
|
3945 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3946 |
emit_int8((unsigned char)0x90 | cc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3947 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 3948 |
} |
3949 |
||
3950 |
void Assembler::shll(Register dst, int imm8) { |
|
3951 |
assert(isShiftCount(imm8), "illegal shift count"); |
|
3952 |
int encode = prefix_and_encode(dst->encoding()); |
|
3953 |
if (imm8 == 1 ) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3954 |
emit_int8((unsigned char)0xD1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3955 |
emit_int8((unsigned char)(0xE0 | encode)); |
1066 | 3956 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3957 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3958 |
emit_int8((unsigned char)(0xE0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3959 |
emit_int8(imm8); |
1066 | 3960 |
} |
3961 |
} |
|
3962 |
||
3963 |
void Assembler::shll(Register dst) { |
|
3964 |
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
|
3965 |
emit_int8((unsigned char)0xD3); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3966 |
emit_int8((unsigned char)(0xE0 | encode)); |
1066 | 3967 |
} |
3968 |
||
3969 |
void Assembler::shrl(Register dst, int imm8) { |
|
3970 |
assert(isShiftCount(imm8), "illegal shift count"); |
|
3971 |
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
|
3972 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3973 |
emit_int8((unsigned char)(0xE8 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3974 |
emit_int8(imm8); |
1066 | 3975 |
} |
3976 |
||
3977 |
void Assembler::shrl(Register dst) { |
|
3978 |
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
|
3979 |
emit_int8((unsigned char)0xD3); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3980 |
emit_int8((unsigned char)(0xE8 | encode)); |
1066 | 3981 |
} |
1 | 3982 |
|
3983 |
// copies a single word from [esi] to [edi] |
|
3984 |
void Assembler::smovl() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3985 |
emit_int8((unsigned char)0xA5); |
1 | 3986 |
} |
3987 |
||
1066 | 3988 |
void Assembler::sqrtsd(XMMRegister dst, XMMRegister src) { |
3989 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 3990 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
3991 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
3992 |
emit_int8(0x51); |
|
3993 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 3994 |
} |
3995 |
||
7433 | 3996 |
void Assembler::sqrtsd(XMMRegister dst, Address src) { |
3997 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 3998 |
InstructionMark im(this); |
3999 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
4000 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
4001 |
simd_prefix(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
4002 |
emit_int8(0x51); |
|
4003 |
emit_operand(dst, src); |
|
7433 | 4004 |
} |
4005 |
||
4006 |
void Assembler::sqrtss(XMMRegister dst, XMMRegister src) { |
|
11427 | 4007 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
34162 | 4008 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
4009 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
4010 |
emit_int8(0x51); |
|
4011 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
7433 | 4012 |
} |
4013 |
||
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
4014 |
void Assembler::std() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4015 |
emit_int8((unsigned char)0xFD); |
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
4016 |
} |
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
4017 |
|
7433 | 4018 |
void Assembler::sqrtss(XMMRegister dst, Address src) { |
11427 | 4019 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
34162 | 4020 |
InstructionMark im(this); |
4021 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
4022 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
4023 |
simd_prefix(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
4024 |
emit_int8(0x51); |
|
4025 |
emit_operand(dst, src); |
|
7433 | 4026 |
} |
4027 |
||
1066 | 4028 |
void Assembler::stmxcsr( Address dst) { |
4029 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
4030 |
InstructionMark im(this); |
|
4031 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4032 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4033 |
emit_int8((unsigned char)0xAE); |
1066 | 4034 |
emit_operand(as_Register(3), dst); |
4035 |
} |
|
4036 |
||
4037 |
void Assembler::subl(Address dst, int32_t imm32) { |
|
4038 |
InstructionMark im(this); |
|
4039 |
prefix(dst); |
|
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
4040 |
emit_arith_operand(0x81, rbp, dst, imm32); |
1066 | 4041 |
} |
4042 |
||
4043 |
void Assembler::subl(Address dst, Register src) { |
|
4044 |
InstructionMark im(this); |
|
4045 |
prefix(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4046 |
emit_int8(0x29); |
1066 | 4047 |
emit_operand(src, dst); |
4048 |
} |
|
4049 |
||
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
4050 |
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
|
4051 |
prefix(dst); |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
4052 |
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
|
4053 |
} |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
4054 |
|
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
4055 |
// 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
|
4056 |
void Assembler::subl_imm32(Register dst, int32_t imm32) { |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
4057 |
prefix(dst); |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
4058 |
emit_arith_imm32(0x81, 0xE8, dst, imm32); |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
4059 |
} |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
4060 |
|
1066 | 4061 |
void Assembler::subl(Register dst, Address src) { |
4062 |
InstructionMark im(this); |
|
4063 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4064 |
emit_int8(0x2B); |
1066 | 4065 |
emit_operand(dst, src); |
4066 |
} |
|
4067 |
||
4068 |
void Assembler::subl(Register dst, Register src) { |
|
4069 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
|
4070 |
emit_arith(0x2B, 0xC0, dst, src); |
|
4071 |
} |
|
4072 |
||
4073 |
void Assembler::subsd(XMMRegister dst, XMMRegister src) { |
|
4074 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 4075 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
4076 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
4077 |
emit_int8(0x5C); |
|
4078 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 4079 |
} |
4080 |
||
4081 |
void Assembler::subsd(XMMRegister dst, Address src) { |
|
4082 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 4083 |
InstructionMark im(this); |
4084 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
4085 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
4086 |
simd_prefix(dst, dst, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
4087 |
emit_int8(0x5C); |
|
4088 |
emit_operand(dst, src); |
|
1066 | 4089 |
} |
4090 |
||
4091 |
void Assembler::subss(XMMRegister dst, XMMRegister src) { |
|
4092 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 4093 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
4094 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
4095 |
emit_int8(0x5C); |
|
4096 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 4097 |
} |
4098 |
||
4099 |
void Assembler::subss(XMMRegister dst, Address src) { |
|
4100 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 4101 |
InstructionMark im(this); |
4102 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
4103 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
4104 |
simd_prefix(dst, dst, src, VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
4105 |
emit_int8(0x5C); |
|
4106 |
emit_operand(dst, src); |
|
1066 | 4107 |
} |
4108 |
||
4109 |
void Assembler::testb(Register dst, int imm8) { |
|
4110 |
NOT_LP64(assert(dst->has_byte_register(), "must have byte register")); |
|
4111 |
(void) prefix_and_encode(dst->encoding(), true); |
|
4112 |
emit_arith_b(0xF6, 0xC0, dst, imm8); |
|
4113 |
} |
|
4114 |
||
4115 |
void Assembler::testl(Register dst, int32_t imm32) { |
|
4116 |
// not using emit_arith because test |
|
4117 |
// doesn't support sign-extension of |
|
4118 |
// 8bit operands |
|
4119 |
int encode = dst->encoding(); |
|
4120 |
if (encode == 0) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4121 |
emit_int8((unsigned char)0xA9); |
1066 | 4122 |
} else { |
4123 |
encode = prefix_and_encode(encode); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4124 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4125 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 4126 |
} |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
4127 |
emit_int32(imm32); |
1066 | 4128 |
} |
4129 |
||
4130 |
void Assembler::testl(Register dst, Register src) { |
|
4131 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
|
4132 |
emit_arith(0x85, 0xC0, dst, src); |
|
4133 |
} |
|
4134 |
||
34162 | 4135 |
void Assembler::testl(Register dst, Address src) { |
1066 | 4136 |
InstructionMark im(this); |
4137 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4138 |
emit_int8((unsigned char)0x85); |
1066 | 4139 |
emit_operand(dst, src); |
4140 |
} |
|
4141 |
||
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4142 |
void Assembler::tzcntl(Register dst, Register src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4143 |
assert(VM_Version::supports_bmi1(), "tzcnt instruction not supported"); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4144 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4145 |
int encode = prefix_and_encode(dst->encoding(), src->encoding()); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4146 |
emit_int8(0x0F); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4147 |
emit_int8((unsigned char)0xBC); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4148 |
emit_int8((unsigned char)0xC0 | encode); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4149 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4150 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4151 |
void Assembler::tzcntq(Register dst, Register src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4152 |
assert(VM_Version::supports_bmi1(), "tzcnt instruction not supported"); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4153 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4154 |
int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4155 |
emit_int8(0x0F); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4156 |
emit_int8((unsigned char)0xBC); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4157 |
emit_int8((unsigned char)(0xC0 | encode)); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4158 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
4159 |
|
1066 | 4160 |
void Assembler::ucomisd(XMMRegister dst, Address src) { |
4161 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 4162 |
InstructionMark im(this); |
4163 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
4164 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
4165 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4166 |
emit_int8(0x2E); |
|
4167 |
emit_operand(dst, src); |
|
1066 | 4168 |
} |
4169 |
||
4170 |
void Assembler::ucomisd(XMMRegister dst, XMMRegister src) { |
|
4171 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 4172 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
4173 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4174 |
emit_int8(0x2E); |
|
4175 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 4176 |
} |
4177 |
||
4178 |
void Assembler::ucomiss(XMMRegister dst, Address src) { |
|
4179 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 4180 |
InstructionMark im(this); |
4181 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
4182 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
4183 |
simd_prefix(dst, xnoreg, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4184 |
emit_int8(0x2E); |
|
4185 |
emit_operand(dst, src); |
|
1066 | 4186 |
} |
4187 |
||
4188 |
void Assembler::ucomiss(XMMRegister dst, XMMRegister src) { |
|
4189 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 4190 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
4191 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4192 |
emit_int8(0x2E); |
|
4193 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
1066 | 4194 |
} |
4195 |
||
23491 | 4196 |
void Assembler::xabort(int8_t imm8) { |
4197 |
emit_int8((unsigned char)0xC6); |
|
4198 |
emit_int8((unsigned char)0xF8); |
|
4199 |
emit_int8((unsigned char)(imm8 & 0xFF)); |
|
4200 |
} |
|
1066 | 4201 |
|
4202 |
void Assembler::xaddl(Address dst, Register src) { |
|
4203 |
InstructionMark im(this); |
|
4204 |
prefix(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4205 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4206 |
emit_int8((unsigned char)0xC1); |
1066 | 4207 |
emit_operand(src, dst); |
4208 |
} |
|
4209 |
||
23491 | 4210 |
void Assembler::xbegin(Label& abort, relocInfo::relocType rtype) { |
4211 |
InstructionMark im(this); |
|
4212 |
relocate(rtype); |
|
4213 |
if (abort.is_bound()) { |
|
4214 |
address entry = target(abort); |
|
4215 |
assert(entry != NULL, "abort entry NULL"); |
|
4216 |
intptr_t offset = entry - pc(); |
|
4217 |
emit_int8((unsigned char)0xC7); |
|
4218 |
emit_int8((unsigned char)0xF8); |
|
4219 |
emit_int32(offset - 6); // 2 opcode + 4 address |
|
4220 |
} else { |
|
4221 |
abort.add_patch_at(code(), locator()); |
|
4222 |
emit_int8((unsigned char)0xC7); |
|
4223 |
emit_int8((unsigned char)0xF8); |
|
4224 |
emit_int32(0); |
|
4225 |
} |
|
4226 |
} |
|
4227 |
||
1066 | 4228 |
void Assembler::xchgl(Register dst, Address src) { // xchg |
4229 |
InstructionMark im(this); |
|
4230 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4231 |
emit_int8((unsigned char)0x87); |
1066 | 4232 |
emit_operand(dst, src); |
4233 |
} |
|
4234 |
||
4235 |
void Assembler::xchgl(Register dst, Register src) { |
|
4236 |
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
|
4237 |
emit_int8((unsigned char)0x87); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4238 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 4239 |
} |
4240 |
||
23491 | 4241 |
void Assembler::xend() { |
4242 |
emit_int8((unsigned char)0x0F); |
|
4243 |
emit_int8((unsigned char)0x01); |
|
4244 |
emit_int8((unsigned char)0xD5); |
|
4245 |
} |
|
4246 |
||
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
4247 |
void Assembler::xgetbv() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4248 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4249 |
emit_int8(0x01); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4250 |
emit_int8((unsigned char)0xD0); |
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
4251 |
} |
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
4252 |
|
1066 | 4253 |
void Assembler::xorl(Register dst, int32_t imm32) { |
4254 |
prefix(dst); |
|
4255 |
emit_arith(0x81, 0xF0, dst, imm32); |
|
4256 |
} |
|
4257 |
||
4258 |
void Assembler::xorl(Register dst, Address src) { |
|
4259 |
InstructionMark im(this); |
|
4260 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4261 |
emit_int8(0x33); |
1066 | 4262 |
emit_operand(dst, src); |
4263 |
} |
|
4264 |
||
4265 |
void Assembler::xorl(Register dst, Register src) { |
|
4266 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
|
4267 |
emit_arith(0x33, 0xC0, dst, src); |
|
4268 |
} |
|
4269 |
||
35154 | 4270 |
void Assembler::xorb(Register dst, Address src) { |
4271 |
InstructionMark im(this); |
|
4272 |
prefix(src, dst); |
|
4273 |
emit_int8(0x32); |
|
4274 |
emit_operand(dst, src); |
|
4275 |
} |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4276 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4277 |
// 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
|
4278 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4279 |
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
|
4280 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4281 |
InstructionMark im(this); |
4282 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
4283 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
4284 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4285 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
4286 |
emit_int8(0x58); |
|
4287 |
emit_operand(dst, src); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4288 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4289 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4290 |
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
|
4291 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4292 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
4293 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4294 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
4295 |
emit_int8(0x58); |
|
4296 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4297 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4298 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4299 |
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
|
4300 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4301 |
InstructionMark im(this); |
4302 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
4303 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
4304 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4305 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
4306 |
emit_int8(0x58); |
|
4307 |
emit_operand(dst, src); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4308 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4309 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4310 |
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
|
4311 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4312 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
4313 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4314 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
4315 |
emit_int8(0x58); |
|
4316 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4317 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4318 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4319 |
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
|
4320 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4321 |
InstructionMark im(this); |
4322 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
4323 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
4324 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4325 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
4326 |
emit_int8(0x5E); |
|
4327 |
emit_operand(dst, src); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4328 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4329 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4330 |
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
|
4331 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4332 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
4333 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4334 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
4335 |
emit_int8(0x5E); |
|
4336 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4337 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4338 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4339 |
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
|
4340 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4341 |
InstructionMark im(this); |
4342 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
4343 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
4344 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4345 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
4346 |
emit_int8(0x5E); |
|
4347 |
emit_operand(dst, src); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4348 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4349 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4350 |
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
|
4351 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4352 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
4353 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4354 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
4355 |
emit_int8(0x5E); |
|
4356 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4357 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4358 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4359 |
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
|
4360 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4361 |
InstructionMark im(this); |
4362 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
4363 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
4364 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4365 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
4366 |
emit_int8(0x59); |
|
4367 |
emit_operand(dst, src); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4368 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4369 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4370 |
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
|
4371 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4372 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
4373 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4374 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
4375 |
emit_int8(0x59); |
|
4376 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4377 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4378 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4379 |
void Assembler::vmulss(XMMRegister dst, XMMRegister nds, Address src) { |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4380 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4381 |
InstructionMark im(this); |
4382 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
4383 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
4384 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4385 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
4386 |
emit_int8(0x59); |
|
4387 |
emit_operand(dst, src); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4388 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4389 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4390 |
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
|
4391 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4392 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
4393 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4394 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
4395 |
emit_int8(0x59); |
|
4396 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4397 |
} |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4398 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4399 |
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
|
4400 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4401 |
InstructionMark im(this); |
4402 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
4403 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
4404 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4405 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
4406 |
emit_int8(0x5C); |
|
4407 |
emit_operand(dst, src); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4408 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4409 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4410 |
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
|
4411 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4412 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
4413 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4414 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); |
|
4415 |
emit_int8(0x5C); |
|
4416 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4417 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4418 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4419 |
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
|
4420 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4421 |
InstructionMark im(this); |
4422 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
4423 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
4424 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4425 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
4426 |
emit_int8(0x5C); |
|
4427 |
emit_operand(dst, src); |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4428 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4429 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
4430 |
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
|
4431 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4432 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
4433 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4434 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F, &attributes); |
|
4435 |
emit_int8(0x5C); |
|
4436 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4437 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4438 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4439 |
//====================VECTOR ARITHMETIC===================================== |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4440 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4441 |
// Float-point vector arithmetic |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4442 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4443 |
void Assembler::addpd(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4444 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 4445 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4446 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4447 |
emit_int8(0x58); |
|
4448 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4449 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4450 |
|
35146 | 4451 |
void Assembler::addpd(XMMRegister dst, Address src) { |
4452 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
4453 |
InstructionMark im(this); |
|
4454 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
4455 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
|
4456 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4457 |
emit_int8(0x58); |
|
4458 |
emit_operand(dst, src); |
|
4459 |
} |
|
4460 |
||
4461 |
||
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4462 |
void Assembler::addps(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4463 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 4464 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4465 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4466 |
emit_int8(0x58); |
|
4467 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4468 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4469 |
|
30624 | 4470 |
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
|
4471 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4472 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4473 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4474 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4475 |
emit_int8(0x58); |
|
4476 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 4477 |
} |
4478 |
||
4479 |
void Assembler::vaddps(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
4480 |
assert(VM_Version::supports_avx(), ""); |
|
34162 | 4481 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4482 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4483 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4484 |
emit_int8(0x58); |
|
4485 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 4486 |
} |
4487 |
||
4488 |
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
|
4489 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4490 |
InstructionMark im(this); |
4491 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
4492 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
|
4493 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4494 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4495 |
emit_int8(0x58); |
|
4496 |
emit_operand(dst, src); |
|
30624 | 4497 |
} |
4498 |
||
4499 |
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
|
4500 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4501 |
InstructionMark im(this); |
4502 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
4503 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
|
4504 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4505 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4506 |
emit_int8(0x58); |
|
4507 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4508 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4509 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4510 |
void Assembler::subpd(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4511 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 4512 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4513 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4514 |
emit_int8(0x5C); |
|
4515 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4516 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4517 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4518 |
void Assembler::subps(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4519 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 4520 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4521 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4522 |
emit_int8(0x5C); |
|
4523 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4524 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4525 |
|
30624 | 4526 |
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
|
4527 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4528 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4529 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4530 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4531 |
emit_int8(0x5C); |
|
4532 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 4533 |
} |
4534 |
||
4535 |
void Assembler::vsubps(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
4536 |
assert(VM_Version::supports_avx(), ""); |
|
34162 | 4537 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4538 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4539 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4540 |
emit_int8(0x5C); |
|
4541 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 4542 |
} |
4543 |
||
4544 |
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
|
4545 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4546 |
InstructionMark im(this); |
4547 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
4548 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
|
4549 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4550 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4551 |
emit_int8(0x5C); |
|
4552 |
emit_operand(dst, src); |
|
30624 | 4553 |
} |
4554 |
||
4555 |
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
|
4556 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4557 |
InstructionMark im(this); |
4558 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
4559 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
|
4560 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4561 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4562 |
emit_int8(0x5C); |
|
4563 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4564 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4565 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4566 |
void Assembler::mulpd(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4567 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 4568 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4569 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4570 |
emit_int8(0x59); |
|
4571 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4572 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4573 |
|
33089 | 4574 |
void Assembler::mulpd(XMMRegister dst, Address src) { |
4575 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 4576 |
InstructionMark im(this); |
4577 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
4578 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
|
4579 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4580 |
emit_int8(0x59); |
|
4581 |
emit_operand(dst, src); |
|
33089 | 4582 |
} |
4583 |
||
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4584 |
void Assembler::mulps(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4585 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 4586 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4587 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4588 |
emit_int8(0x59); |
|
4589 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4590 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4591 |
|
30624 | 4592 |
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
|
4593 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4594 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4595 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4596 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4597 |
emit_int8(0x59); |
|
4598 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 4599 |
} |
4600 |
||
4601 |
void Assembler::vmulps(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
4602 |
assert(VM_Version::supports_avx(), ""); |
|
34162 | 4603 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4604 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4605 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4606 |
emit_int8(0x59); |
|
4607 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 4608 |
} |
4609 |
||
4610 |
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
|
4611 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4612 |
InstructionMark im(this); |
4613 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
4614 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
|
4615 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4616 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4617 |
emit_int8(0x59); |
|
4618 |
emit_operand(dst, src); |
|
30624 | 4619 |
} |
4620 |
||
4621 |
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
|
4622 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4623 |
InstructionMark im(this); |
4624 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
4625 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
|
4626 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4627 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4628 |
emit_int8(0x59); |
|
4629 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4630 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4631 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4632 |
void Assembler::divpd(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4633 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 4634 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4635 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4636 |
emit_int8(0x5E); |
|
4637 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4638 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4639 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4640 |
void Assembler::divps(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4641 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 4642 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4643 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4644 |
emit_int8(0x5E); |
|
4645 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4646 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4647 |
|
30624 | 4648 |
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
|
4649 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4650 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4651 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4652 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4653 |
emit_int8(0x5E); |
|
4654 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 4655 |
} |
4656 |
||
4657 |
void Assembler::vdivps(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
4658 |
assert(VM_Version::supports_avx(), ""); |
|
34162 | 4659 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4660 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4661 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4662 |
emit_int8(0x5E); |
|
4663 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 4664 |
} |
4665 |
||
4666 |
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
|
4667 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4668 |
InstructionMark im(this); |
4669 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
4670 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
|
4671 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4672 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4673 |
emit_int8(0x5E); |
|
4674 |
emit_operand(dst, src); |
|
30624 | 4675 |
} |
4676 |
||
4677 |
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
|
4678 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4679 |
InstructionMark im(this); |
4680 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
4681 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
|
4682 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4683 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4684 |
emit_int8(0x5E); |
|
4685 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4686 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4687 |
|
32723
56534fb3d71a
8135028: support for vectorizing double precision sqrt
mcberg
parents:
32391
diff
changeset
|
4688 |
void Assembler::vsqrtpd(XMMRegister dst, XMMRegister src, int vector_len) { |
56534fb3d71a
8135028: support for vectorizing double precision sqrt
mcberg
parents:
32391
diff
changeset
|
4689 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4690 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4691 |
int nds_enc = 0; |
|
4692 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4693 |
emit_int8(0x51); |
|
4694 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
32723
56534fb3d71a
8135028: support for vectorizing double precision sqrt
mcberg
parents:
32391
diff
changeset
|
4695 |
} |
56534fb3d71a
8135028: support for vectorizing double precision sqrt
mcberg
parents:
32391
diff
changeset
|
4696 |
|
56534fb3d71a
8135028: support for vectorizing double precision sqrt
mcberg
parents:
32391
diff
changeset
|
4697 |
void Assembler::vsqrtpd(XMMRegister dst, Address src, int vector_len) { |
56534fb3d71a
8135028: support for vectorizing double precision sqrt
mcberg
parents:
32391
diff
changeset
|
4698 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4699 |
InstructionMark im(this); |
4700 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
4701 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
|
4702 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4703 |
emit_int8(0x51); |
|
4704 |
emit_operand(dst, src); |
|
32723
56534fb3d71a
8135028: support for vectorizing double precision sqrt
mcberg
parents:
32391
diff
changeset
|
4705 |
} |
56534fb3d71a
8135028: support for vectorizing double precision sqrt
mcberg
parents:
32391
diff
changeset
|
4706 |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4707 |
void Assembler::andpd(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4708 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 4709 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true); |
4710 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4711 |
emit_int8(0x54); |
|
4712 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4713 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4714 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4715 |
void Assembler::andps(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4716 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
34162 | 4717 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true); |
4718 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4719 |
emit_int8(0x54); |
|
4720 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4721 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4722 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4723 |
void Assembler::andps(XMMRegister dst, Address src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4724 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
34162 | 4725 |
InstructionMark im(this); |
4726 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true); |
|
4727 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
|
4728 |
simd_prefix(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4729 |
emit_int8(0x54); |
|
4730 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4731 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4732 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4733 |
void Assembler::andpd(XMMRegister dst, Address src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4734 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 4735 |
InstructionMark im(this); |
4736 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true); |
|
4737 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
|
4738 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4739 |
emit_int8(0x54); |
|
4740 |
emit_operand(dst, src); |
|
30624 | 4741 |
} |
4742 |
||
4743 |
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
|
4744 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4745 |
InstructionAttr attributes(vector_len, /* vex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true); |
4746 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4747 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4748 |
emit_int8(0x54); |
|
4749 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 4750 |
} |
4751 |
||
4752 |
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
|
4753 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4754 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true); |
4755 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4756 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4757 |
emit_int8(0x54); |
|
4758 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 4759 |
} |
4760 |
||
4761 |
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
|
4762 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4763 |
InstructionMark im(this); |
4764 |
InstructionAttr attributes(vector_len, /* vex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true); |
|
4765 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
|
4766 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4767 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4768 |
emit_int8(0x54); |
|
4769 |
emit_operand(dst, src); |
|
30624 | 4770 |
} |
4771 |
||
4772 |
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
|
4773 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4774 |
InstructionMark im(this); |
4775 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true); |
|
4776 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
|
4777 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4778 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4779 |
emit_int8(0x54); |
|
4780 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4781 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4782 |
|
33089 | 4783 |
void Assembler::unpckhpd(XMMRegister dst, XMMRegister src) { |
4784 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 4785 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4786 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4787 |
emit_int8(0x15); |
|
4788 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
33089 | 4789 |
} |
4790 |
||
4791 |
void Assembler::unpcklpd(XMMRegister dst, XMMRegister src) { |
|
4792 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 4793 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4794 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4795 |
emit_int8(0x14); |
|
4796 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
33089 | 4797 |
} |
4798 |
||
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4799 |
void Assembler::xorpd(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4800 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 4801 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true); |
4802 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4803 |
emit_int8(0x57); |
|
4804 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4805 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4806 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4807 |
void Assembler::xorps(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4808 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
34162 | 4809 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true); |
4810 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4811 |
emit_int8(0x57); |
|
4812 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4813 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4814 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4815 |
void Assembler::xorpd(XMMRegister dst, Address src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4816 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 4817 |
InstructionMark im(this); |
4818 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true); |
|
4819 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
|
4820 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4821 |
emit_int8(0x57); |
|
4822 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4823 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4824 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4825 |
void Assembler::xorps(XMMRegister dst, Address src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4826 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
34162 | 4827 |
InstructionMark im(this); |
4828 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true); |
|
4829 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
|
4830 |
simd_prefix(dst, dst, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4831 |
emit_int8(0x57); |
|
4832 |
emit_operand(dst, src); |
|
30624 | 4833 |
} |
4834 |
||
4835 |
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
|
4836 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4837 |
InstructionAttr attributes(vector_len, /* vex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true); |
4838 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4839 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4840 |
emit_int8(0x57); |
|
4841 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 4842 |
} |
4843 |
||
4844 |
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
|
4845 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4846 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true); |
4847 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4848 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4849 |
emit_int8(0x57); |
|
4850 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 4851 |
} |
4852 |
||
4853 |
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
|
4854 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4855 |
InstructionMark im(this); |
4856 |
InstructionAttr attributes(vector_len, /* vex_w */ !_legacy_mode_dq, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true); |
|
4857 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
|
4858 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4859 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4860 |
emit_int8(0x57); |
|
4861 |
emit_operand(dst, src); |
|
30624 | 4862 |
} |
4863 |
||
4864 |
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
|
4865 |
assert(VM_Version::supports_avx(), ""); |
34162 | 4866 |
InstructionMark im(this); |
4867 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true); |
|
4868 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
|
4869 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4870 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
4871 |
emit_int8(0x57); |
|
4872 |
emit_operand(dst, src); |
|
30624 | 4873 |
} |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4874 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4875 |
// Integer vector arithmetic |
30624 | 4876 |
void Assembler::vphaddw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
4877 |
assert(VM_Version::supports_avx() && (vector_len == 0) || |
|
4878 |
VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
|
34162 | 4879 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
4880 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4881 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
30211 | 4882 |
emit_int8(0x01); |
4883 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
4884 |
} |
|
4885 |
||
30624 | 4886 |
void Assembler::vphaddd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
4887 |
assert(VM_Version::supports_avx() && (vector_len == 0) || |
|
4888 |
VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
|
34162 | 4889 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
4890 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4891 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
30211 | 4892 |
emit_int8(0x02); |
4893 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
4894 |
} |
|
4895 |
||
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4896 |
void Assembler::paddb(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4897 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
35113 | 4898 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 4899 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
4900 |
emit_int8((unsigned char)0xFC); |
|
4901 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4902 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4903 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4904 |
void Assembler::paddw(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4905 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
35113 | 4906 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 4907 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
4908 |
emit_int8((unsigned char)0xFD); |
|
4909 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4910 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4911 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4912 |
void Assembler::paddd(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4913 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 4914 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4915 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4916 |
emit_int8((unsigned char)0xFE); |
|
4917 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4918 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4919 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4920 |
void Assembler::paddq(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
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 */ false, /* uses_vl */ true); |
4923 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4924 |
emit_int8((unsigned char)0xD4); |
|
4925 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4926 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4927 |
|
30211 | 4928 |
void Assembler::phaddw(XMMRegister dst, XMMRegister src) { |
4929 |
NOT_LP64(assert(VM_Version::supports_sse3(), "")); |
|
34162 | 4930 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
4931 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
30211 | 4932 |
emit_int8(0x01); |
4933 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
4934 |
} |
|
4935 |
||
4936 |
void Assembler::phaddd(XMMRegister dst, XMMRegister src) { |
|
4937 |
NOT_LP64(assert(VM_Version::supports_sse3(), "")); |
|
34162 | 4938 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
4939 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
30211 | 4940 |
emit_int8(0x02); |
4941 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
4942 |
} |
|
4943 |
||
30624 | 4944 |
void Assembler::vpaddb(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
4945 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
35113 | 4946 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 4947 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
4948 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4949 |
emit_int8((unsigned char)0xFC); |
|
4950 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 4951 |
} |
4952 |
||
4953 |
void Assembler::vpaddw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
4954 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
35113 | 4955 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 4956 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
4957 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4958 |
emit_int8((unsigned char)0xFD); |
|
4959 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 4960 |
} |
4961 |
||
4962 |
void Assembler::vpaddd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
4963 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 4964 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4965 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4966 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4967 |
emit_int8((unsigned char)0xFE); |
|
4968 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 4969 |
} |
4970 |
||
4971 |
void Assembler::vpaddq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
4972 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 4973 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
4974 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4975 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4976 |
emit_int8((unsigned char)0xD4); |
|
4977 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 4978 |
} |
4979 |
||
4980 |
void Assembler::vpaddb(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
4981 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 4982 |
InstructionMark im(this); |
35113 | 4983 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 4984 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
4985 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4986 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4987 |
emit_int8((unsigned char)0xFC); |
|
4988 |
emit_operand(dst, src); |
|
30624 | 4989 |
} |
4990 |
||
4991 |
void Assembler::vpaddw(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
4992 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 4993 |
InstructionMark im(this); |
35113 | 4994 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 4995 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
4996 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4997 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
4998 |
emit_int8((unsigned char)0xFD); |
|
4999 |
emit_operand(dst, src); |
|
30624 | 5000 |
} |
5001 |
||
5002 |
void Assembler::vpaddd(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
5003 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5004 |
InstructionMark im(this); |
5005 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
5006 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
|
5007 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
5008 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5009 |
emit_int8((unsigned char)0xFE); |
|
5010 |
emit_operand(dst, src); |
|
30624 | 5011 |
} |
5012 |
||
5013 |
void Assembler::vpaddq(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
5014 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5015 |
InstructionMark im(this); |
5016 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
5017 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
|
5018 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
5019 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5020 |
emit_int8((unsigned char)0xD4); |
|
5021 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5022 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5023 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5024 |
void Assembler::psubb(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5025 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
35113 | 5026 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5027 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5028 |
emit_int8((unsigned char)0xF8); |
|
5029 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5030 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5031 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5032 |
void Assembler::psubw(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5033 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
35113 | 5034 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5035 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5036 |
emit_int8((unsigned char)0xF9); |
|
5037 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5038 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5039 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5040 |
void Assembler::psubd(XMMRegister dst, XMMRegister src) { |
34162 | 5041 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5042 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5043 |
emit_int8((unsigned char)0xFA); |
|
5044 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5045 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5046 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5047 |
void Assembler::psubq(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5048 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 5049 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5050 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5051 |
emit_int8((unsigned char)0xFB); |
|
5052 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5053 |
} |
5054 |
||
5055 |
void Assembler::vpsubb(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
5056 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
35113 | 5057 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5058 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
5059 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5060 |
emit_int8((unsigned char)0xF8); |
|
5061 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5062 |
} |
5063 |
||
5064 |
void Assembler::vpsubw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
5065 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
35113 | 5066 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5067 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
5068 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5069 |
emit_int8((unsigned char)0xF9); |
|
5070 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5071 |
} |
5072 |
||
5073 |
void Assembler::vpsubd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
5074 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5075 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5076 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
5077 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5078 |
emit_int8((unsigned char)0xFA); |
|
5079 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5080 |
} |
5081 |
||
5082 |
void Assembler::vpsubq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
5083 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5084 |
InstructionAttr attributes(vector_len, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5085 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
5086 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5087 |
emit_int8((unsigned char)0xFB); |
|
5088 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5089 |
} |
5090 |
||
5091 |
void Assembler::vpsubb(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
5092 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5093 |
InstructionMark im(this); |
35113 | 5094 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5095 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
5096 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
5097 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5098 |
emit_int8((unsigned char)0xF8); |
|
5099 |
emit_operand(dst, src); |
|
30624 | 5100 |
} |
5101 |
||
5102 |
void Assembler::vpsubw(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
5103 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5104 |
InstructionMark im(this); |
35113 | 5105 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5106 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
5107 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
5108 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5109 |
emit_int8((unsigned char)0xF9); |
|
5110 |
emit_operand(dst, src); |
|
30624 | 5111 |
} |
5112 |
||
5113 |
void Assembler::vpsubd(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
5114 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5115 |
InstructionMark im(this); |
5116 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
5117 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
|
5118 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
5119 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5120 |
emit_int8((unsigned char)0xFA); |
|
5121 |
emit_operand(dst, src); |
|
30624 | 5122 |
} |
5123 |
||
5124 |
void Assembler::vpsubq(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
5125 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5126 |
InstructionMark im(this); |
5127 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
5128 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
|
5129 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
5130 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5131 |
emit_int8((unsigned char)0xFB); |
|
5132 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5133 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5134 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5135 |
void Assembler::pmullw(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5136 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
35113 | 5137 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5138 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5139 |
emit_int8((unsigned char)0xD5); |
|
5140 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5141 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5142 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5143 |
void Assembler::pmulld(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5144 |
assert(VM_Version::supports_sse4_1(), ""); |
34162 | 5145 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5146 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
30624 | 5147 |
emit_int8(0x40); |
5148 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5149 |
} |
|
5150 |
||
5151 |
void Assembler::vpmullw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
5152 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
35113 | 5153 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5154 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
5155 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5156 |
emit_int8((unsigned char)0xD5); |
|
5157 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5158 |
} |
5159 |
||
5160 |
void Assembler::vpmulld(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
|
5161 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5162 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5163 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
5164 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, 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
|
5165 |
emit_int8(0x40); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5166 |
emit_int8((unsigned char)(0xC0 | encode)); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5167 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5168 |
|
30624 | 5169 |
void Assembler::vpmullq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
5170 |
assert(UseAVX > 2, "requires some form of AVX"); |
|
34162 | 5171 |
InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true); |
30624 | 5172 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
34162 | 5173 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, 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
|
5174 |
emit_int8(0x40); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5175 |
emit_int8((unsigned char)(0xC0 | encode)); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5176 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5177 |
|
30624 | 5178 |
void Assembler::vpmullw(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
5179 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5180 |
InstructionMark im(this); |
35113 | 5181 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5182 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); |
5183 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
5184 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5185 |
emit_int8((unsigned char)0xD5); |
|
5186 |
emit_operand(dst, src); |
|
30624 | 5187 |
} |
5188 |
||
5189 |
void Assembler::vpmulld(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
5190 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5191 |
InstructionMark im(this); |
5192 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
5193 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5194 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
34162 | 5195 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
30624 | 5196 |
emit_int8(0x40); |
5197 |
emit_operand(dst, src); |
|
5198 |
} |
|
5199 |
||
5200 |
void Assembler::vpmullq(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
5201 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5202 |
InstructionMark im(this); |
5203 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ false, /* uses_vl */ true); |
|
5204 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); |
|
30624 | 5205 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
34162 | 5206 |
vex_prefix(src, nds_enc, 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
|
5207 |
emit_int8(0x40); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5208 |
emit_operand(dst, src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5209 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5210 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5211 |
// Shift packed integers left by specified number of bits. |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5212 |
void Assembler::psllw(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5213 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
35113 | 5214 |
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
|
5215 |
// XMM6 is for /6 encoding: 66 0F 71 /6 ib |
34162 | 5216 |
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
|
5217 |
emit_int8(0x71); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5218 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5219 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5220 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5221 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5222 |
void Assembler::pslld(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5223 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 5224 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5225 |
// XMM6 is for /6 encoding: 66 0F 72 /6 ib |
34162 | 5226 |
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
|
5227 |
emit_int8(0x72); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5228 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5229 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5230 |
} |
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 |
void Assembler::psllq(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5233 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 5234 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5235 |
// XMM6 is for /6 encoding: 66 0F 73 /6 ib |
34162 | 5236 |
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
|
5237 |
emit_int8(0x73); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5238 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5239 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5240 |
} |
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 |
void Assembler::psllw(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5243 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
35113 | 5244 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5245 |
int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5246 |
emit_int8((unsigned char)0xF1); |
|
5247 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5248 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5249 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5250 |
void Assembler::pslld(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5251 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 5252 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5253 |
int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5254 |
emit_int8((unsigned char)0xF2); |
|
5255 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5256 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5257 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5258 |
void Assembler::psllq(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5259 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 5260 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5261 |
int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5262 |
emit_int8((unsigned char)0xF3); |
|
5263 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5264 |
} |
5265 |
||
5266 |
void Assembler::vpsllw(XMMRegister dst, XMMRegister src, int shift, int vector_len) { |
|
5267 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
35113 | 5268 |
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
|
5269 |
// XMM6 is for /6 encoding: 66 0F 71 /6 ib |
34162 | 5270 |
int encode = vex_prefix_and_encode(xmm6->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5271 |
emit_int8(0x71); |
|
5272 |
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
|
5273 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5274 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5275 |
|
30624 | 5276 |
void Assembler::vpslld(XMMRegister dst, XMMRegister src, int shift, int vector_len) { |
5277 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5278 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
5279 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5280 |
// XMM6 is for /6 encoding: 66 0F 72 /6 ib |
34162 | 5281 |
int encode = vex_prefix_and_encode(xmm6->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5282 |
emit_int8(0x72); |
|
5283 |
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
|
5284 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5285 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5286 |
|
30624 | 5287 |
void Assembler::vpsllq(XMMRegister dst, XMMRegister src, int shift, int vector_len) { |
5288 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5289 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5290 |
// XMM6 is for /6 encoding: 66 0F 73 /6 ib |
34162 | 5291 |
int encode = vex_prefix_and_encode(xmm6->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5292 |
emit_int8(0x73); |
|
5293 |
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
|
5294 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5295 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5296 |
|
30624 | 5297 |
void Assembler::vpsllw(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { |
5298 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
35113 | 5299 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5300 |
int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5301 |
emit_int8((unsigned char)0xF1); |
|
5302 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5303 |
} |
5304 |
||
5305 |
void Assembler::vpslld(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { |
|
5306 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5307 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5308 |
int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5309 |
emit_int8((unsigned char)0xF2); |
|
5310 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5311 |
} |
5312 |
||
5313 |
void Assembler::vpsllq(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { |
|
5314 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5315 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5316 |
int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5317 |
emit_int8((unsigned char)0xF3); |
|
5318 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5319 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5320 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5321 |
// Shift packed integers logically right by specified number of bits. |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5322 |
void Assembler::psrlw(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5323 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
35113 | 5324 |
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
|
5325 |
// XMM2 is for /2 encoding: 66 0F 71 /2 ib |
34162 | 5326 |
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
|
5327 |
emit_int8(0x71); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5328 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5329 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5330 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5331 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5332 |
void Assembler::psrld(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5333 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 5334 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5335 |
// XMM2 is for /2 encoding: 66 0F 72 /2 ib |
34162 | 5336 |
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
|
5337 |
emit_int8(0x72); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5338 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5339 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5340 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5341 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5342 |
void Assembler::psrlq(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5343 |
// Do not confuse it with psrldq SSE2 instruction which |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5344 |
// shifts 128 bit value in xmm register by number of bytes. |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5345 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 5346 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5347 |
// XMM2 is for /2 encoding: 66 0F 73 /2 ib |
34162 | 5348 |
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
|
5349 |
emit_int8(0x73); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5350 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5351 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5352 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5353 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5354 |
void Assembler::psrlw(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5355 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
35113 | 5356 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5357 |
int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5358 |
emit_int8((unsigned char)0xD1); |
|
5359 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5360 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5361 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5362 |
void Assembler::psrld(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5363 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 5364 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5365 |
int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5366 |
emit_int8((unsigned char)0xD2); |
|
5367 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5368 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5369 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5370 |
void Assembler::psrlq(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5371 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 5372 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5373 |
int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5374 |
emit_int8((unsigned char)0xD3); |
|
5375 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5376 |
} |
5377 |
||
5378 |
void Assembler::vpsrlw(XMMRegister dst, XMMRegister src, int shift, int vector_len) { |
|
5379 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
35113 | 5380 |
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
|
5381 |
// XMM2 is for /2 encoding: 66 0F 71 /2 ib |
34162 | 5382 |
int encode = vex_prefix_and_encode(xmm2->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5383 |
emit_int8(0x71); |
|
5384 |
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
|
5385 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5386 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5387 |
|
30624 | 5388 |
void Assembler::vpsrld(XMMRegister dst, XMMRegister src, int shift, int vector_len) { |
5389 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5390 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5391 |
// XMM2 is for /2 encoding: 66 0F 72 /2 ib |
34162 | 5392 |
int encode = vex_prefix_and_encode(xmm2->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5393 |
emit_int8(0x72); |
|
5394 |
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
|
5395 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5396 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5397 |
|
30624 | 5398 |
void Assembler::vpsrlq(XMMRegister dst, XMMRegister src, int shift, int vector_len) { |
5399 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5400 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5401 |
// XMM2 is for /2 encoding: 66 0F 73 /2 ib |
34162 | 5402 |
int encode = vex_prefix_and_encode(xmm2->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5403 |
emit_int8(0x73); |
|
5404 |
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
|
5405 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5406 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5407 |
|
30624 | 5408 |
void Assembler::vpsrlw(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { |
5409 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
35113 | 5410 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5411 |
int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5412 |
emit_int8((unsigned char)0xD1); |
|
5413 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5414 |
} |
5415 |
||
5416 |
void Assembler::vpsrld(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { |
|
5417 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5418 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5419 |
int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5420 |
emit_int8((unsigned char)0xD2); |
|
5421 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5422 |
} |
5423 |
||
5424 |
void Assembler::vpsrlq(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { |
|
5425 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5426 |
InstructionAttr attributes(vector_len, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5427 |
int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5428 |
emit_int8((unsigned char)0xD3); |
|
5429 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5430 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5431 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5432 |
// Shift packed integers arithmetically right by specified number of bits. |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5433 |
void Assembler::psraw(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5434 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
35113 | 5435 |
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
|
5436 |
// XMM4 is for /4 encoding: 66 0F 71 /4 ib |
34162 | 5437 |
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
|
5438 |
emit_int8(0x71); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5439 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5440 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5441 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5442 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5443 |
void Assembler::psrad(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5444 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 5445 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5446 |
// XMM4 is for /4 encoding: 66 0F 72 /4 ib |
34162 | 5447 |
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
|
5448 |
emit_int8(0x72); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5449 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5450 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5451 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5452 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5453 |
void Assembler::psraw(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5454 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
35113 | 5455 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5456 |
int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5457 |
emit_int8((unsigned char)0xE1); |
|
5458 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5459 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5460 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5461 |
void Assembler::psrad(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5462 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 5463 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5464 |
int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5465 |
emit_int8((unsigned char)0xE2); |
|
5466 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5467 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5468 |
|
30624 | 5469 |
void Assembler::vpsraw(XMMRegister dst, XMMRegister src, int shift, int vector_len) { |
5470 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
35113 | 5471 |
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
|
5472 |
// XMM4 is for /4 encoding: 66 0F 71 /4 ib |
34162 | 5473 |
int encode = vex_prefix_and_encode(xmm4->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5474 |
emit_int8(0x71); |
|
5475 |
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
|
5476 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5477 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5478 |
|
30624 | 5479 |
void Assembler::vpsrad(XMMRegister dst, XMMRegister src, int shift, int vector_len) { |
5480 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5481 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5482 |
// XMM4 is for /4 encoding: 66 0F 71 /4 ib |
34162 | 5483 |
int encode = vex_prefix_and_encode(xmm4->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5484 |
emit_int8(0x72); |
|
5485 |
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
|
5486 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5487 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5488 |
|
30624 | 5489 |
void Assembler::vpsraw(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { |
5490 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
35113 | 5491 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5492 |
int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
5493 |
emit_int8((unsigned char)0xE1); |
|
5494 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5495 |
} |
5496 |
||
5497 |
void Assembler::vpsrad(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { |
|
5498 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5499 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5500 |
int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5501 |
emit_int8((unsigned char)0xE2); |
|
5502 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5503 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5504 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5505 |
|
33089 | 5506 |
// logical operations packed integers |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5507 |
void Assembler::pand(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5508 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 5509 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5510 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5511 |
emit_int8((unsigned char)0xDB); |
|
5512 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5513 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5514 |
|
30624 | 5515 |
void Assembler::vpand(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
5516 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5517 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5518 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
5519 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5520 |
emit_int8((unsigned char)0xDB); |
|
5521 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5522 |
} |
5523 |
||
5524 |
void Assembler::vpand(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
5525 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5526 |
InstructionMark im(this); |
5527 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
5528 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
|
5529 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
5530 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5531 |
emit_int8((unsigned char)0xDB); |
|
5532 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5533 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5534 |
|
33089 | 5535 |
void Assembler::pandn(XMMRegister dst, XMMRegister src) { |
5536 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 5537 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5538 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5539 |
emit_int8((unsigned char)0xDF); |
|
5540 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
33089 | 5541 |
} |
5542 |
||
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5543 |
void Assembler::por(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5544 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 5545 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5546 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5547 |
emit_int8((unsigned char)0xEB); |
|
5548 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5549 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5550 |
|
30624 | 5551 |
void Assembler::vpor(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
5552 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5553 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5554 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
5555 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5556 |
emit_int8((unsigned char)0xEB); |
|
5557 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5558 |
} |
5559 |
||
5560 |
void Assembler::vpor(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
5561 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5562 |
InstructionMark im(this); |
5563 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
5564 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
|
5565 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
5566 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5567 |
emit_int8((unsigned char)0xEB); |
|
5568 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5569 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5570 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5571 |
void Assembler::pxor(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5572 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 5573 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5574 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5575 |
emit_int8((unsigned char)0xEF); |
|
5576 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
5577 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
5578 |
|
30624 | 5579 |
void Assembler::vpxor(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { |
5580 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5581 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
5582 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
5583 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5584 |
emit_int8((unsigned char)0xEF); |
|
5585 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
30624 | 5586 |
} |
5587 |
||
5588 |
void Assembler::vpxor(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { |
|
5589 |
assert(UseAVX > 0, "requires some form of AVX"); |
|
34162 | 5590 |
InstructionMark im(this); |
5591 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
5592 |
attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); |
|
5593 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
5594 |
vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); |
|
5595 |
emit_int8((unsigned char)0xEF); |
|
5596 |
emit_operand(dst, src); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5597 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
5598 |
|
13294 | 5599 |
|
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
5600 |
void Assembler::vinsertf128h(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
5601 |
assert(VM_Version::supports_avx(), ""); |
34162 | 5602 |
int vector_len = VM_Version::supports_evex() ? AVX_512bit : AVX_256bit; |
5603 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
|
5604 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
5605 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, 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
|
5606 |
emit_int8(0x18); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5607 |
emit_int8((unsigned char)(0xC0 | encode)); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
5608 |
// 0x00 - insert into lower 128 bits |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
5609 |
// 0x01 - insert into upper 128 bits |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5610 |
emit_int8(0x01); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
5611 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
5612 |
|
34162 | 5613 |
void Assembler::vinsertf64x4h(XMMRegister dst, XMMRegister nds, XMMRegister src, int value) { |
30624 | 5614 |
assert(VM_Version::supports_evex(), ""); |
34162 | 5615 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
30624 | 5616 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
34162 | 5617 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
30624 | 5618 |
emit_int8(0x1A); |
5619 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5620 |
// 0x00 - insert into lower 256 bits |
|
5621 |
// 0x01 - insert into upper 256 bits |
|
34162 | 5622 |
emit_int8(value & 0x01); |
5623 |
} |
|
5624 |
||
5625 |
void Assembler::vinsertf64x4h(XMMRegister dst, Address src, int value) { |
|
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5626 |
assert(VM_Version::supports_evex(), ""); |
30624 | 5627 |
assert(dst != xnoreg, "sanity"); |
34162 | 5628 |
InstructionMark im(this); |
5629 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
|
5630 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_64bit); |
|
30624 | 5631 |
// swap src<->dst for encoding |
34162 | 5632 |
vex_prefix(src, dst->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
30624 | 5633 |
emit_int8(0x1A); |
5634 |
emit_operand(dst, src); |
|
34162 | 5635 |
// 0x00 - insert into lower 256 bits |
30624 | 5636 |
// 0x01 - insert into upper 128 bits |
34162 | 5637 |
emit_int8(value & 0x01); |
30624 | 5638 |
} |
5639 |
||
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5640 |
void Assembler::vinsertf32x4h(XMMRegister dst, XMMRegister nds, XMMRegister src, int value) { |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5641 |
assert(VM_Version::supports_evex(), ""); |
34162 | 5642 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5643 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
34162 | 5644 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, 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
|
5645 |
emit_int8(0x18); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5646 |
emit_int8((unsigned char)(0xC0 | encode)); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5647 |
// 0x00 - insert into q0 128 bits (0..127) |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5648 |
// 0x01 - insert into q1 128 bits (128..255) |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5649 |
// 0x02 - insert into q2 128 bits (256..383) |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5650 |
// 0x03 - insert into q3 128 bits (384..511) |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5651 |
emit_int8(value & 0x3); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5652 |
} |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5653 |
|
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5654 |
void Assembler::vinsertf32x4h(XMMRegister dst, Address src, int value) { |
34162 | 5655 |
assert(VM_Version::supports_avx(), ""); |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5656 |
assert(dst != xnoreg, "sanity"); |
34162 | 5657 |
int vector_len = VM_Version::supports_evex() ? AVX_512bit : AVX_256bit; |
5658 |
InstructionMark im(this); |
|
5659 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
|
5660 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit); |
|
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5661 |
// swap src<->dst for encoding |
34162 | 5662 |
vex_prefix(src, dst->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
|
5663 |
emit_int8(0x18); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5664 |
emit_operand(dst, src); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5665 |
// 0x00 - insert into q0 128 bits (0..127) |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5666 |
// 0x01 - insert into q1 128 bits (128..255) |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5667 |
// 0x02 - insert into q2 128 bits (256..383) |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5668 |
// 0x03 - insert into q3 128 bits (384..511) |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5669 |
emit_int8(value & 0x3); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5670 |
} |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5671 |
|
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5672 |
void Assembler::vinsertf128h(XMMRegister dst, Address src) { |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5673 |
assert(VM_Version::supports_avx(), ""); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5674 |
assert(dst != xnoreg, "sanity"); |
34162 | 5675 |
int vector_len = VM_Version::supports_evex() ? AVX_512bit : AVX_256bit; |
5676 |
InstructionMark im(this); |
|
5677 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
|
5678 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit); |
|
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5679 |
// swap src<->dst for encoding |
34162 | 5680 |
vex_prefix(src, dst->encoding(), dst->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
|
5681 |
emit_int8(0x18); |
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5682 |
emit_operand(dst, src); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5683 |
// 0x01 - insert into upper 128 bits |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5684 |
emit_int8(0x01); |
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5685 |
} |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5686 |
|
30211 | 5687 |
void Assembler::vextractf128h(XMMRegister dst, XMMRegister src) { |
5688 |
assert(VM_Version::supports_avx(), ""); |
|
34162 | 5689 |
int vector_len = VM_Version::supports_evex() ? AVX_512bit : AVX_256bit; |
5690 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
|
5691 |
int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
30211 | 5692 |
emit_int8(0x19); |
5693 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5694 |
// 0x00 - insert into lower 128 bits |
|
5695 |
// 0x01 - insert into upper 128 bits |
|
5696 |
emit_int8(0x01); |
|
5697 |
} |
|
5698 |
||
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5699 |
void Assembler::vextractf128h(Address dst, XMMRegister src) { |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5700 |
assert(VM_Version::supports_avx(), ""); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5701 |
assert(src != xnoreg, "sanity"); |
34162 | 5702 |
int vector_len = VM_Version::supports_evex() ? AVX_512bit : AVX_256bit; |
5703 |
InstructionMark im(this); |
|
5704 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
|
5705 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit); |
|
5706 |
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
|
5707 |
emit_int8(0x19); |
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5708 |
emit_operand(src, dst); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5709 |
// 0x01 - extract from upper 128 bits |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5710 |
emit_int8(0x01); |
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5711 |
} |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5712 |
|
13294 | 5713 |
void Assembler::vinserti128h(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
5714 |
assert(VM_Version::supports_avx2(), ""); |
|
34162 | 5715 |
int vector_len = VM_Version::supports_evex() ? AVX_512bit : AVX_256bit; |
5716 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
|
5717 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
5718 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, 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
|
5719 |
emit_int8(0x38); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5720 |
emit_int8((unsigned char)(0xC0 | encode)); |
13294 | 5721 |
// 0x00 - insert into lower 128 bits |
5722 |
// 0x01 - insert into upper 128 bits |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5723 |
emit_int8(0x01); |
13294 | 5724 |
} |
5725 |
||
34162 | 5726 |
void Assembler::vinserti64x4h(XMMRegister dst, XMMRegister nds, XMMRegister src, int value) { |
30624 | 5727 |
assert(VM_Version::supports_evex(), ""); |
34162 | 5728 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
30624 | 5729 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
34162 | 5730 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
30624 | 5731 |
emit_int8(0x38); |
5732 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5733 |
// 0x00 - insert into lower 256 bits |
|
5734 |
// 0x01 - insert into upper 256 bits |
|
34162 | 5735 |
emit_int8(value & 0x01); |
30624 | 5736 |
} |
5737 |
||
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5738 |
void Assembler::vinserti128h(XMMRegister dst, Address src) { |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5739 |
assert(VM_Version::supports_avx2(), ""); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5740 |
assert(dst != xnoreg, "sanity"); |
34162 | 5741 |
int vector_len = VM_Version::supports_evex() ? AVX_512bit : AVX_256bit; |
5742 |
InstructionMark im(this); |
|
5743 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
|
5744 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit); |
|
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5745 |
// swap src<->dst for encoding |
34162 | 5746 |
vex_prefix(src, dst->encoding(), dst->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
|
5747 |
emit_int8(0x38); |
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5748 |
emit_operand(dst, src); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5749 |
// 0x01 - insert into upper 128 bits |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5750 |
emit_int8(0x01); |
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5751 |
} |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5752 |
|
30624 | 5753 |
void Assembler::vextracti128h(XMMRegister dst, XMMRegister src) { |
5754 |
assert(VM_Version::supports_avx(), ""); |
|
34162 | 5755 |
int vector_len = VM_Version::supports_evex() ? AVX_512bit : AVX_256bit; |
5756 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
|
5757 |
int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
30624 | 5758 |
emit_int8(0x39); |
5759 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5760 |
// 0x00 - insert into lower 128 bits |
|
5761 |
// 0x01 - insert into upper 128 bits |
|
5762 |
emit_int8(0x01); |
|
5763 |
} |
|
5764 |
||
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5765 |
void Assembler::vextracti128h(Address dst, XMMRegister src) { |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5766 |
assert(VM_Version::supports_avx2(), ""); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5767 |
assert(src != xnoreg, "sanity"); |
34162 | 5768 |
int vector_len = VM_Version::supports_evex() ? AVX_512bit : AVX_256bit; |
5769 |
InstructionMark im(this); |
|
5770 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
|
5771 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit); |
|
5772 |
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
|
5773 |
emit_int8(0x39); |
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5774 |
emit_operand(src, dst); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5775 |
// 0x01 - extract from upper 128 bits |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5776 |
emit_int8(0x01); |
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5777 |
} |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
5778 |
|
34162 | 5779 |
void Assembler::vextracti64x4h(XMMRegister dst, XMMRegister src, int value) { |
30624 | 5780 |
assert(VM_Version::supports_evex(), ""); |
34162 | 5781 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
5782 |
int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
30624 | 5783 |
emit_int8(0x3B); |
5784 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
34162 | 5785 |
// 0x00 - extract from lower 256 bits |
30624 | 5786 |
// 0x01 - extract from upper 256 bits |
34162 | 5787 |
emit_int8(value & 0x01); |
30624 | 5788 |
} |
5789 |
||
5790 |
void Assembler::vextracti64x2h(XMMRegister dst, XMMRegister src, int value) { |
|
5791 |
assert(VM_Version::supports_evex(), ""); |
|
34162 | 5792 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ !_legacy_mode_dq, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
5793 |
int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
30624 | 5794 |
emit_int8(0x39); |
5795 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5796 |
// 0x01 - extract from bits 255:128 |
|
5797 |
// 0x02 - extract from bits 383:256 |
|
5798 |
// 0x03 - extract from bits 511:384 |
|
5799 |
emit_int8(value & 0x3); |
|
5800 |
} |
|
5801 |
||
34162 | 5802 |
void Assembler::vextractf64x4h(XMMRegister dst, XMMRegister src, int value) { |
30624 | 5803 |
assert(VM_Version::supports_evex(), ""); |
34162 | 5804 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
5805 |
int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
30624 | 5806 |
emit_int8(0x1B); |
5807 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
34162 | 5808 |
// 0x00 - extract from lower 256 bits |
30624 | 5809 |
// 0x01 - extract from upper 256 bits |
34162 | 5810 |
emit_int8(value & 0x1); |
5811 |
} |
|
5812 |
||
5813 |
void Assembler::vextractf64x4h(Address dst, XMMRegister src, int value) { |
|
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5814 |
assert(VM_Version::supports_evex(), ""); |
30624 | 5815 |
assert(src != xnoreg, "sanity"); |
34162 | 5816 |
InstructionMark im(this); |
5817 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
|
5818 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T4,/* input_size_in_bits */ EVEX_64bit); |
|
5819 |
vex_prefix(dst, 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
30624 | 5820 |
emit_int8(0x1B); |
5821 |
emit_operand(src, dst); |
|
34162 | 5822 |
// 0x00 - extract from lower 256 bits |
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5823 |
// 0x01 - extract from upper 256 bits |
34162 | 5824 |
emit_int8(value & 0x01); |
30624 | 5825 |
} |
5826 |
||
5827 |
void Assembler::vextractf32x4h(XMMRegister dst, XMMRegister src, int value) { |
|
34162 | 5828 |
assert(VM_Version::supports_avx(), ""); |
5829 |
int vector_len = VM_Version::supports_evex() ? AVX_512bit : AVX_256bit; |
|
5830 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
|
5831 |
int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
30624 | 5832 |
emit_int8(0x19); |
5833 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5834 |
// 0x00 - extract from bits 127:0 |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5835 |
// 0x01 - extract from bits 255:128 |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5836 |
// 0x02 - extract from bits 383:256 |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5837 |
// 0x03 - extract from bits 511:384 |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5838 |
emit_int8(value & 0x3); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5839 |
} |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5840 |
|
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5841 |
void Assembler::vextractf32x4h(Address dst, XMMRegister src, int value) { |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5842 |
assert(VM_Version::supports_evex(), ""); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5843 |
assert(src != xnoreg, "sanity"); |
34162 | 5844 |
InstructionMark im(this); |
5845 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
|
5846 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit); |
|
5847 |
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
|
5848 |
emit_int8(0x19); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5849 |
emit_operand(src, dst); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
5850 |
// 0x00 - extract from bits 127:0 |
30624 | 5851 |
// 0x01 - extract from bits 255:128 |
5852 |
// 0x02 - extract from bits 383:256 |
|
5853 |
// 0x03 - extract from bits 511:384 |
|
5854 |
emit_int8(value & 0x3); |
|
5855 |
} |
|
5856 |
||
5857 |
void Assembler::vextractf64x2h(XMMRegister dst, XMMRegister src, int value) { |
|
5858 |
assert(VM_Version::supports_evex(), ""); |
|
34162 | 5859 |
InstructionAttr attributes(AVX_512bit, /* vex_w */ !_legacy_mode_dq, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ false); |
5860 |
int encode = vex_prefix_and_encode(src->encoding(), 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); |
|
30624 | 5861 |
emit_int8(0x19); |
5862 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5863 |
// 0x01 - extract from bits 255:128 |
|
5864 |
// 0x02 - extract from bits 383:256 |
|
5865 |
// 0x03 - extract from bits 511:384 |
|
5866 |
emit_int8(value & 0x3); |
|
5867 |
} |
|
5868 |
||
15115
f8ef87f6f07f
8005544: Use 256bit YMM registers in arraycopy stubs on x86
kvn
parents:
15114
diff
changeset
|
5869 |
// duplicate 4-bytes integer data from src into 8 locations in dest |
f8ef87f6f07f
8005544: Use 256bit YMM registers in arraycopy stubs on x86
kvn
parents:
15114
diff
changeset
|
5870 |
void Assembler::vpbroadcastd(XMMRegister dst, XMMRegister src) { |
34162 | 5871 |
assert(VM_Version::supports_avx2(), ""); |
5872 |
InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
5873 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
30624 | 5874 |
emit_int8(0x58); |
5875 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5876 |
} |
|
5877 |
||
33628 | 5878 |
// duplicate 2-bytes integer data from src into 16 locations in dest |
5879 |
void Assembler::vpbroadcastw(XMMRegister dst, XMMRegister src) { |
|
5880 |
assert(VM_Version::supports_avx2(), ""); |
|
35113 | 5881 |
InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); |
34162 | 5882 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
33628 | 5883 |
emit_int8(0x79); |
5884 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5885 |
} |
|
5886 |
||
31410 | 5887 |
// duplicate 1-byte integer data from src into 16||32|64 locations in dest : requires AVX512BW and AVX512VL |
5888 |
void Assembler::evpbroadcastb(XMMRegister dst, XMMRegister src, int vector_len) { |
|
34162 | 5889 |
assert(VM_Version::supports_evex(), ""); |
5890 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
5891 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
31410 | 5892 |
emit_int8(0x78); |
5893 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5894 |
} |
|
5895 |
||
5896 |
void Assembler::evpbroadcastb(XMMRegister dst, Address src, int vector_len) { |
|
34162 | 5897 |
assert(VM_Version::supports_evex(), ""); |
31410 | 5898 |
assert(dst != xnoreg, "sanity"); |
34162 | 5899 |
InstructionMark im(this); |
5900 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
5901 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_8bit); |
|
31410 | 5902 |
// swap src<->dst for encoding |
34162 | 5903 |
vex_prefix(src, dst->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
31410 | 5904 |
emit_int8(0x78); |
5905 |
emit_operand(dst, src); |
|
5906 |
} |
|
5907 |
||
5908 |
// duplicate 2-byte integer data from src into 8|16||32 locations in dest : requires AVX512BW and AVX512VL |
|
5909 |
void Assembler::evpbroadcastw(XMMRegister dst, XMMRegister src, int vector_len) { |
|
34162 | 5910 |
assert(VM_Version::supports_evex(), ""); |
5911 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
5912 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
31410 | 5913 |
emit_int8(0x79); |
5914 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5915 |
} |
|
5916 |
||
5917 |
void Assembler::evpbroadcastw(XMMRegister dst, Address src, int vector_len) { |
|
34162 | 5918 |
assert(VM_Version::supports_evex(), ""); |
31410 | 5919 |
assert(dst != xnoreg, "sanity"); |
34162 | 5920 |
InstructionMark im(this); |
5921 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
5922 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_16bit); |
|
31410 | 5923 |
// swap src<->dst for encoding |
34162 | 5924 |
vex_prefix(src, dst->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
31410 | 5925 |
emit_int8(0x79); |
5926 |
emit_operand(dst, src); |
|
5927 |
} |
|
5928 |
||
5929 |
// duplicate 4-byte integer data from src into 4|8|16 locations in dest : requires AVX512VL |
|
30624 | 5930 |
void Assembler::evpbroadcastd(XMMRegister dst, XMMRegister src, int vector_len) { |
34162 | 5931 |
assert(VM_Version::supports_evex(), ""); |
5932 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
5933 |
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
|
5934 |
emit_int8(0x58); |
f8ef87f6f07f
8005544: Use 256bit YMM registers in arraycopy stubs on x86
kvn
parents:
15114
diff
changeset
|
5935 |
emit_int8((unsigned char)(0xC0 | encode)); |
f8ef87f6f07f
8005544: Use 256bit YMM registers in arraycopy stubs on x86
kvn
parents:
15114
diff
changeset
|
5936 |
} |
f8ef87f6f07f
8005544: Use 256bit YMM registers in arraycopy stubs on x86
kvn
parents:
15114
diff
changeset
|
5937 |
|
31410 | 5938 |
void Assembler::evpbroadcastd(XMMRegister dst, Address src, int vector_len) { |
34162 | 5939 |
assert(VM_Version::supports_evex(), ""); |
31410 | 5940 |
assert(dst != xnoreg, "sanity"); |
34162 | 5941 |
InstructionMark im(this); |
5942 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
5943 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
31410 | 5944 |
// swap src<->dst for encoding |
34162 | 5945 |
vex_prefix(src, dst->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
31410 | 5946 |
emit_int8(0x58); |
5947 |
emit_operand(dst, src); |
|
5948 |
} |
|
5949 |
||
5950 |
// duplicate 8-byte integer data from src into 4|8|16 locations in dest : requires AVX512VL |
|
5951 |
void Assembler::evpbroadcastq(XMMRegister dst, XMMRegister src, int vector_len) { |
|
34162 | 5952 |
assert(VM_Version::supports_evex(), ""); |
5953 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
5954 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
31410 | 5955 |
emit_int8(0x59); |
5956 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5957 |
} |
|
5958 |
||
5959 |
void Assembler::evpbroadcastq(XMMRegister dst, Address src, int vector_len) { |
|
34162 | 5960 |
assert(VM_Version::supports_evex(), ""); |
31410 | 5961 |
assert(dst != xnoreg, "sanity"); |
34162 | 5962 |
InstructionMark im(this); |
5963 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
5964 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
31410 | 5965 |
// swap src<->dst for encoding |
34162 | 5966 |
vex_prefix(src, dst->encoding(), dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
31410 | 5967 |
emit_int8(0x59); |
5968 |
emit_operand(dst, src); |
|
5969 |
} |
|
5970 |
||
5971 |
// duplicate single precision fp from src into 4|8|16 locations in dest : requires AVX512VL |
|
5972 |
void Assembler::evpbroadcastss(XMMRegister dst, XMMRegister src, int vector_len) { |
|
34162 | 5973 |
assert(VM_Version::supports_evex(), ""); |
5974 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
5975 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
31410 | 5976 |
emit_int8(0x18); |
5977 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5978 |
} |
|
5979 |
||
5980 |
void Assembler::evpbroadcastss(XMMRegister dst, Address src, int vector_len) { |
|
34162 | 5981 |
assert(VM_Version::supports_evex(), ""); |
31410 | 5982 |
assert(dst != xnoreg, "sanity"); |
34162 | 5983 |
InstructionMark im(this); |
5984 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
5985 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); |
|
31410 | 5986 |
// swap src<->dst for encoding |
34162 | 5987 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
31410 | 5988 |
emit_int8(0x18); |
5989 |
emit_operand(dst, src); |
|
5990 |
} |
|
5991 |
||
5992 |
// duplicate double precision fp from src into 2|4|8 locations in dest : requires AVX512VL |
|
5993 |
void Assembler::evpbroadcastsd(XMMRegister dst, XMMRegister src, int vector_len) { |
|
34162 | 5994 |
assert(VM_Version::supports_evex(), ""); |
5995 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
5996 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
31410 | 5997 |
emit_int8(0x19); |
5998 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
5999 |
} |
|
6000 |
||
6001 |
void Assembler::evpbroadcastsd(XMMRegister dst, Address src, int vector_len) { |
|
34162 | 6002 |
assert(VM_Version::supports_evex(), ""); |
31410 | 6003 |
assert(dst != xnoreg, "sanity"); |
34162 | 6004 |
InstructionMark im(this); |
6005 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
|
6006 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
31410 | 6007 |
// swap src<->dst for encoding |
34162 | 6008 |
vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
31410 | 6009 |
emit_int8(0x19); |
6010 |
emit_operand(dst, src); |
|
6011 |
} |
|
6012 |
||
6013 |
// duplicate 1-byte integer data from src into 16||32|64 locations in dest : requires AVX512BW and AVX512VL |
|
6014 |
void Assembler::evpbroadcastb(XMMRegister dst, Register src, int vector_len) { |
|
6015 |
assert(VM_Version::supports_evex(), ""); |
|
34162 | 6016 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
6017 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
31410 | 6018 |
emit_int8(0x7A); |
6019 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
6020 |
} |
|
6021 |
||
6022 |
// duplicate 2-byte integer data from src into 8|16||32 locations in dest : requires AVX512BW and AVX512VL |
|
6023 |
void Assembler::evpbroadcastw(XMMRegister dst, Register src, int vector_len) { |
|
6024 |
assert(VM_Version::supports_evex(), ""); |
|
34162 | 6025 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
6026 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
31410 | 6027 |
emit_int8(0x7B); |
6028 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
6029 |
} |
|
6030 |
||
6031 |
// duplicate 4-byte integer data from src into 4|8|16 locations in dest : requires AVX512VL |
|
6032 |
void Assembler::evpbroadcastd(XMMRegister dst, Register src, int vector_len) { |
|
6033 |
assert(VM_Version::supports_evex(), ""); |
|
34162 | 6034 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
6035 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
31410 | 6036 |
emit_int8(0x7C); |
6037 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
6038 |
} |
|
6039 |
||
6040 |
// duplicate 8-byte integer data from src into 4|8|16 locations in dest : requires AVX512VL |
|
6041 |
void Assembler::evpbroadcastq(XMMRegister dst, Register src, int vector_len) { |
|
6042 |
assert(VM_Version::supports_evex(), ""); |
|
34162 | 6043 |
InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); |
6044 |
int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); |
|
31410 | 6045 |
emit_int8(0x7C); |
6046 |
emit_int8((unsigned char)(0xC0 | encode)); |
|
6047 |
} |
|
6048 |
||
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
6049 |
// Carry-Less Multiplication Quadword |
25932
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
24424
diff
changeset
|
6050 |
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
|
6051 |
assert(VM_Version::supports_clmul(), ""); |
34162 | 6052 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
6053 |
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
|
6054 |
emit_int8(0x44); |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
24424
diff
changeset
|
6055 |
emit_int8((unsigned char)(0xC0 | encode)); |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
24424
diff
changeset
|
6056 |
emit_int8((unsigned char)mask); |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
24424
diff
changeset
|
6057 |
} |
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
24424
diff
changeset
|
6058 |
|
15d133edd8f6
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
24424
diff
changeset
|
6059 |
// Carry-Less Multiplication Quadword |
18507
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
6060 |
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
|
6061 |
assert(VM_Version::supports_avx() && VM_Version::supports_clmul(), ""); |
34162 | 6062 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
6063 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
6064 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, 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
|
6065 |
emit_int8(0x44); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
6066 |
emit_int8((unsigned char)(0xC0 | encode)); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
6067 |
emit_int8((unsigned char)mask); |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
6068 |
} |
61bfc8995bb3
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
16670
diff
changeset
|
6069 |
|
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
6070 |
void Assembler::vzeroupper() { |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
6071 |
assert(VM_Version::supports_avx(), ""); |
34162 | 6072 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
6073 |
(void)vex_prefix_and_encode(0, 0, 0, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); |
|
6074 |
emit_int8(0x77); |
|
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
6075 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
6076 |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
6077 |
|
1066 | 6078 |
#ifndef _LP64 |
6079 |
// 32bit only pieces of the assembler |
|
6080 |
||
6081 |
void Assembler::cmp_literal32(Register src1, int32_t imm32, RelocationHolder const& rspec) { |
|
6082 |
// NO PREFIX AS NEVER 64BIT |
|
6083 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6084 |
emit_int8((unsigned char)0x81); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6085 |
emit_int8((unsigned char)(0xF8 | src1->encoding())); |
1066 | 6086 |
emit_data(imm32, rspec, 0); |
6087 |
} |
|
6088 |
||
6089 |
void Assembler::cmp_literal32(Address src1, int32_t imm32, RelocationHolder const& rspec) { |
|
6090 |
// NO PREFIX AS NEVER 64BIT (not even 32bit versions of 64bit regs |
|
6091 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6092 |
emit_int8((unsigned char)0x81); |
1066 | 6093 |
emit_operand(rdi, src1); |
6094 |
emit_data(imm32, rspec, 0); |
|
6095 |
} |
|
6096 |
||
6097 |
// The 64-bit (32bit platform) cmpxchg compares the value at adr with the contents of rdx:rax, |
|
6098 |
// and stores rcx:rbx into adr if so; otherwise, the value at adr is loaded |
|
6099 |
// into rdx:rax. The ZF is set if the compared values were equal, and cleared otherwise. |
|
6100 |
void Assembler::cmpxchg8(Address adr) { |
|
6101 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6102 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6103 |
emit_int8((unsigned char)0xC7); |
1066 | 6104 |
emit_operand(rcx, adr); |
6105 |
} |
|
6106 |
||
6107 |
void Assembler::decl(Register dst) { |
|
6108 |
// 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
|
6109 |
emit_int8(0x48 | dst->encoding()); |
1066 | 6110 |
} |
6111 |
||
6112 |
#endif // _LP64 |
|
6113 |
||
6114 |
// 64bit typically doesn't use the x87 but needs to for the trig funcs |
|
6115 |
||
6116 |
void Assembler::fabs() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6117 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6118 |
emit_int8((unsigned char)0xE1); |
1066 | 6119 |
} |
6120 |
||
6121 |
void Assembler::fadd(int i) { |
|
6122 |
emit_farith(0xD8, 0xC0, i); |
|
6123 |
} |
|
6124 |
||
6125 |
void Assembler::fadd_d(Address src) { |
|
6126 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6127 |
emit_int8((unsigned char)0xDC); |
1066 | 6128 |
emit_operand32(rax, src); |
6129 |
} |
|
6130 |
||
6131 |
void Assembler::fadd_s(Address src) { |
|
6132 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6133 |
emit_int8((unsigned char)0xD8); |
1066 | 6134 |
emit_operand32(rax, src); |
6135 |
} |
|
6136 |
||
6137 |
void Assembler::fadda(int i) { |
|
6138 |
emit_farith(0xDC, 0xC0, i); |
|
6139 |
} |
|
6140 |
||
6141 |
void Assembler::faddp(int i) { |
|
6142 |
emit_farith(0xDE, 0xC0, i); |
|
6143 |
} |
|
6144 |
||
6145 |
void Assembler::fchs() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6146 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6147 |
emit_int8((unsigned char)0xE0); |
1066 | 6148 |
} |
6149 |
||
6150 |
void Assembler::fcom(int i) { |
|
6151 |
emit_farith(0xD8, 0xD0, i); |
|
6152 |
} |
|
6153 |
||
6154 |
void Assembler::fcomp(int i) { |
|
6155 |
emit_farith(0xD8, 0xD8, i); |
|
6156 |
} |
|
6157 |
||
6158 |
void Assembler::fcomp_d(Address src) { |
|
6159 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6160 |
emit_int8((unsigned char)0xDC); |
1066 | 6161 |
emit_operand32(rbx, src); |
6162 |
} |
|
6163 |
||
6164 |
void Assembler::fcomp_s(Address src) { |
|
6165 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6166 |
emit_int8((unsigned char)0xD8); |
1066 | 6167 |
emit_operand32(rbx, src); |
6168 |
} |
|
6169 |
||
6170 |
void Assembler::fcompp() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6171 |
emit_int8((unsigned char)0xDE); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6172 |
emit_int8((unsigned char)0xD9); |
1066 | 6173 |
} |
6174 |
||
6175 |
void Assembler::fcos() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6176 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6177 |
emit_int8((unsigned char)0xFF); |
1066 | 6178 |
} |
6179 |
||
6180 |
void Assembler::fdecstp() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6181 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6182 |
emit_int8((unsigned char)0xF6); |
1066 | 6183 |
} |
6184 |
||
6185 |
void Assembler::fdiv(int i) { |
|
6186 |
emit_farith(0xD8, 0xF0, i); |
|
6187 |
} |
|
6188 |
||
6189 |
void Assembler::fdiv_d(Address src) { |
|
6190 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6191 |
emit_int8((unsigned char)0xDC); |
1066 | 6192 |
emit_operand32(rsi, src); |
6193 |
} |
|
6194 |
||
6195 |
void Assembler::fdiv_s(Address src) { |
|
6196 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6197 |
emit_int8((unsigned char)0xD8); |
1066 | 6198 |
emit_operand32(rsi, src); |
6199 |
} |
|
6200 |
||
6201 |
void Assembler::fdiva(int i) { |
|
6202 |
emit_farith(0xDC, 0xF8, i); |
|
6203 |
} |
|
6204 |
||
6205 |
// Note: The Intel manual (Pentium Processor User's Manual, Vol.3, 1994) |
|
6206 |
// is erroneous for some of the floating-point instructions below. |
|
6207 |
||
6208 |
void Assembler::fdivp(int i) { |
|
6209 |
emit_farith(0xDE, 0xF8, i); // ST(0) <- ST(0) / ST(1) and pop (Intel manual wrong) |
|
6210 |
} |
|
6211 |
||
6212 |
void Assembler::fdivr(int i) { |
|
6213 |
emit_farith(0xD8, 0xF8, i); |
|
6214 |
} |
|
6215 |
||
6216 |
void Assembler::fdivr_d(Address src) { |
|
6217 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6218 |
emit_int8((unsigned char)0xDC); |
1066 | 6219 |
emit_operand32(rdi, src); |
6220 |
} |
|
6221 |
||
6222 |
void Assembler::fdivr_s(Address src) { |
|
6223 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6224 |
emit_int8((unsigned char)0xD8); |
1066 | 6225 |
emit_operand32(rdi, src); |
6226 |
} |
|
6227 |
||
6228 |
void Assembler::fdivra(int i) { |
|
6229 |
emit_farith(0xDC, 0xF0, i); |
|
6230 |
} |
|
6231 |
||
6232 |
void Assembler::fdivrp(int i) { |
|
6233 |
emit_farith(0xDE, 0xF0, i); // ST(0) <- ST(1) / ST(0) and pop (Intel manual wrong) |
|
6234 |
} |
|
6235 |
||
6236 |
void Assembler::ffree(int i) { |
|
6237 |
emit_farith(0xDD, 0xC0, i); |
|
6238 |
} |
|
6239 |
||
6240 |
void Assembler::fild_d(Address adr) { |
|
6241 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6242 |
emit_int8((unsigned char)0xDF); |
1066 | 6243 |
emit_operand32(rbp, adr); |
6244 |
} |
|
6245 |
||
6246 |
void Assembler::fild_s(Address adr) { |
|
6247 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6248 |
emit_int8((unsigned char)0xDB); |
1066 | 6249 |
emit_operand32(rax, adr); |
6250 |
} |
|
6251 |
||
6252 |
void Assembler::fincstp() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6253 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6254 |
emit_int8((unsigned char)0xF7); |
1066 | 6255 |
} |
6256 |
||
6257 |
void Assembler::finit() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6258 |
emit_int8((unsigned char)0x9B); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6259 |
emit_int8((unsigned char)0xDB); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6260 |
emit_int8((unsigned char)0xE3); |
1066 | 6261 |
} |
6262 |
||
6263 |
void Assembler::fist_s(Address adr) { |
|
6264 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6265 |
emit_int8((unsigned char)0xDB); |
1066 | 6266 |
emit_operand32(rdx, adr); |
6267 |
} |
|
6268 |
||
6269 |
void Assembler::fistp_d(Address adr) { |
|
6270 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6271 |
emit_int8((unsigned char)0xDF); |
1066 | 6272 |
emit_operand32(rdi, adr); |
6273 |
} |
|
6274 |
||
6275 |
void Assembler::fistp_s(Address adr) { |
|
6276 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6277 |
emit_int8((unsigned char)0xDB); |
1066 | 6278 |
emit_operand32(rbx, adr); |
6279 |
} |
|
1 | 6280 |
|
6281 |
void Assembler::fld1() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6282 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6283 |
emit_int8((unsigned char)0xE8); |
1 | 6284 |
} |
6285 |
||
1066 | 6286 |
void Assembler::fld_d(Address adr) { |
6287 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6288 |
emit_int8((unsigned char)0xDD); |
1066 | 6289 |
emit_operand32(rax, adr); |
6290 |
} |
|
1 | 6291 |
|
6292 |
void Assembler::fld_s(Address adr) { |
|
6293 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6294 |
emit_int8((unsigned char)0xD9); |
1066 | 6295 |
emit_operand32(rax, adr); |
6296 |
} |
|
6297 |
||
6298 |
||
6299 |
void Assembler::fld_s(int index) { |
|
1 | 6300 |
emit_farith(0xD9, 0xC0, index); |
6301 |
} |
|
6302 |
||
6303 |
void Assembler::fld_x(Address adr) { |
|
6304 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6305 |
emit_int8((unsigned char)0xDB); |
1066 | 6306 |
emit_operand32(rbp, adr); |
6307 |
} |
|
6308 |
||
6309 |
void Assembler::fldcw(Address src) { |
|
6310 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6311 |
emit_int8((unsigned char)0xD9); |
1066 | 6312 |
emit_operand32(rbp, src); |
6313 |
} |
|
6314 |
||
6315 |
void Assembler::fldenv(Address src) { |
|
1 | 6316 |
InstructionMark im(this); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6317 |
emit_int8((unsigned char)0xD9); |
1066 | 6318 |
emit_operand32(rsp, src); |
6319 |
} |
|
6320 |
||
6321 |
void Assembler::fldlg2() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6322 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6323 |
emit_int8((unsigned char)0xEC); |
1066 | 6324 |
} |
1 | 6325 |
|
6326 |
void Assembler::fldln2() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6327 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6328 |
emit_int8((unsigned char)0xED); |
1 | 6329 |
} |
6330 |
||
1066 | 6331 |
void Assembler::fldz() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6332 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6333 |
emit_int8((unsigned char)0xEE); |
1066 | 6334 |
} |
1 | 6335 |
|
6336 |
void Assembler::flog() { |
|
6337 |
fldln2(); |
|
6338 |
fxch(); |
|
6339 |
fyl2x(); |
|
6340 |
} |
|
6341 |
||
6342 |
void Assembler::flog10() { |
|
6343 |
fldlg2(); |
|
6344 |
fxch(); |
|
6345 |
fyl2x(); |
|
6346 |
} |
|
6347 |
||
1066 | 6348 |
void Assembler::fmul(int i) { |
6349 |
emit_farith(0xD8, 0xC8, i); |
|
6350 |
} |
|
6351 |
||
6352 |
void Assembler::fmul_d(Address src) { |
|
6353 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6354 |
emit_int8((unsigned char)0xDC); |
1066 | 6355 |
emit_operand32(rcx, src); |
6356 |
} |
|
6357 |
||
6358 |
void Assembler::fmul_s(Address src) { |
|
6359 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6360 |
emit_int8((unsigned char)0xD8); |
1066 | 6361 |
emit_operand32(rcx, src); |
6362 |
} |
|
6363 |
||
6364 |
void Assembler::fmula(int i) { |
|
6365 |
emit_farith(0xDC, 0xC8, i); |
|
6366 |
} |
|
6367 |
||
6368 |
void Assembler::fmulp(int i) { |
|
6369 |
emit_farith(0xDE, 0xC8, i); |
|
6370 |
} |
|
6371 |
||
6372 |
void Assembler::fnsave(Address dst) { |
|
6373 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6374 |
emit_int8((unsigned char)0xDD); |
1066 | 6375 |
emit_operand32(rsi, dst); |
6376 |
} |
|
6377 |
||
6378 |
void Assembler::fnstcw(Address src) { |
|
6379 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6380 |
emit_int8((unsigned char)0x9B); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6381 |
emit_int8((unsigned char)0xD9); |
1066 | 6382 |
emit_operand32(rdi, src); |
6383 |
} |
|
6384 |
||
6385 |
void Assembler::fnstsw_ax() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6386 |
emit_int8((unsigned char)0xDF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6387 |
emit_int8((unsigned char)0xE0); |
1066 | 6388 |
} |
6389 |
||
6390 |
void Assembler::fprem() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6391 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6392 |
emit_int8((unsigned char)0xF8); |
1066 | 6393 |
} |
6394 |
||
6395 |
void Assembler::fprem1() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6396 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6397 |
emit_int8((unsigned char)0xF5); |
1066 | 6398 |
} |
6399 |
||
6400 |
void Assembler::frstor(Address src) { |
|
6401 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6402 |
emit_int8((unsigned char)0xDD); |
1066 | 6403 |
emit_operand32(rsp, src); |
6404 |
} |
|
1 | 6405 |
|
6406 |
void Assembler::fsin() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6407 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6408 |
emit_int8((unsigned char)0xFE); |
1 | 6409 |
} |
6410 |
||
1066 | 6411 |
void Assembler::fsqrt() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6412 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6413 |
emit_int8((unsigned char)0xFA); |
1066 | 6414 |
} |
6415 |
||
6416 |
void Assembler::fst_d(Address adr) { |
|
6417 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6418 |
emit_int8((unsigned char)0xDD); |
1066 | 6419 |
emit_operand32(rdx, adr); |
6420 |
} |
|
6421 |
||
6422 |
void Assembler::fst_s(Address adr) { |
|
6423 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6424 |
emit_int8((unsigned char)0xD9); |
1066 | 6425 |
emit_operand32(rdx, adr); |
6426 |
} |
|
6427 |
||
6428 |
void Assembler::fstp_d(Address adr) { |
|
6429 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6430 |
emit_int8((unsigned char)0xDD); |
1066 | 6431 |
emit_operand32(rbx, adr); |
6432 |
} |
|
6433 |
||
6434 |
void Assembler::fstp_d(int index) { |
|
6435 |
emit_farith(0xDD, 0xD8, index); |
|
6436 |
} |
|
6437 |
||
6438 |
void Assembler::fstp_s(Address adr) { |
|
6439 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6440 |
emit_int8((unsigned char)0xD9); |
1066 | 6441 |
emit_operand32(rbx, adr); |
6442 |
} |
|
6443 |
||
6444 |
void Assembler::fstp_x(Address adr) { |
|
6445 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6446 |
emit_int8((unsigned char)0xDB); |
1066 | 6447 |
emit_operand32(rdi, adr); |
6448 |
} |
|
6449 |
||
6450 |
void Assembler::fsub(int i) { |
|
6451 |
emit_farith(0xD8, 0xE0, i); |
|
6452 |
} |
|
6453 |
||
6454 |
void Assembler::fsub_d(Address src) { |
|
6455 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6456 |
emit_int8((unsigned char)0xDC); |
1066 | 6457 |
emit_operand32(rsp, src); |
6458 |
} |
|
6459 |
||
6460 |
void Assembler::fsub_s(Address src) { |
|
6461 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6462 |
emit_int8((unsigned char)0xD8); |
1066 | 6463 |
emit_operand32(rsp, src); |
6464 |
} |
|
6465 |
||
6466 |
void Assembler::fsuba(int i) { |
|
6467 |
emit_farith(0xDC, 0xE8, i); |
|
6468 |
} |
|
6469 |
||
6470 |
void Assembler::fsubp(int i) { |
|
6471 |
emit_farith(0xDE, 0xE8, i); // ST(0) <- ST(0) - ST(1) and pop (Intel manual wrong) |
|
6472 |
} |
|
6473 |
||
6474 |
void Assembler::fsubr(int i) { |
|
6475 |
emit_farith(0xD8, 0xE8, i); |
|
6476 |
} |
|
6477 |
||
6478 |
void Assembler::fsubr_d(Address src) { |
|
6479 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6480 |
emit_int8((unsigned char)0xDC); |
1066 | 6481 |
emit_operand32(rbp, src); |
6482 |
} |
|
6483 |
||
6484 |
void Assembler::fsubr_s(Address src) { |
|
6485 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6486 |
emit_int8((unsigned char)0xD8); |
1066 | 6487 |
emit_operand32(rbp, src); |
6488 |
} |
|
6489 |
||
6490 |
void Assembler::fsubra(int i) { |
|
6491 |
emit_farith(0xDC, 0xE0, i); |
|
6492 |
} |
|
6493 |
||
6494 |
void Assembler::fsubrp(int i) { |
|
6495 |
emit_farith(0xDE, 0xE0, i); // ST(0) <- ST(1) - ST(0) and pop (Intel manual wrong) |
|
1 | 6496 |
} |
6497 |
||
6498 |
void Assembler::ftan() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6499 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6500 |
emit_int8((unsigned char)0xF2); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6501 |
emit_int8((unsigned char)0xDD); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6502 |
emit_int8((unsigned char)0xD8); |
1 | 6503 |
} |
6504 |
||
1066 | 6505 |
void Assembler::ftst() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6506 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6507 |
emit_int8((unsigned char)0xE4); |
1066 | 6508 |
} |
1 | 6509 |
|
6510 |
void Assembler::fucomi(int i) { |
|
6511 |
// make sure the instruction is supported (introduced for P6, together with cmov) |
|
6512 |
guarantee(VM_Version::supports_cmov(), "illegal instruction"); |
|
6513 |
emit_farith(0xDB, 0xE8, i); |
|
6514 |
} |
|
6515 |
||
6516 |
void Assembler::fucomip(int i) { |
|
6517 |
// make sure the instruction is supported (introduced for P6, together with cmov) |
|
6518 |
guarantee(VM_Version::supports_cmov(), "illegal instruction"); |
|
6519 |
emit_farith(0xDF, 0xE8, i); |
|
6520 |
} |
|
6521 |
||
6522 |
void Assembler::fwait() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6523 |
emit_int8((unsigned char)0x9B); |
1 | 6524 |
} |
6525 |
||
1066 | 6526 |
void Assembler::fxch(int i) { |
6527 |
emit_farith(0xD9, 0xC8, i); |
|
6528 |
} |
|
6529 |
||
6530 |
void Assembler::fyl2x() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6531 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6532 |
emit_int8((unsigned char)0xF1); |
1066 | 6533 |
} |
6534 |
||
12739
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
6535 |
void Assembler::frndint() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6536 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6537 |
emit_int8((unsigned char)0xFC); |
12739
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
6538 |
} |
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
6539 |
|
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
6540 |
void Assembler::f2xm1() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6541 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6542 |
emit_int8((unsigned char)0xF0); |
12739
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
6543 |
} |
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
6544 |
|
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
6545 |
void Assembler::fldl2e() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6546 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6547 |
emit_int8((unsigned char)0xEA); |
12739
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
6548 |
} |
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
6549 |
|
11427 | 6550 |
// SSE SIMD prefix byte values corresponding to VexSimdPrefix encoding. |
6551 |
static int simd_pre[4] = { 0, 0x66, 0xF3, 0xF2 }; |
|
6552 |
// SSE opcode second byte values (first is 0x0F) corresponding to VexOpcode encoding. |
|
6553 |
static int simd_opc[4] = { 0, 0, 0x38, 0x3A }; |
|
6554 |
||
6555 |
// Generate SSE legacy REX prefix and SIMD opcode based on VEX encoding. |
|
6556 |
void Assembler::rex_prefix(Address adr, XMMRegister xreg, VexSimdPrefix pre, VexOpcode opc, bool rex_w) { |
|
6557 |
if (pre > 0) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6558 |
emit_int8(simd_pre[pre]); |
11427 | 6559 |
} |
6560 |
if (rex_w) { |
|
6561 |
prefixq(adr, xreg); |
|
6562 |
} else { |
|
6563 |
prefix(adr, xreg); |
|
6564 |
} |
|
6565 |
if (opc > 0) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6566 |
emit_int8(0x0F); |
11427 | 6567 |
int opc2 = simd_opc[opc]; |
6568 |
if (opc2 > 0) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6569 |
emit_int8(opc2); |
11427 | 6570 |
} |
6571 |
} |
|
6572 |
} |
|
6573 |
||
6574 |
int Assembler::rex_prefix_and_encode(int dst_enc, int src_enc, VexSimdPrefix pre, VexOpcode opc, bool rex_w) { |
|
6575 |
if (pre > 0) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6576 |
emit_int8(simd_pre[pre]); |
11427 | 6577 |
} |
34162 | 6578 |
int encode = (rex_w) ? prefixq_and_encode(dst_enc, src_enc) : prefix_and_encode(dst_enc, src_enc); |
11427 | 6579 |
if (opc > 0) { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6580 |
emit_int8(0x0F); |
11427 | 6581 |
int opc2 = simd_opc[opc]; |
6582 |
if (opc2 > 0) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6583 |
emit_int8(opc2); |
11427 | 6584 |
} |
6585 |
} |
|
6586 |
return encode; |
|
6587 |
} |
|
6588 |
||
6589 |
||
34162 | 6590 |
void Assembler::vex_prefix(bool vex_r, bool vex_b, bool vex_x, int nds_enc, VexSimdPrefix pre, VexOpcode opc) { |
6591 |
int vector_len = _attributes->get_vector_len(); |
|
6592 |
bool vex_w = _attributes->is_rex_vex_w(); |
|
11427 | 6593 |
if (vex_b || vex_x || vex_w || (opc == VEX_OPCODE_0F_38) || (opc == VEX_OPCODE_0F_3A)) { |
6594 |
prefix(VEX_3bytes); |
|
6595 |
||
6596 |
int byte1 = (vex_r ? VEX_R : 0) | (vex_x ? VEX_X : 0) | (vex_b ? VEX_B : 0); |
|
6597 |
byte1 = (~byte1) & 0xE0; |
|
6598 |
byte1 |= opc; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6599 |
emit_int8(byte1); |
11427 | 6600 |
|
6601 |
int byte2 = ((~nds_enc) & 0xf) << 3; |
|
30624 | 6602 |
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
|
6603 |
emit_int8(byte2); |
11427 | 6604 |
} else { |
6605 |
prefix(VEX_2bytes); |
|
6606 |
||
6607 |
int byte1 = vex_r ? VEX_R : 0; |
|
6608 |
byte1 = (~byte1) & 0x80; |
|
6609 |
byte1 |= ((~nds_enc) & 0xf) << 3; |
|
30624 | 6610 |
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
|
6611 |
emit_int8(byte1); |
11427 | 6612 |
} |
6613 |
} |
|
6614 |
||
30624 | 6615 |
// This is a 4 byte encoding |
34162 | 6616 |
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 | 6617 |
// EVEX 0x62 prefix |
6618 |
prefix(EVEX_4bytes); |
|
34162 | 6619 |
bool vex_w = _attributes->is_rex_vex_w(); |
6620 |
int evex_encoding = (vex_w ? VEX_W : 0); |
|
6621 |
// EVEX.b is not currently used for broadcast of single element or data rounding modes |
|
6622 |
_attributes->set_evex_encoding(evex_encoding); |
|
30624 | 6623 |
|
6624 |
// P0: byte 2, initialized to RXBR`00mm |
|
6625 |
// instead of not'd |
|
6626 |
int byte2 = (vex_r ? VEX_R : 0) | (vex_x ? VEX_X : 0) | (vex_b ? VEX_B : 0) | (evex_r ? EVEX_Rb : 0); |
|
6627 |
byte2 = (~byte2) & 0xF0; |
|
6628 |
// confine opc opcode extensions in mm bits to lower two bits |
|
6629 |
// of form {0F, 0F_38, 0F_3A} |
|
6630 |
byte2 |= opc; |
|
6631 |
emit_int8(byte2); |
|
6632 |
||
6633 |
// P1: byte 3 as Wvvvv1pp |
|
6634 |
int byte3 = ((~nds_enc) & 0xf) << 3; |
|
6635 |
// p[10] is always 1 |
|
6636 |
byte3 |= EVEX_F; |
|
6637 |
byte3 |= (vex_w & 1) << 7; |
|
6638 |
// confine pre opcode extensions in pp bits to lower two bits |
|
6639 |
// of form {66, F3, F2} |
|
6640 |
byte3 |= pre; |
|
6641 |
emit_int8(byte3); |
|
6642 |
||
6643 |
// P2: byte 4 as zL'Lbv'aaa |
|
34162 | 6644 |
int byte4 = (_attributes->is_no_reg_mask()) ? 0 : 1; // kregs are implemented in the low 3 bits as aaa (hard code k1, it will be initialized for now) |
30624 | 6645 |
// EVEX.v` for extending EVEX.vvvv or VIDX |
6646 |
byte4 |= (evex_v ? 0: EVEX_V); |
|
6647 |
// third EXEC.b for broadcast actions |
|
34162 | 6648 |
byte4 |= (_attributes->is_extended_context() ? EVEX_Rb : 0); |
30624 | 6649 |
// fourth EVEX.L'L for vector length : 0 is 128, 1 is 256, 2 is 512, currently we do not support 1024 |
34162 | 6650 |
byte4 |= ((_attributes->get_vector_len())& 0x3) << 5; |
30624 | 6651 |
// last is EVEX.z for zero/merge actions |
34162 | 6652 |
byte4 |= (_attributes->is_clear_context() ? EVEX_Z : 0); |
30624 | 6653 |
emit_int8(byte4); |
6654 |
} |
|
6655 |
||
34162 | 6656 |
void Assembler::vex_prefix(Address adr, int nds_enc, int xreg_enc, VexSimdPrefix pre, VexOpcode opc, InstructionAttr *attributes) { |
31410 | 6657 |
bool vex_r = ((xreg_enc & 8) == 8) ? 1 : 0; |
11427 | 6658 |
bool vex_b = adr.base_needs_rex(); |
6659 |
bool vex_x = adr.index_needs_rex(); |
|
34162 | 6660 |
set_attributes(attributes); |
6661 |
attributes->set_current_assembler(this); |
|
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6662 |
|
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6663 |
// if vector length is turned off, revert to AVX for vectors smaller than 512-bit |
34162 | 6664 |
if ((UseAVX > 2) && _legacy_mode_vl && attributes->uses_vl()) { |
6665 |
switch (attributes->get_vector_len()) { |
|
30624 | 6666 |
case AVX_128bit: |
6667 |
case AVX_256bit: |
|
34162 | 6668 |
attributes->set_is_legacy_mode(); |
30624 | 6669 |
break; |
6670 |
} |
|
6671 |
} |
|
6672 |
||
34162 | 6673 |
if ((UseAVX > 2) && !attributes->is_legacy_mode()) |
30624 | 6674 |
{ |
6675 |
bool evex_r = (xreg_enc >= 16); |
|
6676 |
bool evex_v = (nds_enc >= 16); |
|
34162 | 6677 |
attributes->set_is_evex_instruction(); |
6678 |
evex_prefix(vex_r, vex_b, vex_x, evex_r, evex_v, nds_enc, pre, opc); |
|
30624 | 6679 |
} else { |
34162 | 6680 |
vex_prefix(vex_r, vex_b, vex_x, nds_enc, pre, opc); |
30624 | 6681 |
} |
34162 | 6682 |
} |
6683 |
||
6684 |
int Assembler::vex_prefix_and_encode(int dst_enc, int nds_enc, int src_enc, VexSimdPrefix pre, VexOpcode opc, InstructionAttr *attributes) { |
|
31410 | 6685 |
bool vex_r = ((dst_enc & 8) == 8) ? 1 : 0; |
6686 |
bool vex_b = ((src_enc & 8) == 8) ? 1 : 0; |
|
11427 | 6687 |
bool vex_x = false; |
34162 | 6688 |
set_attributes(attributes); |
6689 |
attributes->set_current_assembler(this); |
|
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6690 |
|
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
6691 |
// if vector length is turned off, revert to AVX for vectors smaller than 512-bit |
34162 | 6692 |
if ((UseAVX > 2) && _legacy_mode_vl && attributes->uses_vl()) { |
6693 |
switch (attributes->get_vector_len()) { |
|
30624 | 6694 |
case AVX_128bit: |
6695 |
case AVX_256bit: |
|
34162 | 6696 |
if ((dst_enc >= 16) | (nds_enc >= 16) | (src_enc >= 16)) { |
6697 |
// up propagate arithmetic instructions to meet RA requirements |
|
6698 |
attributes->set_vector_len(AVX_512bit); |
|
6699 |
} else { |
|
6700 |
attributes->set_is_legacy_mode(); |
|
6701 |
} |
|
30624 | 6702 |
break; |
6703 |
} |
|
6704 |
} |
|
6705 |
||
34162 | 6706 |
if ((UseAVX > 2) && !attributes->is_legacy_mode()) |
30624 | 6707 |
{ |
6708 |
bool evex_r = (dst_enc >= 16); |
|
6709 |
bool evex_v = (nds_enc >= 16); |
|
6710 |
// can use vex_x as bank extender on rm encoding |
|
6711 |
vex_x = (src_enc >= 16); |
|
34162 | 6712 |
attributes->set_is_evex_instruction(); |
6713 |
evex_prefix(vex_r, vex_b, vex_x, evex_r, evex_v, nds_enc, pre, opc); |
|
30624 | 6714 |
} else { |
34162 | 6715 |
vex_prefix(vex_r, vex_b, vex_x, nds_enc, pre, opc); |
30624 | 6716 |
} |
6717 |
||
6718 |
// return modrm byte components for operands |
|
11427 | 6719 |
return (((dst_enc & 7) << 3) | (src_enc & 7)); |
6720 |
} |
|
6721 |
||
6722 |
||
30624 | 6723 |
void Assembler::simd_prefix(XMMRegister xreg, XMMRegister nds, Address adr, VexSimdPrefix pre, |
34162 | 6724 |
VexOpcode opc, InstructionAttr *attributes) { |
11427 | 6725 |
if (UseAVX > 0) { |
6726 |
int xreg_enc = xreg->encoding(); |
|
34162 | 6727 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
6728 |
vex_prefix(adr, nds_enc, xreg_enc, pre, opc, attributes); |
|
11427 | 6729 |
} else { |
6730 |
assert((nds == xreg) || (nds == xnoreg), "wrong sse encoding"); |
|
34162 | 6731 |
rex_prefix(adr, xreg, pre, opc, attributes->is_rex_vex_w()); |
11427 | 6732 |
} |
6733 |
} |
|
6734 |
||
30624 | 6735 |
int Assembler::simd_prefix_and_encode(XMMRegister dst, XMMRegister nds, XMMRegister src, VexSimdPrefix pre, |
34162 | 6736 |
VexOpcode opc, InstructionAttr *attributes) { |
11427 | 6737 |
int dst_enc = dst->encoding(); |
6738 |
int src_enc = src->encoding(); |
|
6739 |
if (UseAVX > 0) { |
|
6740 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
34162 | 6741 |
return vex_prefix_and_encode(dst_enc, nds_enc, src_enc, pre, opc, attributes); |
11427 | 6742 |
} else { |
6743 |
assert((nds == dst) || (nds == src) || (nds == xnoreg), "wrong sse encoding"); |
|
34162 | 6744 |
return rex_prefix_and_encode(dst_enc, src_enc, pre, opc, attributes->is_rex_vex_w()); |
11427 | 6745 |
} |
6746 |
} |
|
1066 | 6747 |
|
33469
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
6748 |
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
|
6749 |
assert(VM_Version::supports_avx(), ""); |
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
6750 |
assert(!VM_Version::supports_evex(), ""); |
34162 | 6751 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
6752 |
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
|
6753 |
emit_int8((unsigned char)0xC2); |
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
6754 |
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
|
6755 |
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
|
6756 |
} |
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
6757 |
|
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
6758 |
void Assembler::vpblendd(XMMRegister dst, XMMRegister nds, XMMRegister src1, XMMRegister src2, int vector_len) { |
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
6759 |
assert(VM_Version::supports_avx(), ""); |
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
6760 |
assert(!VM_Version::supports_evex(), ""); |
34162 | 6761 |
InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
6762 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
6763 |
int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, 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
|
6764 |
emit_int8((unsigned char)0x4B); |
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
6765 |
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
|
6766 |
int src2_enc = src2->encoding(); |
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
6767 |
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
|
6768 |
} |
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
6769 |
|
30f4811eded0
8139340: SuperWord enhancement to support vector conditional move (CMovVD) on Intel AVX cpu
iveresov
parents:
33465
diff
changeset
|
6770 |
|
1066 | 6771 |
#ifndef _LP64 |
6772 |
||
6773 |
void Assembler::incl(Register dst) { |
|
6774 |
// 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
|
6775 |
emit_int8(0x40 | dst->encoding()); |
1066 | 6776 |
} |
6777 |
||
6778 |
void Assembler::lea(Register dst, Address src) { |
|
6779 |
leal(dst, src); |
|
6780 |
} |
|
6781 |
||
34162 | 6782 |
void Assembler::mov_literal32(Address dst, int32_t imm32, RelocationHolder const& rspec) { |
1066 | 6783 |
InstructionMark im(this); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6784 |
emit_int8((unsigned char)0xC7); |
1066 | 6785 |
emit_operand(rax, dst); |
6786 |
emit_data((int)imm32, rspec, 0); |
|
6787 |
} |
|
6788 |
||
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
6789 |
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
|
6790 |
InstructionMark im(this); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
6791 |
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
|
6792 |
emit_int8((unsigned char)(0xB8 | encode)); |
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
6793 |
emit_data((int)imm32, rspec, 0); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
6794 |
} |
1066 | 6795 |
|
6796 |
void Assembler::popa() { // 32bit |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6797 |
emit_int8(0x61); |
1066 | 6798 |
} |
6799 |
||
6800 |
void Assembler::push_literal32(int32_t imm32, RelocationHolder const& rspec) { |
|
6801 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6802 |
emit_int8(0x68); |
1066 | 6803 |
emit_data(imm32, rspec, 0); |
6804 |
} |
|
6805 |
||
6806 |
void Assembler::pusha() { // 32bit |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6807 |
emit_int8(0x60); |
1066 | 6808 |
} |
6809 |
||
6810 |
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
|
6811 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6812 |
emit_int8((unsigned char)0x95); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6813 |
emit_int8((unsigned char)(0xE0 | dst->encoding())); |
1066 | 6814 |
} |
6815 |
||
6816 |
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
|
6817 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6818 |
emit_int8((unsigned char)0xA5); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6819 |
emit_int8((unsigned char)(0xC0 | src->encoding() << 3 | dst->encoding())); |
1066 | 6820 |
} |
6821 |
||
33066 | 6822 |
// 0F A4 / r ib |
6823 |
void Assembler::shldl(Register dst, Register src, int8_t imm8) { |
|
6824 |
emit_int8(0x0F); |
|
6825 |
emit_int8((unsigned char)0xA4); |
|
6826 |
emit_int8((unsigned char)(0xC0 | src->encoding() << 3 | dst->encoding())); |
|
6827 |
emit_int8(imm8); |
|
6828 |
} |
|
6829 |
||
1066 | 6830 |
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
|
6831 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6832 |
emit_int8((unsigned char)0xAD); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6833 |
emit_int8((unsigned char)(0xC0 | src->encoding() << 3 | dst->encoding())); |
1066 | 6834 |
} |
6835 |
||
6836 |
#else // LP64 |
|
6837 |
||
5253 | 6838 |
void Assembler::set_byte_if_not_zero(Register dst) { |
6839 |
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
|
6840 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6841 |
emit_int8((unsigned char)0x95); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
6842 |
emit_int8((unsigned char)(0xE0 | enc)); |
5253 | 6843 |
} |
6844 |
||
1066 | 6845 |
// 64bit only pieces of the assembler |
6846 |
// This should only be used by 64bit instructions that can use rip-relative |
|
6847 |
// it cannot be used by instructions that want an immediate value. |
|
6848 |
||
6849 |
bool Assembler::reachable(AddressLiteral adr) { |
|
6850 |
int64_t disp; |
|
6851 |
// None will force a 64bit literal to the code stream. Likely a placeholder |
|
6852 |
// for something that will be patched later and we need to certain it will |
|
6853 |
// always be reachable. |
|
6854 |
if (adr.reloc() == relocInfo::none) { |
|
6855 |
return false; |
|
6856 |
} |
|
6857 |
if (adr.reloc() == relocInfo::internal_word_type) { |
|
6858 |
// This should be rip relative and easily reachable. |
|
6859 |
return true; |
|
6860 |
} |
|
6861 |
if (adr.reloc() == relocInfo::virtual_call_type || |
|
6862 |
adr.reloc() == relocInfo::opt_virtual_call_type || |
|
6863 |
adr.reloc() == relocInfo::static_call_type || |
|
6864 |
adr.reloc() == relocInfo::static_stub_type ) { |
|
6865 |
// This should be rip relative within the code cache and easily |
|
6866 |
// reachable until we get huge code caches. (At which point |
|
6867 |
// ic code is going to have issues). |
|
6868 |
return true; |
|
6869 |
} |
|
6870 |
if (adr.reloc() != relocInfo::external_word_type && |
|
6871 |
adr.reloc() != relocInfo::poll_return_type && // these are really external_word but need special |
|
6872 |
adr.reloc() != relocInfo::poll_type && // relocs to identify them |
|
6873 |
adr.reloc() != relocInfo::runtime_call_type ) { |
|
6874 |
return false; |
|
6875 |
} |
|
6876 |
||
6877 |
// Stress the correction code |
|
6878 |
if (ForceUnreachable) { |
|
6879 |
// Must be runtimecall reloc, see if it is in the codecache |
|
6880 |
// Flipping stuff in the codecache to be unreachable causes issues |
|
6881 |
// with things like inline caches where the additional instructions |
|
6882 |
// are not handled. |
|
6883 |
if (CodeCache::find_blob(adr._target) == NULL) { |
|
6884 |
return false; |
|
6885 |
} |
|
6886 |
} |
|
6887 |
// For external_word_type/runtime_call_type if it is reachable from where we |
|
6888 |
// are now (possibly a temp buffer) and where we might end up |
|
6889 |
// anywhere in the codeCache then we are always reachable. |
|
6890 |
// This would have to change if we ever save/restore shared code |
|
6891 |
// to be more pessimistic. |
|
6892 |
disp = (int64_t)adr._target - ((int64_t)CodeCache::low_bound() + sizeof(int)); |
|
6893 |
if (!is_simm32(disp)) return false; |
|
6894 |
disp = (int64_t)adr._target - ((int64_t)CodeCache::high_bound() + sizeof(int)); |
|
6895 |
if (!is_simm32(disp)) return false; |
|
6896 |
||
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
6897 |
disp = (int64_t)adr._target - ((int64_t)pc() + sizeof(int)); |
1066 | 6898 |
|
6899 |
// Because rip relative is a disp + address_of_next_instruction and we |
|
6900 |
// don't know the value of address_of_next_instruction we apply a fudge factor |
|
6901 |
// to make sure we will be ok no matter the size of the instruction we get placed into. |
|
6902 |
// We don't have to fudge the checks above here because they are already worst case. |
|
6903 |
||
6904 |
// 12 == override/rex byte, opcode byte, rm byte, sib byte, a 4-byte disp , 4-byte literal |
|
6905 |
// + 4 because better safe than sorry. |
|
6906 |
const int fudge = 12 + 4; |
|
6907 |
if (disp < 0) { |
|
6908 |
disp -= fudge; |
|
6909 |
} else { |
|
6910 |
disp += fudge; |
|
6911 |
} |
|
6912 |
return is_simm32(disp); |
|
6913 |
} |
|
6914 |
||
8871
5c3b26c4119e
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
8676
diff
changeset
|
6915 |
// 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
|
6916 |
// addressing. |
5c3b26c4119e
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
8676
diff
changeset
|
6917 |
bool Assembler::is_polling_page_far() { |
5c3b26c4119e
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
8676
diff
changeset
|
6918 |
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
|
6919 |
return ForceUnreachable || |
ee1235a09fc3
7110489: C1: 64-bit tiered with ForceUnreachable: assert(reachable(src)) failed: Address should be reachable
never
parents:
10546
diff
changeset
|
6920 |
!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
|
6921 |
!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
|
6922 |
} |
5c3b26c4119e
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
8676
diff
changeset
|
6923 |
|
1066 | 6924 |
void Assembler::emit_data64(jlong data, |
6925 |
relocInfo::relocType rtype, |
|
6926 |
int format) { |
|
6927 |
if (rtype == relocInfo::none) { |
|
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
6928 |
emit_int64(data); |
1066 | 6929 |
} else { |
6930 |
emit_data64(data, Relocation::spec_simple(rtype), format); |
|
6931 |
} |
|
6932 |
} |
|
6933 |
||
6934 |
void Assembler::emit_data64(jlong data, |
|
6935 |
RelocationHolder const& rspec, |
|
6936 |
int format) { |
|
6937 |
assert(imm_operand == 0, "default format must be immediate in this file"); |
|
6938 |
assert(imm_operand == format, "must be immediate"); |
|
6939 |
assert(inst_mark() != NULL, "must be inside InstructionMark"); |
|
6940 |
// Do not use AbstractAssembler::relocate, which is not intended for |
|
6941 |
// embedded words. Instead, relocate to the enclosing instruction. |
|
6942 |
code_section()->relocate(inst_mark(), rspec, format); |
|
6943 |
#ifdef ASSERT |
|
6944 |
check_relocation(rspec, format); |
|
6945 |
#endif |
|
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
6946 |
emit_int64(data); |
1066 | 6947 |
} |
6948 |
||
6949 |
int Assembler::prefix_and_encode(int reg_enc, bool byteinst) { |
|
6950 |
if (reg_enc >= 8) { |
|
6951 |
prefix(REX_B); |
|
6952 |
reg_enc -= 8; |
|
6953 |
} else if (byteinst && reg_enc >= 4) { |
|
6954 |
prefix(REX); |
|
6955 |
} |
|
6956 |
return reg_enc; |
|
6957 |
} |
|
6958 |
||
6959 |
int Assembler::prefixq_and_encode(int reg_enc) { |
|
6960 |
if (reg_enc < 8) { |
|
6961 |
prefix(REX_W); |
|
6962 |
} else { |
|
6963 |
prefix(REX_WB); |
|
6964 |
reg_enc -= 8; |
|
6965 |
} |
|
6966 |
return reg_enc; |
|
6967 |
} |
|
6968 |
||
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
6969 |
int Assembler::prefix_and_encode(int dst_enc, bool dst_is_byte, int src_enc, bool src_is_byte) { |
1066 | 6970 |
if (dst_enc < 8) { |
6971 |
if (src_enc >= 8) { |
|
6972 |
prefix(REX_B); |
|
6973 |
src_enc -= 8; |
|
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
33089
diff
changeset
|
6974 |
} else if ((src_is_byte && src_enc >= 4) || (dst_is_byte && dst_enc >= 4)) { |
1066 | 6975 |
prefix(REX); |
6976 |
} |
|
6977 |
} else { |
|
6978 |
if (src_enc < 8) { |
|
6979 |
prefix(REX_R); |
|
6980 |
} else { |
|
6981 |
prefix(REX_RB); |
|
6982 |
src_enc -= 8; |
|
6983 |
} |
|
6984 |
dst_enc -= 8; |
|
6985 |
} |
|
6986 |
return dst_enc << 3 | src_enc; |
|
6987 |
} |
|
6988 |
||
6989 |
int Assembler::prefixq_and_encode(int dst_enc, int src_enc) { |
|
6990 |
if (dst_enc < 8) { |
|
6991 |
if (src_enc < 8) { |
|
6992 |
prefix(REX_W); |
|
6993 |
} else { |
|
6994 |
prefix(REX_WB); |
|
6995 |
src_enc -= 8; |
|
6996 |
} |
|
6997 |
} else { |
|
6998 |
if (src_enc < 8) { |
|
6999 |
prefix(REX_WR); |
|
7000 |
} else { |
|
7001 |
prefix(REX_WRB); |
|
7002 |
src_enc -= 8; |
|
7003 |
} |
|
7004 |
dst_enc -= 8; |
|
7005 |
} |
|
7006 |
return dst_enc << 3 | src_enc; |
|
7007 |
} |
|
7008 |
||
7009 |
void Assembler::prefix(Register reg) { |
|
7010 |
if (reg->encoding() >= 8) { |
|
7011 |
prefix(REX_B); |
|
7012 |
} |
|
7013 |
} |
|
7014 |
||
33066 | 7015 |
void Assembler::prefix(Register dst, Register src, Prefix p) { |
7016 |
if (src->encoding() >= 8) { |
|
7017 |
p = (Prefix)(p | REX_B); |
|
7018 |
} |
|
7019 |
if (dst->encoding() >= 8) { |
|
7020 |
p = (Prefix)( p | REX_R); |
|
7021 |
} |
|
7022 |
if (p != Prefix_EMPTY) { |
|
7023 |
// do not generate an empty prefix |
|
7024 |
prefix(p); |
|
7025 |
} |
|
7026 |
} |
|
7027 |
||
7028 |
void Assembler::prefix(Register dst, Address adr, Prefix p) { |
|
7029 |
if (adr.base_needs_rex()) { |
|
7030 |
if (adr.index_needs_rex()) { |
|
7031 |
assert(false, "prefix(Register dst, Address adr, Prefix p) does not support handling of an X"); |
|
7032 |
} else { |
|
7033 |
prefix(REX_B); |
|
7034 |
} |
|
7035 |
} else { |
|
7036 |
if (adr.index_needs_rex()) { |
|
7037 |
assert(false, "prefix(Register dst, Address adr, Prefix p) does not support handling of an X"); |
|
7038 |
} |
|
7039 |
} |
|
7040 |
if (dst->encoding() >= 8) { |
|
7041 |
p = (Prefix)(p | REX_R); |
|
7042 |
} |
|
7043 |
if (p != Prefix_EMPTY) { |
|
7044 |
// do not generate an empty prefix |
|
7045 |
prefix(p); |
|
7046 |
} |
|
7047 |
} |
|
7048 |
||
1066 | 7049 |
void Assembler::prefix(Address adr) { |
7050 |
if (adr.base_needs_rex()) { |
|
7051 |
if (adr.index_needs_rex()) { |
|
7052 |
prefix(REX_XB); |
|
7053 |
} else { |
|
7054 |
prefix(REX_B); |
|
7055 |
} |
|
7056 |
} else { |
|
7057 |
if (adr.index_needs_rex()) { |
|
7058 |
prefix(REX_X); |
|
7059 |
} |
|
7060 |
} |
|
7061 |
} |
|
7062 |
||
7063 |
void Assembler::prefixq(Address adr) { |
|
7064 |
if (adr.base_needs_rex()) { |
|
7065 |
if (adr.index_needs_rex()) { |
|
7066 |
prefix(REX_WXB); |
|
7067 |
} else { |
|
7068 |
prefix(REX_WB); |
|
7069 |
} |
|
7070 |
} else { |
|
7071 |
if (adr.index_needs_rex()) { |
|
7072 |
prefix(REX_WX); |
|
7073 |
} else { |
|
7074 |
prefix(REX_W); |
|
7075 |
} |
|
7076 |
} |
|
7077 |
} |
|
7078 |
||
7079 |
||
7080 |
void Assembler::prefix(Address adr, Register reg, bool byteinst) { |
|
7081 |
if (reg->encoding() < 8) { |
|
7082 |
if (adr.base_needs_rex()) { |
|
7083 |
if (adr.index_needs_rex()) { |
|
7084 |
prefix(REX_XB); |
|
7085 |
} else { |
|
7086 |
prefix(REX_B); |
|
7087 |
} |
|
7088 |
} else { |
|
7089 |
if (adr.index_needs_rex()) { |
|
7090 |
prefix(REX_X); |
|
10268 | 7091 |
} else if (byteinst && reg->encoding() >= 4 ) { |
1066 | 7092 |
prefix(REX); |
7093 |
} |
|
7094 |
} |
|
7095 |
} else { |
|
7096 |
if (adr.base_needs_rex()) { |
|
7097 |
if (adr.index_needs_rex()) { |
|
7098 |
prefix(REX_RXB); |
|
7099 |
} else { |
|
7100 |
prefix(REX_RB); |
|
7101 |
} |
|
7102 |
} else { |
|
7103 |
if (adr.index_needs_rex()) { |
|
7104 |
prefix(REX_RX); |
|
7105 |
} else { |
|
7106 |
prefix(REX_R); |
|
7107 |
} |
|
7108 |
} |
|
7109 |
} |
|
7110 |
} |
|
7111 |
||
7112 |
void Assembler::prefixq(Address adr, Register src) { |
|
7113 |
if (src->encoding() < 8) { |
|
7114 |
if (adr.base_needs_rex()) { |
|
7115 |
if (adr.index_needs_rex()) { |
|
7116 |
prefix(REX_WXB); |
|
7117 |
} else { |
|
7118 |
prefix(REX_WB); |
|
7119 |
} |
|
7120 |
} else { |
|
7121 |
if (adr.index_needs_rex()) { |
|
7122 |
prefix(REX_WX); |
|
7123 |
} else { |
|
7124 |
prefix(REX_W); |
|
7125 |
} |
|
7126 |
} |
|
7127 |
} else { |
|
7128 |
if (adr.base_needs_rex()) { |
|
7129 |
if (adr.index_needs_rex()) { |
|
7130 |
prefix(REX_WRXB); |
|
7131 |
} else { |
|
7132 |
prefix(REX_WRB); |
|
7133 |
} |
|
7134 |
} else { |
|
7135 |
if (adr.index_needs_rex()) { |
|
7136 |
prefix(REX_WRX); |
|
7137 |
} else { |
|
7138 |
prefix(REX_WR); |
|
7139 |
} |
|
7140 |
} |
|
7141 |
} |
|
7142 |
} |
|
7143 |
||
7144 |
void Assembler::prefix(Address adr, XMMRegister reg) { |
|
7145 |
if (reg->encoding() < 8) { |
|
7146 |
if (adr.base_needs_rex()) { |
|
7147 |
if (adr.index_needs_rex()) { |
|
7148 |
prefix(REX_XB); |
|
7149 |
} else { |
|
7150 |
prefix(REX_B); |
|
7151 |
} |
|
7152 |
} else { |
|
7153 |
if (adr.index_needs_rex()) { |
|
7154 |
prefix(REX_X); |
|
7155 |
} |
|
7156 |
} |
|
7157 |
} else { |
|
7158 |
if (adr.base_needs_rex()) { |
|
7159 |
if (adr.index_needs_rex()) { |
|
7160 |
prefix(REX_RXB); |
|
7161 |
} else { |
|
7162 |
prefix(REX_RB); |
|
7163 |
} |
|
7164 |
} else { |
|
7165 |
if (adr.index_needs_rex()) { |
|
7166 |
prefix(REX_RX); |
|
7167 |
} else { |
|
7168 |
prefix(REX_R); |
|
7169 |
} |
|
7170 |
} |
|
7171 |
} |
|
7172 |
} |
|
7173 |
||
11427 | 7174 |
void Assembler::prefixq(Address adr, XMMRegister src) { |
7175 |
if (src->encoding() < 8) { |
|
7176 |
if (adr.base_needs_rex()) { |
|
7177 |
if (adr.index_needs_rex()) { |
|
7178 |
prefix(REX_WXB); |
|
7179 |
} else { |
|
7180 |
prefix(REX_WB); |
|
7181 |
} |
|
7182 |
} else { |
|
7183 |
if (adr.index_needs_rex()) { |
|
7184 |
prefix(REX_WX); |
|
7185 |
} else { |
|
7186 |
prefix(REX_W); |
|
7187 |
} |
|
7188 |
} |
|
7189 |
} else { |
|
7190 |
if (adr.base_needs_rex()) { |
|
7191 |
if (adr.index_needs_rex()) { |
|
7192 |
prefix(REX_WRXB); |
|
7193 |
} else { |
|
7194 |
prefix(REX_WRB); |
|
7195 |
} |
|
7196 |
} else { |
|
7197 |
if (adr.index_needs_rex()) { |
|
7198 |
prefix(REX_WRX); |
|
7199 |
} else { |
|
7200 |
prefix(REX_WR); |
|
7201 |
} |
|
7202 |
} |
|
7203 |
} |
|
7204 |
} |
|
7205 |
||
1066 | 7206 |
void Assembler::adcq(Register dst, int32_t imm32) { |
7207 |
(void) prefixq_and_encode(dst->encoding()); |
|
7208 |
emit_arith(0x81, 0xD0, dst, imm32); |
|
7209 |
} |
|
7210 |
||
7211 |
void Assembler::adcq(Register dst, Address src) { |
|
7212 |
InstructionMark im(this); |
|
7213 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7214 |
emit_int8(0x13); |
1066 | 7215 |
emit_operand(dst, src); |
7216 |
} |
|
7217 |
||
7218 |
void Assembler::adcq(Register dst, Register src) { |
|
20295 | 7219 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
1066 | 7220 |
emit_arith(0x13, 0xC0, dst, src); |
7221 |
} |
|
7222 |
||
7223 |
void Assembler::addq(Address dst, int32_t imm32) { |
|
7224 |
InstructionMark im(this); |
|
7225 |
prefixq(dst); |
|
7226 |
emit_arith_operand(0x81, rax, dst,imm32); |
|
7227 |
} |
|
7228 |
||
7229 |
void Assembler::addq(Address dst, Register src) { |
|
7230 |
InstructionMark im(this); |
|
7231 |
prefixq(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7232 |
emit_int8(0x01); |
1066 | 7233 |
emit_operand(src, dst); |
7234 |
} |
|
7235 |
||
7236 |
void Assembler::addq(Register dst, int32_t imm32) { |
|
7237 |
(void) prefixq_and_encode(dst->encoding()); |
|
7238 |
emit_arith(0x81, 0xC0, dst, imm32); |
|
7239 |
} |
|
7240 |
||
7241 |
void Assembler::addq(Register dst, Address src) { |
|
7242 |
InstructionMark im(this); |
|
7243 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7244 |
emit_int8(0x03); |
1066 | 7245 |
emit_operand(dst, src); |
7246 |
} |
|
7247 |
||
7248 |
void Assembler::addq(Register dst, Register src) { |
|
7249 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
7250 |
emit_arith(0x03, 0xC0, dst, src); |
|
7251 |
} |
|
7252 |
||
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7253 |
void Assembler::adcxq(Register dst, Register src) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7254 |
//assert(VM_Version::supports_adx(), "adx instructions not supported"); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7255 |
emit_int8((unsigned char)0x66); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7256 |
int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7257 |
emit_int8(0x0F); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7258 |
emit_int8(0x38); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7259 |
emit_int8((unsigned char)0xF6); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7260 |
emit_int8((unsigned char)(0xC0 | encode)); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7261 |
} |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7262 |
|
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7263 |
void Assembler::adoxq(Register dst, Register src) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7264 |
//assert(VM_Version::supports_adx(), "adx instructions not supported"); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7265 |
emit_int8((unsigned char)0xF3); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7266 |
int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7267 |
emit_int8(0x0F); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7268 |
emit_int8(0x38); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7269 |
emit_int8((unsigned char)0xF6); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7270 |
emit_int8((unsigned char)(0xC0 | encode)); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7271 |
} |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7272 |
|
10006 | 7273 |
void Assembler::andq(Address dst, int32_t imm32) { |
7274 |
InstructionMark im(this); |
|
7275 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7276 |
emit_int8((unsigned char)0x81); |
10006 | 7277 |
emit_operand(rsp, dst, 4); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
7278 |
emit_int32(imm32); |
10006 | 7279 |
} |
7280 |
||
1066 | 7281 |
void Assembler::andq(Register dst, int32_t imm32) { |
7282 |
(void) prefixq_and_encode(dst->encoding()); |
|
7283 |
emit_arith(0x81, 0xE0, dst, imm32); |
|
7284 |
} |
|
7285 |
||
7286 |
void Assembler::andq(Register dst, Address src) { |
|
7287 |
InstructionMark im(this); |
|
7288 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7289 |
emit_int8(0x23); |
1066 | 7290 |
emit_operand(dst, src); |
7291 |
} |
|
7292 |
||
7293 |
void Assembler::andq(Register dst, Register src) { |
|
20295 | 7294 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
1066 | 7295 |
emit_arith(0x23, 0xC0, dst, src); |
7296 |
} |
|
7297 |
||
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7298 |
void Assembler::andnq(Register dst, Register src1, Register src2) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7299 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 7300 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
7301 |
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
|
7302 |
emit_int8((unsigned char)0xF2); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7303 |
emit_int8((unsigned char)(0xC0 | encode)); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7304 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7305 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7306 |
void Assembler::andnq(Register dst, Register src1, Address src2) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7307 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 7308 |
InstructionMark im(this); |
7309 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
|
7310 |
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
|
7311 |
emit_int8((unsigned char)0xF2); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7312 |
emit_operand(dst, src2); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7313 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7314 |
|
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
7315 |
void Assembler::bsfq(Register dst, Register src) { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
7316 |
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
|
7317 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7318 |
emit_int8((unsigned char)0xBC); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7319 |
emit_int8((unsigned char)(0xC0 | encode)); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
7320 |
} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
7321 |
|
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
7322 |
void Assembler::bsrq(Register dst, Register src) { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
7323 |
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
|
7324 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7325 |
emit_int8((unsigned char)0xBD); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7326 |
emit_int8((unsigned char)(0xC0 | encode)); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
7327 |
} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
7328 |
|
1066 | 7329 |
void Assembler::bswapq(Register reg) { |
7330 |
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
|
7331 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7332 |
emit_int8((unsigned char)(0xC8 | encode)); |
1066 | 7333 |
} |
7334 |
||
23220
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7335 |
void Assembler::blsiq(Register dst, Register src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7336 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 7337 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
7338 |
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
|
7339 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7340 |
emit_int8((unsigned char)(0xC0 | encode)); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7341 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7342 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7343 |
void Assembler::blsiq(Register dst, Address src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7344 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 7345 |
InstructionMark im(this); |
7346 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
|
7347 |
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
|
7348 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7349 |
emit_operand(rbx, src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7350 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7351 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7352 |
void Assembler::blsmskq(Register dst, Register src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7353 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 7354 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
7355 |
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
|
7356 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7357 |
emit_int8((unsigned char)(0xC0 | encode)); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7358 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7359 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7360 |
void Assembler::blsmskq(Register dst, Address src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7361 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 7362 |
InstructionMark im(this); |
7363 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
|
7364 |
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
|
7365 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7366 |
emit_operand(rdx, src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7367 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7368 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7369 |
void Assembler::blsrq(Register dst, Register src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7370 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 7371 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
7372 |
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
|
7373 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7374 |
emit_int8((unsigned char)(0xC0 | encode)); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7375 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7376 |
|
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7377 |
void Assembler::blsrq(Register dst, Address src) { |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7378 |
assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
34162 | 7379 |
InstructionMark im(this); |
7380 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
|
7381 |
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
|
7382 |
emit_int8((unsigned char)0xF3); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7383 |
emit_operand(rcx, src); |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7384 |
} |
fc827339dc37
8031321: Support Intel bit manipulation instructions
iveresov
parents:
21105
diff
changeset
|
7385 |
|
1066 | 7386 |
void Assembler::cdqq() { |
7387 |
prefix(REX_W); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7388 |
emit_int8((unsigned char)0x99); |
1066 | 7389 |
} |
7390 |
||
7391 |
void Assembler::clflush(Address adr) { |
|
7392 |
prefix(adr); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7393 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7394 |
emit_int8((unsigned char)0xAE); |
1066 | 7395 |
emit_operand(rdi, adr); |
7396 |
} |
|
7397 |
||
7398 |
void Assembler::cmovq(Condition cc, Register dst, Register src) { |
|
7399 |
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
|
7400 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7401 |
emit_int8(0x40 | cc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7402 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 7403 |
} |
7404 |
||
7405 |
void Assembler::cmovq(Condition cc, Register dst, Address src) { |
|
7406 |
InstructionMark im(this); |
|
7407 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7408 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7409 |
emit_int8(0x40 | cc); |
1066 | 7410 |
emit_operand(dst, src); |
7411 |
} |
|
7412 |
||
7413 |
void Assembler::cmpq(Address dst, int32_t imm32) { |
|
7414 |
InstructionMark im(this); |
|
7415 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7416 |
emit_int8((unsigned char)0x81); |
1066 | 7417 |
emit_operand(rdi, dst, 4); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
7418 |
emit_int32(imm32); |
1066 | 7419 |
} |
7420 |
||
7421 |
void Assembler::cmpq(Register dst, int32_t imm32) { |
|
7422 |
(void) prefixq_and_encode(dst->encoding()); |
|
7423 |
emit_arith(0x81, 0xF8, dst, imm32); |
|
7424 |
} |
|
7425 |
||
7426 |
void Assembler::cmpq(Address dst, Register src) { |
|
7427 |
InstructionMark im(this); |
|
7428 |
prefixq(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7429 |
emit_int8(0x3B); |
1066 | 7430 |
emit_operand(src, dst); |
7431 |
} |
|
7432 |
||
7433 |
void Assembler::cmpq(Register dst, Register src) { |
|
7434 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
7435 |
emit_arith(0x3B, 0xC0, dst, src); |
|
7436 |
} |
|
7437 |
||
7438 |
void Assembler::cmpq(Register dst, Address src) { |
|
7439 |
InstructionMark im(this); |
|
7440 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7441 |
emit_int8(0x3B); |
1066 | 7442 |
emit_operand(dst, src); |
7443 |
} |
|
7444 |
||
7445 |
void Assembler::cmpxchgq(Register reg, Address adr) { |
|
7446 |
InstructionMark im(this); |
|
7447 |
prefixq(adr, reg); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7448 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7449 |
emit_int8((unsigned char)0xB1); |
1066 | 7450 |
emit_operand(reg, adr); |
7451 |
} |
|
7452 |
||
7453 |
void Assembler::cvtsi2sdq(XMMRegister dst, Register src) { |
|
7454 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 7455 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
7456 |
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
|
7457 |
emit_int8(0x2A); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7458 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 7459 |
} |
7460 |
||
11427 | 7461 |
void Assembler::cvtsi2sdq(XMMRegister dst, Address src) { |
7462 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 7463 |
InstructionMark im(this); |
7464 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
7465 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
7466 |
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
|
7467 |
emit_int8(0x2A); |
11427 | 7468 |
emit_operand(dst, src); |
7469 |
} |
|
7470 |
||
7471 |
void Assembler::cvtsi2ssq(XMMRegister dst, Address src) { |
|
7472 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 7473 |
InstructionMark im(this); |
7474 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
|
7475 |
attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); |
|
7476 |
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
|
7477 |
emit_int8(0x2A); |
11427 | 7478 |
emit_operand(dst, src); |
7479 |
} |
|
7480 |
||
1066 | 7481 |
void Assembler::cvttsd2siq(Register dst, XMMRegister src) { |
7482 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
34162 | 7483 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
7484 |
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
|
7485 |
emit_int8(0x2C); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7486 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 7487 |
} |
7488 |
||
7489 |
void Assembler::cvttss2siq(Register dst, XMMRegister src) { |
|
7490 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
34162 | 7491 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
7492 |
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
|
7493 |
emit_int8(0x2C); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7494 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 7495 |
} |
7496 |
||
7497 |
void Assembler::decl(Register dst) { |
|
7498 |
// Don't use it directly. Use MacroAssembler::decrementl() instead. |
|
7499 |
// Use two-byte form (one-byte form is a REX prefix in 64-bit mode) |
|
7500 |
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
|
7501 |
emit_int8((unsigned char)0xFF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7502 |
emit_int8((unsigned char)(0xC8 | encode)); |
1066 | 7503 |
} |
7504 |
||
7505 |
void Assembler::decq(Register dst) { |
|
7506 |
// Don't use it directly. Use MacroAssembler::decrementq() instead. |
|
7507 |
// Use two-byte form (one-byte from is a REX prefix in 64-bit mode) |
|
7508 |
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
|
7509 |
emit_int8((unsigned char)0xFF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7510 |
emit_int8(0xC8 | encode); |
1066 | 7511 |
} |
7512 |
||
7513 |
void Assembler::decq(Address dst) { |
|
7514 |
// Don't use it directly. Use MacroAssembler::decrementq() instead. |
|
7515 |
InstructionMark im(this); |
|
7516 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7517 |
emit_int8((unsigned char)0xFF); |
1066 | 7518 |
emit_operand(rcx, dst); |
7519 |
} |
|
7520 |
||
7521 |
void Assembler::fxrstor(Address src) { |
|
7522 |
prefixq(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7523 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7524 |
emit_int8((unsigned char)0xAE); |
1066 | 7525 |
emit_operand(as_Register(1), src); |
7526 |
} |
|
7527 |
||
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
7528 |
void Assembler::xrstor(Address src) { |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
7529 |
prefixq(src); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
7530 |
emit_int8(0x0F); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
7531 |
emit_int8((unsigned char)0xAE); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
7532 |
emit_operand(as_Register(5), src); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
7533 |
} |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
7534 |
|
1066 | 7535 |
void Assembler::fxsave(Address dst) { |
7536 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7537 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7538 |
emit_int8((unsigned char)0xAE); |
1066 | 7539 |
emit_operand(as_Register(0), dst); |
7540 |
} |
|
7541 |
||
32727
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
7542 |
void Assembler::xsave(Address dst) { |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
7543 |
prefixq(dst); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
7544 |
emit_int8(0x0F); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
7545 |
emit_int8((unsigned char)0xAE); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
7546 |
emit_operand(as_Register(4), dst); |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
7547 |
} |
320855c2baef
8132160: support for AVX 512 call frames and stack management
mcberg
parents:
32723
diff
changeset
|
7548 |
|
1066 | 7549 |
void Assembler::idivq(Register src) { |
7550 |
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
|
7551 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7552 |
emit_int8((unsigned char)(0xF8 | encode)); |
1066 | 7553 |
} |
7554 |
||
7555 |
void Assembler::imulq(Register dst, Register src) { |
|
7556 |
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
|
7557 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7558 |
emit_int8((unsigned char)0xAF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7559 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 7560 |
} |
7561 |
||
7562 |
void Assembler::imulq(Register dst, Register src, int value) { |
|
7563 |
int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
|
7564 |
if (is8bit(value)) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7565 |
emit_int8(0x6B); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7566 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7567 |
emit_int8(value & 0xFF); |
1066 | 7568 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7569 |
emit_int8(0x69); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7570 |
emit_int8((unsigned char)(0xC0 | encode)); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
7571 |
emit_int32(value); |
1066 | 7572 |
} |
7573 |
} |
|
7574 |
||
21105
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
7575 |
void Assembler::imulq(Register dst, Address src) { |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
7576 |
InstructionMark im(this); |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
7577 |
prefixq(src, dst); |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
7578 |
emit_int8(0x0F); |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
7579 |
emit_int8((unsigned char) 0xAF); |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
7580 |
emit_operand(dst, src); |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
7581 |
} |
47618ee96ed5
8026844: Various Math functions needs intrinsification
rbackman
parents:
20295
diff
changeset
|
7582 |
|
1066 | 7583 |
void Assembler::incl(Register dst) { |
7584 |
// Don't use it directly. Use MacroAssembler::incrementl() instead. |
|
7585 |
// Use two-byte form (one-byte from is a REX prefix in 64-bit mode) |
|
7586 |
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
|
7587 |
emit_int8((unsigned char)0xFF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7588 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 7589 |
} |
7590 |
||
7591 |
void Assembler::incq(Register dst) { |
|
7592 |
// Don't use it directly. Use MacroAssembler::incrementq() instead. |
|
7593 |
// Use two-byte form (one-byte from is a REX prefix in 64-bit mode) |
|
7594 |
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
|
7595 |
emit_int8((unsigned char)0xFF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7596 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 7597 |
} |
7598 |
||
7599 |
void Assembler::incq(Address dst) { |
|
7600 |
// Don't use it directly. Use MacroAssembler::incrementq() instead. |
|
7601 |
InstructionMark im(this); |
|
7602 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7603 |
emit_int8((unsigned char)0xFF); |
1066 | 7604 |
emit_operand(rax, dst); |
7605 |
} |
|
7606 |
||
7607 |
void Assembler::lea(Register dst, Address src) { |
|
7608 |
leaq(dst, src); |
|
7609 |
} |
|
7610 |
||
7611 |
void Assembler::leaq(Register dst, Address src) { |
|
7612 |
InstructionMark im(this); |
|
7613 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7614 |
emit_int8((unsigned char)0x8D); |
1066 | 7615 |
emit_operand(dst, src); |
7616 |
} |
|
7617 |
||
7618 |
void Assembler::mov64(Register dst, int64_t imm64) { |
|
7619 |
InstructionMark im(this); |
|
7620 |
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
|
7621 |
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
|
7622 |
emit_int64(imm64); |
1066 | 7623 |
} |
7624 |
||
7625 |
void Assembler::mov_literal64(Register dst, intptr_t imm64, RelocationHolder const& rspec) { |
|
7626 |
InstructionMark im(this); |
|
7627 |
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
|
7628 |
emit_int8(0xB8 | encode); |
1066 | 7629 |
emit_data64(imm64, rspec); |
7630 |
} |
|
7631 |
||
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
7632 |
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
|
7633 |
InstructionMark im(this); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
7634 |
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
|
7635 |
emit_int8((unsigned char)(0xB8 | encode)); |
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
7636 |
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
|
7637 |
} |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
7638 |
|
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
7639 |
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
|
7640 |
InstructionMark im(this); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
7641 |
prefix(dst); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7642 |
emit_int8((unsigned char)0xC7); |
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
7643 |
emit_operand(rax, dst, 4); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
7644 |
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
|
7645 |
} |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
7646 |
|
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
7647 |
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
|
7648 |
InstructionMark im(this); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
7649 |
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
|
7650 |
emit_int8((unsigned char)0x81); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7651 |
emit_int8((unsigned char)(0xF8 | encode)); |
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
7652 |
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
|
7653 |
} |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
7654 |
|
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
7655 |
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
|
7656 |
InstructionMark im(this); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
7657 |
prefix(src1); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7658 |
emit_int8((unsigned char)0x81); |
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
7659 |
emit_operand(rax, src1, 4); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
7660 |
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
|
7661 |
} |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
7662 |
|
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
7663 |
void Assembler::lzcntq(Register dst, Register src) { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
7664 |
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
|
7665 |
emit_int8((unsigned char)0xF3); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
7666 |
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
|
7667 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7668 |
emit_int8((unsigned char)0xBD); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7669 |
emit_int8((unsigned char)(0xC0 | encode)); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
7670 |
} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
7671 |
|
1066 | 7672 |
void Assembler::movdq(XMMRegister dst, Register src) { |
7673 |
// table D-1 says MMX/SSE2 |
|
11427 | 7674 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 7675 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
7676 |
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
|
7677 |
emit_int8(0x6E); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7678 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 7679 |
} |
7680 |
||
7681 |
void Assembler::movdq(Register dst, XMMRegister src) { |
|
7682 |
// table D-1 says MMX/SSE2 |
|
11427 | 7683 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
34162 | 7684 |
InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); |
1066 | 7685 |
// swap src/dst to get correct prefix |
34162 | 7686 |
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
|
7687 |
emit_int8(0x7E); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7688 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 7689 |
} |
7690 |
||
7691 |
void Assembler::movq(Register dst, Register src) { |
|
7692 |
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
|
7693 |
emit_int8((unsigned char)0x8B); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7694 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 7695 |
} |
7696 |
||
7697 |
void Assembler::movq(Register dst, Address src) { |
|
7698 |
InstructionMark im(this); |
|
7699 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7700 |
emit_int8((unsigned char)0x8B); |
1066 | 7701 |
emit_operand(dst, src); |
7702 |
} |
|
7703 |
||
7704 |
void Assembler::movq(Address dst, Register src) { |
|
7705 |
InstructionMark im(this); |
|
7706 |
prefixq(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7707 |
emit_int8((unsigned char)0x89); |
1066 | 7708 |
emit_operand(src, dst); |
7709 |
} |
|
7710 |
||
2150 | 7711 |
void Assembler::movsbq(Register dst, Address src) { |
7712 |
InstructionMark im(this); |
|
7713 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7714 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7715 |
emit_int8((unsigned char)0xBE); |
2150 | 7716 |
emit_operand(dst, src); |
7717 |
} |
|
7718 |
||
7719 |
void Assembler::movsbq(Register dst, Register src) { |
|
7720 |
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
|
7721 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7722 |
emit_int8((unsigned char)0xBE); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7723 |
emit_int8((unsigned char)(0xC0 | encode)); |
2150 | 7724 |
} |
7725 |
||
1066 | 7726 |
void Assembler::movslq(Register dst, int32_t imm32) { |
7727 |
// dbx shows movslq(rcx, 3) as movq $0x0000000049000000,(%rbx) |
|
7728 |
// and movslq(r8, 3); as movl $0x0000000048000000,(%rbx) |
|
7729 |
// as a result we shouldn't use until tested at runtime... |
|
7730 |
ShouldNotReachHere(); |
|
7731 |
InstructionMark im(this); |
|
7732 |
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
|
7733 |
emit_int8((unsigned char)(0xC7 | encode)); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
7734 |
emit_int32(imm32); |
1066 | 7735 |
} |
7736 |
||
7737 |
void Assembler::movslq(Address dst, int32_t imm32) { |
|
7738 |
assert(is_simm32(imm32), "lost bits"); |
|
7739 |
InstructionMark im(this); |
|
7740 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7741 |
emit_int8((unsigned char)0xC7); |
1066 | 7742 |
emit_operand(rax, dst, 4); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
7743 |
emit_int32(imm32); |
1066 | 7744 |
} |
7745 |
||
7746 |
void Assembler::movslq(Register dst, Address src) { |
|
7747 |
InstructionMark im(this); |
|
7748 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7749 |
emit_int8(0x63); |
1066 | 7750 |
emit_operand(dst, src); |
7751 |
} |
|
7752 |
||
7753 |
void Assembler::movslq(Register dst, Register src) { |
|
7754 |
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
|
7755 |
emit_int8(0x63); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7756 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 7757 |
} |
7758 |
||
2150 | 7759 |
void Assembler::movswq(Register dst, Address src) { |
7760 |
InstructionMark im(this); |
|
7761 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7762 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7763 |
emit_int8((unsigned char)0xBF); |
2150 | 7764 |
emit_operand(dst, src); |
7765 |
} |
|
7766 |
||
7767 |
void Assembler::movswq(Register dst, Register src) { |
|
7768 |
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
|
7769 |
emit_int8((unsigned char)0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7770 |
emit_int8((unsigned char)0xBF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7771 |
emit_int8((unsigned char)(0xC0 | encode)); |
2150 | 7772 |
} |
7773 |
||
7774 |
void Assembler::movzbq(Register dst, Address src) { |
|
7775 |
InstructionMark im(this); |
|
7776 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7777 |
emit_int8((unsigned char)0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7778 |
emit_int8((unsigned char)0xB6); |
2150 | 7779 |
emit_operand(dst, src); |
7780 |
} |
|
7781 |
||
7782 |
void Assembler::movzbq(Register dst, Register src) { |
|
7783 |
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
|
7784 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7785 |
emit_int8((unsigned char)0xB6); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7786 |
emit_int8(0xC0 | encode); |
2150 | 7787 |
} |
7788 |
||
7789 |
void Assembler::movzwq(Register dst, Address src) { |
|
7790 |
InstructionMark im(this); |
|
7791 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7792 |
emit_int8((unsigned char)0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7793 |
emit_int8((unsigned char)0xB7); |
2150 | 7794 |
emit_operand(dst, src); |
7795 |
} |
|
7796 |
||
7797 |
void Assembler::movzwq(Register dst, Register src) { |
|
7798 |
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
|
7799 |
emit_int8((unsigned char)0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7800 |
emit_int8((unsigned char)0xB7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7801 |
emit_int8((unsigned char)(0xC0 | encode)); |
2150 | 7802 |
} |
7803 |
||
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7804 |
void Assembler::mulq(Address src) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7805 |
InstructionMark im(this); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7806 |
prefixq(src); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7807 |
emit_int8((unsigned char)0xF7); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7808 |
emit_operand(rsp, src); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7809 |
} |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7810 |
|
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7811 |
void Assembler::mulq(Register src) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7812 |
int encode = prefixq_and_encode(src->encoding()); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7813 |
emit_int8((unsigned char)0xF7); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7814 |
emit_int8((unsigned char)(0xE0 | encode)); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7815 |
} |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7816 |
|
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7817 |
void Assembler::mulxq(Register dst1, Register dst2, Register src) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7818 |
assert(VM_Version::supports_bmi2(), "bit manipulation instructions not supported"); |
34162 | 7819 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
7820 |
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
|
7821 |
emit_int8((unsigned char)0xF6); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7822 |
emit_int8((unsigned char)(0xC0 | encode)); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7823 |
} |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7824 |
|
1066 | 7825 |
void Assembler::negq(Register dst) { |
7826 |
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
|
7827 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7828 |
emit_int8((unsigned char)(0xD8 | encode)); |
1066 | 7829 |
} |
7830 |
||
7831 |
void Assembler::notq(Register dst) { |
|
7832 |
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
|
7833 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7834 |
emit_int8((unsigned char)(0xD0 | encode)); |
1066 | 7835 |
} |
7836 |
||
7837 |
void Assembler::orq(Address dst, int32_t imm32) { |
|
7838 |
InstructionMark im(this); |
|
7839 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7840 |
emit_int8((unsigned char)0x81); |
1066 | 7841 |
emit_operand(rcx, dst, 4); |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
7842 |
emit_int32(imm32); |
1066 | 7843 |
} |
7844 |
||
7845 |
void Assembler::orq(Register dst, int32_t imm32) { |
|
7846 |
(void) prefixq_and_encode(dst->encoding()); |
|
7847 |
emit_arith(0x81, 0xC8, dst, imm32); |
|
7848 |
} |
|
7849 |
||
7850 |
void Assembler::orq(Register dst, Address src) { |
|
7851 |
InstructionMark im(this); |
|
7852 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7853 |
emit_int8(0x0B); |
1066 | 7854 |
emit_operand(dst, src); |
7855 |
} |
|
7856 |
||
7857 |
void Assembler::orq(Register dst, Register src) { |
|
7858 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
7859 |
emit_arith(0x0B, 0xC0, dst, src); |
|
7860 |
} |
|
7861 |
||
7862 |
void Assembler::popa() { // 64bit |
|
7863 |
movq(r15, Address(rsp, 0)); |
|
7864 |
movq(r14, Address(rsp, wordSize)); |
|
7865 |
movq(r13, Address(rsp, 2 * wordSize)); |
|
7866 |
movq(r12, Address(rsp, 3 * wordSize)); |
|
7867 |
movq(r11, Address(rsp, 4 * wordSize)); |
|
7868 |
movq(r10, Address(rsp, 5 * wordSize)); |
|
7869 |
movq(r9, Address(rsp, 6 * wordSize)); |
|
7870 |
movq(r8, Address(rsp, 7 * wordSize)); |
|
7871 |
movq(rdi, Address(rsp, 8 * wordSize)); |
|
7872 |
movq(rsi, Address(rsp, 9 * wordSize)); |
|
7873 |
movq(rbp, Address(rsp, 10 * wordSize)); |
|
7874 |
// skip rsp |
|
7875 |
movq(rbx, Address(rsp, 12 * wordSize)); |
|
7876 |
movq(rdx, Address(rsp, 13 * wordSize)); |
|
7877 |
movq(rcx, Address(rsp, 14 * wordSize)); |
|
7878 |
movq(rax, Address(rsp, 15 * wordSize)); |
|
7879 |
||
7880 |
addq(rsp, 16 * wordSize); |
|
7881 |
} |
|
7882 |
||
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
7883 |
void Assembler::popcntq(Register dst, Address src) { |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
7884 |
assert(VM_Version::supports_popcnt(), "must support"); |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
7885 |
InstructionMark im(this); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7886 |
emit_int8((unsigned char)0xF3); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
7887 |
prefixq(src, dst); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7888 |
emit_int8((unsigned char)0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7889 |
emit_int8((unsigned char)0xB8); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
7890 |
emit_operand(dst, src); |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
7891 |
} |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
7892 |
|
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
7893 |
void Assembler::popcntq(Register dst, Register src) { |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
7894 |
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
|
7895 |
emit_int8((unsigned char)0xF3); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
7896 |
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
|
7897 |
emit_int8((unsigned char)0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7898 |
emit_int8((unsigned char)0xB8); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7899 |
emit_int8((unsigned char)(0xC0 | encode)); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
7900 |
} |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
7901 |
|
1066 | 7902 |
void Assembler::popq(Address dst) { |
7903 |
InstructionMark im(this); |
|
7904 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7905 |
emit_int8((unsigned char)0x8F); |
1066 | 7906 |
emit_operand(rax, dst); |
7907 |
} |
|
7908 |
||
7909 |
void Assembler::pusha() { // 64bit |
|
7910 |
// we have to store original rsp. ABI says that 128 bytes |
|
7911 |
// below rsp are local scratch. |
|
7912 |
movq(Address(rsp, -5 * wordSize), rsp); |
|
7913 |
||
7914 |
subq(rsp, 16 * wordSize); |
|
7915 |
||
7916 |
movq(Address(rsp, 15 * wordSize), rax); |
|
7917 |
movq(Address(rsp, 14 * wordSize), rcx); |
|
7918 |
movq(Address(rsp, 13 * wordSize), rdx); |
|
7919 |
movq(Address(rsp, 12 * wordSize), rbx); |
|
7920 |
// skip rsp |
|
7921 |
movq(Address(rsp, 10 * wordSize), rbp); |
|
7922 |
movq(Address(rsp, 9 * wordSize), rsi); |
|
7923 |
movq(Address(rsp, 8 * wordSize), rdi); |
|
7924 |
movq(Address(rsp, 7 * wordSize), r8); |
|
7925 |
movq(Address(rsp, 6 * wordSize), r9); |
|
7926 |
movq(Address(rsp, 5 * wordSize), r10); |
|
7927 |
movq(Address(rsp, 4 * wordSize), r11); |
|
7928 |
movq(Address(rsp, 3 * wordSize), r12); |
|
7929 |
movq(Address(rsp, 2 * wordSize), r13); |
|
7930 |
movq(Address(rsp, wordSize), r14); |
|
7931 |
movq(Address(rsp, 0), r15); |
|
7932 |
} |
|
7933 |
||
7934 |
void Assembler::pushq(Address src) { |
|
7935 |
InstructionMark im(this); |
|
7936 |
prefixq(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7937 |
emit_int8((unsigned char)0xFF); |
1066 | 7938 |
emit_operand(rsi, src); |
7939 |
} |
|
7940 |
||
7941 |
void Assembler::rclq(Register dst, int imm8) { |
|
7942 |
assert(isShiftCount(imm8 >> 1), "illegal shift count"); |
|
7943 |
int encode = prefixq_and_encode(dst->encoding()); |
|
7944 |
if (imm8 == 1) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7945 |
emit_int8((unsigned char)0xD1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7946 |
emit_int8((unsigned char)(0xD0 | encode)); |
1066 | 7947 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7948 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7949 |
emit_int8((unsigned char)(0xD0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7950 |
emit_int8(imm8); |
1066 | 7951 |
} |
7952 |
} |
|
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7953 |
|
31129
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
7954 |
void Assembler::rcrq(Register dst, int imm8) { |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
7955 |
assert(isShiftCount(imm8 >> 1), "illegal shift count"); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
7956 |
int encode = prefixq_and_encode(dst->encoding()); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
7957 |
if (imm8 == 1) { |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
7958 |
emit_int8((unsigned char)0xD1); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
7959 |
emit_int8((unsigned char)(0xD8 | encode)); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
7960 |
} else { |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
7961 |
emit_int8((unsigned char)0xC1); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
7962 |
emit_int8((unsigned char)(0xD8 | encode)); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
7963 |
emit_int8(imm8); |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
7964 |
} |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
7965 |
} |
02ee7609f0e1
8081778: Use Intel x64 CPU instructions for RSA acceleration
kvn
parents:
30768
diff
changeset
|
7966 |
|
26434
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7967 |
void Assembler::rorq(Register dst, int imm8) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7968 |
assert(isShiftCount(imm8 >> 1), "illegal shift count"); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7969 |
int encode = prefixq_and_encode(dst->encoding()); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7970 |
if (imm8 == 1) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7971 |
emit_int8((unsigned char)0xD1); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7972 |
emit_int8((unsigned char)(0xC8 | encode)); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7973 |
} else { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7974 |
emit_int8((unsigned char)0xC1); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7975 |
emit_int8((unsigned char)(0xc8 | encode)); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7976 |
emit_int8(imm8); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7977 |
} |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7978 |
} |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7979 |
|
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7980 |
void Assembler::rorxq(Register dst, Register src, int imm8) { |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7981 |
assert(VM_Version::supports_bmi2(), "bit manipulation instructions not supported"); |
34162 | 7982 |
InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); |
7983 |
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
|
7984 |
emit_int8((unsigned char)0xF0); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7985 |
emit_int8((unsigned char)(0xC0 | encode)); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7986 |
emit_int8(imm8); |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7987 |
} |
09ad55e5f486
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
25932
diff
changeset
|
7988 |
|
1066 | 7989 |
void Assembler::sarq(Register dst, int imm8) { |
7990 |
assert(isShiftCount(imm8 >> 1), "illegal shift count"); |
|
7991 |
int encode = prefixq_and_encode(dst->encoding()); |
|
7992 |
if (imm8 == 1) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7993 |
emit_int8((unsigned char)0xD1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7994 |
emit_int8((unsigned char)(0xF8 | encode)); |
1066 | 7995 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7996 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7997 |
emit_int8((unsigned char)(0xF8 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
7998 |
emit_int8(imm8); |
1066 | 7999 |
} |
8000 |
} |
|
8001 |
||
8002 |
void Assembler::sarq(Register dst) { |
|
8003 |
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
|
8004 |
emit_int8((unsigned char)0xD3); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8005 |
emit_int8((unsigned char)(0xF8 | encode)); |
1066 | 8006 |
} |
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
8007 |
|
1066 | 8008 |
void Assembler::sbbq(Address dst, int32_t imm32) { |
8009 |
InstructionMark im(this); |
|
8010 |
prefixq(dst); |
|
8011 |
emit_arith_operand(0x81, rbx, dst, imm32); |
|
8012 |
} |
|
8013 |
||
8014 |
void Assembler::sbbq(Register dst, int32_t imm32) { |
|
8015 |
(void) prefixq_and_encode(dst->encoding()); |
|
8016 |
emit_arith(0x81, 0xD8, dst, imm32); |
|
8017 |
} |
|
8018 |
||
8019 |
void Assembler::sbbq(Register dst, Address src) { |
|
8020 |
InstructionMark im(this); |
|
8021 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8022 |
emit_int8(0x1B); |
1066 | 8023 |
emit_operand(dst, src); |
8024 |
} |
|
8025 |
||
8026 |
void Assembler::sbbq(Register dst, Register src) { |
|
8027 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
8028 |
emit_arith(0x1B, 0xC0, dst, src); |
|
8029 |
} |
|
8030 |
||
8031 |
void Assembler::shlq(Register dst, int imm8) { |
|
8032 |
assert(isShiftCount(imm8 >> 1), "illegal shift count"); |
|
8033 |
int encode = prefixq_and_encode(dst->encoding()); |
|
8034 |
if (imm8 == 1) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8035 |
emit_int8((unsigned char)0xD1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8036 |
emit_int8((unsigned char)(0xE0 | encode)); |
1066 | 8037 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8038 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8039 |
emit_int8((unsigned char)(0xE0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8040 |
emit_int8(imm8); |
1066 | 8041 |
} |
8042 |
} |
|
8043 |
||
8044 |
void Assembler::shlq(Register dst) { |
|
8045 |
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
|
8046 |
emit_int8((unsigned char)0xD3); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8047 |
emit_int8((unsigned char)(0xE0 | encode)); |
1066 | 8048 |
} |
8049 |
||
8050 |
void Assembler::shrq(Register dst, int imm8) { |
|
8051 |
assert(isShiftCount(imm8 >> 1), "illegal shift count"); |
|
8052 |
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
|
8053 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8054 |
emit_int8((unsigned char)(0xE8 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8055 |
emit_int8(imm8); |
1066 | 8056 |
} |
8057 |
||
8058 |
void Assembler::shrq(Register dst) { |
|
8059 |
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
|
8060 |
emit_int8((unsigned char)0xD3); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8061 |
emit_int8(0xE8 | encode); |
1066 | 8062 |
} |
8063 |
||
8064 |
void Assembler::subq(Address dst, int32_t imm32) { |
|
8065 |
InstructionMark im(this); |
|
8066 |
prefixq(dst); |
|
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
8067 |
emit_arith_operand(0x81, rbp, dst, imm32); |
1066 | 8068 |
} |
8069 |
||
8070 |
void Assembler::subq(Address dst, Register src) { |
|
8071 |
InstructionMark im(this); |
|
8072 |
prefixq(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8073 |
emit_int8(0x29); |
1066 | 8074 |
emit_operand(src, dst); |
8075 |
} |
|
8076 |
||
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
8077 |
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
|
8078 |
(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
|
8079 |
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
|
8080 |
} |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
8081 |
|
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
8082 |
// 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
|
8083 |
void Assembler::subq_imm32(Register dst, int32_t imm32) { |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
8084 |
(void) prefixq_and_encode(dst->encoding()); |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
8085 |
emit_arith_imm32(0x81, 0xE8, dst, imm32); |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
8086 |
} |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
8087 |
|
1066 | 8088 |
void Assembler::subq(Register dst, Address src) { |
8089 |
InstructionMark im(this); |
|
8090 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8091 |
emit_int8(0x2B); |
1066 | 8092 |
emit_operand(dst, src); |
8093 |
} |
|
8094 |
||
8095 |
void Assembler::subq(Register dst, Register src) { |
|
8096 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
8097 |
emit_arith(0x2B, 0xC0, dst, src); |
|
8098 |
} |
|
8099 |
||
8100 |
void Assembler::testq(Register dst, int32_t imm32) { |
|
8101 |
// not using emit_arith because test |
|
8102 |
// doesn't support sign-extension of |
|
8103 |
// 8bit operands |
|
8104 |
int encode = dst->encoding(); |
|
8105 |
if (encode == 0) { |
|
8106 |
prefix(REX_W); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8107 |
emit_int8((unsigned char)0xA9); |
1066 | 8108 |
} else { |
8109 |
encode = prefixq_and_encode(encode); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8110 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8111 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 8112 |
} |
15116
af423dcb739c
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
15115
diff
changeset
|
8113 |
emit_int32(imm32); |
1066 | 8114 |
} |
8115 |
||
8116 |
void Assembler::testq(Register dst, Register src) { |
|
8117 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
8118 |
emit_arith(0x85, 0xC0, dst, src); |
|
8119 |
} |
|
8120 |
||
8121 |
void Assembler::xaddq(Address dst, Register src) { |
|
8122 |
InstructionMark im(this); |
|
8123 |
prefixq(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8124 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8125 |
emit_int8((unsigned char)0xC1); |
1066 | 8126 |
emit_operand(src, dst); |
8127 |
} |
|
8128 |
||
8129 |
void Assembler::xchgq(Register dst, Address src) { |
|
8130 |
InstructionMark im(this); |
|
8131 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8132 |
emit_int8((unsigned char)0x87); |
1066 | 8133 |
emit_operand(dst, src); |
8134 |
} |
|
8135 |
||
8136 |
void Assembler::xchgq(Register dst, Register src) { |
|
8137 |
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
|
8138 |
emit_int8((unsigned char)0x87); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8139 |
emit_int8((unsigned char)(0xc0 | encode)); |
1066 | 8140 |
} |
8141 |
||
8142 |
void Assembler::xorq(Register dst, Register src) { |
|
8143 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
8144 |
emit_arith(0x33, 0xC0, dst, src); |
|
8145 |
} |
|
8146 |
||
8147 |
void Assembler::xorq(Register dst, Address src) { |
|
8148 |
InstructionMark im(this); |
|
8149 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
8150 |
emit_int8(0x33); |
1066 | 8151 |
emit_operand(dst, src); |
8152 |
} |
|
8153 |
||
8154 |
#endif // !LP64 |