Commit ae9f9c67 authored by Lu Yahan's avatar Lu Yahan Committed by V8 LUCI CQ

[riscv64] Implement relaxed_trunc

Change-Id: I164d1debe2734e1dabf01e048deb4102e4903147
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3697472Reviewed-by: 's avatarji qiu <qiuji@iscas.ac.cn>
Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
Commit-Queue: ji qiu <qiuji@iscas.ac.cn>
Commit-Queue: Yahan Lu <yahan@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#81019}
parent 8dc7485b
......@@ -2418,19 +2418,31 @@ void LiftoffAssembler::emit_i32x4_trunc_sat_f64x2_u_zero(LiftoffRegister dst,
void LiftoffAssembler::emit_i32x4_relaxed_trunc_f32x4_s(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kRelaxedSimd, "emit_i32x4_relaxed_trunc_f32x4_s");
VU.set(FPURoundingMode::RTZ);
VU.set(kScratchReg, E32, m1);
vfcvt_x_f_v(dst.fp().toV(), src.fp().toV());
}
void LiftoffAssembler::emit_i32x4_relaxed_trunc_f32x4_u(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kRelaxedSimd, "emit_i32x4_relaxed_trunc_f32x4_u");
VU.set(FPURoundingMode::RTZ);
VU.set(kScratchReg, E32, m1);
vfcvt_xu_f_v(dst.fp().toV(), src.fp().toV());
}
void LiftoffAssembler::emit_i32x4_relaxed_trunc_f64x2_s_zero(
LiftoffRegister dst, LiftoffRegister src) {
bailout(kRelaxedSimd, "emit_i32x4_relaxed_trunc_f64x2_s_zero");
VU.set(kScratchReg, E32, m1);
VU.set(FPURoundingMode::RTZ);
vmv_vv(kSimd128ScratchReg, src.fp().toV());
vfncvt_x_f_w(kSimd128ScratchReg, kSimd128ScratchReg);
vmv_vv(dst.fp().toV(), kSimd128ScratchReg);
}
void LiftoffAssembler::emit_i32x4_relaxed_trunc_f64x2_u_zero(
LiftoffRegister dst, LiftoffRegister src) {
bailout(kRelaxedSimd, "emit_i32x4_relaxed_trunc_f64x2_u_zero");
VU.set(kScratchReg, E32, m1);
VU.set(FPURoundingMode::RTZ);
vmv_vv(kSimd128ScratchReg, src.fp().toV());
vfncvt_xu_f_w(kSimd128ScratchReg, kSimd128ScratchReg);
vmv_vv(dst.fp().toV(), kSimd128ScratchReg);
}
void LiftoffAssembler::emit_f64x2_eq(LiftoffRegister dst, LiftoffRegister lhs,
......
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