Mercurial > hg > graal-jvmci-8
annotate src/cpu/x86/vm/assembler_x86.cpp @ 24234:ea6f94ab283b default tip
Added tag jvmci-0.36 for changeset 8128b98d4736
author | Gilles Duboscq <gilles.m.duboscq@oracle.com> |
---|---|
date | Mon, 18 Sep 2017 18:49:45 +0200 |
parents | f13e777eb255 |
children |
rev | line source |
---|---|
0 | 1 /* |
17937
78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
17913
diff
changeset
|
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1513
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1513
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1513
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #include "precompiled.hpp" |
7199
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
7198
diff
changeset
|
26 #include "asm/assembler.hpp" |
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
7198
diff
changeset
|
27 #include "asm/assembler.inline.hpp" |
1972 | 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" | |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
7477
diff
changeset
|
39 #include "utilities/macros.hpp" |
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
7477
diff
changeset
|
40 #if INCLUDE_ALL_GCS |
1972 | 41 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" |
42 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" | |
43 #include "gc_implementation/g1/heapRegion.hpp" | |
8001
db9981fd3124
8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents:
7477
diff
changeset
|
44 #endif // INCLUDE_ALL_GCS |
0 | 45 |
6266
1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
6225
diff
changeset
|
46 #ifdef PRODUCT |
1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
6225
diff
changeset
|
47 #define BLOCK_COMMENT(str) /* nothing */ |
1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
6225
diff
changeset
|
48 #define STOP(error) stop(error) |
1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
6225
diff
changeset
|
49 #else |
1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
6225
diff
changeset
|
50 #define BLOCK_COMMENT(str) block_comment(str) |
1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
6225
diff
changeset
|
51 #define STOP(error) block_comment(error); stop(error) |
1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
6225
diff
changeset
|
52 #endif |
1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
6225
diff
changeset
|
53 |
1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
6225
diff
changeset
|
54 #define BIND(label) bind(label); BLOCK_COMMENT(#label ":") |
0 | 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: | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6614
diff
changeset
|
62 case relocInfo::metadata_type: |
0 | 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 | |
304 | 97 #ifdef _LP64 |
98 | |
0 | 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(); | |
304 | 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) { | |
0 | 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; | |
304 | 142 } |
0 | 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 } | |
304 | 152 |
0 | 153 #endif // _LP64 |
154 | |
304 | 155 |
156 | |
0 | 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. | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6614
diff
changeset
|
160 Address Address::make_raw(int base, int index, int scale, int disp, relocInfo::relocType disp_reloc) { |
624 | 161 RelocationHolder rspec; |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6614
diff
changeset
|
162 if (disp_reloc != relocInfo::none) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6614
diff
changeset
|
163 rspec = Relocation::spec_simple(disp_reloc); |
624 | 164 } |
0 | 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)); | |
624 | 168 madr._rspec = rspec; |
0 | 169 return madr; |
170 } else { | |
171 Address madr(as_Register(base), noreg, Address::no_scale, in_ByteSize(disp)); | |
624 | 172 madr._rspec = rspec; |
0 | 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) | |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
186 emit_int32(data); |
0 | 187 else emit_data(data, Relocation::spec_simple(rtype), format); |
188 } | |
189 | |
190 void Assembler::emit_data(jint data, RelocationHolder const& rspec, int format) { | |
304 | 191 assert(imm_operand == 0, "default format must be immediate in this file"); |
0 | 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 } | |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
206 emit_int32(data); |
0 | 207 } |
208 | |
304 | 209 static int encode(Register r) { |
210 int enc = r->encoding(); | |
211 if (enc >= 8) { | |
212 enc -= 8; | |
213 } | |
214 return enc; | |
215 } | |
216 | |
0 | 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"); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
222 emit_int8(op1); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
223 emit_int8(op2 | encode(dst)); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
224 emit_int8(imm8); |
0 | 225 } |
226 | |
227 | |
304 | 228 void Assembler::emit_arith(int op1, int op2, Register dst, int32_t imm32) { |
0 | 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)) { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
233 emit_int8(op1 | 0x02); // set sign bit |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
234 emit_int8(op2 | encode(dst)); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
235 emit_int8(imm32 & 0xFF); |
0 | 236 } else { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
237 emit_int8(op1); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
238 emit_int8(op2 | encode(dst)); |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
239 emit_int32(imm32); |
0 | 240 } |
241 } | |
242 | |
4947
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
243 // Force generation of a 4 byte immediate value even if it fits into 8bit |
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
244 void Assembler::emit_arith_imm32(int op1, int op2, Register dst, int32_t imm32) { |
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
245 assert(isByte(op1) && isByte(op2), "wrong opcode"); |
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
246 assert((op1 & 0x01) == 1, "should be 32bit operation"); |
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
247 assert((op1 & 0x02) == 0, "sign-extension bit should not be set"); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
248 emit_int8(op1); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
249 emit_int8(op2 | encode(dst)); |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
250 emit_int32(imm32); |
4947
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
251 } |
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
252 |
0 | 253 // immediate-to-memory forms |
304 | 254 void Assembler::emit_arith_operand(int op1, Register rm, Address adr, int32_t imm32) { |
0 | 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)) { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
258 emit_int8(op1 | 0x02); // set sign bit |
304 | 259 emit_operand(rm, adr, 1); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
260 emit_int8(imm32 & 0xFF); |
0 | 261 } else { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
262 emit_int8(op1); |
304 | 263 emit_operand(rm, adr, 4); |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
264 emit_int32(imm32); |
0 | 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"); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
271 emit_int8(op1); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
272 emit_int8(op2 | encode(dst) << 3 | encode(src)); |
304 | 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) { | |
0 | 280 relocInfo::relocType rtype = (relocInfo::relocType) rspec.type(); |
304 | 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 | |
0 | 288 if (base->is_valid()) { |
289 if (index->is_valid()) { | |
290 assert(scale != Address::no_scale, "inconsistent address"); | |
291 // [base + index*scale + disp] | |
304 | 292 if (disp == 0 && rtype == relocInfo::none && |
293 base != rbp LP64_ONLY(&& base != r13)) { | |
0 | 294 // [base + index*scale] |
295 // [00 reg 100][ss index base] | |
296 assert(index != rsp, "illegal addressing mode"); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
297 emit_int8(0x04 | regenc); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
298 emit_int8(scale << 6 | indexenc | baseenc); |
0 | 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"); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
303 emit_int8(0x44 | regenc); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
304 emit_int8(scale << 6 | indexenc | baseenc); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
305 emit_int8(disp & 0xFF); |
0 | 306 } else { |
304 | 307 // [base + index*scale + disp32] |
308 // [10 reg 100][ss index base] disp32 | |
0 | 309 assert(index != rsp, "illegal addressing mode"); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
310 emit_int8(0x84 | regenc); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
311 emit_int8(scale << 6 | indexenc | baseenc); |
0 | 312 emit_data(disp, rspec, disp32_operand); |
313 } | |
304 | 314 } else if (base == rsp LP64_ONLY(|| base == r12)) { |
315 // [rsp + disp] | |
0 | 316 if (disp == 0 && rtype == relocInfo::none) { |
304 | 317 // [rsp] |
0 | 318 // [00 reg 100][00 100 100] |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
319 emit_int8(0x04 | regenc); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
320 emit_int8(0x24); |
0 | 321 } else if (is8bit(disp) && rtype == relocInfo::none) { |
304 | 322 // [rsp + imm8] |
323 // [01 reg 100][00 100 100] disp8 | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
324 emit_int8(0x44 | regenc); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
325 emit_int8(0x24); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
326 emit_int8(disp & 0xFF); |
0 | 327 } else { |
304 | 328 // [rsp + imm32] |
329 // [10 reg 100][00 100 100] disp32 | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
330 emit_int8(0x84 | regenc); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
331 emit_int8(0x24); |
0 | 332 emit_data(disp, rspec, disp32_operand); |
333 } | |
334 } else { | |
335 // [base + disp] | |
304 | 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)) { | |
0 | 339 // [base] |
340 // [00 reg base] | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
341 emit_int8(0x00 | regenc | baseenc); |
0 | 342 } else if (is8bit(disp) && rtype == relocInfo::none) { |
304 | 343 // [base + disp8] |
344 // [01 reg base] disp8 | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
345 emit_int8(0x40 | regenc | baseenc); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
346 emit_int8(disp & 0xFF); |
0 | 347 } else { |
304 | 348 // [base + disp32] |
349 // [10 reg base] disp32 | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
350 emit_int8(0x80 | regenc | baseenc); |
0 | 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] | |
304 | 358 // [00 reg 100][ss index 101] disp32 |
0 | 359 assert(index != rsp, "illegal addressing mode"); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
360 emit_int8(0x04 | regenc); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
361 emit_int8(scale << 6 | indexenc | 0x05); |
0 | 362 emit_data(disp, rspec, disp32_operand); |
304 | 363 } else if (rtype != relocInfo::none ) { |
364 // [disp] (64bit) RIP-RELATIVE (32bit) abs | |
365 // [00 000 101] disp32 | |
366 | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
367 emit_int8(0x05 | regenc); |
304 | 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 | |
0 | 383 } else { |
304 | 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 | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
387 emit_int8(0x04 | regenc); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
388 emit_int8(0x25); |
0 | 389 emit_data(disp, rspec, disp32_operand); |
390 } | |
391 } | |
392 } | |
393 | |
304 | 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 | |
0 | 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. | |
304 | 409 // If "which" is imm64_operand, selects the trailing immediate constant. |
0 | 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, | |
304 | 412 // and that it is 32/64 bits wide. |
0 | 413 |
414 // If "which" is end_pc_operand, find the end of the instruction. | |
415 | |
416 address ip = inst; | |
304 | 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: | |
0 | 423 switch (0xFF & *ip++) { |
424 | |
425 // These convenience macros generate groups of "case" labels for the switch. | |
304 | 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: \ | |
0 | 428 case (x)+4: case (x)+5: case (x)+6: case (x)+7 |
304 | 429 #define REP16(x) REP8((x)+0): \ |
0 | 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: | |
304 | 438 // Seems dubious |
439 LP64_ONLY(assert(false, "shouldn't have that prefix")); | |
0 | 440 assert(ip == inst+1, "only one prefix allowed"); |
441 goto again_after_prefix; | |
442 | |
304 | 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 | |
0 | 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 | |
304 | 473 debug_only(has_disp32 = true); |
0 | 474 break; |
475 | |
304 | 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"); | |
0 | 481 return ip; // not produced by emit_operand |
482 | |
483 case 0x66: // movw ... (size prefix) | |
304 | 484 again_after_size_prefix2: |
0 | 485 switch (0xFF & *ip++) { |
304 | 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; | |
0 | 504 case 0x8B: // movw r, a |
505 case 0x89: // movw a, r | |
304 | 506 debug_only(has_disp32 = true); |
0 | 507 break; |
508 case 0xC7: // movw a, #16 | |
304 | 509 debug_only(has_disp32 = true); |
0 | 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 | |
304 | 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 | |
5984 | 524 assert(which == imm_operand || which == disp32_operand, |
17937
78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
17913
diff
changeset
|
525 err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip))); |
304 | 526 #else |
527 assert((which == call32_operand || which == imm_operand) && is_64bit || | |
5984 | 528 which == narrow_oop_operand && !is_64bit, |
17937
78bbf4d43a14
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
17913
diff
changeset
|
529 err_msg("which %d is_64_bit %d ip " INTPTR_FORMAT, which, is_64bit, p2i(ip))); |
304 | 530 #endif // _LP64 |
0 | 531 return ip; |
532 | |
533 case 0x69: // imul r, a, #32 | |
534 case 0xC7: // movl a, #32(oop?) | |
535 tail_size = 4; | |
304 | 536 debug_only(has_disp32 = true); // has both kinds of operands! |
0 | 537 break; |
538 | |
539 case 0x0F: // movx..., etc. | |
540 switch (0xFF & *ip++) { | |
4759 | 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 | |
0 | 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 | |
23715
3d3f2a5699e6
Update Assembler::locate_operand from JDK9
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
20804
diff
changeset
|
562 case 0x58: // addpd |
3d3f2a5699e6
Update Assembler::locate_operand from JDK9
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
20804
diff
changeset
|
563 case 0x59: // mulpd |
0 | 564 case 0x6E: // movd |
565 case 0x7E: // movd | |
4759 | 566 case 0xAE: // ldmxcsr, stmxcsr, fxrstor, fxsave, clflush |
23715
3d3f2a5699e6
Update Assembler::locate_operand from JDK9
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
20804
diff
changeset
|
567 case 0xFE: // paddd |
304 | 568 debug_only(has_disp32 = true); |
0 | 569 break; |
570 | |
571 case 0xAD: // shrd r, a, %cl | |
572 case 0xAF: // imul r, a | |
304 | 573 case 0xBE: // movsbl r, a (movsxb) |
574 case 0xBF: // movswl r, a (movsxw) | |
575 case 0xB6: // movzbl r, a (movzxb) | |
576 case 0xB7: // movzwl r, a (movzxw) | |
0 | 577 case REP16(0x40): // cmovl cc, r, a |
578 case 0xB0: // cmpxchgb | |
579 case 0xB1: // cmpxchg | |
580 case 0xC1: // xaddl | |
581 case 0xC7: // cmpxchg8 | |
582 case REP16(0x90): // setcc a | |
304 | 583 debug_only(has_disp32 = true); |
0 | 584 // fall out of the switch to decode the address |
585 break; | |
304 | 586 |
4759 | 587 case 0xC4: // pinsrw r, a, #8 |
588 debug_only(has_disp32 = true); | |
589 case 0xC5: // pextrw r, r, #8 | |
590 tail_size = 1; // the imm8 | |
591 break; | |
592 | |
0 | 593 case 0xAC: // shrd r, a, #8 |
304 | 594 debug_only(has_disp32 = true); |
0 | 595 tail_size = 1; // the imm8 |
596 break; | |
304 | 597 |
0 | 598 case REP16(0x80): // jcc rdisp32 |
599 if (which == end_pc_operand) return ip + 4; | |
304 | 600 assert(which == call32_operand, "jcc has no disp32 or imm"); |
0 | 601 return ip; |
602 default: | |
603 ShouldNotReachHere(); | |
604 } | |
605 break; | |
606 | |
607 case 0x81: // addl a, #32; addl r, #32 | |
608 // also: orl, adcl, sbbl, andl, subl, xorl, cmpl | |
304 | 609 // on 32bit in the case of cmpl, the imm might be an oop |
0 | 610 tail_size = 4; |
304 | 611 debug_only(has_disp32 = true); // has both kinds of operands! |
0 | 612 break; |
613 | |
614 case 0x83: // addl a, #8; addl r, #8 | |
615 // also: orl, adcl, sbbl, andl, subl, xorl, cmpl | |
304 | 616 debug_only(has_disp32 = true); // has both kinds of operands! |
0 | 617 tail_size = 1; |
618 break; | |
619 | |
620 case 0x9B: | |
621 switch (0xFF & *ip++) { | |
622 case 0xD9: // fnstcw a | |
304 | 623 debug_only(has_disp32 = true); |
0 | 624 break; |
625 default: | |
626 ShouldNotReachHere(); | |
627 } | |
628 break; | |
629 | |
630 case REP4(0x00): // addb a, r; addl a, r; addb r, a; addl r, a | |
631 case REP4(0x10): // adc... | |
632 case REP4(0x20): // and... | |
633 case REP4(0x30): // xor... | |
634 case REP4(0x08): // or... | |
635 case REP4(0x18): // sbb... | |
636 case REP4(0x28): // sub... | |
304 | 637 case 0xF7: // mull a |
638 case 0x8D: // lea r, a | |
639 case 0x87: // xchg r, a | |
0 | 640 case REP4(0x38): // cmp... |
304 | 641 case 0x85: // test r, a |
642 debug_only(has_disp32 = true); // has both kinds of operands! | |
0 | 643 break; |
644 | |
645 case 0xC1: // sal a, #8; sar a, #8; shl a, #8; shr a, #8 | |
646 case 0xC6: // movb a, #8 | |
647 case 0x80: // cmpb a, #8 | |
648 case 0x6B: // imul r, a, #8 | |
304 | 649 debug_only(has_disp32 = true); // has both kinds of operands! |
0 | 650 tail_size = 1; // the imm8 |
651 break; | |
652 | |
4759 | 653 case 0xC4: // VEX_3bytes |
654 case 0xC5: // VEX_2bytes | |
655 assert((UseAVX > 0), "shouldn't have VEX prefix"); | |
656 assert(ip == inst+1, "no prefixes allowed"); | |
657 // C4 and C5 are also used as opcodes for PINSRW and PEXTRW instructions | |
658 // but they have prefix 0x0F and processed when 0x0F processed above. | |
659 // | |
660 // In 32-bit mode the VEX first byte C4 and C5 alias onto LDS and LES | |
661 // instructions (these instructions are not supported in 64-bit mode). | |
662 // To distinguish them bits [7:6] are set in the VEX second byte since | |
663 // ModRM byte can not be of the form 11xxxxxx in 32-bit mode. To set | |
664 // those VEX bits REX and vvvv bits are inverted. | |
665 // | |
666 // Fortunately C2 doesn't generate these instructions so we don't need | |
667 // to check for them in product version. | |
668 | |
669 // Check second byte | |
670 NOT_LP64(assert((0xC0 & *ip) == 0xC0, "shouldn't have LDS and LES instructions")); | |
671 | |
16784
88df5d7b1001
Correctly parse VEX encoded instructions in Assembler::locate_operand.
Roland Schatz <roland.schatz@oracle.com>
parents:
16081
diff
changeset
|
672 int vex_opcode; |
4759 | 673 // First byte |
674 if ((0xFF & *inst) == VEX_3bytes) { | |
16784
88df5d7b1001
Correctly parse VEX encoded instructions in Assembler::locate_operand.
Roland Schatz <roland.schatz@oracle.com>
parents:
16081
diff
changeset
|
675 vex_opcode = VEX_OPCODE_MASK & *ip; |
4759 | 676 ip++; // third byte |
677 is_64bit = ((VEX_W & *ip) == VEX_W); | |
16784
88df5d7b1001
Correctly parse VEX encoded instructions in Assembler::locate_operand.
Roland Schatz <roland.schatz@oracle.com>
parents:
16081
diff
changeset
|
678 } else { |
88df5d7b1001
Correctly parse VEX encoded instructions in Assembler::locate_operand.
Roland Schatz <roland.schatz@oracle.com>
parents:
16081
diff
changeset
|
679 vex_opcode = VEX_OPCODE_0F; |
4759 | 680 } |
681 ip++; // opcode | |
682 // To find the end of instruction (which == end_pc_operand). | |
16784
88df5d7b1001
Correctly parse VEX encoded instructions in Assembler::locate_operand.
Roland Schatz <roland.schatz@oracle.com>
parents:
16081
diff
changeset
|
683 switch (vex_opcode) { |
88df5d7b1001
Correctly parse VEX encoded instructions in Assembler::locate_operand.
Roland Schatz <roland.schatz@oracle.com>
parents:
16081
diff
changeset
|
684 case VEX_OPCODE_0F: |
88df5d7b1001
Correctly parse VEX encoded instructions in Assembler::locate_operand.
Roland Schatz <roland.schatz@oracle.com>
parents:
16081
diff
changeset
|
685 switch (0xFF & *ip) { |
88df5d7b1001
Correctly parse VEX encoded instructions in Assembler::locate_operand.
Roland Schatz <roland.schatz@oracle.com>
parents:
16081
diff
changeset
|
686 case 0x70: // pshufd r, r/a, #8 |
88df5d7b1001
Correctly parse VEX encoded instructions in Assembler::locate_operand.
Roland Schatz <roland.schatz@oracle.com>
parents:
16081
diff
changeset
|
687 case 0x71: // ps[rl|ra|ll]w r, #8 |
88df5d7b1001
Correctly parse VEX encoded instructions in Assembler::locate_operand.
Roland Schatz <roland.schatz@oracle.com>
parents:
16081
diff
changeset
|
688 case 0x72: // ps[rl|ra|ll]d r, #8 |
88df5d7b1001
Correctly parse VEX encoded instructions in Assembler::locate_operand.
Roland Schatz <roland.schatz@oracle.com>
parents:
16081
diff
changeset
|
689 case 0x73: // ps[rl|ra|ll]q r, #8 |
88df5d7b1001
Correctly parse VEX encoded instructions in Assembler::locate_operand.
Roland Schatz <roland.schatz@oracle.com>
parents:
16081
diff
changeset
|
690 case 0xC2: // cmp[ps|pd|ss|sd] r, r, r/a, #8 |
88df5d7b1001
Correctly parse VEX encoded instructions in Assembler::locate_operand.
Roland Schatz <roland.schatz@oracle.com>
parents:
16081
diff
changeset
|
691 case 0xC4: // pinsrw r, r, r/a, #8 |
88df5d7b1001
Correctly parse VEX encoded instructions in Assembler::locate_operand.
Roland Schatz <roland.schatz@oracle.com>
parents:
16081
diff
changeset
|
692 case 0xC5: // pextrw r/a, r, #8 |
88df5d7b1001
Correctly parse VEX encoded instructions in Assembler::locate_operand.
Roland Schatz <roland.schatz@oracle.com>
parents:
16081
diff
changeset
|
693 case 0xC6: // shufp[s|d] r, r, r/a, #8 |
88df5d7b1001
Correctly parse VEX encoded instructions in Assembler::locate_operand.
Roland Schatz <roland.schatz@oracle.com>
parents:
16081
diff
changeset
|
694 tail_size = 1; // the imm8 |
88df5d7b1001
Correctly parse VEX encoded instructions in Assembler::locate_operand.
Roland Schatz <roland.schatz@oracle.com>
parents:
16081
diff
changeset
|
695 break; |
88df5d7b1001
Correctly parse VEX encoded instructions in Assembler::locate_operand.
Roland Schatz <roland.schatz@oracle.com>
parents:
16081
diff
changeset
|
696 } |
88df5d7b1001
Correctly parse VEX encoded instructions in Assembler::locate_operand.
Roland Schatz <roland.schatz@oracle.com>
parents:
16081
diff
changeset
|
697 break; |
88df5d7b1001
Correctly parse VEX encoded instructions in Assembler::locate_operand.
Roland Schatz <roland.schatz@oracle.com>
parents:
16081
diff
changeset
|
698 case VEX_OPCODE_0F_3A: |
88df5d7b1001
Correctly parse VEX encoded instructions in Assembler::locate_operand.
Roland Schatz <roland.schatz@oracle.com>
parents:
16081
diff
changeset
|
699 tail_size = 1; |
88df5d7b1001
Correctly parse VEX encoded instructions in Assembler::locate_operand.
Roland Schatz <roland.schatz@oracle.com>
parents:
16081
diff
changeset
|
700 break; |
4759 | 701 } |
702 ip++; // skip opcode | |
703 debug_only(has_disp32 = true); // has both kinds of operands! | |
704 break; | |
0 | 705 |
23715
3d3f2a5699e6
Update Assembler::locate_operand from JDK9
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
20804
diff
changeset
|
706 case 0x62: // EVEX_4bytes |
3d3f2a5699e6
Update Assembler::locate_operand from JDK9
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
20804
diff
changeset
|
707 assert((UseAVX > 0), "shouldn't have EVEX prefix"); |
3d3f2a5699e6
Update Assembler::locate_operand from JDK9
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
20804
diff
changeset
|
708 assert(ip == inst+1, "no prefixes allowed"); |
3d3f2a5699e6
Update Assembler::locate_operand from JDK9
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
20804
diff
changeset
|
709 // no EVEX collisions, all instructions that have 0x62 opcodes |
3d3f2a5699e6
Update Assembler::locate_operand from JDK9
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
20804
diff
changeset
|
710 // have EVEX versions and are subopcodes of 0x66 |
3d3f2a5699e6
Update Assembler::locate_operand from JDK9
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
20804
diff
changeset
|
711 ip++; // skip P0 and exmaine W in P1 |
3d3f2a5699e6
Update Assembler::locate_operand from JDK9
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
20804
diff
changeset
|
712 is_64bit = ((VEX_W & *ip) == VEX_W); |
3d3f2a5699e6
Update Assembler::locate_operand from JDK9
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
20804
diff
changeset
|
713 ip++; // move to P2 |
3d3f2a5699e6
Update Assembler::locate_operand from JDK9
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
20804
diff
changeset
|
714 ip++; // skip P2, move to opcode |
3d3f2a5699e6
Update Assembler::locate_operand from JDK9
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
20804
diff
changeset
|
715 // To find the end of instruction (which == end_pc_operand). |
4759 | 716 switch (0xFF & *ip) { |
23715
3d3f2a5699e6
Update Assembler::locate_operand from JDK9
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
20804
diff
changeset
|
717 case 0x22: // pinsrd r, r/a, #8 |
4759 | 718 case 0x61: // pcmpestri r, r/a, #8 |
719 case 0x70: // pshufd r, r/a, #8 | |
720 case 0x73: // psrldq r, #8 | |
721 tail_size = 1; // the imm8 | |
722 break; | |
723 default: | |
724 break; | |
725 } | |
726 ip++; // skip opcode | |
727 debug_only(has_disp32 = true); // has both kinds of operands! | |
728 break; | |
0 | 729 |
730 case 0xD1: // sal a, 1; sar a, 1; shl a, 1; shr a, 1 | |
731 case 0xD3: // sal a, %cl; sar a, %cl; shl a, %cl; shr a, %cl | |
732 case 0xD9: // fld_s a; fst_s a; fstp_s a; fldcw a | |
733 case 0xDD: // fld_d a; fst_d a; fstp_d a | |
734 case 0xDB: // fild_s a; fistp_s a; fld_x a; fstp_x a | |
735 case 0xDF: // fild_d a; fistp_d a | |
736 case 0xD8: // fadd_s a; fsubr_s a; fmul_s a; fdivr_s a; fcomp_s a | |
737 case 0xDC: // fadd_d a; fsubr_d a; fmul_d a; fdivr_d a; fcomp_d a | |
738 case 0xDE: // faddp_d a; fsubrp_d a; fmulp_d a; fdivrp_d a; fcompp_d a | |
304 | 739 debug_only(has_disp32 = true); |
0 | 740 break; |
741 | |
4759 | 742 case 0xE8: // call rdisp32 |
743 case 0xE9: // jmp rdisp32 | |
744 if (which == end_pc_operand) return ip + 4; | |
745 assert(which == call32_operand, "call has no disp32 or imm"); | |
746 return ip; | |
747 | |
420
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
405
diff
changeset
|
748 case 0xF0: // Lock |
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
405
diff
changeset
|
749 assert(os::is_MP(), "only on MP"); |
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
405
diff
changeset
|
750 goto again_after_prefix; |
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
405
diff
changeset
|
751 |
0 | 752 case 0xF3: // For SSE |
753 case 0xF2: // For SSE2 | |
304 | 754 switch (0xFF & *ip++) { |
755 case REX: | |
756 case REX_B: | |
757 case REX_X: | |
758 case REX_XB: | |
759 case REX_R: | |
760 case REX_RB: | |
761 case REX_RX: | |
762 case REX_RXB: | |
763 case REX_W: | |
764 case REX_WB: | |
765 case REX_WX: | |
766 case REX_WXB: | |
767 case REX_WR: | |
768 case REX_WRB: | |
769 case REX_WRX: | |
770 case REX_WRXB: | |
771 NOT_LP64(assert(false, "found 64bit prefix")); | |
772 ip++; | |
773 default: | |
774 ip++; | |
775 } | |
776 debug_only(has_disp32 = true); // has both kinds of operands! | |
0 | 777 break; |
778 | |
779 default: | |
780 ShouldNotReachHere(); | |
781 | |
304 | 782 #undef REP8 |
783 #undef REP16 | |
0 | 784 } |
785 | |
786 assert(which != call32_operand, "instruction is not a call, jmp, or jcc"); | |
304 | 787 #ifdef _LP64 |
788 assert(which != imm_operand, "instruction is not a movq reg, imm64"); | |
789 #else | |
790 // assert(which != imm_operand || has_imm32, "instruction has no imm32 field"); | |
791 assert(which != imm_operand || has_disp32, "instruction has no imm32 field"); | |
792 #endif // LP64 | |
793 assert(which != disp32_operand || has_disp32, "instruction has no disp32 field"); | |
0 | 794 |
795 // parse the output of emit_operand | |
796 int op2 = 0xFF & *ip++; | |
797 int base = op2 & 0x07; | |
798 int op3 = -1; | |
799 const int b100 = 4; | |
800 const int b101 = 5; | |
801 if (base == b100 && (op2 >> 6) != 3) { | |
802 op3 = 0xFF & *ip++; | |
803 base = op3 & 0x07; // refetch the base | |
804 } | |
805 // now ip points at the disp (if any) | |
806 | |
807 switch (op2 >> 6) { | |
808 case 0: | |
809 // [00 reg 100][ss index base] | |
304 | 810 // [00 reg 100][00 100 esp] |
0 | 811 // [00 reg base] |
812 // [00 reg 100][ss index 101][disp32] | |
813 // [00 reg 101] [disp32] | |
814 | |
815 if (base == b101) { | |
816 if (which == disp32_operand) | |
817 return ip; // caller wants the disp32 | |
818 ip += 4; // skip the disp32 | |
819 } | |
820 break; | |
821 | |
822 case 1: | |
823 // [01 reg 100][ss index base][disp8] | |
304 | 824 // [01 reg 100][00 100 esp][disp8] |
0 | 825 // [01 reg base] [disp8] |
826 ip += 1; // skip the disp8 | |
827 break; | |
828 | |
829 case 2: | |
830 // [10 reg 100][ss index base][disp32] | |
304 | 831 // [10 reg 100][00 100 esp][disp32] |
0 | 832 // [10 reg base] [disp32] |
833 if (which == disp32_operand) | |
834 return ip; // caller wants the disp32 | |
835 ip += 4; // skip the disp32 | |
836 break; | |
837 | |
838 case 3: | |
839 // [11 reg base] (not a memory addressing mode) | |
840 break; | |
841 } | |
842 | |
843 if (which == end_pc_operand) { | |
844 return ip + tail_size; | |
845 } | |
846 | |
304 | 847 #ifdef _LP64 |
642
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
848 assert(which == narrow_oop_operand && !is_64bit, "instruction is not a movl adr, imm32"); |
304 | 849 #else |
850 assert(which == imm_operand, "instruction has only an imm field"); | |
851 #endif // LP64 | |
0 | 852 return ip; |
853 } | |
854 | |
855 address Assembler::locate_next_instruction(address inst) { | |
856 // Secretly share code with locate_operand: | |
857 return locate_operand(inst, end_pc_operand); | |
858 } | |
859 | |
860 | |
861 #ifdef ASSERT | |
862 void Assembler::check_relocation(RelocationHolder const& rspec, int format) { | |
863 address inst = inst_mark(); | |
864 assert(inst != NULL && inst < pc(), "must point to beginning of instruction"); | |
865 address opnd; | |
866 | |
867 Relocation* r = rspec.reloc(); | |
868 if (r->type() == relocInfo::none) { | |
869 return; | |
870 } else if (r->is_call() || format == call32_operand) { | |
871 // assert(format == imm32_operand, "cannot specify a nonzero format"); | |
872 opnd = locate_operand(inst, call32_operand); | |
873 } else if (r->is_data()) { | |
304 | 874 assert(format == imm_operand || format == disp32_operand |
875 LP64_ONLY(|| format == narrow_oop_operand), "format ok"); | |
0 | 876 opnd = locate_operand(inst, (WhichOperand)format); |
877 } else { | |
304 | 878 assert(format == imm_operand, "cannot specify a format"); |
0 | 879 return; |
880 } | |
881 assert(opnd == pc(), "must put operand where relocs can find it"); | |
882 } | |
304 | 883 #endif // ASSERT |
884 | |
885 void Assembler::emit_operand32(Register reg, Address adr) { | |
886 assert(reg->encoding() < 8, "no extended registers"); | |
887 assert(!adr.base_needs_rex() && !adr.index_needs_rex(), "no extended registers"); | |
888 emit_operand(reg, adr._base, adr._index, adr._scale, adr._disp, | |
889 adr._rspec); | |
890 } | |
891 | |
892 void Assembler::emit_operand(Register reg, Address adr, | |
893 int rip_relative_correction) { | |
894 emit_operand(reg, adr._base, adr._index, adr._scale, adr._disp, | |
895 adr._rspec, | |
896 rip_relative_correction); | |
897 } | |
898 | |
899 void Assembler::emit_operand(XMMRegister reg, Address adr) { | |
900 emit_operand(reg, adr._base, adr._index, adr._scale, adr._disp, | |
901 adr._rspec); | |
902 } | |
903 | |
904 // MMX operations | |
905 void Assembler::emit_operand(MMXRegister reg, Address adr) { | |
906 assert(!adr.base_needs_rex() && !adr.index_needs_rex(), "no extended registers"); | |
907 emit_operand((Register)reg, adr._base, adr._index, adr._scale, adr._disp, adr._rspec); | |
908 } | |
909 | |
910 // work around gcc (3.2.1-7a) bug | |
911 void Assembler::emit_operand(Address adr, MMXRegister reg) { | |
912 assert(!adr.base_needs_rex() && !adr.index_needs_rex(), "no extended registers"); | |
913 emit_operand((Register)reg, adr._base, adr._index, adr._scale, adr._disp, adr._rspec); | |
0 | 914 } |
915 | |
916 | |
917 void Assembler::emit_farith(int b1, int b2, int i) { | |
918 assert(isByte(b1) && isByte(b2), "wrong opcode"); | |
919 assert(0 <= i && i < 8, "illegal stack offset"); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
920 emit_int8(b1); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
921 emit_int8(b2 + i); |
0 | 922 } |
923 | |
924 | |
2100
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
925 // Now the Assembler instructions (identical for 32/64 bits) |
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
926 |
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
927 void Assembler::adcl(Address dst, int32_t imm32) { |
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
928 InstructionMark im(this); |
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
929 prefix(dst); |
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
930 emit_arith_operand(0x81, rdx, dst, imm32); |
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
931 } |
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
932 |
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
933 void Assembler::adcl(Address dst, Register src) { |
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
934 InstructionMark im(this); |
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
935 prefix(dst, src); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
936 emit_int8(0x11); |
2100
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
937 emit_operand(src, dst); |
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
938 } |
304 | 939 |
940 void Assembler::adcl(Register dst, int32_t imm32) { | |
941 prefix(dst); | |
0 | 942 emit_arith(0x81, 0xD0, dst, imm32); |
943 } | |
944 | |
945 void Assembler::adcl(Register dst, Address src) { | |
946 InstructionMark im(this); | |
304 | 947 prefix(src, dst); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
948 emit_int8(0x13); |
0 | 949 emit_operand(dst, src); |
950 } | |
951 | |
952 void Assembler::adcl(Register dst, Register src) { | |
304 | 953 (void) prefix_and_encode(dst->encoding(), src->encoding()); |
0 | 954 emit_arith(0x13, 0xC0, dst, src); |
955 } | |
956 | |
304 | 957 void Assembler::addl(Address dst, int32_t imm32) { |
958 InstructionMark im(this); | |
959 prefix(dst); | |
960 emit_arith_operand(0x81, rax, dst, imm32); | |
961 } | |
0 | 962 |
963 void Assembler::addl(Address dst, Register src) { | |
964 InstructionMark im(this); | |
304 | 965 prefix(dst, src); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
966 emit_int8(0x01); |
0 | 967 emit_operand(src, dst); |
968 } | |
969 | |
304 | 970 void Assembler::addl(Register dst, int32_t imm32) { |
971 prefix(dst); | |
0 | 972 emit_arith(0x81, 0xC0, dst, imm32); |
973 } | |
974 | |
975 void Assembler::addl(Register dst, Address src) { | |
976 InstructionMark im(this); | |
304 | 977 prefix(src, dst); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
978 emit_int8(0x03); |
0 | 979 emit_operand(dst, src); |
980 } | |
981 | |
982 void Assembler::addl(Register dst, Register src) { | |
304 | 983 (void) prefix_and_encode(dst->encoding(), src->encoding()); |
0 | 984 emit_arith(0x03, 0xC0, dst, src); |
985 } | |
986 | |
987 void Assembler::addr_nop_4() { | |
4947
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
988 assert(UseAddressNop, "no CPU support"); |
0 | 989 // 4 bytes: NOP DWORD PTR [EAX+0] |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
990 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
991 emit_int8(0x1F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
992 emit_int8(0x40); // emit_rm(cbuf, 0x1, EAX_enc, EAX_enc); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
993 emit_int8(0); // 8-bits offset (1 byte) |
0 | 994 } |
995 | |
996 void Assembler::addr_nop_5() { | |
4947
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
997 assert(UseAddressNop, "no CPU support"); |
0 | 998 // 5 bytes: NOP DWORD PTR [EAX+EAX*0+0] 8-bits offset |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
999 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1000 emit_int8(0x1F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1001 emit_int8(0x44); // emit_rm(cbuf, 0x1, EAX_enc, 0x4); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1002 emit_int8(0x00); // emit_rm(cbuf, 0x0, EAX_enc, EAX_enc); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1003 emit_int8(0); // 8-bits offset (1 byte) |
0 | 1004 } |
1005 | |
1006 void Assembler::addr_nop_7() { | |
4947
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
1007 assert(UseAddressNop, "no CPU support"); |
0 | 1008 // 7 bytes: NOP DWORD PTR [EAX+0] 32-bits offset |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1009 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1010 emit_int8(0x1F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1011 emit_int8((unsigned char)0x80); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1012 // emit_rm(cbuf, 0x2, EAX_enc, EAX_enc); |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
1013 emit_int32(0); // 32-bits offset (4 bytes) |
0 | 1014 } |
1015 | |
1016 void Assembler::addr_nop_8() { | |
4947
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
1017 assert(UseAddressNop, "no CPU support"); |
0 | 1018 // 8 bytes: NOP DWORD PTR [EAX+EAX*0+0] 32-bits offset |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1019 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1020 emit_int8(0x1F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1021 emit_int8((unsigned char)0x84); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1022 // emit_rm(cbuf, 0x2, EAX_enc, 0x4); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1023 emit_int8(0x00); // emit_rm(cbuf, 0x0, EAX_enc, EAX_enc); |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
1024 emit_int32(0); // 32-bits offset (4 bytes) |
0 | 1025 } |
1026 | |
304 | 1027 void Assembler::addsd(XMMRegister dst, XMMRegister src) { |
1028 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1029 emit_simd_arith(0x58, dst, src, VEX_SIMD_F2); |
304 | 1030 } |
1031 | |
1032 void Assembler::addsd(XMMRegister dst, Address src) { | |
1033 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1034 emit_simd_arith(0x58, dst, src, VEX_SIMD_F2); |
304 | 1035 } |
1036 | |
1037 void Assembler::addss(XMMRegister dst, XMMRegister src) { | |
1038 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1039 emit_simd_arith(0x58, dst, src, VEX_SIMD_F3); |
304 | 1040 } |
1041 | |
1042 void Assembler::addss(XMMRegister dst, Address src) { | |
1043 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1044 emit_simd_arith(0x58, dst, src, VEX_SIMD_F3); |
304 | 1045 } |
1046 | |
6894 | 1047 void Assembler::aesdec(XMMRegister dst, Address src) { |
1048 assert(VM_Version::supports_aes(), ""); | |
1049 InstructionMark im(this); | |
1050 simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1051 emit_int8((unsigned char)0xDE); |
6894 | 1052 emit_operand(dst, src); |
1053 } | |
1054 | |
1055 void Assembler::aesdec(XMMRegister dst, XMMRegister src) { | |
1056 assert(VM_Version::supports_aes(), ""); | |
1057 int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1058 emit_int8((unsigned char)0xDE); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1059 emit_int8(0xC0 | encode); |
6894 | 1060 } |
1061 | |
1062 void Assembler::aesdeclast(XMMRegister dst, Address src) { | |
1063 assert(VM_Version::supports_aes(), ""); | |
1064 InstructionMark im(this); | |
1065 simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1066 emit_int8((unsigned char)0xDF); |
6894 | 1067 emit_operand(dst, src); |
1068 } | |
1069 | |
1070 void Assembler::aesdeclast(XMMRegister dst, XMMRegister src) { | |
1071 assert(VM_Version::supports_aes(), ""); | |
1072 int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1073 emit_int8((unsigned char)0xDF); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1074 emit_int8((unsigned char)(0xC0 | encode)); |
6894 | 1075 } |
1076 | |
1077 void Assembler::aesenc(XMMRegister dst, Address src) { | |
1078 assert(VM_Version::supports_aes(), ""); | |
1079 InstructionMark im(this); | |
1080 simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1081 emit_int8((unsigned char)0xDC); |
6894 | 1082 emit_operand(dst, src); |
1083 } | |
1084 | |
1085 void Assembler::aesenc(XMMRegister dst, XMMRegister src) { | |
1086 assert(VM_Version::supports_aes(), ""); | |
1087 int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1088 emit_int8((unsigned char)0xDC); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1089 emit_int8(0xC0 | encode); |
6894 | 1090 } |
1091 | |
1092 void Assembler::aesenclast(XMMRegister dst, Address src) { | |
1093 assert(VM_Version::supports_aes(), ""); | |
1094 InstructionMark im(this); | |
1095 simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1096 emit_int8((unsigned char)0xDD); |
6894 | 1097 emit_operand(dst, src); |
1098 } | |
1099 | |
1100 void Assembler::aesenclast(XMMRegister dst, XMMRegister src) { | |
1101 assert(VM_Version::supports_aes(), ""); | |
1102 int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1103 emit_int8((unsigned char)0xDD); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1104 emit_int8((unsigned char)(0xC0 | encode)); |
6894 | 1105 } |
1106 | |
1107 | |
4759 | 1108 void Assembler::andl(Address dst, int32_t imm32) { |
1109 InstructionMark im(this); | |
1110 prefix(dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1111 emit_int8((unsigned char)0x81); |
4759 | 1112 emit_operand(rsp, dst, 4); |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
1113 emit_int32(imm32); |
4759 | 1114 } |
1115 | |
304 | 1116 void Assembler::andl(Register dst, int32_t imm32) { |
1117 prefix(dst); | |
1118 emit_arith(0x81, 0xE0, dst, imm32); | |
1119 } | |
1120 | |
1121 void Assembler::andl(Register dst, Address src) { | |
1122 InstructionMark im(this); | |
1123 prefix(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1124 emit_int8(0x23); |
304 | 1125 emit_operand(dst, src); |
1126 } | |
1127 | |
1128 void Assembler::andl(Register dst, Register src) { | |
1129 (void) prefix_and_encode(dst->encoding(), src->encoding()); | |
1130 emit_arith(0x23, 0xC0, dst, src); | |
1131 } | |
1132 | |
14693
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1133 void Assembler::andnl(Register dst, Register src1, Register src2) { |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1134 assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1135 int encode = vex_prefix_0F38_and_encode(dst, src1, src2); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1136 emit_int8((unsigned char)0xF2); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1137 emit_int8((unsigned char)(0xC0 | encode)); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1138 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1139 |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1140 void Assembler::andnl(Register dst, Register src1, Address src2) { |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1141 InstructionMark im(this); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1142 assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1143 vex_prefix_0F38(dst, src1, src2); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1144 emit_int8((unsigned char)0xF2); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1145 emit_operand(dst, src2); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1146 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1147 |
775
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
1148 void Assembler::bsfl(Register dst, Register src) { |
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
1149 int encode = prefix_and_encode(dst->encoding(), src->encoding()); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1150 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1151 emit_int8((unsigned char)0xBC); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1152 emit_int8((unsigned char)(0xC0 | encode)); |
775
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
1153 } |
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
1154 |
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
1155 void Assembler::bsrl(Register dst, Register src) { |
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
1156 int encode = prefix_and_encode(dst->encoding(), src->encoding()); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1157 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1158 emit_int8((unsigned char)0xBD); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1159 emit_int8((unsigned char)(0xC0 | encode)); |
775
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
1160 } |
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
1161 |
304 | 1162 void Assembler::bswapl(Register reg) { // bswap |
1163 int encode = prefix_and_encode(reg->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1164 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1165 emit_int8((unsigned char)(0xC8 | encode)); |
304 | 1166 } |
1167 | |
14693
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1168 void Assembler::blsil(Register dst, Register src) { |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1169 assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1170 int encode = vex_prefix_0F38_and_encode(rbx, dst, src); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1171 emit_int8((unsigned char)0xF3); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1172 emit_int8((unsigned char)(0xC0 | encode)); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1173 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1174 |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1175 void Assembler::blsil(Register dst, Address src) { |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1176 InstructionMark im(this); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1177 assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1178 vex_prefix_0F38(rbx, dst, src); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1179 emit_int8((unsigned char)0xF3); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1180 emit_operand(rbx, src); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1181 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1182 |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1183 void Assembler::blsmskl(Register dst, Register src) { |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1184 assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1185 int encode = vex_prefix_0F38_and_encode(rdx, dst, src); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1186 emit_int8((unsigned char)0xF3); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1187 emit_int8((unsigned char)(0xC0 | encode)); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1188 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1189 |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1190 void Assembler::blsmskl(Register dst, Address src) { |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1191 InstructionMark im(this); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1192 assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1193 vex_prefix_0F38(rdx, dst, src); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1194 emit_int8((unsigned char)0xF3); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1195 emit_operand(rdx, src); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1196 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1197 |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1198 void Assembler::blsrl(Register dst, Register src) { |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1199 assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1200 int encode = vex_prefix_0F38_and_encode(rcx, dst, src); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1201 emit_int8((unsigned char)0xF3); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1202 emit_int8((unsigned char)(0xC0 | encode)); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1203 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1204 |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1205 void Assembler::blsrl(Register dst, Address src) { |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1206 InstructionMark im(this); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1207 assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1208 vex_prefix_0F38(rcx, dst, src); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1209 emit_int8((unsigned char)0xF3); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1210 emit_operand(rcx, src); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1211 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
1212 |
304 | 1213 void Assembler::call(Label& L, relocInfo::relocType rtype) { |
1214 // suspect disp32 is always good | |
1215 int operand = LP64_ONLY(disp32_operand) NOT_LP64(imm_operand); | |
1216 | |
1217 if (L.is_bound()) { | |
1218 const int long_size = 5; | |
1219 int offs = (int)( target(L) - pc() ); | |
1220 assert(offs <= 0, "assembler error"); | |
1221 InstructionMark im(this); | |
1222 // 1110 1000 #32-bit disp | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1223 emit_int8((unsigned char)0xE8); |
304 | 1224 emit_data(offs - long_size, rtype, operand); |
1225 } else { | |
1226 InstructionMark im(this); | |
1227 // 1110 1000 #32-bit disp | |
1228 L.add_patch_at(code(), locator()); | |
1229 | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1230 emit_int8((unsigned char)0xE8); |
304 | 1231 emit_data(int(0), rtype, operand); |
1232 } | |
1233 } | |
1234 | |
1235 void Assembler::call(Register dst) { | |
4759 | 1236 int encode = prefix_and_encode(dst->encoding()); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1237 emit_int8((unsigned char)0xFF); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1238 emit_int8((unsigned char)(0xD0 | encode)); |
304 | 1239 } |
1240 | |
1241 | |
1242 void Assembler::call(Address adr) { | |
1243 InstructionMark im(this); | |
1244 prefix(adr); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1245 emit_int8((unsigned char)0xFF); |
304 | 1246 emit_operand(rdx, adr); |
1247 } | |
1248 | |
1249 void Assembler::call_literal(address entry, RelocationHolder const& rspec) { | |
1250 assert(entry != NULL, "call most probably wrong"); | |
1251 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1252 emit_int8((unsigned char)0xE8); |
7198
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
6894
diff
changeset
|
1253 intptr_t disp = entry - (pc() + sizeof(int32_t)); |
304 | 1254 assert(is_simm32(disp), "must be 32bit offset (call2)"); |
1255 // Technically, should use call32_operand, but this format is | |
1256 // implied by the fact that we're emitting a call instruction. | |
1257 | |
1258 int operand = LP64_ONLY(disp32_operand) NOT_LP64(call32_operand); | |
1259 emit_data((int) disp, rspec, operand); | |
1260 } | |
1261 | |
1262 void Assembler::cdql() { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1263 emit_int8((unsigned char)0x99); |
304 | 1264 } |
1265 | |
7199
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
7198
diff
changeset
|
1266 void Assembler::cld() { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1267 emit_int8((unsigned char)0xFC); |
7199
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
7198
diff
changeset
|
1268 } |
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
7198
diff
changeset
|
1269 |
304 | 1270 void Assembler::cmovl(Condition cc, Register dst, Register src) { |
1271 NOT_LP64(guarantee(VM_Version::supports_cmov(), "illegal instruction")); | |
1272 int encode = prefix_and_encode(dst->encoding(), src->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1273 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1274 emit_int8(0x40 | cc); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1275 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 1276 } |
1277 | |
1278 | |
1279 void Assembler::cmovl(Condition cc, Register dst, Address src) { | |
1280 NOT_LP64(guarantee(VM_Version::supports_cmov(), "illegal instruction")); | |
1281 prefix(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1282 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1283 emit_int8(0x40 | cc); |
304 | 1284 emit_operand(dst, src); |
1285 } | |
1286 | |
1287 void Assembler::cmpb(Address dst, int imm8) { | |
1288 InstructionMark im(this); | |
1289 prefix(dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1290 emit_int8((unsigned char)0x80); |
304 | 1291 emit_operand(rdi, dst, 1); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1292 emit_int8(imm8); |
304 | 1293 } |
1294 | |
1295 void Assembler::cmpl(Address dst, int32_t imm32) { | |
1296 InstructionMark im(this); | |
1297 prefix(dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1298 emit_int8((unsigned char)0x81); |
304 | 1299 emit_operand(rdi, dst, 4); |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
1300 emit_int32(imm32); |
304 | 1301 } |
1302 | |
1303 void Assembler::cmpl(Register dst, int32_t imm32) { | |
1304 prefix(dst); | |
1305 emit_arith(0x81, 0xF8, dst, imm32); | |
1306 } | |
1307 | |
1308 void Assembler::cmpl(Register dst, Register src) { | |
1309 (void) prefix_and_encode(dst->encoding(), src->encoding()); | |
1310 emit_arith(0x3B, 0xC0, dst, src); | |
1311 } | |
1312 | |
1313 | |
1314 void Assembler::cmpl(Register dst, Address src) { | |
1315 InstructionMark im(this); | |
1316 prefix(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1317 emit_int8((unsigned char)0x3B); |
304 | 1318 emit_operand(dst, src); |
1319 } | |
1320 | |
1321 void Assembler::cmpw(Address dst, int imm16) { | |
1322 InstructionMark im(this); | |
1323 assert(!dst.base_needs_rex() && !dst.index_needs_rex(), "no extended registers"); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1324 emit_int8(0x66); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1325 emit_int8((unsigned char)0x81); |
304 | 1326 emit_operand(rdi, dst, 2); |
7424
c4bd2eccea46
8004536: replace AbstractAssembler emit_word with emit_int16
twisti
parents:
7199
diff
changeset
|
1327 emit_int16(imm16); |
304 | 1328 } |
1329 | |
1330 // The 32-bit cmpxchg compares the value at adr with the contents of rax, | |
1331 // and stores reg into adr if so; otherwise, the value at adr is loaded into rax,. | |
1332 // The ZF is set if the compared values were equal, and cleared otherwise. | |
1333 void Assembler::cmpxchgl(Register reg, Address adr) { // cmpxchg | |
6834 | 1334 InstructionMark im(this); |
1335 prefix(adr, reg); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1336 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1337 emit_int8((unsigned char)0xB1); |
6834 | 1338 emit_operand(reg, adr); |
304 | 1339 } |
1340 | |
1341 void Assembler::comisd(XMMRegister dst, Address src) { | |
1342 // NOTE: dbx seems to decode this as comiss even though the | |
1343 // 0x66 is there. Strangly ucomisd comes out correct | |
1344 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1345 emit_simd_arith_nonds(0x2F, dst, src, VEX_SIMD_66); |
4759 | 1346 } |
1347 | |
1348 void Assembler::comisd(XMMRegister dst, XMMRegister src) { | |
1349 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1350 emit_simd_arith_nonds(0x2F, dst, src, VEX_SIMD_66); |
304 | 1351 } |
1352 | |
1353 void Assembler::comiss(XMMRegister dst, Address src) { | |
1354 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1355 emit_simd_arith_nonds(0x2F, dst, src, VEX_SIMD_NONE); |
304 | 1356 } |
1357 | |
4759 | 1358 void Assembler::comiss(XMMRegister dst, XMMRegister src) { |
1359 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1360 emit_simd_arith_nonds(0x2F, dst, src, VEX_SIMD_NONE); |
4759 | 1361 } |
1362 | |
7199
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
7198
diff
changeset
|
1363 void Assembler::cpuid() { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1364 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1365 emit_int8((unsigned char)0xA2); |
7199
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
7198
diff
changeset
|
1366 } |
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
7198
diff
changeset
|
1367 |
304 | 1368 void Assembler::cvtdq2pd(XMMRegister dst, XMMRegister src) { |
1369 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1370 emit_simd_arith_nonds(0xE6, dst, src, VEX_SIMD_F3); |
304 | 1371 } |
1372 | |
1373 void Assembler::cvtdq2ps(XMMRegister dst, XMMRegister src) { | |
1374 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1375 emit_simd_arith_nonds(0x5B, dst, src, VEX_SIMD_NONE); |
304 | 1376 } |
1377 | |
1378 void Assembler::cvtsd2ss(XMMRegister dst, XMMRegister src) { | |
1379 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1380 emit_simd_arith(0x5A, dst, src, VEX_SIMD_F2); |
304 | 1381 } |
1382 | |
4759 | 1383 void Assembler::cvtsd2ss(XMMRegister dst, Address src) { |
1384 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1385 emit_simd_arith(0x5A, dst, src, VEX_SIMD_F2); |
4759 | 1386 } |
1387 | |
304 | 1388 void Assembler::cvtsi2sdl(XMMRegister dst, Register src) { |
1389 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
4759 | 1390 int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F2); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1391 emit_int8(0x2A); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1392 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 1393 } |
1394 | |
4759 | 1395 void Assembler::cvtsi2sdl(XMMRegister dst, Address src) { |
1396 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1397 emit_simd_arith(0x2A, dst, src, VEX_SIMD_F2); |
4759 | 1398 } |
1399 | |
304 | 1400 void Assembler::cvtsi2ssl(XMMRegister dst, Register src) { |
1401 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
4759 | 1402 int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_F3); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1403 emit_int8(0x2A); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1404 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 1405 } |
1406 | |
4759 | 1407 void Assembler::cvtsi2ssl(XMMRegister dst, Address src) { |
1408 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1409 emit_simd_arith(0x2A, dst, src, VEX_SIMD_F3); |
4759 | 1410 } |
1411 | |
304 | 1412 void Assembler::cvtss2sd(XMMRegister dst, XMMRegister src) { |
1413 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1414 emit_simd_arith(0x5A, dst, src, VEX_SIMD_F3); |
304 | 1415 } |
1416 | |
4759 | 1417 void Assembler::cvtss2sd(XMMRegister dst, Address src) { |
1418 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1419 emit_simd_arith(0x5A, dst, src, VEX_SIMD_F3); |
4759 | 1420 } |
1421 | |
1422 | |
304 | 1423 void Assembler::cvttsd2sil(Register dst, XMMRegister src) { |
1424 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
4759 | 1425 int encode = simd_prefix_and_encode(dst, src, VEX_SIMD_F2); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1426 emit_int8(0x2C); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1427 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 1428 } |
1429 | |
1430 void Assembler::cvttss2sil(Register dst, XMMRegister src) { | |
1431 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
4759 | 1432 int encode = simd_prefix_and_encode(dst, src, VEX_SIMD_F3); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1433 emit_int8(0x2C); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1434 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 1435 } |
1436 | |
1437 void Assembler::decl(Address dst) { | |
1438 // Don't use it directly. Use MacroAssembler::decrement() instead. | |
1439 InstructionMark im(this); | |
1440 prefix(dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1441 emit_int8((unsigned char)0xFF); |
304 | 1442 emit_operand(rcx, dst); |
1443 } | |
1444 | |
1445 void Assembler::divsd(XMMRegister dst, Address src) { | |
1446 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1447 emit_simd_arith(0x5E, dst, src, VEX_SIMD_F2); |
304 | 1448 } |
1449 | |
1450 void Assembler::divsd(XMMRegister dst, XMMRegister src) { | |
1451 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1452 emit_simd_arith(0x5E, dst, src, VEX_SIMD_F2); |
304 | 1453 } |
1454 | |
1455 void Assembler::divss(XMMRegister dst, Address src) { | |
1456 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1457 emit_simd_arith(0x5E, dst, src, VEX_SIMD_F3); |
304 | 1458 } |
1459 | |
1460 void Assembler::divss(XMMRegister dst, XMMRegister src) { | |
1461 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1462 emit_simd_arith(0x5E, dst, src, VEX_SIMD_F3); |
304 | 1463 } |
1464 | |
1465 void Assembler::emms() { | |
1466 NOT_LP64(assert(VM_Version::supports_mmx(), "")); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1467 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1468 emit_int8(0x77); |
304 | 1469 } |
1470 | |
1471 void Assembler::hlt() { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1472 emit_int8((unsigned char)0xF4); |
304 | 1473 } |
1474 | |
1475 void Assembler::idivl(Register src) { | |
1476 int encode = prefix_and_encode(src->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1477 emit_int8((unsigned char)0xF7); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1478 emit_int8((unsigned char)(0xF8 | encode)); |
304 | 1479 } |
1480 | |
1920 | 1481 void Assembler::divl(Register src) { // Unsigned |
1482 int encode = prefix_and_encode(src->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1483 emit_int8((unsigned char)0xF7); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1484 emit_int8((unsigned char)(0xF0 | encode)); |
1920 | 1485 } |
1486 | |
304 | 1487 void Assembler::imull(Register dst, Register src) { |
1488 int encode = prefix_and_encode(dst->encoding(), src->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1489 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1490 emit_int8((unsigned char)0xAF); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1491 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 1492 } |
1493 | |
1494 | |
1495 void Assembler::imull(Register dst, Register src, int value) { | |
1496 int encode = prefix_and_encode(dst->encoding(), src->encoding()); | |
1497 if (is8bit(value)) { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1498 emit_int8(0x6B); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1499 emit_int8((unsigned char)(0xC0 | encode)); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1500 emit_int8(value & 0xFF); |
304 | 1501 } else { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1502 emit_int8(0x69); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1503 emit_int8((unsigned char)(0xC0 | encode)); |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
1504 emit_int32(value); |
304 | 1505 } |
1506 } | |
1507 | |
12972
59e8ad757e19
8026844: Various Math functions needs intrinsification
rbackman
parents:
12329
diff
changeset
|
1508 void Assembler::imull(Register dst, Address src) { |
59e8ad757e19
8026844: Various Math functions needs intrinsification
rbackman
parents:
12329
diff
changeset
|
1509 InstructionMark im(this); |
59e8ad757e19
8026844: Various Math functions needs intrinsification
rbackman
parents:
12329
diff
changeset
|
1510 prefix(src, dst); |
59e8ad757e19
8026844: Various Math functions needs intrinsification
rbackman
parents:
12329
diff
changeset
|
1511 emit_int8(0x0F); |
59e8ad757e19
8026844: Various Math functions needs intrinsification
rbackman
parents:
12329
diff
changeset
|
1512 emit_int8((unsigned char) 0xAF); |
59e8ad757e19
8026844: Various Math functions needs intrinsification
rbackman
parents:
12329
diff
changeset
|
1513 emit_operand(dst, src); |
59e8ad757e19
8026844: Various Math functions needs intrinsification
rbackman
parents:
12329
diff
changeset
|
1514 } |
59e8ad757e19
8026844: Various Math functions needs intrinsification
rbackman
parents:
12329
diff
changeset
|
1515 |
59e8ad757e19
8026844: Various Math functions needs intrinsification
rbackman
parents:
12329
diff
changeset
|
1516 |
304 | 1517 void Assembler::incl(Address dst) { |
1518 // Don't use it directly. Use MacroAssembler::increment() instead. | |
1519 InstructionMark im(this); | |
1520 prefix(dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1521 emit_int8((unsigned char)0xFF); |
304 | 1522 emit_operand(rax, dst); |
1523 } | |
1524 | |
3851 | 1525 void Assembler::jcc(Condition cc, Label& L, bool maybe_short) { |
1526 InstructionMark im(this); | |
304 | 1527 assert((0 <= cc) && (cc < 16), "illegal cc"); |
1528 if (L.is_bound()) { | |
1529 address dst = target(L); | |
1530 assert(dst != NULL, "jcc most probably wrong"); | |
1531 | |
1532 const int short_size = 2; | |
1533 const int long_size = 6; | |
7198
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
6894
diff
changeset
|
1534 intptr_t offs = (intptr_t)dst - (intptr_t)pc(); |
3851 | 1535 if (maybe_short && is8bit(offs - short_size)) { |
304 | 1536 // 0111 tttn #8-bit disp |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1537 emit_int8(0x70 | cc); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1538 emit_int8((offs - short_size) & 0xFF); |
304 | 1539 } else { |
1540 // 0000 1111 1000 tttn #32-bit disp | |
1541 assert(is_simm32(offs - long_size), | |
1542 "must be 32bit offset (call4)"); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1543 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1544 emit_int8((unsigned char)(0x80 | cc)); |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
1545 emit_int32(offs - long_size); |
304 | 1546 } |
1547 } else { | |
1548 // Note: could eliminate cond. jumps to this jump if condition | |
1549 // is the same however, seems to be rather unlikely case. | |
1550 // Note: use jccb() if label to be bound is very close to get | |
1551 // an 8-bit displacement | |
1552 L.add_patch_at(code(), locator()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1553 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1554 emit_int8((unsigned char)(0x80 | cc)); |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
1555 emit_int32(0); |
304 | 1556 } |
1557 } | |
1558 | |
1559 void Assembler::jccb(Condition cc, Label& L) { | |
1560 if (L.is_bound()) { | |
1561 const int short_size = 2; | |
1562 address entry = target(L); | |
4766
40c2484c09e1
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
4762
diff
changeset
|
1563 #ifdef ASSERT |
7198
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
6894
diff
changeset
|
1564 intptr_t dist = (intptr_t)entry - ((intptr_t)pc() + short_size); |
4766
40c2484c09e1
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
4762
diff
changeset
|
1565 intptr_t delta = short_branch_delta(); |
40c2484c09e1
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
4762
diff
changeset
|
1566 if (delta != 0) { |
40c2484c09e1
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
4762
diff
changeset
|
1567 dist += (dist < 0 ? (-delta) :delta); |
40c2484c09e1
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
4762
diff
changeset
|
1568 } |
40c2484c09e1
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
4762
diff
changeset
|
1569 assert(is8bit(dist), "Dispacement too large for a short jmp"); |
40c2484c09e1
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
4762
diff
changeset
|
1570 #endif |
7198
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
6894
diff
changeset
|
1571 intptr_t offs = (intptr_t)entry - (intptr_t)pc(); |
304 | 1572 // 0111 tttn #8-bit disp |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1573 emit_int8(0x70 | cc); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1574 emit_int8((offs - short_size) & 0xFF); |
304 | 1575 } else { |
1576 InstructionMark im(this); | |
1577 L.add_patch_at(code(), locator()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1578 emit_int8(0x70 | cc); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1579 emit_int8(0); |
304 | 1580 } |
1581 } | |
1582 | |
1583 void Assembler::jmp(Address adr) { | |
1584 InstructionMark im(this); | |
1585 prefix(adr); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1586 emit_int8((unsigned char)0xFF); |
304 | 1587 emit_operand(rsp, adr); |
1588 } | |
1589 | |
3851 | 1590 void Assembler::jmp(Label& L, bool maybe_short) { |
304 | 1591 if (L.is_bound()) { |
1592 address entry = target(L); | |
1593 assert(entry != NULL, "jmp most probably wrong"); | |
1594 InstructionMark im(this); | |
1595 const int short_size = 2; | |
1596 const int long_size = 5; | |
7198
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
6894
diff
changeset
|
1597 intptr_t offs = entry - pc(); |
3851 | 1598 if (maybe_short && is8bit(offs - short_size)) { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1599 emit_int8((unsigned char)0xEB); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1600 emit_int8((offs - short_size) & 0xFF); |
304 | 1601 } else { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1602 emit_int8((unsigned char)0xE9); |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
1603 emit_int32(offs - long_size); |
304 | 1604 } |
1605 } else { | |
1606 // By default, forward jumps are always 32-bit displacements, since | |
1607 // we can't yet know where the label will be bound. If you're sure that | |
1608 // the forward jump will not run beyond 256 bytes, use jmpb to | |
1609 // force an 8-bit displacement. | |
1610 InstructionMark im(this); | |
1611 L.add_patch_at(code(), locator()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1612 emit_int8((unsigned char)0xE9); |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
1613 emit_int32(0); |
304 | 1614 } |
1615 } | |
1616 | |
1617 void Assembler::jmp(Register entry) { | |
1618 int encode = prefix_and_encode(entry->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1619 emit_int8((unsigned char)0xFF); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1620 emit_int8((unsigned char)(0xE0 | encode)); |
304 | 1621 } |
1622 | |
1623 void Assembler::jmp_literal(address dest, RelocationHolder const& rspec) { | |
1624 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1625 emit_int8((unsigned char)0xE9); |
304 | 1626 assert(dest != NULL, "must have a target"); |
7198
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
6894
diff
changeset
|
1627 intptr_t disp = dest - (pc() + sizeof(int32_t)); |
304 | 1628 assert(is_simm32(disp), "must be 32bit offset (jmp)"); |
1629 emit_data(disp, rspec.reloc(), call32_operand); | |
1630 } | |
1631 | |
1632 void Assembler::jmpb(Label& L) { | |
1633 if (L.is_bound()) { | |
1634 const int short_size = 2; | |
1635 address entry = target(L); | |
1636 assert(entry != NULL, "jmp most probably wrong"); | |
4766
40c2484c09e1
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
4762
diff
changeset
|
1637 #ifdef ASSERT |
7198
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
6894
diff
changeset
|
1638 intptr_t dist = (intptr_t)entry - ((intptr_t)pc() + short_size); |
4766
40c2484c09e1
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
4762
diff
changeset
|
1639 intptr_t delta = short_branch_delta(); |
40c2484c09e1
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
4762
diff
changeset
|
1640 if (delta != 0) { |
40c2484c09e1
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
4762
diff
changeset
|
1641 dist += (dist < 0 ? (-delta) :delta); |
40c2484c09e1
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
4762
diff
changeset
|
1642 } |
40c2484c09e1
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
4762
diff
changeset
|
1643 assert(is8bit(dist), "Dispacement too large for a short jmp"); |
40c2484c09e1
7110832: ctw/.../org_apache_avalon_composition_util_StringHelper crashes the VM
kvn
parents:
4762
diff
changeset
|
1644 #endif |
7198
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
6894
diff
changeset
|
1645 intptr_t offs = entry - pc(); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1646 emit_int8((unsigned char)0xEB); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1647 emit_int8((offs - short_size) & 0xFF); |
304 | 1648 } else { |
1649 InstructionMark im(this); | |
1650 L.add_patch_at(code(), locator()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1651 emit_int8((unsigned char)0xEB); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1652 emit_int8(0); |
304 | 1653 } |
1654 } | |
1655 | |
1656 void Assembler::ldmxcsr( Address src) { | |
1657 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
1658 InstructionMark im(this); | |
1659 prefix(src); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1660 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1661 emit_int8((unsigned char)0xAE); |
304 | 1662 emit_operand(as_Register(2), src); |
1663 } | |
1664 | |
1665 void Assembler::leal(Register dst, Address src) { | |
1666 InstructionMark im(this); | |
1667 #ifdef _LP64 | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1668 emit_int8(0x67); // addr32 |
304 | 1669 prefix(src, dst); |
1670 #endif // LP64 | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1671 emit_int8((unsigned char)0x8D); |
304 | 1672 emit_operand(dst, src); |
1673 } | |
1674 | |
7199
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
7198
diff
changeset
|
1675 void Assembler::lfence() { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1676 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1677 emit_int8((unsigned char)0xAE); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1678 emit_int8((unsigned char)0xE8); |
7199
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
7198
diff
changeset
|
1679 } |
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
7198
diff
changeset
|
1680 |
304 | 1681 void Assembler::lock() { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1682 emit_int8((unsigned char)0xF0); |
304 | 1683 } |
1684 | |
775
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
1685 void Assembler::lzcntl(Register dst, Register src) { |
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
1686 assert(VM_Version::supports_lzcnt(), "encoding is treated as BSR"); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1687 emit_int8((unsigned char)0xF3); |
775
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
1688 int encode = prefix_and_encode(dst->encoding(), src->encoding()); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1689 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1690 emit_int8((unsigned char)0xBD); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1691 emit_int8((unsigned char)(0xC0 | encode)); |
775
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
1692 } |
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
1693 |
671
d0994e5bebce
6822204: volatile fences should prefer lock:addl to actual mfence instructions
never
parents:
665
diff
changeset
|
1694 // Emit mfence instruction |
304 | 1695 void Assembler::mfence() { |
671
d0994e5bebce
6822204: volatile fences should prefer lock:addl to actual mfence instructions
never
parents:
665
diff
changeset
|
1696 NOT_LP64(assert(VM_Version::supports_sse2(), "unsupported");) |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1697 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1698 emit_int8((unsigned char)0xAE); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1699 emit_int8((unsigned char)0xF0); |
304 | 1700 } |
1701 | |
1702 void Assembler::mov(Register dst, Register src) { | |
1703 LP64_ONLY(movq(dst, src)) NOT_LP64(movl(dst, src)); | |
1704 } | |
1705 | |
1706 void Assembler::movapd(XMMRegister dst, XMMRegister src) { | |
1707 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1708 emit_simd_arith_nonds(0x28, dst, src, VEX_SIMD_66); |
304 | 1709 } |
1710 | |
1711 void Assembler::movaps(XMMRegister dst, XMMRegister src) { | |
1712 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1713 emit_simd_arith_nonds(0x28, dst, src, VEX_SIMD_NONE); |
304 | 1714 } |
1715 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1716 void Assembler::movlhps(XMMRegister dst, XMMRegister src) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1717 NOT_LP64(assert(VM_Version::supports_sse(), "")); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1718 int encode = simd_prefix_and_encode(dst, src, src, VEX_SIMD_NONE); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1719 emit_int8(0x16); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1720 emit_int8((unsigned char)(0xC0 | encode)); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1721 } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1722 |
304 | 1723 void Assembler::movb(Register dst, Address src) { |
1724 NOT_LP64(assert(dst->has_byte_register(), "must have byte register")); | |
1725 InstructionMark im(this); | |
1726 prefix(src, dst, true); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1727 emit_int8((unsigned char)0x8A); |
304 | 1728 emit_operand(dst, src); |
1729 } | |
1730 | |
1731 | |
1732 void Assembler::movb(Address dst, int imm8) { | |
1733 InstructionMark im(this); | |
1734 prefix(dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1735 emit_int8((unsigned char)0xC6); |
304 | 1736 emit_operand(rax, dst, 1); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1737 emit_int8(imm8); |
304 | 1738 } |
1739 | |
1740 | |
1741 void Assembler::movb(Address dst, Register src) { | |
1742 assert(src->has_byte_register(), "must have byte register"); | |
1743 InstructionMark im(this); | |
1744 prefix(dst, src, true); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1745 emit_int8((unsigned char)0x88); |
304 | 1746 emit_operand(src, dst); |
1747 } | |
1748 | |
1749 void Assembler::movdl(XMMRegister dst, Register src) { | |
1750 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
4759 | 1751 int encode = simd_prefix_and_encode(dst, src, VEX_SIMD_66); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1752 emit_int8(0x6E); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1753 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 1754 } |
1755 | |
1756 void Assembler::movdl(Register dst, XMMRegister src) { | |
1757 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
1758 // swap src/dst to get correct prefix | |
4759 | 1759 int encode = simd_prefix_and_encode(src, dst, VEX_SIMD_66); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1760 emit_int8(0x7E); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1761 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 1762 } |
1763 | |
2320
41d4973cf100
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
2262
diff
changeset
|
1764 void Assembler::movdl(XMMRegister dst, Address src) { |
41d4973cf100
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
2262
diff
changeset
|
1765 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
41d4973cf100
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
2262
diff
changeset
|
1766 InstructionMark im(this); |
4759 | 1767 simd_prefix(dst, src, VEX_SIMD_66); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1768 emit_int8(0x6E); |
2320
41d4973cf100
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
2262
diff
changeset
|
1769 emit_operand(dst, src); |
41d4973cf100
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
2262
diff
changeset
|
1770 } |
41d4973cf100
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
2262
diff
changeset
|
1771 |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1772 void Assembler::movdl(Address dst, XMMRegister src) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1773 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1774 InstructionMark im(this); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1775 simd_prefix(dst, src, VEX_SIMD_66); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1776 emit_int8(0x7E); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1777 emit_operand(src, dst); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1778 } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1779 |
304 | 1780 void Assembler::movdqa(XMMRegister dst, XMMRegister src) { |
1781 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1782 emit_simd_arith_nonds(0x6F, dst, src, VEX_SIMD_66); |
304 | 1783 } |
1784 | |
11080
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
1785 void Assembler::movdqa(XMMRegister dst, Address src) { |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
1786 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
1787 emit_simd_arith_nonds(0x6F, dst, src, VEX_SIMD_66); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
1788 } |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
1789 |
405 | 1790 void Assembler::movdqu(XMMRegister dst, Address src) { |
1791 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1792 emit_simd_arith_nonds(0x6F, dst, src, VEX_SIMD_F3); |
405 | 1793 } |
1794 | |
1795 void Assembler::movdqu(XMMRegister dst, XMMRegister src) { | |
1796 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1797 emit_simd_arith_nonds(0x6F, dst, src, VEX_SIMD_F3); |
405 | 1798 } |
1799 | |
1800 void Assembler::movdqu(Address dst, XMMRegister src) { | |
1801 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
1802 InstructionMark im(this); | |
4759 | 1803 simd_prefix(dst, src, VEX_SIMD_F3); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1804 emit_int8(0x7F); |
405 | 1805 emit_operand(src, dst); |
1806 } | |
1807 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1808 // Move Unaligned 256bit Vector |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1809 void Assembler::vmovdqu(XMMRegister dst, XMMRegister src) { |
17913 | 1810 assert(UseAVX > 0, ""); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1811 bool vector256 = true; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1812 int encode = vex_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_F3, vector256); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1813 emit_int8(0x6F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1814 emit_int8((unsigned char)(0xC0 | encode)); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1815 } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1816 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1817 void Assembler::vmovdqu(XMMRegister dst, Address src) { |
17913 | 1818 assert(UseAVX > 0, ""); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1819 InstructionMark im(this); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1820 bool vector256 = true; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1821 vex_prefix(dst, xnoreg, src, VEX_SIMD_F3, vector256); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1822 emit_int8(0x6F); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1823 emit_operand(dst, src); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1824 } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1825 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1826 void Assembler::vmovdqu(Address dst, XMMRegister src) { |
17913 | 1827 assert(UseAVX > 0, ""); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1828 InstructionMark im(this); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1829 bool vector256 = true; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1830 // swap src<->dst for encoding |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1831 assert(src != xnoreg, "sanity"); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1832 vex_prefix(src, xnoreg, dst, VEX_SIMD_F3, vector256); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1833 emit_int8(0x7F); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1834 emit_operand(src, dst); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1835 } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
1836 |
304 | 1837 // Uses zero extension on 64bit |
1838 | |
1839 void Assembler::movl(Register dst, int32_t imm32) { | |
1840 int encode = prefix_and_encode(dst->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1841 emit_int8((unsigned char)(0xB8 | encode)); |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
1842 emit_int32(imm32); |
304 | 1843 } |
1844 | |
1845 void Assembler::movl(Register dst, Register src) { | |
1846 int encode = prefix_and_encode(dst->encoding(), src->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1847 emit_int8((unsigned char)0x8B); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1848 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 1849 } |
1850 | |
1851 void Assembler::movl(Register dst, Address src) { | |
1852 InstructionMark im(this); | |
1853 prefix(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1854 emit_int8((unsigned char)0x8B); |
304 | 1855 emit_operand(dst, src); |
1856 } | |
1857 | |
1858 void Assembler::movl(Address dst, int32_t imm32) { | |
1859 InstructionMark im(this); | |
1860 prefix(dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1861 emit_int8((unsigned char)0xC7); |
304 | 1862 emit_operand(rax, dst, 4); |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
1863 emit_int32(imm32); |
304 | 1864 } |
1865 | |
1866 void Assembler::movl(Address dst, Register src) { | |
1867 InstructionMark im(this); | |
1868 prefix(dst, src); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1869 emit_int8((unsigned char)0x89); |
304 | 1870 emit_operand(src, dst); |
1871 } | |
1872 | |
1873 // New cpus require to use movsd and movss to avoid partial register stall | |
1874 // when loading from memory. But for old Opteron use movlpd instead of movsd. | |
1875 // The selection is done in MacroAssembler::movdbl() and movflt(). | |
1876 void Assembler::movlpd(XMMRegister dst, Address src) { | |
1877 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1878 emit_simd_arith(0x12, dst, src, VEX_SIMD_66); |
304 | 1879 } |
1880 | |
1881 void Assembler::movq( MMXRegister dst, Address src ) { | |
1882 assert( VM_Version::supports_mmx(), "" ); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1883 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1884 emit_int8(0x6F); |
304 | 1885 emit_operand(dst, src); |
1886 } | |
1887 | |
1888 void Assembler::movq( Address dst, MMXRegister src ) { | |
1889 assert( VM_Version::supports_mmx(), "" ); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1890 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1891 emit_int8(0x7F); |
304 | 1892 // workaround gcc (3.2.1-7a) bug |
1893 // In that version of gcc with only an emit_operand(MMX, Address) | |
1894 // gcc will tail jump and try and reverse the parameters completely | |
1895 // obliterating dst in the process. By having a version available | |
1896 // that doesn't need to swap the args at the tail jump the bug is | |
1897 // avoided. | |
1898 emit_operand(dst, src); | |
1899 } | |
1900 | |
1901 void Assembler::movq(XMMRegister dst, Address src) { | |
1902 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
1903 InstructionMark im(this); | |
4759 | 1904 simd_prefix(dst, src, VEX_SIMD_F3); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1905 emit_int8(0x7E); |
304 | 1906 emit_operand(dst, src); |
1907 } | |
1908 | |
1909 void Assembler::movq(Address dst, XMMRegister src) { | |
1910 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
1911 InstructionMark im(this); | |
4759 | 1912 simd_prefix(dst, src, VEX_SIMD_66); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1913 emit_int8((unsigned char)0xD6); |
304 | 1914 emit_operand(src, dst); |
1915 } | |
1916 | |
1917 void Assembler::movsbl(Register dst, Address src) { // movsxb | |
1918 InstructionMark im(this); | |
1919 prefix(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1920 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1921 emit_int8((unsigned char)0xBE); |
304 | 1922 emit_operand(dst, src); |
1923 } | |
1924 | |
1925 void Assembler::movsbl(Register dst, Register src) { // movsxb | |
1926 NOT_LP64(assert(src->has_byte_register(), "must have byte register")); | |
16064
03eda0a202e9
Better fix for prefix byte for AMD64 byte instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16047
diff
changeset
|
1927 int encode = prefix_and_encode(dst->encoding(), false, src->encoding(), true); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1928 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1929 emit_int8((unsigned char)0xBE); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1930 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 1931 } |
1932 | |
1933 void Assembler::movsd(XMMRegister dst, XMMRegister src) { | |
1934 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1935 emit_simd_arith(0x10, dst, src, VEX_SIMD_F2); |
304 | 1936 } |
1937 | |
1938 void Assembler::movsd(XMMRegister dst, Address src) { | |
1939 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1940 emit_simd_arith_nonds(0x10, dst, src, VEX_SIMD_F2); |
304 | 1941 } |
1942 | |
1943 void Assembler::movsd(Address dst, XMMRegister src) { | |
1944 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
1945 InstructionMark im(this); | |
4759 | 1946 simd_prefix(dst, src, VEX_SIMD_F2); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1947 emit_int8(0x11); |
304 | 1948 emit_operand(src, dst); |
1949 } | |
1950 | |
1951 void Assembler::movss(XMMRegister dst, XMMRegister src) { | |
1952 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1953 emit_simd_arith(0x10, dst, src, VEX_SIMD_F3); |
304 | 1954 } |
1955 | |
1956 void Assembler::movss(XMMRegister dst, Address src) { | |
1957 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
1958 emit_simd_arith_nonds(0x10, dst, src, VEX_SIMD_F3); |
304 | 1959 } |
1960 | |
1961 void Assembler::movss(Address dst, XMMRegister src) { | |
1962 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
1963 InstructionMark im(this); | |
4759 | 1964 simd_prefix(dst, src, VEX_SIMD_F3); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1965 emit_int8(0x11); |
304 | 1966 emit_operand(src, dst); |
1967 } | |
1968 | |
1969 void Assembler::movswl(Register dst, Address src) { // movsxw | |
1970 InstructionMark im(this); | |
1971 prefix(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1972 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1973 emit_int8((unsigned char)0xBF); |
304 | 1974 emit_operand(dst, src); |
1975 } | |
1976 | |
1977 void Assembler::movswl(Register dst, Register src) { // movsxw | |
1978 int encode = prefix_and_encode(dst->encoding(), src->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1979 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1980 emit_int8((unsigned char)0xBF); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1981 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 1982 } |
1983 | |
1984 void Assembler::movw(Address dst, int imm16) { | |
1985 InstructionMark im(this); | |
1986 | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1987 emit_int8(0x66); // switch to 16-bit mode |
304 | 1988 prefix(dst); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1989 emit_int8((unsigned char)0xC7); |
304 | 1990 emit_operand(rax, dst, 2); |
7424
c4bd2eccea46
8004536: replace AbstractAssembler emit_word with emit_int16
twisti
parents:
7199
diff
changeset
|
1991 emit_int16(imm16); |
304 | 1992 } |
1993 | |
1994 void Assembler::movw(Register dst, Address src) { | |
1995 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1996 emit_int8(0x66); |
304 | 1997 prefix(src, dst); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
1998 emit_int8((unsigned char)0x8B); |
304 | 1999 emit_operand(dst, src); |
2000 } | |
2001 | |
2002 void Assembler::movw(Address dst, Register src) { | |
2003 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2004 emit_int8(0x66); |
304 | 2005 prefix(dst, src); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2006 emit_int8((unsigned char)0x89); |
304 | 2007 emit_operand(src, dst); |
2008 } | |
2009 | |
2010 void Assembler::movzbl(Register dst, Address src) { // movzxb | |
2011 InstructionMark im(this); | |
2012 prefix(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2013 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2014 emit_int8((unsigned char)0xB6); |
304 | 2015 emit_operand(dst, src); |
2016 } | |
2017 | |
2018 void Assembler::movzbl(Register dst, Register src) { // movzxb | |
2019 NOT_LP64(assert(src->has_byte_register(), "must have byte register")); | |
16081
77cb0f0e5e3f
Revert unnecessary encoding change in assembler (part of 03eda0a202e9).
Roland Schatz <roland.schatz@oracle.com>
parents:
16064
diff
changeset
|
2020 int encode = prefix_and_encode(dst->encoding(), false, src->encoding(), true); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2021 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2022 emit_int8((unsigned char)0xB6); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2023 emit_int8(0xC0 | encode); |
304 | 2024 } |
2025 | |
2026 void Assembler::movzwl(Register dst, Address src) { // movzxw | |
2027 InstructionMark im(this); | |
2028 prefix(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2029 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2030 emit_int8((unsigned char)0xB7); |
304 | 2031 emit_operand(dst, src); |
2032 } | |
2033 | |
2034 void Assembler::movzwl(Register dst, Register src) { // movzxw | |
2035 int encode = prefix_and_encode(dst->encoding(), src->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2036 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2037 emit_int8((unsigned char)0xB7); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2038 emit_int8(0xC0 | encode); |
304 | 2039 } |
2040 | |
2041 void Assembler::mull(Address src) { | |
2042 InstructionMark im(this); | |
2043 prefix(src); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2044 emit_int8((unsigned char)0xF7); |
304 | 2045 emit_operand(rsp, src); |
2046 } | |
2047 | |
2048 void Assembler::mull(Register src) { | |
2049 int encode = prefix_and_encode(src->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2050 emit_int8((unsigned char)0xF7); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2051 emit_int8((unsigned char)(0xE0 | encode)); |
304 | 2052 } |
2053 | |
2054 void Assembler::mulsd(XMMRegister dst, Address src) { | |
2055 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2056 emit_simd_arith(0x59, dst, src, VEX_SIMD_F2); |
304 | 2057 } |
2058 | |
2059 void Assembler::mulsd(XMMRegister dst, XMMRegister src) { | |
2060 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2061 emit_simd_arith(0x59, dst, src, VEX_SIMD_F2); |
304 | 2062 } |
2063 | |
2064 void Assembler::mulss(XMMRegister dst, Address src) { | |
2065 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2066 emit_simd_arith(0x59, dst, src, VEX_SIMD_F3); |
304 | 2067 } |
2068 | |
2069 void Assembler::mulss(XMMRegister dst, XMMRegister src) { | |
2070 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2071 emit_simd_arith(0x59, dst, src, VEX_SIMD_F3); |
304 | 2072 } |
2073 | |
2074 void Assembler::negl(Register dst) { | |
2075 int encode = prefix_and_encode(dst->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2076 emit_int8((unsigned char)0xF7); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2077 emit_int8((unsigned char)(0xD8 | encode)); |
304 | 2078 } |
2079 | |
0 | 2080 void Assembler::nop(int i) { |
304 | 2081 #ifdef ASSERT |
0 | 2082 assert(i > 0, " "); |
304 | 2083 // The fancy nops aren't currently recognized by debuggers making it a |
2084 // pain to disassemble code while debugging. If asserts are on clearly | |
2085 // speed is not an issue so simply use the single byte traditional nop | |
2086 // to do alignment. | |
2087 | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2088 for (; i > 0 ; i--) emit_int8((unsigned char)0x90); |
304 | 2089 return; |
2090 | |
2091 #endif // ASSERT | |
2092 | |
0 | 2093 if (UseAddressNop && VM_Version::is_intel()) { |
2094 // | |
2095 // Using multi-bytes nops "0x0F 0x1F [address]" for Intel | |
2096 // 1: 0x90 | |
2097 // 2: 0x66 0x90 | |
2098 // 3: 0x66 0x66 0x90 (don't use "0x0F 0x1F 0x00" - need patching safe padding) | |
2099 // 4: 0x0F 0x1F 0x40 0x00 | |
2100 // 5: 0x0F 0x1F 0x44 0x00 0x00 | |
2101 // 6: 0x66 0x0F 0x1F 0x44 0x00 0x00 | |
2102 // 7: 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 | |
2103 // 8: 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 | |
2104 // 9: 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 | |
2105 // 10: 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 | |
2106 // 11: 0x66 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 | |
2107 | |
2108 // The rest coding is Intel specific - don't use consecutive address nops | |
2109 | |
2110 // 12: 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x66 0x66 0x66 0x90 | |
2111 // 13: 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x66 0x66 0x66 0x90 | |
2112 // 14: 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x66 0x66 0x66 0x90 | |
2113 // 15: 0x66 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x66 0x66 0x66 0x90 | |
2114 | |
2115 while(i >= 15) { | |
2116 // For Intel don't generate consecutive addess nops (mix with regular nops) | |
2117 i -= 15; | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2118 emit_int8(0x66); // size prefix |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2119 emit_int8(0x66); // size prefix |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2120 emit_int8(0x66); // size prefix |
0 | 2121 addr_nop_8(); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2122 emit_int8(0x66); // size prefix |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2123 emit_int8(0x66); // size prefix |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2124 emit_int8(0x66); // size prefix |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2125 emit_int8((unsigned char)0x90); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2126 // nop |
0 | 2127 } |
2128 switch (i) { | |
2129 case 14: | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2130 emit_int8(0x66); // size prefix |
0 | 2131 case 13: |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2132 emit_int8(0x66); // size prefix |
0 | 2133 case 12: |
2134 addr_nop_8(); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2135 emit_int8(0x66); // size prefix |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2136 emit_int8(0x66); // size prefix |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2137 emit_int8(0x66); // size prefix |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2138 emit_int8((unsigned char)0x90); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2139 // nop |
0 | 2140 break; |
2141 case 11: | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2142 emit_int8(0x66); // size prefix |
0 | 2143 case 10: |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2144 emit_int8(0x66); // size prefix |
0 | 2145 case 9: |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2146 emit_int8(0x66); // size prefix |
0 | 2147 case 8: |
2148 addr_nop_8(); | |
2149 break; | |
2150 case 7: | |
2151 addr_nop_7(); | |
2152 break; | |
2153 case 6: | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2154 emit_int8(0x66); // size prefix |
0 | 2155 case 5: |
2156 addr_nop_5(); | |
2157 break; | |
2158 case 4: | |
2159 addr_nop_4(); | |
2160 break; | |
2161 case 3: | |
2162 // Don't use "0x0F 0x1F 0x00" - need patching safe padding | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2163 emit_int8(0x66); // size prefix |
0 | 2164 case 2: |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2165 emit_int8(0x66); // size prefix |
0 | 2166 case 1: |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2167 emit_int8((unsigned char)0x90); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2168 // nop |
0 | 2169 break; |
2170 default: | |
2171 assert(i == 0, " "); | |
2172 } | |
2173 return; | |
2174 } | |
2175 if (UseAddressNop && VM_Version::is_amd()) { | |
2176 // | |
2177 // Using multi-bytes nops "0x0F 0x1F [address]" for AMD. | |
2178 // 1: 0x90 | |
2179 // 2: 0x66 0x90 | |
2180 // 3: 0x66 0x66 0x90 (don't use "0x0F 0x1F 0x00" - need patching safe padding) | |
2181 // 4: 0x0F 0x1F 0x40 0x00 | |
2182 // 5: 0x0F 0x1F 0x44 0x00 0x00 | |
2183 // 6: 0x66 0x0F 0x1F 0x44 0x00 0x00 | |
2184 // 7: 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 | |
2185 // 8: 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 | |
2186 // 9: 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 | |
2187 // 10: 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 | |
2188 // 11: 0x66 0x66 0x66 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 | |
2189 | |
2190 // The rest coding is AMD specific - use consecutive address nops | |
2191 | |
2192 // 12: 0x66 0x0F 0x1F 0x44 0x00 0x00 0x66 0x0F 0x1F 0x44 0x00 0x00 | |
2193 // 13: 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 0x66 0x0F 0x1F 0x44 0x00 0x00 | |
2194 // 14: 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 | |
2195 // 15: 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x0F 0x1F 0x80 0x00 0x00 0x00 0x00 | |
2196 // 16: 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 0x0F 0x1F 0x84 0x00 0x00 0x00 0x00 0x00 | |
2197 // Size prefixes (0x66) are added for larger sizes | |
2198 | |
2199 while(i >= 22) { | |
2200 i -= 11; | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2201 emit_int8(0x66); // size prefix |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2202 emit_int8(0x66); // size prefix |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2203 emit_int8(0x66); // size prefix |
0 | 2204 addr_nop_8(); |
2205 } | |
2206 // Generate first nop for size between 21-12 | |
2207 switch (i) { | |
2208 case 21: | |
2209 i -= 1; | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2210 emit_int8(0x66); // size prefix |
0 | 2211 case 20: |
2212 case 19: | |
2213 i -= 1; | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2214 emit_int8(0x66); // size prefix |
0 | 2215 case 18: |
2216 case 17: | |
2217 i -= 1; | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2218 emit_int8(0x66); // size prefix |
0 | 2219 case 16: |
2220 case 15: | |
2221 i -= 8; | |
2222 addr_nop_8(); | |
2223 break; | |
2224 case 14: | |
2225 case 13: | |
2226 i -= 7; | |
2227 addr_nop_7(); | |
2228 break; | |
2229 case 12: | |
2230 i -= 6; | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2231 emit_int8(0x66); // size prefix |
0 | 2232 addr_nop_5(); |
2233 break; | |
2234 default: | |
2235 assert(i < 12, " "); | |
2236 } | |
2237 | |
2238 // Generate second nop for size between 11-1 | |
2239 switch (i) { | |
2240 case 11: | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2241 emit_int8(0x66); // size prefix |
0 | 2242 case 10: |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2243 emit_int8(0x66); // size prefix |
0 | 2244 case 9: |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2245 emit_int8(0x66); // size prefix |
0 | 2246 case 8: |
2247 addr_nop_8(); | |
2248 break; | |
2249 case 7: | |
2250 addr_nop_7(); | |
2251 break; | |
2252 case 6: | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2253 emit_int8(0x66); // size prefix |
0 | 2254 case 5: |
2255 addr_nop_5(); | |
2256 break; | |
2257 case 4: | |
2258 addr_nop_4(); | |
2259 break; | |
2260 case 3: | |
2261 // Don't use "0x0F 0x1F 0x00" - need patching safe padding | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2262 emit_int8(0x66); // size prefix |
0 | 2263 case 2: |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2264 emit_int8(0x66); // size prefix |
0 | 2265 case 1: |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2266 emit_int8((unsigned char)0x90); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2267 // nop |
0 | 2268 break; |
2269 default: | |
2270 assert(i == 0, " "); | |
2271 } | |
2272 return; | |
2273 } | |
2274 | |
2275 // Using nops with size prefixes "0x66 0x90". | |
2276 // From AMD Optimization Guide: | |
2277 // 1: 0x90 | |
2278 // 2: 0x66 0x90 | |
2279 // 3: 0x66 0x66 0x90 | |
2280 // 4: 0x66 0x66 0x66 0x90 | |
2281 // 5: 0x66 0x66 0x90 0x66 0x90 | |
2282 // 6: 0x66 0x66 0x90 0x66 0x66 0x90 | |
2283 // 7: 0x66 0x66 0x66 0x90 0x66 0x66 0x90 | |
2284 // 8: 0x66 0x66 0x66 0x90 0x66 0x66 0x66 0x90 | |
2285 // 9: 0x66 0x66 0x90 0x66 0x66 0x90 0x66 0x66 0x90 | |
2286 // 10: 0x66 0x66 0x66 0x90 0x66 0x66 0x90 0x66 0x66 0x90 | |
2287 // | |
2288 while(i > 12) { | |
2289 i -= 4; | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2290 emit_int8(0x66); // size prefix |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2291 emit_int8(0x66); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2292 emit_int8(0x66); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2293 emit_int8((unsigned char)0x90); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2294 // nop |
0 | 2295 } |
2296 // 1 - 12 nops | |
2297 if(i > 8) { | |
2298 if(i > 9) { | |
2299 i -= 1; | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2300 emit_int8(0x66); |
0 | 2301 } |
2302 i -= 3; | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2303 emit_int8(0x66); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2304 emit_int8(0x66); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2305 emit_int8((unsigned char)0x90); |
0 | 2306 } |
2307 // 1 - 8 nops | |
2308 if(i > 4) { | |
2309 if(i > 6) { | |
2310 i -= 1; | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2311 emit_int8(0x66); |
0 | 2312 } |
2313 i -= 3; | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2314 emit_int8(0x66); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2315 emit_int8(0x66); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2316 emit_int8((unsigned char)0x90); |
0 | 2317 } |
2318 switch (i) { | |
2319 case 4: | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2320 emit_int8(0x66); |
0 | 2321 case 3: |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2322 emit_int8(0x66); |
0 | 2323 case 2: |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2324 emit_int8(0x66); |
0 | 2325 case 1: |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2326 emit_int8((unsigned char)0x90); |
0 | 2327 break; |
2328 default: | |
2329 assert(i == 0, " "); | |
2330 } | |
2331 } | |
2332 | |
304 | 2333 void Assembler::notl(Register dst) { |
2334 int encode = prefix_and_encode(dst->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2335 emit_int8((unsigned char)0xF7); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2336 emit_int8((unsigned char)(0xD0 | encode)); |
304 | 2337 } |
2338 | |
2339 void Assembler::orl(Address dst, int32_t imm32) { | |
2340 InstructionMark im(this); | |
2341 prefix(dst); | |
2100
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
2342 emit_arith_operand(0x81, rcx, dst, imm32); |
304 | 2343 } |
2344 | |
2345 void Assembler::orl(Register dst, int32_t imm32) { | |
2346 prefix(dst); | |
2347 emit_arith(0x81, 0xC8, dst, imm32); | |
2348 } | |
2349 | |
2350 void Assembler::orl(Register dst, Address src) { | |
2351 InstructionMark im(this); | |
2352 prefix(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2353 emit_int8(0x0B); |
304 | 2354 emit_operand(dst, src); |
2355 } | |
2356 | |
2357 void Assembler::orl(Register dst, Register src) { | |
2358 (void) prefix_and_encode(dst->encoding(), src->encoding()); | |
2359 emit_arith(0x0B, 0xC0, dst, src); | |
2360 } | |
2361 | |
23813
daaf806995b3
8081778: Use Intel x64 CPU instructions for RSA acceleration
igerasim
parents:
20438
diff
changeset
|
2362 void Assembler::orl(Address dst, Register src) { |
daaf806995b3
8081778: Use Intel x64 CPU instructions for RSA acceleration
igerasim
parents:
20438
diff
changeset
|
2363 InstructionMark im(this); |
daaf806995b3
8081778: Use Intel x64 CPU instructions for RSA acceleration
igerasim
parents:
20438
diff
changeset
|
2364 prefix(dst, src); |
daaf806995b3
8081778: Use Intel x64 CPU instructions for RSA acceleration
igerasim
parents:
20438
diff
changeset
|
2365 emit_int8(0x09); |
daaf806995b3
8081778: Use Intel x64 CPU instructions for RSA acceleration
igerasim
parents:
20438
diff
changeset
|
2366 emit_operand(src, dst); |
daaf806995b3
8081778: Use Intel x64 CPU instructions for RSA acceleration
igerasim
parents:
20438
diff
changeset
|
2367 } |
daaf806995b3
8081778: Use Intel x64 CPU instructions for RSA acceleration
igerasim
parents:
20438
diff
changeset
|
2368 |
4759 | 2369 void Assembler::packuswb(XMMRegister dst, Address src) { |
2370 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
2371 assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2372 emit_simd_arith(0x67, dst, src, VEX_SIMD_66); |
4759 | 2373 } |
2374 | |
2375 void Assembler::packuswb(XMMRegister dst, XMMRegister src) { | |
2376 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2377 emit_simd_arith(0x67, dst, src, VEX_SIMD_66); |
4759 | 2378 } |
2379 | |
7637
b30b3c2a0cf2
6896617: Optimize sun.nio.cs.ISO_8859_1$Encode.encodeArrayLoop() on x86
kvn
parents:
7477
diff
changeset
|
2380 void Assembler::vpackuswb(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
b30b3c2a0cf2
6896617: Optimize sun.nio.cs.ISO_8859_1$Encode.encodeArrayLoop() on x86
kvn
parents:
7477
diff
changeset
|
2381 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
b30b3c2a0cf2
6896617: Optimize sun.nio.cs.ISO_8859_1$Encode.encodeArrayLoop() on x86
kvn
parents:
7477
diff
changeset
|
2382 emit_vex_arith(0x67, dst, nds, src, VEX_SIMD_66, vector256); |
b30b3c2a0cf2
6896617: Optimize sun.nio.cs.ISO_8859_1$Encode.encodeArrayLoop() on x86
kvn
parents:
7477
diff
changeset
|
2383 } |
b30b3c2a0cf2
6896617: Optimize sun.nio.cs.ISO_8859_1$Encode.encodeArrayLoop() on x86
kvn
parents:
7477
diff
changeset
|
2384 |
b30b3c2a0cf2
6896617: Optimize sun.nio.cs.ISO_8859_1$Encode.encodeArrayLoop() on x86
kvn
parents:
7477
diff
changeset
|
2385 void Assembler::vpermq(XMMRegister dst, XMMRegister src, int imm8, bool vector256) { |
8042
91a23b11d8dc
8007708: compiler/6855215 assert(VM_Version::supports_sse4_2())
kvn
parents:
8002
diff
changeset
|
2386 assert(VM_Version::supports_avx2(), ""); |
91a23b11d8dc
8007708: compiler/6855215 assert(VM_Version::supports_sse4_2())
kvn
parents:
8002
diff
changeset
|
2387 int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, true, vector256); |
91a23b11d8dc
8007708: compiler/6855215 assert(VM_Version::supports_sse4_2())
kvn
parents:
8002
diff
changeset
|
2388 emit_int8(0x00); |
91a23b11d8dc
8007708: compiler/6855215 assert(VM_Version::supports_sse4_2())
kvn
parents:
8002
diff
changeset
|
2389 emit_int8(0xC0 | encode); |
91a23b11d8dc
8007708: compiler/6855215 assert(VM_Version::supports_sse4_2())
kvn
parents:
8002
diff
changeset
|
2390 emit_int8(imm8); |
7637
b30b3c2a0cf2
6896617: Optimize sun.nio.cs.ISO_8859_1$Encode.encodeArrayLoop() on x86
kvn
parents:
7477
diff
changeset
|
2391 } |
b30b3c2a0cf2
6896617: Optimize sun.nio.cs.ISO_8859_1$Encode.encodeArrayLoop() on x86
kvn
parents:
7477
diff
changeset
|
2392 |
17780 | 2393 void Assembler::pause() { |
2394 emit_int8((unsigned char)0xF3); | |
2395 emit_int8((unsigned char)0x90); | |
2396 } | |
2397 | |
681 | 2398 void Assembler::pcmpestri(XMMRegister dst, Address src, int imm8) { |
2399 assert(VM_Version::supports_sse4_2(), ""); | |
4759 | 2400 InstructionMark im(this); |
2401 simd_prefix(dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2402 emit_int8(0x61); |
681 | 2403 emit_operand(dst, src); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2404 emit_int8(imm8); |
681 | 2405 } |
2406 | |
2407 void Assembler::pcmpestri(XMMRegister dst, XMMRegister src, int imm8) { | |
2408 assert(VM_Version::supports_sse4_2(), ""); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2409 int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_3A); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2410 emit_int8(0x61); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2411 emit_int8((unsigned char)(0xC0 | encode)); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2412 emit_int8(imm8); |
681 | 2413 } |
2414 | |
11080
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2415 void Assembler::pextrd(Register dst, XMMRegister src, int imm8) { |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2416 assert(VM_Version::supports_sse4_1(), ""); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2417 int encode = simd_prefix_and_encode(as_XMMRegister(dst->encoding()), xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, false); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2418 emit_int8(0x16); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2419 emit_int8((unsigned char)(0xC0 | encode)); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2420 emit_int8(imm8); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2421 } |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2422 |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2423 void Assembler::pextrq(Register dst, XMMRegister src, int imm8) { |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2424 assert(VM_Version::supports_sse4_1(), ""); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2425 int encode = simd_prefix_and_encode(as_XMMRegister(dst->encoding()), xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, true); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2426 emit_int8(0x16); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2427 emit_int8((unsigned char)(0xC0 | encode)); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2428 emit_int8(imm8); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2429 } |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2430 |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2431 void Assembler::pinsrd(XMMRegister dst, Register src, int imm8) { |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2432 assert(VM_Version::supports_sse4_1(), ""); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2433 int encode = simd_prefix_and_encode(dst, dst, as_XMMRegister(src->encoding()), VEX_SIMD_66, VEX_OPCODE_0F_3A, false); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2434 emit_int8(0x22); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2435 emit_int8((unsigned char)(0xC0 | encode)); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2436 emit_int8(imm8); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2437 } |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2438 |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2439 void Assembler::pinsrq(XMMRegister dst, Register src, int imm8) { |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2440 assert(VM_Version::supports_sse4_1(), ""); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2441 int encode = simd_prefix_and_encode(dst, dst, as_XMMRegister(src->encoding()), VEX_SIMD_66, VEX_OPCODE_0F_3A, true); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2442 emit_int8(0x22); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2443 emit_int8((unsigned char)(0xC0 | encode)); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2444 emit_int8(imm8); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2445 } |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
2446 |
4759 | 2447 void Assembler::pmovzxbw(XMMRegister dst, Address src) { |
2448 assert(VM_Version::supports_sse4_1(), ""); | |
2449 InstructionMark im(this); | |
2450 simd_prefix(dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2451 emit_int8(0x30); |
4759 | 2452 emit_operand(dst, src); |
2453 } | |
2454 | |
2455 void Assembler::pmovzxbw(XMMRegister dst, XMMRegister src) { | |
2456 assert(VM_Version::supports_sse4_1(), ""); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2457 int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2458 emit_int8(0x30); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2459 emit_int8((unsigned char)(0xC0 | encode)); |
4759 | 2460 } |
2461 | |
304 | 2462 // generic |
2463 void Assembler::pop(Register dst) { | |
2464 int encode = prefix_and_encode(dst->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2465 emit_int8(0x58 | encode); |
304 | 2466 } |
2467 | |
643
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
2468 void Assembler::popcntl(Register dst, Address src) { |
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
2469 assert(VM_Version::supports_popcnt(), "must support"); |
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
2470 InstructionMark im(this); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2471 emit_int8((unsigned char)0xF3); |
643
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
2472 prefix(src, dst); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2473 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2474 emit_int8((unsigned char)0xB8); |
643
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
2475 emit_operand(dst, src); |
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
2476 } |
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
2477 |
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
2478 void Assembler::popcntl(Register dst, Register src) { |
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
2479 assert(VM_Version::supports_popcnt(), "must support"); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2480 emit_int8((unsigned char)0xF3); |
643
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
2481 int encode = prefix_and_encode(dst->encoding(), src->encoding()); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2482 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2483 emit_int8((unsigned char)0xB8); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2484 emit_int8((unsigned char)(0xC0 | encode)); |
643
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
2485 } |
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
2486 |
304 | 2487 void Assembler::popf() { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2488 emit_int8((unsigned char)0x9D); |
304 | 2489 } |
2490 | |
1060 | 2491 #ifndef _LP64 // no 32bit push/pop on amd64 |
304 | 2492 void Assembler::popl(Address dst) { |
2493 // NOTE: this will adjust stack by 8byte on 64bits | |
2494 InstructionMark im(this); | |
2495 prefix(dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2496 emit_int8((unsigned char)0x8F); |
304 | 2497 emit_operand(rax, dst); |
2498 } | |
1060 | 2499 #endif |
304 | 2500 |
2501 void Assembler::prefetch_prefix(Address src) { | |
2502 prefix(src); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2503 emit_int8(0x0F); |
304 | 2504 } |
2505 | |
2506 void Assembler::prefetchnta(Address src) { | |
3873
a594deb1d6dc
7081926: assert(VM_Version::supports_sse2()) failed: must support
kvn
parents:
3855
diff
changeset
|
2507 NOT_LP64(assert(VM_Version::supports_sse(), "must support")); |
304 | 2508 InstructionMark im(this); |
2509 prefetch_prefix(src); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2510 emit_int8(0x18); |
304 | 2511 emit_operand(rax, src); // 0, src |
2512 } | |
2513 | |
2514 void Assembler::prefetchr(Address src) { | |
3854 | 2515 assert(VM_Version::supports_3dnow_prefetch(), "must support"); |
304 | 2516 InstructionMark im(this); |
2517 prefetch_prefix(src); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2518 emit_int8(0x0D); |
304 | 2519 emit_operand(rax, src); // 0, src |
2520 } | |
2521 | |
2522 void Assembler::prefetcht0(Address src) { | |
2523 NOT_LP64(assert(VM_Version::supports_sse(), "must support")); | |
2524 InstructionMark im(this); | |
2525 prefetch_prefix(src); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2526 emit_int8(0x18); |
304 | 2527 emit_operand(rcx, src); // 1, src |
2528 } | |
2529 | |
2530 void Assembler::prefetcht1(Address src) { | |
2531 NOT_LP64(assert(VM_Version::supports_sse(), "must support")); | |
2532 InstructionMark im(this); | |
2533 prefetch_prefix(src); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2534 emit_int8(0x18); |
304 | 2535 emit_operand(rdx, src); // 2, src |
2536 } | |
2537 | |
2538 void Assembler::prefetcht2(Address src) { | |
2539 NOT_LP64(assert(VM_Version::supports_sse(), "must support")); | |
2540 InstructionMark im(this); | |
2541 prefetch_prefix(src); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2542 emit_int8(0x18); |
304 | 2543 emit_operand(rbx, src); // 3, src |
2544 } | |
2545 | |
2546 void Assembler::prefetchw(Address src) { | |
3854 | 2547 assert(VM_Version::supports_3dnow_prefetch(), "must support"); |
304 | 2548 InstructionMark im(this); |
2549 prefetch_prefix(src); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2550 emit_int8(0x0D); |
304 | 2551 emit_operand(rcx, src); // 1, src |
2552 } | |
2553 | |
2554 void Assembler::prefix(Prefix p) { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2555 emit_int8(p); |
304 | 2556 } |
2557 | |
6894 | 2558 void Assembler::pshufb(XMMRegister dst, XMMRegister src) { |
2559 assert(VM_Version::supports_ssse3(), ""); | |
2560 int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2561 emit_int8(0x00); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2562 emit_int8((unsigned char)(0xC0 | encode)); |
6894 | 2563 } |
2564 | |
2565 void Assembler::pshufb(XMMRegister dst, Address src) { | |
2566 assert(VM_Version::supports_ssse3(), ""); | |
2567 InstructionMark im(this); | |
2568 simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2569 emit_int8(0x00); |
6894 | 2570 emit_operand(dst, src); |
2571 } | |
2572 | |
304 | 2573 void Assembler::pshufd(XMMRegister dst, XMMRegister src, int mode) { |
2574 assert(isByte(mode), "invalid value"); | |
2575 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2576 emit_simd_arith_nonds(0x70, dst, src, VEX_SIMD_66); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2577 emit_int8(mode & 0xFF); |
304 | 2578 |
2579 } | |
2580 | |
2581 void Assembler::pshufd(XMMRegister dst, Address src, int mode) { | |
2582 assert(isByte(mode), "invalid value"); | |
2583 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
4759 | 2584 assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); |
2585 InstructionMark im(this); | |
2586 simd_prefix(dst, src, VEX_SIMD_66); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2587 emit_int8(0x70); |
304 | 2588 emit_operand(dst, src); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2589 emit_int8(mode & 0xFF); |
304 | 2590 } |
2591 | |
2592 void Assembler::pshuflw(XMMRegister dst, XMMRegister src, int mode) { | |
2593 assert(isByte(mode), "invalid value"); | |
2594 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2595 emit_simd_arith_nonds(0x70, dst, src, VEX_SIMD_F2); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2596 emit_int8(mode & 0xFF); |
304 | 2597 } |
2598 | |
2599 void Assembler::pshuflw(XMMRegister dst, Address src, int mode) { | |
2600 assert(isByte(mode), "invalid value"); | |
2601 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
4759 | 2602 assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); |
2603 InstructionMark im(this); | |
2604 simd_prefix(dst, src, VEX_SIMD_F2); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2605 emit_int8(0x70); |
304 | 2606 emit_operand(dst, src); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2607 emit_int8(mode & 0xFF); |
304 | 2608 } |
2609 | |
2320
41d4973cf100
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
2262
diff
changeset
|
2610 void Assembler::psrldq(XMMRegister dst, int shift) { |
41d4973cf100
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
2262
diff
changeset
|
2611 // Shift 128 bit value in xmm register by number of bytes. |
41d4973cf100
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
2262
diff
changeset
|
2612 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
4759 | 2613 int encode = simd_prefix_and_encode(xmm3, dst, dst, VEX_SIMD_66); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2614 emit_int8(0x73); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2615 emit_int8((unsigned char)(0xC0 | encode)); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2616 emit_int8(shift); |
2320
41d4973cf100
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
2262
diff
changeset
|
2617 } |
41d4973cf100
6942326: x86 code in string_indexof() could read beyond reserved heap space
kvn
parents:
2262
diff
changeset
|
2618 |
681 | 2619 void Assembler::ptest(XMMRegister dst, Address src) { |
2620 assert(VM_Version::supports_sse4_1(), ""); | |
4759 | 2621 assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); |
2622 InstructionMark im(this); | |
2623 simd_prefix(dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2624 emit_int8(0x17); |
681 | 2625 emit_operand(dst, src); |
2626 } | |
2627 | |
2628 void Assembler::ptest(XMMRegister dst, XMMRegister src) { | |
2629 assert(VM_Version::supports_sse4_1(), ""); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2630 int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2631 emit_int8(0x17); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2632 emit_int8((unsigned char)(0xC0 | encode)); |
681 | 2633 } |
2634 | |
7477
038dd2875b94
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
7476
diff
changeset
|
2635 void Assembler::vptest(XMMRegister dst, Address src) { |
038dd2875b94
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
7476
diff
changeset
|
2636 assert(VM_Version::supports_avx(), ""); |
038dd2875b94
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
7476
diff
changeset
|
2637 InstructionMark im(this); |
038dd2875b94
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
7476
diff
changeset
|
2638 bool vector256 = true; |
038dd2875b94
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
7476
diff
changeset
|
2639 assert(dst != xnoreg, "sanity"); |
038dd2875b94
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
7476
diff
changeset
|
2640 int dst_enc = dst->encoding(); |
038dd2875b94
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
7476
diff
changeset
|
2641 // swap src<->dst for encoding |
7637
b30b3c2a0cf2
6896617: Optimize sun.nio.cs.ISO_8859_1$Encode.encodeArrayLoop() on x86
kvn
parents:
7477
diff
changeset
|
2642 vex_prefix(src, 0, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F_38, false, vector256); |
7477
038dd2875b94
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
7476
diff
changeset
|
2643 emit_int8(0x17); |
038dd2875b94
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
7476
diff
changeset
|
2644 emit_operand(dst, src); |
038dd2875b94
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
7476
diff
changeset
|
2645 } |
038dd2875b94
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
7476
diff
changeset
|
2646 |
038dd2875b94
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
7476
diff
changeset
|
2647 void Assembler::vptest(XMMRegister dst, XMMRegister src) { |
038dd2875b94
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
7476
diff
changeset
|
2648 assert(VM_Version::supports_avx(), ""); |
038dd2875b94
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
7476
diff
changeset
|
2649 bool vector256 = true; |
038dd2875b94
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
7476
diff
changeset
|
2650 int encode = vex_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, vector256, VEX_OPCODE_0F_38); |
038dd2875b94
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
7476
diff
changeset
|
2651 emit_int8(0x17); |
038dd2875b94
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
7476
diff
changeset
|
2652 emit_int8((unsigned char)(0xC0 | encode)); |
038dd2875b94
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
7476
diff
changeset
|
2653 } |
038dd2875b94
8005419: Improve intrinsics code performance on x86 by using AVX2
kvn
parents:
7476
diff
changeset
|
2654 |
4759 | 2655 void Assembler::punpcklbw(XMMRegister dst, Address src) { |
2656 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
2657 assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2658 emit_simd_arith(0x60, dst, src, VEX_SIMD_66); |
4759 | 2659 } |
2660 | |
304 | 2661 void Assembler::punpcklbw(XMMRegister dst, XMMRegister src) { |
2662 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2663 emit_simd_arith(0x60, dst, src, VEX_SIMD_66); |
304 | 2664 } |
2665 | |
4759 | 2666 void Assembler::punpckldq(XMMRegister dst, Address src) { |
2667 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
2668 assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2669 emit_simd_arith(0x62, dst, src, VEX_SIMD_66); |
4759 | 2670 } |
2671 | |
2672 void Assembler::punpckldq(XMMRegister dst, XMMRegister src) { | |
2673 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2674 emit_simd_arith(0x62, dst, src, VEX_SIMD_66); |
4759 | 2675 } |
2676 | |
6225 | 2677 void Assembler::punpcklqdq(XMMRegister dst, XMMRegister src) { |
2678 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2679 emit_simd_arith(0x6C, dst, src, VEX_SIMD_66); |
6225 | 2680 } |
2681 | |
304 | 2682 void Assembler::push(int32_t imm32) { |
2683 // in 64bits we push 64bits onto the stack but only | |
2684 // take a 32bit immediate | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2685 emit_int8(0x68); |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
2686 emit_int32(imm32); |
304 | 2687 } |
2688 | |
2689 void Assembler::push(Register src) { | |
2690 int encode = prefix_and_encode(src->encoding()); | |
2691 | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2692 emit_int8(0x50 | encode); |
304 | 2693 } |
2694 | |
2695 void Assembler::pushf() { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2696 emit_int8((unsigned char)0x9C); |
304 | 2697 } |
2698 | |
1060 | 2699 #ifndef _LP64 // no 32bit push/pop on amd64 |
304 | 2700 void Assembler::pushl(Address src) { |
2701 // Note this will push 64bit on 64bit | |
2702 InstructionMark im(this); | |
2703 prefix(src); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2704 emit_int8((unsigned char)0xFF); |
304 | 2705 emit_operand(rsi, src); |
2706 } | |
1060 | 2707 #endif |
304 | 2708 |
2709 void Assembler::rcll(Register dst, int imm8) { | |
2710 assert(isShiftCount(imm8), "illegal shift count"); | |
2711 int encode = prefix_and_encode(dst->encoding()); | |
2712 if (imm8 == 1) { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2713 emit_int8((unsigned char)0xD1); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2714 emit_int8((unsigned char)(0xD0 | encode)); |
304 | 2715 } else { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2716 emit_int8((unsigned char)0xC1); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2717 emit_int8((unsigned char)0xD0 | encode); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2718 emit_int8(imm8); |
304 | 2719 } |
2720 } | |
2721 | |
17780 | 2722 void Assembler::rdtsc() { |
2723 emit_int8((unsigned char)0x0F); | |
2724 emit_int8((unsigned char)0x31); | |
2725 } | |
2726 | |
304 | 2727 // copies data from [esi] to [edi] using rcx pointer sized words |
2728 // generic | |
2729 void Assembler::rep_mov() { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2730 emit_int8((unsigned char)0xF3); |
304 | 2731 // MOVSQ |
2732 LP64_ONLY(prefix(REX_W)); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2733 emit_int8((unsigned char)0xA5); |
304 | 2734 } |
2735 | |
7474
00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
7430
diff
changeset
|
2736 // sets rcx bytes with rax, value at [edi] |
00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
7430
diff
changeset
|
2737 void Assembler::rep_stosb() { |
00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
7430
diff
changeset
|
2738 emit_int8((unsigned char)0xF3); // REP |
00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
7430
diff
changeset
|
2739 LP64_ONLY(prefix(REX_W)); |
00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
7430
diff
changeset
|
2740 emit_int8((unsigned char)0xAA); // STOSB |
00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
7430
diff
changeset
|
2741 } |
00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
7430
diff
changeset
|
2742 |
304 | 2743 // sets rcx pointer sized words with rax, value at [edi] |
2744 // generic | |
7474
00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
7430
diff
changeset
|
2745 void Assembler::rep_stos() { |
00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
7430
diff
changeset
|
2746 emit_int8((unsigned char)0xF3); // REP |
00af3a3a8df4
8005522: use fast-string instructions on x86 for zeroing
kvn
parents:
7430
diff
changeset
|
2747 LP64_ONLY(prefix(REX_W)); // LP64:STOSQ, LP32:STOSD |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2748 emit_int8((unsigned char)0xAB); |
304 | 2749 } |
2750 | |
2751 // scans rcx pointer sized words at [edi] for occurance of rax, | |
2752 // generic | |
2753 void Assembler::repne_scan() { // repne_scan | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2754 emit_int8((unsigned char)0xF2); |
304 | 2755 // SCASQ |
2756 LP64_ONLY(prefix(REX_W)); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2757 emit_int8((unsigned char)0xAF); |
304 | 2758 } |
2759 | |
2760 #ifdef _LP64 | |
2761 // scans rcx 4 byte words at [edi] for occurance of rax, | |
2762 // generic | |
2763 void Assembler::repne_scanl() { // repne_scan | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2764 emit_int8((unsigned char)0xF2); |
304 | 2765 // SCASL |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2766 emit_int8((unsigned char)0xAF); |
304 | 2767 } |
2768 #endif | |
2769 | |
0 | 2770 void Assembler::ret(int imm16) { |
2771 if (imm16 == 0) { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2772 emit_int8((unsigned char)0xC3); |
0 | 2773 } else { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2774 emit_int8((unsigned char)0xC2); |
7424
c4bd2eccea46
8004536: replace AbstractAssembler emit_word with emit_int16
twisti
parents:
7199
diff
changeset
|
2775 emit_int16(imm16); |
0 | 2776 } |
2777 } | |
2778 | |
304 | 2779 void Assembler::sahf() { |
2780 #ifdef _LP64 | |
2781 // Not supported in 64bit mode | |
2782 ShouldNotReachHere(); | |
2783 #endif | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2784 emit_int8((unsigned char)0x9E); |
304 | 2785 } |
2786 | |
2787 void Assembler::sarl(Register dst, int imm8) { | |
2788 int encode = prefix_and_encode(dst->encoding()); | |
2789 assert(isShiftCount(imm8), "illegal shift count"); | |
2790 if (imm8 == 1) { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2791 emit_int8((unsigned char)0xD1); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2792 emit_int8((unsigned char)(0xF8 | encode)); |
304 | 2793 } else { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2794 emit_int8((unsigned char)0xC1); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2795 emit_int8((unsigned char)(0xF8 | encode)); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2796 emit_int8(imm8); |
304 | 2797 } |
2798 } | |
2799 | |
2800 void Assembler::sarl(Register dst) { | |
2801 int encode = prefix_and_encode(dst->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2802 emit_int8((unsigned char)0xD3); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2803 emit_int8((unsigned char)(0xF8 | encode)); |
304 | 2804 } |
2805 | |
2806 void Assembler::sbbl(Address dst, int32_t imm32) { | |
2807 InstructionMark im(this); | |
2808 prefix(dst); | |
2809 emit_arith_operand(0x81, rbx, dst, imm32); | |
2810 } | |
2811 | |
2812 void Assembler::sbbl(Register dst, int32_t imm32) { | |
2813 prefix(dst); | |
2814 emit_arith(0x81, 0xD8, dst, imm32); | |
2815 } | |
2816 | |
2817 | |
2818 void Assembler::sbbl(Register dst, Address src) { | |
2819 InstructionMark im(this); | |
2820 prefix(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2821 emit_int8(0x1B); |
304 | 2822 emit_operand(dst, src); |
2823 } | |
2824 | |
2825 void Assembler::sbbl(Register dst, Register src) { | |
2826 (void) prefix_and_encode(dst->encoding(), src->encoding()); | |
2827 emit_arith(0x1B, 0xC0, dst, src); | |
2828 } | |
2829 | |
2830 void Assembler::setb(Condition cc, Register dst) { | |
2831 assert(0 <= cc && cc < 16, "illegal cc"); | |
2832 int encode = prefix_and_encode(dst->encoding(), true); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2833 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2834 emit_int8((unsigned char)0x90 | cc); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2835 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 2836 } |
2837 | |
2838 void Assembler::shll(Register dst, int imm8) { | |
2839 assert(isShiftCount(imm8), "illegal shift count"); | |
2840 int encode = prefix_and_encode(dst->encoding()); | |
2841 if (imm8 == 1 ) { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2842 emit_int8((unsigned char)0xD1); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2843 emit_int8((unsigned char)(0xE0 | encode)); |
304 | 2844 } else { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2845 emit_int8((unsigned char)0xC1); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2846 emit_int8((unsigned char)(0xE0 | encode)); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2847 emit_int8(imm8); |
304 | 2848 } |
2849 } | |
2850 | |
2851 void Assembler::shll(Register dst) { | |
2852 int encode = prefix_and_encode(dst->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2853 emit_int8((unsigned char)0xD3); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2854 emit_int8((unsigned char)(0xE0 | encode)); |
304 | 2855 } |
2856 | |
2857 void Assembler::shrl(Register dst, int imm8) { | |
2858 assert(isShiftCount(imm8), "illegal shift count"); | |
2859 int encode = prefix_and_encode(dst->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2860 emit_int8((unsigned char)0xC1); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2861 emit_int8((unsigned char)(0xE8 | encode)); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2862 emit_int8(imm8); |
304 | 2863 } |
2864 | |
2865 void Assembler::shrl(Register dst) { | |
2866 int encode = prefix_and_encode(dst->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2867 emit_int8((unsigned char)0xD3); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2868 emit_int8((unsigned char)(0xE8 | encode)); |
304 | 2869 } |
0 | 2870 |
2871 // copies a single word from [esi] to [edi] | |
2872 void Assembler::smovl() { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2873 emit_int8((unsigned char)0xA5); |
0 | 2874 } |
2875 | |
304 | 2876 void Assembler::sqrtsd(XMMRegister dst, XMMRegister src) { |
2877 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2878 emit_simd_arith(0x51, dst, src, VEX_SIMD_F2); |
304 | 2879 } |
2880 | |
2008 | 2881 void Assembler::sqrtsd(XMMRegister dst, Address src) { |
2882 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2883 emit_simd_arith(0x51, dst, src, VEX_SIMD_F2); |
2008 | 2884 } |
2885 | |
2886 void Assembler::sqrtss(XMMRegister dst, XMMRegister src) { | |
4759 | 2887 NOT_LP64(assert(VM_Version::supports_sse(), "")); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2888 emit_simd_arith(0x51, dst, src, VEX_SIMD_F3); |
2008 | 2889 } |
2890 | |
7199
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
7198
diff
changeset
|
2891 void Assembler::std() { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2892 emit_int8((unsigned char)0xFD); |
7199
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
7198
diff
changeset
|
2893 } |
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
7198
diff
changeset
|
2894 |
2008 | 2895 void Assembler::sqrtss(XMMRegister dst, Address src) { |
4759 | 2896 NOT_LP64(assert(VM_Version::supports_sse(), "")); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2897 emit_simd_arith(0x51, dst, src, VEX_SIMD_F3); |
2008 | 2898 } |
2899 | |
304 | 2900 void Assembler::stmxcsr( Address dst) { |
2901 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
2902 InstructionMark im(this); | |
2903 prefix(dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2904 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2905 emit_int8((unsigned char)0xAE); |
304 | 2906 emit_operand(as_Register(3), dst); |
2907 } | |
2908 | |
2909 void Assembler::subl(Address dst, int32_t imm32) { | |
2910 InstructionMark im(this); | |
2911 prefix(dst); | |
2100
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
2912 emit_arith_operand(0x81, rbp, dst, imm32); |
304 | 2913 } |
2914 | |
2915 void Assembler::subl(Address dst, Register src) { | |
2916 InstructionMark im(this); | |
2917 prefix(dst, src); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2918 emit_int8(0x29); |
304 | 2919 emit_operand(src, dst); |
2920 } | |
2921 | |
2100
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
2922 void Assembler::subl(Register dst, int32_t imm32) { |
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
2923 prefix(dst); |
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
2924 emit_arith(0x81, 0xE8, dst, imm32); |
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
2925 } |
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
2926 |
4947
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
2927 // Force generation of a 4 byte immediate value even if it fits into 8bit |
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
2928 void Assembler::subl_imm32(Register dst, int32_t imm32) { |
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
2929 prefix(dst); |
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
2930 emit_arith_imm32(0x81, 0xE8, dst, imm32); |
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
2931 } |
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
2932 |
304 | 2933 void Assembler::subl(Register dst, Address src) { |
2934 InstructionMark im(this); | |
2935 prefix(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2936 emit_int8(0x2B); |
304 | 2937 emit_operand(dst, src); |
2938 } | |
2939 | |
2940 void Assembler::subl(Register dst, Register src) { | |
2941 (void) prefix_and_encode(dst->encoding(), src->encoding()); | |
2942 emit_arith(0x2B, 0xC0, dst, src); | |
2943 } | |
2944 | |
2945 void Assembler::subsd(XMMRegister dst, XMMRegister src) { | |
2946 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2947 emit_simd_arith(0x5C, dst, src, VEX_SIMD_F2); |
304 | 2948 } |
2949 | |
2950 void Assembler::subsd(XMMRegister dst, Address src) { | |
2951 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2952 emit_simd_arith(0x5C, dst, src, VEX_SIMD_F2); |
304 | 2953 } |
2954 | |
2955 void Assembler::subss(XMMRegister dst, XMMRegister src) { | |
2956 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2957 emit_simd_arith(0x5C, dst, src, VEX_SIMD_F3); |
304 | 2958 } |
2959 | |
2960 void Assembler::subss(XMMRegister dst, Address src) { | |
2961 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
2962 emit_simd_arith(0x5C, dst, src, VEX_SIMD_F3); |
304 | 2963 } |
2964 | |
2965 void Assembler::testb(Register dst, int imm8) { | |
2966 NOT_LP64(assert(dst->has_byte_register(), "must have byte register")); | |
2967 (void) prefix_and_encode(dst->encoding(), true); | |
2968 emit_arith_b(0xF6, 0xC0, dst, imm8); | |
2969 } | |
2970 | |
2971 void Assembler::testl(Register dst, int32_t imm32) { | |
2972 // not using emit_arith because test | |
2973 // doesn't support sign-extension of | |
2974 // 8bit operands | |
2975 int encode = dst->encoding(); | |
2976 if (encode == 0) { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2977 emit_int8((unsigned char)0xA9); |
304 | 2978 } else { |
2979 encode = prefix_and_encode(encode); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2980 emit_int8((unsigned char)0xF7); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2981 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 2982 } |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
2983 emit_int32(imm32); |
304 | 2984 } |
2985 | |
2986 void Assembler::testl(Register dst, Register src) { | |
2987 (void) prefix_and_encode(dst->encoding(), src->encoding()); | |
2988 emit_arith(0x85, 0xC0, dst, src); | |
2989 } | |
2990 | |
2991 void Assembler::testl(Register dst, Address src) { | |
2992 InstructionMark im(this); | |
2993 prefix(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
2994 emit_int8((unsigned char)0x85); |
304 | 2995 emit_operand(dst, src); |
2996 } | |
2997 | |
14693
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
2998 void Assembler::tzcntl(Register dst, Register src) { |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
2999 assert(VM_Version::supports_bmi1(), "tzcnt instruction not supported"); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
3000 emit_int8((unsigned char)0xF3); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
3001 int encode = prefix_and_encode(dst->encoding(), src->encoding()); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
3002 emit_int8(0x0F); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
3003 emit_int8((unsigned char)0xBC); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
3004 emit_int8((unsigned char)0xC0 | encode); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
3005 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
3006 |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
3007 void Assembler::tzcntq(Register dst, Register src) { |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
3008 assert(VM_Version::supports_bmi1(), "tzcnt instruction not supported"); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
3009 emit_int8((unsigned char)0xF3); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
3010 int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
3011 emit_int8(0x0F); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
3012 emit_int8((unsigned char)0xBC); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
3013 emit_int8((unsigned char)(0xC0 | encode)); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
3014 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
3015 |
304 | 3016 void Assembler::ucomisd(XMMRegister dst, Address src) { |
3017 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3018 emit_simd_arith_nonds(0x2E, dst, src, VEX_SIMD_66); |
304 | 3019 } |
3020 | |
3021 void Assembler::ucomisd(XMMRegister dst, XMMRegister src) { | |
3022 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3023 emit_simd_arith_nonds(0x2E, dst, src, VEX_SIMD_66); |
304 | 3024 } |
3025 | |
3026 void Assembler::ucomiss(XMMRegister dst, Address src) { | |
3027 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3028 emit_simd_arith_nonds(0x2E, dst, src, VEX_SIMD_NONE); |
304 | 3029 } |
3030 | |
3031 void Assembler::ucomiss(XMMRegister dst, XMMRegister src) { | |
3032 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3033 emit_simd_arith_nonds(0x2E, dst, src, VEX_SIMD_NONE); |
304 | 3034 } |
3035 | |
17780 | 3036 void Assembler::xabort(int8_t imm8) { |
3037 emit_int8((unsigned char)0xC6); | |
3038 emit_int8((unsigned char)0xF8); | |
3039 emit_int8((unsigned char)(imm8 & 0xFF)); | |
3040 } | |
304 | 3041 |
3042 void Assembler::xaddl(Address dst, Register src) { | |
3043 InstructionMark im(this); | |
3044 prefix(dst, src); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3045 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3046 emit_int8((unsigned char)0xC1); |
304 | 3047 emit_operand(src, dst); |
3048 } | |
3049 | |
17780 | 3050 void Assembler::xbegin(Label& abort, relocInfo::relocType rtype) { |
3051 InstructionMark im(this); | |
3052 relocate(rtype); | |
3053 if (abort.is_bound()) { | |
3054 address entry = target(abort); | |
3055 assert(entry != NULL, "abort entry NULL"); | |
3056 intptr_t offset = entry - pc(); | |
3057 emit_int8((unsigned char)0xC7); | |
3058 emit_int8((unsigned char)0xF8); | |
3059 emit_int32(offset - 6); // 2 opcode + 4 address | |
3060 } else { | |
3061 abort.add_patch_at(code(), locator()); | |
3062 emit_int8((unsigned char)0xC7); | |
3063 emit_int8((unsigned char)0xF8); | |
3064 emit_int32(0); | |
3065 } | |
3066 } | |
3067 | |
304 | 3068 void Assembler::xchgl(Register dst, Address src) { // xchg |
3069 InstructionMark im(this); | |
3070 prefix(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3071 emit_int8((unsigned char)0x87); |
304 | 3072 emit_operand(dst, src); |
3073 } | |
3074 | |
3075 void Assembler::xchgl(Register dst, Register src) { | |
3076 int encode = prefix_and_encode(dst->encoding(), src->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3077 emit_int8((unsigned char)0x87); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3078 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 3079 } |
3080 | |
17780 | 3081 void Assembler::xend() { |
3082 emit_int8((unsigned char)0x0F); | |
3083 emit_int8((unsigned char)0x01); | |
3084 emit_int8((unsigned char)0xD5); | |
3085 } | |
3086 | |
7199
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
7198
diff
changeset
|
3087 void Assembler::xgetbv() { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3088 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3089 emit_int8(0x01); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3090 emit_int8((unsigned char)0xD0); |
7199
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
7198
diff
changeset
|
3091 } |
cd3d6a6b95d9
8003240: x86: move MacroAssembler into separate file
twisti
parents:
7198
diff
changeset
|
3092 |
304 | 3093 void Assembler::xorl(Register dst, int32_t imm32) { |
3094 prefix(dst); | |
3095 emit_arith(0x81, 0xF0, dst, imm32); | |
3096 } | |
3097 | |
3098 void Assembler::xorl(Register dst, Address src) { | |
3099 InstructionMark im(this); | |
3100 prefix(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3101 emit_int8(0x33); |
304 | 3102 emit_operand(dst, src); |
3103 } | |
3104 | |
3105 void Assembler::xorl(Register dst, Register src) { | |
3106 (void) prefix_and_encode(dst->encoding(), src->encoding()); | |
3107 emit_arith(0x33, 0xC0, dst, src); | |
3108 } | |
3109 | |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3110 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3111 // AVX 3-operands scalar float-point arithmetic instructions |
4761
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3112 |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3113 void Assembler::vaddsd(XMMRegister dst, XMMRegister nds, Address src) { |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3114 assert(VM_Version::supports_avx(), ""); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3115 emit_vex_arith(0x58, dst, nds, src, VEX_SIMD_F2, /* vector256 */ false); |
4761
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3116 } |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3117 |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3118 void Assembler::vaddsd(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3119 assert(VM_Version::supports_avx(), ""); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3120 emit_vex_arith(0x58, dst, nds, src, VEX_SIMD_F2, /* vector256 */ false); |
4761
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3121 } |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3122 |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3123 void Assembler::vaddss(XMMRegister dst, XMMRegister nds, Address src) { |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3124 assert(VM_Version::supports_avx(), ""); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3125 emit_vex_arith(0x58, dst, nds, src, VEX_SIMD_F3, /* vector256 */ false); |
4761
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3126 } |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3127 |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3128 void Assembler::vaddss(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3129 assert(VM_Version::supports_avx(), ""); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3130 emit_vex_arith(0x58, dst, nds, src, VEX_SIMD_F3, /* vector256 */ false); |
4761
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3131 } |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3132 |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3133 void Assembler::vdivsd(XMMRegister dst, XMMRegister nds, Address src) { |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3134 assert(VM_Version::supports_avx(), ""); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3135 emit_vex_arith(0x5E, dst, nds, src, VEX_SIMD_F2, /* vector256 */ false); |
4761
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3136 } |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3137 |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3138 void Assembler::vdivsd(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3139 assert(VM_Version::supports_avx(), ""); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3140 emit_vex_arith(0x5E, dst, nds, src, VEX_SIMD_F2, /* vector256 */ false); |
4761
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3141 } |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3142 |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3143 void Assembler::vdivss(XMMRegister dst, XMMRegister nds, Address src) { |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3144 assert(VM_Version::supports_avx(), ""); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3145 emit_vex_arith(0x5E, dst, nds, src, VEX_SIMD_F3, /* vector256 */ false); |
4761
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3146 } |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3147 |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3148 void Assembler::vdivss(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3149 assert(VM_Version::supports_avx(), ""); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3150 emit_vex_arith(0x5E, dst, nds, src, VEX_SIMD_F3, /* vector256 */ false); |
4761
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3151 } |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3152 |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3153 void Assembler::vmulsd(XMMRegister dst, XMMRegister nds, Address src) { |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3154 assert(VM_Version::supports_avx(), ""); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3155 emit_vex_arith(0x59, dst, nds, src, VEX_SIMD_F2, /* vector256 */ false); |
4761
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3156 } |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3157 |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3158 void Assembler::vmulsd(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3159 assert(VM_Version::supports_avx(), ""); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3160 emit_vex_arith(0x59, dst, nds, src, VEX_SIMD_F2, /* vector256 */ false); |
4761
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3161 } |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3162 |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3163 void Assembler::vmulss(XMMRegister dst, XMMRegister nds, Address src) { |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3164 assert(VM_Version::supports_avx(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3165 emit_vex_arith(0x59, dst, nds, src, VEX_SIMD_F3, /* vector256 */ false); |
4761
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3166 } |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3167 |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3168 void Assembler::vmulss(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3169 assert(VM_Version::supports_avx(), ""); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3170 emit_vex_arith(0x59, dst, nds, src, VEX_SIMD_F3, /* vector256 */ false); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3171 } |
4761
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3172 |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3173 void Assembler::vsubsd(XMMRegister dst, XMMRegister nds, Address src) { |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3174 assert(VM_Version::supports_avx(), ""); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3175 emit_vex_arith(0x5C, dst, nds, src, VEX_SIMD_F2, /* vector256 */ false); |
4761
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3176 } |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3177 |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3178 void Assembler::vsubsd(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3179 assert(VM_Version::supports_avx(), ""); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3180 emit_vex_arith(0x5C, dst, nds, src, VEX_SIMD_F2, /* vector256 */ false); |
4761
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3181 } |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3182 |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3183 void Assembler::vsubss(XMMRegister dst, XMMRegister nds, Address src) { |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3184 assert(VM_Version::supports_avx(), ""); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3185 emit_vex_arith(0x5C, dst, nds, src, VEX_SIMD_F3, /* vector256 */ false); |
4761
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3186 } |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3187 |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3188 void Assembler::vsubss(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3189 assert(VM_Version::supports_avx(), ""); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3190 emit_vex_arith(0x5C, dst, nds, src, VEX_SIMD_F3, /* vector256 */ false); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3191 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3192 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3193 //====================VECTOR ARITHMETIC===================================== |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3194 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3195 // Float-point vector arithmetic |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3196 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3197 void Assembler::addpd(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3198 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3199 emit_simd_arith(0x58, dst, src, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3200 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3201 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3202 void Assembler::addps(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3203 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3204 emit_simd_arith(0x58, dst, src, VEX_SIMD_NONE); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3205 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3206 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3207 void Assembler::vaddpd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3208 assert(VM_Version::supports_avx(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3209 emit_vex_arith(0x58, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3210 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3211 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3212 void Assembler::vaddps(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3213 assert(VM_Version::supports_avx(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3214 emit_vex_arith(0x58, dst, nds, src, VEX_SIMD_NONE, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3215 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3216 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3217 void Assembler::vaddpd(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3218 assert(VM_Version::supports_avx(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3219 emit_vex_arith(0x58, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3220 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3221 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3222 void Assembler::vaddps(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3223 assert(VM_Version::supports_avx(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3224 emit_vex_arith(0x58, dst, nds, src, VEX_SIMD_NONE, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3225 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3226 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3227 void Assembler::subpd(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3228 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3229 emit_simd_arith(0x5C, dst, src, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3230 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3231 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3232 void Assembler::subps(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3233 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3234 emit_simd_arith(0x5C, dst, src, VEX_SIMD_NONE); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3235 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3236 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3237 void Assembler::vsubpd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3238 assert(VM_Version::supports_avx(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3239 emit_vex_arith(0x5C, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3240 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3241 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3242 void Assembler::vsubps(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3243 assert(VM_Version::supports_avx(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3244 emit_vex_arith(0x5C, dst, nds, src, VEX_SIMD_NONE, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3245 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3246 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3247 void Assembler::vsubpd(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3248 assert(VM_Version::supports_avx(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3249 emit_vex_arith(0x5C, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3250 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3251 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3252 void Assembler::vsubps(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3253 assert(VM_Version::supports_avx(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3254 emit_vex_arith(0x5C, dst, nds, src, VEX_SIMD_NONE, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3255 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3256 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3257 void Assembler::mulpd(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3258 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3259 emit_simd_arith(0x59, dst, src, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3260 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3261 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3262 void Assembler::mulps(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3263 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3264 emit_simd_arith(0x59, dst, src, VEX_SIMD_NONE); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3265 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3266 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3267 void Assembler::vmulpd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3268 assert(VM_Version::supports_avx(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3269 emit_vex_arith(0x59, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3270 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3271 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3272 void Assembler::vmulps(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3273 assert(VM_Version::supports_avx(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3274 emit_vex_arith(0x59, dst, nds, src, VEX_SIMD_NONE, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3275 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3276 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3277 void Assembler::vmulpd(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
4761
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3278 assert(VM_Version::supports_avx(), ""); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3279 emit_vex_arith(0x59, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3280 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3281 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3282 void Assembler::vmulps(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3283 assert(VM_Version::supports_avx(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3284 emit_vex_arith(0x59, dst, nds, src, VEX_SIMD_NONE, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3285 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3286 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3287 void Assembler::divpd(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3288 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3289 emit_simd_arith(0x5E, dst, src, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3290 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3291 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3292 void Assembler::divps(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3293 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3294 emit_simd_arith(0x5E, dst, src, VEX_SIMD_NONE); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3295 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3296 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3297 void Assembler::vdivpd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3298 assert(VM_Version::supports_avx(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3299 emit_vex_arith(0x5E, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3300 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3301 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3302 void Assembler::vdivps(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3303 assert(VM_Version::supports_avx(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3304 emit_vex_arith(0x5E, dst, nds, src, VEX_SIMD_NONE, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3305 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3306 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3307 void Assembler::vdivpd(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3308 assert(VM_Version::supports_avx(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3309 emit_vex_arith(0x5E, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3310 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3311 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3312 void Assembler::vdivps(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3313 assert(VM_Version::supports_avx(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3314 emit_vex_arith(0x5E, dst, nds, src, VEX_SIMD_NONE, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3315 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3316 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3317 void Assembler::andpd(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3318 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3319 emit_simd_arith(0x54, dst, src, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3320 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3321 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3322 void Assembler::andps(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3323 NOT_LP64(assert(VM_Version::supports_sse(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3324 emit_simd_arith(0x54, dst, src, VEX_SIMD_NONE); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3325 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3326 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3327 void Assembler::andps(XMMRegister dst, Address src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3328 NOT_LP64(assert(VM_Version::supports_sse(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3329 emit_simd_arith(0x54, dst, src, VEX_SIMD_NONE); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3330 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3331 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3332 void Assembler::andpd(XMMRegister dst, Address src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3333 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3334 emit_simd_arith(0x54, dst, src, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3335 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3336 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3337 void Assembler::vandpd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3338 assert(VM_Version::supports_avx(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3339 emit_vex_arith(0x54, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3340 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3341 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3342 void Assembler::vandps(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3343 assert(VM_Version::supports_avx(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3344 emit_vex_arith(0x54, dst, nds, src, VEX_SIMD_NONE, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3345 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3346 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3347 void Assembler::vandpd(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3348 assert(VM_Version::supports_avx(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3349 emit_vex_arith(0x54, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3350 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3351 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3352 void Assembler::vandps(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3353 assert(VM_Version::supports_avx(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3354 emit_vex_arith(0x54, dst, nds, src, VEX_SIMD_NONE, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3355 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3356 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3357 void Assembler::xorpd(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3358 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3359 emit_simd_arith(0x57, dst, src, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3360 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3361 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3362 void Assembler::xorps(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3363 NOT_LP64(assert(VM_Version::supports_sse(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3364 emit_simd_arith(0x57, dst, src, VEX_SIMD_NONE); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3365 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3366 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3367 void Assembler::xorpd(XMMRegister dst, Address src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3368 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3369 emit_simd_arith(0x57, dst, src, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3370 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3371 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3372 void Assembler::xorps(XMMRegister dst, Address src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3373 NOT_LP64(assert(VM_Version::supports_sse(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3374 emit_simd_arith(0x57, dst, src, VEX_SIMD_NONE); |
4761
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3375 } |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3376 |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
3377 void Assembler::vxorpd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
3378 assert(VM_Version::supports_avx(), ""); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3379 emit_vex_arith(0x57, dst, nds, src, VEX_SIMD_66, vector256); |
4761
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3380 } |
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3381 |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
3382 void Assembler::vxorps(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
3383 assert(VM_Version::supports_avx(), ""); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3384 emit_vex_arith(0x57, dst, nds, src, VEX_SIMD_NONE, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3385 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3386 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3387 void Assembler::vxorpd(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3388 assert(VM_Version::supports_avx(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3389 emit_vex_arith(0x57, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3390 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3391 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3392 void Assembler::vxorps(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3393 assert(VM_Version::supports_avx(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3394 emit_vex_arith(0x57, dst, nds, src, VEX_SIMD_NONE, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3395 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3396 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3397 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3398 // Integer vector arithmetic |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3399 void Assembler::paddb(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3400 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3401 emit_simd_arith(0xFC, dst, src, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3402 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3403 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3404 void Assembler::paddw(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3405 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3406 emit_simd_arith(0xFD, dst, src, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3407 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3408 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3409 void Assembler::paddd(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3410 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3411 emit_simd_arith(0xFE, dst, src, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3412 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3413 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3414 void Assembler::paddq(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3415 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3416 emit_simd_arith(0xD4, dst, src, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3417 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3418 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3419 void Assembler::vpaddb(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3420 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3421 emit_vex_arith(0xFC, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3422 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3423 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3424 void Assembler::vpaddw(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3425 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3426 emit_vex_arith(0xFD, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3427 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3428 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3429 void Assembler::vpaddd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3430 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3431 emit_vex_arith(0xFE, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3432 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3433 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3434 void Assembler::vpaddq(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3435 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3436 emit_vex_arith(0xD4, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3437 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3438 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3439 void Assembler::vpaddb(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3440 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3441 emit_vex_arith(0xFC, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3442 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3443 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3444 void Assembler::vpaddw(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3445 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3446 emit_vex_arith(0xFD, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3447 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3448 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3449 void Assembler::vpaddd(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3450 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3451 emit_vex_arith(0xFE, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3452 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3453 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3454 void Assembler::vpaddq(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3455 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3456 emit_vex_arith(0xD4, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3457 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3458 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3459 void Assembler::psubb(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3460 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3461 emit_simd_arith(0xF8, dst, src, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3462 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3463 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3464 void Assembler::psubw(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3465 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3466 emit_simd_arith(0xF9, dst, src, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3467 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3468 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3469 void Assembler::psubd(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3470 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3471 emit_simd_arith(0xFA, dst, src, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3472 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3473 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3474 void Assembler::psubq(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3475 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3476 emit_simd_arith(0xFB, dst, src, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3477 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3478 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3479 void Assembler::vpsubb(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3480 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3481 emit_vex_arith(0xF8, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3482 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3483 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3484 void Assembler::vpsubw(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3485 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3486 emit_vex_arith(0xF9, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3487 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3488 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3489 void Assembler::vpsubd(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3490 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3491 emit_vex_arith(0xFA, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3492 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3493 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3494 void Assembler::vpsubq(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3495 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3496 emit_vex_arith(0xFB, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3497 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3498 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3499 void Assembler::vpsubb(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3500 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3501 emit_vex_arith(0xF8, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3502 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3503 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3504 void Assembler::vpsubw(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3505 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3506 emit_vex_arith(0xF9, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3507 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3508 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3509 void Assembler::vpsubd(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3510 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3511 emit_vex_arith(0xFA, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3512 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3513 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3514 void Assembler::vpsubq(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3515 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3516 emit_vex_arith(0xFB, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3517 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3518 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3519 void Assembler::pmullw(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3520 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3521 emit_simd_arith(0xD5, dst, src, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3522 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3523 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3524 void Assembler::pmulld(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3525 assert(VM_Version::supports_sse4_1(), ""); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3526 int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3527 emit_int8(0x40); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3528 emit_int8((unsigned char)(0xC0 | encode)); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3529 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3530 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3531 void Assembler::vpmullw(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3532 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3533 emit_vex_arith(0xD5, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3534 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3535 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3536 void Assembler::vpmulld(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3537 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3538 int encode = vex_prefix_and_encode(dst, nds, src, VEX_SIMD_66, vector256, VEX_OPCODE_0F_38); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3539 emit_int8(0x40); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3540 emit_int8((unsigned char)(0xC0 | encode)); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3541 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3542 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3543 void Assembler::vpmullw(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3544 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3545 emit_vex_arith(0xD5, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3546 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3547 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3548 void Assembler::vpmulld(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3549 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3550 InstructionMark im(this); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3551 int dst_enc = dst->encoding(); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3552 int nds_enc = nds->is_valid() ? nds->encoding() : 0; |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3553 vex_prefix(src, nds_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F_38, false, vector256); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3554 emit_int8(0x40); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3555 emit_operand(dst, src); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3556 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3557 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3558 // Shift packed integers left by specified number of bits. |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3559 void Assembler::psllw(XMMRegister dst, int shift) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3560 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3561 // XMM6 is for /6 encoding: 66 0F 71 /6 ib |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3562 int encode = simd_prefix_and_encode(xmm6, dst, dst, VEX_SIMD_66); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3563 emit_int8(0x71); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3564 emit_int8((unsigned char)(0xC0 | encode)); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3565 emit_int8(shift & 0xFF); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3566 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3567 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3568 void Assembler::pslld(XMMRegister dst, int shift) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3569 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3570 // XMM6 is for /6 encoding: 66 0F 72 /6 ib |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3571 int encode = simd_prefix_and_encode(xmm6, dst, dst, VEX_SIMD_66); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3572 emit_int8(0x72); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3573 emit_int8((unsigned char)(0xC0 | encode)); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3574 emit_int8(shift & 0xFF); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3575 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3576 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3577 void Assembler::psllq(XMMRegister dst, int shift) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3578 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3579 // XMM6 is for /6 encoding: 66 0F 73 /6 ib |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3580 int encode = simd_prefix_and_encode(xmm6, dst, dst, VEX_SIMD_66); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3581 emit_int8(0x73); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3582 emit_int8((unsigned char)(0xC0 | encode)); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3583 emit_int8(shift & 0xFF); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3584 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3585 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3586 void Assembler::psllw(XMMRegister dst, XMMRegister shift) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3587 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3588 emit_simd_arith(0xF1, dst, shift, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3589 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3590 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3591 void Assembler::pslld(XMMRegister dst, XMMRegister shift) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3592 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3593 emit_simd_arith(0xF2, dst, shift, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3594 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3595 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3596 void Assembler::psllq(XMMRegister dst, XMMRegister shift) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3597 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3598 emit_simd_arith(0xF3, dst, shift, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3599 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3600 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3601 void Assembler::vpsllw(XMMRegister dst, XMMRegister src, int shift, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3602 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3603 // XMM6 is for /6 encoding: 66 0F 71 /6 ib |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3604 emit_vex_arith(0x71, xmm6, dst, src, VEX_SIMD_66, vector256); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3605 emit_int8(shift & 0xFF); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3606 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3607 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3608 void Assembler::vpslld(XMMRegister dst, XMMRegister src, int shift, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3609 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3610 // XMM6 is for /6 encoding: 66 0F 72 /6 ib |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3611 emit_vex_arith(0x72, xmm6, dst, src, VEX_SIMD_66, vector256); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3612 emit_int8(shift & 0xFF); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3613 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3614 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3615 void Assembler::vpsllq(XMMRegister dst, XMMRegister src, int shift, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3616 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3617 // XMM6 is for /6 encoding: 66 0F 73 /6 ib |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3618 emit_vex_arith(0x73, xmm6, dst, src, VEX_SIMD_66, vector256); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3619 emit_int8(shift & 0xFF); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3620 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3621 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3622 void Assembler::vpsllw(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3623 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3624 emit_vex_arith(0xF1, dst, src, shift, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3625 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3626 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3627 void Assembler::vpslld(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3628 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3629 emit_vex_arith(0xF2, dst, src, shift, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3630 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3631 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3632 void Assembler::vpsllq(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3633 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3634 emit_vex_arith(0xF3, dst, src, shift, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3635 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3636 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3637 // Shift packed integers logically right by specified number of bits. |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3638 void Assembler::psrlw(XMMRegister dst, int shift) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3639 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3640 // XMM2 is for /2 encoding: 66 0F 71 /2 ib |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3641 int encode = simd_prefix_and_encode(xmm2, dst, dst, VEX_SIMD_66); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3642 emit_int8(0x71); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3643 emit_int8((unsigned char)(0xC0 | encode)); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3644 emit_int8(shift & 0xFF); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3645 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3646 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3647 void Assembler::psrld(XMMRegister dst, int shift) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3648 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3649 // XMM2 is for /2 encoding: 66 0F 72 /2 ib |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3650 int encode = simd_prefix_and_encode(xmm2, dst, dst, VEX_SIMD_66); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3651 emit_int8(0x72); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3652 emit_int8((unsigned char)(0xC0 | encode)); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3653 emit_int8(shift & 0xFF); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3654 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3655 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3656 void Assembler::psrlq(XMMRegister dst, int shift) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3657 // Do not confuse it with psrldq SSE2 instruction which |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3658 // shifts 128 bit value in xmm register by number of bytes. |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3659 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3660 // XMM2 is for /2 encoding: 66 0F 73 /2 ib |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3661 int encode = simd_prefix_and_encode(xmm2, dst, dst, VEX_SIMD_66); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3662 emit_int8(0x73); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3663 emit_int8((unsigned char)(0xC0 | encode)); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3664 emit_int8(shift & 0xFF); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3665 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3666 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3667 void Assembler::psrlw(XMMRegister dst, XMMRegister shift) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3668 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3669 emit_simd_arith(0xD1, dst, shift, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3670 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3671 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3672 void Assembler::psrld(XMMRegister dst, XMMRegister shift) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3673 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3674 emit_simd_arith(0xD2, dst, shift, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3675 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3676 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3677 void Assembler::psrlq(XMMRegister dst, XMMRegister shift) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3678 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3679 emit_simd_arith(0xD3, dst, shift, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3680 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3681 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3682 void Assembler::vpsrlw(XMMRegister dst, XMMRegister src, int shift, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3683 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3684 // XMM2 is for /2 encoding: 66 0F 73 /2 ib |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3685 emit_vex_arith(0x71, xmm2, dst, src, VEX_SIMD_66, vector256); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3686 emit_int8(shift & 0xFF); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3687 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3688 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3689 void Assembler::vpsrld(XMMRegister dst, XMMRegister src, int shift, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3690 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3691 // XMM2 is for /2 encoding: 66 0F 73 /2 ib |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3692 emit_vex_arith(0x72, xmm2, dst, src, VEX_SIMD_66, vector256); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3693 emit_int8(shift & 0xFF); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3694 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3695 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3696 void Assembler::vpsrlq(XMMRegister dst, XMMRegister src, int shift, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3697 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3698 // XMM2 is for /2 encoding: 66 0F 73 /2 ib |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3699 emit_vex_arith(0x73, xmm2, dst, src, VEX_SIMD_66, vector256); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3700 emit_int8(shift & 0xFF); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3701 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3702 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3703 void Assembler::vpsrlw(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3704 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3705 emit_vex_arith(0xD1, dst, src, shift, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3706 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3707 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3708 void Assembler::vpsrld(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3709 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3710 emit_vex_arith(0xD2, dst, src, shift, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3711 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3712 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3713 void Assembler::vpsrlq(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3714 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3715 emit_vex_arith(0xD3, dst, src, shift, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3716 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3717 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3718 // Shift packed integers arithmetically right by specified number of bits. |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3719 void Assembler::psraw(XMMRegister dst, int shift) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3720 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3721 // XMM4 is for /4 encoding: 66 0F 71 /4 ib |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3722 int encode = simd_prefix_and_encode(xmm4, dst, dst, VEX_SIMD_66); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3723 emit_int8(0x71); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3724 emit_int8((unsigned char)(0xC0 | encode)); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3725 emit_int8(shift & 0xFF); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3726 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3727 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3728 void Assembler::psrad(XMMRegister dst, int shift) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3729 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3730 // XMM4 is for /4 encoding: 66 0F 72 /4 ib |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3731 int encode = simd_prefix_and_encode(xmm4, dst, dst, VEX_SIMD_66); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3732 emit_int8(0x72); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3733 emit_int8((unsigned char)(0xC0 | encode)); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3734 emit_int8(shift & 0xFF); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3735 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3736 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3737 void Assembler::psraw(XMMRegister dst, XMMRegister shift) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3738 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3739 emit_simd_arith(0xE1, dst, shift, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3740 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3741 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3742 void Assembler::psrad(XMMRegister dst, XMMRegister shift) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3743 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3744 emit_simd_arith(0xE2, dst, shift, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3745 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3746 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3747 void Assembler::vpsraw(XMMRegister dst, XMMRegister src, int shift, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3748 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3749 // XMM4 is for /4 encoding: 66 0F 71 /4 ib |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3750 emit_vex_arith(0x71, xmm4, dst, src, VEX_SIMD_66, vector256); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3751 emit_int8(shift & 0xFF); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3752 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3753 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3754 void Assembler::vpsrad(XMMRegister dst, XMMRegister src, int shift, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3755 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3756 // XMM4 is for /4 encoding: 66 0F 71 /4 ib |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3757 emit_vex_arith(0x72, xmm4, dst, src, VEX_SIMD_66, vector256); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3758 emit_int8(shift & 0xFF); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3759 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3760 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3761 void Assembler::vpsraw(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3762 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3763 emit_vex_arith(0xE1, dst, src, shift, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3764 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3765 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3766 void Assembler::vpsrad(XMMRegister dst, XMMRegister src, XMMRegister shift, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3767 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3768 emit_vex_arith(0xE2, dst, src, shift, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3769 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3770 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3771 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3772 // AND packed integers |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3773 void Assembler::pand(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3774 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3775 emit_simd_arith(0xDB, dst, src, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3776 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3777 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3778 void Assembler::vpand(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3779 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3780 emit_vex_arith(0xDB, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3781 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3782 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3783 void Assembler::vpand(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3784 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3785 emit_vex_arith(0xDB, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3786 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3787 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3788 void Assembler::por(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3789 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3790 emit_simd_arith(0xEB, dst, src, VEX_SIMD_66); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3791 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3792 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3793 void Assembler::vpor(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3794 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3795 emit_vex_arith(0xEB, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3796 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3797 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3798 void Assembler::vpor(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3799 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3800 emit_vex_arith(0xEB, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3801 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3802 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3803 void Assembler::pxor(XMMRegister dst, XMMRegister src) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3804 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3805 emit_simd_arith(0xEF, dst, src, VEX_SIMD_66); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
3806 } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
3807 |
6225 | 3808 void Assembler::vpxor(XMMRegister dst, XMMRegister nds, XMMRegister src, bool vector256) { |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3809 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3810 emit_vex_arith(0xEF, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3811 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3812 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3813 void Assembler::vpxor(XMMRegister dst, XMMRegister nds, Address src, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3814 assert(VM_Version::supports_avx() && !vector256 || VM_Version::supports_avx2(), "256 bit integer vectors requires AVX2"); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3815 emit_vex_arith(0xEF, dst, nds, src, VEX_SIMD_66, vector256); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3816 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
3817 |
6225 | 3818 |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
3819 void Assembler::vinsertf128h(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
3820 assert(VM_Version::supports_avx(), ""); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
3821 bool vector256 = true; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
3822 int encode = vex_prefix_and_encode(dst, nds, src, VEX_SIMD_66, vector256, VEX_OPCODE_0F_3A); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3823 emit_int8(0x18); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3824 emit_int8((unsigned char)(0xC0 | encode)); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
3825 // 0x00 - insert into lower 128 bits |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
3826 // 0x01 - insert into upper 128 bits |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3827 emit_int8(0x01); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
3828 } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
3829 |
6792
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3830 void Assembler::vinsertf128h(XMMRegister dst, Address src) { |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3831 assert(VM_Version::supports_avx(), ""); |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3832 InstructionMark im(this); |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3833 bool vector256 = true; |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3834 assert(dst != xnoreg, "sanity"); |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3835 int dst_enc = dst->encoding(); |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3836 // swap src<->dst for encoding |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3837 vex_prefix(src, dst_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F_3A, false, vector256); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3838 emit_int8(0x18); |
6792
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3839 emit_operand(dst, src); |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3840 // 0x01 - insert into upper 128 bits |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3841 emit_int8(0x01); |
6792
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3842 } |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3843 |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3844 void Assembler::vextractf128h(Address dst, XMMRegister src) { |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3845 assert(VM_Version::supports_avx(), ""); |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3846 InstructionMark im(this); |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3847 bool vector256 = true; |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3848 assert(src != xnoreg, "sanity"); |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3849 int src_enc = src->encoding(); |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3850 vex_prefix(dst, 0, src_enc, VEX_SIMD_66, VEX_OPCODE_0F_3A, false, vector256); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3851 emit_int8(0x19); |
6792
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3852 emit_operand(src, dst); |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3853 // 0x01 - extract from upper 128 bits |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3854 emit_int8(0x01); |
6792
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3855 } |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3856 |
6225 | 3857 void Assembler::vinserti128h(XMMRegister dst, XMMRegister nds, XMMRegister src) { |
3858 assert(VM_Version::supports_avx2(), ""); | |
3859 bool vector256 = true; | |
3860 int encode = vex_prefix_and_encode(dst, nds, src, VEX_SIMD_66, vector256, VEX_OPCODE_0F_3A); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3861 emit_int8(0x38); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3862 emit_int8((unsigned char)(0xC0 | encode)); |
6225 | 3863 // 0x00 - insert into lower 128 bits |
3864 // 0x01 - insert into upper 128 bits | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3865 emit_int8(0x01); |
6225 | 3866 } |
3867 | |
6792
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3868 void Assembler::vinserti128h(XMMRegister dst, Address src) { |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3869 assert(VM_Version::supports_avx2(), ""); |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3870 InstructionMark im(this); |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3871 bool vector256 = true; |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3872 assert(dst != xnoreg, "sanity"); |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3873 int dst_enc = dst->encoding(); |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3874 // swap src<->dst for encoding |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3875 vex_prefix(src, dst_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F_3A, false, vector256); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3876 emit_int8(0x38); |
6792
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3877 emit_operand(dst, src); |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3878 // 0x01 - insert into upper 128 bits |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3879 emit_int8(0x01); |
6792
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3880 } |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3881 |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3882 void Assembler::vextracti128h(Address dst, XMMRegister src) { |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3883 assert(VM_Version::supports_avx2(), ""); |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3884 InstructionMark im(this); |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3885 bool vector256 = true; |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3886 assert(src != xnoreg, "sanity"); |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3887 int src_enc = src->encoding(); |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3888 vex_prefix(dst, 0, src_enc, VEX_SIMD_66, VEX_OPCODE_0F_3A, false, vector256); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3889 emit_int8(0x39); |
6792
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3890 emit_operand(src, dst); |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3891 // 0x01 - extract from upper 128 bits |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3892 emit_int8(0x01); |
6792
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3893 } |
137868b7aa6f
7196199: java/text/Bidi/Bug6665028.java failed: Bidi run count incorrect
kvn
parents:
6725
diff
changeset
|
3894 |
7475
e2e6bf86682c
8005544: Use 256bit YMM registers in arraycopy stubs on x86
kvn
parents:
7474
diff
changeset
|
3895 // duplicate 4-bytes integer data from src into 8 locations in dest |
e2e6bf86682c
8005544: Use 256bit YMM registers in arraycopy stubs on x86
kvn
parents:
7474
diff
changeset
|
3896 void Assembler::vpbroadcastd(XMMRegister dst, XMMRegister src) { |
e2e6bf86682c
8005544: Use 256bit YMM registers in arraycopy stubs on x86
kvn
parents:
7474
diff
changeset
|
3897 assert(VM_Version::supports_avx2(), ""); |
e2e6bf86682c
8005544: Use 256bit YMM registers in arraycopy stubs on x86
kvn
parents:
7474
diff
changeset
|
3898 bool vector256 = true; |
e2e6bf86682c
8005544: Use 256bit YMM registers in arraycopy stubs on x86
kvn
parents:
7474
diff
changeset
|
3899 int encode = vex_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, vector256, VEX_OPCODE_0F_38); |
e2e6bf86682c
8005544: Use 256bit YMM registers in arraycopy stubs on x86
kvn
parents:
7474
diff
changeset
|
3900 emit_int8(0x58); |
e2e6bf86682c
8005544: Use 256bit YMM registers in arraycopy stubs on x86
kvn
parents:
7474
diff
changeset
|
3901 emit_int8((unsigned char)(0xC0 | encode)); |
e2e6bf86682c
8005544: Use 256bit YMM registers in arraycopy stubs on x86
kvn
parents:
7474
diff
changeset
|
3902 } |
e2e6bf86682c
8005544: Use 256bit YMM registers in arraycopy stubs on x86
kvn
parents:
7474
diff
changeset
|
3903 |
11080
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
3904 // Carry-Less Multiplication Quadword |
20311
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
3905 void Assembler::pclmulqdq(XMMRegister dst, XMMRegister src, int mask) { |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
3906 assert(VM_Version::supports_clmul(), ""); |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
3907 int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A); |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
3908 emit_int8(0x44); |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
3909 emit_int8((unsigned char)(0xC0 | encode)); |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
3910 emit_int8((unsigned char)mask); |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
3911 } |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
3912 |
b1bc1af04c6e
8052081: Optimize generated by C2 code for Intel's Atom processor
kvn
parents:
17937
diff
changeset
|
3913 // Carry-Less Multiplication Quadword |
11080
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
3914 void Assembler::vpclmulqdq(XMMRegister dst, XMMRegister nds, XMMRegister src, int mask) { |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
3915 assert(VM_Version::supports_avx() && VM_Version::supports_clmul(), ""); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
3916 bool vector256 = false; |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
3917 int encode = vex_prefix_and_encode(dst, nds, src, VEX_SIMD_66, vector256, VEX_OPCODE_0F_3A); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
3918 emit_int8(0x44); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
3919 emit_int8((unsigned char)(0xC0 | encode)); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
3920 emit_int8((unsigned char)mask); |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
3921 } |
b800986664f4
7088419: Use x86 Hardware CRC32 Instruction with java.util.zip.CRC32
drchase
parents:
9060
diff
changeset
|
3922 |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
3923 void Assembler::vzeroupper() { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
3924 assert(VM_Version::supports_avx(), ""); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
3925 (void)vex_prefix_and_encode(xmm0, xmm0, xmm0, VEX_SIMD_NONE); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3926 emit_int8(0x77); |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
3927 } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
6141
diff
changeset
|
3928 |
4761
65149e74c706
7121648: Use 3-operands SIMD instructions on x86 with AVX
kvn
parents:
4759
diff
changeset
|
3929 |
304 | 3930 #ifndef _LP64 |
3931 // 32bit only pieces of the assembler | |
3932 | |
3933 void Assembler::cmp_literal32(Register src1, int32_t imm32, RelocationHolder const& rspec) { | |
3934 // NO PREFIX AS NEVER 64BIT | |
3935 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3936 emit_int8((unsigned char)0x81); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3937 emit_int8((unsigned char)(0xF8 | src1->encoding())); |
304 | 3938 emit_data(imm32, rspec, 0); |
3939 } | |
3940 | |
3941 void Assembler::cmp_literal32(Address src1, int32_t imm32, RelocationHolder const& rspec) { | |
3942 // NO PREFIX AS NEVER 64BIT (not even 32bit versions of 64bit regs | |
3943 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3944 emit_int8((unsigned char)0x81); |
304 | 3945 emit_operand(rdi, src1); |
3946 emit_data(imm32, rspec, 0); | |
3947 } | |
3948 | |
3949 // The 64-bit (32bit platform) cmpxchg compares the value at adr with the contents of rdx:rax, | |
3950 // and stores rcx:rbx into adr if so; otherwise, the value at adr is loaded | |
3951 // into rdx:rax. The ZF is set if the compared values were equal, and cleared otherwise. | |
3952 void Assembler::cmpxchg8(Address adr) { | |
3953 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3954 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3955 emit_int8((unsigned char)0xC7); |
304 | 3956 emit_operand(rcx, adr); |
3957 } | |
3958 | |
3959 void Assembler::decl(Register dst) { | |
3960 // Don't use it directly. Use MacroAssembler::decrementl() instead. | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3961 emit_int8(0x48 | dst->encoding()); |
304 | 3962 } |
3963 | |
3964 #endif // _LP64 | |
3965 | |
3966 // 64bit typically doesn't use the x87 but needs to for the trig funcs | |
3967 | |
3968 void Assembler::fabs() { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3969 emit_int8((unsigned char)0xD9); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3970 emit_int8((unsigned char)0xE1); |
304 | 3971 } |
3972 | |
3973 void Assembler::fadd(int i) { | |
3974 emit_farith(0xD8, 0xC0, i); | |
3975 } | |
3976 | |
3977 void Assembler::fadd_d(Address src) { | |
3978 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3979 emit_int8((unsigned char)0xDC); |
304 | 3980 emit_operand32(rax, src); |
3981 } | |
3982 | |
3983 void Assembler::fadd_s(Address src) { | |
3984 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3985 emit_int8((unsigned char)0xD8); |
304 | 3986 emit_operand32(rax, src); |
3987 } | |
3988 | |
3989 void Assembler::fadda(int i) { | |
3990 emit_farith(0xDC, 0xC0, i); | |
3991 } | |
3992 | |
3993 void Assembler::faddp(int i) { | |
3994 emit_farith(0xDE, 0xC0, i); | |
3995 } | |
3996 | |
3997 void Assembler::fchs() { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3998 emit_int8((unsigned char)0xD9); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
3999 emit_int8((unsigned char)0xE0); |
304 | 4000 } |
4001 | |
4002 void Assembler::fcom(int i) { | |
4003 emit_farith(0xD8, 0xD0, i); | |
4004 } | |
4005 | |
4006 void Assembler::fcomp(int i) { | |
4007 emit_farith(0xD8, 0xD8, i); | |
4008 } | |
4009 | |
4010 void Assembler::fcomp_d(Address src) { | |
4011 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4012 emit_int8((unsigned char)0xDC); |
304 | 4013 emit_operand32(rbx, src); |
4014 } | |
4015 | |
4016 void Assembler::fcomp_s(Address src) { | |
4017 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4018 emit_int8((unsigned char)0xD8); |
304 | 4019 emit_operand32(rbx, src); |
4020 } | |
4021 | |
4022 void Assembler::fcompp() { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4023 emit_int8((unsigned char)0xDE); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4024 emit_int8((unsigned char)0xD9); |
304 | 4025 } |
4026 | |
4027 void Assembler::fcos() { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4028 emit_int8((unsigned char)0xD9); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4029 emit_int8((unsigned char)0xFF); |
304 | 4030 } |
4031 | |
4032 void Assembler::fdecstp() { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4033 emit_int8((unsigned char)0xD9); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4034 emit_int8((unsigned char)0xF6); |
304 | 4035 } |
4036 | |
4037 void Assembler::fdiv(int i) { | |
4038 emit_farith(0xD8, 0xF0, i); | |
4039 } | |
4040 | |
4041 void Assembler::fdiv_d(Address src) { | |
4042 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4043 emit_int8((unsigned char)0xDC); |
304 | 4044 emit_operand32(rsi, src); |
4045 } | |
4046 | |
4047 void Assembler::fdiv_s(Address src) { | |
4048 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4049 emit_int8((unsigned char)0xD8); |
304 | 4050 emit_operand32(rsi, src); |
4051 } | |
4052 | |
4053 void Assembler::fdiva(int i) { | |
4054 emit_farith(0xDC, 0xF8, i); | |
4055 } | |
4056 | |
4057 // Note: The Intel manual (Pentium Processor User's Manual, Vol.3, 1994) | |
4058 // is erroneous for some of the floating-point instructions below. | |
4059 | |
4060 void Assembler::fdivp(int i) { | |
4061 emit_farith(0xDE, 0xF8, i); // ST(0) <- ST(0) / ST(1) and pop (Intel manual wrong) | |
4062 } | |
4063 | |
4064 void Assembler::fdivr(int i) { | |
4065 emit_farith(0xD8, 0xF8, i); | |
4066 } | |
4067 | |
4068 void Assembler::fdivr_d(Address src) { | |
4069 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4070 emit_int8((unsigned char)0xDC); |
304 | 4071 emit_operand32(rdi, src); |
4072 } | |
4073 | |
4074 void Assembler::fdivr_s(Address src) { | |
4075 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4076 emit_int8((unsigned char)0xD8); |
304 | 4077 emit_operand32(rdi, src); |
4078 } | |
4079 | |
4080 void Assembler::fdivra(int i) { | |
4081 emit_farith(0xDC, 0xF0, i); | |
4082 } | |
4083 | |
4084 void Assembler::fdivrp(int i) { | |
4085 emit_farith(0xDE, 0xF0, i); // ST(0) <- ST(1) / ST(0) and pop (Intel manual wrong) | |
4086 } | |
4087 | |
4088 void Assembler::ffree(int i) { | |
4089 emit_farith(0xDD, 0xC0, i); | |
4090 } | |
4091 | |
4092 void Assembler::fild_d(Address adr) { | |
4093 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4094 emit_int8((unsigned char)0xDF); |
304 | 4095 emit_operand32(rbp, adr); |
4096 } | |
4097 | |
4098 void Assembler::fild_s(Address adr) { | |
4099 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4100 emit_int8((unsigned char)0xDB); |
304 | 4101 emit_operand32(rax, adr); |
4102 } | |
4103 | |
4104 void Assembler::fincstp() { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4105 emit_int8((unsigned char)0xD9); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4106 emit_int8((unsigned char)0xF7); |
304 | 4107 } |
4108 | |
4109 void Assembler::finit() { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4110 emit_int8((unsigned char)0x9B); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4111 emit_int8((unsigned char)0xDB); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4112 emit_int8((unsigned char)0xE3); |
304 | 4113 } |
4114 | |
4115 void Assembler::fist_s(Address adr) { | |
4116 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4117 emit_int8((unsigned char)0xDB); |
304 | 4118 emit_operand32(rdx, adr); |
4119 } | |
4120 | |
4121 void Assembler::fistp_d(Address adr) { | |
4122 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4123 emit_int8((unsigned char)0xDF); |
304 | 4124 emit_operand32(rdi, adr); |
4125 } | |
4126 | |
4127 void Assembler::fistp_s(Address adr) { | |
4128 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4129 emit_int8((unsigned char)0xDB); |
304 | 4130 emit_operand32(rbx, adr); |
4131 } | |
0 | 4132 |
4133 void Assembler::fld1() { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4134 emit_int8((unsigned char)0xD9); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4135 emit_int8((unsigned char)0xE8); |
0 | 4136 } |
4137 | |
304 | 4138 void Assembler::fld_d(Address adr) { |
4139 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4140 emit_int8((unsigned char)0xDD); |
304 | 4141 emit_operand32(rax, adr); |
4142 } | |
0 | 4143 |
4144 void Assembler::fld_s(Address adr) { | |
4145 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4146 emit_int8((unsigned char)0xD9); |
304 | 4147 emit_operand32(rax, adr); |
4148 } | |
4149 | |
4150 | |
4151 void Assembler::fld_s(int index) { | |
0 | 4152 emit_farith(0xD9, 0xC0, index); |
4153 } | |
4154 | |
4155 void Assembler::fld_x(Address adr) { | |
4156 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4157 emit_int8((unsigned char)0xDB); |
304 | 4158 emit_operand32(rbp, adr); |
4159 } | |
4160 | |
4161 void Assembler::fldcw(Address src) { | |
4162 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4163 emit_int8((unsigned char)0xD9); |
304 | 4164 emit_operand32(rbp, src); |
4165 } | |
4166 | |
4167 void Assembler::fldenv(Address src) { | |
0 | 4168 InstructionMark im(this); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4169 emit_int8((unsigned char)0xD9); |
304 | 4170 emit_operand32(rsp, src); |
4171 } | |
4172 | |
4173 void Assembler::fldlg2() { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4174 emit_int8((unsigned char)0xD9); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4175 emit_int8((unsigned char)0xEC); |
304 | 4176 } |
0 | 4177 |
4178 void Assembler::fldln2() { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4179 emit_int8((unsigned char)0xD9); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4180 emit_int8((unsigned char)0xED); |
0 | 4181 } |
4182 | |
304 | 4183 void Assembler::fldz() { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4184 emit_int8((unsigned char)0xD9); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4185 emit_int8((unsigned char)0xEE); |
304 | 4186 } |
0 | 4187 |
4188 void Assembler::flog() { | |
4189 fldln2(); | |
4190 fxch(); | |
4191 fyl2x(); | |
4192 } | |
4193 | |
4194 void Assembler::flog10() { | |
4195 fldlg2(); | |
4196 fxch(); | |
4197 fyl2x(); | |
4198 } | |
4199 | |
304 | 4200 void Assembler::fmul(int i) { |
4201 emit_farith(0xD8, 0xC8, i); | |
4202 } | |
4203 | |
4204 void Assembler::fmul_d(Address src) { | |
4205 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4206 emit_int8((unsigned char)0xDC); |
304 | 4207 emit_operand32(rcx, src); |
4208 } | |
4209 | |
4210 void Assembler::fmul_s(Address src) { | |
4211 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4212 emit_int8((unsigned char)0xD8); |
304 | 4213 emit_operand32(rcx, src); |
4214 } | |
4215 | |
4216 void Assembler::fmula(int i) { | |
4217 emit_farith(0xDC, 0xC8, i); | |
4218 } | |
4219 | |
4220 void Assembler::fmulp(int i) { | |
4221 emit_farith(0xDE, 0xC8, i); | |
4222 } | |
4223 | |
4224 void Assembler::fnsave(Address dst) { | |
4225 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4226 emit_int8((unsigned char)0xDD); |
304 | 4227 emit_operand32(rsi, dst); |
4228 } | |
4229 | |
4230 void Assembler::fnstcw(Address src) { | |
4231 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4232 emit_int8((unsigned char)0x9B); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4233 emit_int8((unsigned char)0xD9); |
304 | 4234 emit_operand32(rdi, src); |
4235 } | |
4236 | |
4237 void Assembler::fnstsw_ax() { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4238 emit_int8((unsigned char)0xDF); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4239 emit_int8((unsigned char)0xE0); |
304 | 4240 } |
4241 | |
4242 void Assembler::fprem() { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4243 emit_int8((unsigned char)0xD9); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4244 emit_int8((unsigned char)0xF8); |
304 | 4245 } |
4246 | |
4247 void Assembler::fprem1() { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4248 emit_int8((unsigned char)0xD9); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4249 emit_int8((unsigned char)0xF5); |
304 | 4250 } |
4251 | |
4252 void Assembler::frstor(Address src) { | |
4253 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4254 emit_int8((unsigned char)0xDD); |
304 | 4255 emit_operand32(rsp, src); |
4256 } | |
0 | 4257 |
4258 void Assembler::fsin() { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4259 emit_int8((unsigned char)0xD9); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4260 emit_int8((unsigned char)0xFE); |
0 | 4261 } |
4262 | |
304 | 4263 void Assembler::fsqrt() { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4264 emit_int8((unsigned char)0xD9); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4265 emit_int8((unsigned char)0xFA); |
304 | 4266 } |
4267 | |
4268 void Assembler::fst_d(Address adr) { | |
4269 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4270 emit_int8((unsigned char)0xDD); |
304 | 4271 emit_operand32(rdx, adr); |
4272 } | |
4273 | |
4274 void Assembler::fst_s(Address adr) { | |
4275 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4276 emit_int8((unsigned char)0xD9); |
304 | 4277 emit_operand32(rdx, adr); |
4278 } | |
4279 | |
4280 void Assembler::fstp_d(Address adr) { | |
4281 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4282 emit_int8((unsigned char)0xDD); |
304 | 4283 emit_operand32(rbx, adr); |
4284 } | |
4285 | |
4286 void Assembler::fstp_d(int index) { | |
4287 emit_farith(0xDD, 0xD8, index); | |
4288 } | |
4289 | |
4290 void Assembler::fstp_s(Address adr) { | |
4291 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4292 emit_int8((unsigned char)0xD9); |
304 | 4293 emit_operand32(rbx, adr); |
4294 } | |
4295 | |
4296 void Assembler::fstp_x(Address adr) { | |
4297 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4298 emit_int8((unsigned char)0xDB); |
304 | 4299 emit_operand32(rdi, adr); |
4300 } | |
4301 | |
4302 void Assembler::fsub(int i) { | |
4303 emit_farith(0xD8, 0xE0, i); | |
4304 } | |
4305 | |
4306 void Assembler::fsub_d(Address src) { | |
4307 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4308 emit_int8((unsigned char)0xDC); |
304 | 4309 emit_operand32(rsp, src); |
4310 } | |
4311 | |
4312 void Assembler::fsub_s(Address src) { | |
4313 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4314 emit_int8((unsigned char)0xD8); |
304 | 4315 emit_operand32(rsp, src); |
4316 } | |
4317 | |
4318 void Assembler::fsuba(int i) { | |
4319 emit_farith(0xDC, 0xE8, i); | |
4320 } | |
4321 | |
4322 void Assembler::fsubp(int i) { | |
4323 emit_farith(0xDE, 0xE8, i); // ST(0) <- ST(0) - ST(1) and pop (Intel manual wrong) | |
4324 } | |
4325 | |
4326 void Assembler::fsubr(int i) { | |
4327 emit_farith(0xD8, 0xE8, i); | |
4328 } | |
4329 | |
4330 void Assembler::fsubr_d(Address src) { | |
4331 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4332 emit_int8((unsigned char)0xDC); |
304 | 4333 emit_operand32(rbp, src); |
4334 } | |
4335 | |
4336 void Assembler::fsubr_s(Address src) { | |
4337 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4338 emit_int8((unsigned char)0xD8); |
304 | 4339 emit_operand32(rbp, src); |
4340 } | |
4341 | |
4342 void Assembler::fsubra(int i) { | |
4343 emit_farith(0xDC, 0xE0, i); | |
4344 } | |
4345 | |
4346 void Assembler::fsubrp(int i) { | |
4347 emit_farith(0xDE, 0xE0, i); // ST(0) <- ST(1) - ST(0) and pop (Intel manual wrong) | |
0 | 4348 } |
4349 | |
4350 void Assembler::ftan() { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4351 emit_int8((unsigned char)0xD9); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4352 emit_int8((unsigned char)0xF2); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4353 emit_int8((unsigned char)0xDD); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4354 emit_int8((unsigned char)0xD8); |
0 | 4355 } |
4356 | |
304 | 4357 void Assembler::ftst() { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4358 emit_int8((unsigned char)0xD9); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4359 emit_int8((unsigned char)0xE4); |
304 | 4360 } |
0 | 4361 |
4362 void Assembler::fucomi(int i) { | |
4363 // make sure the instruction is supported (introduced for P6, together with cmov) | |
4364 guarantee(VM_Version::supports_cmov(), "illegal instruction"); | |
4365 emit_farith(0xDB, 0xE8, i); | |
4366 } | |
4367 | |
4368 void Assembler::fucomip(int i) { | |
4369 // make sure the instruction is supported (introduced for P6, together with cmov) | |
4370 guarantee(VM_Version::supports_cmov(), "illegal instruction"); | |
4371 emit_farith(0xDF, 0xE8, i); | |
4372 } | |
4373 | |
4374 void Assembler::fwait() { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4375 emit_int8((unsigned char)0x9B); |
0 | 4376 } |
4377 | |
304 | 4378 void Assembler::fxch(int i) { |
4379 emit_farith(0xD9, 0xC8, i); | |
4380 } | |
4381 | |
4382 void Assembler::fyl2x() { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4383 emit_int8((unsigned char)0xD9); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4384 emit_int8((unsigned char)0xF1); |
304 | 4385 } |
4386 | |
6084
6759698e3140
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
5984
diff
changeset
|
4387 void Assembler::frndint() { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4388 emit_int8((unsigned char)0xD9); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4389 emit_int8((unsigned char)0xFC); |
6084
6759698e3140
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
5984
diff
changeset
|
4390 } |
6759698e3140
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
5984
diff
changeset
|
4391 |
6759698e3140
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
5984
diff
changeset
|
4392 void Assembler::f2xm1() { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4393 emit_int8((unsigned char)0xD9); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4394 emit_int8((unsigned char)0xF0); |
6084
6759698e3140
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
5984
diff
changeset
|
4395 } |
6759698e3140
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
5984
diff
changeset
|
4396 |
6759698e3140
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
5984
diff
changeset
|
4397 void Assembler::fldl2e() { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4398 emit_int8((unsigned char)0xD9); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4399 emit_int8((unsigned char)0xEA); |
6084
6759698e3140
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
5984
diff
changeset
|
4400 } |
6759698e3140
7133857: exp() and pow() should use the x87 ISA on x86
roland
parents:
5984
diff
changeset
|
4401 |
4759 | 4402 // SSE SIMD prefix byte values corresponding to VexSimdPrefix encoding. |
4403 static int simd_pre[4] = { 0, 0x66, 0xF3, 0xF2 }; | |
4404 // SSE opcode second byte values (first is 0x0F) corresponding to VexOpcode encoding. | |
4405 static int simd_opc[4] = { 0, 0, 0x38, 0x3A }; | |
4406 | |
4407 // Generate SSE legacy REX prefix and SIMD opcode based on VEX encoding. | |
4408 void Assembler::rex_prefix(Address adr, XMMRegister xreg, VexSimdPrefix pre, VexOpcode opc, bool rex_w) { | |
4409 if (pre > 0) { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4410 emit_int8(simd_pre[pre]); |
4759 | 4411 } |
4412 if (rex_w) { | |
4413 prefixq(adr, xreg); | |
4414 } else { | |
4415 prefix(adr, xreg); | |
4416 } | |
4417 if (opc > 0) { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4418 emit_int8(0x0F); |
4759 | 4419 int opc2 = simd_opc[opc]; |
4420 if (opc2 > 0) { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4421 emit_int8(opc2); |
4759 | 4422 } |
4423 } | |
4424 } | |
4425 | |
4426 int Assembler::rex_prefix_and_encode(int dst_enc, int src_enc, VexSimdPrefix pre, VexOpcode opc, bool rex_w) { | |
4427 if (pre > 0) { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4428 emit_int8(simd_pre[pre]); |
4759 | 4429 } |
4430 int encode = (rex_w) ? prefixq_and_encode(dst_enc, src_enc) : | |
4431 prefix_and_encode(dst_enc, src_enc); | |
4432 if (opc > 0) { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4433 emit_int8(0x0F); |
4759 | 4434 int opc2 = simd_opc[opc]; |
4435 if (opc2 > 0) { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4436 emit_int8(opc2); |
4759 | 4437 } |
4438 } | |
4439 return encode; | |
4440 } | |
4441 | |
4442 | |
4443 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) { | |
4444 if (vex_b || vex_x || vex_w || (opc == VEX_OPCODE_0F_38) || (opc == VEX_OPCODE_0F_3A)) { | |
4445 prefix(VEX_3bytes); | |
4446 | |
4447 int byte1 = (vex_r ? VEX_R : 0) | (vex_x ? VEX_X : 0) | (vex_b ? VEX_B : 0); | |
4448 byte1 = (~byte1) & 0xE0; | |
4449 byte1 |= opc; | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4450 emit_int8(byte1); |
4759 | 4451 |
4452 int byte2 = ((~nds_enc) & 0xf) << 3; | |
4453 byte2 |= (vex_w ? VEX_W : 0) | (vector256 ? 4 : 0) | pre; | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4454 emit_int8(byte2); |
4759 | 4455 } else { |
4456 prefix(VEX_2bytes); | |
4457 | |
4458 int byte1 = vex_r ? VEX_R : 0; | |
4459 byte1 = (~byte1) & 0x80; | |
4460 byte1 |= ((~nds_enc) & 0xf) << 3; | |
4461 byte1 |= (vector256 ? 4 : 0) | pre; | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4462 emit_int8(byte1); |
4759 | 4463 } |
4464 } | |
4465 | |
4466 void Assembler::vex_prefix(Address adr, int nds_enc, int xreg_enc, VexSimdPrefix pre, VexOpcode opc, bool vex_w, bool vector256){ | |
4467 bool vex_r = (xreg_enc >= 8); | |
4468 bool vex_b = adr.base_needs_rex(); | |
4469 bool vex_x = adr.index_needs_rex(); | |
4470 vex_prefix(vex_r, vex_b, vex_x, vex_w, nds_enc, pre, opc, vector256); | |
4471 } | |
4472 | |
4473 int Assembler::vex_prefix_and_encode(int dst_enc, int nds_enc, int src_enc, VexSimdPrefix pre, VexOpcode opc, bool vex_w, bool vector256) { | |
4474 bool vex_r = (dst_enc >= 8); | |
4475 bool vex_b = (src_enc >= 8); | |
4476 bool vex_x = false; | |
4477 vex_prefix(vex_r, vex_b, vex_x, vex_w, nds_enc, pre, opc, vector256); | |
4478 return (((dst_enc & 7) << 3) | (src_enc & 7)); | |
4479 } | |
4480 | |
4481 | |
4482 void Assembler::simd_prefix(XMMRegister xreg, XMMRegister nds, Address adr, VexSimdPrefix pre, VexOpcode opc, bool rex_w, bool vector256) { | |
4483 if (UseAVX > 0) { | |
4484 int xreg_enc = xreg->encoding(); | |
4485 int nds_enc = nds->is_valid() ? nds->encoding() : 0; | |
4486 vex_prefix(adr, nds_enc, xreg_enc, pre, opc, rex_w, vector256); | |
4487 } else { | |
4488 assert((nds == xreg) || (nds == xnoreg), "wrong sse encoding"); | |
4489 rex_prefix(adr, xreg, pre, opc, rex_w); | |
4490 } | |
4491 } | |
4492 | |
4493 int Assembler::simd_prefix_and_encode(XMMRegister dst, XMMRegister nds, XMMRegister src, VexSimdPrefix pre, VexOpcode opc, bool rex_w, bool vector256) { | |
4494 int dst_enc = dst->encoding(); | |
4495 int src_enc = src->encoding(); | |
4496 if (UseAVX > 0) { | |
4497 int nds_enc = nds->is_valid() ? nds->encoding() : 0; | |
4498 return vex_prefix_and_encode(dst_enc, nds_enc, src_enc, pre, opc, rex_w, vector256); | |
4499 } else { | |
4500 assert((nds == dst) || (nds == src) || (nds == xnoreg), "wrong sse encoding"); | |
4501 return rex_prefix_and_encode(dst_enc, src_enc, pre, opc, rex_w); | |
4502 } | |
4503 } | |
304 | 4504 |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4505 void Assembler::emit_simd_arith(int opcode, XMMRegister dst, Address src, VexSimdPrefix pre) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4506 InstructionMark im(this); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4507 simd_prefix(dst, dst, src, pre); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4508 emit_int8(opcode); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4509 emit_operand(dst, src); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4510 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4511 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4512 void Assembler::emit_simd_arith(int opcode, XMMRegister dst, XMMRegister src, VexSimdPrefix pre) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4513 int encode = simd_prefix_and_encode(dst, dst, src, pre); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4514 emit_int8(opcode); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4515 emit_int8((unsigned char)(0xC0 | encode)); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4516 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4517 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4518 // Versions with no second source register (non-destructive source). |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4519 void Assembler::emit_simd_arith_nonds(int opcode, XMMRegister dst, Address src, VexSimdPrefix pre) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4520 InstructionMark im(this); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4521 simd_prefix(dst, xnoreg, src, pre); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4522 emit_int8(opcode); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4523 emit_operand(dst, src); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4524 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4525 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4526 void Assembler::emit_simd_arith_nonds(int opcode, XMMRegister dst, XMMRegister src, VexSimdPrefix pre) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4527 int encode = simd_prefix_and_encode(dst, xnoreg, src, pre); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4528 emit_int8(opcode); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4529 emit_int8((unsigned char)(0xC0 | encode)); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4530 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4531 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4532 // 3-operands AVX instructions |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4533 void Assembler::emit_vex_arith(int opcode, XMMRegister dst, XMMRegister nds, |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4534 Address src, VexSimdPrefix pre, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4535 InstructionMark im(this); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4536 vex_prefix(dst, nds, src, pre, vector256); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4537 emit_int8(opcode); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4538 emit_operand(dst, src); |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4539 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4540 |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4541 void Assembler::emit_vex_arith(int opcode, XMMRegister dst, XMMRegister nds, |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4542 XMMRegister src, VexSimdPrefix pre, bool vector256) { |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4543 int encode = vex_prefix_and_encode(dst, nds, src, pre, vector256); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4544 emit_int8(opcode); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4545 emit_int8((unsigned char)(0xC0 | encode)); |
6614
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4546 } |
006050192a5a
6340864: Implement vectorization optimizations in hotspot-server
kvn
parents:
6266
diff
changeset
|
4547 |
304 | 4548 #ifndef _LP64 |
4549 | |
4550 void Assembler::incl(Register dst) { | |
4551 // Don't use it directly. Use MacroAssembler::incrementl() instead. | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4552 emit_int8(0x40 | dst->encoding()); |
304 | 4553 } |
4554 | |
4555 void Assembler::lea(Register dst, Address src) { | |
4556 leal(dst, src); | |
4557 } | |
4558 | |
4559 void Assembler::mov_literal32(Address dst, int32_t imm32, RelocationHolder const& rspec) { | |
4560 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4561 emit_int8((unsigned char)0xC7); |
304 | 4562 emit_operand(rax, dst); |
4563 emit_data((int)imm32, rspec, 0); | |
4564 } | |
4565 | |
642
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
4566 void Assembler::mov_literal32(Register dst, int32_t imm32, RelocationHolder const& rspec) { |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
4567 InstructionMark im(this); |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
4568 int encode = prefix_and_encode(dst->encoding()); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4569 emit_int8((unsigned char)(0xB8 | encode)); |
642
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
4570 emit_data((int)imm32, rspec, 0); |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
4571 } |
304 | 4572 |
4573 void Assembler::popa() { // 32bit | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4574 emit_int8(0x61); |
304 | 4575 } |
4576 | |
4577 void Assembler::push_literal32(int32_t imm32, RelocationHolder const& rspec) { | |
4578 InstructionMark im(this); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4579 emit_int8(0x68); |
304 | 4580 emit_data(imm32, rspec, 0); |
4581 } | |
4582 | |
4583 void Assembler::pusha() { // 32bit | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4584 emit_int8(0x60); |
304 | 4585 } |
4586 | |
4587 void Assembler::set_byte_if_not_zero(Register dst) { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4588 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4589 emit_int8((unsigned char)0x95); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4590 emit_int8((unsigned char)(0xE0 | dst->encoding())); |
304 | 4591 } |
4592 | |
4593 void Assembler::shldl(Register dst, Register src) { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4594 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4595 emit_int8((unsigned char)0xA5); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4596 emit_int8((unsigned char)(0xC0 | src->encoding() << 3 | dst->encoding())); |
304 | 4597 } |
4598 | |
4599 void Assembler::shrdl(Register dst, Register src) { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4600 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4601 emit_int8((unsigned char)0xAD); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4602 emit_int8((unsigned char)(0xC0 | src->encoding() << 3 | dst->encoding())); |
304 | 4603 } |
4604 | |
4605 #else // LP64 | |
4606 | |
1369 | 4607 void Assembler::set_byte_if_not_zero(Register dst) { |
4608 int enc = prefix_and_encode(dst->encoding(), true); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4609 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4610 emit_int8((unsigned char)0x95); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4611 emit_int8((unsigned char)(0xE0 | enc)); |
1369 | 4612 } |
4613 | |
304 | 4614 // 64bit only pieces of the assembler |
4615 // This should only be used by 64bit instructions that can use rip-relative | |
4616 // it cannot be used by instructions that want an immediate value. | |
4617 | |
4618 bool Assembler::reachable(AddressLiteral adr) { | |
4619 int64_t disp; | |
4620 // None will force a 64bit literal to the code stream. Likely a placeholder | |
4621 // for something that will be patched later and we need to certain it will | |
4622 // always be reachable. | |
4623 if (adr.reloc() == relocInfo::none) { | |
4624 return false; | |
4625 } | |
4626 if (adr.reloc() == relocInfo::internal_word_type) { | |
4627 // This should be rip relative and easily reachable. | |
4628 return true; | |
4629 } | |
4630 if (adr.reloc() == relocInfo::virtual_call_type || | |
4631 adr.reloc() == relocInfo::opt_virtual_call_type || | |
4632 adr.reloc() == relocInfo::static_call_type || | |
4633 adr.reloc() == relocInfo::static_stub_type ) { | |
4634 // This should be rip relative within the code cache and easily | |
4635 // reachable until we get huge code caches. (At which point | |
4636 // ic code is going to have issues). | |
4637 return true; | |
4638 } | |
4639 if (adr.reloc() != relocInfo::external_word_type && | |
4640 adr.reloc() != relocInfo::poll_return_type && // these are really external_word but need special | |
4641 adr.reloc() != relocInfo::poll_type && // relocs to identify them | |
4642 adr.reloc() != relocInfo::runtime_call_type ) { | |
4643 return false; | |
4644 } | |
4645 | |
4646 // Stress the correction code | |
4647 if (ForceUnreachable) { | |
4648 // Must be runtimecall reloc, see if it is in the codecache | |
4649 // Flipping stuff in the codecache to be unreachable causes issues | |
4650 // with things like inline caches where the additional instructions | |
4651 // are not handled. | |
4652 if (CodeCache::find_blob(adr._target) == NULL) { | |
4653 return false; | |
4654 } | |
4655 } | |
4656 // For external_word_type/runtime_call_type if it is reachable from where we | |
4657 // are now (possibly a temp buffer) and where we might end up | |
4658 // anywhere in the codeCache then we are always reachable. | |
4659 // This would have to change if we ever save/restore shared code | |
4660 // to be more pessimistic. | |
4661 disp = (int64_t)adr._target - ((int64_t)CodeCache::low_bound() + sizeof(int)); | |
4662 if (!is_simm32(disp)) return false; | |
4663 disp = (int64_t)adr._target - ((int64_t)CodeCache::high_bound() + sizeof(int)); | |
4664 if (!is_simm32(disp)) return false; | |
4665 | |
7198
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
6894
diff
changeset
|
4666 disp = (int64_t)adr._target - ((int64_t)pc() + sizeof(int)); |
304 | 4667 |
4668 // Because rip relative is a disp + address_of_next_instruction and we | |
4669 // don't know the value of address_of_next_instruction we apply a fudge factor | |
4670 // to make sure we will be ok no matter the size of the instruction we get placed into. | |
4671 // We don't have to fudge the checks above here because they are already worst case. | |
4672 | |
4673 // 12 == override/rex byte, opcode byte, rm byte, sib byte, a 4-byte disp , 4-byte literal | |
4674 // + 4 because better safe than sorry. | |
4675 const int fudge = 12 + 4; | |
4676 if (disp < 0) { | |
4677 disp -= fudge; | |
4678 } else { | |
4679 disp += fudge; | |
4680 } | |
4681 return is_simm32(disp); | |
4682 } | |
4683 | |
2404
b40d4fa697bf
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
2357
diff
changeset
|
4684 // Check if the polling page is not reachable from the code cache using rip-relative |
b40d4fa697bf
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
2357
diff
changeset
|
4685 // addressing. |
b40d4fa697bf
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
2357
diff
changeset
|
4686 bool Assembler::is_polling_page_far() { |
b40d4fa697bf
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
2357
diff
changeset
|
4687 intptr_t addr = (intptr_t)os::get_polling_page(); |
4118
59bc0d4d9ea3
7110489: C1: 64-bit tiered with ForceUnreachable: assert(reachable(src)) failed: Address should be reachable
never
parents:
3938
diff
changeset
|
4688 return ForceUnreachable || |
59bc0d4d9ea3
7110489: C1: 64-bit tiered with ForceUnreachable: assert(reachable(src)) failed: Address should be reachable
never
parents:
3938
diff
changeset
|
4689 !is_simm32(addr - (intptr_t)CodeCache::low_bound()) || |
2404
b40d4fa697bf
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
2357
diff
changeset
|
4690 !is_simm32(addr - (intptr_t)CodeCache::high_bound()); |
b40d4fa697bf
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
2357
diff
changeset
|
4691 } |
b40d4fa697bf
6964776: c2 should ensure the polling page is reachable on 64 bit
iveresov
parents:
2357
diff
changeset
|
4692 |
304 | 4693 void Assembler::emit_data64(jlong data, |
4694 relocInfo::relocType rtype, | |
4695 int format) { | |
4696 if (rtype == relocInfo::none) { | |
7198
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
6894
diff
changeset
|
4697 emit_int64(data); |
304 | 4698 } else { |
4699 emit_data64(data, Relocation::spec_simple(rtype), format); | |
4700 } | |
4701 } | |
4702 | |
4703 void Assembler::emit_data64(jlong data, | |
4704 RelocationHolder const& rspec, | |
4705 int format) { | |
4706 assert(imm_operand == 0, "default format must be immediate in this file"); | |
4707 assert(imm_operand == format, "must be immediate"); | |
4708 assert(inst_mark() != NULL, "must be inside InstructionMark"); | |
4709 // Do not use AbstractAssembler::relocate, which is not intended for | |
4710 // embedded words. Instead, relocate to the enclosing instruction. | |
4711 code_section()->relocate(inst_mark(), rspec, format); | |
4712 #ifdef ASSERT | |
4713 check_relocation(rspec, format); | |
4714 #endif | |
7198
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
6894
diff
changeset
|
4715 emit_int64(data); |
304 | 4716 } |
4717 | |
4718 int Assembler::prefix_and_encode(int reg_enc, bool byteinst) { | |
4719 if (reg_enc >= 8) { | |
4720 prefix(REX_B); | |
4721 reg_enc -= 8; | |
4722 } else if (byteinst && reg_enc >= 4) { | |
4723 prefix(REX); | |
4724 } | |
4725 return reg_enc; | |
4726 } | |
4727 | |
4728 int Assembler::prefixq_and_encode(int reg_enc) { | |
4729 if (reg_enc < 8) { | |
4730 prefix(REX_W); | |
4731 } else { | |
4732 prefix(REX_WB); | |
4733 reg_enc -= 8; | |
4734 } | |
4735 return reg_enc; | |
4736 } | |
4737 | |
16064
03eda0a202e9
Better fix for prefix byte for AMD64 byte instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16047
diff
changeset
|
4738 int Assembler::prefix_and_encode(int dst_enc, bool dst_is_byte, int src_enc, bool src_is_byte) { |
304 | 4739 if (dst_enc < 8) { |
4740 if (src_enc >= 8) { | |
4741 prefix(REX_B); | |
4742 src_enc -= 8; | |
16064
03eda0a202e9
Better fix for prefix byte for AMD64 byte instructions
Christian Wimmer <christian.wimmer@oracle.com>
parents:
16047
diff
changeset
|
4743 } else if ((src_is_byte && src_enc >= 4) || (dst_is_byte && dst_enc >= 4)) { |
304 | 4744 prefix(REX); |
4745 } | |
4746 } else { | |
4747 if (src_enc < 8) { | |
4748 prefix(REX_R); | |
4749 } else { | |
4750 prefix(REX_RB); | |
4751 src_enc -= 8; | |
4752 } | |
4753 dst_enc -= 8; | |
4754 } | |
4755 return dst_enc << 3 | src_enc; | |
4756 } | |
4757 | |
4758 int Assembler::prefixq_and_encode(int dst_enc, int src_enc) { | |
4759 if (dst_enc < 8) { | |
4760 if (src_enc < 8) { | |
4761 prefix(REX_W); | |
4762 } else { | |
4763 prefix(REX_WB); | |
4764 src_enc -= 8; | |
4765 } | |
4766 } else { | |
4767 if (src_enc < 8) { | |
4768 prefix(REX_WR); | |
4769 } else { | |
4770 prefix(REX_WRB); | |
4771 src_enc -= 8; | |
4772 } | |
4773 dst_enc -= 8; | |
4774 } | |
4775 return dst_enc << 3 | src_enc; | |
4776 } | |
4777 | |
4778 void Assembler::prefix(Register reg) { | |
4779 if (reg->encoding() >= 8) { | |
4780 prefix(REX_B); | |
4781 } | |
4782 } | |
4783 | |
4784 void Assembler::prefix(Address adr) { | |
4785 if (adr.base_needs_rex()) { | |
4786 if (adr.index_needs_rex()) { | |
4787 prefix(REX_XB); | |
4788 } else { | |
4789 prefix(REX_B); | |
4790 } | |
4791 } else { | |
4792 if (adr.index_needs_rex()) { | |
4793 prefix(REX_X); | |
4794 } | |
4795 } | |
4796 } | |
4797 | |
4798 void Assembler::prefixq(Address adr) { | |
4799 if (adr.base_needs_rex()) { | |
4800 if (adr.index_needs_rex()) { | |
4801 prefix(REX_WXB); | |
4802 } else { | |
4803 prefix(REX_WB); | |
4804 } | |
4805 } else { | |
4806 if (adr.index_needs_rex()) { | |
4807 prefix(REX_WX); | |
4808 } else { | |
4809 prefix(REX_W); | |
4810 } | |
4811 } | |
4812 } | |
4813 | |
4814 | |
4815 void Assembler::prefix(Address adr, Register reg, bool byteinst) { | |
4816 if (reg->encoding() < 8) { | |
4817 if (adr.base_needs_rex()) { | |
4818 if (adr.index_needs_rex()) { | |
4819 prefix(REX_XB); | |
4820 } else { | |
4821 prefix(REX_B); | |
4822 } | |
4823 } else { | |
4824 if (adr.index_needs_rex()) { | |
4825 prefix(REX_X); | |
3855 | 4826 } else if (byteinst && reg->encoding() >= 4 ) { |
304 | 4827 prefix(REX); |
4828 } | |
4829 } | |
4830 } else { | |
4831 if (adr.base_needs_rex()) { | |
4832 if (adr.index_needs_rex()) { | |
4833 prefix(REX_RXB); | |
4834 } else { | |
4835 prefix(REX_RB); | |
4836 } | |
4837 } else { | |
4838 if (adr.index_needs_rex()) { | |
4839 prefix(REX_RX); | |
4840 } else { | |
4841 prefix(REX_R); | |
4842 } | |
4843 } | |
4844 } | |
4845 } | |
4846 | |
4847 void Assembler::prefixq(Address adr, Register src) { | |
4848 if (src->encoding() < 8) { | |
4849 if (adr.base_needs_rex()) { | |
4850 if (adr.index_needs_rex()) { | |
4851 prefix(REX_WXB); | |
4852 } else { | |
4853 prefix(REX_WB); | |
4854 } | |
4855 } else { | |
4856 if (adr.index_needs_rex()) { | |
4857 prefix(REX_WX); | |
4858 } else { | |
4859 prefix(REX_W); | |
4860 } | |
4861 } | |
4862 } else { | |
4863 if (adr.base_needs_rex()) { | |
4864 if (adr.index_needs_rex()) { | |
4865 prefix(REX_WRXB); | |
4866 } else { | |
4867 prefix(REX_WRB); | |
4868 } | |
4869 } else { | |
4870 if (adr.index_needs_rex()) { | |
4871 prefix(REX_WRX); | |
4872 } else { | |
4873 prefix(REX_WR); | |
4874 } | |
4875 } | |
4876 } | |
4877 } | |
4878 | |
4879 void Assembler::prefix(Address adr, XMMRegister reg) { | |
4880 if (reg->encoding() < 8) { | |
4881 if (adr.base_needs_rex()) { | |
4882 if (adr.index_needs_rex()) { | |
4883 prefix(REX_XB); | |
4884 } else { | |
4885 prefix(REX_B); | |
4886 } | |
4887 } else { | |
4888 if (adr.index_needs_rex()) { | |
4889 prefix(REX_X); | |
4890 } | |
4891 } | |
4892 } else { | |
4893 if (adr.base_needs_rex()) { | |
4894 if (adr.index_needs_rex()) { | |
4895 prefix(REX_RXB); | |
4896 } else { | |
4897 prefix(REX_RB); | |
4898 } | |
4899 } else { | |
4900 if (adr.index_needs_rex()) { | |
4901 prefix(REX_RX); | |
4902 } else { | |
4903 prefix(REX_R); | |
4904 } | |
4905 } | |
4906 } | |
4907 } | |
4908 | |
4759 | 4909 void Assembler::prefixq(Address adr, XMMRegister src) { |
4910 if (src->encoding() < 8) { | |
4911 if (adr.base_needs_rex()) { | |
4912 if (adr.index_needs_rex()) { | |
4913 prefix(REX_WXB); | |
4914 } else { | |
4915 prefix(REX_WB); | |
4916 } | |
4917 } else { | |
4918 if (adr.index_needs_rex()) { | |
4919 prefix(REX_WX); | |
4920 } else { | |
4921 prefix(REX_W); | |
4922 } | |
4923 } | |
4924 } else { | |
4925 if (adr.base_needs_rex()) { | |
4926 if (adr.index_needs_rex()) { | |
4927 prefix(REX_WRXB); | |
4928 } else { | |
4929 prefix(REX_WRB); | |
4930 } | |
4931 } else { | |
4932 if (adr.index_needs_rex()) { | |
4933 prefix(REX_WRX); | |
4934 } else { | |
4935 prefix(REX_WR); | |
4936 } | |
4937 } | |
4938 } | |
4939 } | |
4940 | |
304 | 4941 void Assembler::adcq(Register dst, int32_t imm32) { |
4942 (void) prefixq_and_encode(dst->encoding()); | |
4943 emit_arith(0x81, 0xD0, dst, imm32); | |
4944 } | |
4945 | |
4946 void Assembler::adcq(Register dst, Address src) { | |
4947 InstructionMark im(this); | |
4948 prefixq(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4949 emit_int8(0x13); |
304 | 4950 emit_operand(dst, src); |
4951 } | |
4952 | |
4953 void Assembler::adcq(Register dst, Register src) { | |
12329 | 4954 (void) prefixq_and_encode(dst->encoding(), src->encoding()); |
304 | 4955 emit_arith(0x13, 0xC0, dst, src); |
4956 } | |
4957 | |
4958 void Assembler::addq(Address dst, int32_t imm32) { | |
4959 InstructionMark im(this); | |
4960 prefixq(dst); | |
4961 emit_arith_operand(0x81, rax, dst,imm32); | |
4962 } | |
4963 | |
4964 void Assembler::addq(Address dst, Register src) { | |
4965 InstructionMark im(this); | |
4966 prefixq(dst, src); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4967 emit_int8(0x01); |
304 | 4968 emit_operand(src, dst); |
4969 } | |
4970 | |
4971 void Assembler::addq(Register dst, int32_t imm32) { | |
4972 (void) prefixq_and_encode(dst->encoding()); | |
4973 emit_arith(0x81, 0xC0, dst, imm32); | |
4974 } | |
4975 | |
4976 void Assembler::addq(Register dst, Address src) { | |
4977 InstructionMark im(this); | |
4978 prefixq(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
4979 emit_int8(0x03); |
304 | 4980 emit_operand(dst, src); |
4981 } | |
4982 | |
4983 void Assembler::addq(Register dst, Register src) { | |
4984 (void) prefixq_and_encode(dst->encoding(), src->encoding()); | |
4985 emit_arith(0x03, 0xC0, dst, src); | |
4986 } | |
4987 | |
20438
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
4988 void Assembler::adcxq(Register dst, Register src) { |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
4989 //assert(VM_Version::supports_adx(), "adx instructions not supported"); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
4990 emit_int8((unsigned char)0x66); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
4991 int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
4992 emit_int8(0x0F); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
4993 emit_int8(0x38); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
4994 emit_int8((unsigned char)0xF6); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
4995 emit_int8((unsigned char)(0xC0 | encode)); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
4996 } |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
4997 |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
4998 void Assembler::adoxq(Register dst, Register src) { |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
4999 //assert(VM_Version::supports_adx(), "adx instructions not supported"); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5000 emit_int8((unsigned char)0xF3); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5001 int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5002 emit_int8(0x0F); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5003 emit_int8(0x38); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5004 emit_int8((unsigned char)0xF6); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5005 emit_int8((unsigned char)(0xC0 | encode)); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5006 } |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5007 |
3457 | 5008 void Assembler::andq(Address dst, int32_t imm32) { |
5009 InstructionMark im(this); | |
5010 prefixq(dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5011 emit_int8((unsigned char)0x81); |
3457 | 5012 emit_operand(rsp, dst, 4); |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
5013 emit_int32(imm32); |
3457 | 5014 } |
5015 | |
304 | 5016 void Assembler::andq(Register dst, int32_t imm32) { |
5017 (void) prefixq_and_encode(dst->encoding()); | |
5018 emit_arith(0x81, 0xE0, dst, imm32); | |
5019 } | |
5020 | |
5021 void Assembler::andq(Register dst, Address src) { | |
5022 InstructionMark im(this); | |
5023 prefixq(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5024 emit_int8(0x23); |
304 | 5025 emit_operand(dst, src); |
5026 } | |
5027 | |
5028 void Assembler::andq(Register dst, Register src) { | |
12329 | 5029 (void) prefixq_and_encode(dst->encoding(), src->encoding()); |
304 | 5030 emit_arith(0x23, 0xC0, dst, src); |
5031 } | |
5032 | |
14693
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5033 void Assembler::andnq(Register dst, Register src1, Register src2) { |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5034 assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5035 int encode = vex_prefix_0F38_and_encode_q(dst, src1, src2); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5036 emit_int8((unsigned char)0xF2); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5037 emit_int8((unsigned char)(0xC0 | encode)); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5038 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5039 |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5040 void Assembler::andnq(Register dst, Register src1, Address src2) { |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5041 InstructionMark im(this); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5042 assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5043 vex_prefix_0F38_q(dst, src1, src2); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5044 emit_int8((unsigned char)0xF2); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5045 emit_operand(dst, src2); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5046 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5047 |
775
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
5048 void Assembler::bsfq(Register dst, Register src) { |
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
5049 int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5050 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5051 emit_int8((unsigned char)0xBC); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5052 emit_int8((unsigned char)(0xC0 | encode)); |
775
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
5053 } |
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
5054 |
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
5055 void Assembler::bsrq(Register dst, Register src) { |
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
5056 int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5057 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5058 emit_int8((unsigned char)0xBD); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5059 emit_int8((unsigned char)(0xC0 | encode)); |
775
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
5060 } |
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
5061 |
304 | 5062 void Assembler::bswapq(Register reg) { |
5063 int encode = prefixq_and_encode(reg->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5064 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5065 emit_int8((unsigned char)(0xC8 | encode)); |
304 | 5066 } |
5067 | |
14693
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5068 void Assembler::blsiq(Register dst, Register src) { |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5069 assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5070 int encode = vex_prefix_0F38_and_encode_q(rbx, dst, src); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5071 emit_int8((unsigned char)0xF3); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5072 emit_int8((unsigned char)(0xC0 | encode)); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5073 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5074 |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5075 void Assembler::blsiq(Register dst, Address src) { |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5076 InstructionMark im(this); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5077 assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5078 vex_prefix_0F38_q(rbx, dst, src); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5079 emit_int8((unsigned char)0xF3); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5080 emit_operand(rbx, src); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5081 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5082 |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5083 void Assembler::blsmskq(Register dst, Register src) { |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5084 assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5085 int encode = vex_prefix_0F38_and_encode_q(rdx, dst, src); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5086 emit_int8((unsigned char)0xF3); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5087 emit_int8((unsigned char)(0xC0 | encode)); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5088 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5089 |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5090 void Assembler::blsmskq(Register dst, Address src) { |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5091 InstructionMark im(this); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5092 assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5093 vex_prefix_0F38_q(rdx, dst, src); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5094 emit_int8((unsigned char)0xF3); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5095 emit_operand(rdx, src); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5096 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5097 |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5098 void Assembler::blsrq(Register dst, Register src) { |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5099 assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5100 int encode = vex_prefix_0F38_and_encode_q(rcx, dst, src); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5101 emit_int8((unsigned char)0xF3); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5102 emit_int8((unsigned char)(0xC0 | encode)); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5103 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5104 |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5105 void Assembler::blsrq(Register dst, Address src) { |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5106 InstructionMark im(this); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5107 assert(VM_Version::supports_bmi1(), "bit manipulation instructions not supported"); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5108 vex_prefix_0F38_q(rcx, dst, src); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5109 emit_int8((unsigned char)0xF3); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5110 emit_operand(rcx, src); |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5111 } |
9e9af3aa4278
8031321: Support Intel bit manipulation instructions
iveresov
parents:
12972
diff
changeset
|
5112 |
304 | 5113 void Assembler::cdqq() { |
5114 prefix(REX_W); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5115 emit_int8((unsigned char)0x99); |
304 | 5116 } |
5117 | |
5118 void Assembler::clflush(Address adr) { | |
5119 prefix(adr); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5120 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5121 emit_int8((unsigned char)0xAE); |
304 | 5122 emit_operand(rdi, adr); |
5123 } | |
5124 | |
5125 void Assembler::cmovq(Condition cc, Register dst, Register src) { | |
5126 int encode = prefixq_and_encode(dst->encoding(), src->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5127 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5128 emit_int8(0x40 | cc); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5129 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 5130 } |
5131 | |
5132 void Assembler::cmovq(Condition cc, Register dst, Address src) { | |
5133 InstructionMark im(this); | |
5134 prefixq(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5135 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5136 emit_int8(0x40 | cc); |
304 | 5137 emit_operand(dst, src); |
5138 } | |
5139 | |
5140 void Assembler::cmpq(Address dst, int32_t imm32) { | |
5141 InstructionMark im(this); | |
5142 prefixq(dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5143 emit_int8((unsigned char)0x81); |
304 | 5144 emit_operand(rdi, dst, 4); |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
5145 emit_int32(imm32); |
304 | 5146 } |
5147 | |
5148 void Assembler::cmpq(Register dst, int32_t imm32) { | |
5149 (void) prefixq_and_encode(dst->encoding()); | |
5150 emit_arith(0x81, 0xF8, dst, imm32); | |
5151 } | |
5152 | |
5153 void Assembler::cmpq(Address dst, Register src) { | |
5154 InstructionMark im(this); | |
5155 prefixq(dst, src); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5156 emit_int8(0x3B); |
304 | 5157 emit_operand(src, dst); |
5158 } | |
5159 | |
5160 void Assembler::cmpq(Register dst, Register src) { | |
5161 (void) prefixq_and_encode(dst->encoding(), src->encoding()); | |
5162 emit_arith(0x3B, 0xC0, dst, src); | |
5163 } | |
5164 | |
5165 void Assembler::cmpq(Register dst, Address src) { | |
5166 InstructionMark im(this); | |
5167 prefixq(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5168 emit_int8(0x3B); |
304 | 5169 emit_operand(dst, src); |
5170 } | |
5171 | |
5172 void Assembler::cmpxchgq(Register reg, Address adr) { | |
5173 InstructionMark im(this); | |
5174 prefixq(adr, reg); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5175 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5176 emit_int8((unsigned char)0xB1); |
304 | 5177 emit_operand(reg, adr); |
5178 } | |
5179 | |
5180 void Assembler::cvtsi2sdq(XMMRegister dst, Register src) { | |
5181 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
4759 | 5182 int encode = simd_prefix_and_encode_q(dst, dst, src, VEX_SIMD_F2); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5183 emit_int8(0x2A); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5184 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 5185 } |
5186 | |
4759 | 5187 void Assembler::cvtsi2sdq(XMMRegister dst, Address src) { |
5188 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
5189 InstructionMark im(this); | |
5190 simd_prefix_q(dst, dst, src, VEX_SIMD_F2); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5191 emit_int8(0x2A); |
4759 | 5192 emit_operand(dst, src); |
5193 } | |
5194 | |
304 | 5195 void Assembler::cvtsi2ssq(XMMRegister dst, Register src) { |
5196 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
4759 | 5197 int encode = simd_prefix_and_encode_q(dst, dst, src, VEX_SIMD_F3); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5198 emit_int8(0x2A); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5199 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 5200 } |
5201 | |
4759 | 5202 void Assembler::cvtsi2ssq(XMMRegister dst, Address src) { |
5203 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
5204 InstructionMark im(this); | |
5205 simd_prefix_q(dst, dst, src, VEX_SIMD_F3); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5206 emit_int8(0x2A); |
4759 | 5207 emit_operand(dst, src); |
5208 } | |
5209 | |
304 | 5210 void Assembler::cvttsd2siq(Register dst, XMMRegister src) { |
5211 NOT_LP64(assert(VM_Version::supports_sse2(), "")); | |
4759 | 5212 int encode = simd_prefix_and_encode_q(dst, src, VEX_SIMD_F2); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5213 emit_int8(0x2C); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5214 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 5215 } |
5216 | |
5217 void Assembler::cvttss2siq(Register dst, XMMRegister src) { | |
5218 NOT_LP64(assert(VM_Version::supports_sse(), "")); | |
4759 | 5219 int encode = simd_prefix_and_encode_q(dst, src, VEX_SIMD_F3); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5220 emit_int8(0x2C); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5221 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 5222 } |
5223 | |
5224 void Assembler::decl(Register dst) { | |
5225 // Don't use it directly. Use MacroAssembler::decrementl() instead. | |
5226 // Use two-byte form (one-byte form is a REX prefix in 64-bit mode) | |
5227 int encode = prefix_and_encode(dst->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5228 emit_int8((unsigned char)0xFF); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5229 emit_int8((unsigned char)(0xC8 | encode)); |
304 | 5230 } |
5231 | |
5232 void Assembler::decq(Register dst) { | |
5233 // Don't use it directly. Use MacroAssembler::decrementq() instead. | |
5234 // Use two-byte form (one-byte from is a REX prefix in 64-bit mode) | |
5235 int encode = prefixq_and_encode(dst->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5236 emit_int8((unsigned char)0xFF); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5237 emit_int8(0xC8 | encode); |
304 | 5238 } |
5239 | |
5240 void Assembler::decq(Address dst) { | |
5241 // Don't use it directly. Use MacroAssembler::decrementq() instead. | |
5242 InstructionMark im(this); | |
5243 prefixq(dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5244 emit_int8((unsigned char)0xFF); |
304 | 5245 emit_operand(rcx, dst); |
5246 } | |
5247 | |
5248 void Assembler::fxrstor(Address src) { | |
5249 prefixq(src); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5250 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5251 emit_int8((unsigned char)0xAE); |
304 | 5252 emit_operand(as_Register(1), src); |
5253 } | |
5254 | |
5255 void Assembler::fxsave(Address dst) { | |
5256 prefixq(dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5257 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5258 emit_int8((unsigned char)0xAE); |
304 | 5259 emit_operand(as_Register(0), dst); |
5260 } | |
5261 | |
5262 void Assembler::idivq(Register src) { | |
5263 int encode = prefixq_and_encode(src->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5264 emit_int8((unsigned char)0xF7); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5265 emit_int8((unsigned char)(0xF8 | encode)); |
304 | 5266 } |
5267 | |
5268 void Assembler::imulq(Register dst, Register src) { | |
5269 int encode = prefixq_and_encode(dst->encoding(), src->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5270 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5271 emit_int8((unsigned char)0xAF); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5272 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 5273 } |
5274 | |
5275 void Assembler::imulq(Register dst, Register src, int value) { | |
5276 int encode = prefixq_and_encode(dst->encoding(), src->encoding()); | |
5277 if (is8bit(value)) { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5278 emit_int8(0x6B); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5279 emit_int8((unsigned char)(0xC0 | encode)); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5280 emit_int8(value & 0xFF); |
304 | 5281 } else { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5282 emit_int8(0x69); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5283 emit_int8((unsigned char)(0xC0 | encode)); |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
5284 emit_int32(value); |
304 | 5285 } |
5286 } | |
5287 | |
12972
59e8ad757e19
8026844: Various Math functions needs intrinsification
rbackman
parents:
12329
diff
changeset
|
5288 void Assembler::imulq(Register dst, Address src) { |
59e8ad757e19
8026844: Various Math functions needs intrinsification
rbackman
parents:
12329
diff
changeset
|
5289 InstructionMark im(this); |
59e8ad757e19
8026844: Various Math functions needs intrinsification
rbackman
parents:
12329
diff
changeset
|
5290 prefixq(src, dst); |
59e8ad757e19
8026844: Various Math functions needs intrinsification
rbackman
parents:
12329
diff
changeset
|
5291 emit_int8(0x0F); |
59e8ad757e19
8026844: Various Math functions needs intrinsification
rbackman
parents:
12329
diff
changeset
|
5292 emit_int8((unsigned char) 0xAF); |
59e8ad757e19
8026844: Various Math functions needs intrinsification
rbackman
parents:
12329
diff
changeset
|
5293 emit_operand(dst, src); |
59e8ad757e19
8026844: Various Math functions needs intrinsification
rbackman
parents:
12329
diff
changeset
|
5294 } |
59e8ad757e19
8026844: Various Math functions needs intrinsification
rbackman
parents:
12329
diff
changeset
|
5295 |
304 | 5296 void Assembler::incl(Register dst) { |
5297 // Don't use it directly. Use MacroAssembler::incrementl() instead. | |
5298 // Use two-byte form (one-byte from is a REX prefix in 64-bit mode) | |
5299 int encode = prefix_and_encode(dst->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5300 emit_int8((unsigned char)0xFF); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5301 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 5302 } |
5303 | |
5304 void Assembler::incq(Register dst) { | |
5305 // Don't use it directly. Use MacroAssembler::incrementq() instead. | |
5306 // Use two-byte form (one-byte from is a REX prefix in 64-bit mode) | |
5307 int encode = prefixq_and_encode(dst->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5308 emit_int8((unsigned char)0xFF); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5309 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 5310 } |
5311 | |
5312 void Assembler::incq(Address dst) { | |
5313 // Don't use it directly. Use MacroAssembler::incrementq() instead. | |
5314 InstructionMark im(this); | |
5315 prefixq(dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5316 emit_int8((unsigned char)0xFF); |
304 | 5317 emit_operand(rax, dst); |
5318 } | |
5319 | |
5320 void Assembler::lea(Register dst, Address src) { | |
5321 leaq(dst, src); | |
5322 } | |
5323 | |
5324 void Assembler::leaq(Register dst, Address src) { | |
5325 InstructionMark im(this); | |
5326 prefixq(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5327 emit_int8((unsigned char)0x8D); |
304 | 5328 emit_operand(dst, src); |
5329 } | |
5330 | |
5331 void Assembler::mov64(Register dst, int64_t imm64) { | |
5332 InstructionMark im(this); | |
5333 int encode = prefixq_and_encode(dst->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5334 emit_int8((unsigned char)(0xB8 | encode)); |
7198
6ab62ad83507
8003195: AbstractAssembler should not store code pointers but use the CodeSection directly
twisti
parents:
6894
diff
changeset
|
5335 emit_int64(imm64); |
304 | 5336 } |
5337 | |
5338 void Assembler::mov_literal64(Register dst, intptr_t imm64, RelocationHolder const& rspec) { | |
5339 InstructionMark im(this); | |
5340 int encode = prefixq_and_encode(dst->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5341 emit_int8(0xB8 | encode); |
304 | 5342 emit_data64(imm64, rspec); |
5343 } | |
5344 | |
642
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5345 void Assembler::mov_narrow_oop(Register dst, int32_t imm32, RelocationHolder const& rspec) { |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5346 InstructionMark im(this); |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5347 int encode = prefix_and_encode(dst->encoding()); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5348 emit_int8((unsigned char)(0xB8 | encode)); |
642
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5349 emit_data((int)imm32, rspec, narrow_oop_operand); |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5350 } |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5351 |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5352 void Assembler::mov_narrow_oop(Address dst, int32_t imm32, RelocationHolder const& rspec) { |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5353 InstructionMark im(this); |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5354 prefix(dst); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5355 emit_int8((unsigned char)0xC7); |
642
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5356 emit_operand(rax, dst, 4); |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5357 emit_data((int)imm32, rspec, narrow_oop_operand); |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5358 } |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5359 |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5360 void Assembler::cmp_narrow_oop(Register src1, int32_t imm32, RelocationHolder const& rspec) { |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5361 InstructionMark im(this); |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5362 int encode = prefix_and_encode(src1->encoding()); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5363 emit_int8((unsigned char)0x81); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5364 emit_int8((unsigned char)(0xF8 | encode)); |
642
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5365 emit_data((int)imm32, rspec, narrow_oop_operand); |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5366 } |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5367 |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5368 void Assembler::cmp_narrow_oop(Address src1, int32_t imm32, RelocationHolder const& rspec) { |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5369 InstructionMark im(this); |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5370 prefix(src1); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5371 emit_int8((unsigned char)0x81); |
642
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5372 emit_operand(rax, src1, 4); |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5373 emit_data((int)imm32, rspec, narrow_oop_operand); |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5374 } |
660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
kvn
parents:
624
diff
changeset
|
5375 |
775
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
5376 void Assembler::lzcntq(Register dst, Register src) { |
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
5377 assert(VM_Version::supports_lzcnt(), "encoding is treated as BSR"); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5378 emit_int8((unsigned char)0xF3); |
775
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
5379 int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5380 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5381 emit_int8((unsigned char)0xBD); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5382 emit_int8((unsigned char)(0xC0 | encode)); |
775
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
5383 } |
93c14e5562c4
6823354: Add intrinsics for {Integer,Long}.{numberOfLeadingZeros,numberOfTrailingZeros}()
twisti
parents:
710
diff
changeset
|
5384 |
304 | 5385 void Assembler::movdq(XMMRegister dst, Register src) { |
5386 // table D-1 says MMX/SSE2 | |
4759 | 5387 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
5388 int encode = simd_prefix_and_encode_q(dst, src, VEX_SIMD_66); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5389 emit_int8(0x6E); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5390 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 5391 } |
5392 | |
5393 void Assembler::movdq(Register dst, XMMRegister src) { | |
5394 // table D-1 says MMX/SSE2 | |
4759 | 5395 NOT_LP64(assert(VM_Version::supports_sse2(), "")); |
304 | 5396 // swap src/dst to get correct prefix |
4759 | 5397 int encode = simd_prefix_and_encode_q(src, dst, VEX_SIMD_66); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5398 emit_int8(0x7E); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5399 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 5400 } |
5401 | |
5402 void Assembler::movq(Register dst, Register src) { | |
5403 int encode = prefixq_and_encode(dst->encoding(), src->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5404 emit_int8((unsigned char)0x8B); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5405 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 5406 } |
5407 | |
5408 void Assembler::movq(Register dst, Address src) { | |
5409 InstructionMark im(this); | |
5410 prefixq(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5411 emit_int8((unsigned char)0x8B); |
304 | 5412 emit_operand(dst, src); |
5413 } | |
5414 | |
5415 void Assembler::movq(Address dst, Register src) { | |
5416 InstructionMark im(this); | |
5417 prefixq(dst, src); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5418 emit_int8((unsigned char)0x89); |
304 | 5419 emit_operand(src, dst); |
5420 } | |
5421 | |
624 | 5422 void Assembler::movsbq(Register dst, Address src) { |
5423 InstructionMark im(this); | |
5424 prefixq(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5425 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5426 emit_int8((unsigned char)0xBE); |
624 | 5427 emit_operand(dst, src); |
5428 } | |
5429 | |
5430 void Assembler::movsbq(Register dst, Register src) { | |
5431 int encode = prefixq_and_encode(dst->encoding(), src->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5432 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5433 emit_int8((unsigned char)0xBE); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5434 emit_int8((unsigned char)(0xC0 | encode)); |
624 | 5435 } |
5436 | |
304 | 5437 void Assembler::movslq(Register dst, int32_t imm32) { |
5438 // dbx shows movslq(rcx, 3) as movq $0x0000000049000000,(%rbx) | |
5439 // and movslq(r8, 3); as movl $0x0000000048000000,(%rbx) | |
5440 // as a result we shouldn't use until tested at runtime... | |
5441 ShouldNotReachHere(); | |
5442 InstructionMark im(this); | |
5443 int encode = prefixq_and_encode(dst->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5444 emit_int8((unsigned char)(0xC7 | encode)); |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
5445 emit_int32(imm32); |
304 | 5446 } |
5447 | |
5448 void Assembler::movslq(Address dst, int32_t imm32) { | |
5449 assert(is_simm32(imm32), "lost bits"); | |
5450 InstructionMark im(this); | |
5451 prefixq(dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5452 emit_int8((unsigned char)0xC7); |
304 | 5453 emit_operand(rax, dst, 4); |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
5454 emit_int32(imm32); |
304 | 5455 } |
5456 | |
5457 void Assembler::movslq(Register dst, Address src) { | |
5458 InstructionMark im(this); | |
5459 prefixq(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5460 emit_int8(0x63); |
304 | 5461 emit_operand(dst, src); |
5462 } | |
5463 | |
5464 void Assembler::movslq(Register dst, Register src) { | |
5465 int encode = prefixq_and_encode(dst->encoding(), src->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5466 emit_int8(0x63); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5467 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 5468 } |
5469 | |
624 | 5470 void Assembler::movswq(Register dst, Address src) { |
5471 InstructionMark im(this); | |
5472 prefixq(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5473 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5474 emit_int8((unsigned char)0xBF); |
624 | 5475 emit_operand(dst, src); |
5476 } | |
5477 | |
5478 void Assembler::movswq(Register dst, Register src) { | |
5479 int encode = prefixq_and_encode(dst->encoding(), src->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5480 emit_int8((unsigned char)0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5481 emit_int8((unsigned char)0xBF); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5482 emit_int8((unsigned char)(0xC0 | encode)); |
624 | 5483 } |
5484 | |
5485 void Assembler::movzbq(Register dst, Address src) { | |
5486 InstructionMark im(this); | |
5487 prefixq(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5488 emit_int8((unsigned char)0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5489 emit_int8((unsigned char)0xB6); |
624 | 5490 emit_operand(dst, src); |
5491 } | |
5492 | |
5493 void Assembler::movzbq(Register dst, Register src) { | |
5494 int encode = prefixq_and_encode(dst->encoding(), src->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5495 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5496 emit_int8((unsigned char)0xB6); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5497 emit_int8(0xC0 | encode); |
624 | 5498 } |
5499 | |
5500 void Assembler::movzwq(Register dst, Address src) { | |
5501 InstructionMark im(this); | |
5502 prefixq(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5503 emit_int8((unsigned char)0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5504 emit_int8((unsigned char)0xB7); |
624 | 5505 emit_operand(dst, src); |
5506 } | |
5507 | |
5508 void Assembler::movzwq(Register dst, Register src) { | |
5509 int encode = prefixq_and_encode(dst->encoding(), src->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5510 emit_int8((unsigned char)0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5511 emit_int8((unsigned char)0xB7); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5512 emit_int8((unsigned char)(0xC0 | encode)); |
624 | 5513 } |
5514 | |
20438
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5515 void Assembler::mulq(Address src) { |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5516 InstructionMark im(this); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5517 prefixq(src); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5518 emit_int8((unsigned char)0xF7); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5519 emit_operand(rsp, src); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5520 } |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5521 |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5522 void Assembler::mulq(Register src) { |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5523 int encode = prefixq_and_encode(src->encoding()); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5524 emit_int8((unsigned char)0xF7); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5525 emit_int8((unsigned char)(0xE0 | encode)); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5526 } |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5527 |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5528 void Assembler::mulxq(Register dst1, Register dst2, Register src) { |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5529 assert(VM_Version::supports_bmi2(), "bit manipulation instructions not supported"); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5530 int encode = vex_prefix_and_encode(dst1->encoding(), dst2->encoding(), src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F_38, true, false); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5531 emit_int8((unsigned char)0xF6); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5532 emit_int8((unsigned char)(0xC0 | encode)); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5533 } |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5534 |
304 | 5535 void Assembler::negq(Register dst) { |
5536 int encode = prefixq_and_encode(dst->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5537 emit_int8((unsigned char)0xF7); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5538 emit_int8((unsigned char)(0xD8 | encode)); |
304 | 5539 } |
5540 | |
5541 void Assembler::notq(Register dst) { | |
5542 int encode = prefixq_and_encode(dst->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5543 emit_int8((unsigned char)0xF7); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5544 emit_int8((unsigned char)(0xD0 | encode)); |
304 | 5545 } |
5546 | |
5547 void Assembler::orq(Address dst, int32_t imm32) { | |
5548 InstructionMark im(this); | |
5549 prefixq(dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5550 emit_int8((unsigned char)0x81); |
304 | 5551 emit_operand(rcx, dst, 4); |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
5552 emit_int32(imm32); |
304 | 5553 } |
5554 | |
5555 void Assembler::orq(Register dst, int32_t imm32) { | |
5556 (void) prefixq_and_encode(dst->encoding()); | |
5557 emit_arith(0x81, 0xC8, dst, imm32); | |
5558 } | |
5559 | |
5560 void Assembler::orq(Register dst, Address src) { | |
5561 InstructionMark im(this); | |
5562 prefixq(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5563 emit_int8(0x0B); |
304 | 5564 emit_operand(dst, src); |
5565 } | |
5566 | |
5567 void Assembler::orq(Register dst, Register src) { | |
5568 (void) prefixq_and_encode(dst->encoding(), src->encoding()); | |
5569 emit_arith(0x0B, 0xC0, dst, src); | |
5570 } | |
5571 | |
5572 void Assembler::popa() { // 64bit | |
5573 movq(r15, Address(rsp, 0)); | |
5574 movq(r14, Address(rsp, wordSize)); | |
5575 movq(r13, Address(rsp, 2 * wordSize)); | |
5576 movq(r12, Address(rsp, 3 * wordSize)); | |
5577 movq(r11, Address(rsp, 4 * wordSize)); | |
5578 movq(r10, Address(rsp, 5 * wordSize)); | |
5579 movq(r9, Address(rsp, 6 * wordSize)); | |
5580 movq(r8, Address(rsp, 7 * wordSize)); | |
5581 movq(rdi, Address(rsp, 8 * wordSize)); | |
5582 movq(rsi, Address(rsp, 9 * wordSize)); | |
5583 movq(rbp, Address(rsp, 10 * wordSize)); | |
5584 // skip rsp | |
5585 movq(rbx, Address(rsp, 12 * wordSize)); | |
5586 movq(rdx, Address(rsp, 13 * wordSize)); | |
5587 movq(rcx, Address(rsp, 14 * wordSize)); | |
5588 movq(rax, Address(rsp, 15 * wordSize)); | |
5589 | |
5590 addq(rsp, 16 * wordSize); | |
5591 } | |
5592 | |
643
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
5593 void Assembler::popcntq(Register dst, Address src) { |
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
5594 assert(VM_Version::supports_popcnt(), "must support"); |
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
5595 InstructionMark im(this); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5596 emit_int8((unsigned char)0xF3); |
643
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
5597 prefixq(src, dst); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5598 emit_int8((unsigned char)0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5599 emit_int8((unsigned char)0xB8); |
643
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
5600 emit_operand(dst, src); |
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
5601 } |
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
5602 |
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
5603 void Assembler::popcntq(Register dst, Register src) { |
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
5604 assert(VM_Version::supports_popcnt(), "must support"); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5605 emit_int8((unsigned char)0xF3); |
643
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
5606 int encode = prefixq_and_encode(dst->encoding(), src->encoding()); |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5607 emit_int8((unsigned char)0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5608 emit_int8((unsigned char)0xB8); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5609 emit_int8((unsigned char)(0xC0 | encode)); |
643
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
5610 } |
c771b7f43bbf
6378821: bitCount() should use POPC on SPARC processors and AMD+10h
twisti
parents:
642
diff
changeset
|
5611 |
304 | 5612 void Assembler::popq(Address dst) { |
5613 InstructionMark im(this); | |
5614 prefixq(dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5615 emit_int8((unsigned char)0x8F); |
304 | 5616 emit_operand(rax, dst); |
5617 } | |
5618 | |
5619 void Assembler::pusha() { // 64bit | |
5620 // we have to store original rsp. ABI says that 128 bytes | |
5621 // below rsp are local scratch. | |
5622 movq(Address(rsp, -5 * wordSize), rsp); | |
5623 | |
5624 subq(rsp, 16 * wordSize); | |
5625 | |
5626 movq(Address(rsp, 15 * wordSize), rax); | |
5627 movq(Address(rsp, 14 * wordSize), rcx); | |
5628 movq(Address(rsp, 13 * wordSize), rdx); | |
5629 movq(Address(rsp, 12 * wordSize), rbx); | |
5630 // skip rsp | |
5631 movq(Address(rsp, 10 * wordSize), rbp); | |
5632 movq(Address(rsp, 9 * wordSize), rsi); | |
5633 movq(Address(rsp, 8 * wordSize), rdi); | |
5634 movq(Address(rsp, 7 * wordSize), r8); | |
5635 movq(Address(rsp, 6 * wordSize), r9); | |
5636 movq(Address(rsp, 5 * wordSize), r10); | |
5637 movq(Address(rsp, 4 * wordSize), r11); | |
5638 movq(Address(rsp, 3 * wordSize), r12); | |
5639 movq(Address(rsp, 2 * wordSize), r13); | |
5640 movq(Address(rsp, wordSize), r14); | |
5641 movq(Address(rsp, 0), r15); | |
5642 } | |
5643 | |
5644 void Assembler::pushq(Address src) { | |
5645 InstructionMark im(this); | |
5646 prefixq(src); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5647 emit_int8((unsigned char)0xFF); |
304 | 5648 emit_operand(rsi, src); |
5649 } | |
5650 | |
5651 void Assembler::rclq(Register dst, int imm8) { | |
5652 assert(isShiftCount(imm8 >> 1), "illegal shift count"); | |
5653 int encode = prefixq_and_encode(dst->encoding()); | |
5654 if (imm8 == 1) { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5655 emit_int8((unsigned char)0xD1); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5656 emit_int8((unsigned char)(0xD0 | encode)); |
304 | 5657 } else { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5658 emit_int8((unsigned char)0xC1); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5659 emit_int8((unsigned char)(0xD0 | encode)); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5660 emit_int8(imm8); |
304 | 5661 } |
5662 } | |
20438
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5663 |
23813
daaf806995b3
8081778: Use Intel x64 CPU instructions for RSA acceleration
igerasim
parents:
20438
diff
changeset
|
5664 void Assembler::rcrq(Register dst, int imm8) { |
daaf806995b3
8081778: Use Intel x64 CPU instructions for RSA acceleration
igerasim
parents:
20438
diff
changeset
|
5665 assert(isShiftCount(imm8 >> 1), "illegal shift count"); |
daaf806995b3
8081778: Use Intel x64 CPU instructions for RSA acceleration
igerasim
parents:
20438
diff
changeset
|
5666 int encode = prefixq_and_encode(dst->encoding()); |
daaf806995b3
8081778: Use Intel x64 CPU instructions for RSA acceleration
igerasim
parents:
20438
diff
changeset
|
5667 if (imm8 == 1) { |
daaf806995b3
8081778: Use Intel x64 CPU instructions for RSA acceleration
igerasim
parents:
20438
diff
changeset
|
5668 emit_int8((unsigned char)0xD1); |
daaf806995b3
8081778: Use Intel x64 CPU instructions for RSA acceleration
igerasim
parents:
20438
diff
changeset
|
5669 emit_int8((unsigned char)(0xD8 | encode)); |
daaf806995b3
8081778: Use Intel x64 CPU instructions for RSA acceleration
igerasim
parents:
20438
diff
changeset
|
5670 } else { |
daaf806995b3
8081778: Use Intel x64 CPU instructions for RSA acceleration
igerasim
parents:
20438
diff
changeset
|
5671 emit_int8((unsigned char)0xC1); |
daaf806995b3
8081778: Use Intel x64 CPU instructions for RSA acceleration
igerasim
parents:
20438
diff
changeset
|
5672 emit_int8((unsigned char)(0xD8 | encode)); |
daaf806995b3
8081778: Use Intel x64 CPU instructions for RSA acceleration
igerasim
parents:
20438
diff
changeset
|
5673 emit_int8(imm8); |
daaf806995b3
8081778: Use Intel x64 CPU instructions for RSA acceleration
igerasim
parents:
20438
diff
changeset
|
5674 } |
daaf806995b3
8081778: Use Intel x64 CPU instructions for RSA acceleration
igerasim
parents:
20438
diff
changeset
|
5675 } |
daaf806995b3
8081778: Use Intel x64 CPU instructions for RSA acceleration
igerasim
parents:
20438
diff
changeset
|
5676 |
20438
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5677 void Assembler::rorq(Register dst, int imm8) { |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5678 assert(isShiftCount(imm8 >> 1), "illegal shift count"); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5679 int encode = prefixq_and_encode(dst->encoding()); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5680 if (imm8 == 1) { |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5681 emit_int8((unsigned char)0xD1); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5682 emit_int8((unsigned char)(0xC8 | encode)); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5683 } else { |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5684 emit_int8((unsigned char)0xC1); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5685 emit_int8((unsigned char)(0xc8 | encode)); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5686 emit_int8(imm8); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5687 } |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5688 } |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5689 |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5690 void Assembler::rorxq(Register dst, Register src, int imm8) { |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5691 assert(VM_Version::supports_bmi2(), "bit manipulation instructions not supported"); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5692 int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F_3A, true, false); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5693 emit_int8((unsigned char)0xF0); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5694 emit_int8((unsigned char)(0xC0 | encode)); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5695 emit_int8(imm8); |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5696 } |
166d744df0de
8055494: Add C2 x86 intrinsic for BigInteger::multiplyToLen() method
kvn
parents:
20311
diff
changeset
|
5697 |
304 | 5698 void Assembler::sarq(Register dst, int imm8) { |
5699 assert(isShiftCount(imm8 >> 1), "illegal shift count"); | |
5700 int encode = prefixq_and_encode(dst->encoding()); | |
5701 if (imm8 == 1) { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5702 emit_int8((unsigned char)0xD1); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5703 emit_int8((unsigned char)(0xF8 | encode)); |
304 | 5704 } else { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5705 emit_int8((unsigned char)0xC1); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5706 emit_int8((unsigned char)(0xF8 | encode)); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5707 emit_int8(imm8); |
304 | 5708 } |
5709 } | |
5710 | |
5711 void Assembler::sarq(Register dst) { | |
5712 int encode = prefixq_and_encode(dst->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5713 emit_int8((unsigned char)0xD3); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5714 emit_int8((unsigned char)(0xF8 | encode)); |
304 | 5715 } |
2100
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
5716 |
304 | 5717 void Assembler::sbbq(Address dst, int32_t imm32) { |
5718 InstructionMark im(this); | |
5719 prefixq(dst); | |
5720 emit_arith_operand(0x81, rbx, dst, imm32); | |
5721 } | |
5722 | |
5723 void Assembler::sbbq(Register dst, int32_t imm32) { | |
5724 (void) prefixq_and_encode(dst->encoding()); | |
5725 emit_arith(0x81, 0xD8, dst, imm32); | |
5726 } | |
5727 | |
5728 void Assembler::sbbq(Register dst, Address src) { | |
5729 InstructionMark im(this); | |
5730 prefixq(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5731 emit_int8(0x1B); |
304 | 5732 emit_operand(dst, src); |
5733 } | |
5734 | |
5735 void Assembler::sbbq(Register dst, Register src) { | |
5736 (void) prefixq_and_encode(dst->encoding(), src->encoding()); | |
5737 emit_arith(0x1B, 0xC0, dst, src); | |
5738 } | |
5739 | |
5740 void Assembler::shlq(Register dst, int imm8) { | |
5741 assert(isShiftCount(imm8 >> 1), "illegal shift count"); | |
5742 int encode = prefixq_and_encode(dst->encoding()); | |
5743 if (imm8 == 1) { | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5744 emit_int8((unsigned char)0xD1); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5745 emit_int8((unsigned char)(0xE0 | encode)); |
304 | 5746 } else { |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5747 emit_int8((unsigned char)0xC1); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5748 emit_int8((unsigned char)(0xE0 | encode)); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5749 emit_int8(imm8); |
304 | 5750 } |
5751 } | |
5752 | |
5753 void Assembler::shlq(Register dst) { | |
5754 int encode = prefixq_and_encode(dst->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5755 emit_int8((unsigned char)0xD3); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5756 emit_int8((unsigned char)(0xE0 | encode)); |
304 | 5757 } |
5758 | |
5759 void Assembler::shrq(Register dst, int imm8) { | |
5760 assert(isShiftCount(imm8 >> 1), "illegal shift count"); | |
5761 int encode = prefixq_and_encode(dst->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5762 emit_int8((unsigned char)0xC1); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5763 emit_int8((unsigned char)(0xE8 | encode)); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5764 emit_int8(imm8); |
304 | 5765 } |
5766 | |
5767 void Assembler::shrq(Register dst) { | |
5768 int encode = prefixq_and_encode(dst->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5769 emit_int8((unsigned char)0xD3); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5770 emit_int8(0xE8 | encode); |
304 | 5771 } |
5772 | |
5773 void Assembler::subq(Address dst, int32_t imm32) { | |
5774 InstructionMark im(this); | |
5775 prefixq(dst); | |
2100
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
5776 emit_arith_operand(0x81, rbp, dst, imm32); |
304 | 5777 } |
5778 | |
5779 void Assembler::subq(Address dst, Register src) { | |
5780 InstructionMark im(this); | |
5781 prefixq(dst, src); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5782 emit_int8(0x29); |
304 | 5783 emit_operand(src, dst); |
5784 } | |
5785 | |
2100
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
5786 void Assembler::subq(Register dst, int32_t imm32) { |
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
5787 (void) prefixq_and_encode(dst->encoding()); |
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
5788 emit_arith(0x81, 0xE8, dst, imm32); |
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
5789 } |
b1a2afa37ec4
7003271: Hotspot should track cumulative Java heap bytes allocated on a per-thread basis
phh
parents:
2014
diff
changeset
|
5790 |
4947
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
5791 // Force generation of a 4 byte immediate value even if it fits into 8bit |
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
5792 void Assembler::subq_imm32(Register dst, int32_t imm32) { |
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
5793 (void) prefixq_and_encode(dst->encoding()); |
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
5794 emit_arith_imm32(0x81, 0xE8, dst, imm32); |
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
5795 } |
fd8114661503
7125136: SIGILL on linux amd64 in gc/ArrayJuggle/Juggle29
kvn
parents:
4770
diff
changeset
|
5796 |
304 | 5797 void Assembler::subq(Register dst, Address src) { |
5798 InstructionMark im(this); | |
5799 prefixq(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5800 emit_int8(0x2B); |
304 | 5801 emit_operand(dst, src); |
5802 } | |
5803 | |
5804 void Assembler::subq(Register dst, Register src) { | |
5805 (void) prefixq_and_encode(dst->encoding(), src->encoding()); | |
5806 emit_arith(0x2B, 0xC0, dst, src); | |
5807 } | |
5808 | |
5809 void Assembler::testq(Register dst, int32_t imm32) { | |
5810 // not using emit_arith because test | |
5811 // doesn't support sign-extension of | |
5812 // 8bit operands | |
5813 int encode = dst->encoding(); | |
5814 if (encode == 0) { | |
5815 prefix(REX_W); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5816 emit_int8((unsigned char)0xA9); |
304 | 5817 } else { |
5818 encode = prefixq_and_encode(encode); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5819 emit_int8((unsigned char)0xF7); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5820 emit_int8((unsigned char)(0xC0 | encode)); |
304 | 5821 } |
7476
ffa87474d7a4
8004537: replace AbstractAssembler emit_long with emit_int32
twisti
parents:
7475
diff
changeset
|
5822 emit_int32(imm32); |
304 | 5823 } |
5824 | |
5825 void Assembler::testq(Register dst, Register src) { | |
5826 (void) prefixq_and_encode(dst->encoding(), src->encoding()); | |
5827 emit_arith(0x85, 0xC0, dst, src); | |
5828 } | |
5829 | |
5830 void Assembler::xaddq(Address dst, Register src) { | |
5831 InstructionMark im(this); | |
5832 prefixq(dst, src); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5833 emit_int8(0x0F); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5834 emit_int8((unsigned char)0xC1); |
304 | 5835 emit_operand(src, dst); |
5836 } | |
5837 | |
5838 void Assembler::xchgq(Register dst, Address src) { | |
5839 InstructionMark im(this); | |
5840 prefixq(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5841 emit_int8((unsigned char)0x87); |
304 | 5842 emit_operand(dst, src); |
5843 } | |
5844 | |
5845 void Assembler::xchgq(Register dst, Register src) { | |
5846 int encode = prefixq_and_encode(dst->encoding(), src->encoding()); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5847 emit_int8((unsigned char)0x87); |
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5848 emit_int8((unsigned char)(0xc0 | encode)); |
304 | 5849 } |
5850 | |
5851 void Assembler::xorq(Register dst, Register src) { | |
5852 (void) prefixq_and_encode(dst->encoding(), src->encoding()); | |
5853 emit_arith(0x33, 0xC0, dst, src); | |
5854 } | |
5855 | |
5856 void Assembler::xorq(Register dst, Address src) { | |
5857 InstructionMark im(this); | |
5858 prefixq(src, dst); | |
7430
d02120b7a34f
8004250: replace AbstractAssembler a_byte/a_long with emit_int8/emit_int32
twisti
parents:
7427
diff
changeset
|
5859 emit_int8(0x33); |
304 | 5860 emit_operand(dst, src); |
5861 } | |
5862 | |
5863 #endif // !LP64 |