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