tcg/riscv64: Remove vector min/max ops with immediates
PATCH 1/1 tcg/riscv64: Remove vector min/max ops with immediates
RVV 1.0 only defines vmin, vminu, vmax and vmaxu instructions for the vector-vector and vector-scalar case, not the for vector-immediate case. Remove the immediate variant from TCG code generation.
Fixes 1631f19b04fe ("tcg/riscv: Implement vector min/max ops")
Signed-off-by Aurelien Jarno <[email protected]>
--- tcg/riscv64/tcg-target.c.inc | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-)
tcg/riscv64/tcg-target.c.inc +8 -12
@@ -306,13 +306,9 @@ typedef enum { OPC_VSSUBU_VI = 0x88000057 | V_OPIVI, OPC_VMAX_VV = 0x1c000057 | V_OPIVV, - OPC_VMAX_VI = 0x1c000057 | V_OPIVI, OPC_VMAXU_VV = 0x18000057 | V_OPIVV, - OPC_VMAXU_VI = 0x18000057 | V_OPIVI, OPC_VMIN_VV = 0x14000057 | V_OPIVV, - OPC_VMIN_VI = 0x14000057 | V_OPIVI, OPC_VMINU_VV = 0x10000057 | V_OPIVV, - OPC_VMINU_VI = 0x10000057 | V_OPIVI, OPC_VMSEQ_VV = 0x60000057 | V_OPIVV, OPC_VMSEQ_VI = 0x60000057 | V_OPIVI,
@@ -2810,19 +2806,19 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, break; case INDEX_op_smax_vec: set_vtype_len_sew(s, type, vece); - tcg_out_opc_vv_vi(s, OPC_VMAX_VV, OPC_VMAX_VI, a0, a1, a2, c2); + tcg_out_opc_vv(s, OPC_VMAX_VV, a0, a1, a2); break; case INDEX_op_smin_vec: set_vtype_len_sew(s, type, vece); - tcg_out_opc_vv_vi(s, OPC_VMIN_VV, OPC_VMIN_VI, a0, a1, a2, c2); + tcg_out_opc_vv(s, OPC_VMIN_VV, a0, a1, a2); break; case INDEX_op_umax_vec: set_vtype_len_sew(s, type, vece); - tcg_out_opc_vv_vi(s, OPC_VMAXU_VV, OPC_VMAXU_VI, a0, a1, a2, c2); + tcg_out_opc_vv(s, OPC_VMAXU_VV, a0, a1, a2); break; case INDEX_op_umin_vec: set_vtype_len_sew(s, type, vece); - tcg_out_opc_vv_vi(s, OPC_VMINU_VV, OPC_VMINU_VI, a0, a1, a2, c2); + tcg_out_opc_vv(s, OPC_VMINU_VV, a0, a1, a2); break; case INDEX_op_shls_vec: set_vtype_len_sew(s, type, vece);
@@ -2974,10 +2970,6 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_sssub_vec: case INDEX_op_usadd_vec: case INDEX_op_ussub_vec: - case INDEX_op_smax_vec: - case INDEX_op_smin_vec: - case INDEX_op_umax_vec: - case INDEX_op_umin_vec: return C_O1_I2(v, v, vK); case INDEX_op_sub_vec: return C_O1_I2(v, vK, v);
@@ -2987,6 +2979,10 @@ tcg_target_op_def(TCGOpcode op, TCGType type, unsigned flags) case INDEX_op_sarv_vec: case INDEX_op_rotlv_vec: case INDEX_op_rotrv_vec: + case INDEX_op_smax_vec: + case INDEX_op_smin_vec: + case INDEX_op_umax_vec: + case INDEX_op_umin_vec: return C_O1_I2(v, v, v); case INDEX_op_shls_vec: case INDEX_op_shrs_vec:
Signature · 1 line
2.53.0
Quoted 9 lines · Aurelien Jarno
RVV 1.0 only defines vmin, vminu, vmax and vmaxu instructions for the vector-vector and vector-scalar case, not the for vector-immediate case. Remove the immediate variant from TCG code generation.
Fixes 1631f19b04fe ("tcg/riscv: Implement vector min/max ops")Signed-off-by Aurelien Jarno<[email protected]>--- tcg/riscv64/tcg-target.c.inc | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-)
Reviewed-by Richard Henderson <[email protected]>
Thanks, queued to tcg-next.
r~