[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 06/22] include/fpu/softfloat: implement float16_chs h
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PULL 06/22] include/fpu/softfloat: implement float16_chs helper |
Date: |
Wed, 21 Feb 2018 11:05:06 +0000 |
Signed-off-by: Alex Bennée <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
index 1d34f2c3eb..f75aa59100 100644
--- a/include/fpu/softfloat.h
+++ b/include/fpu/softfloat.h
@@ -272,6 +272,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] [PULL 00/22] re-factor softfloat and add fp16 functions, Alex Bennée, 2018/02/21
- [Qemu-devel] [PULL 01/22] fpu/softfloat: implement float16_squash_input_denormal, Alex Bennée, 2018/02/21
- [Qemu-devel] [PULL 03/22] fpu/softfloat-types: new header to prevent excessive re-builds, Alex Bennée, 2018/02/21
- [Qemu-devel] [PULL 02/22] include/fpu/softfloat: remove USE_SOFTFLOAT_STRUCT_TYPES, Alex Bennée, 2018/02/21
- [Qemu-devel] [PULL 06/22] include/fpu/softfloat: implement float16_chs helper,
Alex Bennée <=
- [Qemu-devel] [PULL 05/22] include/fpu/softfloat: implement float16_abs helper, Alex Bennée, 2018/02/21
- [Qemu-devel] [PULL 07/22] include/fpu/softfloat: implement float16_set_sign helper, Alex Bennée, 2018/02/21
- [Qemu-devel] [PULL 10/22] fpu/softfloat: move the extract functions to the top of the file, Alex Bennée, 2018/02/21
- [Qemu-devel] [PULL 04/22] target/*/cpu.h: remove softfloat.h, Alex Bennée, 2018/02/21
- [Qemu-devel] [PULL 19/22] fpu/softfloat: re-factor scalbn, Alex Bennée, 2018/02/21
- [Qemu-devel] [PULL 08/22] include/fpu/softfloat: add some float16 constants, Alex Bennée, 2018/02/21
- [Qemu-devel] [PULL 09/22] fpu/softfloat: improve comments on ARM NaN propagation, Alex Bennée, 2018/02/21
- [Qemu-devel] [PULL 12/22] fpu/softfloat: re-factor add/sub, Alex Bennée, 2018/02/21
- [Qemu-devel] [PULL 16/22] fpu/softfloat: re-factor round_to_int, Alex Bennée, 2018/02/21
- [Qemu-devel] [PULL 21/22] fpu/softfloat: re-factor compare, Alex Bennée, 2018/02/21