diff mbox series

[RFC,08/30] softfloat: add half-precision expansions for MINMAX fns

Message ID 20171013162438.32458-9-alex.bennee@linaro.org
State New
Headers show
Series v8.2 half-precision support (work-in-progress) | expand

Commit Message

Alex Bennée Oct. 13, 2017, 4:24 p.m. UTC
Expand the current helpers to include half-precision functions. The
includes having f16 version of the compare functions.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

---
 fpu/softfloat.c         |  2 ++
 include/fpu/softfloat.h | 11 +++++++++++
 2 files changed, 13 insertions(+)

-- 
2.14.1

Comments

Richard Henderson Oct. 13, 2017, 8:52 p.m. UTC | #1
On 10/13/2017 09:24 AM, Alex Bennée wrote:
> Expand the current helpers to include half-precision functions. The

> includes having f16 version of the compare functions.

> 

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

> ---

>  fpu/softfloat.c         |  2 ++

>  include/fpu/softfloat.h | 11 +++++++++++

>  2 files changed, 13 insertions(+)


"This includes..."

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>



r~
diff mbox series

Patch

diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index 3a4ab1355f..013b223947 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -7579,6 +7579,7 @@  int float ## s ## _compare_quiet(float ## s a, float ## s b,                 \
     return float ## s ## _compare_internal(a, b, 1, status);                 \
 }
 
+COMPARE(16, 0x1f)
 COMPARE(32, 0xff)
 COMPARE(64, 0x7ff)
 
@@ -7779,6 +7780,7 @@  float ## s float ## s ## _maxnummag(float ## s a, float ## s b,         \
     return float ## s ## _minmax(a, b, 0, 1, 1, status);                \
 }
 
+MINMAX(16)
 MINMAX(32)
 MINMAX(64)
 
diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
index edf402d422..d89fdf7675 100644
--- a/include/fpu/softfloat.h
+++ b/include/fpu/softfloat.h
@@ -381,6 +381,17 @@  static inline float16 float16_abs(float16 a)
      */
     return make_float16(float16_val(a) & 0x7fff);
 }
+
+/* Expanded by the MINMAX macro in softfloat.c */
+int float16_compare(float16, float16, float_status *status);
+int float16_compare_quiet(float16, float16, float_status *status);
+float16 float16_min(float16, float16, float_status *status);
+float16 float16_max(float16, float16, float_status *status);
+float16 float16_minnum(float16, float16, float_status *status);
+float16 float16_maxnum(float16, float16, float_status *status);
+float16 float16_minnummag(float16, float16, float_status *status);
+float16 float16_maxnummag(float16, float16, float_status *status);
+
 /*----------------------------------------------------------------------------
 | The pattern for a default generated half-precision NaN.
 *----------------------------------------------------------------------------*/