Skip to content

Commit e018bc9

Browse files
committed
[MERGE #5839 @penzn] [WASM SIMD update, part 1] tests cleanup
Merge pull request #5839 from penzn:wasm.simd.tests For #5838. All changes to WASM files are compatible with WebAssembly/wabt@048e01a.
2 parents 77074f1 + f7da4b1 commit e018bc9

35 files changed

+2026
-3649
lines changed

lib/WasmReader/WasmBinaryOpcodesSimd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ WASM_EXTRACTLANE_OPCODE(I8ExtractLaneS, __prefix | 0x0b, I_M128, Simd128_Extract
5959
WASM_EXTRACTLANE_OPCODE(I8ExtractLaneU, __prefix | 0x0c, I_M128, Simd128_ExtractLane_U8, true, "i16x8.extract_lane_u")
6060
WASM_EXTRACTLANE_OPCODE(I4ExtractLane, __prefix | 0x0d, I_M128, Simd128_ExtractLane_I4, true, "i32x4.extract_lane")
6161
WASM_EXTRACTLANE_OPCODE(I2ExtractLane, __prefix | 0x0e, L_M128, Simd128_ExtractLane_I2, true, "i64x2.extract_lane")
62-
WASM_EXTRACTLANE_OPCODE(F4ExtractLane, __prefix | 0x0f, I_M128, Simd128_ExtractLane_F4, true, "f32x4.extract_lane")
62+
WASM_EXTRACTLANE_OPCODE(F4ExtractLane, __prefix | 0x0f, F_M128, Simd128_ExtractLane_F4, true, "f32x4.extract_lane")
6363
WASM_BINARY_OPCODE(F2ExtractLane, __prefix | 0x10, D_M128_I, Simd128_ExtractLane_D2, true, "f64x2.extract_lane")
6464
WASM_REPLACELANE_OPCODE(I16ReplaceLane, __prefix | 0x11, M128_I, Simd128_ReplaceLane_I16, true, "i8x16.replace_lane")
6565
WASM_REPLACELANE_OPCODE(I8ReplaceLane, __prefix | 0x12, M128_I, Simd128_ReplaceLane_I8, true, "i16x8.replace_lane")

lib/WasmReader/WasmByteCodeGenerator.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,6 +1571,7 @@ EmitInfo WasmBytecodeGenerator::EmitReplaceLaneExpr(Js::OpCodeAsmJs op, const Wa
15711571

15721572
m_writer->AsmReg4(op, resultReg, simdArg.location, indexInfo.location, valueArg.location);
15731573
ReleaseLocation(&indexInfo);
1574+
ReleaseLocation(&valueArg);
15741575
return result;
15751576
}
15761577

@@ -1579,6 +1580,11 @@ EmitInfo WasmBytecodeGenerator::EmitM128BitSelect()
15791580
EmitInfo mask = PopEvalStack(WasmTypes::M128);
15801581
EmitInfo arg2Info = PopEvalStack(WasmTypes::M128);
15811582
EmitInfo arg1Info = PopEvalStack(WasmTypes::M128);
1583+
1584+
ReleaseLocation(&mask);
1585+
ReleaseLocation(&arg2Info);
1586+
ReleaseLocation(&arg1Info);
1587+
15821588
Js::RegSlot resultReg = GetRegisterSpace(WasmTypes::M128)->AcquireTmpRegister();
15831589
EmitInfo resultInfo(resultReg, WasmTypes::M128);
15841590
m_writer->AsmReg4(Js::OpCodeAsmJs::Simd128_BitSelect_I4, resultReg, arg1Info.location, arg2Info.location, mask.location);
@@ -1590,6 +1596,8 @@ EmitInfo WasmBytecodeGenerator::EmitV8X16Shuffle()
15901596
EmitInfo arg2Info = PopEvalStack(WasmTypes::M128);
15911597
EmitInfo arg1Info = PopEvalStack(WasmTypes::M128);
15921598

1599+
// FIXME Release arg2Info and arg1Info
1600+
15931601
Js::RegSlot resultReg = GetRegisterSpace(WasmTypes::M128)->AcquireTmpRegister();
15941602
EmitInfo resultInfo(resultReg, WasmTypes::M128);
15951603

@@ -1612,16 +1620,16 @@ EmitInfo WasmBytecodeGenerator::EmitExtractLaneExpr(Js::OpCodeAsmJs op, const Wa
16121620
WasmTypes::WasmType simdArgType = signature[1];
16131621

16141622
EmitInfo simdArgInfo = PopEvalStack(simdArgType, _u("Argument should be of type M128"));
1623+
ReleaseLocation(&simdArgInfo);
16151624

16161625
Js::RegSlot resultReg = GetRegisterSpace(resultType)->AcquireTmpRegister();
16171626
EmitInfo resultInfo(resultReg, resultType);
16181627

16191628
//put index into a register to reuse the existing infra in Interpreter and Compiler
16201629
EmitInfo indexInfo = EmitLaneIndex(op);
1630+
ReleaseLocation(&indexInfo);
16211631

16221632
m_writer->AsmReg3(op, resultReg, simdArgInfo.location, indexInfo.location);
1623-
ReleaseLocation(&indexInfo);
1624-
ReleaseLocation(&simdArgInfo);
16251633
return resultInfo;
16261634
}
16271635

test/wasm.simd/b16x8.wasm

-465 Bytes
Binary file not shown.

test/wasm.simd/b16x8.wast

Lines changed: 0 additions & 183 deletions
This file was deleted.

test/wasm.simd/b32x4.wasm

-212 Bytes
Binary file not shown.

test/wasm.simd/b32x4.wast

Lines changed: 0 additions & 79 deletions
This file was deleted.

test/wasm.simd/b8x16.wasm

-1.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)