Skip to content

Commit

Permalink
[Liftoff] Cleanup unop macros
Browse files Browse the repository at this point in the history
Merge CASE_I32_SIGN_EXTENSION with the identical CASE_I32_UNOP, and
rename CASE_I64_SIGN_EXTENSION to CASE_I64_UNOP. This prepares the
addition of more opcodes.

R=ahaas@chromium.org

Bug: v8:9919
Change-Id: Ie1611e2b937dffab221bfd9911e8b7f2350b9d19
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1889882
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64668}
  • Loading branch information
backes authored and Commit Bot committed Oct 31, 2019
1 parent d4b39ac commit 6032db4
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions src/wasm/baseline/liftoff-compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -742,14 +742,7 @@ class LiftoffCompiler {
__ emit_##fn(dst.gp(), src.gp()); \
}); \
break;
#define CASE_I32_SIGN_EXTENSION(opcode, fn) \
case kExpr##opcode: \
EmitUnOp<kWasmI32, kWasmI32>( \
[=](LiftoffRegister dst, LiftoffRegister src) { \
__ emit_##fn(dst.gp(), src.gp()); \
}); \
break;
#define CASE_I64_SIGN_EXTENSION(opcode, fn) \
#define CASE_I64_UNOP(opcode, fn) \
case kExpr##opcode: \
EmitUnOp<kWasmI64, kWasmI64>( \
[=](LiftoffRegister dst, LiftoffRegister src) { \
Expand Down Expand Up @@ -823,11 +816,11 @@ class LiftoffCompiler {
&ExternalReference::wasm_uint64_to_float64, kNoTrap)
CASE_TYPE_CONVERSION(F64ConvertF32, F64, F32, nullptr, kNoTrap)
CASE_TYPE_CONVERSION(F64ReinterpretI64, F64, I64, nullptr, kNoTrap)
CASE_I32_SIGN_EXTENSION(I32SExtendI8, i32_signextend_i8)
CASE_I32_SIGN_EXTENSION(I32SExtendI16, i32_signextend_i16)
CASE_I64_SIGN_EXTENSION(I64SExtendI8, i64_signextend_i8)
CASE_I64_SIGN_EXTENSION(I64SExtendI16, i64_signextend_i16)
CASE_I64_SIGN_EXTENSION(I64SExtendI32, i64_signextend_i32)
CASE_I32_UNOP(I32SExtendI8, i32_signextend_i8)
CASE_I32_UNOP(I32SExtendI16, i32_signextend_i16)
CASE_I64_UNOP(I64SExtendI8, i64_signextend_i8)
CASE_I64_UNOP(I64SExtendI16, i64_signextend_i16)
CASE_I64_UNOP(I64SExtendI32, i64_signextend_i32)
case kExprI32Eqz:
DCHECK(decoder->lookahead(0, kExprI32Eqz));
if (decoder->lookahead(1, kExprBrIf)) {
Expand Down Expand Up @@ -869,8 +862,7 @@ class LiftoffCompiler {
UNREACHABLE();
}
#undef CASE_I32_UNOP
#undef CASE_I32_SIGN_EXTENSION
#undef CASE_I64_SIGN_EXTENSION
#undef CASE_I64_UNOP
#undef CASE_FLOAT_UNOP
#undef CASE_FLOAT_UNOP_WITH_CFALLBACK
#undef CASE_TYPE_CONVERSION
Expand Down

0 comments on commit 6032db4

Please sign in to comment.