[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v1 03/19] include/fpu/softfloat: implement float16_c
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PATCH v1 03/19] include/fpu/softfloat: implement float16_chs helper |
Date: |
Mon, 11 Dec 2017 12:56:49 +0000 |
Signed-off-by: Alex Bennée <address@hidden>
---
include/fpu/softfloat.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
index edf402d422..32036382c6 100644
--- a/include/fpu/softfloat.h
+++ b/include/fpu/softfloat.h
@@ -381,6 +381,15 @@ static inline float16 float16_abs(float16 a)
*/
return make_float16(float16_val(a) & 0x7fff);
}
+
+static inline float16 float16_chs(float16 a)
+{
+ /* Note that chs does *not* handle NaN specially, nor does
+ * it flush denormal inputs to zero.
+ */
+ return make_float16(float16_val(a) ^ 0x8000);
+}
+
/*----------------------------------------------------------------------------
| The pattern for a default generated half-precision NaN.
*----------------------------------------------------------------------------*/
--
2.15.1
- [Qemu-devel] [PATCH v1 00/19] re-factor softfloat and add fp16 functions, Alex Bennée, 2017/12/11
- [Qemu-devel] [PATCH v1 02/19] include/fpu/softfloat: implement float16_abs helper, Alex Bennée, 2017/12/11
- [Qemu-devel] [PATCH v1 03/19] include/fpu/softfloat: implement float16_chs helper,
Alex Bennée <=
- [Qemu-devel] [PATCH v1 01/19] fpu/softfloat: implement float16_squash_input_denormal, Alex Bennée, 2017/12/11
- [Qemu-devel] [PATCH v1 05/19] include/fpu/softfloat: add some float16 contants, Alex Bennée, 2017/12/11
- [Qemu-devel] [PATCH v1 06/19] fpu/softfloat: propagate signalling NaNs in MINMAX, Alex Bennée, 2017/12/11
- [Qemu-devel] [PATCH v1 04/19] include/fpu/softfloat: implement float16_set_sign helper, Alex Bennée, 2017/12/11