1
From 312f36883900ec41d012dd75e24a6a693e8834aa Mon Sep 17 00:00:00 2001
2
From: Peter Maydell <peter.maydell@linaro.org>
3
Date: Tue, 7 Jan 2014 17:17:49 +0000
4
Subject: [PATCH 088/158] softfloat: Add 16 bit integer to float conversions
6
Add the float to 16 bit integer conversion routines. These can be
7
trivially implemented in terms of the int32_to_float* routines, but
8
providing them makes our API more symmetrical and can simplify callers.
10
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11
Reviewed-by: Richard Henderson <rth@twiddle.net>
13
include/fpu/softfloat.h | 21 +++++++++++++++++++++
14
1 file changed, 21 insertions(+)
16
diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
17
index a9b8cd9..926d849 100644
18
--- a/include/fpu/softfloat.h
19
+++ b/include/fpu/softfloat.h
20
@@ -239,6 +239,27 @@ floatx80 int64_to_floatx80( int64 STATUS_PARAM );
21
float128 int64_to_float128( int64 STATUS_PARAM );
22
float128 uint64_to_float128( uint64 STATUS_PARAM );
24
+/* We provide the int16 versions for symmetry of API with float-to-int */
25
+INLINE float32 int16_to_float32(int16_t v STATUS_PARAM)
27
+ return int32_to_float32(v STATUS_VAR);
30
+INLINE float32 uint16_to_float32(uint16_t v STATUS_PARAM)
32
+ return uint32_to_float32(v STATUS_VAR);
35
+INLINE float64 int16_to_float64(int16_t v STATUS_PARAM)
37
+ return int32_to_float64(v STATUS_VAR);
40
+INLINE float64 uint16_to_float64(uint16_t v STATUS_PARAM)
42
+ return uint32_to_float64(v STATUS_VAR);
45
/*----------------------------------------------------------------------------
46
| Software half-precision conversion routines.
47
*----------------------------------------------------------------------------*/