aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2024-12-08 15:23:36 -0600
committerRichard Henderson <richard.henderson@linaro.org>2024-12-24 08:32:15 -0800
commitfefc9702e618cef00d199e6ddd43f4b2d4c2fad6 (patch)
tree631b47462b62a5a62790a0da2c63f44088afa9f7
parent795d6a2c4960325c514323147e13a22d5fe21ddf (diff)
downloadqemu-fefc9702e618cef00d199e6ddd43f4b2d4c2fad6.zip
qemu-fefc9702e618cef00d199e6ddd43f4b2d4c2fad6.tar.gz
qemu-fefc9702e618cef00d199e6ddd43f4b2d4c2fad6.tar.bz2
target/hexagon: Remove Float
This structure, with bitfields, is incorrect for big-endian. Use the existing float32_getexp_raw which uses extract32. Reviewed-by: Brian Cain <brian.cain@oss.qualcomm.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r--target/hexagon/fma_emu.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/target/hexagon/fma_emu.c b/target/hexagon/fma_emu.c
index 0769de4..2a8f72f 100644
--- a/target/hexagon/fma_emu.c
+++ b/target/hexagon/fma_emu.c
@@ -53,16 +53,6 @@ typedef union {
};
} Double;
-typedef union {
- float f;
- uint32_t i;
- struct {
- uint32_t mant:23;
- uint32_t exp:8;
- uint32_t sign:1;
- };
-} Float;
-
static uint64_t float64_getmant(float64 f64)
{
Double a = { .i = f64 };
@@ -92,12 +82,12 @@ int32_t float64_getexp(float64 f64)
int32_t float32_getexp(float32 f32)
{
- Float a = { .i = f32 };
+ int exp = float32_getexp_raw(f32);
if (float32_is_normal(f32)) {
- return a.exp;
+ return exp;
}
if (float32_is_denormal(f32)) {
- return a.exp + 1;
+ return exp + 1;
}
return -1;
}