mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-27 03:51:57 -06:00
tcg/riscv: Accept constant first argument to sub_vec
Use vrsub.vi to subtract from a constant. Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
c283c0748a
commit
dc9cd4ec12
2 changed files with 7 additions and 2 deletions
|
@ -25,6 +25,7 @@ C_O0_I2(v, r)
|
||||||
C_O1_I1(v, r)
|
C_O1_I1(v, r)
|
||||||
C_O1_I1(v, v)
|
C_O1_I1(v, v)
|
||||||
C_O1_I2(v, v, v)
|
C_O1_I2(v, v, v)
|
||||||
|
C_O1_I2(v, vK, v)
|
||||||
C_O1_I2(v, v, vK)
|
C_O1_I2(v, v, vK)
|
||||||
C_O1_I2(v, v, vL)
|
C_O1_I2(v, v, vL)
|
||||||
C_O1_I4(v, v, vL, vK, vK)
|
C_O1_I4(v, v, vL, vK, vK)
|
||||||
|
|
|
@ -2350,7 +2350,11 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc,
|
||||||
break;
|
break;
|
||||||
case INDEX_op_sub_vec:
|
case INDEX_op_sub_vec:
|
||||||
set_vtype_len_sew(s, type, vece);
|
set_vtype_len_sew(s, type, vece);
|
||||||
|
if (const_args[1]) {
|
||||||
|
tcg_out_opc_vi(s, OPC_VRSUB_VI, a0, a2, a1);
|
||||||
|
} else {
|
||||||
tcg_out_opc_vv(s, OPC_VSUB_VV, a0, a1, a2);
|
tcg_out_opc_vv(s, OPC_VSUB_VV, a0, a1, a2);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case INDEX_op_and_vec:
|
case INDEX_op_and_vec:
|
||||||
set_vtype_len(s, type);
|
set_vtype_len(s, type);
|
||||||
|
@ -2565,7 +2569,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op)
|
||||||
case INDEX_op_xor_vec:
|
case INDEX_op_xor_vec:
|
||||||
return C_O1_I2(v, v, vK);
|
return C_O1_I2(v, v, vK);
|
||||||
case INDEX_op_sub_vec:
|
case INDEX_op_sub_vec:
|
||||||
return C_O1_I2(v, v, v);
|
return C_O1_I2(v, vK, v);
|
||||||
case INDEX_op_cmp_vec:
|
case INDEX_op_cmp_vec:
|
||||||
return C_O1_I2(v, v, vL);
|
return C_O1_I2(v, v, vL);
|
||||||
case INDEX_op_cmpsel_vec:
|
case INDEX_op_cmpsel_vec:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue