1c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com// Copyright 2011 the V8 project authors. All rights reserved.
29a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// Redistribution and use in source and binary forms, with or without
39a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// modification, are permitted provided that the following conditions are
49a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// met:
59a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com//
69a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com//     * Redistributions of source code must retain the above copyright
79a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com//       notice, this list of conditions and the following disclaimer.
89a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com//     * Redistributions in binary form must reproduce the above
99a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com//       copyright notice, this list of conditions and the following
109a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com//       disclaimer in the documentation and/or other materials provided
119a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com//       with the distribution.
129a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com//     * Neither the name of Google Inc. nor the names of its
139a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com//       contributors may be used to endorse or promote products derived
149a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com//       from this software without specific prior written permission.
159a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com//
169a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
179a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
189a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
199a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
209a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
219a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
229a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
239a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
249a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
259a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
269a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
279a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
289a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com#include <stdlib.h>
299a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
309a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com#include "v8.h"
319a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
329a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com#include "debug.h"
339a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com#include "disasm.h"
349a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com#include "disassembler.h"
359a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com#include "macro-assembler.h"
369a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com#include "serialize.h"
379a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com#include "cctest.h"
389a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
399a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.comusing namespace v8::internal;
409a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
419a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
429a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com#define __ assm.
439a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
449a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
459a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.comstatic void DummyStaticFunction(Object* result) {
469a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com}
479a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
489a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
499a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.comTEST(DisasmIa320) {
50e27d617298263725e8a48c2aa14029759b952623mstarzinger@chromium.org  CcTest::InitializeVM();
51e27d617298263725e8a48c2aa14029759b952623mstarzinger@chromium.org  Isolate* isolate = reinterpret_cast<Isolate*>(CcTest::isolate());
522bda543d75374afd8d7e98f56ca99a57ae1b7bd1svenpanne@chromium.org  HandleScope scope(isolate);
530c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.org  v8::internal::byte buffer[2048];
542bda543d75374afd8d7e98f56ca99a57ae1b7bd1svenpanne@chromium.org  Assembler assm(isolate, buffer, sizeof buffer);
559a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  DummyStaticFunction(NULL);  // just bloody use it (DELETE; debugging)
569a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
579a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  // Short immediate instructions
589a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ adc(eax, 12345678);
59c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com  __ add(eax, Immediate(12345678));
609a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ or_(eax, 12345678);
61c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com  __ sub(eax, Immediate(12345678));
629a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ xor_(eax, 12345678);
639a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ and_(eax, 12345678);
64d4be0f0c0edfc0a0b46e745055c3dc497c0ffcb5verwaest@chromium.org  Handle<FixedArray> foo = isolate->factory()->NewFixedArray(10, TENURED);
659a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ cmp(eax, foo);
669a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
679a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  // ---- This one caused crash
689a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ mov(ebx,  Operand(esp, ecx, times_2, 0));  // [esp+ecx*4]
699a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
709a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  // ---- All instructions that I can think of
71c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com  __ add(edx, ebx);
7259297c735ad2a41156ae9c723a39ff259ad061e0jkummerow@chromium.org  __ add(edx, Operand(12, RelocInfo::NONE32));
739a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ add(edx, Operand(ebx, 0));
749a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ add(edx, Operand(ebx, 16));
759a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ add(edx, Operand(ebx, 1999));
769a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ add(edx, Operand(esp, 0));
779a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ add(edx, Operand(esp, 16));
789a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ add(edx, Operand(esp, 1999));
799a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
809a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ add(edi, Operand(ebp, ecx, times_4, 0));
819a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ add(edi, Operand(ebp, ecx, times_4, 12));
829a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ add(Operand(ebp, ecx, times_4, 12), Immediate(12));
839a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
849a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
85c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com  __ add(ebx, Immediate(12));
869a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
879a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ adc(ecx, 12);
889a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ adc(ecx, 1000);
899a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
909a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ and_(edx, 3);
919a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ and_(edx, Operand(esp, 4));
929a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ cmp(edx, 3);
939a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ cmp(edx, Operand(esp, 4));
949a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ cmp(Operand(ebp, ecx, times_4, 0), Immediate(1000));
95d4be0f0c0edfc0a0b46e745055c3dc497c0ffcb5verwaest@chromium.org  Handle<FixedArray> foo2 = isolate->factory()->NewFixedArray(10, TENURED);
969a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ cmp(ebx, foo2);
97b302e56e5b70c4504faa2adf4ec3efb64a9d3e38sgjesse@chromium.org  __ cmpb(ebx, Operand(ebp, ecx, times_2, 0));
98b302e56e5b70c4504faa2adf4ec3efb64a9d3e38sgjesse@chromium.org  __ cmpb(Operand(ebp, ecx, times_2, 0), ebx);
999a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ or_(edx, 3);
1009a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ xor_(edx, 3);
1019a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
1029a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  {
103c36ce6e8979bbbd43539f0a0effc87ea20dd65cckmillikin@chromium.org    CHECK(CpuFeatures::IsSupported(CPUID));
104750145ab1b720c97adf2b548cc8fbd28c8b8e06dulan@chromium.org    CpuFeatureScope fscope(&assm, CPUID);
1059a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com    __ cpuid();
1069a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  }
1079a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  {
108c36ce6e8979bbbd43539f0a0effc87ea20dd65cckmillikin@chromium.org    CHECK(CpuFeatures::IsSupported(RDTSC));
109750145ab1b720c97adf2b548cc8fbd28c8b8e06dulan@chromium.org    CpuFeatureScope fscope(&assm, RDTSC);
1109a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com    __ rdtsc();
1119a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  }
112c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com  __ movsx_b(edx, ecx);
113c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com  __ movsx_w(edx, ecx);
114c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com  __ movzx_b(edx, ecx);
115c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com  __ movzx_w(edx, ecx);
1169a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
1179a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
118c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com  __ imul(edx, ecx);
119c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com  __ shld(edx, ecx);
120c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com  __ shrd(edx, ecx);
121c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com  __ bts(edx, ecx);
1229a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ bts(Operand(ebx, ecx, times_4, 0), ecx);
1239a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
1249a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ pushad();
1259a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ popad();
1269a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ pushfd();
1279a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ popfd();
1289a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ push(Immediate(12));
1299a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ push(Immediate(23456));
1309a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ push(ecx);
1319a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ push(esi);
1329a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
1339a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ push(Operand(ebx, ecx, times_4, 0));
1349a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ push(Operand(ebx, ecx, times_4, 0));
1359a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ push(Operand(ebx, ecx, times_4, 10000));
1369a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ pop(edx);
1379a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ pop(eax);
1389a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ pop(Operand(ebx, ecx, times_4, 0));
1399a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
1409a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
1419a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ add(edx, Operand(esp, 16));
142c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com  __ add(edx, ecx);
143c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com  __ mov_b(edx, ecx);
144c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com  __ mov_b(ecx, 6);
1459a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ mov_b(Operand(ebx, ecx, times_4, 10000), 6);
1469a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ mov_b(Operand(esp, 16), edx);
1479a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ mov_w(edx, Operand(esp, 16));
1489a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ mov_w(Operand(esp, 16), edx);
1499a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
1509a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ movsx_w(edx, Operand(esp, 12));
1519a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ movsx_b(edx, Operand(esp, 12));
1529a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ movzx_w(edx, Operand(esp, 12));
1539a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ movzx_b(edx, Operand(esp, 12));
1549a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
1559a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ mov(edx, 1234567);
1569a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ mov(edx, Operand(esp, 12));
1579a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ mov(Operand(ebx, ecx, times_4, 10000), Immediate(12345));
1589a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ mov(Operand(ebx, ecx, times_4, 10000), edx);
1599a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
1609a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ dec_b(edx);
1614a1fe7d5e92fdb673d5f05d5ddf7b1ed703ba18dwhesse@chromium.org  __ dec_b(Operand(eax, 10));
1624a1fe7d5e92fdb673d5f05d5ddf7b1ed703ba18dwhesse@chromium.org  __ dec_b(Operand(ebx, ecx, times_4, 10000));
1639a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ dec(edx);
1649a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ cdq();
1659a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
1669a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
1679a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ idiv(edx);
1689a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ mul(edx);
1699a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ neg(edx);
1709a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ not_(edx);
1719a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ test(Operand(ebx, ecx, times_4, 10000), Immediate(123456));
1729a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
1739a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ imul(edx, Operand(ebx, ecx, times_4, 10000));
1749a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ imul(edx, ecx, 12);
1759a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ imul(edx, ecx, 1000);
1769a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
1779a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ inc(edx);
1789a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ inc(Operand(ebx, ecx, times_4, 10000));
1799a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ push(Operand(ebx, ecx, times_4, 10000));
1809a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ pop(Operand(ebx, ecx, times_4, 10000));
1819a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ call(Operand(ebx, ecx, times_4, 10000));
1829a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ jmp(Operand(ebx, ecx, times_4, 10000));
1839a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
1849a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ lea(edx, Operand(ebx, ecx, times_4, 10000));
1859a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ or_(edx, 12345);
1869a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ or_(edx, Operand(ebx, ecx, times_4, 10000));
1879a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
1889a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
1899a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
1909a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ rcl(edx, 1);
1919a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ rcl(edx, 7);
192ea4f62e1df22417fc8dc2c2425485dca98b13d07ager@chromium.org  __ rcr(edx, 1);
193ea4f62e1df22417fc8dc2c2425485dca98b13d07ager@chromium.org  __ rcr(edx, 7);
1949a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ sar(edx, 1);
1959a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ sar(edx, 6);
196c4c927273ae2b690c4a015b4640a2a469c9a1a69ager@chromium.org  __ sar_cl(edx);
1979a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ sbb(edx, Operand(ebx, ecx, times_4, 10000));
1989a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ shld(edx, Operand(ebx, ecx, times_4, 10000));
1999a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ shl(edx, 1);
2009a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ shl(edx, 6);
201c4c927273ae2b690c4a015b4640a2a469c9a1a69ager@chromium.org  __ shl_cl(edx);
2029a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ shrd(edx, Operand(ebx, ecx, times_4, 10000));
203c4c927273ae2b690c4a015b4640a2a469c9a1a69ager@chromium.org  __ shr(edx, 1);
2049a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ shr(edx, 7);
205c4c927273ae2b690c4a015b4640a2a469c9a1a69ager@chromium.org  __ shr_cl(edx);
2069a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
2079a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
2089a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  // Immediates
2099a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
2109a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ adc(edx, 12345);
2119a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
212c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com  __ add(ebx, Immediate(12));
2139a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ add(Operand(edx, ecx, times_4, 10000), Immediate(12));
2149a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
2159a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ and_(ebx, 12345);
2169a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
2179a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ cmp(ebx, 12345);
218c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com  __ cmp(ebx, Immediate(12));
2199a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ cmp(Operand(edx, ecx, times_4, 10000), Immediate(12));
220c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com  __ cmpb(eax, 100);
2219a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
2229a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ or_(ebx, 12345);
2239a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
224c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com  __ sub(ebx, Immediate(12));
2259a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ sub(Operand(edx, ecx, times_4, 10000), Immediate(12));
2269a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
2279a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ xor_(ebx, 12345);
2289a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
2299a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ imul(edx, ecx, 12);
2309a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ imul(edx, ecx, 1000);
2319a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
232ce5e87bd905d592a8bd612b3dedf7a994177c13aager@chromium.org  __ cld();
2330c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.org  __ rep_movs();
234ce5e87bd905d592a8bd612b3dedf7a994177c13aager@chromium.org  __ rep_stos();
2359dfbea4c7d423c7bc1db94425cb78e7f7cf41f78erik.corry@gmail.com  __ stos();
2369a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
2379a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ sub(edx, Operand(ebx, ecx, times_4, 10000));
238c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com  __ sub(edx, ebx);
2399a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
2409a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ test(edx, Immediate(12345));
2419a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ test(edx, Operand(ebx, ecx, times_8, 10000));
2422356e6fbe66ac3aa027b61cb43a3c3619b3c3a5evegorov@chromium.org  __ test(Operand(esi, edi, times_1, -20000000), Immediate(300000000));
2432356e6fbe66ac3aa027b61cb43a3c3619b3c3a5evegorov@chromium.org  __ test_b(edx, Operand(ecx, ebx, times_2, 1000));
2442356e6fbe66ac3aa027b61cb43a3c3619b3c3a5evegorov@chromium.org  __ test_b(Operand(eax, -20), 0x9A);
2459a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
2469a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
2479a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ xor_(edx, 12345);
2489a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ xor_(edx, Operand(ebx, ecx, times_8, 10000));
2499a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ bts(Operand(ebx, ecx, times_8, 10000), edx);
2509a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ hlt();
2519a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ int3();
2529a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ ret(0);
2539a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ ret(8);
2549a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
2559a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  // Calls
2569a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
2579a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  Label L1, L2;
2589a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ bind(&L1);
2599a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
2609a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ call(&L1);
2619a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ call(&L2);
2629a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
2639a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ bind(&L2);
2649a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ call(Operand(ebx, ecx, times_4, 10000));
2659a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
2662bda543d75374afd8d7e98f56ca99a57ae1b7bd1svenpanne@chromium.org  Handle<Code> ic(isolate->builtins()->builtin(Builtins::kLoadIC_Initialize));
267236ad9617a7359a463144a6ebeb5431a70f769cfager@chromium.org  __ call(ic, RelocInfo::CODE_TARGET);
2689a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
269236ad9617a7359a463144a6ebeb5431a70f769cfager@chromium.org  __ call(FUNCTION_ADDR(DummyStaticFunction), RelocInfo::RUNTIME_ENTRY);
2709a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
2719a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
2729a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ jmp(&L1);
2739a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ jmp(Operand(ebx, ecx, times_4, 10000));
2745ad5acef6bd4ebc785f946d8bcc2a88b1e031827ricow@chromium.org#ifdef ENABLE_DEBUGGER_SUPPORT
2759a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  ExternalReference after_break_target =
2762bda543d75374afd8d7e98f56ca99a57ae1b7bd1svenpanne@chromium.org      ExternalReference(Debug_Address::AfterBreakTarget(), isolate);
2779a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ jmp(Operand::StaticVariable(after_break_target));
2785ad5acef6bd4ebc785f946d8bcc2a88b1e031827ricow@chromium.org#endif  // ENABLE_DEBUGGER_SUPPORT
279236ad9617a7359a463144a6ebeb5431a70f769cfager@chromium.org  __ jmp(ic, RelocInfo::CODE_TARGET);
2809a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
2819a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
2829a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
2839a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  Label Ljcc;
2849a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
2859a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  // long jumps
2869a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(overflow, &Ljcc);
2879a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(no_overflow, &Ljcc);
2889a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(below, &Ljcc);
2899a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(above_equal, &Ljcc);
2909a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(equal, &Ljcc);
2919a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(not_equal, &Ljcc);
2929a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(below_equal, &Ljcc);
2939a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(above, &Ljcc);
2949a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(sign, &Ljcc);
2959a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(not_sign, &Ljcc);
2969a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(parity_even, &Ljcc);
2979a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(parity_odd, &Ljcc);
2989a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(less, &Ljcc);
2999a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(greater_equal, &Ljcc);
3009a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(less_equal, &Ljcc);
3019a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(greater, &Ljcc);
3029a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
3039a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ bind(&Ljcc);
3049a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  // short jumps
3059a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(overflow, &Ljcc);
3069a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(no_overflow, &Ljcc);
3079a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(below, &Ljcc);
3089a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(above_equal, &Ljcc);
3099a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(equal, &Ljcc);
3109a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(not_equal, &Ljcc);
3119a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(below_equal, &Ljcc);
3129a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(above, &Ljcc);
3139a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(sign, &Ljcc);
3149a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(not_sign, &Ljcc);
3159a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(parity_even, &Ljcc);
3169a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(parity_odd, &Ljcc);
3179a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(less, &Ljcc);
3189a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(greater_equal, &Ljcc);
3199a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(less_equal, &Ljcc);
3209a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ j(greater, &Ljcc);
3219a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
3229a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  // 0xD9 instructions
3239a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
3249a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
3254a1fe7d5e92fdb673d5f05d5ddf7b1ed703ba18dwhesse@chromium.org  __ fld(1);
3269a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fld1();
3279a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fldz();
3284a1fe7d5e92fdb673d5f05d5ddf7b1ed703ba18dwhesse@chromium.org  __ fldpi();
3299a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fabs();
3309a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fchs();
3319a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fprem();
3329a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fprem1();
3339a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fincstp();
3349a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ ftst();
3359a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fxch(3);
3369a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fld_s(Operand(ebx, ecx, times_4, 10000));
3379a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fstp_s(Operand(ebx, ecx, times_4, 10000));
3389a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ ffree(3);
3399a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fld_d(Operand(ebx, ecx, times_4, 10000));
3409a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fstp_d(Operand(ebx, ecx, times_4, 10000));
3419a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
3429a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
3439a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fild_s(Operand(ebx, ecx, times_4, 10000));
3449a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fistp_s(Operand(ebx, ecx, times_4, 10000));
3459a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fild_d(Operand(ebx, ecx, times_4, 10000));
3469a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fistp_d(Operand(ebx, ecx, times_4, 10000));
3479a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fnstsw_ax();
3489a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
3499a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fadd(3);
3509a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fsub(3);
3519a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fmul(3);
3529a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fdiv(3);
3539a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
3549a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ faddp(3);
3559a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fsubp(3);
3569a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fmulp(3);
3579a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fdivp(3);
3589a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fcompp();
3599a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ fwait();
3609a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ nop();
3619a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  {
362c36ce6e8979bbbd43539f0a0effc87ea20dd65cckmillikin@chromium.org    if (CpuFeatures::IsSupported(SSE2)) {
363750145ab1b720c97adf2b548cc8fbd28c8b8e06dulan@chromium.org      CpuFeatureScope fscope(&assm, SSE2);
364086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ cvttss2si(edx, Operand(ebx, ecx, times_4, 10000));
365086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ cvtsi2sd(xmm1, Operand(ebx, ecx, times_4, 10000));
366086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ addsd(xmm1, xmm0);
367086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ mulsd(xmm1, xmm0);
368086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ subsd(xmm1, xmm0);
369086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ divsd(xmm1, xmm0);
370086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ movdbl(xmm1, Operand(ebx, ecx, times_4, 10000));
371086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ movdbl(Operand(ebx, ecx, times_4, 10000), xmm1);
3725ad5acef6bd4ebc785f946d8bcc2a88b1e031827ricow@chromium.org      __ ucomisd(xmm0, xmm1);
373086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org
374086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      // 128 bit move instructions.
375086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ movdqa(xmm0, Operand(ebx, ecx, times_4, 10000));
376086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ movdqa(Operand(ebx, ecx, times_4, 10000), xmm0);
377086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ movdqu(xmm0, Operand(ebx, ecx, times_4, 10000));
378086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ movdqu(Operand(ebx, ecx, times_4, 10000), xmm0);
379086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org    }
3809a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  }
3819d58c2b1c27d8b2890b9bd46e57d3842b09e0292christian.plesner.hansen@gmail.com
3829d58c2b1c27d8b2890b9bd46e57d3842b09e0292christian.plesner.hansen@gmail.com  // cmov.
3839d58c2b1c27d8b2890b9bd46e57d3842b09e0292christian.plesner.hansen@gmail.com  {
384c36ce6e8979bbbd43539f0a0effc87ea20dd65cckmillikin@chromium.org    if (CpuFeatures::IsSupported(CMOV)) {
385750145ab1b720c97adf2b548cc8fbd28c8b8e06dulan@chromium.org      CpuFeatureScope use_cmov(&assm, CMOV);
386086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ cmov(overflow, eax, Operand(eax, 0));
387086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ cmov(no_overflow, eax, Operand(eax, 1));
388086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ cmov(below, eax, Operand(eax, 2));
389086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ cmov(above_equal, eax, Operand(eax, 3));
390086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ cmov(equal, eax, Operand(ebx, 0));
391086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ cmov(not_equal, eax, Operand(ebx, 1));
392086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ cmov(below_equal, eax, Operand(ebx, 2));
393086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ cmov(above, eax, Operand(ebx, 3));
394086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ cmov(sign, eax, Operand(ecx, 0));
395086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ cmov(not_sign, eax, Operand(ecx, 1));
396086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ cmov(parity_even, eax, Operand(ecx, 2));
397086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ cmov(parity_odd, eax, Operand(ecx, 3));
398086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ cmov(less, eax, Operand(edx, 0));
399086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ cmov(greater_equal, eax, Operand(edx, 1));
400086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ cmov(less_equal, eax, Operand(edx, 2));
401086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org      __ cmov(greater, eax, Operand(edx, 3));
402086aac6d6268988582d3b5b0aa8d24f61ddc1f1ffschneider@chromium.org    }
4039d58c2b1c27d8b2890b9bd46e57d3842b09e0292christian.plesner.hansen@gmail.com  }
4049d58c2b1c27d8b2890b9bd46e57d3842b09e0292christian.plesner.hansen@gmail.com
405c6c5718277d4047fad1e034396228ce15571b5a4sgjesse@chromium.org  // andpd, cmpltsd, movaps, psllq, psrlq, por.
406c20610af4f0ca150977ca140a1174f98ee46f5aafschneider@chromium.org  {
407c36ce6e8979bbbd43539f0a0effc87ea20dd65cckmillikin@chromium.org    if (CpuFeatures::IsSupported(SSE2)) {
408750145ab1b720c97adf2b548cc8fbd28c8b8e06dulan@chromium.org      CpuFeatureScope fscope(&assm, SSE2);
409c20610af4f0ca150977ca140a1174f98ee46f5aafschneider@chromium.org      __ andpd(xmm0, xmm1);
410c20610af4f0ca150977ca140a1174f98ee46f5aafschneider@chromium.org      __ andpd(xmm1, xmm2);
411c20610af4f0ca150977ca140a1174f98ee46f5aafschneider@chromium.org
412c20610af4f0ca150977ca140a1174f98ee46f5aafschneider@chromium.org      __ cmpltsd(xmm0, xmm1);
413c20610af4f0ca150977ca140a1174f98ee46f5aafschneider@chromium.org      __ cmpltsd(xmm1, xmm2);
414c20610af4f0ca150977ca140a1174f98ee46f5aafschneider@chromium.org
415c20610af4f0ca150977ca140a1174f98ee46f5aafschneider@chromium.org      __ movaps(xmm0, xmm1);
416c20610af4f0ca150977ca140a1174f98ee46f5aafschneider@chromium.org      __ movaps(xmm1, xmm2);
417c20610af4f0ca150977ca140a1174f98ee46f5aafschneider@chromium.org
418c20610af4f0ca150977ca140a1174f98ee46f5aafschneider@chromium.org      __ psllq(xmm0, 17);
419c20610af4f0ca150977ca140a1174f98ee46f5aafschneider@chromium.org      __ psllq(xmm1, 42);
420c6c5718277d4047fad1e034396228ce15571b5a4sgjesse@chromium.org
421c6c5718277d4047fad1e034396228ce15571b5a4sgjesse@chromium.org      __ psllq(xmm0, xmm1);
422c6c5718277d4047fad1e034396228ce15571b5a4sgjesse@chromium.org      __ psllq(xmm1, xmm2);
423c6c5718277d4047fad1e034396228ce15571b5a4sgjesse@chromium.org
424c6c5718277d4047fad1e034396228ce15571b5a4sgjesse@chromium.org      __ psrlq(xmm0, 17);
425c6c5718277d4047fad1e034396228ce15571b5a4sgjesse@chromium.org      __ psrlq(xmm1, 42);
426c6c5718277d4047fad1e034396228ce15571b5a4sgjesse@chromium.org
427c6c5718277d4047fad1e034396228ce15571b5a4sgjesse@chromium.org      __ psrlq(xmm0, xmm1);
428c6c5718277d4047fad1e034396228ce15571b5a4sgjesse@chromium.org      __ psrlq(xmm1, xmm2);
429c6c5718277d4047fad1e034396228ce15571b5a4sgjesse@chromium.org
430c6c5718277d4047fad1e034396228ce15571b5a4sgjesse@chromium.org      __ por(xmm0, xmm1);
431c6c5718277d4047fad1e034396228ce15571b5a4sgjesse@chromium.org      __ por(xmm1, xmm2);
432c20610af4f0ca150977ca140a1174f98ee46f5aafschneider@chromium.org    }
433c20610af4f0ca150977ca140a1174f98ee46f5aafschneider@chromium.org  }
434c20610af4f0ca150977ca140a1174f98ee46f5aafschneider@chromium.org
435d91075f76b836c2cfa4f4e4cc0fb31170df864ccerik.corry@gmail.com  {
436a6bbcc801f63c451f814d6da77a1a48fba3d36c6yangguo@chromium.org    if (CpuFeatures::IsSupported(SSE2) &&
437a6bbcc801f63c451f814d6da77a1a48fba3d36c6yangguo@chromium.org        CpuFeatures::IsSupported(SSE4_1)) {
438750145ab1b720c97adf2b548cc8fbd28c8b8e06dulan@chromium.org      CpuFeatureScope scope(&assm, SSE4_1);
439c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com      __ pextrd(eax, xmm0, 1);
440c3b670ff19220959730d7886892bc4beb95d2ebaerik.corry@gmail.com      __ pinsrd(xmm1, eax, 0);
441d91075f76b836c2cfa4f4e4cc0fb31170df864ccerik.corry@gmail.com    }
442d91075f76b836c2cfa4f4e4cc0fb31170df864ccerik.corry@gmail.com  }
443d91075f76b836c2cfa4f4e4cc0fb31170df864ccerik.corry@gmail.com
44464e3a4be4a99f31920128de34573c8ac9038de42ricow@chromium.org  // Nop instructions
44564e3a4be4a99f31920128de34573c8ac9038de42ricow@chromium.org  for (int i = 0; i < 16; i++) {
44664e3a4be4a99f31920128de34573c8ac9038de42ricow@chromium.org    __ Nop(i);
44764e3a4be4a99f31920128de34573c8ac9038de42ricow@chromium.org  }
44864e3a4be4a99f31920128de34573c8ac9038de42ricow@chromium.org
4499a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  __ ret(0);
4509a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
4519a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  CodeDesc desc;
4529a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  assm.GetCode(&desc);
45309d7ab5aba54ebac170eac755664c45eefb0be7dulan@chromium.org  Object* code = isolate->heap()->CreateCode(
454303ada708275d2d425b846fb237f1ba7598ee239lrn@chromium.org      desc,
455303ada708275d2d425b846fb237f1ba7598ee239lrn@chromium.org      Code::ComputeFlags(Code::STUB),
45609d7ab5aba54ebac170eac755664c45eefb0be7dulan@chromium.org      Handle<Code>())->ToObjectChecked();
4579a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  CHECK(code->IsCode());
4589e3e0b618a14a05efd7d66f20bac4423dd3a1a2ffschneider@chromium.org#ifdef OBJECT_PRINT
4599a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  Code::cast(code)->Print();
4609a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  byte* begin = Code::cast(code)->instruction_start();
4619a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  byte* end = begin + Code::cast(code)->instruction_size();
4629a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com  disasm::Disassembler::Disassemble(stdout, begin, end);
4639a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com#endif
4649a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com}
4659a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com
4669a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com#undef __
467