Skip to content

Commit 5f2962c

Browse files
committed
[MERGE #5903 @penzn] [WASM SIMD update, part 2] Remove references to build instruction and m128 type
Merge pull request #5903 from penzn:wasm.simd.cleanup Some updates from WASM SIMD proposal: - `m128` (not to be confused with hardware m128) has been changed to `v128` - `build` instruction has been deprecated For #5838.
2 parents 22f0a42 + daddcff commit 5f2962c

12 files changed

+220
-268
lines changed

lib/Runtime/Language/InterpreterHandlerAsmJs.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ EXDEF2_WMS( SIMD_B8_1U8_2toU8_1 , Simd128_Select_U8 , Js::SIMDInt32x4Opera
420420
EXDEF2_WMS( SIMD_B16_1U16_2toU16_1 , Simd128_Select_U16 , Js::SIMDInt32x4Operation::OpSelect )
421421

422422
// args out, copy value to outParams
423-
EXDEF3_WMS ( CUSTOM_ASMJS , Simd128_ArgOut_F4 , (OP_InvalidWasmTypeConversion<Wasm::WasmTypes::M128,true>) , Reg1Float32x4_1)
423+
EXDEF3_WMS ( CUSTOM_ASMJS , Simd128_ArgOut_F4 , (OP_InvalidWasmTypeConversion<Wasm::WasmTypes::V128,true>) , Reg1Float32x4_1)
424424
EXDEF2_WMS ( SIMD_F4_1toR1Mem , Simd128_I_ArgOut_F4 , OP_I_SetOutAsmSimd )
425425
DEF2_WMS ( SIMD_I4_1toR1Mem , Simd128_I_ArgOut_I4 , OP_I_SetOutAsmSimd )
426426

lib/Runtime/Library/WebAssemblyEnvironment.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ Wasm::WasmConstLitNode WebAssemblyEnvironment::GetGlobalValue(Wasm::WasmGlobal*
161161
case Wasm::WasmTypes::F32: cnst.f32 = GetGlobalInternal<float>(offset); break;
162162
case Wasm::WasmTypes::F64: cnst.f64 = GetGlobalInternal<double>(offset); break;
163163
#ifdef ENABLE_WASM_SIMD
164-
case Wasm::WasmTypes::M128: AssertOrFailFastMsg(UNREACHED, "Wasm.Simd globals not supported");
164+
case Wasm::WasmTypes::V128: AssertOrFailFastMsg(UNREACHED, "Wasm.Simd globals not supported");
165165
#endif
166166
default:
167-
Wasm::WasmTypes::CompileAssertCases<Wasm::WasmTypes::I32, Wasm::WasmTypes::I64, Wasm::WasmTypes::F32, Wasm::WasmTypes::F64, WASM_M128_CHECK_TYPE>();
167+
Wasm::WasmTypes::CompileAssertCases<Wasm::WasmTypes::I32, Wasm::WasmTypes::I64, Wasm::WasmTypes::F32, Wasm::WasmTypes::F64, WASM_V128_CHECK_TYPE>();
168168
}
169169
return cnst;
170170
}
@@ -181,10 +181,10 @@ void WebAssemblyEnvironment::SetGlobalValue(Wasm::WasmGlobal* global, Wasm::Wasm
181181
case Wasm::WasmTypes::F32: SetGlobalInternal<float>(offset, cnst.f32); break;
182182
case Wasm::WasmTypes::F64: SetGlobalInternal<double>(offset, cnst.f64); break;
183183
#ifdef ENABLE_WASM_SIMD
184-
case Wasm::WasmTypes::M128: AssertOrFailFastMsg(UNREACHED, "Wasm.Simd globals not supported");
184+
case Wasm::WasmTypes::V128: AssertOrFailFastMsg(UNREACHED, "Wasm.Simd globals not supported");
185185
#endif
186186
default:
187-
Wasm::WasmTypes::CompileAssertCases<Wasm::WasmTypes::I32, Wasm::WasmTypes::I64, Wasm::WasmTypes::F32, Wasm::WasmTypes::F64, WASM_M128_CHECK_TYPE>();
187+
Wasm::WasmTypes::CompileAssertCases<Wasm::WasmTypes::I32, Wasm::WasmTypes::I64, Wasm::WasmTypes::F32, Wasm::WasmTypes::F64, WASM_V128_CHECK_TYPE>();
188188
}
189189
}
190190

lib/Runtime/Library/WebAssemblyInstance.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,11 @@ Var WebAssemblyInstance::CreateExportObject(WebAssemblyModule * wasmModule, Scri
251251
obj = JavascriptNumber::New(cnst.f64, scriptContext);
252252
break;
253253
#ifdef ENABLE_WASM_SIMD
254-
case Wasm::WasmTypes::M128:
255-
JavascriptError::ThrowTypeErrorVar(wasmModule->GetScriptContext(), WASMERR_InvalidTypeConversion, _u("m128"), _u("Var"));
254+
case Wasm::WasmTypes::V128:
255+
JavascriptError::ThrowTypeErrorVar(wasmModule->GetScriptContext(), WASMERR_InvalidTypeConversion, _u("v128"), _u("Var"));
256256
#endif
257257
default:
258-
Wasm::WasmTypes::CompileAssertCases<Wasm::WasmTypes::I32, Wasm::WasmTypes::I64, Wasm::WasmTypes::F32, Wasm::WasmTypes::F64, WASM_M128_CHECK_TYPE>();
258+
Wasm::WasmTypes::CompileAssertCases<Wasm::WasmTypes::I32, Wasm::WasmTypes::I64, Wasm::WasmTypes::F32, Wasm::WasmTypes::F64, WASM_V128_CHECK_TYPE>();
259259
}
260260
}
261261
JavascriptOperators::OP_SetProperty(exportsNamespace, propertyRecord->GetPropertyId(), obj, scriptContext);
@@ -387,10 +387,10 @@ void WebAssemblyInstance::LoadImports(
387387
case Wasm::WasmTypes::F64: cnst.f64 = JavascriptConversion::ToNumber(prop, ctx); break;
388388
case Wasm::WasmTypes::I64: Js::JavascriptError::ThrowTypeErrorVar(ctx, WASMERR_InvalidTypeConversion, _u("Var"), _u("i64"));
389389
#ifdef ENABLE_WASM_SIMD
390-
case Wasm::WasmTypes::M128: Js::JavascriptError::ThrowTypeErrorVar(ctx, WASMERR_InvalidTypeConversion, _u("Var"), _u("m128"));
390+
case Wasm::WasmTypes::V128: Js::JavascriptError::ThrowTypeErrorVar(ctx, WASMERR_InvalidTypeConversion, _u("Var"), _u("v128"));
391391
#endif
392392
default:
393-
Wasm::WasmTypes::CompileAssertCases<Wasm::WasmTypes::I32, Wasm::WasmTypes::I64, Wasm::WasmTypes::F32, Wasm::WasmTypes::F64, WASM_M128_CHECK_TYPE>();
393+
Wasm::WasmTypes::CompileAssertCases<Wasm::WasmTypes::I32, Wasm::WasmTypes::I64, Wasm::WasmTypes::F32, Wasm::WasmTypes::F64, WASM_V128_CHECK_TYPE>();
394394
}
395395
env->SetGlobalValue(global, cnst);
396396
break;

lib/Runtime/Library/WebAssemblyModule.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -497,11 +497,11 @@ WebAssemblyModule::AttachCustomInOutTracingReader(Wasm::WasmFunctionInfo* func,
497497
case Wasm::Local::F32: node.op = Wasm::wbPrintF32; break;
498498
case Wasm::Local::F64: node.op = Wasm::wbPrintF64; break;
499499
#ifdef ENABLE_WASM_SIMD
500-
// todo:: Add support to print m128 argument values
501-
case Wasm::WasmTypes::M128: continue;
500+
// todo:: Add support to print v128 argument values
501+
case Wasm::WasmTypes::V128: continue;
502502
#endif
503503
default:
504-
Wasm::WasmTypes::CompileAssertCasesNoFailFast<Wasm::WasmTypes::I32, Wasm::WasmTypes::I64, Wasm::WasmTypes::F32, Wasm::WasmTypes::F64, WASM_M128_CHECK_TYPE>();
504+
Wasm::WasmTypes::CompileAssertCasesNoFailFast<Wasm::WasmTypes::I32, Wasm::WasmTypes::I64, Wasm::WasmTypes::F32, Wasm::WasmTypes::F64, WASM_V128_CHECK_TYPE>();
505505
throw Wasm::WasmCompilationException(_u("Unknown param type"));
506506
}
507507
customReader->AddNode(node);
@@ -542,11 +542,11 @@ WebAssemblyModule::AttachCustomInOutTracingReader(Wasm::WasmFunctionInfo* func,
542542
case Wasm::WasmTypes::F32: node.op = Wasm::wbPrintF32; break;
543543
case Wasm::WasmTypes::F64: node.op = Wasm::wbPrintF64; break;
544544
#ifdef ENABLE_WASM_SIMD
545-
// todo:: Add support to print m128 return values
546-
case Wasm::WasmTypes::M128: goto SkipReturnPrint;
545+
// todo:: Add support to print v128 return values
546+
case Wasm::WasmTypes::V128: goto SkipReturnPrint;
547547
#endif
548548
default:
549-
Wasm::WasmTypes::CompileAssertCasesNoFailFast<Wasm::WasmTypes::I32, Wasm::WasmTypes::I64, Wasm::WasmTypes::F32, Wasm::WasmTypes::F64, WASM_M128_CHECK_TYPE>();
549+
Wasm::WasmTypes::CompileAssertCasesNoFailFast<Wasm::WasmTypes::I32, Wasm::WasmTypes::I64, Wasm::WasmTypes::F32, Wasm::WasmTypes::F64, WASM_V128_CHECK_TYPE>();
550550
throw Wasm::WasmCompilationException(_u("Unknown return type"));
551551
}
552552
customReader->AddNode(node);

0 commit comments

Comments
 (0)