aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2025-01-24 16:27:24 +0000
committerPeter Maydell <peter.maydell@linaro.org>2025-01-28 18:40:19 +0000
commitf10dee833f5b810d7c5ac036e3b5937d388f7b3b (patch)
tree1199ac8f1bf54198a63747c4316c1fc33f263400
parent1edc3d43f20df0d04f8d00b906ba19fed37512a5 (diff)
downloadqemu-f10dee833f5b810d7c5ac036e3b5937d388f7b3b.zip
qemu-f10dee833f5b810d7c5ac036e3b5937d388f7b3b.tar.gz
qemu-f10dee833f5b810d7c5ac036e3b5937d388f7b3b.tar.bz2
target/arm: Use FPSR_ constants in vfp_exceptbits_from_host()
Use the FPSR_ named constants in vfp_exceptbits_from_host(), rather than hardcoded magic numbers. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20250124162836.2332150-5-peter.maydell@linaro.org
-rw-r--r--target/arm/vfp_helper.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/target/arm/vfp_helper.c b/target/arm/vfp_helper.c
index fc20a56..fcc9e5d 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;
}