On 6/17/20 12:09 AM, LIU Zhiwei wrote:
> If I want to test bfloat16 interfaces, could you give some advice? Should I
> need to modify berkeley-testfloat-3 to support the bfloat16 test.

I think we'll have to write some new code for this.

Easiest might be:
  (1) shift left to convert bfloat16 to float32,

  (2) if the current rounding mode is directed
      (float_round_{down,up,to_zero}), use that;
      otherwise use float_round_to_odd so that
      we can get the correct bfloat16 rounding later.

  (3) use the float32 arithmetic routine.

  (4) round to bfloat16 as per the current mode.

This should not require too much new code.


r~

Reply via email to