author | kvn |
Thu, 03 Jan 2013 15:09:55 -0800 | |
changeset 15114 | 4074553c678b |
parent 14837 | a75c3082d106 |
child 15115 | f8ef87f6f07f |
permissions | -rw-r--r-- |
1 | 1 |
/* |
11438
d98e7bed0cd6
7119294: Two command line options cause JVM to crash
iveresov
parents:
11436
diff
changeset
|
2 |
* Copyright (c) 1997, 2012, 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" |
7397 | 28 |
#include "gc_interface/collectedHeap.inline.hpp" |
29 |
#include "interpreter/interpreter.hpp" |
|
30 |
#include "memory/cardTableModRefBS.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" |
|
39 |
#ifndef SERIALGC |
|
40 |
#include "gc_implementation/g1/g1CollectedHeap.inline.hpp" |
|
41 |
#include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" |
|
42 |
#include "gc_implementation/g1/heapRegion.hpp" |
|
43 |
#endif |
|
1 | 44 |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
45 |
#ifdef PRODUCT |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
46 |
#define BLOCK_COMMENT(str) /* nothing */ |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
47 |
#define STOP(error) stop(error) |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
48 |
#else |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
49 |
#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
|
50 |
#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
|
51 |
#endif |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
52 |
|
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13294
diff
changeset
|
53 |
#define BIND(label) bind(label); BLOCK_COMMENT(#label ":") |
1 | 54 |
// Implementation of AddressLiteral |
55 |
||
56 |
AddressLiteral::AddressLiteral(address target, relocInfo::relocType rtype) { |
|
57 |
_is_lval = false; |
|
58 |
_target = target; |
|
59 |
switch (rtype) { |
|
60 |
case relocInfo::oop_type: |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13485
diff
changeset
|
61 |
case relocInfo::metadata_type: |
1 | 62 |
// Oops are a special case. Normally they would be their own section |
63 |
// but in cases like icBuffer they are literals in the code stream that |
|
64 |
// we don't have a section for. We use none so that we get a literal address |
|
65 |
// which is always patchable. |
|
66 |
break; |
|
67 |
case relocInfo::external_word_type: |
|
68 |
_rspec = external_word_Relocation::spec(target); |
|
69 |
break; |
|
70 |
case relocInfo::internal_word_type: |
|
71 |
_rspec = internal_word_Relocation::spec(target); |
|
72 |
break; |
|
73 |
case relocInfo::opt_virtual_call_type: |
|
74 |
_rspec = opt_virtual_call_Relocation::spec(); |
|
75 |
break; |
|
76 |
case relocInfo::static_call_type: |
|
77 |
_rspec = static_call_Relocation::spec(); |
|
78 |
break; |
|
79 |
case relocInfo::runtime_call_type: |
|
80 |
_rspec = runtime_call_Relocation::spec(); |
|
81 |
break; |
|
82 |
case relocInfo::poll_type: |
|
83 |
case relocInfo::poll_return_type: |
|
84 |
_rspec = Relocation::spec_simple(rtype); |
|
85 |
break; |
|
86 |
case relocInfo::none: |
|
87 |
break; |
|
88 |
default: |
|
89 |
ShouldNotReachHere(); |
|
90 |
break; |
|
91 |
} |
|
92 |
} |
|
93 |
||
94 |
// Implementation of Address |
|
95 |
||
1066 | 96 |
#ifdef _LP64 |
97 |
||
1 | 98 |
Address Address::make_array(ArrayAddress adr) { |
99 |
// Not implementable on 64bit machines |
|
100 |
// Should have been handled higher up the call chain. |
|
101 |
ShouldNotReachHere(); |
|
1066 | 102 |
return Address(); |
103 |
} |
|
104 |
||
105 |
// exceedingly dangerous constructor |
|
106 |
Address::Address(int disp, address loc, relocInfo::relocType rtype) { |
|
107 |
_base = noreg; |
|
108 |
_index = noreg; |
|
109 |
_scale = no_scale; |
|
110 |
_disp = disp; |
|
111 |
switch (rtype) { |
|
112 |
case relocInfo::external_word_type: |
|
113 |
_rspec = external_word_Relocation::spec(loc); |
|
114 |
break; |
|
115 |
case relocInfo::internal_word_type: |
|
116 |
_rspec = internal_word_Relocation::spec(loc); |
|
117 |
break; |
|
118 |
case relocInfo::runtime_call_type: |
|
119 |
// HMM |
|
120 |
_rspec = runtime_call_Relocation::spec(); |
|
121 |
break; |
|
122 |
case relocInfo::poll_type: |
|
123 |
case relocInfo::poll_return_type: |
|
124 |
_rspec = Relocation::spec_simple(rtype); |
|
125 |
break; |
|
126 |
case relocInfo::none: |
|
127 |
break; |
|
128 |
default: |
|
129 |
ShouldNotReachHere(); |
|
130 |
} |
|
131 |
} |
|
132 |
#else // LP64 |
|
133 |
||
134 |
Address Address::make_array(ArrayAddress adr) { |
|
1 | 135 |
AddressLiteral base = adr.base(); |
136 |
Address index = adr.index(); |
|
137 |
assert(index._disp == 0, "must not have disp"); // maybe it can? |
|
138 |
Address array(index._base, index._index, index._scale, (intptr_t) base.target()); |
|
139 |
array._rspec = base._rspec; |
|
140 |
return array; |
|
1066 | 141 |
} |
1 | 142 |
|
143 |
// exceedingly dangerous constructor |
|
144 |
Address::Address(address loc, RelocationHolder spec) { |
|
145 |
_base = noreg; |
|
146 |
_index = noreg; |
|
147 |
_scale = no_scale; |
|
148 |
_disp = (intptr_t) loc; |
|
149 |
_rspec = spec; |
|
150 |
} |
|
1066 | 151 |
|
1 | 152 |
#endif // _LP64 |
153 |
||
1066 | 154 |
|
155 |
||
1 | 156 |
// Convert the raw encoding form into the form expected by the constructor for |
157 |
// Address. An index of 4 (rsp) corresponds to having no index, so convert |
|
158 |
// that to noreg for the Address constructor. |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13485
diff
changeset
|
159 |
Address Address::make_raw(int base, int index, int scale, int disp, relocInfo::relocType disp_reloc) { |
2150 | 160 |
RelocationHolder rspec; |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13485
diff
changeset
|
161 |
if (disp_reloc != relocInfo::none) { |
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13485
diff
changeset
|
162 |
rspec = Relocation::spec_simple(disp_reloc); |
2150 | 163 |
} |
1 | 164 |
bool valid_index = index != rsp->encoding(); |
165 |
if (valid_index) { |
|
166 |
Address madr(as_Register(base), as_Register(index), (Address::ScaleFactor)scale, in_ByteSize(disp)); |
|
2150 | 167 |
madr._rspec = rspec; |
1 | 168 |
return madr; |
169 |
} else { |
|
170 |
Address madr(as_Register(base), noreg, Address::no_scale, in_ByteSize(disp)); |
|
2150 | 171 |
madr._rspec = rspec; |
1 | 172 |
return madr; |
173 |
} |
|
174 |
} |
|
175 |
||
176 |
// Implementation of Assembler |
|
177 |
||
178 |
int AbstractAssembler::code_fill_byte() { |
|
179 |
return (u_char)'\xF4'; // hlt |
|
180 |
} |
|
181 |
||
182 |
// make this go away someday |
|
183 |
void Assembler::emit_data(jint data, relocInfo::relocType rtype, int format) { |
|
184 |
if (rtype == relocInfo::none) |
|
185 |
emit_long(data); |
|
186 |
else emit_data(data, Relocation::spec_simple(rtype), format); |
|
187 |
} |
|
188 |
||
189 |
void Assembler::emit_data(jint data, RelocationHolder const& rspec, int format) { |
|
1066 | 190 |
assert(imm_operand == 0, "default format must be immediate in this file"); |
1 | 191 |
assert(inst_mark() != NULL, "must be inside InstructionMark"); |
192 |
if (rspec.type() != relocInfo::none) { |
|
193 |
#ifdef ASSERT |
|
194 |
check_relocation(rspec, format); |
|
195 |
#endif |
|
196 |
// Do not use AbstractAssembler::relocate, which is not intended for |
|
197 |
// embedded words. Instead, relocate to the enclosing instruction. |
|
198 |
||
199 |
// hack. call32 is too wide for mask so use disp32 |
|
200 |
if (format == call32_operand) |
|
201 |
code_section()->relocate(inst_mark(), rspec, disp32_operand); |
|
202 |
else |
|
203 |
code_section()->relocate(inst_mark(), rspec, format); |
|
204 |
} |
|
205 |
emit_long(data); |
|
206 |
} |
|
207 |
||
1066 | 208 |
static int encode(Register r) { |
209 |
int enc = r->encoding(); |
|
210 |
if (enc >= 8) { |
|
211 |
enc -= 8; |
|
212 |
} |
|
213 |
return enc; |
|
214 |
} |
|
215 |
||
216 |
static int encode(XMMRegister r) { |
|
217 |
int enc = r->encoding(); |
|
218 |
if (enc >= 8) { |
|
219 |
enc -= 8; |
|
220 |
} |
|
221 |
return enc; |
|
222 |
} |
|
1 | 223 |
|
224 |
void Assembler::emit_arith_b(int op1, int op2, Register dst, int imm8) { |
|
225 |
assert(dst->has_byte_register(), "must have byte register"); |
|
226 |
assert(isByte(op1) && isByte(op2), "wrong opcode"); |
|
227 |
assert(isByte(imm8), "not a byte"); |
|
228 |
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
|
229 |
emit_int8(op1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
230 |
emit_int8(op2 | encode(dst)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
231 |
emit_int8(imm8); |
1 | 232 |
} |
233 |
||
234 |
||
1066 | 235 |
void Assembler::emit_arith(int op1, int op2, Register dst, int32_t imm32) { |
1 | 236 |
assert(isByte(op1) && isByte(op2), "wrong opcode"); |
237 |
assert((op1 & 0x01) == 1, "should be 32bit operation"); |
|
238 |
assert((op1 & 0x02) == 0, "sign-extension bit should not be set"); |
|
239 |
if (is8bit(imm32)) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
240 |
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
|
241 |
emit_int8(op2 | encode(dst)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
242 |
emit_int8(imm32 & 0xFF); |
1 | 243 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
244 |
emit_int8(op1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
245 |
emit_int8(op2 | encode(dst)); |
1 | 246 |
emit_long(imm32); |
247 |
} |
|
248 |
} |
|
249 |
||
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
250 |
// 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
|
251 |
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
|
252 |
assert(isByte(op1) && isByte(op2), "wrong opcode"); |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
253 |
assert((op1 & 0x01) == 1, "should be 32bit operation"); |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
254 |
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
|
255 |
emit_int8(op1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
256 |
emit_int8(op2 | encode(dst)); |
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
257 |
emit_long(imm32); |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
258 |
} |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
259 |
|
1 | 260 |
// immediate-to-memory forms |
1066 | 261 |
void Assembler::emit_arith_operand(int op1, Register rm, Address adr, int32_t imm32) { |
1 | 262 |
assert((op1 & 0x01) == 1, "should be 32bit operation"); |
263 |
assert((op1 & 0x02) == 0, "sign-extension bit should not be set"); |
|
264 |
if (is8bit(imm32)) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
265 |
emit_int8(op1 | 0x02); // set sign bit |
1066 | 266 |
emit_operand(rm, adr, 1); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
267 |
emit_int8(imm32 & 0xFF); |
1 | 268 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
269 |
emit_int8(op1); |
1066 | 270 |
emit_operand(rm, adr, 4); |
1 | 271 |
emit_long(imm32); |
272 |
} |
|
273 |
} |
|
274 |
||
275 |
||
276 |
void Assembler::emit_arith(int op1, int op2, Register dst, Register src) { |
|
277 |
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
|
278 |
emit_int8(op1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
279 |
emit_int8(op2 | encode(dst) << 3 | encode(src)); |
1066 | 280 |
} |
281 |
||
282 |
||
283 |
void Assembler::emit_operand(Register reg, Register base, Register index, |
|
284 |
Address::ScaleFactor scale, int disp, |
|
285 |
RelocationHolder const& rspec, |
|
286 |
int rip_relative_correction) { |
|
1 | 287 |
relocInfo::relocType rtype = (relocInfo::relocType) rspec.type(); |
1066 | 288 |
|
289 |
// Encode the registers as needed in the fields they are used in |
|
290 |
||
291 |
int regenc = encode(reg) << 3; |
|
292 |
int indexenc = index->is_valid() ? encode(index) << 3 : 0; |
|
293 |
int baseenc = base->is_valid() ? encode(base) : 0; |
|
294 |
||
1 | 295 |
if (base->is_valid()) { |
296 |
if (index->is_valid()) { |
|
297 |
assert(scale != Address::no_scale, "inconsistent address"); |
|
298 |
// [base + index*scale + disp] |
|
1066 | 299 |
if (disp == 0 && rtype == relocInfo::none && |
300 |
base != rbp LP64_ONLY(&& base != r13)) { |
|
1 | 301 |
// [base + index*scale] |
302 |
// [00 reg 100][ss index base] |
|
303 |
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
|
304 |
emit_int8(0x04 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
305 |
emit_int8(scale << 6 | indexenc | baseenc); |
1 | 306 |
} else if (is8bit(disp) && rtype == relocInfo::none) { |
307 |
// [base + index*scale + imm8] |
|
308 |
// [01 reg 100][ss index base] imm8 |
|
309 |
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
|
310 |
emit_int8(0x44 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
311 |
emit_int8(scale << 6 | indexenc | baseenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
312 |
emit_int8(disp & 0xFF); |
1 | 313 |
} else { |
1066 | 314 |
// [base + index*scale + disp32] |
315 |
// [10 reg 100][ss index base] disp32 |
|
1 | 316 |
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
|
317 |
emit_int8(0x84 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
318 |
emit_int8(scale << 6 | indexenc | baseenc); |
1 | 319 |
emit_data(disp, rspec, disp32_operand); |
320 |
} |
|
1066 | 321 |
} else if (base == rsp LP64_ONLY(|| base == r12)) { |
322 |
// [rsp + disp] |
|
1 | 323 |
if (disp == 0 && rtype == relocInfo::none) { |
1066 | 324 |
// [rsp] |
1 | 325 |
// [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
|
326 |
emit_int8(0x04 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
327 |
emit_int8(0x24); |
1 | 328 |
} else if (is8bit(disp) && rtype == relocInfo::none) { |
1066 | 329 |
// [rsp + imm8] |
330 |
// [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
|
331 |
emit_int8(0x44 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
332 |
emit_int8(0x24); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
333 |
emit_int8(disp & 0xFF); |
1 | 334 |
} else { |
1066 | 335 |
// [rsp + imm32] |
336 |
// [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
|
337 |
emit_int8(0x84 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
338 |
emit_int8(0x24); |
1 | 339 |
emit_data(disp, rspec, disp32_operand); |
340 |
} |
|
341 |
} else { |
|
342 |
// [base + disp] |
|
1066 | 343 |
assert(base != rsp LP64_ONLY(&& base != r12), "illegal addressing mode"); |
344 |
if (disp == 0 && rtype == relocInfo::none && |
|
345 |
base != rbp LP64_ONLY(&& base != r13)) { |
|
1 | 346 |
// [base] |
347 |
// [00 reg base] |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
348 |
emit_int8(0x00 | regenc | baseenc); |
1 | 349 |
} else if (is8bit(disp) && rtype == relocInfo::none) { |
1066 | 350 |
// [base + disp8] |
351 |
// [01 reg base] disp8 |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
352 |
emit_int8(0x40 | regenc | baseenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
353 |
emit_int8(disp & 0xFF); |
1 | 354 |
} else { |
1066 | 355 |
// [base + disp32] |
356 |
// [10 reg base] disp32 |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
357 |
emit_int8(0x80 | regenc | baseenc); |
1 | 358 |
emit_data(disp, rspec, disp32_operand); |
359 |
} |
|
360 |
} |
|
361 |
} else { |
|
362 |
if (index->is_valid()) { |
|
363 |
assert(scale != Address::no_scale, "inconsistent address"); |
|
364 |
// [index*scale + disp] |
|
1066 | 365 |
// [00 reg 100][ss index 101] disp32 |
1 | 366 |
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
|
367 |
emit_int8(0x04 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
368 |
emit_int8(scale << 6 | indexenc | 0x05); |
1 | 369 |
emit_data(disp, rspec, disp32_operand); |
1066 | 370 |
} else if (rtype != relocInfo::none ) { |
371 |
// [disp] (64bit) RIP-RELATIVE (32bit) abs |
|
372 |
// [00 000 101] disp32 |
|
373 |
||
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
374 |
emit_int8(0x05 | regenc); |
1066 | 375 |
// Note that the RIP-rel. correction applies to the generated |
376 |
// disp field, but _not_ to the target address in the rspec. |
|
377 |
||
378 |
// disp was created by converting the target address minus the pc |
|
379 |
// at the start of the instruction. That needs more correction here. |
|
380 |
// intptr_t disp = target - next_ip; |
|
381 |
assert(inst_mark() != NULL, "must be inside InstructionMark"); |
|
382 |
address next_ip = pc() + sizeof(int32_t) + rip_relative_correction; |
|
383 |
int64_t adjusted = disp; |
|
384 |
// Do rip-rel adjustment for 64bit |
|
385 |
LP64_ONLY(adjusted -= (next_ip - inst_mark())); |
|
386 |
assert(is_simm32(adjusted), |
|
387 |
"must be 32bit offset (RIP relative address)"); |
|
388 |
emit_data((int32_t) adjusted, rspec, disp32_operand); |
|
389 |
||
1 | 390 |
} else { |
1066 | 391 |
// 32bit never did this, did everything as the rip-rel/disp code above |
392 |
// [disp] ABSOLUTE |
|
393 |
// [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
|
394 |
emit_int8(0x04 | regenc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
395 |
emit_int8(0x25); |
1 | 396 |
emit_data(disp, rspec, disp32_operand); |
397 |
} |
|
398 |
} |
|
399 |
} |
|
400 |
||
1066 | 401 |
void Assembler::emit_operand(XMMRegister reg, Register base, Register index, |
402 |
Address::ScaleFactor scale, int disp, |
|
403 |
RelocationHolder const& rspec) { |
|
404 |
emit_operand((Register)reg, base, index, scale, disp, rspec); |
|
405 |
} |
|
406 |
||
1 | 407 |
// Secret local extension to Assembler::WhichOperand: |
408 |
#define end_pc_operand (_WhichOperand_limit) |
|
409 |
||
410 |
address Assembler::locate_operand(address inst, WhichOperand which) { |
|
411 |
// Decode the given instruction, and return the address of |
|
412 |
// an embedded 32-bit operand word. |
|
413 |
||
414 |
// If "which" is disp32_operand, selects the displacement portion |
|
415 |
// of an effective address specifier. |
|
1066 | 416 |
// If "which" is imm64_operand, selects the trailing immediate constant. |
1 | 417 |
// If "which" is call32_operand, selects the displacement of a call or jump. |
418 |
// Caller is responsible for ensuring that there is such an operand, |
|
1066 | 419 |
// and that it is 32/64 bits wide. |
1 | 420 |
|
421 |
// If "which" is end_pc_operand, find the end of the instruction. |
|
422 |
||
423 |
address ip = inst; |
|
1066 | 424 |
bool is_64bit = false; |
425 |
||
426 |
debug_only(bool has_disp32 = false); |
|
427 |
int tail_size = 0; // other random bytes (#32, #16, etc.) at end of insn |
|
428 |
||
429 |
again_after_prefix: |
|
1 | 430 |
switch (0xFF & *ip++) { |
431 |
||
432 |
// These convenience macros generate groups of "case" labels for the switch. |
|
1066 | 433 |
#define REP4(x) (x)+0: case (x)+1: case (x)+2: case (x)+3 |
434 |
#define REP8(x) (x)+0: case (x)+1: case (x)+2: case (x)+3: \ |
|
1 | 435 |
case (x)+4: case (x)+5: case (x)+6: case (x)+7 |
1066 | 436 |
#define REP16(x) REP8((x)+0): \ |
1 | 437 |
case REP8((x)+8) |
438 |
||
439 |
case CS_segment: |
|
440 |
case SS_segment: |
|
441 |
case DS_segment: |
|
442 |
case ES_segment: |
|
443 |
case FS_segment: |
|
444 |
case GS_segment: |
|
1066 | 445 |
// Seems dubious |
446 |
LP64_ONLY(assert(false, "shouldn't have that prefix")); |
|
1 | 447 |
assert(ip == inst+1, "only one prefix allowed"); |
448 |
goto again_after_prefix; |
|
449 |
||
1066 | 450 |
case 0x67: |
451 |
case REX: |
|
452 |
case REX_B: |
|
453 |
case REX_X: |
|
454 |
case REX_XB: |
|
455 |
case REX_R: |
|
456 |
case REX_RB: |
|
457 |
case REX_RX: |
|
458 |
case REX_RXB: |
|
459 |
NOT_LP64(assert(false, "64bit prefixes")); |
|
460 |
goto again_after_prefix; |
|
461 |
||
462 |
case REX_W: |
|
463 |
case REX_WB: |
|
464 |
case REX_WX: |
|
465 |
case REX_WXB: |
|
466 |
case REX_WR: |
|
467 |
case REX_WRB: |
|
468 |
case REX_WRX: |
|
469 |
case REX_WRXB: |
|
470 |
NOT_LP64(assert(false, "64bit prefixes")); |
|
471 |
is_64bit = true; |
|
472 |
goto again_after_prefix; |
|
473 |
||
474 |
case 0xFF: // pushq a; decl a; incl a; call a; jmp a |
|
1 | 475 |
case 0x88: // movb a, r |
476 |
case 0x89: // movl a, r |
|
477 |
case 0x8A: // movb r, a |
|
478 |
case 0x8B: // movl r, a |
|
479 |
case 0x8F: // popl a |
|
1066 | 480 |
debug_only(has_disp32 = true); |
1 | 481 |
break; |
482 |
||
1066 | 483 |
case 0x68: // pushq #32 |
484 |
if (which == end_pc_operand) { |
|
485 |
return ip + 4; |
|
486 |
} |
|
487 |
assert(which == imm_operand && !is_64bit, "pushl has no disp32 or 64bit immediate"); |
|
1 | 488 |
return ip; // not produced by emit_operand |
489 |
||
490 |
case 0x66: // movw ... (size prefix) |
|
1066 | 491 |
again_after_size_prefix2: |
1 | 492 |
switch (0xFF & *ip++) { |
1066 | 493 |
case REX: |
494 |
case REX_B: |
|
495 |
case REX_X: |
|
496 |
case REX_XB: |
|
497 |
case REX_R: |
|
498 |
case REX_RB: |
|
499 |
case REX_RX: |
|
500 |
case REX_RXB: |
|
501 |
case REX_W: |
|
502 |
case REX_WB: |
|
503 |
case REX_WX: |
|
504 |
case REX_WXB: |
|
505 |
case REX_WR: |
|
506 |
case REX_WRB: |
|
507 |
case REX_WRX: |
|
508 |
case REX_WRXB: |
|
509 |
NOT_LP64(assert(false, "64bit prefix found")); |
|
510 |
goto again_after_size_prefix2; |
|
1 | 511 |
case 0x8B: // movw r, a |
512 |
case 0x89: // movw a, r |
|
1066 | 513 |
debug_only(has_disp32 = true); |
1 | 514 |
break; |
515 |
case 0xC7: // movw a, #16 |
|
1066 | 516 |
debug_only(has_disp32 = true); |
1 | 517 |
tail_size = 2; // the imm16 |
518 |
break; |
|
519 |
case 0x0F: // several SSE/SSE2 variants |
|
520 |
ip--; // reparse the 0x0F |
|
521 |
goto again_after_prefix; |
|
522 |
default: |
|
523 |
ShouldNotReachHere(); |
|
524 |
} |
|
525 |
break; |
|
526 |
||
1066 | 527 |
case REP8(0xB8): // movl/q r, #32/#64(oop?) |
528 |
if (which == end_pc_operand) return ip + (is_64bit ? 8 : 4); |
|
529 |
// these asserts are somewhat nonsensical |
|
530 |
#ifndef _LP64 |
|
12268 | 531 |
assert(which == imm_operand || which == disp32_operand, |
532 |
err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, ip)); |
|
1066 | 533 |
#else |
534 |
assert((which == call32_operand || which == imm_operand) && is_64bit || |
|
12268 | 535 |
which == narrow_oop_operand && !is_64bit, |
536 |
err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, ip)); |
|
1066 | 537 |
#endif // _LP64 |
1 | 538 |
return ip; |
539 |
||
540 |
case 0x69: // imul r, a, #32 |
|
541 |
case 0xC7: // movl a, #32(oop?) |
|
542 |
tail_size = 4; |
|
1066 | 543 |
debug_only(has_disp32 = true); // has both kinds of operands! |
1 | 544 |
break; |
545 |
||
546 |
case 0x0F: // movx..., etc. |
|
547 |
switch (0xFF & *ip++) { |
|
11427 | 548 |
case 0x3A: // pcmpestri |
549 |
tail_size = 1; |
|
550 |
case 0x38: // ptest, pmovzxbw |
|
551 |
ip++; // skip opcode |
|
552 |
debug_only(has_disp32 = true); // has both kinds of operands! |
|
553 |
break; |
|
554 |
||
555 |
case 0x70: // pshufd r, r/a, #8 |
|
556 |
debug_only(has_disp32 = true); // has both kinds of operands! |
|
557 |
case 0x73: // psrldq r, #8 |
|
558 |
tail_size = 1; |
|
559 |
break; |
|
560 |
||
1 | 561 |
case 0x12: // movlps |
562 |
case 0x28: // movaps |
|
563 |
case 0x2E: // ucomiss |
|
564 |
case 0x2F: // comiss |
|
565 |
case 0x54: // andps |
|
566 |
case 0x55: // andnps |
|
567 |
case 0x56: // orps |
|
568 |
case 0x57: // xorps |
|
569 |
case 0x6E: // movd |
|
570 |
case 0x7E: // movd |
|
11427 | 571 |
case 0xAE: // ldmxcsr, stmxcsr, fxrstor, fxsave, clflush |
1066 | 572 |
debug_only(has_disp32 = true); |
1 | 573 |
break; |
574 |
||
575 |
case 0xAD: // shrd r, a, %cl |
|
576 |
case 0xAF: // imul r, a |
|
1066 | 577 |
case 0xBE: // movsbl r, a (movsxb) |
578 |
case 0xBF: // movswl r, a (movsxw) |
|
579 |
case 0xB6: // movzbl r, a (movzxb) |
|
580 |
case 0xB7: // movzwl r, a (movzxw) |
|
1 | 581 |
case REP16(0x40): // cmovl cc, r, a |
582 |
case 0xB0: // cmpxchgb |
|
583 |
case 0xB1: // cmpxchg |
|
584 |
case 0xC1: // xaddl |
|
585 |
case 0xC7: // cmpxchg8 |
|
586 |
case REP16(0x90): // setcc a |
|
1066 | 587 |
debug_only(has_disp32 = true); |
1 | 588 |
// fall out of the switch to decode the address |
589 |
break; |
|
1066 | 590 |
|
11427 | 591 |
case 0xC4: // pinsrw r, a, #8 |
592 |
debug_only(has_disp32 = true); |
|
593 |
case 0xC5: // pextrw r, r, #8 |
|
594 |
tail_size = 1; // the imm8 |
|
595 |
break; |
|
596 |
||
1 | 597 |
case 0xAC: // shrd r, a, #8 |
1066 | 598 |
debug_only(has_disp32 = true); |
1 | 599 |
tail_size = 1; // the imm8 |
600 |
break; |
|
1066 | 601 |
|
1 | 602 |
case REP16(0x80): // jcc rdisp32 |
603 |
if (which == end_pc_operand) return ip + 4; |
|
1066 | 604 |
assert(which == call32_operand, "jcc has no disp32 or imm"); |
1 | 605 |
return ip; |
606 |
default: |
|
607 |
ShouldNotReachHere(); |
|
608 |
} |
|
609 |
break; |
|
610 |
||
611 |
case 0x81: // addl a, #32; addl r, #32 |
|
612 |
// also: orl, adcl, sbbl, andl, subl, xorl, cmpl |
|
1066 | 613 |
// on 32bit in the case of cmpl, the imm might be an oop |
1 | 614 |
tail_size = 4; |
1066 | 615 |
debug_only(has_disp32 = true); // has both kinds of operands! |
1 | 616 |
break; |
617 |
||
618 |
case 0x83: // addl a, #8; addl r, #8 |
|
619 |
// also: orl, adcl, sbbl, andl, subl, xorl, cmpl |
|
1066 | 620 |
debug_only(has_disp32 = true); // has both kinds of operands! |
1 | 621 |
tail_size = 1; |
622 |
break; |
|
623 |
||
624 |
case 0x9B: |
|
625 |
switch (0xFF & *ip++) { |
|
626 |
case 0xD9: // fnstcw a |
|
1066 | 627 |
debug_only(has_disp32 = true); |
1 | 628 |
break; |
629 |
default: |
|
630 |
ShouldNotReachHere(); |
|
631 |
} |
|
632 |
break; |
|
633 |
||
634 |
case REP4(0x00): // addb a, r; addl a, r; addb r, a; addl r, a |
|
635 |
case REP4(0x10): // adc... |
|
636 |
case REP4(0x20): // and... |
|
637 |
case REP4(0x30): // xor... |
|
638 |
case REP4(0x08): // or... |
|
639 |
case REP4(0x18): // sbb... |
|
640 |
case REP4(0x28): // sub... |
|
1066 | 641 |
case 0xF7: // mull a |
642 |
case 0x8D: // lea r, a |
|
643 |
case 0x87: // xchg r, a |
|
1 | 644 |
case REP4(0x38): // cmp... |
1066 | 645 |
case 0x85: // test r, a |
646 |
debug_only(has_disp32 = true); // has both kinds of operands! |
|
1 | 647 |
break; |
648 |
||
649 |
case 0xC1: // sal a, #8; sar a, #8; shl a, #8; shr a, #8 |
|
650 |
case 0xC6: // movb a, #8 |
|
651 |
case 0x80: // cmpb a, #8 |
|
652 |
case 0x6B: // imul r, a, #8 |
|
1066 | 653 |
debug_only(has_disp32 = true); // has both kinds of operands! |
1 | 654 |
tail_size = 1; // the imm8 |
655 |
break; |
|
656 |
||
11427 | 657 |
case 0xC4: // VEX_3bytes |
658 |
case 0xC5: // VEX_2bytes |
|
659 |
assert((UseAVX > 0), "shouldn't have VEX prefix"); |
|
660 |
assert(ip == inst+1, "no prefixes allowed"); |
|
661 |
// C4 and C5 are also used as opcodes for PINSRW and PEXTRW instructions |
|
662 |
// but they have prefix 0x0F and processed when 0x0F processed above. |
|
663 |
// |
|
664 |
// In 32-bit mode the VEX first byte C4 and C5 alias onto LDS and LES |
|
665 |
// instructions (these instructions are not supported in 64-bit mode). |
|
666 |
// To distinguish them bits [7:6] are set in the VEX second byte since |
|
667 |
// ModRM byte can not be of the form 11xxxxxx in 32-bit mode. To set |
|
668 |
// those VEX bits REX and vvvv bits are inverted. |
|
669 |
// |
|
670 |
// Fortunately C2 doesn't generate these instructions so we don't need |
|
671 |
// to check for them in product version. |
|
672 |
||
673 |
// Check second byte |
|
674 |
NOT_LP64(assert((0xC0 & *ip) == 0xC0, "shouldn't have LDS and LES instructions")); |
|
675 |
||
676 |
// First byte |
|
677 |
if ((0xFF & *inst) == VEX_3bytes) { |
|
678 |
ip++; // third byte |
|
679 |
is_64bit = ((VEX_W & *ip) == VEX_W); |
|
680 |
} |
|
681 |
ip++; // opcode |
|
682 |
// To find the end of instruction (which == end_pc_operand). |
|
683 |
switch (0xFF & *ip) { |
|
684 |
case 0x61: // pcmpestri r, r/a, #8 |
|
685 |
case 0x70: // pshufd r, r/a, #8 |
|
686 |
case 0x73: // psrldq r, #8 |
|
687 |
tail_size = 1; // the imm8 |
|
688 |
break; |
|
689 |
default: |
|
690 |
break; |
|
691 |
} |
|
692 |
ip++; // skip opcode |
|
693 |
debug_only(has_disp32 = true); // has both kinds of operands! |
|
694 |
break; |
|
1 | 695 |
|
696 |
case 0xD1: // sal a, 1; sar a, 1; shl a, 1; shr a, 1 |
|
697 |
case 0xD3: // sal a, %cl; sar a, %cl; shl a, %cl; shr a, %cl |
|
698 |
case 0xD9: // fld_s a; fst_s a; fstp_s a; fldcw a |
|
699 |
case 0xDD: // fld_d a; fst_d a; fstp_d a |
|
700 |
case 0xDB: // fild_s a; fistp_s a; fld_x a; fstp_x a |
|
701 |
case 0xDF: // fild_d a; fistp_d a |
|
702 |
case 0xD8: // fadd_s a; fsubr_s a; fmul_s a; fdivr_s a; fcomp_s a |
|
703 |
case 0xDC: // fadd_d a; fsubr_d a; fmul_d a; fdivr_d a; fcomp_d a |
|
704 |
case 0xDE: // faddp_d a; fsubrp_d a; fmulp_d a; fdivrp_d a; fcompp_d a |
|
1066 | 705 |
debug_only(has_disp32 = true); |
1 | 706 |
break; |
707 |
||
11427 | 708 |
case 0xE8: // call rdisp32 |
709 |
case 0xE9: // jmp rdisp32 |
|
710 |
if (which == end_pc_operand) return ip + 4; |
|
711 |
assert(which == call32_operand, "call has no disp32 or imm"); |
|
712 |
return ip; |
|
713 |
||
1500
bea9a90f3e8f
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
1437
diff
changeset
|
714 |
case 0xF0: // Lock |
bea9a90f3e8f
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
1437
diff
changeset
|
715 |
assert(os::is_MP(), "only on MP"); |
bea9a90f3e8f
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
1437
diff
changeset
|
716 |
goto again_after_prefix; |
bea9a90f3e8f
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
1437
diff
changeset
|
717 |
|
1 | 718 |
case 0xF3: // For SSE |
719 |
case 0xF2: // For SSE2 |
|
1066 | 720 |
switch (0xFF & *ip++) { |
721 |
case REX: |
|
722 |
case REX_B: |
|
723 |
case REX_X: |
|
724 |
case REX_XB: |
|
725 |
case REX_R: |
|
726 |
case REX_RB: |
|
727 |
case REX_RX: |
|
728 |
case REX_RXB: |
|
729 |
case REX_W: |
|
730 |
case REX_WB: |
|
731 |
case REX_WX: |
|
732 |
case REX_WXB: |
|
733 |
case REX_WR: |
|
734 |
case REX_WRB: |
|
735 |
case REX_WRX: |
|
736 |
case REX_WRXB: |
|
737 |
NOT_LP64(assert(false, "found 64bit prefix")); |
|
738 |
ip++; |
|
739 |
default: |
|
740 |
ip++; |
|
741 |
} |
|
742 |
debug_only(has_disp32 = true); // has both kinds of operands! |
|
1 | 743 |
break; |
744 |
||
745 |
default: |
|
746 |
ShouldNotReachHere(); |
|
747 |
||
1066 | 748 |
#undef REP8 |
749 |
#undef REP16 |
|
1 | 750 |
} |
751 |
||
752 |
assert(which != call32_operand, "instruction is not a call, jmp, or jcc"); |
|
1066 | 753 |
#ifdef _LP64 |
754 |
assert(which != imm_operand, "instruction is not a movq reg, imm64"); |
|
755 |
#else |
|
756 |
// assert(which != imm_operand || has_imm32, "instruction has no imm32 field"); |
|
757 |
assert(which != imm_operand || has_disp32, "instruction has no imm32 field"); |
|
758 |
#endif // LP64 |
|
759 |
assert(which != disp32_operand || has_disp32, "instruction has no disp32 field"); |
|
1 | 760 |
|
761 |
// parse the output of emit_operand |
|
762 |
int op2 = 0xFF & *ip++; |
|
763 |
int base = op2 & 0x07; |
|
764 |
int op3 = -1; |
|
765 |
const int b100 = 4; |
|
766 |
const int b101 = 5; |
|
767 |
if (base == b100 && (op2 >> 6) != 3) { |
|
768 |
op3 = 0xFF & *ip++; |
|
769 |
base = op3 & 0x07; // refetch the base |
|
770 |
} |
|
771 |
// now ip points at the disp (if any) |
|
772 |
||
773 |
switch (op2 >> 6) { |
|
774 |
case 0: |
|
775 |
// [00 reg 100][ss index base] |
|
1066 | 776 |
// [00 reg 100][00 100 esp] |
1 | 777 |
// [00 reg base] |
778 |
// [00 reg 100][ss index 101][disp32] |
|
779 |
// [00 reg 101] [disp32] |
|
780 |
||
781 |
if (base == b101) { |
|
782 |
if (which == disp32_operand) |
|
783 |
return ip; // caller wants the disp32 |
|
784 |
ip += 4; // skip the disp32 |
|
785 |
} |
|
786 |
break; |
|
787 |
||
788 |
case 1: |
|
789 |
// [01 reg 100][ss index base][disp8] |
|
1066 | 790 |
// [01 reg 100][00 100 esp][disp8] |
1 | 791 |
// [01 reg base] [disp8] |
792 |
ip += 1; // skip the disp8 |
|
793 |
break; |
|
794 |
||
795 |
case 2: |
|
796 |
// [10 reg 100][ss index base][disp32] |
|
1066 | 797 |
// [10 reg 100][00 100 esp][disp32] |
1 | 798 |
// [10 reg base] [disp32] |
799 |
if (which == disp32_operand) |
|
800 |
return ip; // caller wants the disp32 |
|
801 |
ip += 4; // skip the disp32 |
|
802 |
break; |
|
803 |
||
804 |
case 3: |
|
805 |
// [11 reg base] (not a memory addressing mode) |
|
806 |
break; |
|
807 |
} |
|
808 |
||
809 |
if (which == end_pc_operand) { |
|
810 |
return ip + tail_size; |
|
811 |
} |
|
812 |
||
1066 | 813 |
#ifdef _LP64 |
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
814 |
assert(which == narrow_oop_operand && !is_64bit, "instruction is not a movl adr, imm32"); |
1066 | 815 |
#else |
816 |
assert(which == imm_operand, "instruction has only an imm field"); |
|
817 |
#endif // LP64 |
|
1 | 818 |
return ip; |
819 |
} |
|
820 |
||
821 |
address Assembler::locate_next_instruction(address inst) { |
|
822 |
// Secretly share code with locate_operand: |
|
823 |
return locate_operand(inst, end_pc_operand); |
|
824 |
} |
|
825 |
||
826 |
||
827 |
#ifdef ASSERT |
|
828 |
void Assembler::check_relocation(RelocationHolder const& rspec, int format) { |
|
829 |
address inst = inst_mark(); |
|
830 |
assert(inst != NULL && inst < pc(), "must point to beginning of instruction"); |
|
831 |
address opnd; |
|
832 |
||
833 |
Relocation* r = rspec.reloc(); |
|
834 |
if (r->type() == relocInfo::none) { |
|
835 |
return; |
|
836 |
} else if (r->is_call() || format == call32_operand) { |
|
837 |
// assert(format == imm32_operand, "cannot specify a nonzero format"); |
|
838 |
opnd = locate_operand(inst, call32_operand); |
|
839 |
} else if (r->is_data()) { |
|
1066 | 840 |
assert(format == imm_operand || format == disp32_operand |
841 |
LP64_ONLY(|| format == narrow_oop_operand), "format ok"); |
|
1 | 842 |
opnd = locate_operand(inst, (WhichOperand)format); |
843 |
} else { |
|
1066 | 844 |
assert(format == imm_operand, "cannot specify a format"); |
1 | 845 |
return; |
846 |
} |
|
847 |
assert(opnd == pc(), "must put operand where relocs can find it"); |
|
848 |
} |
|
1066 | 849 |
#endif // ASSERT |
850 |
||
851 |
void Assembler::emit_operand32(Register reg, Address adr) { |
|
852 |
assert(reg->encoding() < 8, "no extended registers"); |
|
853 |
assert(!adr.base_needs_rex() && !adr.index_needs_rex(), "no extended registers"); |
|
854 |
emit_operand(reg, adr._base, adr._index, adr._scale, adr._disp, |
|
855 |
adr._rspec); |
|
856 |
} |
|
857 |
||
858 |
void Assembler::emit_operand(Register reg, Address adr, |
|
859 |
int rip_relative_correction) { |
|
860 |
emit_operand(reg, adr._base, adr._index, adr._scale, adr._disp, |
|
861 |
adr._rspec, |
|
862 |
rip_relative_correction); |
|
863 |
} |
|
864 |
||
865 |
void Assembler::emit_operand(XMMRegister reg, Address adr) { |
|
866 |
emit_operand(reg, adr._base, adr._index, adr._scale, adr._disp, |
|
867 |
adr._rspec); |
|
868 |
} |
|
869 |
||
870 |
// MMX operations |
|
871 |
void Assembler::emit_operand(MMXRegister reg, Address adr) { |
|
872 |
assert(!adr.base_needs_rex() && !adr.index_needs_rex(), "no extended registers"); |
|
873 |
emit_operand((Register)reg, adr._base, adr._index, adr._scale, adr._disp, adr._rspec); |
|
874 |
} |
|
875 |
||
876 |
// work around gcc (3.2.1-7a) bug |
|
877 |
void Assembler::emit_operand(Address adr, MMXRegister reg) { |
|
878 |
assert(!adr.base_needs_rex() && !adr.index_needs_rex(), "no extended registers"); |
|
879 |
emit_operand((Register)reg, adr._base, adr._index, adr._scale, adr._disp, adr._rspec); |
|
1 | 880 |
} |
881 |
||
882 |
||
883 |
void Assembler::emit_farith(int b1, int b2, int i) { |
|
884 |
assert(isByte(b1) && isByte(b2), "wrong opcode"); |
|
885 |
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
|
886 |
emit_int8(b1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
887 |
emit_int8(b2 + i); |
1 | 888 |
} |
889 |
||
890 |
||
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
891 |
// 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
|
892 |
|
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
893 |
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
|
894 |
InstructionMark im(this); |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
895 |
prefix(dst); |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
896 |
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
|
897 |
} |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
898 |
|
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
899 |
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
|
900 |
InstructionMark im(this); |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
901 |
prefix(dst, src); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
902 |
emit_int8(0x11); |
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
903 |
emit_operand(src, dst); |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
904 |
} |
1066 | 905 |
|
906 |
void Assembler::adcl(Register dst, int32_t imm32) { |
|
907 |
prefix(dst); |
|
1 | 908 |
emit_arith(0x81, 0xD0, dst, imm32); |
909 |
} |
|
910 |
||
911 |
void Assembler::adcl(Register dst, Address src) { |
|
912 |
InstructionMark im(this); |
|
1066 | 913 |
prefix(src, dst); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
914 |
emit_int8(0x13); |
1 | 915 |
emit_operand(dst, src); |
916 |
} |
|
917 |
||
918 |
void Assembler::adcl(Register dst, Register src) { |
|
1066 | 919 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
1 | 920 |
emit_arith(0x13, 0xC0, dst, src); |
921 |
} |
|
922 |
||
1066 | 923 |
void Assembler::addl(Address dst, int32_t imm32) { |
924 |
InstructionMark im(this); |
|
925 |
prefix(dst); |
|
926 |
emit_arith_operand(0x81, rax, dst, imm32); |
|
927 |
} |
|
1 | 928 |
|
929 |
void Assembler::addl(Address dst, Register src) { |
|
930 |
InstructionMark im(this); |
|
1066 | 931 |
prefix(dst, src); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
932 |
emit_int8(0x01); |
1 | 933 |
emit_operand(src, dst); |
934 |
} |
|
935 |
||
1066 | 936 |
void Assembler::addl(Register dst, int32_t imm32) { |
937 |
prefix(dst); |
|
1 | 938 |
emit_arith(0x81, 0xC0, dst, imm32); |
939 |
} |
|
940 |
||
941 |
void Assembler::addl(Register dst, Address src) { |
|
942 |
InstructionMark im(this); |
|
1066 | 943 |
prefix(src, dst); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
944 |
emit_int8(0x03); |
1 | 945 |
emit_operand(dst, src); |
946 |
} |
|
947 |
||
948 |
void Assembler::addl(Register dst, Register src) { |
|
1066 | 949 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
1 | 950 |
emit_arith(0x03, 0xC0, dst, src); |
951 |
} |
|
952 |
||
953 |
void Assembler::addr_nop_4() { |
|
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
954 |
assert(UseAddressNop, "no CPU support"); |
1 | 955 |
// 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
|
956 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
957 |
emit_int8(0x1F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
958 |
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
|
959 |
emit_int8(0); // 8-bits offset (1 byte) |
1 | 960 |
} |
961 |
||
962 |
void Assembler::addr_nop_5() { |
|
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
963 |
assert(UseAddressNop, "no CPU support"); |
1 | 964 |
// 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
|
965 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
966 |
emit_int8(0x1F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
967 |
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
|
968 |
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
|
969 |
emit_int8(0); // 8-bits offset (1 byte) |
1 | 970 |
} |
971 |
||
972 |
void Assembler::addr_nop_7() { |
|
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
973 |
assert(UseAddressNop, "no CPU support"); |
1 | 974 |
// 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
|
975 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
976 |
emit_int8(0x1F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
977 |
emit_int8((unsigned char)0x80); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
978 |
// emit_rm(cbuf, 0x2, EAX_enc, EAX_enc); |
1 | 979 |
emit_long(0); // 32-bits offset (4 bytes) |
980 |
} |
|
981 |
||
982 |
void Assembler::addr_nop_8() { |
|
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
983 |
assert(UseAddressNop, "no CPU support"); |
1 | 984 |
// 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
|
985 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
986 |
emit_int8(0x1F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
987 |
emit_int8((unsigned char)0x84); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
988 |
// 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
|
989 |
emit_int8(0x00); // emit_rm(cbuf, 0x0, EAX_enc, EAX_enc); |
1 | 990 |
emit_long(0); // 32-bits offset (4 bytes) |
991 |
} |
|
992 |
||
1066 | 993 |
void Assembler::addsd(XMMRegister dst, XMMRegister src) { |
994 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
995 |
emit_simd_arith(0x58, dst, src, VEX_SIMD_F2); |
1066 | 996 |
} |
997 |
||
998 |
void Assembler::addsd(XMMRegister dst, Address src) { |
|
999 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1000 |
emit_simd_arith(0x58, dst, src, VEX_SIMD_F2); |
1066 | 1001 |
} |
1002 |
||
1003 |
void Assembler::addss(XMMRegister dst, XMMRegister src) { |
|
1004 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1005 |
emit_simd_arith(0x58, dst, src, VEX_SIMD_F3); |
1066 | 1006 |
} |
1007 |
||
1008 |
void Assembler::addss(XMMRegister dst, Address src) { |
|
1009 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1010 |
emit_simd_arith(0x58, dst, src, VEX_SIMD_F3); |
1066 | 1011 |
} |
1012 |
||
14132 | 1013 |
void Assembler::aesdec(XMMRegister dst, Address src) { |
1014 |
assert(VM_Version::supports_aes(), ""); |
|
1015 |
InstructionMark im(this); |
|
1016 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1017 |
emit_int8((unsigned char)0xDE); |
14132 | 1018 |
emit_operand(dst, src); |
1019 |
} |
|
1020 |
||
1021 |
void Assembler::aesdec(XMMRegister dst, XMMRegister src) { |
|
1022 |
assert(VM_Version::supports_aes(), ""); |
|
1023 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1024 |
emit_int8((unsigned char)0xDE); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1025 |
emit_int8(0xC0 | encode); |
14132 | 1026 |
} |
1027 |
||
1028 |
void Assembler::aesdeclast(XMMRegister dst, Address src) { |
|
1029 |
assert(VM_Version::supports_aes(), ""); |
|
1030 |
InstructionMark im(this); |
|
1031 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1032 |
emit_int8((unsigned char)0xDF); |
14132 | 1033 |
emit_operand(dst, src); |
1034 |
} |
|
1035 |
||
1036 |
void Assembler::aesdeclast(XMMRegister dst, XMMRegister src) { |
|
1037 |
assert(VM_Version::supports_aes(), ""); |
|
1038 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1039 |
emit_int8((unsigned char)0xDF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1040 |
emit_int8((unsigned char)(0xC0 | encode)); |
14132 | 1041 |
} |
1042 |
||
1043 |
void Assembler::aesenc(XMMRegister dst, Address src) { |
|
1044 |
assert(VM_Version::supports_aes(), ""); |
|
1045 |
InstructionMark im(this); |
|
1046 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1047 |
emit_int8((unsigned char)0xDC); |
14132 | 1048 |
emit_operand(dst, src); |
1049 |
} |
|
1050 |
||
1051 |
void Assembler::aesenc(XMMRegister dst, XMMRegister src) { |
|
1052 |
assert(VM_Version::supports_aes(), ""); |
|
1053 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1054 |
emit_int8((unsigned char)0xDC); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1055 |
emit_int8(0xC0 | encode); |
14132 | 1056 |
} |
1057 |
||
1058 |
void Assembler::aesenclast(XMMRegister dst, Address src) { |
|
1059 |
assert(VM_Version::supports_aes(), ""); |
|
1060 |
InstructionMark im(this); |
|
1061 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1062 |
emit_int8((unsigned char)0xDD); |
14132 | 1063 |
emit_operand(dst, src); |
1064 |
} |
|
1065 |
||
1066 |
void Assembler::aesenclast(XMMRegister dst, XMMRegister src) { |
|
1067 |
assert(VM_Version::supports_aes(), ""); |
|
1068 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1069 |
emit_int8((unsigned char)0xDD); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1070 |
emit_int8((unsigned char)(0xC0 | encode)); |
14132 | 1071 |
} |
1072 |
||
1073 |
||
11427 | 1074 |
void Assembler::andl(Address dst, int32_t imm32) { |
1075 |
InstructionMark im(this); |
|
1076 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1077 |
emit_int8((unsigned char)0x81); |
11427 | 1078 |
emit_operand(rsp, dst, 4); |
1079 |
emit_long(imm32); |
|
1080 |
} |
|
1081 |
||
1066 | 1082 |
void Assembler::andl(Register dst, int32_t imm32) { |
1083 |
prefix(dst); |
|
1084 |
emit_arith(0x81, 0xE0, dst, imm32); |
|
1085 |
} |
|
1086 |
||
1087 |
void Assembler::andl(Register dst, Address src) { |
|
1088 |
InstructionMark im(this); |
|
1089 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1090 |
emit_int8(0x23); |
1066 | 1091 |
emit_operand(dst, src); |
1092 |
} |
|
1093 |
||
1094 |
void Assembler::andl(Register dst, Register src) { |
|
1095 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
|
1096 |
emit_arith(0x23, 0xC0, dst, src); |
|
1097 |
} |
|
1098 |
||
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1099 |
void Assembler::bsfl(Register dst, Register src) { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1100 |
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
|
1101 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1102 |
emit_int8((unsigned char)0xBC); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1103 |
emit_int8((unsigned char)(0xC0 | encode)); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1104 |
} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1105 |
|
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1106 |
void Assembler::bsrl(Register dst, Register src) { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1107 |
assert(!VM_Version::supports_lzcnt(), "encoding is treated as LZCNT"); |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1108 |
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
|
1109 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1110 |
emit_int8((unsigned char)0xBD); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1111 |
emit_int8((unsigned char)(0xC0 | encode)); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1112 |
} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1113 |
|
1066 | 1114 |
void Assembler::bswapl(Register reg) { // bswap |
1115 |
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
|
1116 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1117 |
emit_int8((unsigned char)(0xC8 | encode)); |
1066 | 1118 |
} |
1119 |
||
1120 |
void Assembler::call(Label& L, relocInfo::relocType rtype) { |
|
1121 |
// suspect disp32 is always good |
|
1122 |
int operand = LP64_ONLY(disp32_operand) NOT_LP64(imm_operand); |
|
1123 |
||
1124 |
if (L.is_bound()) { |
|
1125 |
const int long_size = 5; |
|
1126 |
int offs = (int)( target(L) - pc() ); |
|
1127 |
assert(offs <= 0, "assembler error"); |
|
1128 |
InstructionMark im(this); |
|
1129 |
// 1110 1000 #32-bit disp |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1130 |
emit_int8((unsigned char)0xE8); |
1066 | 1131 |
emit_data(offs - long_size, rtype, operand); |
1132 |
} else { |
|
1133 |
InstructionMark im(this); |
|
1134 |
// 1110 1000 #32-bit disp |
|
1135 |
L.add_patch_at(code(), locator()); |
|
1136 |
||
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1137 |
emit_int8((unsigned char)0xE8); |
1066 | 1138 |
emit_data(int(0), rtype, operand); |
1139 |
} |
|
1140 |
} |
|
1141 |
||
1142 |
void Assembler::call(Register dst) { |
|
11427 | 1143 |
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
|
1144 |
emit_int8((unsigned char)0xFF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1145 |
emit_int8((unsigned char)(0xD0 | encode)); |
1066 | 1146 |
} |
1147 |
||
1148 |
||
1149 |
void Assembler::call(Address adr) { |
|
1150 |
InstructionMark im(this); |
|
1151 |
prefix(adr); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1152 |
emit_int8((unsigned char)0xFF); |
1066 | 1153 |
emit_operand(rdx, adr); |
1154 |
} |
|
1155 |
||
1156 |
void Assembler::call_literal(address entry, RelocationHolder const& rspec) { |
|
1157 |
assert(entry != NULL, "call most probably wrong"); |
|
1158 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1159 |
emit_int8((unsigned char)0xE8); |
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
1160 |
intptr_t disp = entry - (pc() + sizeof(int32_t)); |
1066 | 1161 |
assert(is_simm32(disp), "must be 32bit offset (call2)"); |
1162 |
// Technically, should use call32_operand, but this format is |
|
1163 |
// implied by the fact that we're emitting a call instruction. |
|
1164 |
||
1165 |
int operand = LP64_ONLY(disp32_operand) NOT_LP64(call32_operand); |
|
1166 |
emit_data((int) disp, rspec, operand); |
|
1167 |
} |
|
1168 |
||
1169 |
void Assembler::cdql() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1170 |
emit_int8((unsigned char)0x99); |
1066 | 1171 |
} |
1172 |
||
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1173 |
void Assembler::cld() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1174 |
emit_int8((unsigned char)0xFC); |
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1175 |
} |
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1176 |
|
1066 | 1177 |
void Assembler::cmovl(Condition cc, Register dst, Register src) { |
1178 |
NOT_LP64(guarantee(VM_Version::supports_cmov(), "illegal instruction")); |
|
1179 |
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
|
1180 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1181 |
emit_int8(0x40 | cc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1182 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1183 |
} |
1184 |
||
1185 |
||
1186 |
void Assembler::cmovl(Condition cc, Register dst, Address src) { |
|
1187 |
NOT_LP64(guarantee(VM_Version::supports_cmov(), "illegal instruction")); |
|
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(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1190 |
emit_int8(0x40 | cc); |
1066 | 1191 |
emit_operand(dst, src); |
1192 |
} |
|
1193 |
||
1194 |
void Assembler::cmpb(Address dst, int imm8) { |
|
1195 |
InstructionMark im(this); |
|
1196 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1197 |
emit_int8((unsigned char)0x80); |
1066 | 1198 |
emit_operand(rdi, dst, 1); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1199 |
emit_int8(imm8); |
1066 | 1200 |
} |
1201 |
||
1202 |
void Assembler::cmpl(Address dst, int32_t imm32) { |
|
1203 |
InstructionMark im(this); |
|
1204 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1205 |
emit_int8((unsigned char)0x81); |
1066 | 1206 |
emit_operand(rdi, dst, 4); |
1207 |
emit_long(imm32); |
|
1208 |
} |
|
1209 |
||
1210 |
void Assembler::cmpl(Register dst, int32_t imm32) { |
|
1211 |
prefix(dst); |
|
1212 |
emit_arith(0x81, 0xF8, dst, imm32); |
|
1213 |
} |
|
1214 |
||
1215 |
void Assembler::cmpl(Register dst, Register src) { |
|
1216 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
|
1217 |
emit_arith(0x3B, 0xC0, dst, src); |
|
1218 |
} |
|
1219 |
||
1220 |
||
1221 |
void Assembler::cmpl(Register dst, Address src) { |
|
1222 |
InstructionMark im(this); |
|
1223 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1224 |
emit_int8((unsigned char)0x3B); |
1066 | 1225 |
emit_operand(dst, src); |
1226 |
} |
|
1227 |
||
1228 |
void Assembler::cmpw(Address dst, int imm16) { |
|
1229 |
InstructionMark im(this); |
|
1230 |
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
|
1231 |
emit_int8(0x66); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1232 |
emit_int8((unsigned char)0x81); |
1066 | 1233 |
emit_operand(rdi, dst, 2); |
14831
84828ee2a91c
8004536: replace AbstractAssembler emit_word with emit_int16
twisti
parents:
14626
diff
changeset
|
1234 |
emit_int16(imm16); |
1066 | 1235 |
} |
1236 |
||
1237 |
// The 32-bit cmpxchg compares the value at adr with the contents of rax, |
|
1238 |
// and stores reg into adr if so; otherwise, the value at adr is loaded into rax,. |
|
1239 |
// The ZF is set if the compared values were equal, and cleared otherwise. |
|
1240 |
void Assembler::cmpxchgl(Register reg, Address adr) { // cmpxchg |
|
13955 | 1241 |
InstructionMark im(this); |
1242 |
prefix(adr, reg); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1243 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1244 |
emit_int8((unsigned char)0xB1); |
13955 | 1245 |
emit_operand(reg, adr); |
1066 | 1246 |
} |
1247 |
||
1248 |
void Assembler::comisd(XMMRegister dst, Address src) { |
|
1249 |
// NOTE: dbx seems to decode this as comiss even though the |
|
1250 |
// 0x66 is there. Strangly ucomisd comes out correct |
|
1251 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1252 |
emit_simd_arith_nonds(0x2F, dst, src, VEX_SIMD_66); |
11427 | 1253 |
} |
1254 |
||
1255 |
void Assembler::comisd(XMMRegister dst, XMMRegister src) { |
|
1256 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1257 |
emit_simd_arith_nonds(0x2F, dst, src, VEX_SIMD_66); |
1066 | 1258 |
} |
1259 |
||
1260 |
void Assembler::comiss(XMMRegister dst, Address src) { |
|
1261 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1262 |
emit_simd_arith_nonds(0x2F, dst, src, VEX_SIMD_NONE); |
1066 | 1263 |
} |
1264 |
||
11427 | 1265 |
void Assembler::comiss(XMMRegister dst, XMMRegister src) { |
1266 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1267 |
emit_simd_arith_nonds(0x2F, dst, src, VEX_SIMD_NONE); |
11427 | 1268 |
} |
1269 |
||
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1270 |
void Assembler::cpuid() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1271 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1272 |
emit_int8((unsigned char)0xA2); |
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1273 |
} |
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1274 |
|
1066 | 1275 |
void Assembler::cvtdq2pd(XMMRegister dst, XMMRegister src) { |
1276 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1277 |
emit_simd_arith_nonds(0xE6, dst, src, VEX_SIMD_F3); |
1066 | 1278 |
} |
1279 |
||
1280 |
void Assembler::cvtdq2ps(XMMRegister dst, XMMRegister src) { |
|
1281 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1282 |
emit_simd_arith_nonds(0x5B, dst, src, VEX_SIMD_NONE); |
1066 | 1283 |
} |
1284 |
||
1285 |
void Assembler::cvtsd2ss(XMMRegister dst, XMMRegister src) { |
|
1286 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1287 |
emit_simd_arith(0x5A, dst, src, VEX_SIMD_F2); |
1066 | 1288 |
} |
1289 |
||
11427 | 1290 |
void Assembler::cvtsd2ss(XMMRegister dst, Address src) { |
1291 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1292 |
emit_simd_arith(0x5A, dst, src, VEX_SIMD_F2); |
11427 | 1293 |
} |
1294 |
||
1066 | 1295 |
void Assembler::cvtsi2sdl(XMMRegister dst, Register src) { |
1296 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
11427 | 1297 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F2); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1298 |
emit_int8(0x2A); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1299 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1300 |
} |
1301 |
||
11427 | 1302 |
void Assembler::cvtsi2sdl(XMMRegister dst, Address src) { |
1303 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1304 |
emit_simd_arith(0x2A, dst, src, VEX_SIMD_F2); |
11427 | 1305 |
} |
1306 |
||
1066 | 1307 |
void Assembler::cvtsi2ssl(XMMRegister dst, Register src) { |
1308 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
11427 | 1309 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F3); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1310 |
emit_int8(0x2A); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1311 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1312 |
} |
1313 |
||
11427 | 1314 |
void Assembler::cvtsi2ssl(XMMRegister dst, Address src) { |
1315 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1316 |
emit_simd_arith(0x2A, dst, src, VEX_SIMD_F3); |
11427 | 1317 |
} |
1318 |
||
1066 | 1319 |
void Assembler::cvtss2sd(XMMRegister dst, XMMRegister src) { |
1320 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1321 |
emit_simd_arith(0x5A, dst, src, VEX_SIMD_F3); |
1066 | 1322 |
} |
1323 |
||
11427 | 1324 |
void Assembler::cvtss2sd(XMMRegister dst, Address src) { |
1325 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1326 |
emit_simd_arith(0x5A, dst, src, VEX_SIMD_F3); |
11427 | 1327 |
} |
1328 |
||
1329 |
||
1066 | 1330 |
void Assembler::cvttsd2sil(Register dst, XMMRegister src) { |
1331 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
11427 | 1332 |
int encode = simd_prefix_and_encode(dst, src, VEX_SIMD_F2); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1333 |
emit_int8(0x2C); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1334 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1335 |
} |
1336 |
||
1337 |
void Assembler::cvttss2sil(Register dst, XMMRegister src) { |
|
1338 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
11427 | 1339 |
int encode = simd_prefix_and_encode(dst, src, VEX_SIMD_F3); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1340 |
emit_int8(0x2C); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1341 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1342 |
} |
1343 |
||
1344 |
void Assembler::decl(Address dst) { |
|
1345 |
// Don't use it directly. Use MacroAssembler::decrement() instead. |
|
1346 |
InstructionMark im(this); |
|
1347 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1348 |
emit_int8((unsigned char)0xFF); |
1066 | 1349 |
emit_operand(rcx, dst); |
1350 |
} |
|
1351 |
||
1352 |
void Assembler::divsd(XMMRegister dst, Address src) { |
|
1353 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1354 |
emit_simd_arith(0x5E, dst, src, VEX_SIMD_F2); |
1066 | 1355 |
} |
1356 |
||
1357 |
void Assembler::divsd(XMMRegister dst, XMMRegister src) { |
|
1358 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1359 |
emit_simd_arith(0x5E, dst, src, VEX_SIMD_F2); |
1066 | 1360 |
} |
1361 |
||
1362 |
void Assembler::divss(XMMRegister dst, Address src) { |
|
1363 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1364 |
emit_simd_arith(0x5E, dst, src, VEX_SIMD_F3); |
1066 | 1365 |
} |
1366 |
||
1367 |
void Assembler::divss(XMMRegister dst, XMMRegister src) { |
|
1368 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1369 |
emit_simd_arith(0x5E, dst, src, VEX_SIMD_F3); |
1066 | 1370 |
} |
1371 |
||
1372 |
void Assembler::emms() { |
|
1373 |
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
|
1374 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1375 |
emit_int8(0x77); |
1066 | 1376 |
} |
1377 |
||
1378 |
void Assembler::hlt() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1379 |
emit_int8((unsigned char)0xF4); |
1066 | 1380 |
} |
1381 |
||
1382 |
void Assembler::idivl(Register src) { |
|
1383 |
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
|
1384 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1385 |
emit_int8((unsigned char)(0xF8 | encode)); |
1066 | 1386 |
} |
1387 |
||
7121 | 1388 |
void Assembler::divl(Register src) { // Unsigned |
1389 |
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
|
1390 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1391 |
emit_int8((unsigned char)(0xF0 | encode)); |
7121 | 1392 |
} |
1393 |
||
1066 | 1394 |
void Assembler::imull(Register dst, Register src) { |
1395 |
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
|
1396 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1397 |
emit_int8((unsigned char)0xAF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1398 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1399 |
} |
1400 |
||
1401 |
||
1402 |
void Assembler::imull(Register dst, Register src, int value) { |
|
1403 |
int encode = prefix_and_encode(dst->encoding(), src->encoding()); |
|
1404 |
if (is8bit(value)) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1405 |
emit_int8(0x6B); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1406 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1407 |
emit_int8(value & 0xFF); |
1066 | 1408 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1409 |
emit_int8(0x69); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1410 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1411 |
emit_long(value); |
1412 |
} |
|
1413 |
} |
|
1414 |
||
1415 |
void Assembler::incl(Address dst) { |
|
1416 |
// Don't use it directly. Use MacroAssembler::increment() instead. |
|
1417 |
InstructionMark im(this); |
|
1418 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1419 |
emit_int8((unsigned char)0xFF); |
1066 | 1420 |
emit_operand(rax, dst); |
1421 |
} |
|
1422 |
||
10264 | 1423 |
void Assembler::jcc(Condition cc, Label& L, bool maybe_short) { |
1424 |
InstructionMark im(this); |
|
1066 | 1425 |
assert((0 <= cc) && (cc < 16), "illegal cc"); |
1426 |
if (L.is_bound()) { |
|
1427 |
address dst = target(L); |
|
1428 |
assert(dst != NULL, "jcc most probably wrong"); |
|
1429 |
||
1430 |
const int short_size = 2; |
|
1431 |
const int long_size = 6; |
|
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
1432 |
intptr_t offs = (intptr_t)dst - (intptr_t)pc(); |
10264 | 1433 |
if (maybe_short && is8bit(offs - short_size)) { |
1066 | 1434 |
// 0111 tttn #8-bit disp |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1435 |
emit_int8(0x70 | cc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1436 |
emit_int8((offs - short_size) & 0xFF); |
1066 | 1437 |
} else { |
1438 |
// 0000 1111 1000 tttn #32-bit disp |
|
1439 |
assert(is_simm32(offs - long_size), |
|
1440 |
"must be 32bit offset (call4)"); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1441 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1442 |
emit_int8((unsigned char)(0x80 | cc)); |
1066 | 1443 |
emit_long(offs - long_size); |
1444 |
} |
|
1445 |
} else { |
|
1446 |
// Note: could eliminate cond. jumps to this jump if condition |
|
1447 |
// is the same however, seems to be rather unlikely case. |
|
1448 |
// Note: use jccb() if label to be bound is very close to get |
|
1449 |
// an 8-bit displacement |
|
1450 |
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
|
1451 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1452 |
emit_int8((unsigned char)(0x80 | cc)); |
1066 | 1453 |
emit_long(0); |
1454 |
} |
|
1455 |
} |
|
1456 |
||
1457 |
void Assembler::jccb(Condition cc, Label& L) { |
|
1458 |
if (L.is_bound()) { |
|
1459 |
const int short_size = 2; |
|
1460 |
address entry = target(L); |
|
11434
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
1461 |
#ifdef ASSERT |
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
1462 |
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
|
1463 |
intptr_t delta = short_branch_delta(); |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
1464 |
if (delta != 0) { |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
1465 |
dist += (dist < 0 ? (-delta) :delta); |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
1466 |
} |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
1467 |
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
|
1468 |
#endif |
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
1469 |
intptr_t offs = (intptr_t)entry - (intptr_t)pc(); |
1066 | 1470 |
// 0111 tttn #8-bit disp |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1471 |
emit_int8(0x70 | cc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1472 |
emit_int8((offs - short_size) & 0xFF); |
1066 | 1473 |
} else { |
1474 |
InstructionMark im(this); |
|
1475 |
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
|
1476 |
emit_int8(0x70 | cc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1477 |
emit_int8(0); |
1066 | 1478 |
} |
1479 |
} |
|
1480 |
||
1481 |
void Assembler::jmp(Address adr) { |
|
1482 |
InstructionMark im(this); |
|
1483 |
prefix(adr); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1484 |
emit_int8((unsigned char)0xFF); |
1066 | 1485 |
emit_operand(rsp, adr); |
1486 |
} |
|
1487 |
||
10264 | 1488 |
void Assembler::jmp(Label& L, bool maybe_short) { |
1066 | 1489 |
if (L.is_bound()) { |
1490 |
address entry = target(L); |
|
1491 |
assert(entry != NULL, "jmp most probably wrong"); |
|
1492 |
InstructionMark im(this); |
|
1493 |
const int short_size = 2; |
|
1494 |
const int long_size = 5; |
|
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
1495 |
intptr_t offs = entry - pc(); |
10264 | 1496 |
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
|
1497 |
emit_int8((unsigned char)0xEB); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1498 |
emit_int8((offs - short_size) & 0xFF); |
1066 | 1499 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1500 |
emit_int8((unsigned char)0xE9); |
1066 | 1501 |
emit_long(offs - long_size); |
1502 |
} |
|
1503 |
} else { |
|
1504 |
// By default, forward jumps are always 32-bit displacements, since |
|
1505 |
// we can't yet know where the label will be bound. If you're sure that |
|
1506 |
// the forward jump will not run beyond 256 bytes, use jmpb to |
|
1507 |
// force an 8-bit displacement. |
|
1508 |
InstructionMark im(this); |
|
1509 |
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
|
1510 |
emit_int8((unsigned char)0xE9); |
1066 | 1511 |
emit_long(0); |
1512 |
} |
|
1513 |
} |
|
1514 |
||
1515 |
void Assembler::jmp(Register entry) { |
|
1516 |
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
|
1517 |
emit_int8((unsigned char)0xFF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1518 |
emit_int8((unsigned char)(0xE0 | encode)); |
1066 | 1519 |
} |
1520 |
||
1521 |
void Assembler::jmp_literal(address dest, RelocationHolder const& rspec) { |
|
1522 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1523 |
emit_int8((unsigned char)0xE9); |
1066 | 1524 |
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
|
1525 |
intptr_t disp = dest - (pc() + sizeof(int32_t)); |
1066 | 1526 |
assert(is_simm32(disp), "must be 32bit offset (jmp)"); |
1527 |
emit_data(disp, rspec.reloc(), call32_operand); |
|
1528 |
} |
|
1529 |
||
1530 |
void Assembler::jmpb(Label& L) { |
|
1531 |
if (L.is_bound()) { |
|
1532 |
const int short_size = 2; |
|
1533 |
address entry = target(L); |
|
1534 |
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
|
1535 |
#ifdef ASSERT |
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
1536 |
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
|
1537 |
intptr_t delta = short_branch_delta(); |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
1538 |
if (delta != 0) { |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
1539 |
dist += (dist < 0 ? (-delta) :delta); |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
1540 |
} |
c50976508b6b
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
11430
diff
changeset
|
1541 |
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
|
1542 |
#endif |
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
1543 |
intptr_t offs = entry - pc(); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1544 |
emit_int8((unsigned char)0xEB); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1545 |
emit_int8((offs - short_size) & 0xFF); |
1066 | 1546 |
} else { |
1547 |
InstructionMark im(this); |
|
1548 |
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
|
1549 |
emit_int8((unsigned char)0xEB); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1550 |
emit_int8(0); |
1066 | 1551 |
} |
1552 |
} |
|
1553 |
||
1554 |
void Assembler::ldmxcsr( Address src) { |
|
1555 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
1556 |
InstructionMark im(this); |
|
1557 |
prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1558 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1559 |
emit_int8((unsigned char)0xAE); |
1066 | 1560 |
emit_operand(as_Register(2), src); |
1561 |
} |
|
1562 |
||
1563 |
void Assembler::leal(Register dst, Address src) { |
|
1564 |
InstructionMark im(this); |
|
1565 |
#ifdef _LP64 |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1566 |
emit_int8(0x67); // addr32 |
1066 | 1567 |
prefix(src, dst); |
1568 |
#endif // LP64 |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1569 |
emit_int8((unsigned char)0x8D); |
1066 | 1570 |
emit_operand(dst, src); |
1571 |
} |
|
1572 |
||
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1573 |
void Assembler::lfence() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1574 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1575 |
emit_int8((unsigned char)0xAE); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1576 |
emit_int8((unsigned char)0xE8); |
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1577 |
} |
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
1578 |
|
1066 | 1579 |
void Assembler::lock() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1580 |
emit_int8((unsigned char)0xF0); |
1066 | 1581 |
} |
1582 |
||
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1583 |
void Assembler::lzcntl(Register dst, Register src) { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1584 |
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
|
1585 |
emit_int8((unsigned char)0xF3); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1586 |
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
|
1587 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1588 |
emit_int8((unsigned char)0xBD); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1589 |
emit_int8((unsigned char)(0xC0 | encode)); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1590 |
} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
1591 |
|
2338
a8660a1b709b
6822204: volatile fences should prefer lock:addl to actual mfence instructions
never
parents:
2332
diff
changeset
|
1592 |
// Emit mfence instruction |
1066 | 1593 |
void Assembler::mfence() { |
2338
a8660a1b709b
6822204: volatile fences should prefer lock:addl to actual mfence instructions
never
parents:
2332
diff
changeset
|
1594 |
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
|
1595 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1596 |
emit_int8((unsigned char)0xAE); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1597 |
emit_int8((unsigned char)0xF0); |
1066 | 1598 |
} |
1599 |
||
1600 |
void Assembler::mov(Register dst, Register src) { |
|
1601 |
LP64_ONLY(movq(dst, src)) NOT_LP64(movl(dst, src)); |
|
1602 |
} |
|
1603 |
||
1604 |
void Assembler::movapd(XMMRegister dst, XMMRegister src) { |
|
1605 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1606 |
emit_simd_arith_nonds(0x28, dst, src, VEX_SIMD_66); |
1066 | 1607 |
} |
1608 |
||
1609 |
void Assembler::movaps(XMMRegister dst, XMMRegister src) { |
|
1610 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1611 |
emit_simd_arith_nonds(0x28, dst, src, VEX_SIMD_NONE); |
1066 | 1612 |
} |
1613 |
||
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1614 |
void Assembler::movlhps(XMMRegister dst, XMMRegister src) { |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1615 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1616 |
int encode = simd_prefix_and_encode(dst, src, src, VEX_SIMD_NONE); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1617 |
emit_int8(0x16); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1618 |
emit_int8((unsigned char)(0xC0 | encode)); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1619 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1620 |
|
1066 | 1621 |
void Assembler::movb(Register dst, Address src) { |
1622 |
NOT_LP64(assert(dst->has_byte_register(), "must have byte register")); |
|
1623 |
InstructionMark im(this); |
|
1624 |
prefix(src, dst, true); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1625 |
emit_int8((unsigned char)0x8A); |
1066 | 1626 |
emit_operand(dst, src); |
1627 |
} |
|
1628 |
||
1629 |
||
1630 |
void Assembler::movb(Address dst, int imm8) { |
|
1631 |
InstructionMark im(this); |
|
1632 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1633 |
emit_int8((unsigned char)0xC6); |
1066 | 1634 |
emit_operand(rax, dst, 1); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1635 |
emit_int8(imm8); |
1066 | 1636 |
} |
1637 |
||
1638 |
||
1639 |
void Assembler::movb(Address dst, Register src) { |
|
1640 |
assert(src->has_byte_register(), "must have byte register"); |
|
1641 |
InstructionMark im(this); |
|
1642 |
prefix(dst, src, true); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1643 |
emit_int8((unsigned char)0x88); |
1066 | 1644 |
emit_operand(src, dst); |
1645 |
} |
|
1646 |
||
1647 |
void Assembler::movdl(XMMRegister dst, Register src) { |
|
1648 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
11427 | 1649 |
int encode = simd_prefix_and_encode(dst, src, VEX_SIMD_66); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1650 |
emit_int8(0x6E); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1651 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1652 |
} |
1653 |
||
1654 |
void Assembler::movdl(Register dst, XMMRegister src) { |
|
1655 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
1656 |
// swap src/dst to get correct prefix |
|
11427 | 1657 |
int encode = simd_prefix_and_encode(src, dst, VEX_SIMD_66); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1658 |
emit_int8(0x7E); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1659 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1660 |
} |
1661 |
||
8494
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
1662 |
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
|
1663 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
1664 |
InstructionMark im(this); |
11427 | 1665 |
simd_prefix(dst, src, VEX_SIMD_66); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1666 |
emit_int8(0x6E); |
8494
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
1667 |
emit_operand(dst, src); |
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
1668 |
} |
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
1669 |
|
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1670 |
void Assembler::movdl(Address dst, XMMRegister src) { |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1671 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1672 |
InstructionMark im(this); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1673 |
simd_prefix(dst, src, VEX_SIMD_66); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1674 |
emit_int8(0x7E); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1675 |
emit_operand(src, dst); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1676 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1677 |
|
1066 | 1678 |
void Assembler::movdqa(XMMRegister dst, XMMRegister src) { |
1679 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1680 |
emit_simd_arith_nonds(0x6F, dst, src, VEX_SIMD_66); |
1066 | 1681 |
} |
1682 |
||
1437 | 1683 |
void Assembler::movdqu(XMMRegister dst, Address src) { |
1684 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1685 |
emit_simd_arith_nonds(0x6F, dst, src, VEX_SIMD_F3); |
1437 | 1686 |
} |
1687 |
||
1688 |
void Assembler::movdqu(XMMRegister dst, XMMRegister src) { |
|
1689 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1690 |
emit_simd_arith_nonds(0x6F, dst, src, VEX_SIMD_F3); |
1437 | 1691 |
} |
1692 |
||
1693 |
void Assembler::movdqu(Address dst, XMMRegister src) { |
|
1694 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
1695 |
InstructionMark im(this); |
|
11427 | 1696 |
simd_prefix(dst, src, VEX_SIMD_F3); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1697 |
emit_int8(0x7F); |
1437 | 1698 |
emit_operand(src, dst); |
1699 |
} |
|
1700 |
||
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1701 |
// Move Unaligned 256bit Vector |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1702 |
void Assembler::vmovdqu(XMMRegister dst, XMMRegister src) { |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1703 |
assert(UseAVX, ""); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1704 |
bool vector256 = true; |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1705 |
int encode = vex_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_F3, vector256); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1706 |
emit_int8(0x6F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1707 |
emit_int8((unsigned char)(0xC0 | encode)); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1708 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1709 |
|
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1710 |
void Assembler::vmovdqu(XMMRegister dst, Address src) { |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1711 |
assert(UseAVX, ""); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1712 |
InstructionMark im(this); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1713 |
bool vector256 = true; |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1714 |
vex_prefix(dst, xnoreg, src, VEX_SIMD_F3, vector256); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1715 |
emit_int8(0x6F); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1716 |
emit_operand(dst, src); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1717 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1718 |
|
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1719 |
void Assembler::vmovdqu(Address dst, XMMRegister src) { |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1720 |
assert(UseAVX, ""); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1721 |
InstructionMark im(this); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1722 |
bool vector256 = true; |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1723 |
// swap src<->dst for encoding |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1724 |
assert(src != xnoreg, "sanity"); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1725 |
vex_prefix(src, xnoreg, dst, VEX_SIMD_F3, vector256); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1726 |
emit_int8(0x7F); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1727 |
emit_operand(src, dst); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1728 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
1729 |
|
1066 | 1730 |
// Uses zero extension on 64bit |
1731 |
||
1732 |
void Assembler::movl(Register dst, int32_t imm32) { |
|
1733 |
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
|
1734 |
emit_int8((unsigned char)(0xB8 | encode)); |
1066 | 1735 |
emit_long(imm32); |
1736 |
} |
|
1737 |
||
1738 |
void Assembler::movl(Register dst, Register src) { |
|
1739 |
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
|
1740 |
emit_int8((unsigned char)0x8B); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1741 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1742 |
} |
1743 |
||
1744 |
void Assembler::movl(Register dst, Address src) { |
|
1745 |
InstructionMark im(this); |
|
1746 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1747 |
emit_int8((unsigned char)0x8B); |
1066 | 1748 |
emit_operand(dst, src); |
1749 |
} |
|
1750 |
||
1751 |
void Assembler::movl(Address dst, int32_t imm32) { |
|
1752 |
InstructionMark im(this); |
|
1753 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1754 |
emit_int8((unsigned char)0xC7); |
1066 | 1755 |
emit_operand(rax, dst, 4); |
1756 |
emit_long(imm32); |
|
1757 |
} |
|
1758 |
||
1759 |
void Assembler::movl(Address dst, Register src) { |
|
1760 |
InstructionMark im(this); |
|
1761 |
prefix(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1762 |
emit_int8((unsigned char)0x89); |
1066 | 1763 |
emit_operand(src, dst); |
1764 |
} |
|
1765 |
||
1766 |
// New cpus require to use movsd and movss to avoid partial register stall |
|
1767 |
// when loading from memory. But for old Opteron use movlpd instead of movsd. |
|
1768 |
// The selection is done in MacroAssembler::movdbl() and movflt(). |
|
1769 |
void Assembler::movlpd(XMMRegister dst, Address src) { |
|
1770 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1771 |
emit_simd_arith(0x12, dst, src, VEX_SIMD_66); |
1066 | 1772 |
} |
1773 |
||
1774 |
void Assembler::movq( MMXRegister dst, Address src ) { |
|
1775 |
assert( VM_Version::supports_mmx(), "" ); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1776 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1777 |
emit_int8(0x6F); |
1066 | 1778 |
emit_operand(dst, src); |
1779 |
} |
|
1780 |
||
1781 |
void Assembler::movq( Address dst, MMXRegister src ) { |
|
1782 |
assert( VM_Version::supports_mmx(), "" ); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1783 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1784 |
emit_int8(0x7F); |
1066 | 1785 |
// workaround gcc (3.2.1-7a) bug |
1786 |
// In that version of gcc with only an emit_operand(MMX, Address) |
|
1787 |
// gcc will tail jump and try and reverse the parameters completely |
|
1788 |
// obliterating dst in the process. By having a version available |
|
1789 |
// that doesn't need to swap the args at the tail jump the bug is |
|
1790 |
// avoided. |
|
1791 |
emit_operand(dst, src); |
|
1792 |
} |
|
1793 |
||
1794 |
void Assembler::movq(XMMRegister dst, Address src) { |
|
1795 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
1796 |
InstructionMark im(this); |
|
11427 | 1797 |
simd_prefix(dst, src, VEX_SIMD_F3); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1798 |
emit_int8(0x7E); |
1066 | 1799 |
emit_operand(dst, src); |
1800 |
} |
|
1801 |
||
1802 |
void Assembler::movq(Address dst, XMMRegister src) { |
|
1803 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
1804 |
InstructionMark im(this); |
|
11427 | 1805 |
simd_prefix(dst, src, VEX_SIMD_66); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1806 |
emit_int8((unsigned char)0xD6); |
1066 | 1807 |
emit_operand(src, dst); |
1808 |
} |
|
1809 |
||
1810 |
void Assembler::movsbl(Register dst, Address src) { // movsxb |
|
1811 |
InstructionMark im(this); |
|
1812 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1813 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1814 |
emit_int8((unsigned char)0xBE); |
1066 | 1815 |
emit_operand(dst, src); |
1816 |
} |
|
1817 |
||
1818 |
void Assembler::movsbl(Register dst, Register src) { // movsxb |
|
1819 |
NOT_LP64(assert(src->has_byte_register(), "must have byte register")); |
|
1820 |
int encode = prefix_and_encode(dst->encoding(), src->encoding(), true); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1821 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1822 |
emit_int8((unsigned char)0xBE); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1823 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1824 |
} |
1825 |
||
1826 |
void Assembler::movsd(XMMRegister dst, XMMRegister src) { |
|
1827 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1828 |
emit_simd_arith(0x10, dst, src, VEX_SIMD_F2); |
1066 | 1829 |
} |
1830 |
||
1831 |
void Assembler::movsd(XMMRegister dst, Address src) { |
|
1832 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1833 |
emit_simd_arith_nonds(0x10, dst, src, VEX_SIMD_F2); |
1066 | 1834 |
} |
1835 |
||
1836 |
void Assembler::movsd(Address dst, XMMRegister src) { |
|
1837 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
1838 |
InstructionMark im(this); |
|
11427 | 1839 |
simd_prefix(dst, src, VEX_SIMD_F2); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1840 |
emit_int8(0x11); |
1066 | 1841 |
emit_operand(src, dst); |
1842 |
} |
|
1843 |
||
1844 |
void Assembler::movss(XMMRegister dst, XMMRegister src) { |
|
1845 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1846 |
emit_simd_arith(0x10, dst, src, VEX_SIMD_F3); |
1066 | 1847 |
} |
1848 |
||
1849 |
void Assembler::movss(XMMRegister dst, Address src) { |
|
1850 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1851 |
emit_simd_arith_nonds(0x10, dst, src, VEX_SIMD_F3); |
1066 | 1852 |
} |
1853 |
||
1854 |
void Assembler::movss(Address dst, XMMRegister src) { |
|
1855 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
1856 |
InstructionMark im(this); |
|
11427 | 1857 |
simd_prefix(dst, src, VEX_SIMD_F3); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1858 |
emit_int8(0x11); |
1066 | 1859 |
emit_operand(src, dst); |
1860 |
} |
|
1861 |
||
1862 |
void Assembler::movswl(Register dst, Address src) { // movsxw |
|
1863 |
InstructionMark im(this); |
|
1864 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1865 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1866 |
emit_int8((unsigned char)0xBF); |
1066 | 1867 |
emit_operand(dst, src); |
1868 |
} |
|
1869 |
||
1870 |
void Assembler::movswl(Register dst, Register src) { // movsxw |
|
1871 |
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
|
1872 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1873 |
emit_int8((unsigned char)0xBF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1874 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 1875 |
} |
1876 |
||
1877 |
void Assembler::movw(Address dst, int imm16) { |
|
1878 |
InstructionMark im(this); |
|
1879 |
||
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1880 |
emit_int8(0x66); // switch to 16-bit mode |
1066 | 1881 |
prefix(dst); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1882 |
emit_int8((unsigned char)0xC7); |
1066 | 1883 |
emit_operand(rax, dst, 2); |
14831
84828ee2a91c
8004536: replace AbstractAssembler emit_word with emit_int16
twisti
parents:
14626
diff
changeset
|
1884 |
emit_int16(imm16); |
1066 | 1885 |
} |
1886 |
||
1887 |
void Assembler::movw(Register dst, Address src) { |
|
1888 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1889 |
emit_int8(0x66); |
1066 | 1890 |
prefix(src, dst); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1891 |
emit_int8((unsigned char)0x8B); |
1066 | 1892 |
emit_operand(dst, src); |
1893 |
} |
|
1894 |
||
1895 |
void Assembler::movw(Address dst, Register src) { |
|
1896 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1897 |
emit_int8(0x66); |
1066 | 1898 |
prefix(dst, src); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1899 |
emit_int8((unsigned char)0x89); |
1066 | 1900 |
emit_operand(src, dst); |
1901 |
} |
|
1902 |
||
1903 |
void Assembler::movzbl(Register dst, Address src) { // movzxb |
|
1904 |
InstructionMark im(this); |
|
1905 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1906 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1907 |
emit_int8((unsigned char)0xB6); |
1066 | 1908 |
emit_operand(dst, src); |
1909 |
} |
|
1910 |
||
1911 |
void Assembler::movzbl(Register dst, Register src) { // movzxb |
|
1912 |
NOT_LP64(assert(src->has_byte_register(), "must have byte register")); |
|
1913 |
int encode = prefix_and_encode(dst->encoding(), src->encoding(), true); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1914 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1915 |
emit_int8((unsigned char)0xB6); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1916 |
emit_int8(0xC0 | encode); |
1066 | 1917 |
} |
1918 |
||
1919 |
void Assembler::movzwl(Register dst, Address src) { // movzxw |
|
1920 |
InstructionMark im(this); |
|
1921 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1922 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1923 |
emit_int8((unsigned char)0xB7); |
1066 | 1924 |
emit_operand(dst, src); |
1925 |
} |
|
1926 |
||
1927 |
void Assembler::movzwl(Register dst, Register src) { // movzxw |
|
1928 |
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
|
1929 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1930 |
emit_int8((unsigned char)0xB7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1931 |
emit_int8(0xC0 | encode); |
1066 | 1932 |
} |
1933 |
||
1934 |
void Assembler::mull(Address src) { |
|
1935 |
InstructionMark im(this); |
|
1936 |
prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1937 |
emit_int8((unsigned char)0xF7); |
1066 | 1938 |
emit_operand(rsp, src); |
1939 |
} |
|
1940 |
||
1941 |
void Assembler::mull(Register src) { |
|
1942 |
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
|
1943 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1944 |
emit_int8((unsigned char)(0xE0 | encode)); |
1066 | 1945 |
} |
1946 |
||
1947 |
void Assembler::mulsd(XMMRegister dst, Address src) { |
|
1948 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1949 |
emit_simd_arith(0x59, dst, src, VEX_SIMD_F2); |
1066 | 1950 |
} |
1951 |
||
1952 |
void Assembler::mulsd(XMMRegister dst, XMMRegister src) { |
|
1953 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1954 |
emit_simd_arith(0x59, dst, src, VEX_SIMD_F2); |
1066 | 1955 |
} |
1956 |
||
1957 |
void Assembler::mulss(XMMRegister dst, Address src) { |
|
1958 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1959 |
emit_simd_arith(0x59, dst, src, VEX_SIMD_F3); |
1066 | 1960 |
} |
1961 |
||
1962 |
void Assembler::mulss(XMMRegister dst, XMMRegister src) { |
|
1963 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
1964 |
emit_simd_arith(0x59, dst, src, VEX_SIMD_F3); |
1066 | 1965 |
} |
1966 |
||
1967 |
void Assembler::negl(Register dst) { |
|
1968 |
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
|
1969 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1970 |
emit_int8((unsigned char)(0xD8 | encode)); |
1066 | 1971 |
} |
1972 |
||
1 | 1973 |
void Assembler::nop(int i) { |
1066 | 1974 |
#ifdef ASSERT |
1 | 1975 |
assert(i > 0, " "); |
1066 | 1976 |
// The fancy nops aren't currently recognized by debuggers making it a |
1977 |
// pain to disassemble code while debugging. If asserts are on clearly |
|
1978 |
// speed is not an issue so simply use the single byte traditional nop |
|
1979 |
// to do alignment. |
|
1980 |
||
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
1981 |
for (; i > 0 ; i--) emit_int8((unsigned char)0x90); |
1066 | 1982 |
return; |
1983 |
||
1984 |
#endif // ASSERT |
|
1985 |
||
1 | 1986 |
if (UseAddressNop && VM_Version::is_intel()) { |
1987 |
// |
|
1988 |
// Using multi-bytes nops "0x0F 0x1F [address]" for Intel |
|
1989 |
// 1: 0x90 |
|
1990 |
// 2: 0x66 0x90 |
|
1991 |
// 3: 0x66 0x66 0x90 (don't use "0x0F 0x1F 0x00" - need patching safe padding) |
|
1992 |
// 4: 0x0F 0x1F 0x40 0x00 |
|
1993 |
// 5: 0x0F 0x1F 0x44 0x00 0x00 |
|
1994 |
// 6: 0x66 0x0F 0x1F 0x44 0x00 0x00 |
|
1995 |
// 7: 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 |
|
1996 |
// 8: 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
1997 |
// 9: 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
1998 |
// 10: 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
1999 |
// 11: 0x66 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
2000 |
||
2001 |
// The rest coding is Intel specific - don't use consecutive address nops |
|
2002 |
||
2003 |
// 12: 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x66 0x66 0x66 0x90 |
|
2004 |
// 13: 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x66 0x66 0x66 0x90 |
|
2005 |
// 14: 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x66 0x66 0x66 0x90 |
|
2006 |
// 15: 0x66 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x66 0x66 0x66 0x90 |
|
2007 |
||
2008 |
while(i >= 15) { |
|
2009 |
// For Intel don't generate consecutive addess nops (mix with regular nops) |
|
2010 |
i -= 15; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2011 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2012 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2013 |
emit_int8(0x66); // size prefix |
1 | 2014 |
addr_nop_8(); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2015 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2016 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2017 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2018 |
emit_int8((unsigned char)0x90); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2019 |
// nop |
1 | 2020 |
} |
2021 |
switch (i) { |
|
2022 |
case 14: |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2023 |
emit_int8(0x66); // size prefix |
1 | 2024 |
case 13: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2025 |
emit_int8(0x66); // size prefix |
1 | 2026 |
case 12: |
2027 |
addr_nop_8(); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2028 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2029 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2030 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2031 |
emit_int8((unsigned char)0x90); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2032 |
// nop |
1 | 2033 |
break; |
2034 |
case 11: |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2035 |
emit_int8(0x66); // size prefix |
1 | 2036 |
case 10: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2037 |
emit_int8(0x66); // size prefix |
1 | 2038 |
case 9: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2039 |
emit_int8(0x66); // size prefix |
1 | 2040 |
case 8: |
2041 |
addr_nop_8(); |
|
2042 |
break; |
|
2043 |
case 7: |
|
2044 |
addr_nop_7(); |
|
2045 |
break; |
|
2046 |
case 6: |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2047 |
emit_int8(0x66); // size prefix |
1 | 2048 |
case 5: |
2049 |
addr_nop_5(); |
|
2050 |
break; |
|
2051 |
case 4: |
|
2052 |
addr_nop_4(); |
|
2053 |
break; |
|
2054 |
case 3: |
|
2055 |
// 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
|
2056 |
emit_int8(0x66); // size prefix |
1 | 2057 |
case 2: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2058 |
emit_int8(0x66); // size prefix |
1 | 2059 |
case 1: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2060 |
emit_int8((unsigned char)0x90); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2061 |
// nop |
1 | 2062 |
break; |
2063 |
default: |
|
2064 |
assert(i == 0, " "); |
|
2065 |
} |
|
2066 |
return; |
|
2067 |
} |
|
2068 |
if (UseAddressNop && VM_Version::is_amd()) { |
|
2069 |
// |
|
2070 |
// Using multi-bytes nops "0x0F 0x1F [address]" for AMD. |
|
2071 |
// 1: 0x90 |
|
2072 |
// 2: 0x66 0x90 |
|
2073 |
// 3: 0x66 0x66 0x90 (don't use "0x0F 0x1F 0x00" - need patching safe padding) |
|
2074 |
// 4: 0x0F 0x1F 0x40 0x00 |
|
2075 |
// 5: 0x0F 0x1F 0x44 0x00 0x00 |
|
2076 |
// 6: 0x66 0x0F 0x1F 0x44 0x00 0x00 |
|
2077 |
// 7: 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 |
|
2078 |
// 8: 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
2079 |
// 9: 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
2080 |
// 10: 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
2081 |
// 11: 0x66 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
2082 |
||
2083 |
// The rest coding is AMD specific - use consecutive address nops |
|
2084 |
||
2085 |
// 12: 0x66 0x0F 0x1F 0x44 0x00 0x00 0x66 0x0F 0x1F 0x44 0x00 0x00 |
|
2086 |
// 13: 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 0x66 0x0F 0x1F 0x44 0x00 0x00 |
|
2087 |
// 14: 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 |
|
2088 |
// 15: 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 |
|
2089 |
// 16: 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 |
|
2090 |
// Size prefixes (0x66) are added for larger sizes |
|
2091 |
||
2092 |
while(i >= 22) { |
|
2093 |
i -= 11; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2094 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2095 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2096 |
emit_int8(0x66); // size prefix |
1 | 2097 |
addr_nop_8(); |
2098 |
} |
|
2099 |
// Generate first nop for size between 21-12 |
|
2100 |
switch (i) { |
|
2101 |
case 21: |
|
2102 |
i -= 1; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2103 |
emit_int8(0x66); // size prefix |
1 | 2104 |
case 20: |
2105 |
case 19: |
|
2106 |
i -= 1; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2107 |
emit_int8(0x66); // size prefix |
1 | 2108 |
case 18: |
2109 |
case 17: |
|
2110 |
i -= 1; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2111 |
emit_int8(0x66); // size prefix |
1 | 2112 |
case 16: |
2113 |
case 15: |
|
2114 |
i -= 8; |
|
2115 |
addr_nop_8(); |
|
2116 |
break; |
|
2117 |
case 14: |
|
2118 |
case 13: |
|
2119 |
i -= 7; |
|
2120 |
addr_nop_7(); |
|
2121 |
break; |
|
2122 |
case 12: |
|
2123 |
i -= 6; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2124 |
emit_int8(0x66); // size prefix |
1 | 2125 |
addr_nop_5(); |
2126 |
break; |
|
2127 |
default: |
|
2128 |
assert(i < 12, " "); |
|
2129 |
} |
|
2130 |
||
2131 |
// Generate second nop for size between 11-1 |
|
2132 |
switch (i) { |
|
2133 |
case 11: |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2134 |
emit_int8(0x66); // size prefix |
1 | 2135 |
case 10: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2136 |
emit_int8(0x66); // size prefix |
1 | 2137 |
case 9: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2138 |
emit_int8(0x66); // size prefix |
1 | 2139 |
case 8: |
2140 |
addr_nop_8(); |
|
2141 |
break; |
|
2142 |
case 7: |
|
2143 |
addr_nop_7(); |
|
2144 |
break; |
|
2145 |
case 6: |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2146 |
emit_int8(0x66); // size prefix |
1 | 2147 |
case 5: |
2148 |
addr_nop_5(); |
|
2149 |
break; |
|
2150 |
case 4: |
|
2151 |
addr_nop_4(); |
|
2152 |
break; |
|
2153 |
case 3: |
|
2154 |
// 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
|
2155 |
emit_int8(0x66); // size prefix |
1 | 2156 |
case 2: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2157 |
emit_int8(0x66); // size prefix |
1 | 2158 |
case 1: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2159 |
emit_int8((unsigned char)0x90); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2160 |
// nop |
1 | 2161 |
break; |
2162 |
default: |
|
2163 |
assert(i == 0, " "); |
|
2164 |
} |
|
2165 |
return; |
|
2166 |
} |
|
2167 |
||
2168 |
// Using nops with size prefixes "0x66 0x90". |
|
2169 |
// From AMD Optimization Guide: |
|
2170 |
// 1: 0x90 |
|
2171 |
// 2: 0x66 0x90 |
|
2172 |
// 3: 0x66 0x66 0x90 |
|
2173 |
// 4: 0x66 0x66 0x66 0x90 |
|
2174 |
// 5: 0x66 0x66 0x90 0x66 0x90 |
|
2175 |
// 6: 0x66 0x66 0x90 0x66 0x66 0x90 |
|
2176 |
// 7: 0x66 0x66 0x66 0x90 0x66 0x66 0x90 |
|
2177 |
// 8: 0x66 0x66 0x66 0x90 0x66 0x66 0x66 0x90 |
|
2178 |
// 9: 0x66 0x66 0x90 0x66 0x66 0x90 0x66 0x66 0x90 |
|
2179 |
// 10: 0x66 0x66 0x66 0x90 0x66 0x66 0x90 0x66 0x66 0x90 |
|
2180 |
// |
|
2181 |
while(i > 12) { |
|
2182 |
i -= 4; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2183 |
emit_int8(0x66); // size prefix |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2184 |
emit_int8(0x66); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2185 |
emit_int8(0x66); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2186 |
emit_int8((unsigned char)0x90); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2187 |
// nop |
1 | 2188 |
} |
2189 |
// 1 - 12 nops |
|
2190 |
if(i > 8) { |
|
2191 |
if(i > 9) { |
|
2192 |
i -= 1; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2193 |
emit_int8(0x66); |
1 | 2194 |
} |
2195 |
i -= 3; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2196 |
emit_int8(0x66); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2197 |
emit_int8(0x66); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2198 |
emit_int8((unsigned char)0x90); |
1 | 2199 |
} |
2200 |
// 1 - 8 nops |
|
2201 |
if(i > 4) { |
|
2202 |
if(i > 6) { |
|
2203 |
i -= 1; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2204 |
emit_int8(0x66); |
1 | 2205 |
} |
2206 |
i -= 3; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2207 |
emit_int8(0x66); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2208 |
emit_int8(0x66); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2209 |
emit_int8((unsigned char)0x90); |
1 | 2210 |
} |
2211 |
switch (i) { |
|
2212 |
case 4: |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2213 |
emit_int8(0x66); |
1 | 2214 |
case 3: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2215 |
emit_int8(0x66); |
1 | 2216 |
case 2: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2217 |
emit_int8(0x66); |
1 | 2218 |
case 1: |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2219 |
emit_int8((unsigned char)0x90); |
1 | 2220 |
break; |
2221 |
default: |
|
2222 |
assert(i == 0, " "); |
|
2223 |
} |
|
2224 |
} |
|
2225 |
||
1066 | 2226 |
void Assembler::notl(Register dst) { |
2227 |
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
|
2228 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2229 |
emit_int8((unsigned char)(0xD0 | encode)); |
1066 | 2230 |
} |
2231 |
||
2232 |
void Assembler::orl(Address dst, int32_t imm32) { |
|
2233 |
InstructionMark im(this); |
|
2234 |
prefix(dst); |
|
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
2235 |
emit_arith_operand(0x81, rcx, dst, imm32); |
1066 | 2236 |
} |
2237 |
||
2238 |
void Assembler::orl(Register dst, int32_t imm32) { |
|
2239 |
prefix(dst); |
|
2240 |
emit_arith(0x81, 0xC8, dst, imm32); |
|
2241 |
} |
|
2242 |
||
2243 |
void Assembler::orl(Register dst, Address src) { |
|
2244 |
InstructionMark im(this); |
|
2245 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2246 |
emit_int8(0x0B); |
1066 | 2247 |
emit_operand(dst, src); |
2248 |
} |
|
2249 |
||
2250 |
void Assembler::orl(Register dst, Register src) { |
|
2251 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
|
2252 |
emit_arith(0x0B, 0xC0, dst, src); |
|
2253 |
} |
|
2254 |
||
11427 | 2255 |
void Assembler::packuswb(XMMRegister dst, Address src) { |
2256 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
2257 |
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2258 |
emit_simd_arith(0x67, dst, src, VEX_SIMD_66); |
11427 | 2259 |
} |
2260 |
||
2261 |
void Assembler::packuswb(XMMRegister dst, XMMRegister src) { |
|
2262 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2263 |
emit_simd_arith(0x67, dst, src, VEX_SIMD_66); |
11427 | 2264 |
} |
2265 |
||
2348 | 2266 |
void Assembler::pcmpestri(XMMRegister dst, Address src, int imm8) { |
2267 |
assert(VM_Version::supports_sse4_2(), ""); |
|
11427 | 2268 |
InstructionMark im(this); |
2269 |
simd_prefix(dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2270 |
emit_int8(0x61); |
2348 | 2271 |
emit_operand(dst, src); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2272 |
emit_int8(imm8); |
2348 | 2273 |
} |
2274 |
||
2275 |
void Assembler::pcmpestri(XMMRegister dst, XMMRegister src, int imm8) { |
|
2276 |
assert(VM_Version::supports_sse4_2(), ""); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2277 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_3A); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2278 |
emit_int8(0x61); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2279 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2280 |
emit_int8(imm8); |
2348 | 2281 |
} |
2282 |
||
11427 | 2283 |
void Assembler::pmovzxbw(XMMRegister dst, Address src) { |
2284 |
assert(VM_Version::supports_sse4_1(), ""); |
|
2285 |
InstructionMark im(this); |
|
2286 |
simd_prefix(dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2287 |
emit_int8(0x30); |
11427 | 2288 |
emit_operand(dst, src); |
2289 |
} |
|
2290 |
||
2291 |
void Assembler::pmovzxbw(XMMRegister dst, XMMRegister src) { |
|
2292 |
assert(VM_Version::supports_sse4_1(), ""); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2293 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2294 |
emit_int8(0x30); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2295 |
emit_int8((unsigned char)(0xC0 | encode)); |
11427 | 2296 |
} |
2297 |
||
1066 | 2298 |
// generic |
2299 |
void Assembler::pop(Register dst) { |
|
2300 |
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
|
2301 |
emit_int8(0x58 | encode); |
1066 | 2302 |
} |
2303 |
||
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
2304 |
void Assembler::popcntl(Register dst, Address src) { |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
2305 |
assert(VM_Version::supports_popcnt(), "must support"); |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
2306 |
InstructionMark im(this); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2307 |
emit_int8((unsigned char)0xF3); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
2308 |
prefix(src, dst); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2309 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2310 |
emit_int8((unsigned char)0xB8); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
2311 |
emit_operand(dst, src); |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
2312 |
} |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
2313 |
|
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
2314 |
void Assembler::popcntl(Register dst, Register src) { |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
2315 |
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
|
2316 |
emit_int8((unsigned char)0xF3); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
2317 |
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
|
2318 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2319 |
emit_int8((unsigned char)0xB8); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2320 |
emit_int8((unsigned char)(0xC0 | encode)); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
2321 |
} |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
2322 |
|
1066 | 2323 |
void Assembler::popf() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2324 |
emit_int8((unsigned char)0x9D); |
1066 | 2325 |
} |
2326 |
||
4430 | 2327 |
#ifndef _LP64 // no 32bit push/pop on amd64 |
1066 | 2328 |
void Assembler::popl(Address dst) { |
2329 |
// NOTE: this will adjust stack by 8byte on 64bits |
|
2330 |
InstructionMark im(this); |
|
2331 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2332 |
emit_int8((unsigned char)0x8F); |
1066 | 2333 |
emit_operand(rax, dst); |
2334 |
} |
|
4430 | 2335 |
#endif |
1066 | 2336 |
|
2337 |
void Assembler::prefetch_prefix(Address src) { |
|
2338 |
prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2339 |
emit_int8(0x0F); |
1066 | 2340 |
} |
2341 |
||
2342 |
void Assembler::prefetchnta(Address src) { |
|
10286
74b0f625d56a
7081926: assert(VM_Version::supports_sse2()) failed: must support
kvn
parents:
10268
diff
changeset
|
2343 |
NOT_LP64(assert(VM_Version::supports_sse(), "must support")); |
1066 | 2344 |
InstructionMark im(this); |
2345 |
prefetch_prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2346 |
emit_int8(0x18); |
1066 | 2347 |
emit_operand(rax, src); // 0, src |
2348 |
} |
|
2349 |
||
2350 |
void Assembler::prefetchr(Address src) { |
|
10267 | 2351 |
assert(VM_Version::supports_3dnow_prefetch(), "must support"); |
1066 | 2352 |
InstructionMark im(this); |
2353 |
prefetch_prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2354 |
emit_int8(0x0D); |
1066 | 2355 |
emit_operand(rax, src); // 0, src |
2356 |
} |
|
2357 |
||
2358 |
void Assembler::prefetcht0(Address src) { |
|
2359 |
NOT_LP64(assert(VM_Version::supports_sse(), "must support")); |
|
2360 |
InstructionMark im(this); |
|
2361 |
prefetch_prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2362 |
emit_int8(0x18); |
1066 | 2363 |
emit_operand(rcx, src); // 1, src |
2364 |
} |
|
2365 |
||
2366 |
void Assembler::prefetcht1(Address src) { |
|
2367 |
NOT_LP64(assert(VM_Version::supports_sse(), "must support")); |
|
2368 |
InstructionMark im(this); |
|
2369 |
prefetch_prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2370 |
emit_int8(0x18); |
1066 | 2371 |
emit_operand(rdx, src); // 2, src |
2372 |
} |
|
2373 |
||
2374 |
void Assembler::prefetcht2(Address src) { |
|
2375 |
NOT_LP64(assert(VM_Version::supports_sse(), "must support")); |
|
2376 |
InstructionMark im(this); |
|
2377 |
prefetch_prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2378 |
emit_int8(0x18); |
1066 | 2379 |
emit_operand(rbx, src); // 3, src |
2380 |
} |
|
2381 |
||
2382 |
void Assembler::prefetchw(Address src) { |
|
10267 | 2383 |
assert(VM_Version::supports_3dnow_prefetch(), "must support"); |
1066 | 2384 |
InstructionMark im(this); |
2385 |
prefetch_prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2386 |
emit_int8(0x0D); |
1066 | 2387 |
emit_operand(rcx, src); // 1, src |
2388 |
} |
|
2389 |
||
2390 |
void Assembler::prefix(Prefix p) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2391 |
emit_int8(p); |
1066 | 2392 |
} |
2393 |
||
14132 | 2394 |
void Assembler::pshufb(XMMRegister dst, XMMRegister src) { |
2395 |
assert(VM_Version::supports_ssse3(), ""); |
|
2396 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2397 |
emit_int8(0x00); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2398 |
emit_int8((unsigned char)(0xC0 | encode)); |
14132 | 2399 |
} |
2400 |
||
2401 |
void Assembler::pshufb(XMMRegister dst, Address src) { |
|
2402 |
assert(VM_Version::supports_ssse3(), ""); |
|
2403 |
InstructionMark im(this); |
|
2404 |
simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2405 |
emit_int8(0x00); |
14132 | 2406 |
emit_operand(dst, src); |
2407 |
} |
|
2408 |
||
1066 | 2409 |
void Assembler::pshufd(XMMRegister dst, XMMRegister src, int mode) { |
2410 |
assert(isByte(mode), "invalid value"); |
|
2411 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2412 |
emit_simd_arith_nonds(0x70, dst, src, VEX_SIMD_66); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2413 |
emit_int8(mode & 0xFF); |
1066 | 2414 |
|
2415 |
} |
|
2416 |
||
2417 |
void Assembler::pshufd(XMMRegister dst, Address src, int mode) { |
|
2418 |
assert(isByte(mode), "invalid value"); |
|
2419 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
11427 | 2420 |
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); |
2421 |
InstructionMark im(this); |
|
2422 |
simd_prefix(dst, src, VEX_SIMD_66); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2423 |
emit_int8(0x70); |
1066 | 2424 |
emit_operand(dst, src); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2425 |
emit_int8(mode & 0xFF); |
1066 | 2426 |
} |
2427 |
||
2428 |
void Assembler::pshuflw(XMMRegister dst, XMMRegister src, int mode) { |
|
2429 |
assert(isByte(mode), "invalid value"); |
|
2430 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2431 |
emit_simd_arith_nonds(0x70, dst, src, VEX_SIMD_F2); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2432 |
emit_int8(mode & 0xFF); |
1066 | 2433 |
} |
2434 |
||
2435 |
void Assembler::pshuflw(XMMRegister dst, Address src, int mode) { |
|
2436 |
assert(isByte(mode), "invalid value"); |
|
2437 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
11427 | 2438 |
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); |
2439 |
InstructionMark im(this); |
|
2440 |
simd_prefix(dst, src, VEX_SIMD_F2); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2441 |
emit_int8(0x70); |
1066 | 2442 |
emit_operand(dst, src); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2443 |
emit_int8(mode & 0xFF); |
1066 | 2444 |
} |
2445 |
||
8494
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
2446 |
void Assembler::psrldq(XMMRegister dst, int shift) { |
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
2447 |
// Shift 128 bit value in xmm register by number of bytes. |
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
2448 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
11427 | 2449 |
int encode = simd_prefix_and_encode(xmm3, dst, dst, VEX_SIMD_66); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2450 |
emit_int8(0x73); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2451 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2452 |
emit_int8(shift); |
8494
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
2453 |
} |
4258c78226d9
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
8332
diff
changeset
|
2454 |
|
2348 | 2455 |
void Assembler::ptest(XMMRegister dst, Address src) { |
2456 |
assert(VM_Version::supports_sse4_1(), ""); |
|
11427 | 2457 |
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); |
2458 |
InstructionMark im(this); |
|
2459 |
simd_prefix(dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2460 |
emit_int8(0x17); |
2348 | 2461 |
emit_operand(dst, src); |
2462 |
} |
|
2463 |
||
2464 |
void Assembler::ptest(XMMRegister dst, XMMRegister src) { |
|
2465 |
assert(VM_Version::supports_sse4_1(), ""); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2466 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2467 |
emit_int8(0x17); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2468 |
emit_int8((unsigned char)(0xC0 | encode)); |
2348 | 2469 |
} |
2470 |
||
11427 | 2471 |
void Assembler::punpcklbw(XMMRegister dst, Address src) { |
2472 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
2473 |
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2474 |
emit_simd_arith(0x60, dst, src, VEX_SIMD_66); |
11427 | 2475 |
} |
2476 |
||
1066 | 2477 |
void Assembler::punpcklbw(XMMRegister dst, XMMRegister src) { |
2478 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2479 |
emit_simd_arith(0x60, dst, src, VEX_SIMD_66); |
1066 | 2480 |
} |
2481 |
||
11427 | 2482 |
void Assembler::punpckldq(XMMRegister dst, Address src) { |
2483 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
2484 |
assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2485 |
emit_simd_arith(0x62, dst, src, VEX_SIMD_66); |
11427 | 2486 |
} |
2487 |
||
2488 |
void Assembler::punpckldq(XMMRegister dst, XMMRegister src) { |
|
2489 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2490 |
emit_simd_arith(0x62, dst, src, VEX_SIMD_66); |
11427 | 2491 |
} |
2492 |
||
13294 | 2493 |
void Assembler::punpcklqdq(XMMRegister dst, XMMRegister src) { |
2494 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2495 |
emit_simd_arith(0x6C, dst, src, VEX_SIMD_66); |
13294 | 2496 |
} |
2497 |
||
1066 | 2498 |
void Assembler::push(int32_t imm32) { |
2499 |
// in 64bits we push 64bits onto the stack but only |
|
2500 |
// take a 32bit immediate |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2501 |
emit_int8(0x68); |
1066 | 2502 |
emit_long(imm32); |
2503 |
} |
|
2504 |
||
2505 |
void Assembler::push(Register src) { |
|
2506 |
int encode = prefix_and_encode(src->encoding()); |
|
2507 |
||
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2508 |
emit_int8(0x50 | encode); |
1066 | 2509 |
} |
2510 |
||
2511 |
void Assembler::pushf() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2512 |
emit_int8((unsigned char)0x9C); |
1066 | 2513 |
} |
2514 |
||
4430 | 2515 |
#ifndef _LP64 // no 32bit push/pop on amd64 |
1066 | 2516 |
void Assembler::pushl(Address src) { |
2517 |
// Note this will push 64bit on 64bit |
|
2518 |
InstructionMark im(this); |
|
2519 |
prefix(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2520 |
emit_int8((unsigned char)0xFF); |
1066 | 2521 |
emit_operand(rsi, src); |
2522 |
} |
|
4430 | 2523 |
#endif |
1066 | 2524 |
|
2525 |
void Assembler::rcll(Register dst, int imm8) { |
|
2526 |
assert(isShiftCount(imm8), "illegal shift count"); |
|
2527 |
int encode = prefix_and_encode(dst->encoding()); |
|
2528 |
if (imm8 == 1) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2529 |
emit_int8((unsigned char)0xD1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2530 |
emit_int8((unsigned char)(0xD0 | encode)); |
1066 | 2531 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2532 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2533 |
emit_int8((unsigned char)0xD0 | encode); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2534 |
emit_int8(imm8); |
1066 | 2535 |
} |
2536 |
} |
|
2537 |
||
2538 |
// copies data from [esi] to [edi] using rcx pointer sized words |
|
2539 |
// generic |
|
2540 |
void Assembler::rep_mov() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2541 |
emit_int8((unsigned char)0xF3); |
1066 | 2542 |
// MOVSQ |
2543 |
LP64_ONLY(prefix(REX_W)); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2544 |
emit_int8((unsigned char)0xA5); |
1066 | 2545 |
} |
2546 |
||
15114
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
2547 |
// sets rcx bytes with rax, value at [edi] |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
2548 |
void Assembler::rep_stosb() { |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
2549 |
emit_int8((unsigned char)0xF3); // REP |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
2550 |
LP64_ONLY(prefix(REX_W)); |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
2551 |
emit_int8((unsigned char)0xAA); // STOSB |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
2552 |
} |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
2553 |
|
1066 | 2554 |
// sets rcx pointer sized words with rax, value at [edi] |
2555 |
// generic |
|
15114
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
2556 |
void Assembler::rep_stos() { |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
2557 |
emit_int8((unsigned char)0xF3); // REP |
4074553c678b
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
14837
diff
changeset
|
2558 |
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
|
2559 |
emit_int8((unsigned char)0xAB); |
1066 | 2560 |
} |
2561 |
||
2562 |
// scans rcx pointer sized words at [edi] for occurance of rax, |
|
2563 |
// generic |
|
2564 |
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
|
2565 |
emit_int8((unsigned char)0xF2); |
1066 | 2566 |
// SCASQ |
2567 |
LP64_ONLY(prefix(REX_W)); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2568 |
emit_int8((unsigned char)0xAF); |
1066 | 2569 |
} |
2570 |
||
2571 |
#ifdef _LP64 |
|
2572 |
// scans rcx 4 byte words at [edi] for occurance of rax, |
|
2573 |
// generic |
|
2574 |
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
|
2575 |
emit_int8((unsigned char)0xF2); |
1066 | 2576 |
// SCASL |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2577 |
emit_int8((unsigned char)0xAF); |
1066 | 2578 |
} |
2579 |
#endif |
|
2580 |
||
1 | 2581 |
void Assembler::ret(int imm16) { |
2582 |
if (imm16 == 0) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2583 |
emit_int8((unsigned char)0xC3); |
1 | 2584 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2585 |
emit_int8((unsigned char)0xC2); |
14831
84828ee2a91c
8004536: replace AbstractAssembler emit_word with emit_int16
twisti
parents:
14626
diff
changeset
|
2586 |
emit_int16(imm16); |
1 | 2587 |
} |
2588 |
} |
|
2589 |
||
1066 | 2590 |
void Assembler::sahf() { |
2591 |
#ifdef _LP64 |
|
2592 |
// Not supported in 64bit mode |
|
2593 |
ShouldNotReachHere(); |
|
2594 |
#endif |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2595 |
emit_int8((unsigned char)0x9E); |
1066 | 2596 |
} |
2597 |
||
2598 |
void Assembler::sarl(Register dst, int imm8) { |
|
2599 |
int encode = prefix_and_encode(dst->encoding()); |
|
2600 |
assert(isShiftCount(imm8), "illegal shift count"); |
|
2601 |
if (imm8 == 1) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2602 |
emit_int8((unsigned char)0xD1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2603 |
emit_int8((unsigned char)(0xF8 | encode)); |
1066 | 2604 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2605 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2606 |
emit_int8((unsigned char)(0xF8 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2607 |
emit_int8(imm8); |
1066 | 2608 |
} |
2609 |
} |
|
2610 |
||
2611 |
void Assembler::sarl(Register dst) { |
|
2612 |
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
|
2613 |
emit_int8((unsigned char)0xD3); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2614 |
emit_int8((unsigned char)(0xF8 | encode)); |
1066 | 2615 |
} |
2616 |
||
2617 |
void Assembler::sbbl(Address dst, int32_t imm32) { |
|
2618 |
InstructionMark im(this); |
|
2619 |
prefix(dst); |
|
2620 |
emit_arith_operand(0x81, rbx, dst, imm32); |
|
2621 |
} |
|
2622 |
||
2623 |
void Assembler::sbbl(Register dst, int32_t imm32) { |
|
2624 |
prefix(dst); |
|
2625 |
emit_arith(0x81, 0xD8, dst, imm32); |
|
2626 |
} |
|
2627 |
||
2628 |
||
2629 |
void Assembler::sbbl(Register dst, Address src) { |
|
2630 |
InstructionMark im(this); |
|
2631 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2632 |
emit_int8(0x1B); |
1066 | 2633 |
emit_operand(dst, src); |
2634 |
} |
|
2635 |
||
2636 |
void Assembler::sbbl(Register dst, Register src) { |
|
2637 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
|
2638 |
emit_arith(0x1B, 0xC0, dst, src); |
|
2639 |
} |
|
2640 |
||
2641 |
void Assembler::setb(Condition cc, Register dst) { |
|
2642 |
assert(0 <= cc && cc < 16, "illegal cc"); |
|
2643 |
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
|
2644 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2645 |
emit_int8((unsigned char)0x90 | cc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2646 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 2647 |
} |
2648 |
||
2649 |
void Assembler::shll(Register dst, int imm8) { |
|
2650 |
assert(isShiftCount(imm8), "illegal shift count"); |
|
2651 |
int encode = prefix_and_encode(dst->encoding()); |
|
2652 |
if (imm8 == 1 ) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2653 |
emit_int8((unsigned char)0xD1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2654 |
emit_int8((unsigned char)(0xE0 | encode)); |
1066 | 2655 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2656 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2657 |
emit_int8((unsigned char)(0xE0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2658 |
emit_int8(imm8); |
1066 | 2659 |
} |
2660 |
} |
|
2661 |
||
2662 |
void Assembler::shll(Register dst) { |
|
2663 |
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
|
2664 |
emit_int8((unsigned char)0xD3); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2665 |
emit_int8((unsigned char)(0xE0 | encode)); |
1066 | 2666 |
} |
2667 |
||
2668 |
void Assembler::shrl(Register dst, int imm8) { |
|
2669 |
assert(isShiftCount(imm8), "illegal shift count"); |
|
2670 |
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
|
2671 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2672 |
emit_int8((unsigned char)(0xE8 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2673 |
emit_int8(imm8); |
1066 | 2674 |
} |
2675 |
||
2676 |
void Assembler::shrl(Register dst) { |
|
2677 |
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
|
2678 |
emit_int8((unsigned char)0xD3); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2679 |
emit_int8((unsigned char)(0xE8 | encode)); |
1066 | 2680 |
} |
1 | 2681 |
|
2682 |
// copies a single word from [esi] to [edi] |
|
2683 |
void Assembler::smovl() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2684 |
emit_int8((unsigned char)0xA5); |
1 | 2685 |
} |
2686 |
||
1066 | 2687 |
void Assembler::sqrtsd(XMMRegister dst, XMMRegister src) { |
2688 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2689 |
emit_simd_arith(0x51, dst, src, VEX_SIMD_F2); |
1066 | 2690 |
} |
2691 |
||
7433 | 2692 |
void Assembler::sqrtsd(XMMRegister dst, Address src) { |
2693 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2694 |
emit_simd_arith(0x51, dst, src, VEX_SIMD_F2); |
7433 | 2695 |
} |
2696 |
||
2697 |
void Assembler::sqrtss(XMMRegister dst, XMMRegister src) { |
|
11427 | 2698 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2699 |
emit_simd_arith(0x51, dst, src, VEX_SIMD_F3); |
7433 | 2700 |
} |
2701 |
||
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
2702 |
void Assembler::std() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2703 |
emit_int8((unsigned char)0xFD); |
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
2704 |
} |
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
2705 |
|
7433 | 2706 |
void Assembler::sqrtss(XMMRegister dst, Address src) { |
11427 | 2707 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2708 |
emit_simd_arith(0x51, dst, src, VEX_SIMD_F3); |
7433 | 2709 |
} |
2710 |
||
1066 | 2711 |
void Assembler::stmxcsr( Address dst) { |
2712 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
2713 |
InstructionMark im(this); |
|
2714 |
prefix(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2715 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2716 |
emit_int8((unsigned char)0xAE); |
1066 | 2717 |
emit_operand(as_Register(3), dst); |
2718 |
} |
|
2719 |
||
2720 |
void Assembler::subl(Address dst, int32_t imm32) { |
|
2721 |
InstructionMark im(this); |
|
2722 |
prefix(dst); |
|
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
2723 |
emit_arith_operand(0x81, rbp, dst, imm32); |
1066 | 2724 |
} |
2725 |
||
2726 |
void Assembler::subl(Address dst, Register src) { |
|
2727 |
InstructionMark im(this); |
|
2728 |
prefix(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2729 |
emit_int8(0x29); |
1066 | 2730 |
emit_operand(src, dst); |
2731 |
} |
|
2732 |
||
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
2733 |
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
|
2734 |
prefix(dst); |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
2735 |
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
|
2736 |
} |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
2737 |
|
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
2738 |
// 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
|
2739 |
void Assembler::subl_imm32(Register dst, int32_t imm32) { |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
2740 |
prefix(dst); |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
2741 |
emit_arith_imm32(0x81, 0xE8, dst, imm32); |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
2742 |
} |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
2743 |
|
1066 | 2744 |
void Assembler::subl(Register dst, Address src) { |
2745 |
InstructionMark im(this); |
|
2746 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2747 |
emit_int8(0x2B); |
1066 | 2748 |
emit_operand(dst, src); |
2749 |
} |
|
2750 |
||
2751 |
void Assembler::subl(Register dst, Register src) { |
|
2752 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
|
2753 |
emit_arith(0x2B, 0xC0, dst, src); |
|
2754 |
} |
|
2755 |
||
2756 |
void Assembler::subsd(XMMRegister dst, XMMRegister src) { |
|
2757 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2758 |
emit_simd_arith(0x5C, dst, src, VEX_SIMD_F2); |
1066 | 2759 |
} |
2760 |
||
2761 |
void Assembler::subsd(XMMRegister dst, Address src) { |
|
2762 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2763 |
emit_simd_arith(0x5C, dst, src, VEX_SIMD_F2); |
1066 | 2764 |
} |
2765 |
||
2766 |
void Assembler::subss(XMMRegister dst, XMMRegister src) { |
|
2767 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2768 |
emit_simd_arith(0x5C, dst, src, VEX_SIMD_F3); |
1066 | 2769 |
} |
2770 |
||
2771 |
void Assembler::subss(XMMRegister dst, Address src) { |
|
2772 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2773 |
emit_simd_arith(0x5C, dst, src, VEX_SIMD_F3); |
1066 | 2774 |
} |
2775 |
||
2776 |
void Assembler::testb(Register dst, int imm8) { |
|
2777 |
NOT_LP64(assert(dst->has_byte_register(), "must have byte register")); |
|
2778 |
(void) prefix_and_encode(dst->encoding(), true); |
|
2779 |
emit_arith_b(0xF6, 0xC0, dst, imm8); |
|
2780 |
} |
|
2781 |
||
2782 |
void Assembler::testl(Register dst, int32_t imm32) { |
|
2783 |
// not using emit_arith because test |
|
2784 |
// doesn't support sign-extension of |
|
2785 |
// 8bit operands |
|
2786 |
int encode = dst->encoding(); |
|
2787 |
if (encode == 0) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2788 |
emit_int8((unsigned char)0xA9); |
1066 | 2789 |
} else { |
2790 |
encode = prefix_and_encode(encode); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2791 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2792 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 2793 |
} |
2794 |
emit_long(imm32); |
|
2795 |
} |
|
2796 |
||
2797 |
void Assembler::testl(Register dst, Register src) { |
|
2798 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
|
2799 |
emit_arith(0x85, 0xC0, dst, src); |
|
2800 |
} |
|
2801 |
||
2802 |
void Assembler::testl(Register dst, Address src) { |
|
2803 |
InstructionMark im(this); |
|
2804 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2805 |
emit_int8((unsigned char)0x85); |
1066 | 2806 |
emit_operand(dst, src); |
2807 |
} |
|
2808 |
||
2809 |
void Assembler::ucomisd(XMMRegister dst, Address src) { |
|
2810 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2811 |
emit_simd_arith_nonds(0x2E, dst, src, VEX_SIMD_66); |
1066 | 2812 |
} |
2813 |
||
2814 |
void Assembler::ucomisd(XMMRegister dst, XMMRegister src) { |
|
2815 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2816 |
emit_simd_arith_nonds(0x2E, dst, src, VEX_SIMD_66); |
1066 | 2817 |
} |
2818 |
||
2819 |
void Assembler::ucomiss(XMMRegister dst, Address src) { |
|
2820 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2821 |
emit_simd_arith_nonds(0x2E, dst, src, VEX_SIMD_NONE); |
1066 | 2822 |
} |
2823 |
||
2824 |
void Assembler::ucomiss(XMMRegister dst, XMMRegister src) { |
|
2825 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2826 |
emit_simd_arith_nonds(0x2E, dst, src, VEX_SIMD_NONE); |
1066 | 2827 |
} |
2828 |
||
2829 |
||
2830 |
void Assembler::xaddl(Address dst, Register src) { |
|
2831 |
InstructionMark im(this); |
|
2832 |
prefix(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2833 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2834 |
emit_int8((unsigned char)0xC1); |
1066 | 2835 |
emit_operand(src, dst); |
2836 |
} |
|
2837 |
||
2838 |
void Assembler::xchgl(Register dst, Address src) { // xchg |
|
2839 |
InstructionMark im(this); |
|
2840 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2841 |
emit_int8((unsigned char)0x87); |
1066 | 2842 |
emit_operand(dst, src); |
2843 |
} |
|
2844 |
||
2845 |
void Assembler::xchgl(Register dst, Register src) { |
|
2846 |
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
|
2847 |
emit_int8((unsigned char)0x87); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2848 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 2849 |
} |
2850 |
||
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
2851 |
void Assembler::xgetbv() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2852 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2853 |
emit_int8(0x01); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2854 |
emit_int8((unsigned char)0xD0); |
14626
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
2855 |
} |
0cf4eccf130f
8003240: x86: move MacroAssembler into separate file
twisti
parents:
14625
diff
changeset
|
2856 |
|
1066 | 2857 |
void Assembler::xorl(Register dst, int32_t imm32) { |
2858 |
prefix(dst); |
|
2859 |
emit_arith(0x81, 0xF0, dst, imm32); |
|
2860 |
} |
|
2861 |
||
2862 |
void Assembler::xorl(Register dst, Address src) { |
|
2863 |
InstructionMark im(this); |
|
2864 |
prefix(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
2865 |
emit_int8(0x33); |
1066 | 2866 |
emit_operand(dst, src); |
2867 |
} |
|
2868 |
||
2869 |
void Assembler::xorl(Register dst, Register src) { |
|
2870 |
(void) prefix_and_encode(dst->encoding(), src->encoding()); |
|
2871 |
emit_arith(0x33, 0xC0, dst, src); |
|
2872 |
} |
|
2873 |
||
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2874 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2875 |
// 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
|
2876 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2877 |
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
|
2878 |
assert(VM_Version::supports_avx(), ""); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2879 |
emit_vex_arith(0x58, dst, nds, src, VEX_SIMD_F2, /* vector256 */ false); |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2880 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2881 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2882 |
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
|
2883 |
assert(VM_Version::supports_avx(), ""); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2884 |
emit_vex_arith(0x58, dst, nds, src, VEX_SIMD_F2, /* vector256 */ false); |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2885 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2886 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2887 |
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
|
2888 |
assert(VM_Version::supports_avx(), ""); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2889 |
emit_vex_arith(0x58, dst, nds, src, VEX_SIMD_F3, /* vector256 */ false); |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2890 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2891 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2892 |
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
|
2893 |
assert(VM_Version::supports_avx(), ""); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2894 |
emit_vex_arith(0x58, dst, nds, src, VEX_SIMD_F3, /* vector256 */ false); |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2895 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2896 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2897 |
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
|
2898 |
assert(VM_Version::supports_avx(), ""); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2899 |
emit_vex_arith(0x5E, dst, nds, src, VEX_SIMD_F2, /* vector256 */ false); |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2900 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2901 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2902 |
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
|
2903 |
assert(VM_Version::supports_avx(), ""); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2904 |
emit_vex_arith(0x5E, dst, nds, src, VEX_SIMD_F2, /* vector256 */ false); |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2905 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2906 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2907 |
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
|
2908 |
assert(VM_Version::supports_avx(), ""); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2909 |
emit_vex_arith(0x5E, dst, nds, src, VEX_SIMD_F3, /* vector256 */ false); |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2910 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2911 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2912 |
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
|
2913 |
assert(VM_Version::supports_avx(), ""); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2914 |
emit_vex_arith(0x5E, dst, nds, src, VEX_SIMD_F3, /* vector256 */ false); |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2915 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2916 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2917 |
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
|
2918 |
assert(VM_Version::supports_avx(), ""); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2919 |
emit_vex_arith(0x59, dst, nds, src, VEX_SIMD_F2, /* vector256 */ false); |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2920 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2921 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2922 |
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
|
2923 |
assert(VM_Version::supports_avx(), ""); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2924 |
emit_vex_arith(0x59, dst, nds, src, VEX_SIMD_F2, /* vector256 */ false); |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2925 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2926 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2927 |
void Assembler::vmulss(XMMRegister dst, XMMRegister nds, Address src) { |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2928 |
assert(VM_Version::supports_avx(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2929 |
emit_vex_arith(0x59, dst, nds, src, VEX_SIMD_F3, /* vector256 */ false); |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2930 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2931 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2932 |
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
|
2933 |
assert(VM_Version::supports_avx(), ""); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2934 |
emit_vex_arith(0x59, dst, nds, src, VEX_SIMD_F3, /* vector256 */ false); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2935 |
} |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2936 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2937 |
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
|
2938 |
assert(VM_Version::supports_avx(), ""); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2939 |
emit_vex_arith(0x5C, dst, nds, src, VEX_SIMD_F2, /* vector256 */ false); |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2940 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2941 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2942 |
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
|
2943 |
assert(VM_Version::supports_avx(), ""); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2944 |
emit_vex_arith(0x5C, dst, nds, src, VEX_SIMD_F2, /* vector256 */ false); |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2945 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2946 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2947 |
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
|
2948 |
assert(VM_Version::supports_avx(), ""); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2949 |
emit_vex_arith(0x5C, dst, nds, src, VEX_SIMD_F3, /* vector256 */ false); |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2950 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2951 |
|
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
2952 |
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
|
2953 |
assert(VM_Version::supports_avx(), ""); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2954 |
emit_vex_arith(0x5C, dst, nds, src, VEX_SIMD_F3, /* vector256 */ false); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2955 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2956 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2957 |
//====================VECTOR ARITHMETIC===================================== |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2958 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2959 |
// Float-point vector arithmetic |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2960 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2961 |
void Assembler::addpd(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2962 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2963 |
emit_simd_arith(0x58, dst, src, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2964 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2965 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2966 |
void Assembler::addps(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2967 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2968 |
emit_simd_arith(0x58, dst, src, VEX_SIMD_NONE); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2969 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2970 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2971 |
void Assembler::vaddpd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2972 |
assert(VM_Version::supports_avx(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2973 |
emit_vex_arith(0x58, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2974 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2975 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2976 |
void Assembler::vaddps(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2977 |
assert(VM_Version::supports_avx(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2978 |
emit_vex_arith(0x58, dst, nds, src, VEX_SIMD_NONE, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2979 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2980 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2981 |
void Assembler::vaddpd(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2982 |
assert(VM_Version::supports_avx(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2983 |
emit_vex_arith(0x58, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2984 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2985 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2986 |
void Assembler::vaddps(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2987 |
assert(VM_Version::supports_avx(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2988 |
emit_vex_arith(0x58, dst, nds, src, VEX_SIMD_NONE, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2989 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2990 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2991 |
void Assembler::subpd(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2992 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2993 |
emit_simd_arith(0x5C, dst, src, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2994 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2995 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2996 |
void Assembler::subps(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2997 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2998 |
emit_simd_arith(0x5C, dst, src, VEX_SIMD_NONE); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
2999 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3000 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3001 |
void Assembler::vsubpd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3002 |
assert(VM_Version::supports_avx(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3003 |
emit_vex_arith(0x5C, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3004 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3005 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3006 |
void Assembler::vsubps(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3007 |
assert(VM_Version::supports_avx(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3008 |
emit_vex_arith(0x5C, dst, nds, src, VEX_SIMD_NONE, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3009 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3010 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3011 |
void Assembler::vsubpd(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3012 |
assert(VM_Version::supports_avx(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3013 |
emit_vex_arith(0x5C, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3014 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3015 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3016 |
void Assembler::vsubps(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3017 |
assert(VM_Version::supports_avx(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3018 |
emit_vex_arith(0x5C, dst, nds, src, VEX_SIMD_NONE, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3019 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3020 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3021 |
void Assembler::mulpd(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3022 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3023 |
emit_simd_arith(0x59, dst, src, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3024 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3025 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3026 |
void Assembler::mulps(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3027 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3028 |
emit_simd_arith(0x59, dst, src, VEX_SIMD_NONE); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3029 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3030 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3031 |
void Assembler::vmulpd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3032 |
assert(VM_Version::supports_avx(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3033 |
emit_vex_arith(0x59, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3034 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3035 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3036 |
void Assembler::vmulps(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3037 |
assert(VM_Version::supports_avx(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3038 |
emit_vex_arith(0x59, dst, nds, src, VEX_SIMD_NONE, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3039 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3040 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3041 |
void Assembler::vmulpd(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
3042 |
assert(VM_Version::supports_avx(), ""); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3043 |
emit_vex_arith(0x59, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3044 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3045 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3046 |
void Assembler::vmulps(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3047 |
assert(VM_Version::supports_avx(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3048 |
emit_vex_arith(0x59, dst, nds, src, VEX_SIMD_NONE, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3049 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3050 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3051 |
void Assembler::divpd(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3052 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3053 |
emit_simd_arith(0x5E, dst, src, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3054 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3055 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3056 |
void Assembler::divps(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3057 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3058 |
emit_simd_arith(0x5E, dst, src, VEX_SIMD_NONE); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3059 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3060 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3061 |
void Assembler::vdivpd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3062 |
assert(VM_Version::supports_avx(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3063 |
emit_vex_arith(0x5E, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3064 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3065 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3066 |
void Assembler::vdivps(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3067 |
assert(VM_Version::supports_avx(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3068 |
emit_vex_arith(0x5E, dst, nds, src, VEX_SIMD_NONE, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3069 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3070 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3071 |
void Assembler::vdivpd(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3072 |
assert(VM_Version::supports_avx(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3073 |
emit_vex_arith(0x5E, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3074 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3075 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3076 |
void Assembler::vdivps(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3077 |
assert(VM_Version::supports_avx(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3078 |
emit_vex_arith(0x5E, dst, nds, src, VEX_SIMD_NONE, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3079 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3080 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3081 |
void Assembler::andpd(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3082 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3083 |
emit_simd_arith(0x54, dst, src, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3084 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3085 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3086 |
void Assembler::andps(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3087 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3088 |
emit_simd_arith(0x54, dst, src, VEX_SIMD_NONE); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3089 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3090 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3091 |
void Assembler::andps(XMMRegister dst, Address src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3092 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3093 |
emit_simd_arith(0x54, dst, src, VEX_SIMD_NONE); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3094 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3095 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3096 |
void Assembler::andpd(XMMRegister dst, Address src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3097 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3098 |
emit_simd_arith(0x54, dst, src, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3099 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3100 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3101 |
void Assembler::vandpd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3102 |
assert(VM_Version::supports_avx(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3103 |
emit_vex_arith(0x54, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3104 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3105 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3106 |
void Assembler::vandps(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3107 |
assert(VM_Version::supports_avx(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3108 |
emit_vex_arith(0x54, dst, nds, src, VEX_SIMD_NONE, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3109 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3110 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3111 |
void Assembler::vandpd(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3112 |
assert(VM_Version::supports_avx(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3113 |
emit_vex_arith(0x54, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3114 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3115 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3116 |
void Assembler::vandps(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3117 |
assert(VM_Version::supports_avx(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3118 |
emit_vex_arith(0x54, dst, nds, src, VEX_SIMD_NONE, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3119 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3120 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3121 |
void Assembler::xorpd(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3122 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3123 |
emit_simd_arith(0x57, dst, src, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3124 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3125 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3126 |
void Assembler::xorps(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3127 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3128 |
emit_simd_arith(0x57, dst, src, VEX_SIMD_NONE); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3129 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3130 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3131 |
void Assembler::xorpd(XMMRegister dst, Address src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3132 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3133 |
emit_simd_arith(0x57, dst, src, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3134 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3135 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3136 |
void Assembler::xorps(XMMRegister dst, Address src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3137 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3138 |
emit_simd_arith(0x57, dst, src, VEX_SIMD_NONE); |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
3139 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
3140 |
|
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
3141 |
void Assembler::vxorpd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
3142 |
assert(VM_Version::supports_avx(), ""); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3143 |
emit_vex_arith(0x57, dst, nds, src, VEX_SIMD_66, vector256); |
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
3144 |
} |
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
3145 |
|
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
3146 |
void Assembler::vxorps(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
3147 |
assert(VM_Version::supports_avx(), ""); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3148 |
emit_vex_arith(0x57, dst, nds, src, VEX_SIMD_NONE, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3149 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3150 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3151 |
void Assembler::vxorpd(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3152 |
assert(VM_Version::supports_avx(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3153 |
emit_vex_arith(0x57, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3154 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3155 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3156 |
void Assembler::vxorps(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3157 |
assert(VM_Version::supports_avx(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3158 |
emit_vex_arith(0x57, dst, nds, src, VEX_SIMD_NONE, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3159 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3160 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3161 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3162 |
// Integer vector arithmetic |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3163 |
void Assembler::paddb(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3164 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3165 |
emit_simd_arith(0xFC, dst, src, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3166 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3167 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3168 |
void Assembler::paddw(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3169 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3170 |
emit_simd_arith(0xFD, dst, src, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3171 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3172 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3173 |
void Assembler::paddd(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3174 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3175 |
emit_simd_arith(0xFE, dst, src, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3176 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3177 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3178 |
void Assembler::paddq(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3179 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3180 |
emit_simd_arith(0xD4, dst, src, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3181 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3182 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3183 |
void Assembler::vpaddb(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3184 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3185 |
emit_vex_arith(0xFC, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3186 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3187 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3188 |
void Assembler::vpaddw(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3189 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3190 |
emit_vex_arith(0xFD, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3191 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3192 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3193 |
void Assembler::vpaddd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3194 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3195 |
emit_vex_arith(0xFE, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3196 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3197 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3198 |
void Assembler::vpaddq(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3199 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3200 |
emit_vex_arith(0xD4, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3201 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3202 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3203 |
void Assembler::vpaddb(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3204 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3205 |
emit_vex_arith(0xFC, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3206 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3207 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3208 |
void Assembler::vpaddw(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3209 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3210 |
emit_vex_arith(0xFD, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3211 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3212 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3213 |
void Assembler::vpaddd(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3214 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3215 |
emit_vex_arith(0xFE, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3216 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3217 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3218 |
void Assembler::vpaddq(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3219 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3220 |
emit_vex_arith(0xD4, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3221 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3222 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3223 |
void Assembler::psubb(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3224 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3225 |
emit_simd_arith(0xF8, dst, src, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3226 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3227 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3228 |
void Assembler::psubw(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3229 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3230 |
emit_simd_arith(0xF9, dst, src, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3231 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3232 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3233 |
void Assembler::psubd(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3234 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3235 |
emit_simd_arith(0xFA, dst, src, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3236 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3237 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3238 |
void Assembler::psubq(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3239 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3240 |
emit_simd_arith(0xFB, dst, src, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3241 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3242 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3243 |
void Assembler::vpsubb(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3244 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3245 |
emit_vex_arith(0xF8, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3246 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3247 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3248 |
void Assembler::vpsubw(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3249 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3250 |
emit_vex_arith(0xF9, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3251 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3252 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3253 |
void Assembler::vpsubd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3254 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3255 |
emit_vex_arith(0xFA, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3256 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3257 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3258 |
void Assembler::vpsubq(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3259 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3260 |
emit_vex_arith(0xFB, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3261 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3262 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3263 |
void Assembler::vpsubb(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3264 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3265 |
emit_vex_arith(0xF8, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3266 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3267 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3268 |
void Assembler::vpsubw(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3269 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3270 |
emit_vex_arith(0xF9, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3271 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3272 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3273 |
void Assembler::vpsubd(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3274 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3275 |
emit_vex_arith(0xFA, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3276 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3277 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3278 |
void Assembler::vpsubq(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3279 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3280 |
emit_vex_arith(0xFB, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3281 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3282 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3283 |
void Assembler::pmullw(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3284 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3285 |
emit_simd_arith(0xD5, dst, src, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3286 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3287 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3288 |
void Assembler::pmulld(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3289 |
assert(VM_Version::supports_sse4_1(), ""); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3290 |
int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3291 |
emit_int8(0x40); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3292 |
emit_int8((unsigned char)(0xC0 | encode)); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3293 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3294 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3295 |
void Assembler::vpmullw(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3296 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3297 |
emit_vex_arith(0xD5, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3298 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3299 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3300 |
void Assembler::vpmulld(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3301 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3302 |
int encode = vex_prefix_and_encode(dst, nds, src, VEX_SIMD_66, vector256, VEX_OPCODE_0F_38); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3303 |
emit_int8(0x40); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3304 |
emit_int8((unsigned char)(0xC0 | encode)); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3305 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3306 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3307 |
void Assembler::vpmullw(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3308 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3309 |
emit_vex_arith(0xD5, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3310 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3311 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3312 |
void Assembler::vpmulld(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3313 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3314 |
InstructionMark im(this); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3315 |
int dst_enc = dst->encoding(); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3316 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3317 |
vex_prefix(src, nds_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F_38, false, vector256); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3318 |
emit_int8(0x40); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3319 |
emit_operand(dst, src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3320 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3321 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3322 |
// Shift packed integers left by specified number of bits. |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3323 |
void Assembler::psllw(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3324 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3325 |
// XMM6 is for /6 encoding: 66 0F 71 /6 ib |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3326 |
int encode = simd_prefix_and_encode(xmm6, dst, dst, VEX_SIMD_66); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3327 |
emit_int8(0x71); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3328 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3329 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3330 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3331 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3332 |
void Assembler::pslld(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3333 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3334 |
// XMM6 is for /6 encoding: 66 0F 72 /6 ib |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3335 |
int encode = simd_prefix_and_encode(xmm6, dst, dst, VEX_SIMD_66); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3336 |
emit_int8(0x72); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3337 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3338 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3339 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3340 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3341 |
void Assembler::psllq(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3342 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3343 |
// XMM6 is for /6 encoding: 66 0F 73 /6 ib |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3344 |
int encode = simd_prefix_and_encode(xmm6, dst, dst, VEX_SIMD_66); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3345 |
emit_int8(0x73); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3346 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3347 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3348 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3349 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3350 |
void Assembler::psllw(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3351 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3352 |
emit_simd_arith(0xF1, dst, shift, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3353 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3354 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3355 |
void Assembler::pslld(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3356 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3357 |
emit_simd_arith(0xF2, dst, shift, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3358 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3359 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3360 |
void Assembler::psllq(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3361 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3362 |
emit_simd_arith(0xF3, dst, shift, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3363 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3364 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3365 |
void Assembler::vpsllw(XMMRegister dst, XMMRegister src, int shift, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3366 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3367 |
// XMM6 is for /6 encoding: 66 0F 71 /6 ib |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3368 |
emit_vex_arith(0x71, xmm6, dst, src, VEX_SIMD_66, vector256); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3369 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3370 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3371 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3372 |
void Assembler::vpslld(XMMRegister dst, XMMRegister src, int shift, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3373 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3374 |
// XMM6 is for /6 encoding: 66 0F 72 /6 ib |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3375 |
emit_vex_arith(0x72, xmm6, dst, src, VEX_SIMD_66, vector256); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3376 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3377 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3378 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3379 |
void Assembler::vpsllq(XMMRegister dst, XMMRegister src, int shift, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3380 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3381 |
// XMM6 is for /6 encoding: 66 0F 73 /6 ib |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3382 |
emit_vex_arith(0x73, xmm6, dst, src, VEX_SIMD_66, vector256); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3383 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3384 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3385 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3386 |
void Assembler::vpsllw(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3387 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3388 |
emit_vex_arith(0xF1, dst, src, shift, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3389 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3390 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3391 |
void Assembler::vpslld(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3392 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3393 |
emit_vex_arith(0xF2, dst, src, shift, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3394 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3395 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3396 |
void Assembler::vpsllq(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3397 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3398 |
emit_vex_arith(0xF3, dst, src, shift, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3399 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3400 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3401 |
// Shift packed integers logically right by specified number of bits. |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3402 |
void Assembler::psrlw(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3403 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3404 |
// XMM2 is for /2 encoding: 66 0F 71 /2 ib |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3405 |
int encode = simd_prefix_and_encode(xmm2, dst, dst, VEX_SIMD_66); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3406 |
emit_int8(0x71); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3407 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3408 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3409 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3410 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3411 |
void Assembler::psrld(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3412 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3413 |
// XMM2 is for /2 encoding: 66 0F 72 /2 ib |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3414 |
int encode = simd_prefix_and_encode(xmm2, dst, dst, VEX_SIMD_66); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3415 |
emit_int8(0x72); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3416 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3417 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3418 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3419 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3420 |
void Assembler::psrlq(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3421 |
// Do not confuse it with psrldq SSE2 instruction which |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3422 |
// shifts 128 bit value in xmm register by number of bytes. |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3423 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3424 |
// XMM2 is for /2 encoding: 66 0F 73 /2 ib |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3425 |
int encode = simd_prefix_and_encode(xmm2, dst, dst, VEX_SIMD_66); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3426 |
emit_int8(0x73); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3427 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3428 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3429 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3430 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3431 |
void Assembler::psrlw(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3432 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3433 |
emit_simd_arith(0xD1, dst, shift, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3434 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3435 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3436 |
void Assembler::psrld(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3437 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3438 |
emit_simd_arith(0xD2, dst, shift, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3439 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3440 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3441 |
void Assembler::psrlq(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3442 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3443 |
emit_simd_arith(0xD3, dst, shift, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3444 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3445 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3446 |
void Assembler::vpsrlw(XMMRegister dst, XMMRegister src, int shift, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3447 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3448 |
// XMM2 is for /2 encoding: 66 0F 73 /2 ib |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3449 |
emit_vex_arith(0x71, xmm2, dst, src, VEX_SIMD_66, vector256); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3450 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3451 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3452 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3453 |
void Assembler::vpsrld(XMMRegister dst, XMMRegister src, int shift, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3454 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3455 |
// XMM2 is for /2 encoding: 66 0F 73 /2 ib |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3456 |
emit_vex_arith(0x72, xmm2, dst, src, VEX_SIMD_66, vector256); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3457 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3458 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3459 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3460 |
void Assembler::vpsrlq(XMMRegister dst, XMMRegister src, int shift, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3461 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3462 |
// XMM2 is for /2 encoding: 66 0F 73 /2 ib |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3463 |
emit_vex_arith(0x73, xmm2, dst, src, VEX_SIMD_66, vector256); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3464 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3465 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3466 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3467 |
void Assembler::vpsrlw(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3468 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3469 |
emit_vex_arith(0xD1, dst, src, shift, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3470 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3471 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3472 |
void Assembler::vpsrld(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3473 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3474 |
emit_vex_arith(0xD2, dst, src, shift, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3475 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3476 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3477 |
void Assembler::vpsrlq(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3478 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3479 |
emit_vex_arith(0xD3, dst, src, shift, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3480 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3481 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3482 |
// Shift packed integers arithmetically right by specified number of bits. |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3483 |
void Assembler::psraw(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3484 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3485 |
// XMM4 is for /4 encoding: 66 0F 71 /4 ib |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3486 |
int encode = simd_prefix_and_encode(xmm4, dst, dst, VEX_SIMD_66); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3487 |
emit_int8(0x71); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3488 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3489 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3490 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3491 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3492 |
void Assembler::psrad(XMMRegister dst, int shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3493 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3494 |
// XMM4 is for /4 encoding: 66 0F 72 /4 ib |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3495 |
int encode = simd_prefix_and_encode(xmm4, dst, dst, VEX_SIMD_66); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3496 |
emit_int8(0x72); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3497 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3498 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3499 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3500 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3501 |
void Assembler::psraw(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3502 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3503 |
emit_simd_arith(0xE1, dst, shift, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3504 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3505 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3506 |
void Assembler::psrad(XMMRegister dst, XMMRegister shift) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3507 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3508 |
emit_simd_arith(0xE2, dst, shift, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3509 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3510 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3511 |
void Assembler::vpsraw(XMMRegister dst, XMMRegister src, int shift, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3512 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3513 |
// XMM4 is for /4 encoding: 66 0F 71 /4 ib |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3514 |
emit_vex_arith(0x71, xmm4, dst, src, VEX_SIMD_66, vector256); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3515 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3516 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3517 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3518 |
void Assembler::vpsrad(XMMRegister dst, XMMRegister src, int shift, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3519 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3520 |
// XMM4 is for /4 encoding: 66 0F 71 /4 ib |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3521 |
emit_vex_arith(0x72, xmm4, dst, src, VEX_SIMD_66, vector256); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3522 |
emit_int8(shift & 0xFF); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3523 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3524 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3525 |
void Assembler::vpsraw(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3526 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3527 |
emit_vex_arith(0xE1, dst, src, shift, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3528 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3529 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3530 |
void Assembler::vpsrad(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3531 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3532 |
emit_vex_arith(0xE2, dst, src, shift, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3533 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3534 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3535 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3536 |
// AND packed integers |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3537 |
void Assembler::pand(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3538 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3539 |
emit_simd_arith(0xDB, dst, src, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3540 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3541 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3542 |
void Assembler::vpand(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3543 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3544 |
emit_vex_arith(0xDB, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3545 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3546 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3547 |
void Assembler::vpand(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3548 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3549 |
emit_vex_arith(0xDB, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3550 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3551 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3552 |
void Assembler::por(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3553 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3554 |
emit_simd_arith(0xEB, dst, src, VEX_SIMD_66); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3555 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3556 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3557 |
void Assembler::vpor(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3558 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3559 |
emit_vex_arith(0xEB, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3560 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3561 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3562 |
void Assembler::vpor(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3563 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3564 |
emit_vex_arith(0xEB, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3565 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3566 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3567 |
void Assembler::pxor(XMMRegister dst, XMMRegister src) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3568 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3569 |
emit_simd_arith(0xEF, dst, src, VEX_SIMD_66); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
3570 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
3571 |
|
13294 | 3572 |
void Assembler::vpxor(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3573 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3574 |
emit_vex_arith(0xEF, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3575 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3576 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3577 |
void Assembler::vpxor(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3578 |
assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3579 |
emit_vex_arith(0xEF, dst, nds, src, VEX_SIMD_66, vector256); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3580 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
3581 |
|
13294 | 3582 |
|
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
3583 |
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
|
3584 |
assert(VM_Version::supports_avx(), ""); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
3585 |
bool vector256 = true; |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
3586 |
int encode = vex_prefix_and_encode(dst, nds, src, VEX_SIMD_66, vector256, VEX_OPCODE_0F_3A); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3587 |
emit_int8(0x18); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3588 |
emit_int8((unsigned char)(0xC0 | encode)); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
3589 |
// 0x00 - insert into lower 128 bits |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
3590 |
// 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
|
3591 |
emit_int8(0x01); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
3592 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
3593 |
|
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3594 |
void Assembler::vinsertf128h(XMMRegister dst, Address src) { |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3595 |
assert(VM_Version::supports_avx(), ""); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3596 |
InstructionMark im(this); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3597 |
bool vector256 = true; |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3598 |
assert(dst != xnoreg, "sanity"); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3599 |
int dst_enc = dst->encoding(); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3600 |
// swap src<->dst for encoding |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3601 |
vex_prefix(src, dst_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F_3A, false, vector256); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3602 |
emit_int8(0x18); |
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3603 |
emit_operand(dst, src); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3604 |
// 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
|
3605 |
emit_int8(0x01); |
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3606 |
} |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3607 |
|
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3608 |
void Assembler::vextractf128h(Address dst, XMMRegister src) { |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3609 |
assert(VM_Version::supports_avx(), ""); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3610 |
InstructionMark im(this); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3611 |
bool vector256 = true; |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3612 |
assert(src != xnoreg, "sanity"); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3613 |
int src_enc = src->encoding(); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3614 |
vex_prefix(dst, 0, src_enc, VEX_SIMD_66, VEX_OPCODE_0F_3A, false, vector256); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3615 |
emit_int8(0x19); |
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3616 |
emit_operand(src, dst); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3617 |
// 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
|
3618 |
emit_int8(0x01); |
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3619 |
} |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3620 |
|
13294 | 3621 |
void Assembler::vinserti128h(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
3622 |
assert(VM_Version::supports_avx2(), ""); |
|
3623 |
bool vector256 = true; |
|
3624 |
int encode = vex_prefix_and_encode(dst, nds, src, VEX_SIMD_66, vector256, VEX_OPCODE_0F_3A); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3625 |
emit_int8(0x38); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3626 |
emit_int8((unsigned char)(0xC0 | encode)); |
13294 | 3627 |
// 0x00 - insert into lower 128 bits |
3628 |
// 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
|
3629 |
emit_int8(0x01); |
13294 | 3630 |
} |
3631 |
||
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3632 |
void Assembler::vinserti128h(XMMRegister dst, Address src) { |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3633 |
assert(VM_Version::supports_avx2(), ""); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3634 |
InstructionMark im(this); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3635 |
bool vector256 = true; |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3636 |
assert(dst != xnoreg, "sanity"); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3637 |
int dst_enc = dst->encoding(); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3638 |
// swap src<->dst for encoding |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3639 |
vex_prefix(src, dst_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F_3A, false, vector256); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3640 |
emit_int8(0x38); |
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3641 |
emit_operand(dst, src); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3642 |
// 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
|
3643 |
emit_int8(0x01); |
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3644 |
} |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3645 |
|
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3646 |
void Assembler::vextracti128h(Address dst, XMMRegister src) { |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3647 |
assert(VM_Version::supports_avx2(), ""); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3648 |
InstructionMark im(this); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3649 |
bool vector256 = true; |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3650 |
assert(src != xnoreg, "sanity"); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3651 |
int src_enc = src->encoding(); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3652 |
vex_prefix(dst, 0, src_enc, VEX_SIMD_66, VEX_OPCODE_0F_3A, false, vector256); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3653 |
emit_int8(0x39); |
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3654 |
emit_operand(src, dst); |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3655 |
// 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
|
3656 |
emit_int8(0x01); |
13883
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3657 |
} |
6979b9850feb
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
13728
diff
changeset
|
3658 |
|
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
3659 |
void Assembler::vzeroupper() { |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
3660 |
assert(VM_Version::supports_avx(), ""); |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
3661 |
(void)vex_prefix_and_encode(xmm0, xmm0, xmm0, VEX_SIMD_NONE); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3662 |
emit_int8(0x77); |
13104
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
3663 |
} |
657b387034fb
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
12955
diff
changeset
|
3664 |
|
11429
e894217a5d94
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
11427
diff
changeset
|
3665 |
|
1066 | 3666 |
#ifndef _LP64 |
3667 |
// 32bit only pieces of the assembler |
|
3668 |
||
3669 |
void Assembler::cmp_literal32(Register src1, int32_t imm32, RelocationHolder const& rspec) { |
|
3670 |
// NO PREFIX AS NEVER 64BIT |
|
3671 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3672 |
emit_int8((unsigned char)0x81); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3673 |
emit_int8((unsigned char)(0xF8 | src1->encoding())); |
1066 | 3674 |
emit_data(imm32, rspec, 0); |
3675 |
} |
|
3676 |
||
3677 |
void Assembler::cmp_literal32(Address src1, int32_t imm32, RelocationHolder const& rspec) { |
|
3678 |
// NO PREFIX AS NEVER 64BIT (not even 32bit versions of 64bit regs |
|
3679 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3680 |
emit_int8((unsigned char)0x81); |
1066 | 3681 |
emit_operand(rdi, src1); |
3682 |
emit_data(imm32, rspec, 0); |
|
3683 |
} |
|
3684 |
||
3685 |
// The 64-bit (32bit platform) cmpxchg compares the value at adr with the contents of rdx:rax, |
|
3686 |
// and stores rcx:rbx into adr if so; otherwise, the value at adr is loaded |
|
3687 |
// into rdx:rax. The ZF is set if the compared values were equal, and cleared otherwise. |
|
3688 |
void Assembler::cmpxchg8(Address adr) { |
|
3689 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3690 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3691 |
emit_int8((unsigned char)0xC7); |
1066 | 3692 |
emit_operand(rcx, adr); |
3693 |
} |
|
3694 |
||
3695 |
void Assembler::decl(Register dst) { |
|
3696 |
// 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
|
3697 |
emit_int8(0x48 | dst->encoding()); |
1066 | 3698 |
} |
3699 |
||
3700 |
#endif // _LP64 |
|
3701 |
||
3702 |
// 64bit typically doesn't use the x87 but needs to for the trig funcs |
|
3703 |
||
3704 |
void Assembler::fabs() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3705 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3706 |
emit_int8((unsigned char)0xE1); |
1066 | 3707 |
} |
3708 |
||
3709 |
void Assembler::fadd(int i) { |
|
3710 |
emit_farith(0xD8, 0xC0, i); |
|
3711 |
} |
|
3712 |
||
3713 |
void Assembler::fadd_d(Address src) { |
|
3714 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3715 |
emit_int8((unsigned char)0xDC); |
1066 | 3716 |
emit_operand32(rax, src); |
3717 |
} |
|
3718 |
||
3719 |
void Assembler::fadd_s(Address src) { |
|
3720 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3721 |
emit_int8((unsigned char)0xD8); |
1066 | 3722 |
emit_operand32(rax, src); |
3723 |
} |
|
3724 |
||
3725 |
void Assembler::fadda(int i) { |
|
3726 |
emit_farith(0xDC, 0xC0, i); |
|
3727 |
} |
|
3728 |
||
3729 |
void Assembler::faddp(int i) { |
|
3730 |
emit_farith(0xDE, 0xC0, i); |
|
3731 |
} |
|
3732 |
||
3733 |
void Assembler::fchs() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3734 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3735 |
emit_int8((unsigned char)0xE0); |
1066 | 3736 |
} |
3737 |
||
3738 |
void Assembler::fcom(int i) { |
|
3739 |
emit_farith(0xD8, 0xD0, i); |
|
3740 |
} |
|
3741 |
||
3742 |
void Assembler::fcomp(int i) { |
|
3743 |
emit_farith(0xD8, 0xD8, i); |
|
3744 |
} |
|
3745 |
||
3746 |
void Assembler::fcomp_d(Address src) { |
|
3747 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3748 |
emit_int8((unsigned char)0xDC); |
1066 | 3749 |
emit_operand32(rbx, src); |
3750 |
} |
|
3751 |
||
3752 |
void Assembler::fcomp_s(Address src) { |
|
3753 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3754 |
emit_int8((unsigned char)0xD8); |
1066 | 3755 |
emit_operand32(rbx, src); |
3756 |
} |
|
3757 |
||
3758 |
void Assembler::fcompp() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3759 |
emit_int8((unsigned char)0xDE); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3760 |
emit_int8((unsigned char)0xD9); |
1066 | 3761 |
} |
3762 |
||
3763 |
void Assembler::fcos() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3764 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3765 |
emit_int8((unsigned char)0xFF); |
1066 | 3766 |
} |
3767 |
||
3768 |
void Assembler::fdecstp() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3769 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3770 |
emit_int8((unsigned char)0xF6); |
1066 | 3771 |
} |
3772 |
||
3773 |
void Assembler::fdiv(int i) { |
|
3774 |
emit_farith(0xD8, 0xF0, i); |
|
3775 |
} |
|
3776 |
||
3777 |
void Assembler::fdiv_d(Address src) { |
|
3778 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3779 |
emit_int8((unsigned char)0xDC); |
1066 | 3780 |
emit_operand32(rsi, src); |
3781 |
} |
|
3782 |
||
3783 |
void Assembler::fdiv_s(Address src) { |
|
3784 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3785 |
emit_int8((unsigned char)0xD8); |
1066 | 3786 |
emit_operand32(rsi, src); |
3787 |
} |
|
3788 |
||
3789 |
void Assembler::fdiva(int i) { |
|
3790 |
emit_farith(0xDC, 0xF8, i); |
|
3791 |
} |
|
3792 |
||
3793 |
// Note: The Intel manual (Pentium Processor User's Manual, Vol.3, 1994) |
|
3794 |
// is erroneous for some of the floating-point instructions below. |
|
3795 |
||
3796 |
void Assembler::fdivp(int i) { |
|
3797 |
emit_farith(0xDE, 0xF8, i); // ST(0) <- ST(0) / ST(1) and pop (Intel manual wrong) |
|
3798 |
} |
|
3799 |
||
3800 |
void Assembler::fdivr(int i) { |
|
3801 |
emit_farith(0xD8, 0xF8, i); |
|
3802 |
} |
|
3803 |
||
3804 |
void Assembler::fdivr_d(Address src) { |
|
3805 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3806 |
emit_int8((unsigned char)0xDC); |
1066 | 3807 |
emit_operand32(rdi, src); |
3808 |
} |
|
3809 |
||
3810 |
void Assembler::fdivr_s(Address src) { |
|
3811 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3812 |
emit_int8((unsigned char)0xD8); |
1066 | 3813 |
emit_operand32(rdi, src); |
3814 |
} |
|
3815 |
||
3816 |
void Assembler::fdivra(int i) { |
|
3817 |
emit_farith(0xDC, 0xF0, i); |
|
3818 |
} |
|
3819 |
||
3820 |
void Assembler::fdivrp(int i) { |
|
3821 |
emit_farith(0xDE, 0xF0, i); // ST(0) <- ST(1) / ST(0) and pop (Intel manual wrong) |
|
3822 |
} |
|
3823 |
||
3824 |
void Assembler::ffree(int i) { |
|
3825 |
emit_farith(0xDD, 0xC0, i); |
|
3826 |
} |
|
3827 |
||
3828 |
void Assembler::fild_d(Address adr) { |
|
3829 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3830 |
emit_int8((unsigned char)0xDF); |
1066 | 3831 |
emit_operand32(rbp, adr); |
3832 |
} |
|
3833 |
||
3834 |
void Assembler::fild_s(Address adr) { |
|
3835 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3836 |
emit_int8((unsigned char)0xDB); |
1066 | 3837 |
emit_operand32(rax, adr); |
3838 |
} |
|
3839 |
||
3840 |
void Assembler::fincstp() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3841 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3842 |
emit_int8((unsigned char)0xF7); |
1066 | 3843 |
} |
3844 |
||
3845 |
void Assembler::finit() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3846 |
emit_int8((unsigned char)0x9B); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3847 |
emit_int8((unsigned char)0xDB); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3848 |
emit_int8((unsigned char)0xE3); |
1066 | 3849 |
} |
3850 |
||
3851 |
void Assembler::fist_s(Address adr) { |
|
3852 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3853 |
emit_int8((unsigned char)0xDB); |
1066 | 3854 |
emit_operand32(rdx, adr); |
3855 |
} |
|
3856 |
||
3857 |
void Assembler::fistp_d(Address adr) { |
|
3858 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3859 |
emit_int8((unsigned char)0xDF); |
1066 | 3860 |
emit_operand32(rdi, adr); |
3861 |
} |
|
3862 |
||
3863 |
void Assembler::fistp_s(Address adr) { |
|
3864 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3865 |
emit_int8((unsigned char)0xDB); |
1066 | 3866 |
emit_operand32(rbx, adr); |
3867 |
} |
|
1 | 3868 |
|
3869 |
void Assembler::fld1() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3870 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3871 |
emit_int8((unsigned char)0xE8); |
1 | 3872 |
} |
3873 |
||
1066 | 3874 |
void Assembler::fld_d(Address adr) { |
3875 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3876 |
emit_int8((unsigned char)0xDD); |
1066 | 3877 |
emit_operand32(rax, adr); |
3878 |
} |
|
1 | 3879 |
|
3880 |
void Assembler::fld_s(Address adr) { |
|
3881 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3882 |
emit_int8((unsigned char)0xD9); |
1066 | 3883 |
emit_operand32(rax, adr); |
3884 |
} |
|
3885 |
||
3886 |
||
3887 |
void Assembler::fld_s(int index) { |
|
1 | 3888 |
emit_farith(0xD9, 0xC0, index); |
3889 |
} |
|
3890 |
||
3891 |
void Assembler::fld_x(Address adr) { |
|
3892 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3893 |
emit_int8((unsigned char)0xDB); |
1066 | 3894 |
emit_operand32(rbp, adr); |
3895 |
} |
|
3896 |
||
3897 |
void Assembler::fldcw(Address src) { |
|
3898 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3899 |
emit_int8((unsigned char)0xD9); |
1066 | 3900 |
emit_operand32(rbp, src); |
3901 |
} |
|
3902 |
||
3903 |
void Assembler::fldenv(Address src) { |
|
1 | 3904 |
InstructionMark im(this); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3905 |
emit_int8((unsigned char)0xD9); |
1066 | 3906 |
emit_operand32(rsp, src); |
3907 |
} |
|
3908 |
||
3909 |
void Assembler::fldlg2() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3910 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3911 |
emit_int8((unsigned char)0xEC); |
1066 | 3912 |
} |
1 | 3913 |
|
3914 |
void Assembler::fldln2() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3915 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3916 |
emit_int8((unsigned char)0xED); |
1 | 3917 |
} |
3918 |
||
1066 | 3919 |
void Assembler::fldz() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3920 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3921 |
emit_int8((unsigned char)0xEE); |
1066 | 3922 |
} |
1 | 3923 |
|
3924 |
void Assembler::flog() { |
|
3925 |
fldln2(); |
|
3926 |
fxch(); |
|
3927 |
fyl2x(); |
|
3928 |
} |
|
3929 |
||
3930 |
void Assembler::flog10() { |
|
3931 |
fldlg2(); |
|
3932 |
fxch(); |
|
3933 |
fyl2x(); |
|
3934 |
} |
|
3935 |
||
1066 | 3936 |
void Assembler::fmul(int i) { |
3937 |
emit_farith(0xD8, 0xC8, i); |
|
3938 |
} |
|
3939 |
||
3940 |
void Assembler::fmul_d(Address src) { |
|
3941 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3942 |
emit_int8((unsigned char)0xDC); |
1066 | 3943 |
emit_operand32(rcx, src); |
3944 |
} |
|
3945 |
||
3946 |
void Assembler::fmul_s(Address src) { |
|
3947 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3948 |
emit_int8((unsigned char)0xD8); |
1066 | 3949 |
emit_operand32(rcx, src); |
3950 |
} |
|
3951 |
||
3952 |
void Assembler::fmula(int i) { |
|
3953 |
emit_farith(0xDC, 0xC8, i); |
|
3954 |
} |
|
3955 |
||
3956 |
void Assembler::fmulp(int i) { |
|
3957 |
emit_farith(0xDE, 0xC8, i); |
|
3958 |
} |
|
3959 |
||
3960 |
void Assembler::fnsave(Address dst) { |
|
3961 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3962 |
emit_int8((unsigned char)0xDD); |
1066 | 3963 |
emit_operand32(rsi, dst); |
3964 |
} |
|
3965 |
||
3966 |
void Assembler::fnstcw(Address src) { |
|
3967 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3968 |
emit_int8((unsigned char)0x9B); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3969 |
emit_int8((unsigned char)0xD9); |
1066 | 3970 |
emit_operand32(rdi, src); |
3971 |
} |
|
3972 |
||
3973 |
void Assembler::fnstsw_ax() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3974 |
emit_int8((unsigned char)0xDF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3975 |
emit_int8((unsigned char)0xE0); |
1066 | 3976 |
} |
3977 |
||
3978 |
void Assembler::fprem() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3979 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3980 |
emit_int8((unsigned char)0xF8); |
1066 | 3981 |
} |
3982 |
||
3983 |
void Assembler::fprem1() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3984 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3985 |
emit_int8((unsigned char)0xF5); |
1066 | 3986 |
} |
3987 |
||
3988 |
void Assembler::frstor(Address src) { |
|
3989 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3990 |
emit_int8((unsigned char)0xDD); |
1066 | 3991 |
emit_operand32(rsp, src); |
3992 |
} |
|
1 | 3993 |
|
3994 |
void Assembler::fsin() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3995 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
3996 |
emit_int8((unsigned char)0xFE); |
1 | 3997 |
} |
3998 |
||
1066 | 3999 |
void Assembler::fsqrt() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4000 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4001 |
emit_int8((unsigned char)0xFA); |
1066 | 4002 |
} |
4003 |
||
4004 |
void Assembler::fst_d(Address adr) { |
|
4005 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4006 |
emit_int8((unsigned char)0xDD); |
1066 | 4007 |
emit_operand32(rdx, adr); |
4008 |
} |
|
4009 |
||
4010 |
void Assembler::fst_s(Address adr) { |
|
4011 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4012 |
emit_int8((unsigned char)0xD9); |
1066 | 4013 |
emit_operand32(rdx, adr); |
4014 |
} |
|
4015 |
||
4016 |
void Assembler::fstp_d(Address adr) { |
|
4017 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4018 |
emit_int8((unsigned char)0xDD); |
1066 | 4019 |
emit_operand32(rbx, adr); |
4020 |
} |
|
4021 |
||
4022 |
void Assembler::fstp_d(int index) { |
|
4023 |
emit_farith(0xDD, 0xD8, index); |
|
4024 |
} |
|
4025 |
||
4026 |
void Assembler::fstp_s(Address adr) { |
|
4027 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4028 |
emit_int8((unsigned char)0xD9); |
1066 | 4029 |
emit_operand32(rbx, adr); |
4030 |
} |
|
4031 |
||
4032 |
void Assembler::fstp_x(Address adr) { |
|
4033 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4034 |
emit_int8((unsigned char)0xDB); |
1066 | 4035 |
emit_operand32(rdi, adr); |
4036 |
} |
|
4037 |
||
4038 |
void Assembler::fsub(int i) { |
|
4039 |
emit_farith(0xD8, 0xE0, i); |
|
4040 |
} |
|
4041 |
||
4042 |
void Assembler::fsub_d(Address src) { |
|
4043 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4044 |
emit_int8((unsigned char)0xDC); |
1066 | 4045 |
emit_operand32(rsp, src); |
4046 |
} |
|
4047 |
||
4048 |
void Assembler::fsub_s(Address src) { |
|
4049 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4050 |
emit_int8((unsigned char)0xD8); |
1066 | 4051 |
emit_operand32(rsp, src); |
4052 |
} |
|
4053 |
||
4054 |
void Assembler::fsuba(int i) { |
|
4055 |
emit_farith(0xDC, 0xE8, i); |
|
4056 |
} |
|
4057 |
||
4058 |
void Assembler::fsubp(int i) { |
|
4059 |
emit_farith(0xDE, 0xE8, i); // ST(0) <- ST(0) - ST(1) and pop (Intel manual wrong) |
|
4060 |
} |
|
4061 |
||
4062 |
void Assembler::fsubr(int i) { |
|
4063 |
emit_farith(0xD8, 0xE8, i); |
|
4064 |
} |
|
4065 |
||
4066 |
void Assembler::fsubr_d(Address src) { |
|
4067 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4068 |
emit_int8((unsigned char)0xDC); |
1066 | 4069 |
emit_operand32(rbp, src); |
4070 |
} |
|
4071 |
||
4072 |
void Assembler::fsubr_s(Address src) { |
|
4073 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4074 |
emit_int8((unsigned char)0xD8); |
1066 | 4075 |
emit_operand32(rbp, src); |
4076 |
} |
|
4077 |
||
4078 |
void Assembler::fsubra(int i) { |
|
4079 |
emit_farith(0xDC, 0xE0, i); |
|
4080 |
} |
|
4081 |
||
4082 |
void Assembler::fsubrp(int i) { |
|
4083 |
emit_farith(0xDE, 0xE0, i); // ST(0) <- ST(1) - ST(0) and pop (Intel manual wrong) |
|
1 | 4084 |
} |
4085 |
||
4086 |
void Assembler::ftan() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4087 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4088 |
emit_int8((unsigned char)0xF2); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4089 |
emit_int8((unsigned char)0xDD); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4090 |
emit_int8((unsigned char)0xD8); |
1 | 4091 |
} |
4092 |
||
1066 | 4093 |
void Assembler::ftst() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4094 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4095 |
emit_int8((unsigned char)0xE4); |
1066 | 4096 |
} |
1 | 4097 |
|
4098 |
void Assembler::fucomi(int i) { |
|
4099 |
// make sure the instruction is supported (introduced for P6, together with cmov) |
|
4100 |
guarantee(VM_Version::supports_cmov(), "illegal instruction"); |
|
4101 |
emit_farith(0xDB, 0xE8, i); |
|
4102 |
} |
|
4103 |
||
4104 |
void Assembler::fucomip(int i) { |
|
4105 |
// make sure the instruction is supported (introduced for P6, together with cmov) |
|
4106 |
guarantee(VM_Version::supports_cmov(), "illegal instruction"); |
|
4107 |
emit_farith(0xDF, 0xE8, i); |
|
4108 |
} |
|
4109 |
||
4110 |
void Assembler::fwait() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4111 |
emit_int8((unsigned char)0x9B); |
1 | 4112 |
} |
4113 |
||
1066 | 4114 |
void Assembler::fxch(int i) { |
4115 |
emit_farith(0xD9, 0xC8, i); |
|
4116 |
} |
|
4117 |
||
4118 |
void Assembler::fyl2x() { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4119 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4120 |
emit_int8((unsigned char)0xF1); |
1066 | 4121 |
} |
4122 |
||
12739
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
4123 |
void Assembler::frndint() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4124 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4125 |
emit_int8((unsigned char)0xFC); |
12739
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
4126 |
} |
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
4127 |
|
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
4128 |
void Assembler::f2xm1() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4129 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4130 |
emit_int8((unsigned char)0xF0); |
12739
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
4131 |
} |
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
4132 |
|
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
4133 |
void Assembler::fldl2e() { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4134 |
emit_int8((unsigned char)0xD9); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4135 |
emit_int8((unsigned char)0xEA); |
12739
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
4136 |
} |
09f26b73ae66
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
12268
diff
changeset
|
4137 |
|
11427 | 4138 |
// SSE SIMD prefix byte values corresponding to VexSimdPrefix encoding. |
4139 |
static int simd_pre[4] = { 0, 0x66, 0xF3, 0xF2 }; |
|
4140 |
// SSE opcode second byte values (first is 0x0F) corresponding to VexOpcode encoding. |
|
4141 |
static int simd_opc[4] = { 0, 0, 0x38, 0x3A }; |
|
4142 |
||
4143 |
// Generate SSE legacy REX prefix and SIMD opcode based on VEX encoding. |
|
4144 |
void Assembler::rex_prefix(Address adr, XMMRegister xreg, VexSimdPrefix pre, VexOpcode opc, bool rex_w) { |
|
4145 |
if (pre > 0) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4146 |
emit_int8(simd_pre[pre]); |
11427 | 4147 |
} |
4148 |
if (rex_w) { |
|
4149 |
prefixq(adr, xreg); |
|
4150 |
} else { |
|
4151 |
prefix(adr, xreg); |
|
4152 |
} |
|
4153 |
if (opc > 0) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4154 |
emit_int8(0x0F); |
11427 | 4155 |
int opc2 = simd_opc[opc]; |
4156 |
if (opc2 > 0) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4157 |
emit_int8(opc2); |
11427 | 4158 |
} |
4159 |
} |
|
4160 |
} |
|
4161 |
||
4162 |
int Assembler::rex_prefix_and_encode(int dst_enc, int src_enc, VexSimdPrefix pre, VexOpcode opc, bool rex_w) { |
|
4163 |
if (pre > 0) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4164 |
emit_int8(simd_pre[pre]); |
11427 | 4165 |
} |
4166 |
int encode = (rex_w) ? prefixq_and_encode(dst_enc, src_enc) : |
|
4167 |
prefix_and_encode(dst_enc, src_enc); |
|
4168 |
if (opc > 0) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4169 |
emit_int8(0x0F); |
11427 | 4170 |
int opc2 = simd_opc[opc]; |
4171 |
if (opc2 > 0) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4172 |
emit_int8(opc2); |
11427 | 4173 |
} |
4174 |
} |
|
4175 |
return encode; |
|
4176 |
} |
|
4177 |
||
4178 |
||
4179 |
void Assembler::vex_prefix(bool vex_r, bool vex_b, bool vex_x, bool vex_w, int nds_enc, VexSimdPrefix pre, VexOpcode opc, bool vector256) { |
|
4180 |
if (vex_b || vex_x || vex_w || (opc == VEX_OPCODE_0F_38) || (opc == VEX_OPCODE_0F_3A)) { |
|
4181 |
prefix(VEX_3bytes); |
|
4182 |
||
4183 |
int byte1 = (vex_r ? VEX_R : 0) | (vex_x ? VEX_X : 0) | (vex_b ? VEX_B : 0); |
|
4184 |
byte1 = (~byte1) & 0xE0; |
|
4185 |
byte1 |= opc; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4186 |
emit_int8(byte1); |
11427 | 4187 |
|
4188 |
int byte2 = ((~nds_enc) & 0xf) << 3; |
|
4189 |
byte2 |= (vex_w ? VEX_W : 0) | (vector256 ? 4 : 0) | pre; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4190 |
emit_int8(byte2); |
11427 | 4191 |
} else { |
4192 |
prefix(VEX_2bytes); |
|
4193 |
||
4194 |
int byte1 = vex_r ? VEX_R : 0; |
|
4195 |
byte1 = (~byte1) & 0x80; |
|
4196 |
byte1 |= ((~nds_enc) & 0xf) << 3; |
|
4197 |
byte1 |= (vector256 ? 4 : 0) | pre; |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4198 |
emit_int8(byte1); |
11427 | 4199 |
} |
4200 |
} |
|
4201 |
||
4202 |
void Assembler::vex_prefix(Address adr, int nds_enc, int xreg_enc, VexSimdPrefix pre, VexOpcode opc, bool vex_w, bool vector256){ |
|
4203 |
bool vex_r = (xreg_enc >= 8); |
|
4204 |
bool vex_b = adr.base_needs_rex(); |
|
4205 |
bool vex_x = adr.index_needs_rex(); |
|
4206 |
vex_prefix(vex_r, vex_b, vex_x, vex_w, nds_enc, pre, opc, vector256); |
|
4207 |
} |
|
4208 |
||
4209 |
int Assembler::vex_prefix_and_encode(int dst_enc, int nds_enc, int src_enc, VexSimdPrefix pre, VexOpcode opc, bool vex_w, bool vector256) { |
|
4210 |
bool vex_r = (dst_enc >= 8); |
|
4211 |
bool vex_b = (src_enc >= 8); |
|
4212 |
bool vex_x = false; |
|
4213 |
vex_prefix(vex_r, vex_b, vex_x, vex_w, nds_enc, pre, opc, vector256); |
|
4214 |
return (((dst_enc & 7) << 3) | (src_enc & 7)); |
|
4215 |
} |
|
4216 |
||
4217 |
||
4218 |
void Assembler::simd_prefix(XMMRegister xreg, XMMRegister nds, Address adr, VexSimdPrefix pre, VexOpcode opc, bool rex_w, bool vector256) { |
|
4219 |
if (UseAVX > 0) { |
|
4220 |
int xreg_enc = xreg->encoding(); |
|
4221 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4222 |
vex_prefix(adr, nds_enc, xreg_enc, pre, opc, rex_w, vector256); |
|
4223 |
} else { |
|
4224 |
assert((nds == xreg) || (nds == xnoreg), "wrong sse encoding"); |
|
4225 |
rex_prefix(adr, xreg, pre, opc, rex_w); |
|
4226 |
} |
|
4227 |
} |
|
4228 |
||
4229 |
int Assembler::simd_prefix_and_encode(XMMRegister dst, XMMRegister nds, XMMRegister src, VexSimdPrefix pre, VexOpcode opc, bool rex_w, bool vector256) { |
|
4230 |
int dst_enc = dst->encoding(); |
|
4231 |
int src_enc = src->encoding(); |
|
4232 |
if (UseAVX > 0) { |
|
4233 |
int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
|
4234 |
return vex_prefix_and_encode(dst_enc, nds_enc, src_enc, pre, opc, rex_w, vector256); |
|
4235 |
} else { |
|
4236 |
assert((nds == dst) || (nds == src) || (nds == xnoreg), "wrong sse encoding"); |
|
4237 |
return rex_prefix_and_encode(dst_enc, src_enc, pre, opc, rex_w); |
|
4238 |
} |
|
4239 |
} |
|
1066 | 4240 |
|
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4241 |
void Assembler::emit_simd_arith(int opcode, XMMRegister dst, Address src, VexSimdPrefix pre) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4242 |
InstructionMark im(this); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4243 |
simd_prefix(dst, dst, src, pre); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4244 |
emit_int8(opcode); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4245 |
emit_operand(dst, src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4246 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4247 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4248 |
void Assembler::emit_simd_arith(int opcode, XMMRegister dst, XMMRegister src, VexSimdPrefix pre) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4249 |
int encode = simd_prefix_and_encode(dst, dst, src, pre); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4250 |
emit_int8(opcode); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4251 |
emit_int8((unsigned char)(0xC0 | encode)); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4252 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4253 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4254 |
// Versions with no second source register (non-destructive source). |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4255 |
void Assembler::emit_simd_arith_nonds(int opcode, XMMRegister dst, Address src, VexSimdPrefix pre) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4256 |
InstructionMark im(this); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4257 |
simd_prefix(dst, xnoreg, src, pre); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4258 |
emit_int8(opcode); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4259 |
emit_operand(dst, src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4260 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4261 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4262 |
void Assembler::emit_simd_arith_nonds(int opcode, XMMRegister dst, XMMRegister src, VexSimdPrefix pre) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4263 |
int encode = simd_prefix_and_encode(dst, xnoreg, src, pre); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4264 |
emit_int8(opcode); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4265 |
emit_int8((unsigned char)(0xC0 | encode)); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4266 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4267 |
|
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4268 |
// 3-operands AVX instructions |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4269 |
void Assembler::emit_vex_arith(int opcode, XMMRegister dst, XMMRegister nds, |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4270 |
Address src, VexSimdPrefix pre, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4271 |
InstructionMark im(this); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4272 |
vex_prefix(dst, nds, src, pre, vector256); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4273 |
emit_int8(opcode); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4274 |
emit_operand(dst, src); |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4275 |
} |
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 |
void Assembler::emit_vex_arith(int opcode, XMMRegister dst, XMMRegister nds, |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4278 |
XMMRegister src, VexSimdPrefix pre, bool vector256) { |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4279 |
int encode = vex_prefix_and_encode(dst, nds, src, pre, vector256); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4280 |
emit_int8(opcode); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4281 |
emit_int8((unsigned char)(0xC0 | encode)); |
13485
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4282 |
} |
6c7faa516fc6
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
13391
diff
changeset
|
4283 |
|
1066 | 4284 |
#ifndef _LP64 |
4285 |
||
4286 |
void Assembler::incl(Register dst) { |
|
4287 |
// 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
|
4288 |
emit_int8(0x40 | dst->encoding()); |
1066 | 4289 |
} |
4290 |
||
4291 |
void Assembler::lea(Register dst, Address src) { |
|
4292 |
leal(dst, src); |
|
4293 |
} |
|
4294 |
||
4295 |
void Assembler::mov_literal32(Address dst, int32_t imm32, RelocationHolder const& rspec) { |
|
4296 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4297 |
emit_int8((unsigned char)0xC7); |
1066 | 4298 |
emit_operand(rax, dst); |
4299 |
emit_data((int)imm32, rspec, 0); |
|
4300 |
} |
|
4301 |
||
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
4302 |
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
|
4303 |
InstructionMark im(this); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
4304 |
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
|
4305 |
emit_int8((unsigned char)(0xB8 | encode)); |
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
4306 |
emit_data((int)imm32, rspec, 0); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
4307 |
} |
1066 | 4308 |
|
4309 |
void Assembler::popa() { // 32bit |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4310 |
emit_int8(0x61); |
1066 | 4311 |
} |
4312 |
||
4313 |
void Assembler::push_literal32(int32_t imm32, RelocationHolder const& rspec) { |
|
4314 |
InstructionMark im(this); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4315 |
emit_int8(0x68); |
1066 | 4316 |
emit_data(imm32, rspec, 0); |
4317 |
} |
|
4318 |
||
4319 |
void Assembler::pusha() { // 32bit |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4320 |
emit_int8(0x60); |
1066 | 4321 |
} |
4322 |
||
4323 |
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
|
4324 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4325 |
emit_int8((unsigned char)0x95); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4326 |
emit_int8((unsigned char)(0xE0 | dst->encoding())); |
1066 | 4327 |
} |
4328 |
||
4329 |
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
|
4330 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4331 |
emit_int8((unsigned char)0xA5); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4332 |
emit_int8((unsigned char)(0xC0 | src->encoding() << 3 | dst->encoding())); |
1066 | 4333 |
} |
4334 |
||
4335 |
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
|
4336 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4337 |
emit_int8((unsigned char)0xAD); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4338 |
emit_int8((unsigned char)(0xC0 | src->encoding() << 3 | dst->encoding())); |
1066 | 4339 |
} |
4340 |
||
4341 |
#else // LP64 |
|
4342 |
||
5253 | 4343 |
void Assembler::set_byte_if_not_zero(Register dst) { |
4344 |
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
|
4345 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4346 |
emit_int8((unsigned char)0x95); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4347 |
emit_int8((unsigned char)(0xE0 | enc)); |
5253 | 4348 |
} |
4349 |
||
1066 | 4350 |
// 64bit only pieces of the assembler |
4351 |
// This should only be used by 64bit instructions that can use rip-relative |
|
4352 |
// it cannot be used by instructions that want an immediate value. |
|
4353 |
||
4354 |
bool Assembler::reachable(AddressLiteral adr) { |
|
4355 |
int64_t disp; |
|
4356 |
// None will force a 64bit literal to the code stream. Likely a placeholder |
|
4357 |
// for something that will be patched later and we need to certain it will |
|
4358 |
// always be reachable. |
|
4359 |
if (adr.reloc() == relocInfo::none) { |
|
4360 |
return false; |
|
4361 |
} |
|
4362 |
if (adr.reloc() == relocInfo::internal_word_type) { |
|
4363 |
// This should be rip relative and easily reachable. |
|
4364 |
return true; |
|
4365 |
} |
|
4366 |
if (adr.reloc() == relocInfo::virtual_call_type || |
|
4367 |
adr.reloc() == relocInfo::opt_virtual_call_type || |
|
4368 |
adr.reloc() == relocInfo::static_call_type || |
|
4369 |
adr.reloc() == relocInfo::static_stub_type ) { |
|
4370 |
// This should be rip relative within the code cache and easily |
|
4371 |
// reachable until we get huge code caches. (At which point |
|
4372 |
// ic code is going to have issues). |
|
4373 |
return true; |
|
4374 |
} |
|
4375 |
if (adr.reloc() != relocInfo::external_word_type && |
|
4376 |
adr.reloc() != relocInfo::poll_return_type && // these are really external_word but need special |
|
4377 |
adr.reloc() != relocInfo::poll_type && // relocs to identify them |
|
4378 |
adr.reloc() != relocInfo::runtime_call_type ) { |
|
4379 |
return false; |
|
4380 |
} |
|
4381 |
||
4382 |
// Stress the correction code |
|
4383 |
if (ForceUnreachable) { |
|
4384 |
// Must be runtimecall reloc, see if it is in the codecache |
|
4385 |
// Flipping stuff in the codecache to be unreachable causes issues |
|
4386 |
// with things like inline caches where the additional instructions |
|
4387 |
// are not handled. |
|
4388 |
if (CodeCache::find_blob(adr._target) == NULL) { |
|
4389 |
return false; |
|
4390 |
} |
|
4391 |
} |
|
4392 |
// For external_word_type/runtime_call_type if it is reachable from where we |
|
4393 |
// are now (possibly a temp buffer) and where we might end up |
|
4394 |
// anywhere in the codeCache then we are always reachable. |
|
4395 |
// This would have to change if we ever save/restore shared code |
|
4396 |
// to be more pessimistic. |
|
4397 |
disp = (int64_t)adr._target - ((int64_t)CodeCache::low_bound() + sizeof(int)); |
|
4398 |
if (!is_simm32(disp)) return false; |
|
4399 |
disp = (int64_t)adr._target - ((int64_t)CodeCache::high_bound() + sizeof(int)); |
|
4400 |
if (!is_simm32(disp)) return false; |
|
4401 |
||
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
4402 |
disp = (int64_t)adr._target - ((int64_t)pc() + sizeof(int)); |
1066 | 4403 |
|
4404 |
// Because rip relative is a disp + address_of_next_instruction and we |
|
4405 |
// don't know the value of address_of_next_instruction we apply a fudge factor |
|
4406 |
// to make sure we will be ok no matter the size of the instruction we get placed into. |
|
4407 |
// We don't have to fudge the checks above here because they are already worst case. |
|
4408 |
||
4409 |
// 12 == override/rex byte, opcode byte, rm byte, sib byte, a 4-byte disp , 4-byte literal |
|
4410 |
// + 4 because better safe than sorry. |
|
4411 |
const int fudge = 12 + 4; |
|
4412 |
if (disp < 0) { |
|
4413 |
disp -= fudge; |
|
4414 |
} else { |
|
4415 |
disp += fudge; |
|
4416 |
} |
|
4417 |
return is_simm32(disp); |
|
4418 |
} |
|
4419 |
||
8871
5c3b26c4119e
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
8676
diff
changeset
|
4420 |
// 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
|
4421 |
// addressing. |
5c3b26c4119e
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
8676
diff
changeset
|
4422 |
bool Assembler::is_polling_page_far() { |
5c3b26c4119e
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
8676
diff
changeset
|
4423 |
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
|
4424 |
return ForceUnreachable || |
ee1235a09fc3
7110489: C1: 64-bit tiered with ForceUnreachable: assert(reachable(src)) failed: Address should be reachable
never
parents:
10546
diff
changeset
|
4425 |
!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
|
4426 |
!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
|
4427 |
} |
5c3b26c4119e
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
8676
diff
changeset
|
4428 |
|
1066 | 4429 |
void Assembler::emit_data64(jlong data, |
4430 |
relocInfo::relocType rtype, |
|
4431 |
int format) { |
|
4432 |
if (rtype == relocInfo::none) { |
|
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
4433 |
emit_int64(data); |
1066 | 4434 |
} else { |
4435 |
emit_data64(data, Relocation::spec_simple(rtype), format); |
|
4436 |
} |
|
4437 |
} |
|
4438 |
||
4439 |
void Assembler::emit_data64(jlong data, |
|
4440 |
RelocationHolder const& rspec, |
|
4441 |
int format) { |
|
4442 |
assert(imm_operand == 0, "default format must be immediate in this file"); |
|
4443 |
assert(imm_operand == format, "must be immediate"); |
|
4444 |
assert(inst_mark() != NULL, "must be inside InstructionMark"); |
|
4445 |
// Do not use AbstractAssembler::relocate, which is not intended for |
|
4446 |
// embedded words. Instead, relocate to the enclosing instruction. |
|
4447 |
code_section()->relocate(inst_mark(), rspec, format); |
|
4448 |
#ifdef ASSERT |
|
4449 |
check_relocation(rspec, format); |
|
4450 |
#endif |
|
14625
b02f361c324e
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
14132
diff
changeset
|
4451 |
emit_int64(data); |
1066 | 4452 |
} |
4453 |
||
4454 |
int Assembler::prefix_and_encode(int reg_enc, bool byteinst) { |
|
4455 |
if (reg_enc >= 8) { |
|
4456 |
prefix(REX_B); |
|
4457 |
reg_enc -= 8; |
|
4458 |
} else if (byteinst && reg_enc >= 4) { |
|
4459 |
prefix(REX); |
|
4460 |
} |
|
4461 |
return reg_enc; |
|
4462 |
} |
|
4463 |
||
4464 |
int Assembler::prefixq_and_encode(int reg_enc) { |
|
4465 |
if (reg_enc < 8) { |
|
4466 |
prefix(REX_W); |
|
4467 |
} else { |
|
4468 |
prefix(REX_WB); |
|
4469 |
reg_enc -= 8; |
|
4470 |
} |
|
4471 |
return reg_enc; |
|
4472 |
} |
|
4473 |
||
4474 |
int Assembler::prefix_and_encode(int dst_enc, int src_enc, bool byteinst) { |
|
4475 |
if (dst_enc < 8) { |
|
4476 |
if (src_enc >= 8) { |
|
4477 |
prefix(REX_B); |
|
4478 |
src_enc -= 8; |
|
4479 |
} else if (byteinst && src_enc >= 4) { |
|
4480 |
prefix(REX); |
|
4481 |
} |
|
4482 |
} else { |
|
4483 |
if (src_enc < 8) { |
|
4484 |
prefix(REX_R); |
|
4485 |
} else { |
|
4486 |
prefix(REX_RB); |
|
4487 |
src_enc -= 8; |
|
4488 |
} |
|
4489 |
dst_enc -= 8; |
|
4490 |
} |
|
4491 |
return dst_enc << 3 | src_enc; |
|
4492 |
} |
|
4493 |
||
4494 |
int Assembler::prefixq_and_encode(int dst_enc, int src_enc) { |
|
4495 |
if (dst_enc < 8) { |
|
4496 |
if (src_enc < 8) { |
|
4497 |
prefix(REX_W); |
|
4498 |
} else { |
|
4499 |
prefix(REX_WB); |
|
4500 |
src_enc -= 8; |
|
4501 |
} |
|
4502 |
} else { |
|
4503 |
if (src_enc < 8) { |
|
4504 |
prefix(REX_WR); |
|
4505 |
} else { |
|
4506 |
prefix(REX_WRB); |
|
4507 |
src_enc -= 8; |
|
4508 |
} |
|
4509 |
dst_enc -= 8; |
|
4510 |
} |
|
4511 |
return dst_enc << 3 | src_enc; |
|
4512 |
} |
|
4513 |
||
4514 |
void Assembler::prefix(Register reg) { |
|
4515 |
if (reg->encoding() >= 8) { |
|
4516 |
prefix(REX_B); |
|
4517 |
} |
|
4518 |
} |
|
4519 |
||
4520 |
void Assembler::prefix(Address adr) { |
|
4521 |
if (adr.base_needs_rex()) { |
|
4522 |
if (adr.index_needs_rex()) { |
|
4523 |
prefix(REX_XB); |
|
4524 |
} else { |
|
4525 |
prefix(REX_B); |
|
4526 |
} |
|
4527 |
} else { |
|
4528 |
if (adr.index_needs_rex()) { |
|
4529 |
prefix(REX_X); |
|
4530 |
} |
|
4531 |
} |
|
4532 |
} |
|
4533 |
||
4534 |
void Assembler::prefixq(Address adr) { |
|
4535 |
if (adr.base_needs_rex()) { |
|
4536 |
if (adr.index_needs_rex()) { |
|
4537 |
prefix(REX_WXB); |
|
4538 |
} else { |
|
4539 |
prefix(REX_WB); |
|
4540 |
} |
|
4541 |
} else { |
|
4542 |
if (adr.index_needs_rex()) { |
|
4543 |
prefix(REX_WX); |
|
4544 |
} else { |
|
4545 |
prefix(REX_W); |
|
4546 |
} |
|
4547 |
} |
|
4548 |
} |
|
4549 |
||
4550 |
||
4551 |
void Assembler::prefix(Address adr, Register reg, bool byteinst) { |
|
4552 |
if (reg->encoding() < 8) { |
|
4553 |
if (adr.base_needs_rex()) { |
|
4554 |
if (adr.index_needs_rex()) { |
|
4555 |
prefix(REX_XB); |
|
4556 |
} else { |
|
4557 |
prefix(REX_B); |
|
4558 |
} |
|
4559 |
} else { |
|
4560 |
if (adr.index_needs_rex()) { |
|
4561 |
prefix(REX_X); |
|
10268 | 4562 |
} else if (byteinst && reg->encoding() >= 4 ) { |
1066 | 4563 |
prefix(REX); |
4564 |
} |
|
4565 |
} |
|
4566 |
} else { |
|
4567 |
if (adr.base_needs_rex()) { |
|
4568 |
if (adr.index_needs_rex()) { |
|
4569 |
prefix(REX_RXB); |
|
4570 |
} else { |
|
4571 |
prefix(REX_RB); |
|
4572 |
} |
|
4573 |
} else { |
|
4574 |
if (adr.index_needs_rex()) { |
|
4575 |
prefix(REX_RX); |
|
4576 |
} else { |
|
4577 |
prefix(REX_R); |
|
4578 |
} |
|
4579 |
} |
|
4580 |
} |
|
4581 |
} |
|
4582 |
||
4583 |
void Assembler::prefixq(Address adr, Register src) { |
|
4584 |
if (src->encoding() < 8) { |
|
4585 |
if (adr.base_needs_rex()) { |
|
4586 |
if (adr.index_needs_rex()) { |
|
4587 |
prefix(REX_WXB); |
|
4588 |
} else { |
|
4589 |
prefix(REX_WB); |
|
4590 |
} |
|
4591 |
} else { |
|
4592 |
if (adr.index_needs_rex()) { |
|
4593 |
prefix(REX_WX); |
|
4594 |
} else { |
|
4595 |
prefix(REX_W); |
|
4596 |
} |
|
4597 |
} |
|
4598 |
} else { |
|
4599 |
if (adr.base_needs_rex()) { |
|
4600 |
if (adr.index_needs_rex()) { |
|
4601 |
prefix(REX_WRXB); |
|
4602 |
} else { |
|
4603 |
prefix(REX_WRB); |
|
4604 |
} |
|
4605 |
} else { |
|
4606 |
if (adr.index_needs_rex()) { |
|
4607 |
prefix(REX_WRX); |
|
4608 |
} else { |
|
4609 |
prefix(REX_WR); |
|
4610 |
} |
|
4611 |
} |
|
4612 |
} |
|
4613 |
} |
|
4614 |
||
4615 |
void Assembler::prefix(Address adr, XMMRegister reg) { |
|
4616 |
if (reg->encoding() < 8) { |
|
4617 |
if (adr.base_needs_rex()) { |
|
4618 |
if (adr.index_needs_rex()) { |
|
4619 |
prefix(REX_XB); |
|
4620 |
} else { |
|
4621 |
prefix(REX_B); |
|
4622 |
} |
|
4623 |
} else { |
|
4624 |
if (adr.index_needs_rex()) { |
|
4625 |
prefix(REX_X); |
|
4626 |
} |
|
4627 |
} |
|
4628 |
} else { |
|
4629 |
if (adr.base_needs_rex()) { |
|
4630 |
if (adr.index_needs_rex()) { |
|
4631 |
prefix(REX_RXB); |
|
4632 |
} else { |
|
4633 |
prefix(REX_RB); |
|
4634 |
} |
|
4635 |
} else { |
|
4636 |
if (adr.index_needs_rex()) { |
|
4637 |
prefix(REX_RX); |
|
4638 |
} else { |
|
4639 |
prefix(REX_R); |
|
4640 |
} |
|
4641 |
} |
|
4642 |
} |
|
4643 |
} |
|
4644 |
||
11427 | 4645 |
void Assembler::prefixq(Address adr, XMMRegister src) { |
4646 |
if (src->encoding() < 8) { |
|
4647 |
if (adr.base_needs_rex()) { |
|
4648 |
if (adr.index_needs_rex()) { |
|
4649 |
prefix(REX_WXB); |
|
4650 |
} else { |
|
4651 |
prefix(REX_WB); |
|
4652 |
} |
|
4653 |
} else { |
|
4654 |
if (adr.index_needs_rex()) { |
|
4655 |
prefix(REX_WX); |
|
4656 |
} else { |
|
4657 |
prefix(REX_W); |
|
4658 |
} |
|
4659 |
} |
|
4660 |
} else { |
|
4661 |
if (adr.base_needs_rex()) { |
|
4662 |
if (adr.index_needs_rex()) { |
|
4663 |
prefix(REX_WRXB); |
|
4664 |
} else { |
|
4665 |
prefix(REX_WRB); |
|
4666 |
} |
|
4667 |
} else { |
|
4668 |
if (adr.index_needs_rex()) { |
|
4669 |
prefix(REX_WRX); |
|
4670 |
} else { |
|
4671 |
prefix(REX_WR); |
|
4672 |
} |
|
4673 |
} |
|
4674 |
} |
|
4675 |
} |
|
4676 |
||
1066 | 4677 |
void Assembler::adcq(Register dst, int32_t imm32) { |
4678 |
(void) prefixq_and_encode(dst->encoding()); |
|
4679 |
emit_arith(0x81, 0xD0, dst, imm32); |
|
4680 |
} |
|
4681 |
||
4682 |
void Assembler::adcq(Register dst, Address src) { |
|
4683 |
InstructionMark im(this); |
|
4684 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4685 |
emit_int8(0x13); |
1066 | 4686 |
emit_operand(dst, src); |
4687 |
} |
|
4688 |
||
4689 |
void Assembler::adcq(Register dst, Register src) { |
|
4690 |
(int) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
4691 |
emit_arith(0x13, 0xC0, dst, src); |
|
4692 |
} |
|
4693 |
||
4694 |
void Assembler::addq(Address dst, int32_t imm32) { |
|
4695 |
InstructionMark im(this); |
|
4696 |
prefixq(dst); |
|
4697 |
emit_arith_operand(0x81, rax, dst,imm32); |
|
4698 |
} |
|
4699 |
||
4700 |
void Assembler::addq(Address dst, Register src) { |
|
4701 |
InstructionMark im(this); |
|
4702 |
prefixq(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4703 |
emit_int8(0x01); |
1066 | 4704 |
emit_operand(src, dst); |
4705 |
} |
|
4706 |
||
4707 |
void Assembler::addq(Register dst, int32_t imm32) { |
|
4708 |
(void) prefixq_and_encode(dst->encoding()); |
|
4709 |
emit_arith(0x81, 0xC0, dst, imm32); |
|
4710 |
} |
|
4711 |
||
4712 |
void Assembler::addq(Register dst, Address src) { |
|
4713 |
InstructionMark im(this); |
|
4714 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4715 |
emit_int8(0x03); |
1066 | 4716 |
emit_operand(dst, src); |
4717 |
} |
|
4718 |
||
4719 |
void Assembler::addq(Register dst, Register src) { |
|
4720 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
4721 |
emit_arith(0x03, 0xC0, dst, src); |
|
4722 |
} |
|
4723 |
||
10006 | 4724 |
void Assembler::andq(Address dst, int32_t imm32) { |
4725 |
InstructionMark im(this); |
|
4726 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4727 |
emit_int8((unsigned char)0x81); |
10006 | 4728 |
emit_operand(rsp, dst, 4); |
4729 |
emit_long(imm32); |
|
4730 |
} |
|
4731 |
||
1066 | 4732 |
void Assembler::andq(Register dst, int32_t imm32) { |
4733 |
(void) prefixq_and_encode(dst->encoding()); |
|
4734 |
emit_arith(0x81, 0xE0, dst, imm32); |
|
4735 |
} |
|
4736 |
||
4737 |
void Assembler::andq(Register dst, Address src) { |
|
4738 |
InstructionMark im(this); |
|
4739 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4740 |
emit_int8(0x23); |
1066 | 4741 |
emit_operand(dst, src); |
4742 |
} |
|
4743 |
||
4744 |
void Assembler::andq(Register dst, Register src) { |
|
4745 |
(int) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
4746 |
emit_arith(0x23, 0xC0, dst, src); |
|
4747 |
} |
|
4748 |
||
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
4749 |
void Assembler::bsfq(Register dst, Register src) { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
4750 |
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
|
4751 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4752 |
emit_int8((unsigned char)0xBC); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4753 |
emit_int8((unsigned char)(0xC0 | encode)); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
4754 |
} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
4755 |
|
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
4756 |
void Assembler::bsrq(Register dst, Register src) { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
4757 |
assert(!VM_Version::supports_lzcnt(), "encoding is treated as LZCNT"); |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
4758 |
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
|
4759 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4760 |
emit_int8((unsigned char)0xBD); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4761 |
emit_int8((unsigned char)(0xC0 | encode)); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
4762 |
} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
4763 |
|
1066 | 4764 |
void Assembler::bswapq(Register reg) { |
4765 |
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
|
4766 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4767 |
emit_int8((unsigned char)(0xC8 | encode)); |
1066 | 4768 |
} |
4769 |
||
4770 |
void Assembler::cdqq() { |
|
4771 |
prefix(REX_W); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4772 |
emit_int8((unsigned char)0x99); |
1066 | 4773 |
} |
4774 |
||
4775 |
void Assembler::clflush(Address adr) { |
|
4776 |
prefix(adr); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4777 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4778 |
emit_int8((unsigned char)0xAE); |
1066 | 4779 |
emit_operand(rdi, adr); |
4780 |
} |
|
4781 |
||
4782 |
void Assembler::cmovq(Condition cc, Register dst, Register src) { |
|
4783 |
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
|
4784 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4785 |
emit_int8(0x40 | cc); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4786 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 4787 |
} |
4788 |
||
4789 |
void Assembler::cmovq(Condition cc, Register dst, Address src) { |
|
4790 |
InstructionMark im(this); |
|
4791 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4792 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4793 |
emit_int8(0x40 | cc); |
1066 | 4794 |
emit_operand(dst, src); |
4795 |
} |
|
4796 |
||
4797 |
void Assembler::cmpq(Address dst, int32_t imm32) { |
|
4798 |
InstructionMark im(this); |
|
4799 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4800 |
emit_int8((unsigned char)0x81); |
1066 | 4801 |
emit_operand(rdi, dst, 4); |
4802 |
emit_long(imm32); |
|
4803 |
} |
|
4804 |
||
4805 |
void Assembler::cmpq(Register dst, int32_t imm32) { |
|
4806 |
(void) prefixq_and_encode(dst->encoding()); |
|
4807 |
emit_arith(0x81, 0xF8, dst, imm32); |
|
4808 |
} |
|
4809 |
||
4810 |
void Assembler::cmpq(Address dst, Register src) { |
|
4811 |
InstructionMark im(this); |
|
4812 |
prefixq(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4813 |
emit_int8(0x3B); |
1066 | 4814 |
emit_operand(src, dst); |
4815 |
} |
|
4816 |
||
4817 |
void Assembler::cmpq(Register dst, Register src) { |
|
4818 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
4819 |
emit_arith(0x3B, 0xC0, dst, src); |
|
4820 |
} |
|
4821 |
||
4822 |
void Assembler::cmpq(Register dst, Address src) { |
|
4823 |
InstructionMark im(this); |
|
4824 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4825 |
emit_int8(0x3B); |
1066 | 4826 |
emit_operand(dst, src); |
4827 |
} |
|
4828 |
||
4829 |
void Assembler::cmpxchgq(Register reg, Address adr) { |
|
4830 |
InstructionMark im(this); |
|
4831 |
prefixq(adr, reg); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4832 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4833 |
emit_int8((unsigned char)0xB1); |
1066 | 4834 |
emit_operand(reg, adr); |
4835 |
} |
|
4836 |
||
4837 |
void Assembler::cvtsi2sdq(XMMRegister dst, Register src) { |
|
4838 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
11427 | 4839 |
int encode = simd_prefix_and_encode_q(dst, dst, src, VEX_SIMD_F2); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4840 |
emit_int8(0x2A); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4841 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 4842 |
} |
4843 |
||
11427 | 4844 |
void Assembler::cvtsi2sdq(XMMRegister dst, Address src) { |
4845 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
4846 |
InstructionMark im(this); |
|
4847 |
simd_prefix_q(dst, dst, src, VEX_SIMD_F2); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4848 |
emit_int8(0x2A); |
11427 | 4849 |
emit_operand(dst, src); |
4850 |
} |
|
4851 |
||
1066 | 4852 |
void Assembler::cvtsi2ssq(XMMRegister dst, Register src) { |
4853 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
11427 | 4854 |
int encode = simd_prefix_and_encode_q(dst, dst, src, VEX_SIMD_F3); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4855 |
emit_int8(0x2A); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4856 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 4857 |
} |
4858 |
||
11427 | 4859 |
void Assembler::cvtsi2ssq(XMMRegister dst, Address src) { |
4860 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
4861 |
InstructionMark im(this); |
|
4862 |
simd_prefix_q(dst, dst, src, VEX_SIMD_F3); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4863 |
emit_int8(0x2A); |
11427 | 4864 |
emit_operand(dst, src); |
4865 |
} |
|
4866 |
||
1066 | 4867 |
void Assembler::cvttsd2siq(Register dst, XMMRegister src) { |
4868 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
|
11427 | 4869 |
int encode = simd_prefix_and_encode_q(dst, src, VEX_SIMD_F2); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4870 |
emit_int8(0x2C); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4871 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 4872 |
} |
4873 |
||
4874 |
void Assembler::cvttss2siq(Register dst, XMMRegister src) { |
|
4875 |
NOT_LP64(assert(VM_Version::supports_sse(), "")); |
|
11427 | 4876 |
int encode = simd_prefix_and_encode_q(dst, src, VEX_SIMD_F3); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4877 |
emit_int8(0x2C); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4878 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 4879 |
} |
4880 |
||
4881 |
void Assembler::decl(Register dst) { |
|
4882 |
// Don't use it directly. Use MacroAssembler::decrementl() instead. |
|
4883 |
// Use two-byte form (one-byte form is a REX prefix in 64-bit mode) |
|
4884 |
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
|
4885 |
emit_int8((unsigned char)0xFF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4886 |
emit_int8((unsigned char)(0xC8 | encode)); |
1066 | 4887 |
} |
4888 |
||
4889 |
void Assembler::decq(Register dst) { |
|
4890 |
// Don't use it directly. Use MacroAssembler::decrementq() instead. |
|
4891 |
// Use two-byte form (one-byte from is a REX prefix in 64-bit mode) |
|
4892 |
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
|
4893 |
emit_int8((unsigned char)0xFF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4894 |
emit_int8(0xC8 | encode); |
1066 | 4895 |
} |
4896 |
||
4897 |
void Assembler::decq(Address dst) { |
|
4898 |
// Don't use it directly. Use MacroAssembler::decrementq() instead. |
|
4899 |
InstructionMark im(this); |
|
4900 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4901 |
emit_int8((unsigned char)0xFF); |
1066 | 4902 |
emit_operand(rcx, dst); |
4903 |
} |
|
4904 |
||
4905 |
void Assembler::fxrstor(Address src) { |
|
4906 |
prefixq(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4907 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4908 |
emit_int8((unsigned char)0xAE); |
1066 | 4909 |
emit_operand(as_Register(1), src); |
4910 |
} |
|
4911 |
||
4912 |
void Assembler::fxsave(Address dst) { |
|
4913 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4914 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4915 |
emit_int8((unsigned char)0xAE); |
1066 | 4916 |
emit_operand(as_Register(0), dst); |
4917 |
} |
|
4918 |
||
4919 |
void Assembler::idivq(Register src) { |
|
4920 |
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
|
4921 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4922 |
emit_int8((unsigned char)(0xF8 | encode)); |
1066 | 4923 |
} |
4924 |
||
4925 |
void Assembler::imulq(Register dst, Register src) { |
|
4926 |
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
|
4927 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4928 |
emit_int8((unsigned char)0xAF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4929 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 4930 |
} |
4931 |
||
4932 |
void Assembler::imulq(Register dst, Register src, int value) { |
|
4933 |
int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
|
4934 |
if (is8bit(value)) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4935 |
emit_int8(0x6B); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4936 |
emit_int8((unsigned char)(0xC0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4937 |
emit_int8(value & 0xFF); |
1066 | 4938 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4939 |
emit_int8(0x69); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4940 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 4941 |
emit_long(value); |
4942 |
} |
|
4943 |
} |
|
4944 |
||
4945 |
void Assembler::incl(Register dst) { |
|
4946 |
// Don't use it directly. Use MacroAssembler::incrementl() instead. |
|
4947 |
// Use two-byte form (one-byte from is a REX prefix in 64-bit mode) |
|
4948 |
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
|
4949 |
emit_int8((unsigned char)0xFF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4950 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 4951 |
} |
4952 |
||
4953 |
void Assembler::incq(Register dst) { |
|
4954 |
// Don't use it directly. Use MacroAssembler::incrementq() instead. |
|
4955 |
// Use two-byte form (one-byte from is a REX prefix in 64-bit mode) |
|
4956 |
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
|
4957 |
emit_int8((unsigned char)0xFF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4958 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 4959 |
} |
4960 |
||
4961 |
void Assembler::incq(Address dst) { |
|
4962 |
// Don't use it directly. Use MacroAssembler::incrementq() instead. |
|
4963 |
InstructionMark im(this); |
|
4964 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4965 |
emit_int8((unsigned char)0xFF); |
1066 | 4966 |
emit_operand(rax, dst); |
4967 |
} |
|
4968 |
||
4969 |
void Assembler::lea(Register dst, Address src) { |
|
4970 |
leaq(dst, src); |
|
4971 |
} |
|
4972 |
||
4973 |
void Assembler::leaq(Register dst, Address src) { |
|
4974 |
InstructionMark im(this); |
|
4975 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
4976 |
emit_int8((unsigned char)0x8D); |
1066 | 4977 |
emit_operand(dst, src); |
4978 |
} |
|
4979 |
||
4980 |
void Assembler::mov64(Register dst, int64_t imm64) { |
|
4981 |
InstructionMark im(this); |
|
4982 |
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
|
4983 |
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
|
4984 |
emit_int64(imm64); |
1066 | 4985 |
} |
4986 |
||
4987 |
void Assembler::mov_literal64(Register dst, intptr_t imm64, RelocationHolder const& rspec) { |
|
4988 |
InstructionMark im(this); |
|
4989 |
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
|
4990 |
emit_int8(0xB8 | encode); |
1066 | 4991 |
emit_data64(imm64, rspec); |
4992 |
} |
|
4993 |
||
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
4994 |
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
|
4995 |
InstructionMark im(this); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
4996 |
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
|
4997 |
emit_int8((unsigned char)(0xB8 | encode)); |
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
4998 |
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
|
4999 |
} |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
5000 |
|
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
5001 |
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
|
5002 |
InstructionMark im(this); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
5003 |
prefix(dst); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5004 |
emit_int8((unsigned char)0xC7); |
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
5005 |
emit_operand(rax, dst, 4); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
5006 |
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
|
5007 |
} |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
5008 |
|
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
5009 |
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
|
5010 |
InstructionMark im(this); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
5011 |
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
|
5012 |
emit_int8((unsigned char)0x81); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5013 |
emit_int8((unsigned char)(0xF8 | encode)); |
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
5014 |
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
|
5015 |
} |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
5016 |
|
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
5017 |
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
|
5018 |
InstructionMark im(this); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
5019 |
prefix(src1); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5020 |
emit_int8((unsigned char)0x81); |
2254
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
5021 |
emit_operand(rax, src1, 4); |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
5022 |
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
|
5023 |
} |
f13dda645a4b
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
2150
diff
changeset
|
5024 |
|
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
5025 |
void Assembler::lzcntq(Register dst, Register src) { |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
5026 |
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
|
5027 |
emit_int8((unsigned char)0xF3); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
5028 |
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
|
5029 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5030 |
emit_int8((unsigned char)0xBD); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5031 |
emit_int8((unsigned char)(0xC0 | encode)); |
2862
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
5032 |
} |
fad636edf18f
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
2534
diff
changeset
|
5033 |
|
1066 | 5034 |
void Assembler::movdq(XMMRegister dst, Register src) { |
5035 |
// table D-1 says MMX/SSE2 |
|
11427 | 5036 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
5037 |
int encode = simd_prefix_and_encode_q(dst, src, VEX_SIMD_66); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5038 |
emit_int8(0x6E); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5039 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 5040 |
} |
5041 |
||
5042 |
void Assembler::movdq(Register dst, XMMRegister src) { |
|
5043 |
// table D-1 says MMX/SSE2 |
|
11427 | 5044 |
NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
1066 | 5045 |
// swap src/dst to get correct prefix |
11427 | 5046 |
int encode = simd_prefix_and_encode_q(src, dst, VEX_SIMD_66); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5047 |
emit_int8(0x7E); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5048 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 5049 |
} |
5050 |
||
5051 |
void Assembler::movq(Register dst, Register src) { |
|
5052 |
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
|
5053 |
emit_int8((unsigned char)0x8B); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5054 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 5055 |
} |
5056 |
||
5057 |
void Assembler::movq(Register dst, Address src) { |
|
5058 |
InstructionMark im(this); |
|
5059 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5060 |
emit_int8((unsigned char)0x8B); |
1066 | 5061 |
emit_operand(dst, src); |
5062 |
} |
|
5063 |
||
5064 |
void Assembler::movq(Address dst, Register src) { |
|
5065 |
InstructionMark im(this); |
|
5066 |
prefixq(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5067 |
emit_int8((unsigned char)0x89); |
1066 | 5068 |
emit_operand(src, dst); |
5069 |
} |
|
5070 |
||
2150 | 5071 |
void Assembler::movsbq(Register dst, Address src) { |
5072 |
InstructionMark im(this); |
|
5073 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5074 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5075 |
emit_int8((unsigned char)0xBE); |
2150 | 5076 |
emit_operand(dst, src); |
5077 |
} |
|
5078 |
||
5079 |
void Assembler::movsbq(Register dst, Register src) { |
|
5080 |
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
|
5081 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5082 |
emit_int8((unsigned char)0xBE); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5083 |
emit_int8((unsigned char)(0xC0 | encode)); |
2150 | 5084 |
} |
5085 |
||
1066 | 5086 |
void Assembler::movslq(Register dst, int32_t imm32) { |
5087 |
// dbx shows movslq(rcx, 3) as movq $0x0000000049000000,(%rbx) |
|
5088 |
// and movslq(r8, 3); as movl $0x0000000048000000,(%rbx) |
|
5089 |
// as a result we shouldn't use until tested at runtime... |
|
5090 |
ShouldNotReachHere(); |
|
5091 |
InstructionMark im(this); |
|
5092 |
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
|
5093 |
emit_int8((unsigned char)(0xC7 | encode)); |
1066 | 5094 |
emit_long(imm32); |
5095 |
} |
|
5096 |
||
5097 |
void Assembler::movslq(Address dst, int32_t imm32) { |
|
5098 |
assert(is_simm32(imm32), "lost bits"); |
|
5099 |
InstructionMark im(this); |
|
5100 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5101 |
emit_int8((unsigned char)0xC7); |
1066 | 5102 |
emit_operand(rax, dst, 4); |
5103 |
emit_long(imm32); |
|
5104 |
} |
|
5105 |
||
5106 |
void Assembler::movslq(Register dst, Address src) { |
|
5107 |
InstructionMark im(this); |
|
5108 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5109 |
emit_int8(0x63); |
1066 | 5110 |
emit_operand(dst, src); |
5111 |
} |
|
5112 |
||
5113 |
void Assembler::movslq(Register dst, Register src) { |
|
5114 |
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
|
5115 |
emit_int8(0x63); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5116 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 5117 |
} |
5118 |
||
2150 | 5119 |
void Assembler::movswq(Register dst, Address src) { |
5120 |
InstructionMark im(this); |
|
5121 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5122 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5123 |
emit_int8((unsigned char)0xBF); |
2150 | 5124 |
emit_operand(dst, src); |
5125 |
} |
|
5126 |
||
5127 |
void Assembler::movswq(Register dst, Register src) { |
|
5128 |
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
|
5129 |
emit_int8((unsigned char)0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5130 |
emit_int8((unsigned char)0xBF); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5131 |
emit_int8((unsigned char)(0xC0 | encode)); |
2150 | 5132 |
} |
5133 |
||
5134 |
void Assembler::movzbq(Register dst, Address src) { |
|
5135 |
InstructionMark im(this); |
|
5136 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5137 |
emit_int8((unsigned char)0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5138 |
emit_int8((unsigned char)0xB6); |
2150 | 5139 |
emit_operand(dst, src); |
5140 |
} |
|
5141 |
||
5142 |
void Assembler::movzbq(Register dst, Register src) { |
|
5143 |
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
|
5144 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5145 |
emit_int8((unsigned char)0xB6); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5146 |
emit_int8(0xC0 | encode); |
2150 | 5147 |
} |
5148 |
||
5149 |
void Assembler::movzwq(Register dst, Address src) { |
|
5150 |
InstructionMark im(this); |
|
5151 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5152 |
emit_int8((unsigned char)0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5153 |
emit_int8((unsigned char)0xB7); |
2150 | 5154 |
emit_operand(dst, src); |
5155 |
} |
|
5156 |
||
5157 |
void Assembler::movzwq(Register dst, Register src) { |
|
5158 |
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
|
5159 |
emit_int8((unsigned char)0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5160 |
emit_int8((unsigned char)0xB7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5161 |
emit_int8((unsigned char)(0xC0 | encode)); |
2150 | 5162 |
} |
5163 |
||
1066 | 5164 |
void Assembler::negq(Register dst) { |
5165 |
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
|
5166 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5167 |
emit_int8((unsigned char)(0xD8 | encode)); |
1066 | 5168 |
} |
5169 |
||
5170 |
void Assembler::notq(Register dst) { |
|
5171 |
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
|
5172 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5173 |
emit_int8((unsigned char)(0xD0 | encode)); |
1066 | 5174 |
} |
5175 |
||
5176 |
void Assembler::orq(Address dst, int32_t imm32) { |
|
5177 |
InstructionMark im(this); |
|
5178 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5179 |
emit_int8((unsigned char)0x81); |
1066 | 5180 |
emit_operand(rcx, dst, 4); |
5181 |
emit_long(imm32); |
|
5182 |
} |
|
5183 |
||
5184 |
void Assembler::orq(Register dst, int32_t imm32) { |
|
5185 |
(void) prefixq_and_encode(dst->encoding()); |
|
5186 |
emit_arith(0x81, 0xC8, dst, imm32); |
|
5187 |
} |
|
5188 |
||
5189 |
void Assembler::orq(Register dst, Address src) { |
|
5190 |
InstructionMark im(this); |
|
5191 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5192 |
emit_int8(0x0B); |
1066 | 5193 |
emit_operand(dst, src); |
5194 |
} |
|
5195 |
||
5196 |
void Assembler::orq(Register dst, Register src) { |
|
5197 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
5198 |
emit_arith(0x0B, 0xC0, dst, src); |
|
5199 |
} |
|
5200 |
||
5201 |
void Assembler::popa() { // 64bit |
|
5202 |
movq(r15, Address(rsp, 0)); |
|
5203 |
movq(r14, Address(rsp, wordSize)); |
|
5204 |
movq(r13, Address(rsp, 2 * wordSize)); |
|
5205 |
movq(r12, Address(rsp, 3 * wordSize)); |
|
5206 |
movq(r11, Address(rsp, 4 * wordSize)); |
|
5207 |
movq(r10, Address(rsp, 5 * wordSize)); |
|
5208 |
movq(r9, Address(rsp, 6 * wordSize)); |
|
5209 |
movq(r8, Address(rsp, 7 * wordSize)); |
|
5210 |
movq(rdi, Address(rsp, 8 * wordSize)); |
|
5211 |
movq(rsi, Address(rsp, 9 * wordSize)); |
|
5212 |
movq(rbp, Address(rsp, 10 * wordSize)); |
|
5213 |
// skip rsp |
|
5214 |
movq(rbx, Address(rsp, 12 * wordSize)); |
|
5215 |
movq(rdx, Address(rsp, 13 * wordSize)); |
|
5216 |
movq(rcx, Address(rsp, 14 * wordSize)); |
|
5217 |
movq(rax, Address(rsp, 15 * wordSize)); |
|
5218 |
||
5219 |
addq(rsp, 16 * wordSize); |
|
5220 |
} |
|
5221 |
||
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
5222 |
void Assembler::popcntq(Register dst, Address src) { |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
5223 |
assert(VM_Version::supports_popcnt(), "must support"); |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
5224 |
InstructionMark im(this); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5225 |
emit_int8((unsigned char)0xF3); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
5226 |
prefixq(src, dst); |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5227 |
emit_int8((unsigned char)0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5228 |
emit_int8((unsigned char)0xB8); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
5229 |
emit_operand(dst, src); |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
5230 |
} |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
5231 |
|
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
5232 |
void Assembler::popcntq(Register dst, Register src) { |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
5233 |
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
|
5234 |
emit_int8((unsigned char)0xF3); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
5235 |
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
|
5236 |
emit_int8((unsigned char)0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5237 |
emit_int8((unsigned char)0xB8); |
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)); |
2255
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
5239 |
} |
54abdf3e1055
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
2254
diff
changeset
|
5240 |
|
1066 | 5241 |
void Assembler::popq(Address dst) { |
5242 |
InstructionMark im(this); |
|
5243 |
prefixq(dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5244 |
emit_int8((unsigned char)0x8F); |
1066 | 5245 |
emit_operand(rax, dst); |
5246 |
} |
|
5247 |
||
5248 |
void Assembler::pusha() { // 64bit |
|
5249 |
// we have to store original rsp. ABI says that 128 bytes |
|
5250 |
// below rsp are local scratch. |
|
5251 |
movq(Address(rsp, -5 * wordSize), rsp); |
|
5252 |
||
5253 |
subq(rsp, 16 * wordSize); |
|
5254 |
||
5255 |
movq(Address(rsp, 15 * wordSize), rax); |
|
5256 |
movq(Address(rsp, 14 * wordSize), rcx); |
|
5257 |
movq(Address(rsp, 13 * wordSize), rdx); |
|
5258 |
movq(Address(rsp, 12 * wordSize), rbx); |
|
5259 |
// skip rsp |
|
5260 |
movq(Address(rsp, 10 * wordSize), rbp); |
|
5261 |
movq(Address(rsp, 9 * wordSize), rsi); |
|
5262 |
movq(Address(rsp, 8 * wordSize), rdi); |
|
5263 |
movq(Address(rsp, 7 * wordSize), r8); |
|
5264 |
movq(Address(rsp, 6 * wordSize), r9); |
|
5265 |
movq(Address(rsp, 5 * wordSize), r10); |
|
5266 |
movq(Address(rsp, 4 * wordSize), r11); |
|
5267 |
movq(Address(rsp, 3 * wordSize), r12); |
|
5268 |
movq(Address(rsp, 2 * wordSize), r13); |
|
5269 |
movq(Address(rsp, wordSize), r14); |
|
5270 |
movq(Address(rsp, 0), r15); |
|
5271 |
} |
|
5272 |
||
5273 |
void Assembler::pushq(Address src) { |
|
5274 |
InstructionMark im(this); |
|
5275 |
prefixq(src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5276 |
emit_int8((unsigned char)0xFF); |
1066 | 5277 |
emit_operand(rsi, src); |
5278 |
} |
|
5279 |
||
5280 |
void Assembler::rclq(Register dst, int imm8) { |
|
5281 |
assert(isShiftCount(imm8 >> 1), "illegal shift count"); |
|
5282 |
int encode = prefixq_and_encode(dst->encoding()); |
|
5283 |
if (imm8 == 1) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5284 |
emit_int8((unsigned char)0xD1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5285 |
emit_int8((unsigned char)(0xD0 | encode)); |
1066 | 5286 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5287 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5288 |
emit_int8((unsigned char)(0xD0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5289 |
emit_int8(imm8); |
1066 | 5290 |
} |
5291 |
} |
|
5292 |
void Assembler::sarq(Register dst, int imm8) { |
|
5293 |
assert(isShiftCount(imm8 >> 1), "illegal shift count"); |
|
5294 |
int encode = prefixq_and_encode(dst->encoding()); |
|
5295 |
if (imm8 == 1) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5296 |
emit_int8((unsigned char)0xD1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5297 |
emit_int8((unsigned char)(0xF8 | encode)); |
1066 | 5298 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5299 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5300 |
emit_int8((unsigned char)(0xF8 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5301 |
emit_int8(imm8); |
1066 | 5302 |
} |
5303 |
} |
|
5304 |
||
5305 |
void Assembler::sarq(Register dst) { |
|
5306 |
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
|
5307 |
emit_int8((unsigned char)0xD3); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5308 |
emit_int8((unsigned char)(0xF8 | encode)); |
1066 | 5309 |
} |
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
5310 |
|
1066 | 5311 |
void Assembler::sbbq(Address dst, int32_t imm32) { |
5312 |
InstructionMark im(this); |
|
5313 |
prefixq(dst); |
|
5314 |
emit_arith_operand(0x81, rbx, dst, imm32); |
|
5315 |
} |
|
5316 |
||
5317 |
void Assembler::sbbq(Register dst, int32_t imm32) { |
|
5318 |
(void) prefixq_and_encode(dst->encoding()); |
|
5319 |
emit_arith(0x81, 0xD8, dst, imm32); |
|
5320 |
} |
|
5321 |
||
5322 |
void Assembler::sbbq(Register dst, Address src) { |
|
5323 |
InstructionMark im(this); |
|
5324 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5325 |
emit_int8(0x1B); |
1066 | 5326 |
emit_operand(dst, src); |
5327 |
} |
|
5328 |
||
5329 |
void Assembler::sbbq(Register dst, Register src) { |
|
5330 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
5331 |
emit_arith(0x1B, 0xC0, dst, src); |
|
5332 |
} |
|
5333 |
||
5334 |
void Assembler::shlq(Register dst, int imm8) { |
|
5335 |
assert(isShiftCount(imm8 >> 1), "illegal shift count"); |
|
5336 |
int encode = prefixq_and_encode(dst->encoding()); |
|
5337 |
if (imm8 == 1) { |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5338 |
emit_int8((unsigned char)0xD1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5339 |
emit_int8((unsigned char)(0xE0 | encode)); |
1066 | 5340 |
} else { |
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5341 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5342 |
emit_int8((unsigned char)(0xE0 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5343 |
emit_int8(imm8); |
1066 | 5344 |
} |
5345 |
} |
|
5346 |
||
5347 |
void Assembler::shlq(Register dst) { |
|
5348 |
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
|
5349 |
emit_int8((unsigned char)0xD3); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5350 |
emit_int8((unsigned char)(0xE0 | encode)); |
1066 | 5351 |
} |
5352 |
||
5353 |
void Assembler::shrq(Register dst, int imm8) { |
|
5354 |
assert(isShiftCount(imm8 >> 1), "illegal shift count"); |
|
5355 |
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
|
5356 |
emit_int8((unsigned char)0xC1); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5357 |
emit_int8((unsigned char)(0xE8 | encode)); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5358 |
emit_int8(imm8); |
1066 | 5359 |
} |
5360 |
||
5361 |
void Assembler::shrq(Register dst) { |
|
5362 |
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
|
5363 |
emit_int8((unsigned char)0xD3); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5364 |
emit_int8(0xE8 | encode); |
1066 | 5365 |
} |
5366 |
||
5367 |
void Assembler::subq(Address dst, int32_t imm32) { |
|
5368 |
InstructionMark im(this); |
|
5369 |
prefixq(dst); |
|
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
5370 |
emit_arith_operand(0x81, rbp, dst, imm32); |
1066 | 5371 |
} |
5372 |
||
5373 |
void Assembler::subq(Address dst, Register src) { |
|
5374 |
InstructionMark im(this); |
|
5375 |
prefixq(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5376 |
emit_int8(0x29); |
1066 | 5377 |
emit_operand(src, dst); |
5378 |
} |
|
5379 |
||
7724
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
5380 |
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
|
5381 |
(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
|
5382 |
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
|
5383 |
} |
a92d706dbdd5
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
7439
diff
changeset
|
5384 |
|
11791
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
5385 |
// 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
|
5386 |
void Assembler::subq_imm32(Register dst, int32_t imm32) { |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
5387 |
(void) prefixq_and_encode(dst->encoding()); |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
5388 |
emit_arith_imm32(0x81, 0xE8, dst, imm32); |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
5389 |
} |
3be8cae67887
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
11438
diff
changeset
|
5390 |
|
1066 | 5391 |
void Assembler::subq(Register dst, Address src) { |
5392 |
InstructionMark im(this); |
|
5393 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5394 |
emit_int8(0x2B); |
1066 | 5395 |
emit_operand(dst, src); |
5396 |
} |
|
5397 |
||
5398 |
void Assembler::subq(Register dst, Register src) { |
|
5399 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
5400 |
emit_arith(0x2B, 0xC0, dst, src); |
|
5401 |
} |
|
5402 |
||
5403 |
void Assembler::testq(Register dst, int32_t imm32) { |
|
5404 |
// not using emit_arith because test |
|
5405 |
// doesn't support sign-extension of |
|
5406 |
// 8bit operands |
|
5407 |
int encode = dst->encoding(); |
|
5408 |
if (encode == 0) { |
|
5409 |
prefix(REX_W); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5410 |
emit_int8((unsigned char)0xA9); |
1066 | 5411 |
} else { |
5412 |
encode = prefixq_and_encode(encode); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5413 |
emit_int8((unsigned char)0xF7); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5414 |
emit_int8((unsigned char)(0xC0 | encode)); |
1066 | 5415 |
} |
5416 |
emit_long(imm32); |
|
5417 |
} |
|
5418 |
||
5419 |
void Assembler::testq(Register dst, Register src) { |
|
5420 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
5421 |
emit_arith(0x85, 0xC0, dst, src); |
|
5422 |
} |
|
5423 |
||
5424 |
void Assembler::xaddq(Address dst, Register src) { |
|
5425 |
InstructionMark im(this); |
|
5426 |
prefixq(dst, src); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5427 |
emit_int8(0x0F); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5428 |
emit_int8((unsigned char)0xC1); |
1066 | 5429 |
emit_operand(src, dst); |
5430 |
} |
|
5431 |
||
5432 |
void Assembler::xchgq(Register dst, Address src) { |
|
5433 |
InstructionMark im(this); |
|
5434 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5435 |
emit_int8((unsigned char)0x87); |
1066 | 5436 |
emit_operand(dst, src); |
5437 |
} |
|
5438 |
||
5439 |
void Assembler::xchgq(Register dst, Register src) { |
|
5440 |
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
|
5441 |
emit_int8((unsigned char)0x87); |
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5442 |
emit_int8((unsigned char)(0xc0 | encode)); |
1066 | 5443 |
} |
5444 |
||
5445 |
void Assembler::xorq(Register dst, Register src) { |
|
5446 |
(void) prefixq_and_encode(dst->encoding(), src->encoding()); |
|
5447 |
emit_arith(0x33, 0xC0, dst, src); |
|
5448 |
} |
|
5449 |
||
5450 |
void Assembler::xorq(Register dst, Address src) { |
|
5451 |
InstructionMark im(this); |
|
5452 |
prefixq(src, dst); |
|
14837
a75c3082d106
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
14834
diff
changeset
|
5453 |
emit_int8(0x33); |
1066 | 5454 |
emit_operand(dst, src); |
5455 |
} |
|
5456 |
||
5457 |
#endif // !LP64 |