Commit c4468c39 authored by Deepti Gandluri's avatar Deepti Gandluri Committed by Commit Bot

[wasm-simd] Remove simd lowering compilation env variable

Bug: v8:11613
Change-Id: I25bf720164129c3d95ebc07d0c2a0f6e6b8ee9af
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2847473Reviewed-by: 's avatarZhi An Ng <zhin@chromium.org>
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74131}
parent 7961ab1b
...@@ -7470,7 +7470,7 @@ wasm::WasmCompilationResult CompileWasmMathIntrinsic( ...@@ -7470,7 +7470,7 @@ wasm::WasmCompilationResult CompileWasmMathIntrinsic(
wasm::CompilationEnv env( wasm::CompilationEnv env(
nullptr, wasm::UseTrapHandler::kNoTrapHandler, nullptr, wasm::UseTrapHandler::kNoTrapHandler,
wasm::RuntimeExceptionSupport::kNoRuntimeExceptionSupport, wasm::RuntimeExceptionSupport::kNoRuntimeExceptionSupport,
wasm::WasmFeatures::All(), wasm::LowerSimd::kNoLowerSimd); wasm::WasmFeatures::All());
WasmGraphBuilder builder(&env, mcgraph->zone(), mcgraph, sig, WasmGraphBuilder builder(&env, mcgraph->zone(), mcgraph, sig,
source_positions); source_positions);
...@@ -7870,8 +7870,7 @@ wasm::WasmCompilationResult ExecuteTurbofanWasmCompilation( ...@@ -7870,8 +7870,7 @@ wasm::WasmCompilationResult ExecuteTurbofanWasmCompilation(
call_descriptor = GetI32WasmCallDescriptor(&zone, call_descriptor); call_descriptor = GetI32WasmCallDescriptor(&zone, call_descriptor);
} }
if (ContainsSimd(func_body.sig) && if (ContainsSimd(func_body.sig) && !CpuFeatures::SupportsWasmSimd128()) {
(!CpuFeatures::SupportsWasmSimd128() || env->lower_simd)) {
call_descriptor = GetI32WasmCallDescriptorForSimd(&zone, call_descriptor); call_descriptor = GetI32WasmCallDescriptorForSimd(&zone, call_descriptor);
} }
......
...@@ -38,8 +38,6 @@ enum RuntimeExceptionSupport : bool { ...@@ -38,8 +38,6 @@ enum RuntimeExceptionSupport : bool {
enum UseTrapHandler : bool { kUseTrapHandler = true, kNoTrapHandler = false }; enum UseTrapHandler : bool { kUseTrapHandler = true, kNoTrapHandler = false };
enum LowerSimd : bool { kLowerSimd = true, kNoLowerSimd = false };
// The {CompilationEnv} encapsulates the module data that is used during // The {CompilationEnv} encapsulates the module data that is used during
// compilation. CompilationEnvs are shareable across multiple compilations. // compilation. CompilationEnvs are shareable across multiple compilations.
struct CompilationEnv { struct CompilationEnv {
...@@ -66,8 +64,6 @@ struct CompilationEnv { ...@@ -66,8 +64,6 @@ struct CompilationEnv {
// Features enabled for this compilation. // Features enabled for this compilation.
const WasmFeatures enabled_features; const WasmFeatures enabled_features;
const LowerSimd lower_simd;
static constexpr uint32_t kMaxMemoryPagesAtRuntime = static constexpr uint32_t kMaxMemoryPagesAtRuntime =
std::min(kV8MaxWasmMemoryPages, std::min(kV8MaxWasmMemoryPages,
std::numeric_limits<uintptr_t>::max() / kWasmPageSize); std::numeric_limits<uintptr_t>::max() / kWasmPageSize);
...@@ -75,8 +71,7 @@ struct CompilationEnv { ...@@ -75,8 +71,7 @@ struct CompilationEnv {
constexpr CompilationEnv(const WasmModule* module, constexpr CompilationEnv(const WasmModule* module,
UseTrapHandler use_trap_handler, UseTrapHandler use_trap_handler,
RuntimeExceptionSupport runtime_exception_support, RuntimeExceptionSupport runtime_exception_support,
const WasmFeatures& enabled_features, const WasmFeatures& enabled_features)
LowerSimd lower_simd = kNoLowerSimd)
: module(module), : module(module),
use_trap_handler(use_trap_handler), use_trap_handler(use_trap_handler),
runtime_exception_support(runtime_exception_support), runtime_exception_support(runtime_exception_support),
...@@ -90,8 +85,7 @@ struct CompilationEnv { ...@@ -90,8 +85,7 @@ struct CompilationEnv {
module && module->has_maximum_pages ? module->maximum_pages module && module->has_maximum_pages ? module->maximum_pages
: max_mem_pages()) * : max_mem_pages()) *
uint64_t{kWasmPageSize})), uint64_t{kWasmPageSize})),
enabled_features(enabled_features), enabled_features(enabled_features) {}
lower_simd(lower_simd) {}
}; };
// The wire bytes are either owned by the StreamingDecoder, or (after streaming) // The wire bytes are either owned by the StreamingDecoder, or (after streaming)
......
...@@ -881,7 +881,7 @@ void NativeModule::LogWasmCodes(Isolate* isolate, Script script) { ...@@ -881,7 +881,7 @@ void NativeModule::LogWasmCodes(Isolate* isolate, Script script) {
CompilationEnv NativeModule::CreateCompilationEnv() const { CompilationEnv NativeModule::CreateCompilationEnv() const {
return {module(), use_trap_handler_, kRuntimeExceptionSupport, return {module(), use_trap_handler_, kRuntimeExceptionSupport,
enabled_features_, kNoLowerSimd}; enabled_features_};
} }
WasmCode* NativeModule::AddCodeForTesting(Handle<Code> code) { WasmCode* NativeModule::AddCodeForTesting(Handle<Code> code) {
......
...@@ -22,7 +22,7 @@ class LiftoffCompileEnvironment { ...@@ -22,7 +22,7 @@ class LiftoffCompileEnvironment {
handle_scope_(isolate_), handle_scope_(isolate_),
zone_(isolate_->allocator(), ZONE_NAME), zone_(isolate_->allocator(), ZONE_NAME),
wasm_runner_(nullptr, TestExecutionTier::kLiftoff, 0, wasm_runner_(nullptr, TestExecutionTier::kLiftoff, 0,
kRuntimeExceptionSupport, kNoLowerSimd) { kRuntimeExceptionSupport) {
// Add a table of length 1, for indirect calls. // Add a table of length 1, for indirect calls.
wasm_runner_.builder().AddIndirectFunctionTable(nullptr, 1); wasm_runner_.builder().AddIndirectFunctionTable(nullptr, 1);
// Set tiered down such that we generate debugging code. // Set tiered down such that we generate debugging code.
......
...@@ -16,20 +16,18 @@ namespace wasm { ...@@ -16,20 +16,18 @@ namespace wasm {
namespace test_run_wasm_relaxed_simd { namespace test_run_wasm_relaxed_simd {
// Use this for experimental relaxed-simd opcodes. // Use this for experimental relaxed-simd opcodes.
#define WASM_RELAXED_SIMD_TEST(name) \ #define WASM_RELAXED_SIMD_TEST(name) \
void RunWasm_##name##_Impl(LowerSimd lower_simd, \ void RunWasm_##name##_Impl(TestExecutionTier execution_tier); \
TestExecutionTier execution_tier); \ TEST(RunWasm_##name##_turbofan) { \
TEST(RunWasm_##name##_turbofan) { \ if (!CpuFeatures::SupportsWasmSimd128()) return; \
if (!CpuFeatures::SupportsWasmSimd128()) return; \ EXPERIMENTAL_FLAG_SCOPE(relaxed_simd); \
EXPERIMENTAL_FLAG_SCOPE(relaxed_simd); \ RunWasm_##name##_Impl(TestExecutionTier::kTurbofan); \
RunWasm_##name##_Impl(kNoLowerSimd, TestExecutionTier::kTurbofan); \ } \
} \ TEST(RunWasm_##name##_interpreter) { \
TEST(RunWasm_##name##_interpreter) { \ EXPERIMENTAL_FLAG_SCOPE(relaxed_simd); \
EXPERIMENTAL_FLAG_SCOPE(relaxed_simd); \ RunWasm_##name##_Impl(TestExecutionTier::kInterpreter); \
RunWasm_##name##_Impl(kNoLowerSimd, TestExecutionTier::kInterpreter); \ } \
} \ void RunWasm_##name##_Impl(TestExecutionTier execution_tier)
void RunWasm_##name##_Impl(LowerSimd lower_simd, \
TestExecutionTier execution_tier)
#if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_S390X || \ #if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_S390X || \
V8_TARGET_ARCH_PPC64 V8_TARGET_ARCH_PPC64
...@@ -125,7 +123,7 @@ bool ExpectFused(TestExecutionTier tier) { ...@@ -125,7 +123,7 @@ bool ExpectFused(TestExecutionTier tier) {
#if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_S390X || \ #if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_S390X || \
V8_TARGET_ARCH_PPC64 V8_TARGET_ARCH_PPC64
WASM_RELAXED_SIMD_TEST(F32x4Qfma) { WASM_RELAXED_SIMD_TEST(F32x4Qfma) {
WasmRunner<int32_t, float, float, float> r(execution_tier, lower_simd); WasmRunner<int32_t, float, float, float> r(execution_tier);
// Set up global to hold mask output. // Set up global to hold mask output.
float* g = r.builder().AddGlobal<float>(kWasmS128); float* g = r.builder().AddGlobal<float>(kWasmS128);
// Build fn to splat test values, perform compare op, and write the result. // Build fn to splat test values, perform compare op, and write the result.
...@@ -149,7 +147,7 @@ WASM_RELAXED_SIMD_TEST(F32x4Qfma) { ...@@ -149,7 +147,7 @@ WASM_RELAXED_SIMD_TEST(F32x4Qfma) {
} }
WASM_RELAXED_SIMD_TEST(F32x4Qfms) { WASM_RELAXED_SIMD_TEST(F32x4Qfms) {
WasmRunner<int32_t, float, float, float> r(execution_tier, lower_simd); WasmRunner<int32_t, float, float, float> r(execution_tier);
// Set up global to hold mask output. // Set up global to hold mask output.
float* g = r.builder().AddGlobal<float>(kWasmS128); float* g = r.builder().AddGlobal<float>(kWasmS128);
// Build fn to splat test values, perform compare op, and write the result. // Build fn to splat test values, perform compare op, and write the result.
...@@ -173,7 +171,7 @@ WASM_RELAXED_SIMD_TEST(F32x4Qfms) { ...@@ -173,7 +171,7 @@ WASM_RELAXED_SIMD_TEST(F32x4Qfms) {
} }
WASM_RELAXED_SIMD_TEST(F64x2Qfma) { WASM_RELAXED_SIMD_TEST(F64x2Qfma) {
WasmRunner<int32_t, double, double, double> r(execution_tier, lower_simd); WasmRunner<int32_t, double, double, double> r(execution_tier);
// Set up global to hold mask output. // Set up global to hold mask output.
double* g = r.builder().AddGlobal<double>(kWasmS128); double* g = r.builder().AddGlobal<double>(kWasmS128);
// Build fn to splat test values, perform compare op, and write the result. // Build fn to splat test values, perform compare op, and write the result.
...@@ -197,7 +195,7 @@ WASM_RELAXED_SIMD_TEST(F64x2Qfma) { ...@@ -197,7 +195,7 @@ WASM_RELAXED_SIMD_TEST(F64x2Qfma) {
} }
WASM_RELAXED_SIMD_TEST(F64x2Qfms) { WASM_RELAXED_SIMD_TEST(F64x2Qfms) {
WasmRunner<int32_t, double, double, double> r(execution_tier, lower_simd); WasmRunner<int32_t, double, double, double> r(execution_tier);
// Set up global to hold mask output. // Set up global to hold mask output.
double* g = r.builder().AddGlobal<double>(kWasmS128); double* g = r.builder().AddGlobal<double>(kWasmS128);
// Build fn to splat test values, perform compare op, and write the result. // Build fn to splat test values, perform compare op, and write the result.
...@@ -223,13 +221,13 @@ WASM_RELAXED_SIMD_TEST(F64x2Qfms) { ...@@ -223,13 +221,13 @@ WASM_RELAXED_SIMD_TEST(F64x2Qfms) {
// V8_TARGET_ARCH_PPC64 // V8_TARGET_ARCH_PPC64
WASM_RELAXED_SIMD_TEST(F32x4RecipApprox) { WASM_RELAXED_SIMD_TEST(F32x4RecipApprox) {
RunF32x4UnOpTest(execution_tier, lower_simd, kExprF32x4RecipApprox, RunF32x4UnOpTest(execution_tier, kExprF32x4RecipApprox, base::Recip,
base::Recip, false /* !exact */); false /* !exact */);
} }
WASM_RELAXED_SIMD_TEST(F32x4RecipSqrtApprox) { WASM_RELAXED_SIMD_TEST(F32x4RecipSqrtApprox) {
RunF32x4UnOpTest(execution_tier, lower_simd, kExprF32x4RecipSqrtApprox, RunF32x4UnOpTest(execution_tier, kExprF32x4RecipSqrtApprox, base::RecipSqrt,
base::RecipSqrt, false /* !exact */); false /* !exact */);
} }
#undef WASM_RELAXED_SIMD_TEST #undef WASM_RELAXED_SIMD_TEST
......
...@@ -30,14 +30,14 @@ namespace test_run_wasm_simd_liftoff { ...@@ -30,14 +30,14 @@ namespace test_run_wasm_simd_liftoff {
void RunWasm_##name##_Impl() void RunWasm_##name##_Impl()
WASM_SIMD_LIFTOFF_TEST(S128Local) { WASM_SIMD_LIFTOFF_TEST(S128Local) {
WasmRunner<int32_t> r(TestExecutionTier::kLiftoff, kNoLowerSimd); WasmRunner<int32_t> r(TestExecutionTier::kLiftoff);
byte temp1 = r.AllocateLocal(kWasmS128); byte temp1 = r.AllocateLocal(kWasmS128);
BUILD(r, WASM_LOCAL_SET(temp1, WASM_LOCAL_GET(temp1)), WASM_ONE); BUILD(r, WASM_LOCAL_SET(temp1, WASM_LOCAL_GET(temp1)), WASM_ONE);
CHECK_EQ(1, r.Call()); CHECK_EQ(1, r.Call());
} }
WASM_SIMD_LIFTOFF_TEST(S128Global) { WASM_SIMD_LIFTOFF_TEST(S128Global) {
WasmRunner<int32_t> r(TestExecutionTier::kLiftoff, kNoLowerSimd); WasmRunner<int32_t> r(TestExecutionTier::kLiftoff);
int32_t* g0 = r.builder().AddGlobal<int32_t>(kWasmS128); int32_t* g0 = r.builder().AddGlobal<int32_t>(kWasmS128);
int32_t* g1 = r.builder().AddGlobal<int32_t>(kWasmS128); int32_t* g1 = r.builder().AddGlobal<int32_t>(kWasmS128);
...@@ -58,7 +58,7 @@ WASM_SIMD_LIFTOFF_TEST(S128Param) { ...@@ -58,7 +58,7 @@ WASM_SIMD_LIFTOFF_TEST(S128Param) {
// Test how SIMD parameters in functions are processed. There is no easy way // Test how SIMD parameters in functions are processed. There is no easy way
// to specify a SIMD value when initializing a WasmRunner, so we manually // to specify a SIMD value when initializing a WasmRunner, so we manually
// add a new function with the right signature, and call it from main. // add a new function with the right signature, and call it from main.
WasmRunner<int32_t> r(TestExecutionTier::kLiftoff, kNoLowerSimd); WasmRunner<int32_t> r(TestExecutionTier::kLiftoff);
TestSignatures sigs; TestSignatures sigs;
// We use a temp local to materialize a SIMD value, since at this point // We use a temp local to materialize a SIMD value, since at this point
// Liftoff does not support any SIMD operations. // Liftoff does not support any SIMD operations.
...@@ -74,7 +74,7 @@ WASM_SIMD_LIFTOFF_TEST(S128Param) { ...@@ -74,7 +74,7 @@ WASM_SIMD_LIFTOFF_TEST(S128Param) {
WASM_SIMD_LIFTOFF_TEST(S128Return) { WASM_SIMD_LIFTOFF_TEST(S128Return) {
// Test how functions returning SIMD values are processed. // Test how functions returning SIMD values are processed.
WasmRunner<int32_t> r(TestExecutionTier::kLiftoff, kNoLowerSimd); WasmRunner<int32_t> r(TestExecutionTier::kLiftoff);
TestSignatures sigs; TestSignatures sigs;
WasmFunctionCompiler& simd_func = r.NewFunction(sigs.s_i()); WasmFunctionCompiler& simd_func = r.NewFunction(sigs.s_i());
byte temp1 = simd_func.AllocateLocal(kWasmS128); byte temp1 = simd_func.AllocateLocal(kWasmS128);
...@@ -93,7 +93,7 @@ WASM_SIMD_LIFTOFF_TEST(REGRESS_1088273) { ...@@ -93,7 +93,7 @@ WASM_SIMD_LIFTOFF_TEST(REGRESS_1088273) {
// explicitly skip them. // explicitly skip them.
if (!CpuFeatures::SupportsWasmSimd128()) return; if (!CpuFeatures::SupportsWasmSimd128()) return;
WasmRunner<int32_t> r(TestExecutionTier::kLiftoff, kNoLowerSimd); WasmRunner<int32_t> r(TestExecutionTier::kLiftoff);
TestSignatures sigs; TestSignatures sigs;
WasmFunctionCompiler& simd_func = r.NewFunction(sigs.s_i()); WasmFunctionCompiler& simd_func = r.NewFunction(sigs.s_i());
byte temp1 = simd_func.AllocateLocal(kWasmS128); byte temp1 = simd_func.AllocateLocal(kWasmS128);
...@@ -109,7 +109,7 @@ WASM_SIMD_LIFTOFF_TEST(REGRESS_1088273) { ...@@ -109,7 +109,7 @@ WASM_SIMD_LIFTOFF_TEST(REGRESS_1088273) {
// implementation in Liftoff is a bit more tricky due to shuffle requiring // implementation in Liftoff is a bit more tricky due to shuffle requiring
// adjacent registers in ARM/ARM64. // adjacent registers in ARM/ARM64.
WASM_SIMD_LIFTOFF_TEST(I8x16Shuffle) { WASM_SIMD_LIFTOFF_TEST(I8x16Shuffle) {
WasmRunner<int32_t> r(TestExecutionTier::kLiftoff, kNoLowerSimd); WasmRunner<int32_t> r(TestExecutionTier::kLiftoff);
// Temps to use up registers and force non-adjacent registers for shuffle. // Temps to use up registers and force non-adjacent registers for shuffle.
byte local0 = r.AllocateLocal(kWasmS128); byte local0 = r.AllocateLocal(kWasmS128);
byte local1 = r.AllocateLocal(kWasmS128); byte local1 = r.AllocateLocal(kWasmS128);
...@@ -154,7 +154,7 @@ WASM_SIMD_LIFTOFF_TEST(I8x16Shuffle) { ...@@ -154,7 +154,7 @@ WASM_SIMD_LIFTOFF_TEST(I8x16Shuffle) {
// Exercise logic in Liftoff's implementation of shuffle when inputs to the // Exercise logic in Liftoff's implementation of shuffle when inputs to the
// shuffle are the same register. // shuffle are the same register.
WASM_SIMD_LIFTOFF_TEST(I8x16Shuffle_SingleOperand) { WASM_SIMD_LIFTOFF_TEST(I8x16Shuffle_SingleOperand) {
WasmRunner<int32_t> r(TestExecutionTier::kLiftoff, kNoLowerSimd); WasmRunner<int32_t> r(TestExecutionTier::kLiftoff);
byte local0 = r.AllocateLocal(kWasmS128); byte local0 = r.AllocateLocal(kWasmS128);
byte* g0 = r.builder().AddGlobal<byte>(kWasmS128); byte* g0 = r.builder().AddGlobal<byte>(kWasmS128);
...@@ -190,7 +190,7 @@ WASM_SIMD_LIFTOFF_TEST(I8x16Shuffle_SingleOperand) { ...@@ -190,7 +190,7 @@ WASM_SIMD_LIFTOFF_TEST(I8x16Shuffle_SingleOperand) {
// incorrect instruction for storing zeroes into the slot when the slot offset // incorrect instruction for storing zeroes into the slot when the slot offset
// was too large to fit in the instruction as an immediate. // was too large to fit in the instruction as an immediate.
WASM_SIMD_LIFTOFF_TEST(FillStackSlotsWithZero_CheckStartOffset) { WASM_SIMD_LIFTOFF_TEST(FillStackSlotsWithZero_CheckStartOffset) {
WasmRunner<int64_t> r(TestExecutionTier::kLiftoff, kNoLowerSimd); WasmRunner<int64_t> r(TestExecutionTier::kLiftoff);
// Function that takes in 32 i64 arguments, returns i64. This gets us a large // Function that takes in 32 i64 arguments, returns i64. This gets us a large
// enough starting offset from which we spill locals. // enough starting offset from which we spill locals.
// start = 32 * 8 + 16 (instance) = 272 (cannot fit in signed int9). // start = 32 * 8 + 16 (instance) = 272 (cannot fit in signed int9).
......
This diff is collapsed.
...@@ -21,14 +21,12 @@ namespace wasm { ...@@ -21,14 +21,12 @@ namespace wasm {
TestingModuleBuilder::TestingModuleBuilder( TestingModuleBuilder::TestingModuleBuilder(
Zone* zone, ManuallyImportedJSFunction* maybe_import, Zone* zone, ManuallyImportedJSFunction* maybe_import,
TestExecutionTier tier, RuntimeExceptionSupport exception_support, TestExecutionTier tier, RuntimeExceptionSupport exception_support)
LowerSimd lower_simd)
: test_module_(std::make_shared<WasmModule>()), : test_module_(std::make_shared<WasmModule>()),
isolate_(CcTest::InitIsolateOnce()), isolate_(CcTest::InitIsolateOnce()),
enabled_features_(WasmFeatures::FromIsolate(isolate_)), enabled_features_(WasmFeatures::FromIsolate(isolate_)),
execution_tier_(tier), execution_tier_(tier),
runtime_exception_support_(exception_support), runtime_exception_support_(exception_support) {
lower_simd_(lower_simd) {
WasmJs::Install(isolate_, true); WasmJs::Install(isolate_, true);
test_module_->untagged_globals_buffer_size = kMaxGlobalsSize; test_module_->untagged_globals_buffer_size = kMaxGlobalsSize;
memset(globals_data_, 0, sizeof(globals_data_)); memset(globals_data_, 0, sizeof(globals_data_));
...@@ -313,7 +311,7 @@ CompilationEnv TestingModuleBuilder::CreateCompilationEnv() { ...@@ -313,7 +311,7 @@ CompilationEnv TestingModuleBuilder::CreateCompilationEnv() {
V8_TRAP_HANDLER_SUPPORTED && i::FLAG_wasm_trap_handler; V8_TRAP_HANDLER_SUPPORTED && i::FLAG_wasm_trap_handler;
return {test_module_.get(), return {test_module_.get(),
is_trap_handler_enabled ? kUseTrapHandler : kNoTrapHandler, is_trap_handler_enabled ? kUseTrapHandler : kNoTrapHandler,
runtime_exception_support_, enabled_features_, lower_simd()}; runtime_exception_support_, enabled_features_};
} }
const WasmGlobal* TestingModuleBuilder::AddGlobal(ValueType type) { const WasmGlobal* TestingModuleBuilder::AddGlobal(ValueType type) {
......
...@@ -98,7 +98,7 @@ struct ManuallyImportedJSFunction { ...@@ -98,7 +98,7 @@ struct ManuallyImportedJSFunction {
class TestingModuleBuilder { class TestingModuleBuilder {
public: public:
TestingModuleBuilder(Zone*, ManuallyImportedJSFunction*, TestExecutionTier, TestingModuleBuilder(Zone*, ManuallyImportedJSFunction*, TestExecutionTier,
RuntimeExceptionSupport, LowerSimd); RuntimeExceptionSupport);
~TestingModuleBuilder(); ~TestingModuleBuilder();
void ChangeOriginToAsmjs() { test_module_->origin = kAsmJsSloppyOrigin; } void ChangeOriginToAsmjs() { test_module_->origin = kAsmJsSloppyOrigin; }
...@@ -219,7 +219,6 @@ class TestingModuleBuilder { ...@@ -219,7 +219,6 @@ class TestingModuleBuilder {
WasmInterpreter* interpreter() const { return interpreter_.get(); } WasmInterpreter* interpreter() const { return interpreter_.get(); }
bool interpret() const { return interpreter_ != nullptr; } bool interpret() const { return interpreter_ != nullptr; }
LowerSimd lower_simd() const { return lower_simd_; }
Isolate* isolate() const { return isolate_; } Isolate* isolate() const { return isolate_; }
Handle<WasmInstanceObject> instance_object() const { Handle<WasmInstanceObject> instance_object() const {
return instance_object_; return instance_object_;
...@@ -273,7 +272,6 @@ class TestingModuleBuilder { ...@@ -273,7 +272,6 @@ class TestingModuleBuilder {
Handle<WasmInstanceObject> instance_object_; Handle<WasmInstanceObject> instance_object_;
NativeModule* native_module_ = nullptr; NativeModule* native_module_ = nullptr;
RuntimeExceptionSupport runtime_exception_support_; RuntimeExceptionSupport runtime_exception_support_;
LowerSimd lower_simd_;
// Data segment arrays that are normally allocated on the instance. // Data segment arrays that are normally allocated on the instance.
std::vector<byte> data_segment_data_; std::vector<byte> data_segment_data_;
...@@ -386,11 +384,10 @@ class WasmRunnerBase : public InitializedHandleScope { ...@@ -386,11 +384,10 @@ class WasmRunnerBase : public InitializedHandleScope {
public: public:
WasmRunnerBase(ManuallyImportedJSFunction* maybe_import, WasmRunnerBase(ManuallyImportedJSFunction* maybe_import,
TestExecutionTier execution_tier, int num_params, TestExecutionTier execution_tier, int num_params,
RuntimeExceptionSupport runtime_exception_support, RuntimeExceptionSupport runtime_exception_support)
LowerSimd lower_simd)
: zone_(&allocator_, ZONE_NAME, kCompressGraphZone), : zone_(&allocator_, ZONE_NAME, kCompressGraphZone),
builder_(&zone_, maybe_import, execution_tier, builder_(&zone_, maybe_import, execution_tier,
runtime_exception_support, lower_simd), runtime_exception_support),
wrapper_(&zone_, num_params) {} wrapper_(&zone_, num_params) {}
static void SetUpTrapCallback() { static void SetUpTrapCallback() {
...@@ -549,10 +546,9 @@ class WasmRunner : public WasmRunnerBase { ...@@ -549,10 +546,9 @@ class WasmRunner : public WasmRunnerBase {
ManuallyImportedJSFunction* maybe_import = nullptr, ManuallyImportedJSFunction* maybe_import = nullptr,
const char* main_fn_name = "main", const char* main_fn_name = "main",
RuntimeExceptionSupport runtime_exception_support = RuntimeExceptionSupport runtime_exception_support =
kNoRuntimeExceptionSupport, kNoRuntimeExceptionSupport)
LowerSimd lower_simd = kNoLowerSimd)
: WasmRunnerBase(maybe_import, execution_tier, sizeof...(ParamTypes), : WasmRunnerBase(maybe_import, execution_tier, sizeof...(ParamTypes),
runtime_exception_support, lower_simd) { runtime_exception_support) {
WasmFunctionCompiler& main_fn = WasmFunctionCompiler& main_fn =
NewFunction<ReturnType, ParamTypes...>(main_fn_name); NewFunction<ReturnType, ParamTypes...>(main_fn_name);
// Non-zero if there is an import. // Non-zero if there is an import.
...@@ -563,10 +559,6 @@ class WasmRunner : public WasmRunnerBase { ...@@ -563,10 +559,6 @@ class WasmRunner : public WasmRunnerBase {
} }
} }
WasmRunner(TestExecutionTier execution_tier, LowerSimd lower_simd)
: WasmRunner(execution_tier, nullptr, "main", kNoRuntimeExceptionSupport,
lower_simd) {}
ReturnType Call(ParamTypes... p) { ReturnType Call(ParamTypes... p) {
Isolate* isolate = CcTest::InitIsolateOnce(); Isolate* isolate = CcTest::InitIsolateOnce();
// Save the original context, because CEntry (for runtime calls) will // Save the original context, because CEntry (for runtime calls) will
......
This diff is collapsed.
...@@ -38,43 +38,41 @@ using DoubleUnOp = double (*)(double); ...@@ -38,43 +38,41 @@ using DoubleUnOp = double (*)(double);
using DoubleBinOp = double (*)(double, double); using DoubleBinOp = double (*)(double, double);
using DoubleCompareOp = int64_t (*)(double, double); using DoubleCompareOp = int64_t (*)(double, double);
void RunI8x16UnOpTest(TestExecutionTier execution_tier, LowerSimd lower_simd, void RunI8x16UnOpTest(TestExecutionTier execution_tier, WasmOpcode opcode,
WasmOpcode opcode, Int8UnOp expected_op); Int8UnOp expected_op);
template <typename T = int8_t, typename OpType = T (*)(T, T)> template <typename T = int8_t, typename OpType = T (*)(T, T)>
void RunI8x16BinOpTest(TestExecutionTier execution_tier, LowerSimd lower_simd, void RunI8x16BinOpTest(TestExecutionTier execution_tier, WasmOpcode opcode,
WasmOpcode opcode, OpType expected_op); OpType expected_op);
void RunI8x16ShiftOpTest(TestExecutionTier execution_tier, LowerSimd lower_simd, void RunI8x16ShiftOpTest(TestExecutionTier execution_tier, WasmOpcode opcode,
WasmOpcode opcode, Int8ShiftOp expected_op); Int8ShiftOp expected_op);
void RunI8x16MixedRelationalOpTest(TestExecutionTier execution_tier, void RunI8x16MixedRelationalOpTest(TestExecutionTier execution_tier,
LowerSimd lower_simd, WasmOpcode opcode, WasmOpcode opcode, Int8BinOp expected_op);
Int8BinOp expected_op);
void RunI16x8UnOpTest(TestExecutionTier execution_tier, LowerSimd lower_simd, void RunI16x8UnOpTest(TestExecutionTier execution_tier, WasmOpcode opcode,
WasmOpcode opcode, Int16UnOp expected_op); Int16UnOp expected_op);
template <typename T = int16_t, typename OpType = T (*)(T, T)> template <typename T = int16_t, typename OpType = T (*)(T, T)>
void RunI16x8BinOpTest(TestExecutionTier execution_tier, LowerSimd lower_simd, void RunI16x8BinOpTest(TestExecutionTier execution_tier, WasmOpcode opcode,
WasmOpcode opcode, OpType expected_op); OpType expected_op);
void RunI16x8ShiftOpTest(TestExecutionTier execution_tier, LowerSimd lower_simd, void RunI16x8ShiftOpTest(TestExecutionTier execution_tier, WasmOpcode opcode,
WasmOpcode opcode, Int16ShiftOp expected_op); Int16ShiftOp expected_op);
void RunI16x8MixedRelationalOpTest(TestExecutionTier execution_tier, void RunI16x8MixedRelationalOpTest(TestExecutionTier execution_tier,
LowerSimd lower_simd, WasmOpcode opcode, WasmOpcode opcode, Int16BinOp expected_op);
Int16BinOp expected_op);
void RunI32x4UnOpTest(TestExecutionTier execution_tier, WasmOpcode opcode,
void RunI32x4UnOpTest(TestExecutionTier execution_tier, LowerSimd lower_simd, Int32UnOp expected_op);
WasmOpcode opcode, Int32UnOp expected_op); void RunI32x4BinOpTest(TestExecutionTier execution_tier, WasmOpcode opcode,
void RunI32x4BinOpTest(TestExecutionTier execution_tier, LowerSimd lower_simd, Int32BinOp expected_op);
WasmOpcode opcode, Int32BinOp expected_op); void RunI32x4ShiftOpTest(TestExecutionTier execution_tier, WasmOpcode opcode,
void RunI32x4ShiftOpTest(TestExecutionTier execution_tier, LowerSimd lower_simd, Int32ShiftOp expected_op);
WasmOpcode opcode, Int32ShiftOp expected_op);
void RunI64x2UnOpTest(TestExecutionTier execution_tier, WasmOpcode opcode,
void RunI64x2UnOpTest(TestExecutionTier execution_tier, LowerSimd lower_simd, Int64UnOp expected_op);
WasmOpcode opcode, Int64UnOp expected_op); void RunI64x2BinOpTest(TestExecutionTier execution_tier, WasmOpcode opcode,
void RunI64x2BinOpTest(TestExecutionTier execution_tier, LowerSimd lower_simd, Int64BinOp expected_op);
WasmOpcode opcode, Int64BinOp expected_op); void RunI64x2ShiftOpTest(TestExecutionTier execution_tier, WasmOpcode opcode,
void RunI64x2ShiftOpTest(TestExecutionTier execution_tier, LowerSimd lower_simd, Int64ShiftOp expected_op);
WasmOpcode opcode, Int64ShiftOp expected_op);
// Generic expected value functions. // Generic expected value functions.
template <typename T, typename = typename std::enable_if< template <typename T, typename = typename std::enable_if<
...@@ -152,24 +150,20 @@ bool IsCanonical(double actual); ...@@ -152,24 +150,20 @@ bool IsCanonical(double actual);
void CheckDoubleResult(double x, double y, double expected, double actual, void CheckDoubleResult(double x, double y, double expected, double actual,
bool exact = true); bool exact = true);
void RunF32x4UnOpTest(TestExecutionTier execution_tier, LowerSimd lower_simd, void RunF32x4UnOpTest(TestExecutionTier execution_tier, WasmOpcode opcode,
WasmOpcode opcode, FloatUnOp expected_op, FloatUnOp expected_op, bool exact = true);
bool exact = true);
void RunF32x4BinOpTest(TestExecutionTier execution_tier, LowerSimd lower_simd, void RunF32x4BinOpTest(TestExecutionTier execution_tier, WasmOpcode opcode,
WasmOpcode opcode, FloatBinOp expected_op); FloatBinOp expected_op);
void RunF32x4CompareOpTest(TestExecutionTier execution_tier, void RunF32x4CompareOpTest(TestExecutionTier execution_tier, WasmOpcode opcode,
LowerSimd lower_simd, WasmOpcode opcode,
FloatCompareOp expected_op); FloatCompareOp expected_op);
void RunF64x2UnOpTest(TestExecutionTier execution_tier, LowerSimd lower_simd, void RunF64x2UnOpTest(TestExecutionTier execution_tier, WasmOpcode opcode,
WasmOpcode opcode, DoubleUnOp expected_op, DoubleUnOp expected_op, bool exact = true);
bool exact = true); void RunF64x2BinOpTest(TestExecutionTier execution_tier, WasmOpcode opcode,
void RunF64x2BinOpTest(TestExecutionTier execution_tier, LowerSimd lower_simd, DoubleBinOp expected_op);
WasmOpcode opcode, DoubleBinOp expected_op); void RunF64x2CompareOpTest(TestExecutionTier execution_tier, WasmOpcode opcode,
void RunF64x2CompareOpTest(TestExecutionTier execution_tier,
LowerSimd lower_simd, WasmOpcode opcode,
DoubleCompareOp expected_op); DoubleCompareOp expected_op);
} // namespace wasm } // namespace wasm
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment