From 8282310d8535cc2a8431c516e907da79f92df6eb Mon Sep 17 00:00:00 2001 From: LIU Zhiwei Date: Thu, 13 Aug 2020 15:14:19 +0800 Subject: softfloat: Define operations for bfloat16 This patch implements operations for bfloat16 except conversion and some misc operations. We also add FloatFmt and pack/unpack interfaces for bfloat16. As they are both static fields, we can't make a sperate patch for them. Signed-off-by: LIU Zhiwei Reviewed-by: Richard Henderson Message-Id: <20200813071421.2509-2-zhiwei_liu@c-sky.com> [rth: Use FloatRelation for comparison operations.] Signed-off-by: Richard Henderson --- include/fpu/softfloat-types.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/fpu/softfloat-types.h') diff --git a/include/fpu/softfloat-types.h b/include/fpu/softfloat-types.h index c7ddcab8ca..8a3f20fae9 100644 --- a/include/fpu/softfloat-types.h +++ b/include/fpu/softfloat-types.h @@ -112,6 +112,11 @@ typedef struct { #define make_float128(high_, low_) ((float128) { .high = high_, .low = low_ }) #define make_float128_init(high_, low_) { .high = high_, .low = low_ } +/* + * Software neural-network floating-point types. + */ +typedef uint16_t bfloat16; + /* * Software IEC/IEEE floating-point underflow tininess-detection mode. */ -- cgit v1.2.3-55-g7522