qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fpu/softfloat: a question on BFloat 16 support on QEMU


From: Richard Henderson
Subject: Re: fpu/softfloat: a question on BFloat 16 support on QEMU
Date: Fri, 26 Jun 2020 08:58:17 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

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

[Prev in Thread] Current Thread [Next in Thread]