Commit 5c208de7 authored by Yu Yin's avatar Yu Yin Committed by Commit Bot

[MIPS64][liftoff] Introduce emit_{i64,i32}_add with immediate

This is port for https://crrev.com/c/1524482
Original commit message:
    This allows immediates to be encoded directly into instructions, rather than
    mov-ing constants to registers first.

    This patch only changes emit_{i64,i32}_add, other emit_ functions will be changed once
    this approach has been approved.

Bug: v8:9038
Change-Id: I96929f870e54b24403a32428f3db31b42f41087a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1545148Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Yu Yin <xwafish@gmail.com>
Cr-Commit-Position: refs/heads/master@{#60619}
parent e26ec8bd
......@@ -500,6 +500,10 @@ void LiftoffAssembler::FillI64Half(Register, uint32_t index, RegPairHalf) {
UNREACHABLE();
}
void LiftoffAssembler::emit_i32_add(Register dst, Register lhs, int32_t imm) {
Addu(dst, lhs, Operand(imm));
}
void LiftoffAssembler::emit_i32_mul(Register dst, Register lhs, Register rhs) {
TurboAssembler::Mul(dst, lhs, rhs);
}
......@@ -590,6 +594,11 @@ I32_SHIFTOP_I(shr, srl)
#undef I32_SHIFTOP
#undef I32_SHIFTOP_I
void LiftoffAssembler::emit_i64_add(LiftoffRegister dst, LiftoffRegister lhs,
int32_t imm) {
Daddu(dst.gp(), lhs.gp(), Operand(imm));
}
void LiftoffAssembler::emit_i64_mul(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) {
TurboAssembler::Dmul(dst.gp(), lhs.gp(), rhs.gp());
......
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