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 <zhiwei_liu@c-sky.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200813071421.2509-2-zhiwei_liu@c-sky.com>
[rth: Use FloatRelation for comparison operations.]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
LIU Zhiwei
2020-08-13 15:14:19 +08:00
committed by Richard Henderson
parent a03e924cf8
commit 8282310d85
3 changed files with 211 additions and 0 deletions

View File

@@ -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.
*/