Commit 528ec99d authored by Liu Yu's avatar Liu Yu Committed by Commit Bot

[mips][wasm-simd][liftoff] Implement some SIMD instructions

Implement i8x16.popcnt, double precision conversions,
v64x2.alltrue and i64x2.ne.

Port: 00babf07
Port: 66964c51
Port: 1b81ffb1

Change-Id: I26f62f31fd362b06f7bcbf1988a8e2ff12d12504
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2706354
Auto-Submit: Liu yu <liuyu@loongson.cn>
Reviewed-by: 's avatarZhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#72854}
parent 12d3262b
...@@ -1925,6 +1925,11 @@ void LiftoffAssembler::emit_i64x2_eq(LiftoffRegister dst, LiftoffRegister lhs, ...@@ -1925,6 +1925,11 @@ void LiftoffAssembler::emit_i64x2_eq(LiftoffRegister dst, LiftoffRegister lhs,
bailout(kSimd, "emit_i64x2_eq"); bailout(kSimd, "emit_i64x2_eq");
} }
void LiftoffAssembler::emit_i64x2_ne(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) {
bailout(kSimd, "emit_i64x2_ne");
}
void LiftoffAssembler::emit_f64x2_eq(LiftoffRegister dst, LiftoffRegister lhs, void LiftoffAssembler::emit_f64x2_eq(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) { LiftoffRegister rhs) {
bailout(kSimd, "emit_f64x2_eq"); bailout(kSimd, "emit_f64x2_eq");
...@@ -2097,6 +2102,11 @@ void LiftoffAssembler::emit_i8x16_max_u(LiftoffRegister dst, ...@@ -2097,6 +2102,11 @@ void LiftoffAssembler::emit_i8x16_max_u(LiftoffRegister dst,
bailout(kSimd, "emit_i8x16_max_u"); bailout(kSimd, "emit_i8x16_max_u");
} }
void LiftoffAssembler::emit_i8x16_popcnt(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "emit_i8x16_popcnt");
}
void LiftoffAssembler::emit_i16x8_neg(LiftoffRegister dst, void LiftoffAssembler::emit_i16x8_neg(LiftoffRegister dst,
LiftoffRegister src) { LiftoffRegister src) {
bailout(kSimd, "emit_i16x8_neg"); bailout(kSimd, "emit_i16x8_neg");
...@@ -2304,6 +2314,11 @@ void LiftoffAssembler::emit_i64x2_neg(LiftoffRegister dst, ...@@ -2304,6 +2314,11 @@ void LiftoffAssembler::emit_i64x2_neg(LiftoffRegister dst,
bailout(kSimd, "emit_i64x2_neg"); bailout(kSimd, "emit_i64x2_neg");
} }
void LiftoffAssembler::emit_v64x2_alltrue(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "emit_v64x2_alltrue");
}
void LiftoffAssembler::emit_i64x2_bitmask(LiftoffRegister dst, void LiftoffAssembler::emit_i64x2_bitmask(LiftoffRegister dst,
LiftoffRegister src) { LiftoffRegister src) {
bailout(kSimd, "emit_i64x2_bitmask"); bailout(kSimd, "emit_i64x2_bitmask");
...@@ -2506,6 +2521,21 @@ void LiftoffAssembler::emit_f64x2_pmax(LiftoffRegister dst, LiftoffRegister lhs, ...@@ -2506,6 +2521,21 @@ void LiftoffAssembler::emit_f64x2_pmax(LiftoffRegister dst, LiftoffRegister lhs,
bailout(kSimd, "emit_f64x2_pmax"); bailout(kSimd, "emit_f64x2_pmax");
} }
void LiftoffAssembler::emit_f64x2_convert_low_i32x4_s(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "emit_f64x2_convert_low_i32x4_s");
}
void LiftoffAssembler::emit_f64x2_convert_low_i32x4_u(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "emit_f64x2_convert_low_i32x4_u");
}
void LiftoffAssembler::emit_f64x2_promote_low_f32x4(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "emit_f64x2_promote_low_f32x4");
}
void LiftoffAssembler::emit_i32x4_sconvert_f32x4(LiftoffRegister dst, void LiftoffAssembler::emit_i32x4_sconvert_f32x4(LiftoffRegister dst,
LiftoffRegister src) { LiftoffRegister src) {
bailout(kSimd, "emit_i32x4_sconvert_f32x4"); bailout(kSimd, "emit_i32x4_sconvert_f32x4");
...@@ -2516,6 +2546,16 @@ void LiftoffAssembler::emit_i32x4_uconvert_f32x4(LiftoffRegister dst, ...@@ -2516,6 +2546,16 @@ void LiftoffAssembler::emit_i32x4_uconvert_f32x4(LiftoffRegister dst,
bailout(kSimd, "emit_i32x4_uconvert_f32x4"); bailout(kSimd, "emit_i32x4_uconvert_f32x4");
} }
void LiftoffAssembler::emit_i32x4_trunc_sat_f64x2_s_zero(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "emit_i32x4_trunc_sat_f64x2_s_zero");
}
void LiftoffAssembler::emit_i32x4_trunc_sat_f64x2_u_zero(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "emit_i32x4_trunc_sat_f64x2_u_zero");
}
void LiftoffAssembler::emit_f32x4_sconvert_i32x4(LiftoffRegister dst, void LiftoffAssembler::emit_f32x4_sconvert_i32x4(LiftoffRegister dst,
LiftoffRegister src) { LiftoffRegister src) {
bailout(kSimd, "emit_f32x4_sconvert_i32x4"); bailout(kSimd, "emit_f32x4_sconvert_i32x4");
...@@ -2526,6 +2566,11 @@ void LiftoffAssembler::emit_f32x4_uconvert_i32x4(LiftoffRegister dst, ...@@ -2526,6 +2566,11 @@ void LiftoffAssembler::emit_f32x4_uconvert_i32x4(LiftoffRegister dst,
bailout(kSimd, "emit_f32x4_uconvert_i32x4"); bailout(kSimd, "emit_f32x4_uconvert_i32x4");
} }
void LiftoffAssembler::emit_f32x4_demote_f64x2_zero(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "emit_f32x4_demote_f64x2_zero");
}
void LiftoffAssembler::emit_i8x16_sconvert_i16x8(LiftoffRegister dst, void LiftoffAssembler::emit_i8x16_sconvert_i16x8(LiftoffRegister dst,
LiftoffRegister lhs, LiftoffRegister lhs,
LiftoffRegister rhs) { LiftoffRegister rhs) {
......
...@@ -1863,6 +1863,12 @@ void LiftoffAssembler::emit_i64x2_eq(LiftoffRegister dst, LiftoffRegister lhs, ...@@ -1863,6 +1863,12 @@ void LiftoffAssembler::emit_i64x2_eq(LiftoffRegister dst, LiftoffRegister lhs,
ceq_d(dst.fp().toW(), lhs.fp().toW(), rhs.fp().toW()); ceq_d(dst.fp().toW(), lhs.fp().toW(), rhs.fp().toW());
} }
void LiftoffAssembler::emit_i64x2_ne(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) {
ceq_d(dst.fp().toW(), lhs.fp().toW(), rhs.fp().toW());
nor_v(dst.fp().toW(), dst.fp().toW(), dst.fp().toW());
}
void LiftoffAssembler::emit_f64x2_eq(LiftoffRegister dst, LiftoffRegister lhs, void LiftoffAssembler::emit_f64x2_eq(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) { LiftoffRegister rhs) {
fceq_d(dst.fp().toW(), lhs.fp().toW(), rhs.fp().toW()); fceq_d(dst.fp().toW(), lhs.fp().toW(), rhs.fp().toW());
...@@ -2063,6 +2069,11 @@ void LiftoffAssembler::emit_i8x16_max_u(LiftoffRegister dst, ...@@ -2063,6 +2069,11 @@ void LiftoffAssembler::emit_i8x16_max_u(LiftoffRegister dst,
max_u_b(dst.fp().toW(), lhs.fp().toW(), rhs.fp().toW()); max_u_b(dst.fp().toW(), lhs.fp().toW(), rhs.fp().toW());
} }
void LiftoffAssembler::emit_i8x16_popcnt(LiftoffRegister dst,
LiftoffRegister src) {
pcnt_b(dst.fp().toW(), src.fp().toW());
}
void LiftoffAssembler::emit_i16x8_neg(LiftoffRegister dst, void LiftoffAssembler::emit_i16x8_neg(LiftoffRegister dst,
LiftoffRegister src) { LiftoffRegister src) {
xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero); xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
...@@ -2297,6 +2308,11 @@ void LiftoffAssembler::emit_i64x2_neg(LiftoffRegister dst, ...@@ -2297,6 +2308,11 @@ void LiftoffAssembler::emit_i64x2_neg(LiftoffRegister dst,
subv_d(dst.fp().toW(), kSimd128RegZero, src.fp().toW()); subv_d(dst.fp().toW(), kSimd128RegZero, src.fp().toW());
} }
void LiftoffAssembler::emit_v64x2_alltrue(LiftoffRegister dst,
LiftoffRegister src) {
liftoff::EmitAllTrue(this, dst, src, MSA_BRANCH_D);
}
void LiftoffAssembler::emit_i64x2_bitmask(LiftoffRegister dst, void LiftoffAssembler::emit_i64x2_bitmask(LiftoffRegister dst,
LiftoffRegister src) { LiftoffRegister src) {
srli_d(kSimd128RegZero, src.fp().toW(), 63); srli_d(kSimd128RegZero, src.fp().toW(), 63);
...@@ -2602,6 +2618,27 @@ void LiftoffAssembler::emit_f64x2_pmax(LiftoffRegister dst, LiftoffRegister lhs, ...@@ -2602,6 +2618,27 @@ void LiftoffAssembler::emit_f64x2_pmax(LiftoffRegister dst, LiftoffRegister lhs,
bsel_v(dst_msa, lhs_msa, rhs_msa); bsel_v(dst_msa, lhs_msa, rhs_msa);
} }
void LiftoffAssembler::emit_f64x2_convert_low_i32x4_s(LiftoffRegister dst,
LiftoffRegister src) {
xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
ilvr_w(kSimd128RegZero, kSimd128RegZero, src.fp().toW());
slli_d(kSimd128RegZero, kSimd128RegZero, 32);
srai_d(kSimd128RegZero, kSimd128RegZero, 32);
ffint_s_d(dst.fp().toW(), kSimd128RegZero);
}
void LiftoffAssembler::emit_f64x2_convert_low_i32x4_u(LiftoffRegister dst,
LiftoffRegister src) {
xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
ilvr_w(kSimd128RegZero, kSimd128RegZero, src.fp().toW());
ffint_u_d(dst.fp().toW(), kSimd128RegZero);
}
void LiftoffAssembler::emit_f64x2_promote_low_f32x4(LiftoffRegister dst,
LiftoffRegister src) {
fexupr_d(dst.fp().toW(), src.fp().toW());
}
void LiftoffAssembler::emit_i32x4_sconvert_f32x4(LiftoffRegister dst, void LiftoffAssembler::emit_i32x4_sconvert_f32x4(LiftoffRegister dst,
LiftoffRegister src) { LiftoffRegister src) {
ftrunc_s_w(dst.fp().toW(), src.fp().toW()); ftrunc_s_w(dst.fp().toW(), src.fp().toW());
...@@ -2612,6 +2649,22 @@ void LiftoffAssembler::emit_i32x4_uconvert_f32x4(LiftoffRegister dst, ...@@ -2612,6 +2649,22 @@ void LiftoffAssembler::emit_i32x4_uconvert_f32x4(LiftoffRegister dst,
ftrunc_u_w(dst.fp().toW(), src.fp().toW()); ftrunc_u_w(dst.fp().toW(), src.fp().toW());
} }
void LiftoffAssembler::emit_i32x4_trunc_sat_f64x2_s_zero(LiftoffRegister dst,
LiftoffRegister src) {
xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
ftrunc_s_d(kSimd128ScratchReg, src.fp().toW());
sat_s_d(kSimd128ScratchReg, kSimd128ScratchReg, 31);
pckev_w(dst.fp().toW(), kSimd128RegZero, kSimd128ScratchReg);
}
void LiftoffAssembler::emit_i32x4_trunc_sat_f64x2_u_zero(LiftoffRegister dst,
LiftoffRegister src) {
xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
ftrunc_u_d(kSimd128ScratchReg, src.fp().toW());
sat_u_d(kSimd128ScratchReg, kSimd128ScratchReg, 31);
pckev_w(dst.fp().toW(), kSimd128RegZero, kSimd128ScratchReg);
}
void LiftoffAssembler::emit_f32x4_sconvert_i32x4(LiftoffRegister dst, void LiftoffAssembler::emit_f32x4_sconvert_i32x4(LiftoffRegister dst,
LiftoffRegister src) { LiftoffRegister src) {
ffint_s_w(dst.fp().toW(), src.fp().toW()); ffint_s_w(dst.fp().toW(), src.fp().toW());
...@@ -2622,6 +2675,12 @@ void LiftoffAssembler::emit_f32x4_uconvert_i32x4(LiftoffRegister dst, ...@@ -2622,6 +2675,12 @@ void LiftoffAssembler::emit_f32x4_uconvert_i32x4(LiftoffRegister dst,
ffint_u_w(dst.fp().toW(), src.fp().toW()); ffint_u_w(dst.fp().toW(), src.fp().toW());
} }
void LiftoffAssembler::emit_f32x4_demote_f64x2_zero(LiftoffRegister dst,
LiftoffRegister src) {
xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
fexdo_w(dst.fp().toW(), kSimd128RegZero, 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