chromium/v8/test/unittests/assembler/assembler-x64-unittest.cc

// Copyright 2009 the V8 project authors. All rights reserved.
// 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 <cstdlib>
#include <cstring>
#include <iostream>

#include "include/v8-function.h"
#include "src/base/numbers/double.h"
#include "src/base/platform/platform.h"
#include "src/base/utils/random-number-generator.h"
#include "src/codegen/macro-assembler.h"
#include "src/execution/simulator.h"
#include "src/heap/factory.h"
#include "src/objects/objects-inl.h"
#include "src/utils/ostreams.h"
#include "test/common/assembler-tester.h"
#include "test/unittests/test-utils.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace v8 {
namespace internal {

// Test the x64 assembler by compiling some simple functions into
// a buffer and executing them.  These tests do not initialize the
// V8 library, create a context, or use any V8 objects.
// The AMD64 calling convention is used, with the first six arguments
// in RDI, RSI, RDX, RCX, R8, and R9, and floating point arguments in
// the XMM registers.  The return value is in RAX.
// This calling convention is used on Linux, with GCC, and on Mac OS,
// with GCC.  A different convention is used on 64-bit windows,
// where the first four integer arguments are passed in RCX, RDX, R8 and R9.

using AssemblerX64Test = TestWithIsolate;

F0;
F1;
F2;
F3;
F4;
F5;

#ifdef _WIN64
static const Register arg1 = rcx;
static const Register arg2 = rdx;
#else
static const Register arg1 =;
static const Register arg2 =;
#endif

#define __

TEST_F(AssemblerX64Test, AssemblerX64ReturnOperation) {}

TEST_F(AssemblerX64Test, AssemblerX64StackOperations) {}

TEST_F(AssemblerX64Test, AssemblerX64ArithmeticOperations) {}

TEST_F(AssemblerX64Test, AssemblerX64CmpbOperation) {}

TEST_F(AssemblerX64Test, AssemblerX64ImulOperation) {}

TEST_F(AssemblerX64Test, AssemblerX64testbwqOperation) {}

TEST_F(AssemblerX64Test, AssemblerX64XchglOperations) {}

TEST_F(AssemblerX64Test, AssemblerX64OrlOperations) {}

TEST_F(AssemblerX64Test, AssemblerX64RollOperations) {}

TEST_F(AssemblerX64Test, AssemblerX64SublOperations) {}

TEST_F(AssemblerX64Test, AssemblerX64TestlOperations) {}

TEST_F(AssemblerX64Test, AssemblerX64TestwOperations) {}

TEST_F(AssemblerX64Test, AssemblerX64XorlOperations) {}

TEST_F(AssemblerX64Test, AssemblerX64MemoryOperands) {}

TEST_F(AssemblerX64Test, AssemblerX64ControlFlow) {}

TEST_F(AssemblerX64Test, AssemblerX64LoopImmediates) {}

TEST_F(AssemblerX64Test, OperandRegisterDependency) {}

TEST_F(AssemblerX64Test, AssemblerX64LabelChaining) {}

TEST_F(AssemblerX64Test, AssemblerMultiByteNop) {}

#ifdef __GNUC__
#define ELEMENT_COUNT

void DoSSE2(const v8::FunctionCallbackInfo<v8::Value>& info) {}

TEST_F(AssemblerX64Test, StackAlignmentForSSE2) {}

#undef ELEMENT_COUNT
#endif  // __GNUC__

TEST_F(AssemblerX64Test, AssemblerX64Extractps) {}

F6;
TEST_F(AssemblerX64Test, AssemblerX64SSE) {}

TEST_F(AssemblerX64Test, AssemblerX64SSE3) {}

F7;
TEST_F(AssemblerX64Test, AssemblerX64FMA_sd) {}

F8;
TEST_F(AssemblerX64Test, AssemblerX64FMA_ss) {}

TEST_F(AssemblerX64Test, AssemblerX64SSE_ss) {}

TEST_F(AssemblerX64Test, AssemblerX64AVX_ss) {}

TEST_F(AssemblerX64Test, AssemblerX64AVX_sd) {}

TEST_F(AssemblerX64Test, AssemblerX64BMI1) {}

TEST_F(AssemblerX64Test, AssemblerX64LZCNT) {}

TEST_F(AssemblerX64Test, AssemblerX64POPCNT) {}

TEST_F(AssemblerX64Test, AssemblerX64BMI2) {}

TEST_F(AssemblerX64Test, AssemblerX64JumpTables1) {}

TEST_F(AssemblerX64Test, AssemblerX64JumpTables2) {}

TEST_F(AssemblerX64Test, AssemblerX64PslldWithXmm15) {}

F9;
TEST_F(AssemblerX64Test, AssemblerX64vmovups) {}

TEST_F(AssemblerX64Test, AssemblerX64Regmove256bit) {}

TEST_F(AssemblerX64Test, AssemblerX64AVX2Op256bit) {}

TEST_F(AssemblerX64Test, AssemblerX64FloatingPoint256bit) {}

TEST_F(AssemblerX64Test, AssemblerX64Integer256bit) {}

TEST_F(AssemblerX64Test, AssemblerX64CmpOperations256bit) {}

TEST_F(AssemblerX64Test, AssemblerX64FMA256bit) {}

TEST_F(AssemblerX64Test, AssemblerX64ShiftImm128bit) {}

TEST_F(AssemblerX64Test, AssemblerX64ShiftImm256bit) {}

TEST_F(AssemblerX64Test, AssemblerX64BinOp256bit) {}

TEST_F(AssemblerX64Test, F16C) {}

TEST_F(AssemblerX64Test, AssemblerX64AVXVNNI) {}

TEST_F(AssemblerX64Test, AssemblerX64AVXVNNIINT8) {}

TEST_F(AssemblerX64Test, CpuFeatures_ProbeImpl) {}

#undef __

}  // namespace internal
}  // namespace v8