[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/76] target/arm: Use FPSR_ constants in vfp_exceptbits_from_hos
From: |
Peter Maydell |
Subject: |
[PATCH 04/76] target/arm: Use FPSR_ constants in vfp_exceptbits_from_host() |
Date: |
Fri, 24 Jan 2025 16:27:24 +0000 |
Use the FPSR_ named constants in vfp_exceptbits_from_host(),
rather than hardcoded magic numbers.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target/arm/vfp_helper.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/target/arm/vfp_helper.c b/target/arm/vfp_helper.c
index fc20a567530..fcc9e5d382e 100644
--- a/target/arm/vfp_helper.c
+++ b/target/arm/vfp_helper.c
@@ -39,22 +39,22 @@ static inline int vfp_exceptbits_from_host(int host_bits)
int target_bits = 0;
if (host_bits & float_flag_invalid) {
- target_bits |= 1;
+ target_bits |= FPSR_IOC;
}
if (host_bits & float_flag_divbyzero) {
- target_bits |= 2;
+ target_bits |= FPSR_DZC;
}
if (host_bits & float_flag_overflow) {
- target_bits |= 4;
+ target_bits |= FPSR_OFC;
}
if (host_bits & (float_flag_underflow | float_flag_output_denormal)) {
- target_bits |= 8;
+ target_bits |= FPSR_UFC;
}
if (host_bits & float_flag_inexact) {
- target_bits |= 0x10;
+ target_bits |= FPSR_IXC;
}
if (host_bits & float_flag_input_denormal) {
- target_bits |= 0x80;
+ target_bits |= FPSR_IDC;
}
return target_bits;
}
--
2.34.1
- [PATCH 00/76] target/arm: Implement FEAT_AFP and FEAT_RPRES, Peter Maydell, 2025/01/24
- [PATCH 04/76] target/arm: Use FPSR_ constants in vfp_exceptbits_from_host(),
Peter Maydell <=
- [PATCH 03/76] target/arm: arm_reset_sve_state() should set FPSR, not FPCR, Peter Maydell, 2025/01/24
- [PATCH 09/76] target/arm: Use fp_status_a32 in vfp_cmp helpers, Peter Maydell, 2025/01/24
- [PATCH 01/76] target/i386: Do not raise Invalid for 0 * Inf + QNaN, Peter Maydell, 2025/01/24
- [PATCH 05/76] target/arm: Use uint32_t in vfp_exceptbits_from_host(), Peter Maydell, 2025/01/24
- [PATCH 13/76] target/arm: Define new fp_status_f16_a32 and fp_status_f16_a64, Peter Maydell, 2025/01/24