Commit 8e7527aa authored by Ivica Bogosavljevic's avatar Ivica Bogosavljevic Committed by Commit Bot

MIPS[64]: Port `[wasm] Implement wasm sign extension opcodes`

Port 1abeb5a3

Change-Id: Ib31abb7e5e920b319d0e485bf5bcc29fdc018bbc
Bug: chromium:806078
Reviewed-on: https://chromium-review.googlesource.com/888744Reviewed-by: 's avatarMiran Karić <miran.karic@mips.com>
Commit-Queue: Ivica Bogosavljevic <ivica.bogosavljevic@mips.com>
Cr-Commit-Position: refs/heads/master@{#50902}
parent 385611cb
......@@ -2260,11 +2260,13 @@ void InstructionSelector::VisitS8x16Shuffle(Node* node) {
}
void InstructionSelector::VisitSignExtendWord8ToInt32(Node* node) {
UNIMPLEMENTED();
MipsOperandGenerator g(this);
Emit(kMipsSeb, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)));
}
void InstructionSelector::VisitSignExtendWord16ToInt32(Node* node) {
UNIMPLEMENTED();
MipsOperandGenerator g(this);
Emit(kMipsSeh, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)));
}
// static
......
......@@ -2922,23 +2922,29 @@ void InstructionSelector::VisitS8x16Shuffle(Node* node) {
}
void InstructionSelector::VisitSignExtendWord8ToInt32(Node* node) {
UNIMPLEMENTED();
Mips64OperandGenerator g(this);
Emit(kMips64Seb, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)));
}
void InstructionSelector::VisitSignExtendWord16ToInt32(Node* node) {
UNIMPLEMENTED();
Mips64OperandGenerator g(this);
Emit(kMips64Seh, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)));
}
void InstructionSelector::VisitSignExtendWord8ToInt64(Node* node) {
UNIMPLEMENTED();
Mips64OperandGenerator g(this);
Emit(kMips64Seb, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)));
}
void InstructionSelector::VisitSignExtendWord16ToInt64(Node* node) {
UNIMPLEMENTED();
Mips64OperandGenerator g(this);
Emit(kMips64Seh, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)));
}
void InstructionSelector::VisitSignExtendWord32ToInt64(Node* node) {
UNIMPLEMENTED();
Mips64OperandGenerator g(this);
Emit(kMips64Shl, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)),
g.TempImmediate(0));
}
// static
......
......@@ -10,7 +10,6 @@ namespace v8 {
namespace internal {
namespace wasm {
#if !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64
WASM_COMPILED_EXEC_TEST(I32SExtendI8) {
EXPERIMENTAL_FLAG_SCOPE(se);
WasmRunner<int32_t, int32_t> r(execution_mode);
......@@ -32,12 +31,10 @@ WASM_COMPILED_EXEC_TEST(I32SExtendI16) {
CHECK_EQ(0x7afa, r.Call(0x7afa));
CHECK_EQ(-0x8000, r.Call(0x8000));
}
#endif // !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64
// TODO(gdeepti): Enable tests to run in the interpreter, and on 32 bit
// platforms after int64 lowering support. Add JS tests once all ops can be run
// on 32 bit platforms.
#if V8_TARGET_ARCH_64_BIT && !V8_TARGET_ARCH_MIPS64
#if V8_TARGET_ARCH_64_BIT
WASM_COMPILED_EXEC_TEST(I64SExtendI8) {
EXPERIMENTAL_FLAG_SCOPE(se);
WasmRunner<int64_t, int64_t> r(execution_mode);
......@@ -70,7 +67,7 @@ WASM_COMPILED_EXEC_TEST(I64SExtendI32) {
CHECK_EQ(0x7fffffff, r.Call(0x7fffffff));
CHECK_EQ(-0x80000000LL, r.Call(0x80000000));
}
#endif // V8_TARGET_ARCH_64_BIT && !V8_TARGET_ARCH_MIPS64
#endif // V8_TARGET_ARCH_64_BIT
} // namespace wasm
} // namespace internal
......
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