2011-10-03 11:44:39 +00:00
|
|
|
// Copyright 2011 the V8 project authors. All rights reserved.
|
2008-08-22 13:33:59 +00:00
|
|
|
// Redistribution and use in source and binary forms, with or without
|
|
|
|
// modification, are permitted provided that the following conditions are
|
|
|
|
// met:
|
|
|
|
//
|
|
|
|
// * Redistributions of source code must retain the above copyright
|
|
|
|
// notice, this list of conditions and the following disclaimer.
|
|
|
|
// * Redistributions in binary form must reproduce the above
|
|
|
|
// copyright notice, this list of conditions and the following
|
|
|
|
// disclaimer in the documentation and/or other materials provided
|
|
|
|
// with the distribution.
|
|
|
|
// * Neither the name of Google Inc. nor the names of its
|
|
|
|
// contributors may be used to endorse or promote products derived
|
|
|
|
// from this software without specific prior written permission.
|
|
|
|
//
|
|
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2019-05-24 13:51:59 +00:00
|
|
|
#include "src/init/v8.h"
|
2008-08-22 13:33:59 +00:00
|
|
|
|
2019-05-21 09:30:15 +00:00
|
|
|
#include "src/codegen/code-factory.h"
|
|
|
|
#include "src/codegen/macro-assembler.h"
|
2015-07-31 11:07:50 +00:00
|
|
|
#include "src/debug/debug.h"
|
2019-05-20 09:15:06 +00:00
|
|
|
#include "src/diagnostics/disasm.h"
|
|
|
|
#include "src/diagnostics/disassembler.h"
|
2019-05-22 07:55:37 +00:00
|
|
|
#include "src/execution/frames-inl.h"
|
2019-05-23 13:27:57 +00:00
|
|
|
#include "src/utils/ostreams.h"
|
2014-06-03 08:12:43 +00:00
|
|
|
#include "test/cctest/cctest.h"
|
2008-08-22 13:33:59 +00:00
|
|
|
|
2017-08-31 12:34:55 +00:00
|
|
|
namespace v8 {
|
|
|
|
namespace internal {
|
2008-08-22 13:33:59 +00:00
|
|
|
|
|
|
|
#define __ assm.
|
|
|
|
|
2018-12-25 00:19:47 +00:00
|
|
|
static void DummyStaticFunction(Object result) {}
|
2008-08-22 13:33:59 +00:00
|
|
|
|
|
|
|
TEST(DisasmIa320) {
|
2013-04-10 08:29:39 +00:00
|
|
|
CcTest::InitializeVM();
|
2014-03-05 09:28:26 +00:00
|
|
|
Isolate* isolate = CcTest::i_isolate();
|
2013-03-15 12:06:53 +00:00
|
|
|
HandleScope scope(isolate);
|
2017-06-13 02:06:17 +00:00
|
|
|
v8::internal::byte buffer[8192];
|
2019-01-16 18:29:52 +00:00
|
|
|
Assembler assm(AssemblerOptions{},
|
|
|
|
ExternalAssemblerBuffer(buffer, sizeof buffer));
|
2008-08-22 13:33:59 +00:00
|
|
|
// Short immediate instructions
|
|
|
|
__ adc(eax, 12345678);
|
2011-10-03 11:44:39 +00:00
|
|
|
__ add(eax, Immediate(12345678));
|
2008-08-22 13:33:59 +00:00
|
|
|
__ or_(eax, 12345678);
|
2011-10-03 11:44:39 +00:00
|
|
|
__ sub(eax, Immediate(12345678));
|
2008-08-22 13:33:59 +00:00
|
|
|
__ xor_(eax, 12345678);
|
|
|
|
__ and_(eax, 12345678);
|
2019-03-11 19:04:02 +00:00
|
|
|
Handle<FixedArray> foo =
|
|
|
|
isolate->factory()->NewFixedArray(10, AllocationType::kOld);
|
2008-08-22 13:33:59 +00:00
|
|
|
__ cmp(eax, foo);
|
|
|
|
|
|
|
|
// ---- This one caused crash
|
|
|
|
__ mov(ebx, Operand(esp, ecx, times_2, 0)); // [esp+ecx*4]
|
|
|
|
|
|
|
|
// ---- All instructions that I can think of
|
2011-10-03 11:44:39 +00:00
|
|
|
__ add(edx, ebx);
|
2018-01-22 14:04:45 +00:00
|
|
|
__ add(edx, Operand(12, RelocInfo::NONE));
|
2008-08-22 13:33:59 +00:00
|
|
|
__ add(edx, Operand(ebx, 0));
|
|
|
|
__ add(edx, Operand(ebx, 16));
|
|
|
|
__ add(edx, Operand(ebx, 1999));
|
2014-03-05 09:28:26 +00:00
|
|
|
__ add(edx, Operand(ebx, -4));
|
|
|
|
__ add(edx, Operand(ebx, -1999));
|
2008-08-22 13:33:59 +00:00
|
|
|
__ add(edx, Operand(esp, 0));
|
|
|
|
__ add(edx, Operand(esp, 16));
|
|
|
|
__ add(edx, Operand(esp, 1999));
|
2014-03-05 09:28:26 +00:00
|
|
|
__ add(edx, Operand(esp, -4));
|
|
|
|
__ add(edx, Operand(esp, -1999));
|
|
|
|
__ nop();
|
|
|
|
__ add(esi, Operand(ecx, times_4, 0));
|
|
|
|
__ add(esi, Operand(ecx, times_4, 24));
|
|
|
|
__ add(esi, Operand(ecx, times_4, -4));
|
|
|
|
__ add(esi, Operand(ecx, times_4, -1999));
|
2008-08-22 13:33:59 +00:00
|
|
|
__ nop();
|
|
|
|
__ add(edi, Operand(ebp, ecx, times_4, 0));
|
|
|
|
__ add(edi, Operand(ebp, ecx, times_4, 12));
|
2014-03-05 09:28:26 +00:00
|
|
|
__ add(edi, Operand(ebp, ecx, times_4, -8));
|
|
|
|
__ add(edi, Operand(ebp, ecx, times_4, -3999));
|
2008-08-22 13:33:59 +00:00
|
|
|
__ add(Operand(ebp, ecx, times_4, 12), Immediate(12));
|
|
|
|
|
2018-08-14 08:39:05 +00:00
|
|
|
__ bswap(eax);
|
|
|
|
|
2008-08-22 13:33:59 +00:00
|
|
|
__ nop();
|
2011-10-03 11:44:39 +00:00
|
|
|
__ add(ebx, Immediate(12));
|
2008-08-22 13:33:59 +00:00
|
|
|
__ nop();
|
2016-03-14 15:33:15 +00:00
|
|
|
__ adc(edx, Operand(ebx));
|
2008-08-22 13:33:59 +00:00
|
|
|
__ adc(ecx, 12);
|
|
|
|
__ adc(ecx, 1000);
|
|
|
|
__ nop();
|
|
|
|
__ and_(edx, 3);
|
|
|
|
__ and_(edx, Operand(esp, 4));
|
|
|
|
__ cmp(edx, 3);
|
|
|
|
__ cmp(edx, Operand(esp, 4));
|
|
|
|
__ cmp(Operand(ebp, ecx, times_4, 0), Immediate(1000));
|
2019-03-11 19:04:02 +00:00
|
|
|
Handle<FixedArray> foo2 =
|
|
|
|
isolate->factory()->NewFixedArray(10, AllocationType::kOld);
|
2008-08-22 13:33:59 +00:00
|
|
|
__ cmp(ebx, foo2);
|
2010-01-21 12:10:56 +00:00
|
|
|
__ cmpb(ebx, Operand(ebp, ecx, times_2, 0));
|
|
|
|
__ cmpb(Operand(ebp, ecx, times_2, 0), ebx);
|
2008-08-22 13:33:59 +00:00
|
|
|
__ or_(edx, 3);
|
|
|
|
__ xor_(edx, 3);
|
|
|
|
__ nop();
|
2013-08-26 09:37:39 +00:00
|
|
|
__ cpuid();
|
2011-10-03 11:44:39 +00:00
|
|
|
__ movsx_b(edx, ecx);
|
|
|
|
__ movsx_w(edx, ecx);
|
|
|
|
__ movzx_b(edx, ecx);
|
|
|
|
__ movzx_w(edx, ecx);
|
2008-08-22 13:33:59 +00:00
|
|
|
|
|
|
|
__ nop();
|
2011-10-03 11:44:39 +00:00
|
|
|
__ imul(edx, ecx);
|
2016-03-07 15:17:54 +00:00
|
|
|
__ shld(edx, ecx, 10);
|
|
|
|
__ shld_cl(edx, ecx);
|
2016-03-09 16:37:29 +00:00
|
|
|
__ shrd(edx, ecx, 10);
|
|
|
|
__ shrd_cl(edx, ecx);
|
2011-10-03 11:44:39 +00:00
|
|
|
__ bts(edx, ecx);
|
2008-08-22 13:33:59 +00:00
|
|
|
__ bts(Operand(ebx, ecx, times_4, 0), ecx);
|
|
|
|
__ nop();
|
|
|
|
__ pushad();
|
|
|
|
__ popad();
|
|
|
|
__ pushfd();
|
|
|
|
__ popfd();
|
|
|
|
__ push(Immediate(12));
|
|
|
|
__ push(Immediate(23456));
|
|
|
|
__ push(ecx);
|
|
|
|
__ push(esi);
|
|
|
|
__ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
|
|
|
|
__ push(Operand(ebx, ecx, times_4, 0));
|
|
|
|
__ push(Operand(ebx, ecx, times_4, 0));
|
|
|
|
__ push(Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ pop(edx);
|
|
|
|
__ pop(eax);
|
|
|
|
__ pop(Operand(ebx, ecx, times_4, 0));
|
|
|
|
__ nop();
|
|
|
|
|
|
|
|
__ add(edx, Operand(esp, 16));
|
2011-10-03 11:44:39 +00:00
|
|
|
__ add(edx, ecx);
|
|
|
|
__ mov_b(edx, ecx);
|
|
|
|
__ mov_b(ecx, 6);
|
2008-08-22 13:33:59 +00:00
|
|
|
__ mov_b(Operand(ebx, ecx, times_4, 10000), 6);
|
|
|
|
__ mov_b(Operand(esp, 16), edx);
|
|
|
|
__ mov_w(edx, Operand(esp, 16));
|
|
|
|
__ mov_w(Operand(esp, 16), edx);
|
|
|
|
__ nop();
|
|
|
|
__ movsx_w(edx, Operand(esp, 12));
|
|
|
|
__ movsx_b(edx, Operand(esp, 12));
|
|
|
|
__ movzx_w(edx, Operand(esp, 12));
|
|
|
|
__ movzx_b(edx, Operand(esp, 12));
|
|
|
|
__ nop();
|
|
|
|
__ mov(edx, 1234567);
|
|
|
|
__ mov(edx, Operand(esp, 12));
|
|
|
|
__ mov(Operand(ebx, ecx, times_4, 10000), Immediate(12345));
|
|
|
|
__ mov(Operand(ebx, ecx, times_4, 10000), edx);
|
|
|
|
__ nop();
|
|
|
|
__ dec_b(edx);
|
2010-09-23 19:01:56 +00:00
|
|
|
__ dec_b(Operand(eax, 10));
|
|
|
|
__ dec_b(Operand(ebx, ecx, times_4, 10000));
|
2008-08-22 13:33:59 +00:00
|
|
|
__ dec(edx);
|
|
|
|
__ cdq();
|
|
|
|
|
|
|
|
__ nop();
|
|
|
|
__ idiv(edx);
|
2014-07-30 13:54:45 +00:00
|
|
|
__ idiv(Operand(edx, ecx, times_1, 1));
|
|
|
|
__ idiv(Operand(esp, 12));
|
|
|
|
__ div(edx);
|
|
|
|
__ div(Operand(edx, ecx, times_1, 1));
|
|
|
|
__ div(Operand(esp, 12));
|
2008-08-22 13:33:59 +00:00
|
|
|
__ mul(edx);
|
|
|
|
__ neg(edx);
|
|
|
|
__ not_(edx);
|
|
|
|
__ test(Operand(ebx, ecx, times_4, 10000), Immediate(123456));
|
|
|
|
|
|
|
|
__ imul(edx, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ imul(edx, ecx, 12);
|
2014-07-30 13:54:45 +00:00
|
|
|
__ imul(edx, Operand(edx, eax, times_2, 42), 8);
|
2008-08-22 13:33:59 +00:00
|
|
|
__ imul(edx, ecx, 1000);
|
2014-07-30 13:54:45 +00:00
|
|
|
__ imul(edx, Operand(ebx, ecx, times_4, 1), 9000);
|
2008-08-22 13:33:59 +00:00
|
|
|
|
|
|
|
__ inc(edx);
|
|
|
|
__ inc(Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ push(Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ pop(Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ call(Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ jmp(Operand(ebx, ecx, times_4, 10000));
|
|
|
|
|
|
|
|
__ lea(edx, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ or_(edx, 12345);
|
|
|
|
__ or_(edx, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
|
|
|
|
__ nop();
|
|
|
|
|
|
|
|
__ rcl(edx, 1);
|
|
|
|
__ rcl(edx, 7);
|
2010-08-16 11:18:42 +00:00
|
|
|
__ rcr(edx, 1);
|
|
|
|
__ rcr(edx, 7);
|
2014-10-02 09:04:04 +00:00
|
|
|
__ ror(edx, 1);
|
|
|
|
__ ror(edx, 6);
|
|
|
|
__ ror_cl(edx);
|
|
|
|
__ ror(Operand(ebx, ecx, times_4, 10000), 1);
|
|
|
|
__ ror(Operand(ebx, ecx, times_4, 10000), 6);
|
|
|
|
__ ror_cl(Operand(ebx, ecx, times_4, 10000));
|
2008-08-22 13:33:59 +00:00
|
|
|
__ sar(edx, 1);
|
|
|
|
__ sar(edx, 6);
|
2009-11-17 08:35:43 +00:00
|
|
|
__ sar_cl(edx);
|
2014-07-30 13:54:45 +00:00
|
|
|
__ sar(Operand(ebx, ecx, times_4, 10000), 1);
|
|
|
|
__ sar(Operand(ebx, ecx, times_4, 10000), 6);
|
|
|
|
__ sar_cl(Operand(ebx, ecx, times_4, 10000));
|
2008-08-22 13:33:59 +00:00
|
|
|
__ sbb(edx, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ shl(edx, 1);
|
|
|
|
__ shl(edx, 6);
|
2009-11-17 08:35:43 +00:00
|
|
|
__ shl_cl(edx);
|
2014-07-30 13:54:45 +00:00
|
|
|
__ shl(Operand(ebx, ecx, times_4, 10000), 1);
|
|
|
|
__ shl(Operand(ebx, ecx, times_4, 10000), 6);
|
|
|
|
__ shl_cl(Operand(ebx, ecx, times_4, 10000));
|
2016-03-09 16:37:29 +00:00
|
|
|
__ shrd_cl(Operand(ebx, ecx, times_4, 10000), edx);
|
2009-11-17 10:24:27 +00:00
|
|
|
__ shr(edx, 1);
|
2008-08-22 13:33:59 +00:00
|
|
|
__ shr(edx, 7);
|
2009-11-17 08:35:43 +00:00
|
|
|
__ shr_cl(edx);
|
2014-07-30 13:54:45 +00:00
|
|
|
__ shr(Operand(ebx, ecx, times_4, 10000), 1);
|
|
|
|
__ shr(Operand(ebx, ecx, times_4, 10000), 6);
|
|
|
|
__ shr_cl(Operand(ebx, ecx, times_4, 10000));
|
2008-08-22 13:33:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Immediates
|
|
|
|
|
|
|
|
__ adc(edx, 12345);
|
|
|
|
|
2011-10-03 11:44:39 +00:00
|
|
|
__ add(ebx, Immediate(12));
|
2008-08-22 13:33:59 +00:00
|
|
|
__ add(Operand(edx, ecx, times_4, 10000), Immediate(12));
|
|
|
|
|
|
|
|
__ and_(ebx, 12345);
|
|
|
|
|
|
|
|
__ cmp(ebx, 12345);
|
2011-10-03 11:44:39 +00:00
|
|
|
__ cmp(ebx, Immediate(12));
|
2008-08-22 13:33:59 +00:00
|
|
|
__ cmp(Operand(edx, ecx, times_4, 10000), Immediate(12));
|
2016-03-21 10:08:43 +00:00
|
|
|
__ cmpb(eax, Immediate(100));
|
2008-08-22 13:33:59 +00:00
|
|
|
|
|
|
|
__ or_(ebx, 12345);
|
|
|
|
|
2011-10-03 11:44:39 +00:00
|
|
|
__ sub(ebx, Immediate(12));
|
2008-08-22 13:33:59 +00:00
|
|
|
__ sub(Operand(edx, ecx, times_4, 10000), Immediate(12));
|
|
|
|
|
|
|
|
__ xor_(ebx, 12345);
|
|
|
|
|
|
|
|
__ imul(edx, ecx, 12);
|
|
|
|
__ imul(edx, ecx, 1000);
|
|
|
|
|
2010-03-02 12:42:15 +00:00
|
|
|
__ cld();
|
2010-01-11 15:19:53 +00:00
|
|
|
__ rep_movs();
|
2010-03-02 12:42:15 +00:00
|
|
|
__ rep_stos();
|
2010-05-17 14:14:34 +00:00
|
|
|
__ stos();
|
2008-08-22 13:33:59 +00:00
|
|
|
|
|
|
|
__ sub(edx, Operand(ebx, ecx, times_4, 10000));
|
2011-10-03 11:44:39 +00:00
|
|
|
__ sub(edx, ebx);
|
2008-08-22 13:33:59 +00:00
|
|
|
|
|
|
|
__ test(edx, Immediate(12345));
|
|
|
|
__ test(edx, Operand(ebx, ecx, times_8, 10000));
|
2010-06-08 12:44:24 +00:00
|
|
|
__ test(Operand(esi, edi, times_1, -20000000), Immediate(300000000));
|
|
|
|
__ test_b(edx, Operand(ecx, ebx, times_2, 1000));
|
2016-03-21 10:08:43 +00:00
|
|
|
__ test_b(Operand(eax, -20), Immediate(0x9A));
|
2008-08-22 13:33:59 +00:00
|
|
|
__ nop();
|
|
|
|
|
|
|
|
__ xor_(edx, 12345);
|
|
|
|
__ xor_(edx, Operand(ebx, ecx, times_8, 10000));
|
|
|
|
__ bts(Operand(ebx, ecx, times_8, 10000), edx);
|
|
|
|
__ hlt();
|
|
|
|
__ int3();
|
|
|
|
__ ret(0);
|
|
|
|
__ ret(8);
|
|
|
|
|
|
|
|
// Calls
|
|
|
|
|
|
|
|
Label L1, L2;
|
|
|
|
__ bind(&L1);
|
|
|
|
__ nop();
|
|
|
|
__ call(&L1);
|
|
|
|
__ call(&L2);
|
|
|
|
__ nop();
|
|
|
|
__ bind(&L2);
|
|
|
|
__ call(Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ nop();
|
2017-08-01 08:15:46 +00:00
|
|
|
Handle<Code> ic = BUILTIN_CODE(isolate, LoadIC);
|
2008-09-22 13:57:03 +00:00
|
|
|
__ call(ic, RelocInfo::CODE_TARGET);
|
2008-08-22 13:33:59 +00:00
|
|
|
__ nop();
|
2008-09-22 13:57:03 +00:00
|
|
|
__ call(FUNCTION_ADDR(DummyStaticFunction), RelocInfo::RUNTIME_ENTRY);
|
2008-08-22 13:33:59 +00:00
|
|
|
__ nop();
|
|
|
|
|
|
|
|
__ jmp(&L1);
|
|
|
|
__ jmp(Operand(ebx, ecx, times_4, 10000));
|
2008-09-22 13:57:03 +00:00
|
|
|
__ jmp(ic, RelocInfo::CODE_TARGET);
|
2008-08-22 13:33:59 +00:00
|
|
|
__ nop();
|
|
|
|
|
|
|
|
|
|
|
|
Label Ljcc;
|
|
|
|
__ nop();
|
|
|
|
// long jumps
|
|
|
|
__ j(overflow, &Ljcc);
|
|
|
|
__ j(no_overflow, &Ljcc);
|
|
|
|
__ j(below, &Ljcc);
|
|
|
|
__ j(above_equal, &Ljcc);
|
|
|
|
__ j(equal, &Ljcc);
|
|
|
|
__ j(not_equal, &Ljcc);
|
|
|
|
__ j(below_equal, &Ljcc);
|
|
|
|
__ j(above, &Ljcc);
|
|
|
|
__ j(sign, &Ljcc);
|
|
|
|
__ j(not_sign, &Ljcc);
|
|
|
|
__ j(parity_even, &Ljcc);
|
|
|
|
__ j(parity_odd, &Ljcc);
|
|
|
|
__ j(less, &Ljcc);
|
|
|
|
__ j(greater_equal, &Ljcc);
|
|
|
|
__ j(less_equal, &Ljcc);
|
|
|
|
__ j(greater, &Ljcc);
|
|
|
|
__ nop();
|
|
|
|
__ bind(&Ljcc);
|
|
|
|
// short jumps
|
|
|
|
__ j(overflow, &Ljcc);
|
|
|
|
__ j(no_overflow, &Ljcc);
|
|
|
|
__ j(below, &Ljcc);
|
|
|
|
__ j(above_equal, &Ljcc);
|
|
|
|
__ j(equal, &Ljcc);
|
|
|
|
__ j(not_equal, &Ljcc);
|
|
|
|
__ j(below_equal, &Ljcc);
|
|
|
|
__ j(above, &Ljcc);
|
|
|
|
__ j(sign, &Ljcc);
|
|
|
|
__ j(not_sign, &Ljcc);
|
|
|
|
__ j(parity_even, &Ljcc);
|
|
|
|
__ j(parity_odd, &Ljcc);
|
|
|
|
__ j(less, &Ljcc);
|
|
|
|
__ j(greater_equal, &Ljcc);
|
|
|
|
__ j(less_equal, &Ljcc);
|
|
|
|
__ j(greater, &Ljcc);
|
|
|
|
|
|
|
|
// 0xD9 instructions
|
|
|
|
__ nop();
|
|
|
|
|
2010-09-24 12:55:17 +00:00
|
|
|
__ fld(1);
|
2008-08-22 13:33:59 +00:00
|
|
|
__ fld1();
|
|
|
|
__ fldz();
|
2010-09-24 12:55:17 +00:00
|
|
|
__ fldpi();
|
2008-08-22 13:33:59 +00:00
|
|
|
__ fabs();
|
|
|
|
__ fchs();
|
|
|
|
__ fprem();
|
|
|
|
__ fprem1();
|
|
|
|
__ fincstp();
|
|
|
|
__ ftst();
|
|
|
|
__ fxch(3);
|
|
|
|
__ fld_s(Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ fstp_s(Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ ffree(3);
|
|
|
|
__ fld_d(Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ fstp_d(Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ nop();
|
|
|
|
|
|
|
|
__ fild_s(Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ fistp_s(Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ fild_d(Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ fistp_d(Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ fnstsw_ax();
|
|
|
|
__ nop();
|
|
|
|
__ fadd(3);
|
|
|
|
__ fsub(3);
|
|
|
|
__ fmul(3);
|
|
|
|
__ fdiv(3);
|
|
|
|
|
|
|
|
__ faddp(3);
|
|
|
|
__ fsubp(3);
|
|
|
|
__ fmulp(3);
|
|
|
|
__ fdivp(3);
|
|
|
|
__ fcompp();
|
|
|
|
__ fwait();
|
2014-02-03 08:13:12 +00:00
|
|
|
__ frndint();
|
|
|
|
__ fninit();
|
2008-08-22 13:33:59 +00:00
|
|
|
__ nop();
|
2013-11-18 15:24:41 +00:00
|
|
|
|
|
|
|
// SSE instruction
|
|
|
|
{
|
2014-05-09 13:01:50 +00:00
|
|
|
// Move operation
|
|
|
|
__ movaps(xmm0, xmm1);
|
2016-07-13 13:53:04 +00:00
|
|
|
__ movups(xmm0, xmm1);
|
|
|
|
__ movups(xmm0, Operand(edx, 4));
|
|
|
|
__ movups(Operand(edx, 4), xmm0);
|
2014-05-09 13:01:50 +00:00
|
|
|
__ shufps(xmm0, xmm0, 0x0);
|
2014-10-13 07:12:57 +00:00
|
|
|
__ cvtsd2ss(xmm0, xmm1);
|
|
|
|
__ cvtsd2ss(xmm0, Operand(ebx, ecx, times_4, 10000));
|
2018-08-08 21:30:51 +00:00
|
|
|
__ movq(xmm0, Operand(edx, 4));
|
2014-05-09 13:01:50 +00:00
|
|
|
|
|
|
|
// logic operation
|
|
|
|
__ andps(xmm0, xmm1);
|
|
|
|
__ andps(xmm0, Operand(ebx, ecx, times_4, 10000));
|
2019-03-21 20:30:49 +00:00
|
|
|
__ andnps(xmm0, xmm1);
|
|
|
|
__ andnps(xmm0, Operand(ebx, ecx, times_4, 10000));
|
2014-05-09 13:01:50 +00:00
|
|
|
__ orps(xmm0, xmm1);
|
|
|
|
__ orps(xmm0, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ xorps(xmm0, xmm1);
|
|
|
|
__ xorps(xmm0, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
|
|
|
|
// Arithmetic operation
|
2014-12-02 15:30:03 +00:00
|
|
|
__ addss(xmm1, xmm0);
|
|
|
|
__ addss(xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ mulss(xmm1, xmm0);
|
|
|
|
__ mulss(xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ subss(xmm1, xmm0);
|
|
|
|
__ subss(xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ divss(xmm1, xmm0);
|
|
|
|
__ divss(xmm1, Operand(ebx, ecx, times_4, 10000));
|
2015-03-30 07:33:46 +00:00
|
|
|
__ maxss(xmm1, xmm0);
|
|
|
|
__ maxss(xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ minss(xmm1, xmm0);
|
|
|
|
__ minss(xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ sqrtss(xmm1, xmm0);
|
|
|
|
__ sqrtss(xmm1, Operand(ebx, ecx, times_4, 10000));
|
2014-05-09 13:01:50 +00:00
|
|
|
__ addps(xmm1, xmm0);
|
|
|
|
__ addps(xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ subps(xmm1, xmm0);
|
|
|
|
__ subps(xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ mulps(xmm1, xmm0);
|
|
|
|
__ mulps(xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ divps(xmm1, xmm0);
|
|
|
|
__ divps(xmm1, Operand(ebx, ecx, times_4, 10000));
|
2017-03-15 02:01:05 +00:00
|
|
|
__ minps(xmm1, xmm0);
|
|
|
|
__ minps(xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ maxps(xmm1, xmm0);
|
|
|
|
__ maxps(xmm1, Operand(ebx, ecx, times_4, 10000));
|
2017-05-15 09:00:42 +00:00
|
|
|
__ rcpps(xmm1, xmm0);
|
|
|
|
__ rcpps(xmm1, Operand(ebx, ecx, times_4, 10000));
|
2019-09-13 22:23:52 +00:00
|
|
|
__ sqrtps(xmm1, xmm0);
|
|
|
|
__ sqrtps(xmm1, Operand(ebx, ecx, times_4, 10000));
|
2017-05-15 09:00:42 +00:00
|
|
|
__ rsqrtps(xmm1, xmm0);
|
|
|
|
__ rsqrtps(xmm1, Operand(ebx, ecx, times_4, 10000));
|
2014-12-02 15:30:03 +00:00
|
|
|
|
2017-04-28 01:56:26 +00:00
|
|
|
__ cmpeqps(xmm5, xmm1);
|
|
|
|
__ cmpeqps(xmm5, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ cmpltps(xmm5, xmm1);
|
|
|
|
__ cmpltps(xmm5, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ cmpleps(xmm5, xmm1);
|
|
|
|
__ cmpleps(xmm5, Operand(ebx, ecx, times_4, 10000));
|
2019-10-09 19:33:51 +00:00
|
|
|
__ cmpunordps(xmm5, xmm1);
|
|
|
|
__ cmpunordps(xmm5, Operand(ebx, ecx, times_4, 10000));
|
2017-04-28 01:56:26 +00:00
|
|
|
__ cmpneqps(xmm5, xmm1);
|
|
|
|
__ cmpneqps(xmm5, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
|
2014-12-02 15:30:03 +00:00
|
|
|
__ ucomiss(xmm0, xmm1);
|
|
|
|
__ ucomiss(xmm0, Operand(ebx, ecx, times_4, 10000));
|
2013-11-18 15:24:41 +00:00
|
|
|
}
|
2008-08-22 13:33:59 +00:00
|
|
|
{
|
2014-05-09 13:01:50 +00:00
|
|
|
__ cvttss2si(edx, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ cvtsi2sd(xmm1, Operand(ebx, ecx, times_4, 10000));
|
2014-10-13 07:42:35 +00:00
|
|
|
__ cvtss2sd(xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ cvtss2sd(xmm1, xmm0);
|
2017-05-15 09:00:42 +00:00
|
|
|
__ cvtdq2ps(xmm1, xmm0);
|
|
|
|
__ cvtdq2ps(xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ cvttps2dq(xmm1, xmm0);
|
|
|
|
__ cvttps2dq(xmm1, Operand(ebx, ecx, times_4, 10000));
|
2014-05-09 13:01:50 +00:00
|
|
|
__ movsd(xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ movsd(Operand(ebx, ecx, times_4, 10000), xmm1);
|
|
|
|
// 128 bit move instructions.
|
|
|
|
__ movdqa(xmm0, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ movdqa(Operand(ebx, ecx, times_4, 10000), xmm0);
|
|
|
|
__ movdqu(xmm0, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ movdqu(Operand(ebx, ecx, times_4, 10000), xmm0);
|
|
|
|
|
2019-10-09 19:33:51 +00:00
|
|
|
__ movapd(xmm0, xmm1);
|
|
|
|
__ movapd(xmm0, Operand(edx, 4));
|
|
|
|
|
2017-06-12 01:57:05 +00:00
|
|
|
__ movd(xmm0, edi);
|
|
|
|
__ movd(xmm0, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ movd(eax, xmm1);
|
|
|
|
__ movd(Operand(ebx, ecx, times_4, 10000), xmm1);
|
|
|
|
|
2014-05-09 13:01:50 +00:00
|
|
|
__ addsd(xmm1, xmm0);
|
2014-11-03 05:56:55 +00:00
|
|
|
__ addsd(xmm1, Operand(ebx, ecx, times_4, 10000));
|
2014-05-09 13:01:50 +00:00
|
|
|
__ mulsd(xmm1, xmm0);
|
2014-11-03 05:56:55 +00:00
|
|
|
__ mulsd(xmm1, Operand(ebx, ecx, times_4, 10000));
|
2014-05-09 13:01:50 +00:00
|
|
|
__ subsd(xmm1, xmm0);
|
2014-09-19 14:25:13 +00:00
|
|
|
__ subsd(xmm1, Operand(ebx, ecx, times_4, 10000));
|
2014-05-09 13:01:50 +00:00
|
|
|
__ divsd(xmm1, xmm0);
|
2014-11-03 05:56:55 +00:00
|
|
|
__ divsd(xmm1, Operand(ebx, ecx, times_4, 10000));
|
2015-03-12 14:07:28 +00:00
|
|
|
__ minsd(xmm1, xmm0);
|
|
|
|
__ minsd(xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ maxsd(xmm1, xmm0);
|
|
|
|
__ maxsd(xmm1, Operand(ebx, ecx, times_4, 10000));
|
2018-03-03 08:53:21 +00:00
|
|
|
__ sqrtsd(xmm1, xmm0);
|
|
|
|
__ sqrtsd(xmm1, Operand(ebx, ecx, times_4, 10000));
|
2014-05-09 13:01:50 +00:00
|
|
|
__ ucomisd(xmm0, xmm1);
|
|
|
|
__ cmpltsd(xmm0, xmm1);
|
|
|
|
|
|
|
|
__ andpd(xmm0, xmm1);
|
2019-10-02 18:05:48 +00:00
|
|
|
__ andpd(xmm0, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ andnpd(xmm0, xmm1);
|
|
|
|
__ andnpd(xmm0, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ orpd(xmm0, xmm1);
|
|
|
|
__ orpd(xmm0, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ xorpd(xmm0, xmm1);
|
|
|
|
__ xorpd(xmm0, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ addpd(xmm1, xmm0);
|
|
|
|
__ addpd(xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ subpd(xmm1, xmm0);
|
|
|
|
__ subpd(xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ mulpd(xmm1, xmm0);
|
|
|
|
__ mulpd(xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ divpd(xmm1, xmm0);
|
|
|
|
__ divpd(xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ minpd(xmm1, xmm0);
|
|
|
|
__ minpd(xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ maxpd(xmm1, xmm0);
|
|
|
|
__ maxpd(xmm1, Operand(ebx, ecx, times_4, 10000));
|
2017-03-14 08:01:20 +00:00
|
|
|
|
2019-10-04 21:28:18 +00:00
|
|
|
__ cmpeqpd(xmm5, xmm1);
|
|
|
|
__ cmpeqpd(xmm5, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ cmpltpd(xmm5, xmm1);
|
|
|
|
__ cmpltpd(xmm5, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ cmplepd(xmm5, xmm1);
|
|
|
|
__ cmplepd(xmm5, Operand(ebx, ecx, times_4, 10000));
|
2019-10-09 19:33:51 +00:00
|
|
|
__ cmpunordpd(xmm5, xmm1);
|
|
|
|
__ cmpunordpd(xmm5, Operand(ebx, ecx, times_4, 10000));
|
2019-10-04 21:28:18 +00:00
|
|
|
__ cmpneqpd(xmm5, xmm1);
|
|
|
|
__ cmpneqpd(xmm5, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
|
2017-03-14 08:01:20 +00:00
|
|
|
__ psllw(xmm0, 17);
|
|
|
|
__ pslld(xmm0, 17);
|
|
|
|
__ psrlw(xmm0, 17);
|
|
|
|
__ psrld(xmm0, 17);
|
|
|
|
__ psraw(xmm0, 17);
|
|
|
|
__ psrad(xmm0, 17);
|
2014-05-09 13:01:50 +00:00
|
|
|
__ psllq(xmm0, 17);
|
|
|
|
__ psllq(xmm0, xmm1);
|
|
|
|
__ psrlq(xmm0, 17);
|
|
|
|
__ psrlq(xmm0, xmm1);
|
2017-03-10 02:40:06 +00:00
|
|
|
|
2018-05-31 16:53:09 +00:00
|
|
|
__ pshufhw(xmm5, xmm1, 5);
|
|
|
|
__ pshufhw(xmm5, Operand(edx, 4), 5);
|
2017-06-13 02:06:17 +00:00
|
|
|
__ pshuflw(xmm5, xmm1, 5);
|
|
|
|
__ pshuflw(xmm5, Operand(edx, 4), 5);
|
2017-06-12 01:57:05 +00:00
|
|
|
__ pshufd(xmm5, xmm1, 5);
|
|
|
|
__ pshufd(xmm5, Operand(edx, 4), 5);
|
2017-03-10 02:40:06 +00:00
|
|
|
__ pinsrw(xmm5, edx, 5);
|
|
|
|
__ pinsrw(xmm5, Operand(edx, 4), 5);
|
|
|
|
|
|
|
|
#define EMIT_SSE2_INSTR(instruction, notUsed1, notUsed2, notUsed3) \
|
|
|
|
__ instruction(xmm5, xmm1); \
|
|
|
|
__ instruction(xmm5, Operand(edx, 4));
|
|
|
|
|
|
|
|
SSE2_INSTRUCTION_LIST(EMIT_SSE2_INSTR)
|
|
|
|
#undef EMIT_SSE2_INSTR
|
2008-08-22 13:33:59 +00:00
|
|
|
}
|
2009-10-08 13:28:46 +00:00
|
|
|
|
|
|
|
// cmov.
|
|
|
|
{
|
2014-05-13 08:16:26 +00:00
|
|
|
__ cmov(overflow, eax, Operand(eax, 0));
|
|
|
|
__ cmov(no_overflow, eax, Operand(eax, 1));
|
|
|
|
__ cmov(below, eax, Operand(eax, 2));
|
|
|
|
__ cmov(above_equal, eax, Operand(eax, 3));
|
|
|
|
__ cmov(equal, eax, Operand(ebx, 0));
|
|
|
|
__ cmov(not_equal, eax, Operand(ebx, 1));
|
|
|
|
__ cmov(below_equal, eax, Operand(ebx, 2));
|
|
|
|
__ cmov(above, eax, Operand(ebx, 3));
|
|
|
|
__ cmov(sign, eax, Operand(ecx, 0));
|
|
|
|
__ cmov(not_sign, eax, Operand(ecx, 1));
|
|
|
|
__ cmov(parity_even, eax, Operand(ecx, 2));
|
|
|
|
__ cmov(parity_odd, eax, Operand(ecx, 3));
|
|
|
|
__ cmov(less, eax, Operand(edx, 0));
|
|
|
|
__ cmov(greater_equal, eax, Operand(edx, 1));
|
|
|
|
__ cmov(less_equal, eax, Operand(edx, 2));
|
|
|
|
__ cmov(greater, eax, Operand(edx, 3));
|
2009-10-08 13:28:46 +00:00
|
|
|
}
|
|
|
|
|
2018-02-28 06:28:08 +00:00
|
|
|
{
|
|
|
|
if (CpuFeatures::IsSupported(SSE3)) {
|
|
|
|
CpuFeatureScope scope(&assm, SSE3);
|
|
|
|
__ haddps(xmm1, xmm0);
|
|
|
|
__ haddps(xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-07 13:51:30 +00:00
|
|
|
#define EMIT_SSE34_INSTR(instruction, notUsed1, notUsed2, notUsed3, notUsed4) \
|
|
|
|
__ instruction(xmm5, xmm1); \
|
|
|
|
__ instruction(xmm5, Operand(edx, 4));
|
|
|
|
|
2017-06-13 02:06:17 +00:00
|
|
|
{
|
|
|
|
if (CpuFeatures::IsSupported(SSSE3)) {
|
|
|
|
CpuFeatureScope scope(&assm, SSSE3);
|
2017-08-07 13:51:30 +00:00
|
|
|
SSSE3_INSTRUCTION_LIST(EMIT_SSE34_INSTR)
|
2018-05-31 16:53:09 +00:00
|
|
|
__ palignr(xmm5, xmm1, 5);
|
|
|
|
__ palignr(xmm5, Operand(edx, 4), 5);
|
2017-06-13 02:06:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-09 12:39:15 +00:00
|
|
|
{
|
2014-05-09 13:01:50 +00:00
|
|
|
if (CpuFeatures::IsSupported(SSE4_1)) {
|
2013-03-05 10:48:16 +00:00
|
|
|
CpuFeatureScope scope(&assm, SSE4_1);
|
2018-03-27 05:05:44 +00:00
|
|
|
__ pblendw(xmm5, xmm1, 5);
|
|
|
|
__ pblendw(xmm5, Operand(edx, 4), 5);
|
2017-06-13 02:06:17 +00:00
|
|
|
__ pextrb(eax, xmm0, 1);
|
|
|
|
__ pextrb(Operand(edx, 4), xmm0, 1);
|
|
|
|
__ pextrw(eax, xmm0, 1);
|
|
|
|
__ pextrw(Operand(edx, 4), xmm0, 1);
|
2011-10-03 11:44:39 +00:00
|
|
|
__ pextrd(eax, xmm0, 1);
|
2017-06-12 01:57:05 +00:00
|
|
|
__ pextrd(Operand(edx, 4), xmm0, 1);
|
2017-12-05 10:50:32 +00:00
|
|
|
__ insertps(xmm1, xmm2, 0);
|
|
|
|
__ insertps(xmm1, Operand(edx, 4), 0);
|
2017-06-13 02:06:17 +00:00
|
|
|
__ pinsrb(xmm1, eax, 0);
|
|
|
|
__ pinsrb(xmm1, Operand(edx, 4), 0);
|
2011-10-03 11:44:39 +00:00
|
|
|
__ pinsrd(xmm1, eax, 0);
|
2017-06-12 01:57:05 +00:00
|
|
|
__ pinsrd(xmm1, Operand(edx, 4), 0);
|
2013-10-15 12:51:58 +00:00
|
|
|
__ extractps(eax, xmm1, 0);
|
2017-03-14 02:00:13 +00:00
|
|
|
|
2017-08-07 13:51:30 +00:00
|
|
|
SSE4_INSTRUCTION_LIST(EMIT_SSE34_INSTR)
|
2018-06-25 02:21:36 +00:00
|
|
|
SSE4_RM_INSTRUCTION_LIST(EMIT_SSE34_INSTR)
|
2011-02-09 12:39:15 +00:00
|
|
|
}
|
|
|
|
}
|
2017-08-07 13:51:30 +00:00
|
|
|
#undef EMIT_SSE34_INSTR
|
2011-02-09 12:39:15 +00:00
|
|
|
|
2014-12-02 08:09:39 +00:00
|
|
|
// AVX instruction
|
|
|
|
{
|
|
|
|
if (CpuFeatures::IsSupported(AVX)) {
|
|
|
|
CpuFeatureScope scope(&assm, AVX);
|
|
|
|
__ vaddsd(xmm0, xmm1, xmm2);
|
|
|
|
__ vaddsd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vmulsd(xmm0, xmm1, xmm2);
|
|
|
|
__ vmulsd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vsubsd(xmm0, xmm1, xmm2);
|
|
|
|
__ vsubsd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vdivsd(xmm0, xmm1, xmm2);
|
|
|
|
__ vdivsd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
2015-03-12 14:07:28 +00:00
|
|
|
__ vminsd(xmm0, xmm1, xmm2);
|
|
|
|
__ vminsd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vmaxsd(xmm0, xmm1, xmm2);
|
|
|
|
__ vmaxsd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
2018-03-03 08:53:21 +00:00
|
|
|
__ vsqrtsd(xmm0, xmm1, xmm2);
|
|
|
|
__ vsqrtsd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
2015-03-30 07:33:46 +00:00
|
|
|
|
|
|
|
__ vaddss(xmm0, xmm1, xmm2);
|
|
|
|
__ vaddss(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vmulss(xmm0, xmm1, xmm2);
|
|
|
|
__ vmulss(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vsubss(xmm0, xmm1, xmm2);
|
|
|
|
__ vsubss(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vdivss(xmm0, xmm1, xmm2);
|
|
|
|
__ vdivss(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vminss(xmm0, xmm1, xmm2);
|
|
|
|
__ vminss(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vmaxss(xmm0, xmm1, xmm2);
|
|
|
|
__ vmaxss(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
2018-03-03 08:53:21 +00:00
|
|
|
__ vsqrtss(xmm0, xmm1, xmm2);
|
|
|
|
__ vsqrtss(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
2015-04-11 01:02:22 +00:00
|
|
|
|
|
|
|
__ vandps(xmm0, xmm1, xmm2);
|
|
|
|
__ vandps(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
2019-03-21 20:30:49 +00:00
|
|
|
__ vandnps(xmm0, xmm1, xmm2);
|
|
|
|
__ vandnps(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
2019-10-02 18:05:48 +00:00
|
|
|
__ vorps(xmm0, xmm1, xmm2);
|
|
|
|
__ vorps(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
2015-04-11 01:02:22 +00:00
|
|
|
__ vxorps(xmm0, xmm1, xmm2);
|
|
|
|
__ vxorps(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
2017-03-15 02:01:05 +00:00
|
|
|
__ vaddps(xmm0, xmm1, xmm2);
|
|
|
|
__ vaddps(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vmulps(xmm0, xmm1, xmm2);
|
|
|
|
__ vmulps(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vsubps(xmm0, xmm1, xmm2);
|
|
|
|
__ vsubps(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vminps(xmm0, xmm1, xmm2);
|
|
|
|
__ vminps(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vdivps(xmm0, xmm1, xmm2);
|
|
|
|
__ vdivps(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vmaxps(xmm0, xmm1, xmm2);
|
|
|
|
__ vmaxps(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
2017-05-15 09:00:42 +00:00
|
|
|
__ vrcpps(xmm1, xmm0);
|
|
|
|
__ vrcpps(xmm1, Operand(ebx, ecx, times_4, 10000));
|
2019-09-13 22:23:52 +00:00
|
|
|
__ vsqrtps(xmm1, xmm0);
|
|
|
|
__ vsqrtps(xmm1, Operand(ebx, ecx, times_4, 10000));
|
2017-05-15 09:00:42 +00:00
|
|
|
__ vrsqrtps(xmm1, xmm0);
|
|
|
|
__ vrsqrtps(xmm1, Operand(ebx, ecx, times_4, 10000));
|
2017-12-05 10:50:32 +00:00
|
|
|
__ vmovaps(xmm0, xmm1);
|
2019-10-09 19:33:51 +00:00
|
|
|
__ vmovapd(xmm0, xmm1);
|
|
|
|
__ vmovapd(xmm0, Operand(ebx, ecx, times_4, 10000));
|
2017-12-05 10:50:32 +00:00
|
|
|
__ vshufps(xmm0, xmm1, xmm2, 3);
|
|
|
|
__ vshufps(xmm0, xmm1, Operand(edx, 4), 3);
|
2018-02-28 06:28:08 +00:00
|
|
|
__ vhaddps(xmm0, xmm1, xmm2);
|
|
|
|
__ vhaddps(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
2015-04-11 01:02:22 +00:00
|
|
|
|
2017-04-28 01:56:26 +00:00
|
|
|
__ vcmpeqps(xmm5, xmm4, xmm1);
|
|
|
|
__ vcmpeqps(xmm5, xmm4, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vcmpltps(xmm5, xmm4, xmm1);
|
|
|
|
__ vcmpltps(xmm5, xmm4, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vcmpleps(xmm5, xmm4, xmm1);
|
|
|
|
__ vcmpleps(xmm5, xmm4, Operand(ebx, ecx, times_4, 10000));
|
2019-10-09 19:33:51 +00:00
|
|
|
__ vcmpunordps(xmm5, xmm4, xmm1);
|
|
|
|
__ vcmpunordps(xmm5, xmm4, Operand(ebx, ecx, times_4, 10000));
|
2017-04-28 01:56:26 +00:00
|
|
|
__ vcmpneqps(xmm5, xmm4, xmm1);
|
|
|
|
__ vcmpneqps(xmm5, xmm4, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
|
2015-04-11 01:02:22 +00:00
|
|
|
__ vandpd(xmm0, xmm1, xmm2);
|
|
|
|
__ vandpd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
2019-10-02 18:05:48 +00:00
|
|
|
__ vandnpd(xmm0, xmm1, xmm2);
|
|
|
|
__ vandnpd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vorpd(xmm0, xmm1, xmm2);
|
|
|
|
__ vorpd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
2015-04-11 01:02:22 +00:00
|
|
|
__ vxorpd(xmm0, xmm1, xmm2);
|
|
|
|
__ vxorpd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
2017-03-15 02:01:05 +00:00
|
|
|
__ vaddpd(xmm0, xmm1, xmm2);
|
|
|
|
__ vaddpd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vmulpd(xmm0, xmm1, xmm2);
|
|
|
|
__ vmulpd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vsubpd(xmm0, xmm1, xmm2);
|
|
|
|
__ vsubpd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vminpd(xmm0, xmm1, xmm2);
|
|
|
|
__ vminpd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vdivpd(xmm0, xmm1, xmm2);
|
|
|
|
__ vdivpd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vmaxpd(xmm0, xmm1, xmm2);
|
|
|
|
__ vmaxpd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
2017-03-10 02:40:06 +00:00
|
|
|
|
2019-10-04 21:28:18 +00:00
|
|
|
__ vcmpeqpd(xmm5, xmm4, xmm1);
|
|
|
|
__ vcmpeqpd(xmm5, xmm4, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vcmpltpd(xmm5, xmm4, xmm1);
|
|
|
|
__ vcmpltpd(xmm5, xmm4, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vcmplepd(xmm5, xmm4, xmm1);
|
|
|
|
__ vcmplepd(xmm5, xmm4, Operand(ebx, ecx, times_4, 10000));
|
2019-10-09 19:33:51 +00:00
|
|
|
__ vcmpunordpd(xmm5, xmm4, xmm1);
|
|
|
|
__ vcmpunordpd(xmm5, xmm4, Operand(ebx, ecx, times_4, 10000));
|
2019-10-04 21:28:18 +00:00
|
|
|
__ vcmpneqpd(xmm5, xmm4, xmm1);
|
|
|
|
__ vcmpneqpd(xmm5, xmm4, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
|
2017-03-14 08:01:20 +00:00
|
|
|
__ vpsllw(xmm0, xmm7, 21);
|
|
|
|
__ vpslld(xmm0, xmm7, 21);
|
|
|
|
__ vpsrlw(xmm0, xmm7, 21);
|
|
|
|
__ vpsrld(xmm0, xmm7, 21);
|
2019-10-09 19:33:51 +00:00
|
|
|
__ vpsrlq(xmm0, xmm7, 21);
|
2017-03-14 08:01:20 +00:00
|
|
|
__ vpsraw(xmm0, xmm7, 21);
|
|
|
|
__ vpsrad(xmm0, xmm7, 21);
|
2017-05-15 09:00:42 +00:00
|
|
|
|
2018-05-31 16:53:09 +00:00
|
|
|
__ vpshufhw(xmm5, xmm1, 5);
|
|
|
|
__ vpshufhw(xmm5, Operand(edx, 4), 5);
|
2017-06-13 02:06:17 +00:00
|
|
|
__ vpshuflw(xmm5, xmm1, 5);
|
|
|
|
__ vpshuflw(xmm5, Operand(edx, 4), 5);
|
2017-06-12 01:57:05 +00:00
|
|
|
__ vpshufd(xmm5, xmm1, 5);
|
|
|
|
__ vpshufd(xmm5, Operand(edx, 4), 5);
|
2018-03-27 05:05:44 +00:00
|
|
|
__ vpblendw(xmm5, xmm1, xmm0, 5);
|
|
|
|
__ vpblendw(xmm5, xmm1, Operand(edx, 4), 5);
|
2018-05-31 16:53:09 +00:00
|
|
|
__ vpalignr(xmm5, xmm1, xmm0, 5);
|
|
|
|
__ vpalignr(xmm5, xmm1, Operand(edx, 4), 5);
|
2017-06-13 02:06:17 +00:00
|
|
|
__ vpextrb(eax, xmm0, 1);
|
|
|
|
__ vpextrb(Operand(edx, 4), xmm0, 1);
|
|
|
|
__ vpextrw(eax, xmm0, 1);
|
|
|
|
__ vpextrw(Operand(edx, 4), xmm0, 1);
|
2017-06-12 01:57:05 +00:00
|
|
|
__ vpextrd(eax, xmm0, 1);
|
|
|
|
__ vpextrd(Operand(edx, 4), xmm0, 1);
|
2017-12-05 10:50:32 +00:00
|
|
|
__ vinsertps(xmm0, xmm1, xmm2, 0);
|
|
|
|
__ vinsertps(xmm0, xmm1, Operand(edx, 4), 0);
|
2017-06-13 02:06:17 +00:00
|
|
|
__ vpinsrb(xmm0, xmm1, eax, 0);
|
|
|
|
__ vpinsrb(xmm0, xmm1, Operand(edx, 4), 0);
|
|
|
|
__ vpinsrw(xmm0, xmm1, eax, 0);
|
|
|
|
__ vpinsrw(xmm0, xmm1, Operand(edx, 4), 0);
|
2017-06-12 01:57:05 +00:00
|
|
|
__ vpinsrd(xmm0, xmm1, eax, 0);
|
|
|
|
__ vpinsrd(xmm0, xmm1, Operand(edx, 4), 0);
|
|
|
|
|
2017-05-15 09:00:42 +00:00
|
|
|
__ vcvtdq2ps(xmm1, xmm0);
|
|
|
|
__ vcvtdq2ps(xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vcvttps2dq(xmm1, xmm0);
|
|
|
|
__ vcvttps2dq(xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
|
2017-12-08 02:27:23 +00:00
|
|
|
__ vmovdqu(xmm0, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vmovdqu(Operand(ebx, ecx, times_4, 10000), xmm0);
|
2017-06-12 01:57:05 +00:00
|
|
|
__ vmovd(xmm0, edi);
|
|
|
|
__ vmovd(xmm0, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vmovd(eax, xmm1);
|
|
|
|
__ vmovd(Operand(ebx, ecx, times_4, 10000), xmm1);
|
2017-03-10 02:40:06 +00:00
|
|
|
#define EMIT_SSE2_AVXINSTR(instruction, notUsed1, notUsed2, notUsed3) \
|
|
|
|
__ v##instruction(xmm7, xmm5, xmm1); \
|
|
|
|
__ v##instruction(xmm7, xmm5, Operand(edx, 4));
|
|
|
|
|
|
|
|
SSE2_INSTRUCTION_LIST(EMIT_SSE2_AVXINSTR)
|
|
|
|
#undef EMIT_SSE2_AVXINSTR
|
2017-03-14 02:00:13 +00:00
|
|
|
|
2017-08-07 13:51:30 +00:00
|
|
|
#define EMIT_SSE34_AVXINSTR(instruction, notUsed1, notUsed2, notUsed3, \
|
|
|
|
notUsed4) \
|
|
|
|
__ v##instruction(xmm7, xmm5, xmm1); \
|
2017-03-14 02:00:13 +00:00
|
|
|
__ v##instruction(xmm7, xmm5, Operand(edx, 4));
|
|
|
|
|
2017-08-07 13:51:30 +00:00
|
|
|
SSSE3_INSTRUCTION_LIST(EMIT_SSE34_AVXINSTR)
|
|
|
|
SSE4_INSTRUCTION_LIST(EMIT_SSE34_AVXINSTR)
|
|
|
|
#undef EMIT_SSE34_AVXINSTR
|
2018-06-25 02:21:36 +00:00
|
|
|
|
|
|
|
#define EMIT_SSE4_RM_AVXINSTR(instruction, notUsed1, notUsed2, notUsed3, \
|
|
|
|
notUsed4) \
|
|
|
|
__ v##instruction(xmm5, xmm1); \
|
|
|
|
__ v##instruction(xmm5, Operand(edx, 4));
|
|
|
|
|
|
|
|
SSE4_RM_INSTRUCTION_LIST(EMIT_SSE4_RM_AVXINSTR)
|
|
|
|
#undef EMIT_SSE4_RM_AVXINSTR
|
2014-12-02 08:09:39 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-12-02 15:30:03 +00:00
|
|
|
// FMA3 instruction
|
|
|
|
{
|
|
|
|
if (CpuFeatures::IsSupported(FMA3)) {
|
|
|
|
CpuFeatureScope scope(&assm, FMA3);
|
|
|
|
__ vfmadd132sd(xmm0, xmm1, xmm2);
|
|
|
|
__ vfmadd132sd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vfmadd213sd(xmm0, xmm1, xmm2);
|
|
|
|
__ vfmadd213sd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vfmadd231sd(xmm0, xmm1, xmm2);
|
|
|
|
__ vfmadd231sd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
|
|
|
|
__ vfmsub132sd(xmm0, xmm1, xmm2);
|
|
|
|
__ vfmsub132sd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vfmsub213sd(xmm0, xmm1, xmm2);
|
|
|
|
__ vfmsub213sd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vfmsub231sd(xmm0, xmm1, xmm2);
|
|
|
|
__ vfmsub231sd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
|
|
|
|
__ vfnmadd132sd(xmm0, xmm1, xmm2);
|
|
|
|
__ vfnmadd132sd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vfnmadd213sd(xmm0, xmm1, xmm2);
|
|
|
|
__ vfnmadd213sd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vfnmadd231sd(xmm0, xmm1, xmm2);
|
|
|
|
__ vfnmadd231sd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
|
|
|
|
__ vfnmsub132sd(xmm0, xmm1, xmm2);
|
|
|
|
__ vfnmsub132sd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vfnmsub213sd(xmm0, xmm1, xmm2);
|
|
|
|
__ vfnmsub213sd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vfnmsub231sd(xmm0, xmm1, xmm2);
|
|
|
|
__ vfnmsub231sd(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
|
|
|
|
__ vfmadd132ss(xmm0, xmm1, xmm2);
|
|
|
|
__ vfmadd132ss(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vfmadd213ss(xmm0, xmm1, xmm2);
|
|
|
|
__ vfmadd213ss(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vfmadd231ss(xmm0, xmm1, xmm2);
|
|
|
|
__ vfmadd231ss(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
|
|
|
|
__ vfmsub132ss(xmm0, xmm1, xmm2);
|
|
|
|
__ vfmsub132ss(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vfmsub213ss(xmm0, xmm1, xmm2);
|
|
|
|
__ vfmsub213ss(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vfmsub231ss(xmm0, xmm1, xmm2);
|
|
|
|
__ vfmsub231ss(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
|
|
|
|
__ vfnmadd132ss(xmm0, xmm1, xmm2);
|
|
|
|
__ vfnmadd132ss(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vfnmadd213ss(xmm0, xmm1, xmm2);
|
|
|
|
__ vfnmadd213ss(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vfnmadd231ss(xmm0, xmm1, xmm2);
|
|
|
|
__ vfnmadd231ss(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
|
|
|
|
__ vfnmsub132ss(xmm0, xmm1, xmm2);
|
|
|
|
__ vfnmsub132ss(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vfnmsub213ss(xmm0, xmm1, xmm2);
|
|
|
|
__ vfnmsub213ss(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ vfnmsub231ss(xmm0, xmm1, xmm2);
|
|
|
|
__ vfnmsub231ss(xmm0, xmm1, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-09 06:50:52 +00:00
|
|
|
// BMI1 instructions
|
|
|
|
{
|
|
|
|
if (CpuFeatures::IsSupported(BMI1)) {
|
|
|
|
CpuFeatureScope scope(&assm, BMI1);
|
|
|
|
__ andn(eax, ebx, ecx);
|
|
|
|
__ andn(eax, ebx, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ bextr(eax, ebx, ecx);
|
|
|
|
__ bextr(eax, Operand(ebx, ecx, times_4, 10000), ebx);
|
|
|
|
__ blsi(eax, ebx);
|
|
|
|
__ blsi(eax, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ blsmsk(eax, ebx);
|
|
|
|
__ blsmsk(eax, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ blsr(eax, ebx);
|
|
|
|
__ blsr(eax, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ tzcnt(eax, ebx);
|
|
|
|
__ tzcnt(eax, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// LZCNT instructions
|
|
|
|
{
|
|
|
|
if (CpuFeatures::IsSupported(LZCNT)) {
|
|
|
|
CpuFeatureScope scope(&assm, LZCNT);
|
|
|
|
__ lzcnt(eax, ebx);
|
|
|
|
__ lzcnt(eax, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// POPCNT instructions
|
|
|
|
{
|
|
|
|
if (CpuFeatures::IsSupported(POPCNT)) {
|
|
|
|
CpuFeatureScope scope(&assm, POPCNT);
|
|
|
|
__ popcnt(eax, ebx);
|
|
|
|
__ popcnt(eax, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// BMI2 instructions
|
|
|
|
{
|
|
|
|
if (CpuFeatures::IsSupported(BMI2)) {
|
|
|
|
CpuFeatureScope scope(&assm, BMI2);
|
|
|
|
__ bzhi(eax, ebx, ecx);
|
|
|
|
__ bzhi(eax, Operand(ebx, ecx, times_4, 10000), ebx);
|
|
|
|
__ mulx(eax, ebx, ecx);
|
|
|
|
__ mulx(eax, ebx, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ pdep(eax, ebx, ecx);
|
|
|
|
__ pdep(eax, ebx, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ pext(eax, ebx, ecx);
|
|
|
|
__ pext(eax, ebx, Operand(ebx, ecx, times_4, 10000));
|
|
|
|
__ sarx(eax, ebx, ecx);
|
|
|
|
__ sarx(eax, Operand(ebx, ecx, times_4, 10000), ebx);
|
|
|
|
__ shlx(eax, ebx, ecx);
|
|
|
|
__ shlx(eax, Operand(ebx, ecx, times_4, 10000), ebx);
|
|
|
|
__ shrx(eax, ebx, ecx);
|
|
|
|
__ shrx(eax, Operand(ebx, ecx, times_4, 10000), ebx);
|
|
|
|
__ rorx(eax, ebx, 31);
|
|
|
|
__ rorx(eax, Operand(ebx, ecx, times_4, 10000), 31);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-07-30 13:54:45 +00:00
|
|
|
// xchg.
|
|
|
|
{
|
2016-05-19 00:55:08 +00:00
|
|
|
__ xchg_b(eax, Operand(eax, 8));
|
|
|
|
__ xchg_w(eax, Operand(ebx, 8));
|
2014-07-30 13:54:45 +00:00
|
|
|
__ xchg(eax, eax);
|
|
|
|
__ xchg(eax, ebx);
|
|
|
|
__ xchg(ebx, ebx);
|
|
|
|
__ xchg(ebx, Operand(esp, 12));
|
|
|
|
}
|
|
|
|
|
2016-05-19 00:55:08 +00:00
|
|
|
// cmpxchg.
|
|
|
|
{
|
|
|
|
__ cmpxchg_b(Operand(esp, 12), eax);
|
|
|
|
__ cmpxchg_w(Operand(ebx, ecx, times_4, 10000), eax);
|
|
|
|
__ cmpxchg(Operand(ebx, ecx, times_4, 10000), eax);
|
2018-07-23 17:16:00 +00:00
|
|
|
__ cmpxchg(Operand(ebx, ecx, times_4, 10000), eax);
|
|
|
|
__ cmpxchg8b(Operand(ebx, ecx, times_8, 10000));
|
2016-05-19 00:55:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// lock prefix.
|
|
|
|
{
|
|
|
|
__ lock();
|
|
|
|
__ cmpxchg(Operand(esp, 12), ebx);
|
|
|
|
|
|
|
|
__ lock();
|
|
|
|
__ xchg_w(eax, Operand(ecx, 8));
|
|
|
|
}
|
|
|
|
|
2011-12-02 10:01:50 +00:00
|
|
|
// Nop instructions
|
|
|
|
for (int i = 0; i < 16; i++) {
|
|
|
|
__ Nop(i);
|
|
|
|
}
|
|
|
|
|
2019-07-18 09:10:30 +00:00
|
|
|
__ mfence();
|
|
|
|
__ lfence();
|
2018-06-05 16:11:40 +00:00
|
|
|
__ pause();
|
2008-08-22 13:33:59 +00:00
|
|
|
__ ret(0);
|
|
|
|
|
|
|
|
CodeDesc desc;
|
2017-05-31 14:00:11 +00:00
|
|
|
assm.GetCode(isolate, &desc);
|
2019-04-29 16:15:47 +00:00
|
|
|
Handle<Code> code = Factory::CodeBuilder(isolate, desc, Code::STUB).Build();
|
2014-04-16 11:50:24 +00:00
|
|
|
USE(code);
|
2011-01-03 09:32:42 +00:00
|
|
|
#ifdef OBJECT_PRINT
|
2018-06-14 12:46:07 +00:00
|
|
|
StdoutStream os;
|
2018-07-12 10:06:42 +00:00
|
|
|
code->Print(os);
|
2018-04-13 22:28:05 +00:00
|
|
|
Address begin = code->raw_instruction_start();
|
|
|
|
Address end = code->raw_instruction_end();
|
|
|
|
disasm::Disassembler::Disassemble(stdout, reinterpret_cast<byte*>(begin),
|
|
|
|
reinterpret_cast<byte*>(end));
|
2008-08-22 13:33:59 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef __
|
2017-08-31 12:34:55 +00:00
|
|
|
|
|
|
|
} // namespace internal
|
|
|
|
} // namespace v8
|