blob: 7f9a6332ac1d6cd6722a94c1ac78c97de6a3c585 [file] [log] [blame]
erik.corry@gmail.comc3b670f2011-10-05 21:44:48 +00001// Copyright 2011 the V8 project authors. All rights reserved.
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +00002// Redistribution and use in source and binary forms, with or without
3// modification, are permitted provided that the following conditions are
4// met:
5//
6// * Redistributions of source code must retain the above copyright
7// notice, this list of conditions and the following disclaimer.
8// * Redistributions in binary form must reproduce the above
9// copyright notice, this list of conditions and the following
10// disclaimer in the documentation and/or other materials provided
11// with the distribution.
12// * Neither the name of Google Inc. nor the names of its
13// contributors may be used to endorse or promote products derived
14// from this software without specific prior written permission.
15//
16// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28#include <stdlib.h>
29
30#include "v8.h"
31
32#include "debug.h"
33#include "disasm.h"
34#include "disassembler.h"
35#include "macro-assembler.h"
36#include "serialize.h"
37#include "cctest.h"
38
39using namespace v8::internal;
40
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +000041
42#define __ assm.
43
44
45static void DummyStaticFunction(Object* result) {
46}
47
48
49TEST(DisasmIa320) {
mstarzinger@chromium.orge27d6172013-04-17 11:51:44 +000050 CcTest::InitializeVM();
51 Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
svenpanne@chromium.org2bda5432013-03-15 12:39:50 +000052 HandleScope scope(isolate);
fschneider@chromium.org0c20e672010-01-14 15:28:53 +000053 v8::internal::byte buffer[2048];
svenpanne@chromium.org2bda5432013-03-15 12:39:50 +000054 Assembler assm(isolate, buffer, sizeof buffer);
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +000055 DummyStaticFunction(NULL); // just bloody use it (DELETE; debugging)
56
57 // Short immediate instructions
58 __ adc(eax, 12345678);
erik.corry@gmail.comc3b670f2011-10-05 21:44:48 +000059 __ add(eax, Immediate(12345678));
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +000060 __ or_(eax, 12345678);
erik.corry@gmail.comc3b670f2011-10-05 21:44:48 +000061 __ sub(eax, Immediate(12345678));
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +000062 __ xor_(eax, 12345678);
63 __ and_(eax, 12345678);
verwaest@chromium.orgd4be0f02013-06-05 13:39:03 +000064 Handle<FixedArray> foo = isolate->factory()->NewFixedArray(10, TENURED);
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +000065 __ cmp(eax, foo);
66
67 // ---- This one caused crash
68 __ mov(ebx, Operand(esp, ecx, times_2, 0)); // [esp+ecx*4]
69
70 // ---- All instructions that I can think of
erik.corry@gmail.comc3b670f2011-10-05 21:44:48 +000071 __ add(edx, ebx);
jkummerow@chromium.org59297c72013-01-09 16:32:23 +000072 __ add(edx, Operand(12, RelocInfo::NONE32));
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +000073 __ add(edx, Operand(ebx, 0));
74 __ add(edx, Operand(ebx, 16));
75 __ add(edx, Operand(ebx, 1999));
76 __ add(edx, Operand(esp, 0));
77 __ add(edx, Operand(esp, 16));
78 __ add(edx, Operand(esp, 1999));
79 __ nop();
80 __ add(edi, Operand(ebp, ecx, times_4, 0));
81 __ add(edi, Operand(ebp, ecx, times_4, 12));
82 __ add(Operand(ebp, ecx, times_4, 12), Immediate(12));
83
84 __ nop();
erik.corry@gmail.comc3b670f2011-10-05 21:44:48 +000085 __ add(ebx, Immediate(12));
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +000086 __ nop();
87 __ adc(ecx, 12);
88 __ adc(ecx, 1000);
89 __ nop();
90 __ and_(edx, 3);
91 __ and_(edx, Operand(esp, 4));
92 __ cmp(edx, 3);
93 __ cmp(edx, Operand(esp, 4));
94 __ cmp(Operand(ebp, ecx, times_4, 0), Immediate(1000));
verwaest@chromium.orgd4be0f02013-06-05 13:39:03 +000095 Handle<FixedArray> foo2 = isolate->factory()->NewFixedArray(10, TENURED);
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +000096 __ cmp(ebx, foo2);
sgjesse@chromium.orgb302e562010-02-03 11:26:59 +000097 __ cmpb(ebx, Operand(ebp, ecx, times_2, 0));
98 __ cmpb(Operand(ebp, ecx, times_2, 0), ebx);
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +000099 __ or_(edx, 3);
100 __ xor_(edx, 3);
101 __ nop();
jkummerow@chromium.org1e8da742013-08-26 17:13:35 +0000102 __ cpuid();
erik.corry@gmail.comc3b670f2011-10-05 21:44:48 +0000103 __ movsx_b(edx, ecx);
104 __ movsx_w(edx, ecx);
105 __ movzx_b(edx, ecx);
106 __ movzx_w(edx, ecx);
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000107
108 __ nop();
erik.corry@gmail.comc3b670f2011-10-05 21:44:48 +0000109 __ imul(edx, ecx);
110 __ shld(edx, ecx);
111 __ shrd(edx, ecx);
112 __ bts(edx, ecx);
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000113 __ bts(Operand(ebx, ecx, times_4, 0), ecx);
114 __ nop();
115 __ pushad();
116 __ popad();
117 __ pushfd();
118 __ popfd();
119 __ push(Immediate(12));
120 __ push(Immediate(23456));
121 __ push(ecx);
122 __ push(esi);
123 __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
124 __ push(Operand(ebx, ecx, times_4, 0));
125 __ push(Operand(ebx, ecx, times_4, 0));
126 __ push(Operand(ebx, ecx, times_4, 10000));
127 __ pop(edx);
128 __ pop(eax);
129 __ pop(Operand(ebx, ecx, times_4, 0));
130 __ nop();
131
132 __ add(edx, Operand(esp, 16));
erik.corry@gmail.comc3b670f2011-10-05 21:44:48 +0000133 __ add(edx, ecx);
134 __ mov_b(edx, ecx);
135 __ mov_b(ecx, 6);
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000136 __ mov_b(Operand(ebx, ecx, times_4, 10000), 6);
137 __ mov_b(Operand(esp, 16), edx);
138 __ mov_w(edx, Operand(esp, 16));
139 __ mov_w(Operand(esp, 16), edx);
140 __ nop();
141 __ movsx_w(edx, Operand(esp, 12));
142 __ movsx_b(edx, Operand(esp, 12));
143 __ movzx_w(edx, Operand(esp, 12));
144 __ movzx_b(edx, Operand(esp, 12));
145 __ nop();
146 __ mov(edx, 1234567);
147 __ mov(edx, Operand(esp, 12));
148 __ mov(Operand(ebx, ecx, times_4, 10000), Immediate(12345));
149 __ mov(Operand(ebx, ecx, times_4, 10000), edx);
150 __ nop();
151 __ dec_b(edx);
whesse@chromium.org4a1fe7d2010-09-27 12:32:04 +0000152 __ dec_b(Operand(eax, 10));
153 __ dec_b(Operand(ebx, ecx, times_4, 10000));
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000154 __ dec(edx);
155 __ cdq();
156
157 __ nop();
158 __ idiv(edx);
159 __ mul(edx);
160 __ neg(edx);
161 __ not_(edx);
162 __ test(Operand(ebx, ecx, times_4, 10000), Immediate(123456));
163
164 __ imul(edx, Operand(ebx, ecx, times_4, 10000));
165 __ imul(edx, ecx, 12);
166 __ imul(edx, ecx, 1000);
167
168 __ inc(edx);
169 __ inc(Operand(ebx, ecx, times_4, 10000));
170 __ push(Operand(ebx, ecx, times_4, 10000));
171 __ pop(Operand(ebx, ecx, times_4, 10000));
172 __ call(Operand(ebx, ecx, times_4, 10000));
173 __ jmp(Operand(ebx, ecx, times_4, 10000));
174
175 __ lea(edx, Operand(ebx, ecx, times_4, 10000));
176 __ or_(edx, 12345);
177 __ or_(edx, Operand(ebx, ecx, times_4, 10000));
178
179 __ nop();
180
181 __ rcl(edx, 1);
182 __ rcl(edx, 7);
ager@chromium.orgea4f62e2010-08-16 16:28:43 +0000183 __ rcr(edx, 1);
184 __ rcr(edx, 7);
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000185 __ sar(edx, 1);
186 __ sar(edx, 6);
ager@chromium.orgc4c92722009-11-18 14:12:51 +0000187 __ sar_cl(edx);
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000188 __ sbb(edx, Operand(ebx, ecx, times_4, 10000));
189 __ shld(edx, Operand(ebx, ecx, times_4, 10000));
190 __ shl(edx, 1);
191 __ shl(edx, 6);
ager@chromium.orgc4c92722009-11-18 14:12:51 +0000192 __ shl_cl(edx);
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000193 __ shrd(edx, Operand(ebx, ecx, times_4, 10000));
ager@chromium.orgc4c92722009-11-18 14:12:51 +0000194 __ shr(edx, 1);
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000195 __ shr(edx, 7);
ager@chromium.orgc4c92722009-11-18 14:12:51 +0000196 __ shr_cl(edx);
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000197
198
199 // Immediates
200
201 __ adc(edx, 12345);
202
erik.corry@gmail.comc3b670f2011-10-05 21:44:48 +0000203 __ add(ebx, Immediate(12));
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000204 __ add(Operand(edx, ecx, times_4, 10000), Immediate(12));
205
206 __ and_(ebx, 12345);
207
208 __ cmp(ebx, 12345);
erik.corry@gmail.comc3b670f2011-10-05 21:44:48 +0000209 __ cmp(ebx, Immediate(12));
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000210 __ cmp(Operand(edx, ecx, times_4, 10000), Immediate(12));
erik.corry@gmail.comc3b670f2011-10-05 21:44:48 +0000211 __ cmpb(eax, 100);
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000212
213 __ or_(ebx, 12345);
214
erik.corry@gmail.comc3b670f2011-10-05 21:44:48 +0000215 __ sub(ebx, Immediate(12));
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000216 __ sub(Operand(edx, ecx, times_4, 10000), Immediate(12));
217
218 __ xor_(ebx, 12345);
219
220 __ imul(edx, ecx, 12);
221 __ imul(edx, ecx, 1000);
222
ager@chromium.orgce5e87b2010-03-10 10:24:18 +0000223 __ cld();
fschneider@chromium.org0c20e672010-01-14 15:28:53 +0000224 __ rep_movs();
ager@chromium.orgce5e87b2010-03-10 10:24:18 +0000225 __ rep_stos();
erik.corry@gmail.com9dfbea42010-05-21 12:58:28 +0000226 __ stos();
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000227
228 __ sub(edx, Operand(ebx, ecx, times_4, 10000));
erik.corry@gmail.comc3b670f2011-10-05 21:44:48 +0000229 __ sub(edx, ebx);
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000230
231 __ test(edx, Immediate(12345));
232 __ test(edx, Operand(ebx, ecx, times_8, 10000));
vegorov@chromium.org2356e6f2010-06-09 09:38:56 +0000233 __ test(Operand(esi, edi, times_1, -20000000), Immediate(300000000));
234 __ test_b(edx, Operand(ecx, ebx, times_2, 1000));
235 __ test_b(Operand(eax, -20), 0x9A);
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000236 __ nop();
237
238 __ xor_(edx, 12345);
239 __ xor_(edx, Operand(ebx, ecx, times_8, 10000));
240 __ bts(Operand(ebx, ecx, times_8, 10000), edx);
241 __ hlt();
242 __ int3();
243 __ ret(0);
244 __ ret(8);
245
246 // Calls
247
248 Label L1, L2;
249 __ bind(&L1);
250 __ nop();
251 __ call(&L1);
252 __ call(&L2);
253 __ nop();
254 __ bind(&L2);
255 __ call(Operand(ebx, ecx, times_4, 10000));
256 __ nop();
svenpanne@chromium.org2bda5432013-03-15 12:39:50 +0000257 Handle<Code> ic(isolate->builtins()->builtin(Builtins::kLoadIC_Initialize));
ager@chromium.org236ad962008-09-25 09:45:57 +0000258 __ call(ic, RelocInfo::CODE_TARGET);
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000259 __ nop();
ager@chromium.org236ad962008-09-25 09:45:57 +0000260 __ call(FUNCTION_ADDR(DummyStaticFunction), RelocInfo::RUNTIME_ENTRY);
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000261 __ nop();
262
263 __ jmp(&L1);
264 __ jmp(Operand(ebx, ecx, times_4, 10000));
ricow@chromium.org5ad5ace2010-06-23 09:06:43 +0000265#ifdef ENABLE_DEBUGGER_SUPPORT
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000266 ExternalReference after_break_target =
svenpanne@chromium.org2bda5432013-03-15 12:39:50 +0000267 ExternalReference(Debug_Address::AfterBreakTarget(), isolate);
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000268 __ jmp(Operand::StaticVariable(after_break_target));
ricow@chromium.org5ad5ace2010-06-23 09:06:43 +0000269#endif // ENABLE_DEBUGGER_SUPPORT
ager@chromium.org236ad962008-09-25 09:45:57 +0000270 __ jmp(ic, RelocInfo::CODE_TARGET);
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000271 __ nop();
272
273
274 Label Ljcc;
275 __ nop();
276 // long jumps
277 __ j(overflow, &Ljcc);
278 __ j(no_overflow, &Ljcc);
279 __ j(below, &Ljcc);
280 __ j(above_equal, &Ljcc);
281 __ j(equal, &Ljcc);
282 __ j(not_equal, &Ljcc);
283 __ j(below_equal, &Ljcc);
284 __ j(above, &Ljcc);
285 __ j(sign, &Ljcc);
286 __ j(not_sign, &Ljcc);
287 __ j(parity_even, &Ljcc);
288 __ j(parity_odd, &Ljcc);
289 __ j(less, &Ljcc);
290 __ j(greater_equal, &Ljcc);
291 __ j(less_equal, &Ljcc);
292 __ j(greater, &Ljcc);
293 __ nop();
294 __ bind(&Ljcc);
295 // short jumps
296 __ j(overflow, &Ljcc);
297 __ j(no_overflow, &Ljcc);
298 __ j(below, &Ljcc);
299 __ j(above_equal, &Ljcc);
300 __ j(equal, &Ljcc);
301 __ j(not_equal, &Ljcc);
302 __ j(below_equal, &Ljcc);
303 __ j(above, &Ljcc);
304 __ j(sign, &Ljcc);
305 __ j(not_sign, &Ljcc);
306 __ j(parity_even, &Ljcc);
307 __ j(parity_odd, &Ljcc);
308 __ j(less, &Ljcc);
309 __ j(greater_equal, &Ljcc);
310 __ j(less_equal, &Ljcc);
311 __ j(greater, &Ljcc);
312
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000313 // 0xD9 instructions
314 __ nop();
315
whesse@chromium.org4a1fe7d2010-09-27 12:32:04 +0000316 __ fld(1);
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000317 __ fld1();
318 __ fldz();
whesse@chromium.org4a1fe7d2010-09-27 12:32:04 +0000319 __ fldpi();
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000320 __ fabs();
321 __ fchs();
322 __ fprem();
323 __ fprem1();
324 __ fincstp();
325 __ ftst();
326 __ fxch(3);
327 __ fld_s(Operand(ebx, ecx, times_4, 10000));
328 __ fstp_s(Operand(ebx, ecx, times_4, 10000));
329 __ ffree(3);
330 __ fld_d(Operand(ebx, ecx, times_4, 10000));
331 __ fstp_d(Operand(ebx, ecx, times_4, 10000));
332 __ nop();
333
334 __ fild_s(Operand(ebx, ecx, times_4, 10000));
335 __ fistp_s(Operand(ebx, ecx, times_4, 10000));
336 __ fild_d(Operand(ebx, ecx, times_4, 10000));
337 __ fistp_d(Operand(ebx, ecx, times_4, 10000));
338 __ fnstsw_ax();
339 __ nop();
340 __ fadd(3);
341 __ fsub(3);
342 __ fmul(3);
343 __ fdiv(3);
344
345 __ faddp(3);
346 __ fsubp(3);
347 __ fmulp(3);
348 __ fdivp(3);
349 __ fcompp();
350 __ fwait();
351 __ nop();
352 {
kmillikin@chromium.orgc36ce6e2011-04-04 08:25:31 +0000353 if (CpuFeatures::IsSupported(SSE2)) {
ulan@chromium.org750145a2013-03-07 15:14:13 +0000354 CpuFeatureScope fscope(&assm, SSE2);
fschneider@chromium.org086aac62010-03-17 13:18:24 +0000355 __ cvttss2si(edx, Operand(ebx, ecx, times_4, 10000));
356 __ cvtsi2sd(xmm1, Operand(ebx, ecx, times_4, 10000));
bmeurer@chromium.org0fdb2a62013-10-21 07:19:36 +0000357 __ movsd(xmm1, Operand(ebx, ecx, times_4, 10000));
358 __ movsd(Operand(ebx, ecx, times_4, 10000), xmm1);
jkummerow@chromium.orgef33a542013-10-28 18:03:37 +0000359 __ movaps(xmm0, xmm1);
fschneider@chromium.org086aac62010-03-17 13:18:24 +0000360 // 128 bit move instructions.
361 __ movdqa(xmm0, Operand(ebx, ecx, times_4, 10000));
362 __ movdqa(Operand(ebx, ecx, times_4, 10000), xmm0);
363 __ movdqu(xmm0, Operand(ebx, ecx, times_4, 10000));
364 __ movdqu(Operand(ebx, ecx, times_4, 10000), xmm0);
jkummerow@chromium.orgef33a542013-10-28 18:03:37 +0000365
366 __ addsd(xmm1, xmm0);
367 __ mulsd(xmm1, xmm0);
368 __ subsd(xmm1, xmm0);
369 __ divsd(xmm1, xmm0);
370 __ ucomisd(xmm0, xmm1);
371 __ cmpltsd(xmm0, xmm1);
372
373 __ andps(xmm0, xmm1);
verwaest@chromium.org057bd502013-11-06 12:03:29 +0000374 __ orps(xmm0, xmm1);
jkummerow@chromium.orgef33a542013-10-28 18:03:37 +0000375 __ andpd(xmm0, xmm1);
376 __ psllq(xmm0, 17);
377 __ psllq(xmm0, xmm1);
378 __ psrlq(xmm0, 17);
379 __ psrlq(xmm0, xmm1);
380 __ por(xmm0, xmm1);
fschneider@chromium.org086aac62010-03-17 13:18:24 +0000381 }
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000382 }
christian.plesner.hansen@gmail.com9d58c2b2009-10-16 11:48:38 +0000383
384 // cmov.
385 {
kmillikin@chromium.orgc36ce6e2011-04-04 08:25:31 +0000386 if (CpuFeatures::IsSupported(CMOV)) {
ulan@chromium.org750145a2013-03-07 15:14:13 +0000387 CpuFeatureScope use_cmov(&assm, CMOV);
fschneider@chromium.org086aac62010-03-17 13:18:24 +0000388 __ cmov(overflow, eax, Operand(eax, 0));
389 __ cmov(no_overflow, eax, Operand(eax, 1));
390 __ cmov(below, eax, Operand(eax, 2));
391 __ cmov(above_equal, eax, Operand(eax, 3));
392 __ cmov(equal, eax, Operand(ebx, 0));
393 __ cmov(not_equal, eax, Operand(ebx, 1));
394 __ cmov(below_equal, eax, Operand(ebx, 2));
395 __ cmov(above, eax, Operand(ebx, 3));
396 __ cmov(sign, eax, Operand(ecx, 0));
397 __ cmov(not_sign, eax, Operand(ecx, 1));
398 __ cmov(parity_even, eax, Operand(ecx, 2));
399 __ cmov(parity_odd, eax, Operand(ecx, 3));
400 __ cmov(less, eax, Operand(edx, 0));
401 __ cmov(greater_equal, eax, Operand(edx, 1));
402 __ cmov(less_equal, eax, Operand(edx, 2));
403 __ cmov(greater, eax, Operand(edx, 3));
404 }
christian.plesner.hansen@gmail.com9d58c2b2009-10-16 11:48:38 +0000405 }
406
erik.corry@gmail.comd91075f2011-02-10 07:45:38 +0000407 {
yangguo@chromium.orga6bbcc82012-12-21 12:35:02 +0000408 if (CpuFeatures::IsSupported(SSE2) &&
409 CpuFeatures::IsSupported(SSE4_1)) {
ulan@chromium.org750145a2013-03-07 15:14:13 +0000410 CpuFeatureScope scope(&assm, SSE4_1);
erik.corry@gmail.comc3b670f2011-10-05 21:44:48 +0000411 __ pextrd(eax, xmm0, 1);
412 __ pinsrd(xmm1, eax, 0);
mstarzinger@chromium.orgb4968be2013-10-16 09:00:56 +0000413 __ extractps(eax, xmm1, 0);
erik.corry@gmail.comd91075f2011-02-10 07:45:38 +0000414 }
415 }
416
ricow@chromium.org64e3a4b2011-12-13 08:07:27 +0000417 // Nop instructions
418 for (int i = 0; i < 16; i++) {
419 __ Nop(i);
420 }
421
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000422 __ ret(0);
423
424 CodeDesc desc;
425 assm.GetCode(&desc);
ulan@chromium.org09d7ab52013-02-25 15:50:35 +0000426 Object* code = isolate->heap()->CreateCode(
lrn@chromium.org303ada72010-10-27 09:33:13 +0000427 desc,
428 Code::ComputeFlags(Code::STUB),
ulan@chromium.org09d7ab52013-02-25 15:50:35 +0000429 Handle<Code>())->ToObjectChecked();
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000430 CHECK(code->IsCode());
fschneider@chromium.org9e3e0b62011-01-03 10:16:46 +0000431#ifdef OBJECT_PRINT
mads.s.ager@gmail.com9a4089a2008-09-01 08:55:01 +0000432 Code::cast(code)->Print();
433 byte* begin = Code::cast(code)->instruction_start();
434 byte* end = begin + Code::cast(code)->instruction_size();
435 disasm::Disassembler::Disassemble(stdout, begin, end);
436#endif
437}
438
439#undef __