From f2f392fbad5b0b0bc65af28bbb537e6a9bee085a Mon Sep 17 00:00:00 2001 From: Junliang Yan Date: Thu, 16 Sep 2021 11:01:06 -0400 Subject: [PATCH] ppc: [liftoff] implement basic type conversion Change-Id: I1cfb706a429a67830640ec3274b95dd6ee9cdd56 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3164904 Reviewed-by: Milad Fa Commit-Queue: Junliang Yan Cr-Commit-Position: refs/heads/main@{#76883} --- src/wasm/baseline/ppc/liftoff-assembler-ppc.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/wasm/baseline/ppc/liftoff-assembler-ppc.h b/src/wasm/baseline/ppc/liftoff-assembler-ppc.h index 051f1e255f..b172fe9645 100644 --- a/src/wasm/baseline/ppc/liftoff-assembler-ppc.h +++ b/src/wasm/baseline/ppc/liftoff-assembler-ppc.h @@ -1085,6 +1085,25 @@ bool LiftoffAssembler::emit_i64_remu(LiftoffRegister dst, LiftoffRegister lhs, bool LiftoffAssembler::emit_type_conversion(WasmOpcode opcode, LiftoffRegister dst, LiftoffRegister src, Label* trap) { + switch (opcode) { + case kExprI32ConvertI64: + extsw(dst.gp(), src.gp()); + return true; + case kExprI64SConvertI32: + extsw(dst.gp(), src.gp()); + return true; + case kExprI64UConvertI32: + ZeroExtWord32(dst.gp(), src.gp()); + return true; + case kExprF32ConvertF64: + frsp(dst.fp(), src.fp()); + return true; + case kExprF64ConvertF32: + fmr(dst.fp(), src.fp()); + return true; + default: + break; + } bailout(kUnsupportedArchitecture, "emit_type_conversion"); return true; }