[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [RFC PATCH for 2.11 19/23] fpu/softfloat2a: implement float16
From: |
Alex Bennée |
Subject: |
[Qemu-arm] [RFC PATCH for 2.11 19/23] fpu/softfloat2a: implement float16_abs helper |
Date: |
Thu, 20 Jul 2017 16:04:22 +0100 |
This will be required when expanding the MINMAX() macro for 16
bit/half-precision operations.
Signed-off-by: Alex Bennée <address@hidden>
---
include/fpu/softfloat2a/softfloat.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/include/fpu/softfloat2a/softfloat.h
b/include/fpu/softfloat2a/softfloat.h
index a274dc7419..3cb41977d8 100644
--- a/include/fpu/softfloat2a/softfloat.h
+++ b/include/fpu/softfloat2a/softfloat.h
@@ -379,6 +379,13 @@ static inline int float16_is_zero_or_denormal(float16 a)
return (float16_val(a) & 0x7c00) == 0;
}
+static inline float16 float16_abs(float16 a)
+{
+ /* Note that abs does *not* handle NaN specially, nor does
+ * it flush denormal inputs to zero.
+ */
+ return make_float16(float16_val(a) & 0x7fff);
+}
/*----------------------------------------------------------------------------
| The pattern for a default generated half-precision NaN.
*----------------------------------------------------------------------------*/
--
2.13.0
- [Qemu-arm] [RFC PATCH for 2.11 15/23] target/arm/translate-a64.c: AdvSIMD scalar 2 register misc decode, (continued)
- [Qemu-arm] [RFC PATCH for 2.11 15/23] target/arm/translate-a64.c: AdvSIMD scalar 2 register misc decode, Alex Bennée, 2017/07/20
- [Qemu-arm] [RFC PATCH for 2.11 22/23] fpu/softfloat2a: improve comments on ARM NaN propagation, Alex Bennée, 2017/07/20
- [Qemu-arm] [RFC PATCH for 2.11 23/23] target/arm: implement half-precision F(MIN|MAX)(V|NMV), Alex Bennée, 2017/07/20
- [Qemu-arm] [RFC PATCH for 2.11 18/23] fpu/softfloat2a: implement float16_squash_input_denormal, Alex Bennée, 2017/07/20
- [Qemu-arm] [RFC PATCH for 2.11 16/23] include/exec/helper-head.h: support f16 in helper calls, Alex Bennée, 2017/07/20
- [Qemu-arm] [RFC PATCH for 2.11 14/23] target/arm/translate-a64.c: add ARMv8.2 fadd scalar half-precision, Alex Bennée, 2017/07/20
- [Qemu-arm] [RFC PATCH for 2.11 19/23] fpu/softfloat2a: implement float16_abs helper,
Alex Bennée <=
- [Qemu-arm] [RFC PATCH for 2.11 21/23] fpu/softfloat2a: propagate signalling NaNs in MINMAX, Alex Bennée, 2017/07/20
- [Qemu-arm] [RFC PATCH for 2.11 20/23] fpu/softfloat2a: add half-precision expansions for MINMAX fns, Alex Bennée, 2017/07/20
- Re: [Qemu-arm] [RFC PATCH for 2.11 00/23] Implementing FP16 for ARMv8.2 using SoftFloat2a and 3c, Peter Maydell, 2017/07/20
- [Qemu-arm] [RFC PATCH for 2.11 03/23] softfloat3c: dos2unix all files, Alex Bennée, 2017/07/20