Commit b88bfa9f authored by Junliang Yan's avatar Junliang Yan Committed by V8 LUCI CQ

ppc: [liftoff] implement type reinterpret casting

Change-Id: I8edbc9f3acada00d40b8007c880dfb3d14491744
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3168356
Commit-Queue: Junliang Yan <junyan@redhat.com>
Reviewed-by: 's avatarMilad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#76914}
parent f2e25f8a
...@@ -1252,11 +1252,37 @@ bool LiftoffAssembler::emit_type_conversion(WasmOpcode opcode, ...@@ -1252,11 +1252,37 @@ bool LiftoffAssembler::emit_type_conversion(WasmOpcode opcode,
bind(&done); bind(&done);
return true; return true;
} }
case kExprI32ReinterpretF32: {
subi(sp, sp, Operand(kSystemPointerSize));
StoreF32(src.fp(), MemOperand(sp), r0);
LoadU32(dst.gp(), MemOperand(sp), r0);
addi(sp, sp, Operand(kSystemPointerSize));
return true;
}
case kExprI64ReinterpretF64: {
subi(sp, sp, Operand(kSystemPointerSize));
StoreF64(src.fp(), MemOperand(sp), r0);
LoadU64(dst.gp(), MemOperand(sp), r0);
addi(sp, sp, Operand(kSystemPointerSize));
return true;
}
case kExprF32ReinterpretI32: {
subi(sp, sp, Operand(kSystemPointerSize));
StoreU32(src.gp(), MemOperand(sp), r0);
LoadF32(dst.fp(), MemOperand(sp), r0);
addi(sp, sp, Operand(kSystemPointerSize));
return true;
}
case kExprF64ReinterpretI64: {
subi(sp, sp, Operand(kSystemPointerSize));
StoreU64(src.gp(), MemOperand(sp), r0);
LoadF64(dst.fp(), MemOperand(sp), r0);
addi(sp, sp, Operand(kSystemPointerSize));
return true;
}
default: default:
break; UNREACHABLE();
} }
bailout(kUnsupportedArchitecture, "emit_type_conversion");
return true;
} }
void LiftoffAssembler::emit_jump(Label* label) { b(al, label); } void LiftoffAssembler::emit_jump(Label* label) { b(al, label); }
......
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