Commit b6db2255 authored by ahaas's avatar ahaas Committed by Commit bot

[wasm] Mark all 64-bit instructions as supported on 32-bit platforms.

Additionally I removed some stale comments.

R=titzer@chromium.org

Review-Url: https://codereview.chromium.org/1941323002
Cr-Commit-Position: refs/heads/master@{#35976}
parent 51a289b1
...@@ -268,9 +268,6 @@ void Int64Lowering::LowerNode(Node* node) { ...@@ -268,9 +268,6 @@ void Int64Lowering::LowerNode(Node* node) {
node->NullAllInputs(); node->NullAllInputs();
break; break;
} }
// todo(ahaas): I added a list of missing instructions here to make merging
// easier when I do them one by one.
// kExprI64Add:
case IrOpcode::kInt64Add: { case IrOpcode::kInt64Add: {
DCHECK(node->InputCount() == 2); DCHECK(node->InputCount() == 2);
...@@ -289,8 +286,6 @@ void Int64Lowering::LowerNode(Node* node) { ...@@ -289,8 +286,6 @@ void Int64Lowering::LowerNode(Node* node) {
ReplaceNode(node, low_node, high_node); ReplaceNode(node, low_node, high_node);
break; break;
} }
// kExprI64Sub:
case IrOpcode::kInt64Sub: { case IrOpcode::kInt64Sub: {
DCHECK(node->InputCount() == 2); DCHECK(node->InputCount() == 2);
...@@ -309,7 +304,6 @@ void Int64Lowering::LowerNode(Node* node) { ...@@ -309,7 +304,6 @@ void Int64Lowering::LowerNode(Node* node) {
ReplaceNode(node, low_node, high_node); ReplaceNode(node, low_node, high_node);
break; break;
} }
// kExprI64Mul:
case IrOpcode::kInt64Mul: { case IrOpcode::kInt64Mul: {
DCHECK(node->InputCount() == 2); DCHECK(node->InputCount() == 2);
...@@ -328,11 +322,6 @@ void Int64Lowering::LowerNode(Node* node) { ...@@ -328,11 +322,6 @@ void Int64Lowering::LowerNode(Node* node) {
ReplaceNode(node, low_node, high_node); ReplaceNode(node, low_node, high_node);
break; break;
} }
// kExprI64DivS:
// kExprI64DivU:
// kExprI64RemS:
// kExprI64RemU:
// kExprI64Ior:
case IrOpcode::kWord64Or: { case IrOpcode::kWord64Or: {
DCHECK(node->InputCount() == 2); DCHECK(node->InputCount() == 2);
Node* left = node->InputAt(0); Node* left = node->InputAt(0);
...@@ -347,8 +336,6 @@ void Int64Lowering::LowerNode(Node* node) { ...@@ -347,8 +336,6 @@ void Int64Lowering::LowerNode(Node* node) {
ReplaceNode(node, low_node, high_node); ReplaceNode(node, low_node, high_node);
break; break;
} }
// kExprI64Xor:
case IrOpcode::kWord64Xor: { case IrOpcode::kWord64Xor: {
DCHECK(node->InputCount() == 2); DCHECK(node->InputCount() == 2);
Node* left = node->InputAt(0); Node* left = node->InputAt(0);
...@@ -363,7 +350,6 @@ void Int64Lowering::LowerNode(Node* node) { ...@@ -363,7 +350,6 @@ void Int64Lowering::LowerNode(Node* node) {
ReplaceNode(node, low_node, high_node); ReplaceNode(node, low_node, high_node);
break; break;
} }
// kExprI64Shl:
case IrOpcode::kWord64Shl: { case IrOpcode::kWord64Shl: {
// TODO(turbofan): if the shift count >= 32, then we can set the low word // TODO(turbofan): if the shift count >= 32, then we can set the low word
// of the output to 0 and just calculate the high word. // of the output to 0 and just calculate the high word.
...@@ -386,7 +372,6 @@ void Int64Lowering::LowerNode(Node* node) { ...@@ -386,7 +372,6 @@ void Int64Lowering::LowerNode(Node* node) {
ReplaceNode(node, low_node, high_node); ReplaceNode(node, low_node, high_node);
break; break;
} }
// kExprI64ShrU:
case IrOpcode::kWord64Shr: { case IrOpcode::kWord64Shr: {
// TODO(turbofan): if the shift count >= 32, then we can set the low word // TODO(turbofan): if the shift count >= 32, then we can set the low word
// of the output to 0 and just calculate the high word. // of the output to 0 and just calculate the high word.
...@@ -409,7 +394,6 @@ void Int64Lowering::LowerNode(Node* node) { ...@@ -409,7 +394,6 @@ void Int64Lowering::LowerNode(Node* node) {
ReplaceNode(node, low_node, high_node); ReplaceNode(node, low_node, high_node);
break; break;
} }
// kExprI64ShrS:
case IrOpcode::kWord64Sar: { case IrOpcode::kWord64Sar: {
// TODO(turbofan): if the shift count >= 32, then we can set the low word // TODO(turbofan): if the shift count >= 32, then we can set the low word
// of the output to 0 and just calculate the high word. // of the output to 0 and just calculate the high word.
...@@ -432,7 +416,6 @@ void Int64Lowering::LowerNode(Node* node) { ...@@ -432,7 +416,6 @@ void Int64Lowering::LowerNode(Node* node) {
ReplaceNode(node, low_node, high_node); ReplaceNode(node, low_node, high_node);
break; break;
} }
// kExprI64Eq:
case IrOpcode::kWord64Equal: { case IrOpcode::kWord64Equal: {
DCHECK(node->InputCount() == 2); DCHECK(node->InputCount() == 2);
Node* left = node->InputAt(0); Node* left = node->InputAt(0);
...@@ -452,7 +435,6 @@ void Int64Lowering::LowerNode(Node* node) { ...@@ -452,7 +435,6 @@ void Int64Lowering::LowerNode(Node* node) {
ReplaceNode(node, replacement, nullptr); ReplaceNode(node, replacement, nullptr);
break; break;
} }
// kExprI64LtS:
case IrOpcode::kInt64LessThan: { case IrOpcode::kInt64LessThan: {
LowerComparison(node, machine()->Int32LessThan(), LowerComparison(node, machine()->Int32LessThan(),
machine()->Uint32LessThan()); machine()->Uint32LessThan());
...@@ -473,8 +455,6 @@ void Int64Lowering::LowerNode(Node* node) { ...@@ -473,8 +455,6 @@ void Int64Lowering::LowerNode(Node* node) {
machine()->Uint32LessThanOrEqual()); machine()->Uint32LessThanOrEqual());
break; break;
} }
// kExprI64SConvertI32:
case IrOpcode::kChangeInt32ToInt64: { case IrOpcode::kChangeInt32ToInt64: {
DCHECK(node->InputCount() == 1); DCHECK(node->InputCount() == 1);
Node* input = node->InputAt(0); Node* input = node->InputAt(0);
...@@ -489,7 +469,6 @@ void Int64Lowering::LowerNode(Node* node) { ...@@ -489,7 +469,6 @@ void Int64Lowering::LowerNode(Node* node) {
node->NullAllInputs(); node->NullAllInputs();
break; break;
} }
// kExprI64UConvertI32: {
case IrOpcode::kChangeUint32ToUint64: { case IrOpcode::kChangeUint32ToUint64: {
DCHECK(node->InputCount() == 1); DCHECK(node->InputCount() == 1);
Node* input = node->InputAt(0); Node* input = node->InputAt(0);
...@@ -500,7 +479,6 @@ void Int64Lowering::LowerNode(Node* node) { ...@@ -500,7 +479,6 @@ void Int64Lowering::LowerNode(Node* node) {
node->NullAllInputs(); node->NullAllInputs();
break; break;
} }
// kExprF64ReinterpretI64:
case IrOpcode::kBitcastInt64ToFloat64: { case IrOpcode::kBitcastInt64ToFloat64: {
DCHECK(node->InputCount() == 1); DCHECK(node->InputCount() == 1);
Node* input = node->InputAt(0); Node* input = node->InputAt(0);
...@@ -529,7 +507,6 @@ void Int64Lowering::LowerNode(Node* node) { ...@@ -529,7 +507,6 @@ void Int64Lowering::LowerNode(Node* node) {
ReplaceNode(node, load, nullptr); ReplaceNode(node, load, nullptr);
break; break;
} }
// kExprI64ReinterpretF64:
case IrOpcode::kBitcastFloat64ToInt64: { case IrOpcode::kBitcastFloat64ToInt64: {
DCHECK(node->InputCount() == 1); DCHECK(node->InputCount() == 1);
Node* input = node->InputAt(0); Node* input = node->InputAt(0);
...@@ -665,7 +642,6 @@ void Int64Lowering::LowerNode(Node* node) { ...@@ -665,7 +642,6 @@ void Int64Lowering::LowerNode(Node* node) {
} }
break; break;
} }
// kExprI64Clz:
case IrOpcode::kWord64Clz: { case IrOpcode::kWord64Clz: {
DCHECK(node->InputCount() == 1); DCHECK(node->InputCount() == 1);
Node* input = node->InputAt(0); Node* input = node->InputAt(0);
...@@ -684,7 +660,6 @@ void Int64Lowering::LowerNode(Node* node) { ...@@ -684,7 +660,6 @@ void Int64Lowering::LowerNode(Node* node) {
ReplaceNode(node, low_node, graph()->NewNode(common()->Int32Constant(0))); ReplaceNode(node, low_node, graph()->NewNode(common()->Int32Constant(0)));
break; break;
} }
// kExprI64Ctz:
case IrOpcode::kWord64Ctz: { case IrOpcode::kWord64Ctz: {
DCHECK(node->InputCount() == 1); DCHECK(node->InputCount() == 1);
DCHECK(machine()->Word32Ctz().IsSupported()); DCHECK(machine()->Word32Ctz().IsSupported());
...@@ -704,7 +679,6 @@ void Int64Lowering::LowerNode(Node* node) { ...@@ -704,7 +679,6 @@ void Int64Lowering::LowerNode(Node* node) {
ReplaceNode(node, low_node, graph()->NewNode(common()->Int32Constant(0))); ReplaceNode(node, low_node, graph()->NewNode(common()->Int32Constant(0)));
break; break;
} }
// kExprI64Popcnt:
case IrOpcode::kWord64Popcnt: { case IrOpcode::kWord64Popcnt: {
DCHECK(node->InputCount() == 1); DCHECK(node->InputCount() == 1);
Node* input = node->InputAt(0); Node* input = node->InputAt(0);
......
...@@ -49,11 +49,6 @@ namespace compiler { ...@@ -49,11 +49,6 @@ namespace compiler {
namespace { namespace {
const Operator* UnsupportedOpcode(wasm::WasmOpcode opcode) { const Operator* UnsupportedOpcode(wasm::WasmOpcode opcode) {
if (wasm::WasmOpcodes::IsSupported(opcode)) {
V8_Fatal(__FILE__, __LINE__,
"Unsupported opcode #%d:%s reported as supported", opcode,
wasm::WasmOpcodes::OpcodeName(opcode));
}
V8_Fatal(__FILE__, __LINE__, "Unsupported opcode #%d:%s", opcode, V8_Fatal(__FILE__, __LINE__, "Unsupported opcode #%d:%s", opcode,
wasm::WasmOpcodes::OpcodeName(opcode)); wasm::WasmOpcodes::OpcodeName(opcode));
return nullptr; return nullptr;
...@@ -471,62 +466,46 @@ Node* WasmGraphBuilder::Binop(wasm::WasmOpcode opcode, Node* left, Node* right, ...@@ -471,62 +466,46 @@ Node* WasmGraphBuilder::Binop(wasm::WasmOpcode opcode, Node* left, Node* right,
case wasm::kExprI64And: case wasm::kExprI64And:
op = m->Word64And(); op = m->Word64And();
break; break;
// todo(ahaas): I added a list of missing instructions here to make merging
// easier when I do them one by one.
// kExprI64Add:
case wasm::kExprI64Add: case wasm::kExprI64Add:
op = m->Int64Add(); op = m->Int64Add();
break; break;
// kExprI64Sub:
case wasm::kExprI64Sub: case wasm::kExprI64Sub:
op = m->Int64Sub(); op = m->Int64Sub();
break; break;
// kExprI64Mul:
case wasm::kExprI64Mul: case wasm::kExprI64Mul:
op = m->Int64Mul(); op = m->Int64Mul();
break; break;
// kExprI64DivS:
case wasm::kExprI64DivS: case wasm::kExprI64DivS:
return BuildI64DivS(left, right, position); return BuildI64DivS(left, right, position);
// kExprI64DivU:
case wasm::kExprI64DivU: case wasm::kExprI64DivU:
return BuildI64DivU(left, right, position); return BuildI64DivU(left, right, position);
// kExprI64RemS:
case wasm::kExprI64RemS: case wasm::kExprI64RemS:
return BuildI64RemS(left, right, position); return BuildI64RemS(left, right, position);
// kExprI64RemU:
case wasm::kExprI64RemU: case wasm::kExprI64RemU:
return BuildI64RemU(left, right, position); return BuildI64RemU(left, right, position);
case wasm::kExprI64Ior: case wasm::kExprI64Ior:
op = m->Word64Or(); op = m->Word64Or();
break; break;
// kExprI64Xor:
case wasm::kExprI64Xor: case wasm::kExprI64Xor:
op = m->Word64Xor(); op = m->Word64Xor();
break; break;
// kExprI64Shl:
case wasm::kExprI64Shl: case wasm::kExprI64Shl:
op = m->Word64Shl(); op = m->Word64Shl();
right = MaskShiftCount64(right); right = MaskShiftCount64(right);
break; break;
// kExprI64ShrU:
case wasm::kExprI64ShrU: case wasm::kExprI64ShrU:
op = m->Word64Shr(); op = m->Word64Shr();
right = MaskShiftCount64(right); right = MaskShiftCount64(right);
break; break;
// kExprI64ShrS:
case wasm::kExprI64ShrS: case wasm::kExprI64ShrS:
op = m->Word64Sar(); op = m->Word64Sar();
right = MaskShiftCount64(right); right = MaskShiftCount64(right);
break; break;
// kExprI64Eq:
case wasm::kExprI64Eq: case wasm::kExprI64Eq:
op = m->Word64Equal(); op = m->Word64Equal();
break; break;
// kExprI64Ne:
case wasm::kExprI64Ne: case wasm::kExprI64Ne:
return Invert(Binop(wasm::kExprI64Eq, left, right)); return Invert(Binop(wasm::kExprI64Eq, left, right));
// kExprI64LtS:
case wasm::kExprI64LtS: case wasm::kExprI64LtS:
op = m->Int64LessThan(); op = m->Int64LessThan();
break; break;
...@@ -795,31 +774,24 @@ Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input, ...@@ -795,31 +774,24 @@ Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input,
case wasm::kExprF64Log: { case wasm::kExprF64Log: {
return BuildF64Log(input); return BuildF64Log(input);
} }
// kExprI32ConvertI64:
case wasm::kExprI32ConvertI64: case wasm::kExprI32ConvertI64:
op = m->TruncateInt64ToInt32(); op = m->TruncateInt64ToInt32();
break; break;
// kExprI64SConvertI32:
case wasm::kExprI64SConvertI32: case wasm::kExprI64SConvertI32:
op = m->ChangeInt32ToInt64(); op = m->ChangeInt32ToInt64();
break; break;
// kExprI64UConvertI32:
case wasm::kExprI64UConvertI32: case wasm::kExprI64UConvertI32:
op = m->ChangeUint32ToUint64(); op = m->ChangeUint32ToUint64();
break; break;
// kExprF64ReinterpretI64:
case wasm::kExprF64ReinterpretI64: case wasm::kExprF64ReinterpretI64:
op = m->BitcastInt64ToFloat64(); op = m->BitcastInt64ToFloat64();
break; break;
// kExprI64ReinterpretF64:
case wasm::kExprI64ReinterpretF64: case wasm::kExprI64ReinterpretF64:
op = m->BitcastFloat64ToInt64(); op = m->BitcastFloat64ToInt64();
break; break;
// kExprI64Clz:
case wasm::kExprI64Clz: case wasm::kExprI64Clz:
op = m->Word64Clz(); op = m->Word64Clz();
break; break;
// kExprI64Ctz:
case wasm::kExprI64Ctz: { case wasm::kExprI64Ctz: {
if (m->Word64Ctz().IsSupported()) { if (m->Word64Ctz().IsSupported()) {
op = m->Word64Ctz().op(); op = m->Word64Ctz().op();
...@@ -835,7 +807,6 @@ Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input, ...@@ -835,7 +807,6 @@ Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input,
return BuildI64Ctz(input); return BuildI64Ctz(input);
} }
} }
// kExprI64Popcnt:
case wasm::kExprI64Popcnt: { case wasm::kExprI64Popcnt: {
if (m->Word64Popcnt().IsSupported()) { if (m->Word64Popcnt().IsSupported()) {
op = m->Word64Popcnt().op(); op = m->Word64Popcnt().op();
...@@ -846,7 +817,6 @@ Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input, ...@@ -846,7 +817,6 @@ Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input,
} }
break; break;
} }
// kExprF32SConvertI64:
case wasm::kExprI64Eqz: case wasm::kExprI64Eqz:
op = m->Word64Equal(); op = m->Word64Equal();
return graph()->NewNode(op, input, jsgraph()->Int64Constant(0)); return graph()->NewNode(op, input, jsgraph()->Int64Constant(0));
...@@ -856,40 +826,33 @@ Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input, ...@@ -856,40 +826,33 @@ Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input,
} }
op = m->RoundInt64ToFloat32(); op = m->RoundInt64ToFloat32();
break; break;
// kExprF32UConvertI64:
case wasm::kExprF32UConvertI64: case wasm::kExprF32UConvertI64:
if (m->Is32()) { if (m->Is32()) {
return BuildF32UConvertI64(input); return BuildF32UConvertI64(input);
} }
op = m->RoundUint64ToFloat32(); op = m->RoundUint64ToFloat32();
break; break;
// kExprF64SConvertI64:
case wasm::kExprF64SConvertI64: case wasm::kExprF64SConvertI64:
if (m->Is32()) { if (m->Is32()) {
return BuildF64SConvertI64(input); return BuildF64SConvertI64(input);
} }
op = m->RoundInt64ToFloat64(); op = m->RoundInt64ToFloat64();
break; break;
// kExprF64UConvertI64:
case wasm::kExprF64UConvertI64: case wasm::kExprF64UConvertI64:
if (m->Is32()) { if (m->Is32()) {
return BuildF64UConvertI64(input); return BuildF64UConvertI64(input);
} }
op = m->RoundUint64ToFloat64(); op = m->RoundUint64ToFloat64();
break; break;
// kExprI64SConvertF32:
case wasm::kExprI64SConvertF32: { case wasm::kExprI64SConvertF32: {
return BuildI64SConvertF32(input, position); return BuildI64SConvertF32(input, position);
} }
// kExprI64SConvertF64:
case wasm::kExprI64SConvertF64: { case wasm::kExprI64SConvertF64: {
return BuildI64SConvertF64(input, position); return BuildI64SConvertF64(input, position);
} }
// kExprI64UConvertF32:
case wasm::kExprI64UConvertF32: { case wasm::kExprI64UConvertF32: {
return BuildI64UConvertF32(input, position); return BuildI64UConvertF32(input, position);
} }
// kExprI64UConvertF64:
case wasm::kExprI64UConvertF64: { case wasm::kExprI64UConvertF64: {
return BuildI64UConvertF64(input, position); return BuildI64UConvertF64(input, position);
} }
......
...@@ -99,66 +99,6 @@ FunctionSig* WasmOpcodes::Signature(WasmOpcode opcode) { ...@@ -99,66 +99,6 @@ FunctionSig* WasmOpcodes::Signature(WasmOpcode opcode) {
#define WASM_64 0 #define WASM_64 0
#endif #endif
bool WasmOpcodes::IsSupported(WasmOpcode opcode) {
#if !WASM_64
switch (opcode) {
// Opcodes not supported on 32-bit platforms.
case kExprI64Add:
case kExprI64Sub:
case kExprI64Mul:
case kExprI64DivS:
case kExprI64DivU:
case kExprI64RemS:
case kExprI64RemU:
case kExprI64And:
case kExprI64Ior:
case kExprI64Xor:
case kExprI64Shl:
case kExprI64ShrU:
case kExprI64ShrS:
case kExprI64Ror:
case kExprI64Rol:
case kExprI64Eq:
case kExprI64Ne:
case kExprI64LtS:
case kExprI64LeS:
case kExprI64LtU:
case kExprI64LeU:
case kExprI64GtS:
case kExprI64GeS:
case kExprI64GtU:
case kExprI64GeU:
case kExprI32ConvertI64:
case kExprI64SConvertI32:
case kExprI64UConvertI32:
case kExprF64ReinterpretI64:
case kExprI64ReinterpretF64:
case kExprI64Clz:
case kExprI64Ctz:
case kExprI64Popcnt:
case kExprF32SConvertI64:
case kExprF32UConvertI64:
case kExprF64SConvertI64:
case kExprF64UConvertI64:
case kExprI64SConvertF32:
case kExprI64SConvertF64:
case kExprI64UConvertF32:
case kExprI64UConvertF64:
return false;
default:
return true;
}
#else
return true;
#endif
}
int WasmOpcodes::TrapReasonToMessageId(TrapReason reason) { int WasmOpcodes::TrapReasonToMessageId(TrapReason reason) {
switch (reason) { switch (reason) {
#define TRAPREASON_TO_MESSAGE(name) \ #define TRAPREASON_TO_MESSAGE(name) \
......
...@@ -348,7 +348,6 @@ enum TrapReason { ...@@ -348,7 +348,6 @@ enum TrapReason {
// A collection of opcode-related static methods. // A collection of opcode-related static methods.
class WasmOpcodes { class WasmOpcodes {
public: public:
static bool IsSupported(WasmOpcode opcode);
static const char* OpcodeName(WasmOpcode opcode); static const char* OpcodeName(WasmOpcode opcode);
static const char* ShortOpcodeName(WasmOpcode opcode); static const char* ShortOpcodeName(WasmOpcode opcode);
static FunctionSig* Signature(WasmOpcode opcode); static FunctionSig* Signature(WasmOpcode opcode);
......
...@@ -121,9 +121,6 @@ TEST(Run_Wasm_Return_I64) { ...@@ -121,9 +121,6 @@ TEST(Run_Wasm_Return_I64) {
FOR_INT64_INPUTS(i) { CHECK_EQ(*i, r.Call(*i)); } FOR_INT64_INPUTS(i) { CHECK_EQ(*i, r.Call(*i)); }
} }
// todo(ahaas): I added a list of missing instructions here to make merging
// easier when I do them one by one.
// kExprI64Add:
TEST(Run_WasmI64Add) { TEST(Run_WasmI64Add) {
REQUIRE(I64Add); REQUIRE(I64Add);
WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64()); WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64());
...@@ -132,7 +129,7 @@ TEST(Run_WasmI64Add) { ...@@ -132,7 +129,7 @@ TEST(Run_WasmI64Add) {
FOR_INT64_INPUTS(j) { CHECK_EQ(*i + *j, r.Call(*i, *j)); } FOR_INT64_INPUTS(j) { CHECK_EQ(*i + *j, r.Call(*i, *j)); }
} }
} }
// kExprI64Sub:
TEST(Run_Wasm_I64Sub) { TEST(Run_Wasm_I64Sub) {
REQUIRE(I64Sub); REQUIRE(I64Sub);
WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64()); WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64());
...@@ -141,8 +138,6 @@ TEST(Run_Wasm_I64Sub) { ...@@ -141,8 +138,6 @@ TEST(Run_Wasm_I64Sub) {
FOR_INT64_INPUTS(j) { CHECK_EQ(*i - *j, r.Call(*i, *j)); } FOR_INT64_INPUTS(j) { CHECK_EQ(*i - *j, r.Call(*i, *j)); }
} }
} }
// kExprI64Mul:
// kExprI64DivS:
TEST(Run_WasmI64DivS) { TEST(Run_WasmI64DivS) {
REQUIRE(I64DivS); REQUIRE(I64DivS);
...@@ -186,7 +181,6 @@ TEST(Run_WasmI64DivS_Byzero_Const) { ...@@ -186,7 +181,6 @@ TEST(Run_WasmI64DivS_Byzero_Const) {
} }
} }
} }
// kExprI64DivU:
TEST(Run_WasmI64DivU) { TEST(Run_WasmI64DivU) {
REQUIRE(I64DivU); REQUIRE(I64DivU);
...@@ -228,7 +222,7 @@ TEST(Run_WasmI64DivU_Byzero_Const) { ...@@ -228,7 +222,7 @@ TEST(Run_WasmI64DivU_Byzero_Const) {
} }
} }
} }
// kExprI64RemS:
TEST(Run_WasmI64RemS) { TEST(Run_WasmI64RemS) {
REQUIRE(I64RemS); REQUIRE(I64RemS);
WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64()); WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64());
...@@ -255,7 +249,6 @@ TEST(Run_WasmI64RemS_Trap) { ...@@ -255,7 +249,6 @@ TEST(Run_WasmI64RemS_Trap) {
CHECK_TRAP64(r.Call(std::numeric_limits<int64_t>::min(), asi64(0))); CHECK_TRAP64(r.Call(std::numeric_limits<int64_t>::min(), asi64(0)));
} }
// kExprI64RemU:
TEST(Run_WasmI64RemU) { TEST(Run_WasmI64RemU) {
REQUIRE(I64RemU); REQUIRE(I64RemU);
WasmRunner<uint64_t> r(MachineType::Uint64(), MachineType::Uint64()); WasmRunner<uint64_t> r(MachineType::Uint64(), MachineType::Uint64());
...@@ -281,7 +274,6 @@ TEST(Run_Wasm_I64RemU_Trap) { ...@@ -281,7 +274,6 @@ TEST(Run_Wasm_I64RemU_Trap) {
CHECK_TRAP64(r.Call(std::numeric_limits<uint64_t>::max(), asu64(0))); CHECK_TRAP64(r.Call(std::numeric_limits<uint64_t>::max(), asu64(0)));
} }
// kExprI64And:
TEST(Run_Wasm_I64And) { TEST(Run_Wasm_I64And) {
REQUIRE(I64And); REQUIRE(I64And);
WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64()); WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64());
...@@ -290,7 +282,7 @@ TEST(Run_Wasm_I64And) { ...@@ -290,7 +282,7 @@ TEST(Run_Wasm_I64And) {
FOR_INT64_INPUTS(j) { CHECK_EQ((*i) & (*j), r.Call(*i, *j)); } FOR_INT64_INPUTS(j) { CHECK_EQ((*i) & (*j), r.Call(*i, *j)); }
} }
} }
// kExprI64Ior:
TEST(Run_Wasm_I64Ior) { TEST(Run_Wasm_I64Ior) {
REQUIRE(I64Ior); REQUIRE(I64Ior);
WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64()); WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64());
...@@ -299,7 +291,7 @@ TEST(Run_Wasm_I64Ior) { ...@@ -299,7 +291,7 @@ TEST(Run_Wasm_I64Ior) {
FOR_INT64_INPUTS(j) { CHECK_EQ((*i) | (*j), r.Call(*i, *j)); } FOR_INT64_INPUTS(j) { CHECK_EQ((*i) | (*j), r.Call(*i, *j)); }
} }
} }
// kExprI64Xor:
TEST(Run_Wasm_I64Xor) { TEST(Run_Wasm_I64Xor) {
REQUIRE(I64Xor); REQUIRE(I64Xor);
WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64()); WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64());
...@@ -308,7 +300,7 @@ TEST(Run_Wasm_I64Xor) { ...@@ -308,7 +300,7 @@ TEST(Run_Wasm_I64Xor) {
FOR_INT64_INPUTS(j) { CHECK_EQ((*i) ^ (*j), r.Call(*i, *j)); } FOR_INT64_INPUTS(j) { CHECK_EQ((*i) ^ (*j), r.Call(*i, *j)); }
} }
} }
// kExprI64Shl:
TEST(Run_Wasm_I64Shl) { TEST(Run_Wasm_I64Shl) {
REQUIRE(I64Shl); REQUIRE(I64Shl);
{ {
...@@ -343,7 +335,7 @@ TEST(Run_Wasm_I64Shl) { ...@@ -343,7 +335,7 @@ TEST(Run_Wasm_I64Shl) {
FOR_UINT64_INPUTS(i) { CHECK_EQ(*i << 40, r.Call(*i)); } FOR_UINT64_INPUTS(i) { CHECK_EQ(*i << 40, r.Call(*i)); }
} }
} }
// kExprI64ShrU:
TEST(Run_Wasm_I64ShrU) { TEST(Run_Wasm_I64ShrU) {
REQUIRE(I64ShrU); REQUIRE(I64ShrU);
{ {
...@@ -378,7 +370,7 @@ TEST(Run_Wasm_I64ShrU) { ...@@ -378,7 +370,7 @@ TEST(Run_Wasm_I64ShrU) {
FOR_UINT64_INPUTS(i) { CHECK_EQ(*i >> 40, r.Call(*i)); } FOR_UINT64_INPUTS(i) { CHECK_EQ(*i >> 40, r.Call(*i)); }
} }
} }
// kExprI64ShrS:
TEST(Run_Wasm_I64ShrS) { TEST(Run_Wasm_I64ShrS) {
REQUIRE(I64ShrS); REQUIRE(I64ShrS);
{ {
...@@ -413,7 +405,7 @@ TEST(Run_Wasm_I64ShrS) { ...@@ -413,7 +405,7 @@ TEST(Run_Wasm_I64ShrS) {
FOR_INT64_INPUTS(i) { CHECK_EQ(*i >> 40, r.Call(*i)); } FOR_INT64_INPUTS(i) { CHECK_EQ(*i >> 40, r.Call(*i)); }
} }
} }
// kExprI64Eq:
TEST(Run_Wasm_I64Eq) { TEST(Run_Wasm_I64Eq) {
REQUIRE(I64Eq); REQUIRE(I64Eq);
WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64()); WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
...@@ -422,7 +414,7 @@ TEST(Run_Wasm_I64Eq) { ...@@ -422,7 +414,7 @@ TEST(Run_Wasm_I64Eq) {
FOR_INT64_INPUTS(j) { CHECK_EQ(*i == *j ? 1 : 0, r.Call(*i, *j)); } FOR_INT64_INPUTS(j) { CHECK_EQ(*i == *j ? 1 : 0, r.Call(*i, *j)); }
} }
} }
// kExprI64Ne:
TEST(Run_Wasm_I64Ne) { TEST(Run_Wasm_I64Ne) {
REQUIRE(I64Ne); REQUIRE(I64Ne);
WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64()); WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
...@@ -431,7 +423,7 @@ TEST(Run_Wasm_I64Ne) { ...@@ -431,7 +423,7 @@ TEST(Run_Wasm_I64Ne) {
FOR_INT64_INPUTS(j) { CHECK_EQ(*i != *j ? 1 : 0, r.Call(*i, *j)); } FOR_INT64_INPUTS(j) { CHECK_EQ(*i != *j ? 1 : 0, r.Call(*i, *j)); }
} }
} }
// kExprI64LtS:
TEST(Run_Wasm_I64LtS) { TEST(Run_Wasm_I64LtS) {
REQUIRE(I64LtS); REQUIRE(I64LtS);
WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64()); WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
...@@ -440,6 +432,7 @@ TEST(Run_Wasm_I64LtS) { ...@@ -440,6 +432,7 @@ TEST(Run_Wasm_I64LtS) {
FOR_INT64_INPUTS(j) { CHECK_EQ(*i < *j ? 1 : 0, r.Call(*i, *j)); } FOR_INT64_INPUTS(j) { CHECK_EQ(*i < *j ? 1 : 0, r.Call(*i, *j)); }
} }
} }
TEST(Run_Wasm_I64LeS) { TEST(Run_Wasm_I64LeS) {
REQUIRE(I64LeS); REQUIRE(I64LeS);
WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64()); WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
...@@ -448,6 +441,7 @@ TEST(Run_Wasm_I64LeS) { ...@@ -448,6 +441,7 @@ TEST(Run_Wasm_I64LeS) {
FOR_INT64_INPUTS(j) { CHECK_EQ(*i <= *j ? 1 : 0, r.Call(*i, *j)); } FOR_INT64_INPUTS(j) { CHECK_EQ(*i <= *j ? 1 : 0, r.Call(*i, *j)); }
} }
} }
TEST(Run_Wasm_I64LtU) { TEST(Run_Wasm_I64LtU) {
REQUIRE(I64LtU); REQUIRE(I64LtU);
WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64()); WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
...@@ -456,6 +450,7 @@ TEST(Run_Wasm_I64LtU) { ...@@ -456,6 +450,7 @@ TEST(Run_Wasm_I64LtU) {
FOR_UINT64_INPUTS(j) { CHECK_EQ(*i < *j ? 1 : 0, r.Call(*i, *j)); } FOR_UINT64_INPUTS(j) { CHECK_EQ(*i < *j ? 1 : 0, r.Call(*i, *j)); }
} }
} }
TEST(Run_Wasm_I64LeU) { TEST(Run_Wasm_I64LeU) {
REQUIRE(I64LeU); REQUIRE(I64LeU);
WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64()); WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
...@@ -464,6 +459,7 @@ TEST(Run_Wasm_I64LeU) { ...@@ -464,6 +459,7 @@ TEST(Run_Wasm_I64LeU) {
FOR_UINT64_INPUTS(j) { CHECK_EQ(*i <= *j ? 1 : 0, r.Call(*i, *j)); } FOR_UINT64_INPUTS(j) { CHECK_EQ(*i <= *j ? 1 : 0, r.Call(*i, *j)); }
} }
} }
TEST(Run_Wasm_I64GtS) { TEST(Run_Wasm_I64GtS) {
REQUIRE(I64GtS); REQUIRE(I64GtS);
WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64()); WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
...@@ -472,6 +468,7 @@ TEST(Run_Wasm_I64GtS) { ...@@ -472,6 +468,7 @@ TEST(Run_Wasm_I64GtS) {
FOR_INT64_INPUTS(j) { CHECK_EQ(*i > *j ? 1 : 0, r.Call(*i, *j)); } FOR_INT64_INPUTS(j) { CHECK_EQ(*i > *j ? 1 : 0, r.Call(*i, *j)); }
} }
} }
TEST(Run_Wasm_I64GeS) { TEST(Run_Wasm_I64GeS) {
REQUIRE(I64GeS); REQUIRE(I64GeS);
WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64()); WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
...@@ -498,7 +495,7 @@ TEST(Run_Wasm_I64GeU) { ...@@ -498,7 +495,7 @@ TEST(Run_Wasm_I64GeU) {
FOR_UINT64_INPUTS(j) { CHECK_EQ(*i >= *j ? 1 : 0, r.Call(*i, *j)); } FOR_UINT64_INPUTS(j) { CHECK_EQ(*i >= *j ? 1 : 0, r.Call(*i, *j)); }
} }
} }
// kExprI32ConvertI64:
TEST(Run_Wasm_I32ConvertI64) { TEST(Run_Wasm_I32ConvertI64) {
REQUIRE(I32ConvertI64); REQUIRE(I32ConvertI64);
FOR_INT64_INPUTS(i) { FOR_INT64_INPUTS(i) {
...@@ -507,7 +504,7 @@ TEST(Run_Wasm_I32ConvertI64) { ...@@ -507,7 +504,7 @@ TEST(Run_Wasm_I32ConvertI64) {
CHECK_EQ(static_cast<int32_t>(*i), r.Call()); CHECK_EQ(static_cast<int32_t>(*i), r.Call());
} }
} }
// kExprI64SConvertI32:
TEST(Run_Wasm_I64SConvertI32) { TEST(Run_Wasm_I64SConvertI32) {
REQUIRE(I64SConvertI32); REQUIRE(I64SConvertI32);
WasmRunner<int64_t> r(MachineType::Int32()); WasmRunner<int64_t> r(MachineType::Int32());
...@@ -515,7 +512,6 @@ TEST(Run_Wasm_I64SConvertI32) { ...@@ -515,7 +512,6 @@ TEST(Run_Wasm_I64SConvertI32) {
FOR_INT32_INPUTS(i) { CHECK_EQ(static_cast<int64_t>(*i), r.Call(*i)); } FOR_INT32_INPUTS(i) { CHECK_EQ(static_cast<int64_t>(*i), r.Call(*i)); }
} }
// kExprI64UConvertI32:
TEST(Run_Wasm_I64UConvertI32) { TEST(Run_Wasm_I64UConvertI32) {
REQUIRE(I64UConvertI32); REQUIRE(I64UConvertI32);
WasmRunner<int64_t> r(MachineType::Uint32()); WasmRunner<int64_t> r(MachineType::Uint32());
...@@ -523,12 +519,6 @@ TEST(Run_Wasm_I64UConvertI32) { ...@@ -523,12 +519,6 @@ TEST(Run_Wasm_I64UConvertI32) {
FOR_UINT32_INPUTS(i) { CHECK_EQ(static_cast<uint64_t>(*i), r.Call(*i)); } FOR_UINT32_INPUTS(i) { CHECK_EQ(static_cast<uint64_t>(*i), r.Call(*i)); }
} }
// kExprF64ReinterpretI64:
// kExprI64ReinterpretF64:
// kExprI64Clz:
// kExprI64Ctz:
// kExprI64Popcnt:
TEST(Run_WasmI64Popcnt) { TEST(Run_WasmI64Popcnt) {
struct { struct {
int64_t expected; int64_t expected;
...@@ -546,14 +536,13 @@ TEST(Run_WasmI64Popcnt) { ...@@ -546,14 +536,13 @@ TEST(Run_WasmI64Popcnt) {
} }
} }
// kExprF32SConvertI64:
TEST(Run_WasmF32SConvertI64) { TEST(Run_WasmF32SConvertI64) {
REQUIRE(F32SConvertI64); REQUIRE(F32SConvertI64);
WasmRunner<float> r(MachineType::Int64()); WasmRunner<float> r(MachineType::Int64());
BUILD(r, WASM_F32_SCONVERT_I64(WASM_GET_LOCAL(0))); BUILD(r, WASM_F32_SCONVERT_I64(WASM_GET_LOCAL(0)));
FOR_INT64_INPUTS(i) { CHECK_FLOAT_EQ(static_cast<float>(*i), r.Call(*i)); } FOR_INT64_INPUTS(i) { CHECK_FLOAT_EQ(static_cast<float>(*i), r.Call(*i)); }
} }
// kExprF32UConvertI64:
TEST(Run_WasmF32UConvertI64) { TEST(Run_WasmF32UConvertI64) {
REQUIRE(F32UConvertI64); REQUIRE(F32UConvertI64);
struct { struct {
...@@ -641,14 +630,14 @@ TEST(Run_WasmF32UConvertI64) { ...@@ -641,14 +630,14 @@ TEST(Run_WasmF32UConvertI64) {
CHECK_EQ(bit_cast<float>(values[i].expected), r.Call(values[i].input)); CHECK_EQ(bit_cast<float>(values[i].expected), r.Call(values[i].input));
} }
} }
// kExprF64SConvertI64:
TEST(Run_WasmF64SConvertI64) { TEST(Run_WasmF64SConvertI64) {
REQUIRE(F64SConvertI64); REQUIRE(F64SConvertI64);
WasmRunner<double> r(MachineType::Int64()); WasmRunner<double> r(MachineType::Int64());
BUILD(r, WASM_F64_SCONVERT_I64(WASM_GET_LOCAL(0))); BUILD(r, WASM_F64_SCONVERT_I64(WASM_GET_LOCAL(0)));
FOR_INT64_INPUTS(i) { CHECK_DOUBLE_EQ(static_cast<double>(*i), r.Call(*i)); } FOR_INT64_INPUTS(i) { CHECK_DOUBLE_EQ(static_cast<double>(*i), r.Call(*i)); }
} }
// kExprF64UConvertI64:
TEST(Run_Wasm_F64UConvertI64) { TEST(Run_Wasm_F64UConvertI64) {
REQUIRE(F64UConvertI64); REQUIRE(F64UConvertI64);
struct { struct {
...@@ -735,7 +724,6 @@ TEST(Run_Wasm_F64UConvertI64) { ...@@ -735,7 +724,6 @@ TEST(Run_Wasm_F64UConvertI64) {
CHECK_EQ(bit_cast<double>(values[i].expected), r.Call(values[i].input)); CHECK_EQ(bit_cast<double>(values[i].expected), r.Call(values[i].input));
} }
} }
// kExprI64SConvertF32:
TEST(Run_Wasm_I64SConvertF32a) { TEST(Run_Wasm_I64SConvertF32a) {
WasmRunner<int64_t> r(MachineType::Float32()); WasmRunner<int64_t> r(MachineType::Float32());
...@@ -750,7 +738,7 @@ TEST(Run_Wasm_I64SConvertF32a) { ...@@ -750,7 +738,7 @@ TEST(Run_Wasm_I64SConvertF32a) {
} }
} }
} }
// kExprI64SConvertF64:
TEST(Run_Wasm_I64SConvertF64a) { TEST(Run_Wasm_I64SConvertF64a) {
WasmRunner<int64_t> r(MachineType::Float64()); WasmRunner<int64_t> r(MachineType::Float64());
BUILD(r, WASM_I64_SCONVERT_F64(WASM_GET_LOCAL(0))); BUILD(r, WASM_I64_SCONVERT_F64(WASM_GET_LOCAL(0)));
...@@ -765,7 +753,6 @@ TEST(Run_Wasm_I64SConvertF64a) { ...@@ -765,7 +753,6 @@ TEST(Run_Wasm_I64SConvertF64a) {
} }
} }
// kExprI64UConvertF32:
TEST(Run_Wasm_I64UConvertF32a) { TEST(Run_Wasm_I64UConvertF32a) {
WasmRunner<uint64_t> r(MachineType::Float32()); WasmRunner<uint64_t> r(MachineType::Float32());
BUILD(r, WASM_I64_UCONVERT_F32(WASM_GET_LOCAL(0))); BUILD(r, WASM_I64_UCONVERT_F32(WASM_GET_LOCAL(0)));
...@@ -780,7 +767,6 @@ TEST(Run_Wasm_I64UConvertF32a) { ...@@ -780,7 +767,6 @@ TEST(Run_Wasm_I64UConvertF32a) {
} }
} }
// kExprI64UConvertF64:
TEST(Run_Wasm_I64UConvertF64a) { TEST(Run_Wasm_I64UConvertF64a) {
WasmRunner<uint64_t> r(MachineType::Float64()); WasmRunner<uint64_t> r(MachineType::Float64());
BUILD(r, WASM_I64_UCONVERT_F64(WASM_GET_LOCAL(0))); BUILD(r, WASM_I64_UCONVERT_F64(WASM_GET_LOCAL(0)));
......
...@@ -1750,8 +1750,6 @@ TEST(Run_Wasm_Infinite_Loop_not_taken2_brif) { ...@@ -1750,8 +1750,6 @@ TEST(Run_Wasm_Infinite_Loop_not_taken2_brif) {
static void TestBuildGraphForSimpleExpression(WasmOpcode opcode) { static void TestBuildGraphForSimpleExpression(WasmOpcode opcode) {
if (!WasmOpcodes::IsSupported(opcode)) return;
Isolate* isolate = CcTest::InitIsolateOnce(); Isolate* isolate = CcTest::InitIsolateOnce();
Zone zone(isolate->allocator()); Zone zone(isolate->allocator());
HandleScope scope(isolate); HandleScope scope(isolate);
......
...@@ -301,9 +301,6 @@ TEST_F(Int64LoweringTest, CallI64Parameter) { ...@@ -301,9 +301,6 @@ TEST_F(Int64LoweringTest, CallI64Parameter) {
wasm::ModuleEnv::GetI32WasmCallDescriptor(zone(), desc)); wasm::ModuleEnv::GetI32WasmCallDescriptor(zone(), desc));
} }
// todo(ahaas): I added a list of missing instructions here to make merging
// easier when I do them one by one.
// kExprI64Add:
TEST_F(Int64LoweringTest, Int64Add) { TEST_F(Int64LoweringTest, Int64Add) {
LowerGraph(graph()->NewNode(machine()->Int64Add(), Int64Constant(value(0)), LowerGraph(graph()->NewNode(machine()->Int64Add(), Int64Constant(value(0)),
Int64Constant(value(1))), Int64Constant(value(1))),
...@@ -319,7 +316,7 @@ TEST_F(Int64LoweringTest, Int64Add) { ...@@ -319,7 +316,7 @@ TEST_F(Int64LoweringTest, Int64Add) {
IsProjection(1, AllOf(CaptureEq(&add), add_matcher)), IsProjection(1, AllOf(CaptureEq(&add), add_matcher)),
start(), start())); start(), start()));
} }
// kExprI64Sub:
TEST_F(Int64LoweringTest, Int64Sub) { TEST_F(Int64LoweringTest, Int64Sub) {
LowerGraph(graph()->NewNode(machine()->Int64Sub(), Int64Constant(value(0)), LowerGraph(graph()->NewNode(machine()->Int64Sub(), Int64Constant(value(0)),
Int64Constant(value(1))), Int64Constant(value(1))),
...@@ -336,7 +333,6 @@ TEST_F(Int64LoweringTest, Int64Sub) { ...@@ -336,7 +333,6 @@ TEST_F(Int64LoweringTest, Int64Sub) {
start(), start())); start(), start()));
} }
// kExprI64Mul:
TEST_F(Int64LoweringTest, Int64Mul) { TEST_F(Int64LoweringTest, Int64Mul) {
LowerGraph(graph()->NewNode(machine()->Int64Mul(), Int64Constant(value(0)), LowerGraph(graph()->NewNode(machine()->Int64Mul(), Int64Constant(value(0)),
Int64Constant(value(1))), Int64Constant(value(1))),
...@@ -354,11 +350,6 @@ TEST_F(Int64LoweringTest, Int64Mul) { ...@@ -354,11 +350,6 @@ TEST_F(Int64LoweringTest, Int64Mul) {
start(), start())); start(), start()));
} }
// kExprI64DivS:
// kExprI64DivU:
// kExprI64RemS:
// kExprI64RemU:
// kExprI64Ior:
TEST_F(Int64LoweringTest, Int64Ior) { TEST_F(Int64LoweringTest, Int64Ior) {
LowerGraph(graph()->NewNode(machine()->Word64Or(), Int64Constant(value(0)), LowerGraph(graph()->NewNode(machine()->Word64Or(), Int64Constant(value(0)),
Int64Constant(value(1))), Int64Constant(value(1))),
...@@ -371,7 +362,6 @@ TEST_F(Int64LoweringTest, Int64Ior) { ...@@ -371,7 +362,6 @@ TEST_F(Int64LoweringTest, Int64Ior) {
start(), start())); start(), start()));
} }
// kExprI64Xor:
TEST_F(Int64LoweringTest, Int64Xor) { TEST_F(Int64LoweringTest, Int64Xor) {
LowerGraph(graph()->NewNode(machine()->Word64Xor(), Int64Constant(value(0)), LowerGraph(graph()->NewNode(machine()->Word64Xor(), Int64Constant(value(0)),
Int64Constant(value(1))), Int64Constant(value(1))),
...@@ -383,7 +373,7 @@ TEST_F(Int64LoweringTest, Int64Xor) { ...@@ -383,7 +373,7 @@ TEST_F(Int64LoweringTest, Int64Xor) {
IsInt32Constant(high_word_value(1))), IsInt32Constant(high_word_value(1))),
start(), start())); start(), start()));
} }
// kExprI64Shl:
TEST_F(Int64LoweringTest, Int64Shl) { TEST_F(Int64LoweringTest, Int64Shl) {
LowerGraph(graph()->NewNode(machine()->Word64Shl(), Int64Constant(value(0)), LowerGraph(graph()->NewNode(machine()->Word64Shl(), Int64Constant(value(0)),
Int64Constant(value(1))), Int64Constant(value(1))),
...@@ -399,7 +389,7 @@ TEST_F(Int64LoweringTest, Int64Shl) { ...@@ -399,7 +389,7 @@ TEST_F(Int64LoweringTest, Int64Shl) {
IsProjection(1, AllOf(CaptureEq(&shl), shl_matcher)), IsProjection(1, AllOf(CaptureEq(&shl), shl_matcher)),
start(), start())); start(), start()));
} }
// kExprI64ShrU:
TEST_F(Int64LoweringTest, Int64ShrU) { TEST_F(Int64LoweringTest, Int64ShrU) {
LowerGraph(graph()->NewNode(machine()->Word64Shr(), Int64Constant(value(0)), LowerGraph(graph()->NewNode(machine()->Word64Shr(), Int64Constant(value(0)),
Int64Constant(value(1))), Int64Constant(value(1))),
...@@ -415,7 +405,7 @@ TEST_F(Int64LoweringTest, Int64ShrU) { ...@@ -415,7 +405,7 @@ TEST_F(Int64LoweringTest, Int64ShrU) {
IsProjection(1, AllOf(CaptureEq(&shr), shr_matcher)), IsProjection(1, AllOf(CaptureEq(&shr), shr_matcher)),
start(), start())); start(), start()));
} }
// kExprI64ShrS:
TEST_F(Int64LoweringTest, Int64ShrS) { TEST_F(Int64LoweringTest, Int64ShrS) {
LowerGraph(graph()->NewNode(machine()->Word64Sar(), Int64Constant(value(0)), LowerGraph(graph()->NewNode(machine()->Word64Sar(), Int64Constant(value(0)),
Int64Constant(value(1))), Int64Constant(value(1))),
...@@ -431,7 +421,7 @@ TEST_F(Int64LoweringTest, Int64ShrS) { ...@@ -431,7 +421,7 @@ TEST_F(Int64LoweringTest, Int64ShrS) {
IsProjection(1, AllOf(CaptureEq(&sar), sar_matcher)), IsProjection(1, AllOf(CaptureEq(&sar), sar_matcher)),
start(), start())); start(), start()));
} }
// kExprI64Eq:
TEST_F(Int64LoweringTest, Int64Eq) { TEST_F(Int64LoweringTest, Int64Eq) {
LowerGraph(graph()->NewNode(machine()->Word64Equal(), Int64Constant(value(0)), LowerGraph(graph()->NewNode(machine()->Word64Equal(), Int64Constant(value(0)),
Int64Constant(value(1))), Int64Constant(value(1))),
...@@ -447,27 +437,25 @@ TEST_F(Int64LoweringTest, Int64Eq) { ...@@ -447,27 +437,25 @@ TEST_F(Int64LoweringTest, Int64Eq) {
start(), start())); start(), start()));
} }
// kExprI64LtS:
TEST_F(Int64LoweringTest, Int64LtS) { TEST_F(Int64LoweringTest, Int64LtS) {
TestComparison(machine()->Int64LessThan(), IsInt32LessThan, IsUint32LessThan); TestComparison(machine()->Int64LessThan(), IsInt32LessThan, IsUint32LessThan);
} }
// kExprI64LeS:
TEST_F(Int64LoweringTest, Int64LeS) { TEST_F(Int64LoweringTest, Int64LeS) {
TestComparison(machine()->Int64LessThanOrEqual(), IsInt32LessThan, TestComparison(machine()->Int64LessThanOrEqual(), IsInt32LessThan,
IsUint32LessThanOrEqual); IsUint32LessThanOrEqual);
} }
// kExprI64LtU:
TEST_F(Int64LoweringTest, Int64LtU) { TEST_F(Int64LoweringTest, Int64LtU) {
TestComparison(machine()->Uint64LessThan(), IsUint32LessThan, TestComparison(machine()->Uint64LessThan(), IsUint32LessThan,
IsUint32LessThan); IsUint32LessThan);
} }
// kExprI64LeU:
TEST_F(Int64LoweringTest, Int64LeU) { TEST_F(Int64LoweringTest, Int64LeU) {
TestComparison(machine()->Uint64LessThanOrEqual(), IsUint32LessThan, TestComparison(machine()->Uint64LessThanOrEqual(), IsUint32LessThan,
IsUint32LessThanOrEqual); IsUint32LessThanOrEqual);
} }
// kExprI32ConvertI64:
TEST_F(Int64LoweringTest, I32ConvertI64) { TEST_F(Int64LoweringTest, I32ConvertI64) {
LowerGraph(graph()->NewNode(machine()->TruncateInt64ToInt32(), LowerGraph(graph()->NewNode(machine()->TruncateInt64ToInt32(),
Int64Constant(value(0))), Int64Constant(value(0))),
...@@ -475,7 +463,7 @@ TEST_F(Int64LoweringTest, I32ConvertI64) { ...@@ -475,7 +463,7 @@ TEST_F(Int64LoweringTest, I32ConvertI64) {
EXPECT_THAT(graph()->end()->InputAt(1), EXPECT_THAT(graph()->end()->InputAt(1),
IsReturn(IsInt32Constant(low_word_value(0)), start(), start())); IsReturn(IsInt32Constant(low_word_value(0)), start(), start()));
} }
// kExprI64SConvertI32:
TEST_F(Int64LoweringTest, I64SConvertI32) { TEST_F(Int64LoweringTest, I64SConvertI32) {
LowerGraph(graph()->NewNode(machine()->ChangeInt32ToInt64(), LowerGraph(graph()->NewNode(machine()->ChangeInt32ToInt64(),
Int32Constant(low_word_value(0))), Int32Constant(low_word_value(0))),
...@@ -501,7 +489,7 @@ TEST_F(Int64LoweringTest, I64SConvertI32_2) { ...@@ -501,7 +489,7 @@ TEST_F(Int64LoweringTest, I64SConvertI32_2) {
IsInt32Constant(31)), IsInt32Constant(31)),
start(), start())); start(), start()));
} }
// kExprI64UConvertI32:
TEST_F(Int64LoweringTest, I64UConvertI32) { TEST_F(Int64LoweringTest, I64UConvertI32) {
LowerGraph(graph()->NewNode(machine()->ChangeUint32ToUint64(), LowerGraph(graph()->NewNode(machine()->ChangeUint32ToUint64(),
Int32Constant(low_word_value(0))), Int32Constant(low_word_value(0))),
...@@ -523,7 +511,7 @@ TEST_F(Int64LoweringTest, I64UConvertI32_2) { ...@@ -523,7 +511,7 @@ TEST_F(Int64LoweringTest, I64UConvertI32_2) {
IsReturn2(IsInt32Constant(low_word_value(0)), IsInt32Constant(0), IsReturn2(IsInt32Constant(low_word_value(0)), IsInt32Constant(0),
start(), start())); start(), start()));
} }
// kExprF64ReinterpretI64:
TEST_F(Int64LoweringTest, F64ReinterpretI64) { TEST_F(Int64LoweringTest, F64ReinterpretI64) {
LowerGraph(graph()->NewNode(machine()->BitcastInt64ToFloat64(), LowerGraph(graph()->NewNode(machine()->BitcastInt64ToFloat64(),
Int64Constant(value(0))), Int64Constant(value(0))),
...@@ -554,7 +542,7 @@ TEST_F(Int64LoweringTest, F64ReinterpretI64) { ...@@ -554,7 +542,7 @@ TEST_F(Int64LoweringTest, F64ReinterpretI64) {
AllOf(CaptureEq(&store_capture), store_matcher), start()), AllOf(CaptureEq(&store_capture), store_matcher), start()),
start(), start())); start(), start()));
} }
// kExprI64ReinterpretF64:
TEST_F(Int64LoweringTest, I64ReinterpretF64) { TEST_F(Int64LoweringTest, I64ReinterpretF64) {
LowerGraph(graph()->NewNode(machine()->BitcastFloat64ToInt64(), LowerGraph(graph()->NewNode(machine()->BitcastFloat64ToInt64(),
Float64Constant(bit_cast<double>(value(0)))), Float64Constant(bit_cast<double>(value(0)))),
...@@ -583,7 +571,7 @@ TEST_F(Int64LoweringTest, I64ReinterpretF64) { ...@@ -583,7 +571,7 @@ TEST_F(Int64LoweringTest, I64ReinterpretF64) {
AllOf(CaptureEq(&store), store_matcher), start()), AllOf(CaptureEq(&store), store_matcher), start()),
start(), start())); start(), start()));
} }
// kExprI64Clz:
TEST_F(Int64LoweringTest, I64Clz) { TEST_F(Int64LoweringTest, I64Clz) {
LowerGraph(graph()->NewNode(machine()->Word64Clz(), Int64Constant(value(0))), LowerGraph(graph()->NewNode(machine()->Word64Clz(), Int64Constant(value(0))),
MachineRepresentation::kWord64); MachineRepresentation::kWord64);
...@@ -606,7 +594,7 @@ TEST_F(Int64LoweringTest, I64Clz) { ...@@ -606,7 +594,7 @@ TEST_F(Int64LoweringTest, I64Clz) {
AllOf(CaptureEq(&branch_capture), branch_matcher)))), AllOf(CaptureEq(&branch_capture), branch_matcher)))),
IsInt32Constant(0), start(), start())); IsInt32Constant(0), start(), start()));
} }
// kExprI64Ctz:
TEST_F(Int64LoweringTest, I64Ctz) { TEST_F(Int64LoweringTest, I64Ctz) {
LowerGraph(graph()->NewNode(machine()->Word64CtzPlaceholder(), LowerGraph(graph()->NewNode(machine()->Word64CtzPlaceholder(),
Int64Constant(value(0))), Int64Constant(value(0))),
...@@ -628,7 +616,6 @@ TEST_F(Int64LoweringTest, I64Ctz) { ...@@ -628,7 +616,6 @@ TEST_F(Int64LoweringTest, I64Ctz) {
AllOf(CaptureEq(&branch_capture), branch_matcher)))), AllOf(CaptureEq(&branch_capture), branch_matcher)))),
IsInt32Constant(0), start(), start())); IsInt32Constant(0), start(), start()));
} }
// kExprI64Popcnt:
TEST_F(Int64LoweringTest, Dfs) { TEST_F(Int64LoweringTest, Dfs) {
Node* common = Int64Constant(value(0)); Node* common = Int64Constant(value(0));
......
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