Commit 3cf5a452 authored by Zhao Jiazhong's avatar Zhao Jiazhong Committed by Commit Bot

[mips][wasm-simd][liftoff] Implement int-float/float-int conversion, s8x16.swizzle, anytrue.

port 0f624aae
https://crrev.com/c/2208686

port 839e9695
https://crrev.com/c/2208610

port 51847be8
https://crrev.com/c/2216930

Change-Id: I11046631b575a521d11c17ea5c418bfc7d900e8a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2219749Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#68068}
parent 18ffc9fa
...@@ -1574,6 +1574,12 @@ void LiftoffAssembler::LoadTransform(LiftoffRegister dst, Register src_addr, ...@@ -1574,6 +1574,12 @@ void LiftoffAssembler::LoadTransform(LiftoffRegister dst, Register src_addr,
bailout(kSimd, "load extend and load splat unimplemented"); bailout(kSimd, "load extend and load splat unimplemented");
} }
void LiftoffAssembler::emit_s8x16_swizzle(LiftoffRegister dst,
LiftoffRegister lhs,
LiftoffRegister rhs) {
bailout(kSimd, "emit_s8x16_swizzle");
}
void LiftoffAssembler::emit_i8x16_splat(LiftoffRegister dst, void LiftoffAssembler::emit_i8x16_splat(LiftoffRegister dst,
LiftoffRegister src) { LiftoffRegister src) {
bailout(kSimd, "emit_i8x16_splat"); bailout(kSimd, "emit_i8x16_splat");
...@@ -1771,6 +1777,11 @@ void LiftoffAssembler::emit_i8x16_neg(LiftoffRegister dst, ...@@ -1771,6 +1777,11 @@ void LiftoffAssembler::emit_i8x16_neg(LiftoffRegister dst,
bailout(kSimd, "emit_i8x16_neg"); bailout(kSimd, "emit_i8x16_neg");
} }
void LiftoffAssembler::emit_v8x16_anytrue(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "emit_v8x16_anytrue");
}
void LiftoffAssembler::emit_i8x16_shl(LiftoffRegister dst, LiftoffRegister lhs, void LiftoffAssembler::emit_i8x16_shl(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) { LiftoffRegister rhs) {
bailout(kSimd, "emit_i8x16_shl"); bailout(kSimd, "emit_i8x16_shl");
...@@ -1871,6 +1882,11 @@ void LiftoffAssembler::emit_i16x8_neg(LiftoffRegister dst, ...@@ -1871,6 +1882,11 @@ void LiftoffAssembler::emit_i16x8_neg(LiftoffRegister dst,
bailout(kSimd, "emit_i16x8_neg"); bailout(kSimd, "emit_i16x8_neg");
} }
void LiftoffAssembler::emit_v16x8_anytrue(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "emit_v16x8_anytrue");
}
void LiftoffAssembler::emit_i16x8_shl(LiftoffRegister dst, LiftoffRegister lhs, void LiftoffAssembler::emit_i16x8_shl(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) { LiftoffRegister rhs) {
bailout(kSimd, "emit_i16x8_shl"); bailout(kSimd, "emit_i16x8_shl");
...@@ -1971,6 +1987,11 @@ void LiftoffAssembler::emit_i32x4_neg(LiftoffRegister dst, ...@@ -1971,6 +1987,11 @@ void LiftoffAssembler::emit_i32x4_neg(LiftoffRegister dst,
bailout(kSimd, "emit_i32x4_neg"); bailout(kSimd, "emit_i32x4_neg");
} }
void LiftoffAssembler::emit_v32x4_anytrue(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "emit_v32x4_anytrue");
}
void LiftoffAssembler::emit_i32x4_shl(LiftoffRegister dst, LiftoffRegister lhs, void LiftoffAssembler::emit_i32x4_shl(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) { LiftoffRegister rhs) {
bailout(kSimd, "emit_i32x4_shl"); bailout(kSimd, "emit_i32x4_shl");
...@@ -2184,6 +2205,26 @@ void LiftoffAssembler::emit_f64x2_max(LiftoffRegister dst, LiftoffRegister lhs, ...@@ -2184,6 +2205,26 @@ void LiftoffAssembler::emit_f64x2_max(LiftoffRegister dst, LiftoffRegister lhs,
bailout(kSimd, "emit_f64x2_max"); bailout(kSimd, "emit_f64x2_max");
} }
void LiftoffAssembler::emit_i32x4_sconvert_f32x4(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "emit_i32x4_sconvert_f32x4");
}
void LiftoffAssembler::emit_i32x4_uconvert_f32x4(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "emit_i32x4_uconvert_f32x4");
}
void LiftoffAssembler::emit_f32x4_sconvert_i32x4(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "emit_f32x4_sconvert_i32x4");
}
void LiftoffAssembler::emit_f32x4_uconvert_i32x4(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "emit_f32x4_uconvert_i32x4");
}
void LiftoffAssembler::emit_i8x16_sconvert_i16x8(LiftoffRegister dst, void LiftoffAssembler::emit_i8x16_sconvert_i16x8(LiftoffRegister dst,
LiftoffRegister lhs, LiftoffRegister lhs,
LiftoffRegister rhs) { LiftoffRegister rhs) {
......
...@@ -1321,6 +1321,16 @@ inline FPUCondition ConditionToConditionCmpFPU(Condition condition, ...@@ -1321,6 +1321,16 @@ inline FPUCondition ConditionToConditionCmpFPU(Condition condition,
UNREACHABLE(); UNREACHABLE();
} }
inline void EmitAnyTrue(LiftoffAssembler* assm, LiftoffRegister dst,
LiftoffRegister src) {
Label all_false;
assm->BranchMSA(&all_false, MSA_BRANCH_V, all_zero, src.fp().toW(),
USE_DELAY_SLOT);
assm->li(dst.gp(), 0l);
assm->li(dst.gp(), 1);
assm->bind(&all_false);
}
} // namespace liftoff } // namespace liftoff
void LiftoffAssembler::emit_f32_set_cond(Condition cond, Register dst, void LiftoffAssembler::emit_f32_set_cond(Condition cond, Register dst,
...@@ -1439,6 +1449,22 @@ void LiftoffAssembler::LoadTransform(LiftoffRegister dst, Register src_addr, ...@@ -1439,6 +1449,22 @@ void LiftoffAssembler::LoadTransform(LiftoffRegister dst, Register src_addr,
} }
} }
void LiftoffAssembler::emit_s8x16_swizzle(LiftoffRegister dst,
LiftoffRegister lhs,
LiftoffRegister rhs) {
MSARegister dst_msa = dst.fp().toW();
MSARegister lhs_msa = lhs.fp().toW();
MSARegister rhs_msa = rhs.fp().toW();
if (dst == lhs) {
move_v(kSimd128ScratchReg, lhs_msa);
lhs_msa = kSimd128ScratchReg;
}
xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
move_v(dst_msa, rhs_msa);
vshf_b(dst_msa, kSimd128RegZero, lhs_msa);
}
void LiftoffAssembler::emit_i8x16_splat(LiftoffRegister dst, void LiftoffAssembler::emit_i8x16_splat(LiftoffRegister dst,
LiftoffRegister src) { LiftoffRegister src) {
fill_b(dst.fp().toW(), src.gp()); fill_b(dst.fp().toW(), src.gp());
...@@ -1649,6 +1675,11 @@ void LiftoffAssembler::emit_i8x16_neg(LiftoffRegister dst, ...@@ -1649,6 +1675,11 @@ void LiftoffAssembler::emit_i8x16_neg(LiftoffRegister dst,
subv_b(dst.fp().toW(), kSimd128RegZero, src.fp().toW()); subv_b(dst.fp().toW(), kSimd128RegZero, src.fp().toW());
} }
void LiftoffAssembler::emit_v8x16_anytrue(LiftoffRegister dst,
LiftoffRegister src) {
liftoff::EmitAnyTrue(this, dst, src);
}
void LiftoffAssembler::emit_i8x16_shl(LiftoffRegister dst, LiftoffRegister lhs, void LiftoffAssembler::emit_i8x16_shl(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) { LiftoffRegister rhs) {
fill_b(kSimd128ScratchReg, rhs.gp()); fill_b(kSimd128ScratchReg, rhs.gp());
...@@ -1753,6 +1784,11 @@ void LiftoffAssembler::emit_i16x8_neg(LiftoffRegister dst, ...@@ -1753,6 +1784,11 @@ void LiftoffAssembler::emit_i16x8_neg(LiftoffRegister dst,
subv_h(dst.fp().toW(), kSimd128RegZero, src.fp().toW()); subv_h(dst.fp().toW(), kSimd128RegZero, src.fp().toW());
} }
void LiftoffAssembler::emit_v16x8_anytrue(LiftoffRegister dst,
LiftoffRegister src) {
liftoff::EmitAnyTrue(this, dst, src);
}
void LiftoffAssembler::emit_i16x8_shl(LiftoffRegister dst, LiftoffRegister lhs, void LiftoffAssembler::emit_i16x8_shl(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) { LiftoffRegister rhs) {
fill_h(kSimd128ScratchReg, rhs.gp()); fill_h(kSimd128ScratchReg, rhs.gp());
...@@ -1857,6 +1893,11 @@ void LiftoffAssembler::emit_i32x4_neg(LiftoffRegister dst, ...@@ -1857,6 +1893,11 @@ void LiftoffAssembler::emit_i32x4_neg(LiftoffRegister dst,
subv_w(dst.fp().toW(), kSimd128RegZero, src.fp().toW()); subv_w(dst.fp().toW(), kSimd128RegZero, src.fp().toW());
} }
void LiftoffAssembler::emit_v32x4_anytrue(LiftoffRegister dst,
LiftoffRegister src) {
liftoff::EmitAnyTrue(this, dst, src);
}
void LiftoffAssembler::emit_i32x4_shl(LiftoffRegister dst, LiftoffRegister lhs, void LiftoffAssembler::emit_i32x4_shl(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) { LiftoffRegister rhs) {
fill_w(kSimd128ScratchReg, rhs.gp()); fill_w(kSimd128ScratchReg, rhs.gp());
...@@ -2137,6 +2178,26 @@ void LiftoffAssembler::emit_f64x2_max(LiftoffRegister dst, LiftoffRegister lhs, ...@@ -2137,6 +2178,26 @@ void LiftoffAssembler::emit_f64x2_max(LiftoffRegister dst, LiftoffRegister lhs,
bsel_v(dst_msa, scratch0, scratch1); bsel_v(dst_msa, scratch0, scratch1);
} }
void LiftoffAssembler::emit_i32x4_sconvert_f32x4(LiftoffRegister dst,
LiftoffRegister src) {
ftrunc_s_w(dst.fp().toW(), src.fp().toW());
}
void LiftoffAssembler::emit_i32x4_uconvert_f32x4(LiftoffRegister dst,
LiftoffRegister src) {
ftrunc_u_w(dst.fp().toW(), src.fp().toW());
}
void LiftoffAssembler::emit_f32x4_sconvert_i32x4(LiftoffRegister dst,
LiftoffRegister src) {
ffint_s_w(dst.fp().toW(), src.fp().toW());
}
void LiftoffAssembler::emit_f32x4_uconvert_i32x4(LiftoffRegister dst,
LiftoffRegister src) {
ffint_u_w(dst.fp().toW(), src.fp().toW());
}
void LiftoffAssembler::emit_i8x16_sconvert_i16x8(LiftoffRegister dst, void LiftoffAssembler::emit_i8x16_sconvert_i16x8(LiftoffRegister dst,
LiftoffRegister lhs, LiftoffRegister lhs,
LiftoffRegister rhs) { LiftoffRegister rhs) {
......
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