[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 28/36] target/arm: Use FPST_A32_F16 in A32 decoder
From: |
Peter Maydell |
Subject: |
[PULL 28/36] target/arm: Use FPST_A32_F16 in A32 decoder |
Date: |
Tue, 28 Jan 2025 20:13:06 +0000 |
In the A32 decoder, use FPST_A32_F16 rather than FPST_FPCR_F16.
By doing an automated conversion of the whole file we avoid possibly
using more than one fpst value in a set_rmode/op/restore_rmode
sequence.
Patch created with
perl -p -i -e 's/FPST_FPCR_F16(?!_)/FPST_A32_F16/g'
target/arm/tcg/translate-vfp.c
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20250124162836.2332150-17-peter.maydell@linaro.org
---
target/arm/tcg/translate-vfp.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/target/arm/tcg/translate-vfp.c b/target/arm/tcg/translate-vfp.c
index c82f41234cd..8d9d1ab877a 100644
--- a/target/arm/tcg/translate-vfp.c
+++ b/target/arm/tcg/translate-vfp.c
@@ -460,7 +460,7 @@ static bool trans_VRINT(DisasContext *s, arg_VRINT *a)
}
if (sz == 1) {
- fpst = fpstatus_ptr(FPST_FPCR_F16);
+ fpst = fpstatus_ptr(FPST_A32_F16);
} else {
fpst = fpstatus_ptr(FPST_A32);
}
@@ -527,7 +527,7 @@ static bool trans_VCVT(DisasContext *s, arg_VCVT *a)
}
if (sz == 1) {
- fpst = fpstatus_ptr(FPST_FPCR_F16);
+ fpst = fpstatus_ptr(FPST_A32_F16);
} else {
fpst = fpstatus_ptr(FPST_A32);
}
@@ -1433,7 +1433,7 @@ static bool do_vfp_3op_hp(DisasContext *s, VFPGen3OpSPFn
*fn,
/*
* Do a half-precision operation. Functionally this is
* the same as do_vfp_3op_sp(), except:
- * - it uses the FPST_FPCR_F16
+ * - it uses the FPST_A32_F16
* - it doesn't need the VFP vector handling (fp16 is a
* v8 feature, and in v8 VFP vectors don't exist)
* - it does the aa32_fp16_arith feature test
@@ -1456,7 +1456,7 @@ static bool do_vfp_3op_hp(DisasContext *s, VFPGen3OpSPFn
*fn,
f0 = tcg_temp_new_i32();
f1 = tcg_temp_new_i32();
fd = tcg_temp_new_i32();
- fpst = fpstatus_ptr(FPST_FPCR_F16);
+ fpst = fpstatus_ptr(FPST_A32_F16);
vfp_load_reg16(f0, vn);
vfp_load_reg16(f1, vm);
@@ -2122,7 +2122,7 @@ static bool do_vfm_hp(DisasContext *s, arg_VFMA_sp *a,
bool neg_n, bool neg_d)
/* VFNMA, VFNMS */
gen_vfp_negh(vd, vd);
}
- fpst = fpstatus_ptr(FPST_FPCR_F16);
+ fpst = fpstatus_ptr(FPST_A32_F16);
gen_helper_vfp_muladdh(vd, vn, vm, vd, fpst);
vfp_store_reg32(vd, a->vd);
return true;
@@ -2424,7 +2424,7 @@ DO_VFP_2OP(VNEG, dp, gen_vfp_negd, aa32_fpdp_v2)
static void gen_VSQRT_hp(TCGv_i32 vd, TCGv_i32 vm)
{
- gen_helper_vfp_sqrth(vd, vm, fpstatus_ptr(FPST_FPCR_F16));
+ gen_helper_vfp_sqrth(vd, vm, fpstatus_ptr(FPST_A32_F16));
}
static void gen_VSQRT_sp(TCGv_i32 vd, TCGv_i32 vm)
@@ -2706,7 +2706,7 @@ static bool trans_VRINTR_hp(DisasContext *s,
arg_VRINTR_sp *a)
tmp = tcg_temp_new_i32();
vfp_load_reg16(tmp, a->vm);
- fpst = fpstatus_ptr(FPST_FPCR_F16);
+ fpst = fpstatus_ptr(FPST_A32_F16);
gen_helper_rinth(tmp, tmp, fpst);
vfp_store_reg32(tmp, a->vd);
return true;
@@ -2779,7 +2779,7 @@ static bool trans_VRINTZ_hp(DisasContext *s,
arg_VRINTZ_sp *a)
tmp = tcg_temp_new_i32();
vfp_load_reg16(tmp, a->vm);
- fpst = fpstatus_ptr(FPST_FPCR_F16);
+ fpst = fpstatus_ptr(FPST_A32_F16);
tcg_rmode = gen_set_rmode(FPROUNDING_ZERO, fpst);
gen_helper_rinth(tmp, tmp, fpst);
gen_restore_rmode(tcg_rmode, fpst);
@@ -2859,7 +2859,7 @@ static bool trans_VRINTX_hp(DisasContext *s,
arg_VRINTX_sp *a)
tmp = tcg_temp_new_i32();
vfp_load_reg16(tmp, a->vm);
- fpst = fpstatus_ptr(FPST_FPCR_F16);
+ fpst = fpstatus_ptr(FPST_A32_F16);
gen_helper_rinth_exact(tmp, tmp, fpst);
vfp_store_reg32(tmp, a->vd);
return true;
@@ -2983,7 +2983,7 @@ static bool trans_VCVT_int_hp(DisasContext *s,
arg_VCVT_int_sp *a)
vm = tcg_temp_new_i32();
vfp_load_reg32(vm, a->vm);
- fpst = fpstatus_ptr(FPST_FPCR_F16);
+ fpst = fpstatus_ptr(FPST_A32_F16);
if (a->s) {
/* i32 -> f16 */
gen_helper_vfp_sitoh(vm, vm, fpst);
@@ -3105,7 +3105,7 @@ static bool trans_VCVT_fix_hp(DisasContext *s,
arg_VCVT_fix_sp *a)
vd = tcg_temp_new_i32();
vfp_load_reg32(vd, a->vd);
- fpst = fpstatus_ptr(FPST_FPCR_F16);
+ fpst = fpstatus_ptr(FPST_A32_F16);
shift = tcg_constant_i32(frac_bits);
/* Switch on op:U:sx bits */
@@ -3273,7 +3273,7 @@ static bool trans_VCVT_hp_int(DisasContext *s,
arg_VCVT_sp_int *a)
return true;
}
- fpst = fpstatus_ptr(FPST_FPCR_F16);
+ fpst = fpstatus_ptr(FPST_A32_F16);
vm = tcg_temp_new_i32();
vfp_load_reg16(vm, a->vm);
--
2.34.1
- [PULL 15/36] target/arm: Use FPSR_ constants in vfp_exceptbits_from_host(), (continued)
- [PULL 15/36] target/arm: Use FPSR_ constants in vfp_exceptbits_from_host(), Peter Maydell, 2025/01/28
- [PULL 16/36] target/arm: Use uint32_t in vfp_exceptbits_from_host(), Peter Maydell, 2025/01/28
- [PULL 17/36] target/arm: Define new fp_status_a32 and fp_status_a64, Peter Maydell, 2025/01/28
- [PULL 19/36] target/arm: Use fp_status_a64 or fp_status_a32 in is_ebf(), Peter Maydell, 2025/01/28
- [PULL 18/36] target/arm: Use vfp.fp_status_a64 in A64-only helper functions, Peter Maydell, 2025/01/28
- [PULL 22/36] target/arm: Use FPST_A32 in A32 decoder, Peter Maydell, 2025/01/28
- [PULL 20/36] target/arm: Use fp_status_a32 in vjvct helper, Peter Maydell, 2025/01/28
- [PULL 21/36] target/arm: Use fp_status_a32 in vfp_cmp helpers, Peter Maydell, 2025/01/28
- [PULL 26/36] target/arm: Use fp_status_f16_a32 in AArch32-only helpers, Peter Maydell, 2025/01/28
- [PULL 23/36] target/arm: Use FPST_A64 in A64 decoder, Peter Maydell, 2025/01/28
- [PULL 28/36] target/arm: Use FPST_A32_F16 in A32 decoder,
Peter Maydell <=
- [PULL 35/36] target/arm: Use FPST_A64_F16 for halfprec-to-other conversions, Peter Maydell, 2025/01/28
- [PULL 34/36] target/arm: Remove redundant advsimd float16 helpers, Peter Maydell, 2025/01/28
- [PULL 36/36] hw/usb/canokey: Fix buffer overflow for OUT packet, Peter Maydell, 2025/01/28
- [PULL 25/36] target/arm: Define new fp_status_f16_a32 and fp_status_f16_a64, Peter Maydell, 2025/01/28
- [PULL 24/36] target/arm: Remove now-unused vfp.fp_status and FPST_FPCR, Peter Maydell, 2025/01/28
- [PULL 27/36] target/arm: Use fp_status_f16_a64 in AArch64-only helpers, Peter Maydell, 2025/01/28
- [PULL 31/36] fpu: Rename float_flag_input_denormal to float_flag_input_denormal_flushed, Peter Maydell, 2025/01/28
- [PULL 30/36] target/arm: Remove now-unused vfp.fp_status_f16 and FPST_FPCR_F16, Peter Maydell, 2025/01/28
- [PULL 32/36] fpu: Rename float_flag_output_denormal to float_flag_output_denormal_flushed, Peter Maydell, 2025/01/28
- [PULL 33/36] fpu: Fix a comment in softfloat-types.h, Peter Maydell, 2025/01/28