[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 03/24] softfloat: Add 16 bit integer to float con
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PATCH v2 03/24] softfloat: Add 16 bit integer to float conversions |
Date: |
Mon, 6 Jan 2014 13:11:00 +0000 |
Add the float to 16 bit integer conversion routines. These can be
trivially implemented in terms of the int32_to_float* routines, but
providing them makes our API more symmetrical and can simplify callers.
Signed-off-by: Peter Maydell <address@hidden>
---
include/fpu/softfloat.h | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
index a9b8cd9..926d849 100644
--- a/include/fpu/softfloat.h
+++ b/include/fpu/softfloat.h
@@ -239,6 +239,27 @@ floatx80 int64_to_floatx80( int64 STATUS_PARAM );
float128 int64_to_float128( int64 STATUS_PARAM );
float128 uint64_to_float128( uint64 STATUS_PARAM );
+/* We provide the int16 versions for symmetry of API with float-to-int */
+INLINE float32 int16_to_float32(int16_t v STATUS_PARAM)
+{
+ return int32_to_float32(v STATUS_VAR);
+}
+
+INLINE float32 uint16_to_float32(uint16_t v STATUS_PARAM)
+{
+ return uint32_to_float32(v STATUS_VAR);
+}
+
+INLINE float64 int16_to_float64(int16_t v STATUS_PARAM)
+{
+ return int32_to_float64(v STATUS_VAR);
+}
+
+INLINE float64 uint16_to_float64(uint16_t v STATUS_PARAM)
+{
+ return uint32_to_float64(v STATUS_VAR);
+}
+
/*----------------------------------------------------------------------------
| Software half-precision conversion routines.
*----------------------------------------------------------------------------*/
--
1.8.5
- [Qemu-devel] [PATCH v2 23/24] target-arm: A64: Add 1-source 32-to-32 and 64-to-64 FP instructions, (continued)
- [Qemu-devel] [PATCH v2 23/24] target-arm: A64: Add 1-source 32-to-32 and 64-to-64 FP instructions, Peter Maydell, 2014/01/06
- [Qemu-devel] [PATCH v2 17/24] target-arm: Prepare VFP_CONV_FIX helpers for A64 uses, Peter Maydell, 2014/01/06
- [Qemu-devel] [PATCH v2 07/24] softfloat: Fix factor 2 error for scalbn on denormal inputs, Peter Maydell, 2014/01/06
- [Qemu-devel] [PATCH v2 20/24] target-arm: A64: Add extra VFP fixed point conversion helpers, Peter Maydell, 2014/01/06
- [Qemu-devel] [PATCH v2 16/24] softfloat: Add support for ties-away rounding, Peter Maydell, 2014/01/06
- [Qemu-devel] [PATCH v2 10/24] softfloat: Fix float64_to_uint32, Peter Maydell, 2014/01/06
- [Qemu-devel] [PATCH v2 12/24] softfloat: Provide complete set of accessors for fp state, Peter Maydell, 2014/01/06
- [Qemu-devel] [PATCH v2 03/24] softfloat: Add 16 bit integer to float conversions,
Peter Maydell <=
- [Qemu-devel] [PATCH v2 09/24] softfloat: Fix float64_to_uint64_round_to_zero, Peter Maydell, 2014/01/06
- [Qemu-devel] [PATCH v2 11/24] softfloat: Fix float64_to_uint32_round_to_zero, Peter Maydell, 2014/01/06
- [Qemu-devel] [PATCH v2 18/24] target-arm: Rename A32 VFP conversion helpers, Peter Maydell, 2014/01/06
- [Qemu-devel] [PATCH v2 05/24] softfloat: Fix float64_to_uint64, Peter Maydell, 2014/01/06
- [Qemu-devel] [PATCH v2 08/24] softfloat: Add float32_to_uint64(), Peter Maydell, 2014/01/06
- [Qemu-devel] [PATCH v2 13/24] softfloat: Factor out RoundAndPackFloat16 and NormalizeFloat16Subnormal, Peter Maydell, 2014/01/06