[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 14/17] target/hexagon: Remove Float
From: |
Richard Henderson |
Subject: |
[PATCH 14/17] target/hexagon: Remove Float |
Date: |
Sun, 8 Dec 2024 16:48:41 -0600 |
This structure, with bitfields, is incorrect for big-endian.
Use the existing float32_getexp_raw which uses extract32.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/hexagon/fma_emu.c | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/target/hexagon/fma_emu.c b/target/hexagon/fma_emu.c
index bce3bd4dfb..c359eecffd 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;
}
--
2.43.0
- [PATCH 09/17] target/hexagon: Use float32_muladd for helper_sffms, (continued)
- [PATCH 09/17] target/hexagon: Use float32_muladd for helper_sffms, Richard Henderson, 2024/12/08
- [PATCH 10/17] target/hexagon: Use float32_muladd_scalbn for helper_sffma_sc, Richard Henderson, 2024/12/08
- [PATCH 11/17] target/hexagon: Use float32_muladd for helper_sffm[as]_lib, Richard Henderson, 2024/12/08
- [PATCH 12/17] target/hexagon: Remove internal_fmafx, Richard Henderson, 2024/12/08
- [PATCH 13/17] target/hexagon: Expand GEN_XF_ROUND, Richard Henderson, 2024/12/08
- [PATCH 14/17] target/hexagon: Remove Float,
Richard Henderson <=
- [PATCH 15/17] target/hexagon: Remove Double, Richard Henderson, 2024/12/08
- [PATCH 16/17] target/hexagon: Use mulu64 for int128_mul_6464, Richard Henderson, 2024/12/08
- [PATCH 17/17] target/hexagon: Simplify internal_mpyhh setup, Richard Henderson, 2024/12/08