On Mon, Sep 12, 2022 at 10:52:35PM +0200, Jakub Jelinek via Gcc-patches wrote:
> Can't that be implemented as 2 conversions, convert BFmode to SFmode and
> then back to HFmode (or the other way around)?
> SFmode is a superset of both formats, so except for the raise exception on
> SNaN and conversion to QNaN extension to SFmode from both formats should be
> lossless?
> 
> In any case, the bfloat16 support is intended maybe for follow-up patches,
> not in this patch.

Well, the BF -> HF conversion could be done just by << 16 + SF -> HF
conversion too.
But for BF -> HF and HF -> BF conversions (C++ allows them only
for explicit casts, not implicit), the question is what library routine
name to use, because it is neither pure extension nor pure truncation.
But guess that is the case for PowerPC IFmode vs. KFmode.  And the backend
has both truncifkf2 and extendifkf2 named patterns which presumably do the
same thing.

        Jakub

Reply via email to