[llvm] [X86] Respect denormal mode in f32-to-bf16 conversions (PR #221052)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 4 00:52:45 PDT 2026


phoebewang wrote:

I'm not expert in the FP standard, but I think we should view it with a forward-looking perspective. There's no double IEEE types follow IEEE denormal mode definitions, but BF16 is not one of IEEE types. And with AI prosperity, variants new types are supported or going to be suppoerted by more and more HWs. Given the fewer bits they can use, more and more "standard" FP characters abandoned. There's not one rule fit for all.

Standard and toolchains work for users, not the opposite. Back to the BF16 case, it has 8 exponent bits. So, unlike the same size FP16, which has only 5 exponent bits, the denormal value is not important. That's why most HWs chose the FTZ/DAZ design by default. Most users would care more about the performance rather than denormal result.

> I think should add an option similar to -mno-gather to allow opt-out native bf16 in frontend (for Julia?)

+1

> Would it be reasonable to change the fallback to the integer round-to-nearest-even sequence instead?

I think it's good as an improvement, but not good enough to change the default behavior.

https://github.com/llvm/llvm-project/pull/221052


More information about the llvm-commits mailing list