open-catalog icon indicating copy to clipboard operation
open-catalog copied to clipboard

[Fortran] `ieee_fma` (related to PWR048) is available since Fortran 2018

Open foxtran opened this issue 6 months ago • 3 comments

In Fortran, Fused multiply-add was imtroduced as IEEE_FMA in Fortran 2018 standard, so modern codebases may use it.

In Fortran 2023 draft, it is located at 17.11.4.

foxtran avatar Jul 31 '25 11:07 foxtran

Hi @foxtran,

Thanks for the notice! The PWR048 entry should indeed be updated to reflect this.

I'll leave this issue open so we don't lose sight of it. Naturally, feel free to submit a PR if you'd like to make a proposal!

Thank you again for your contribution :)

alvrogd avatar Jul 31 '25 11:07 alvrogd

gfortran sucks if ieee_fma is used:

https://godbolt.org/z/zds1oW454

And assembler is OK for code which does not use FMA.

For Intel compiler, it depends on runtime library:

https://godbolt.org/z/TocYxerbo

So, the speed of IEEE_FMA will depend on internal implementation.

Probably, for current moment, it would be better to suggest avoiding of IEEE_FMA usage 😄

foxtran avatar Aug 12 '25 08:08 foxtran

Thanks for the update!

Probably, for current moment, it would be better to suggest avoiding of IEEE_FMA usage 😄

Given these examples, it could be reasonable 😅

A more thorough evaluation across various compilers, versions, target architectures, and code patterns would help determine if this can be offered as general guidance with enough confidence. I'll rename the issue to reflect this, and keep it open so we don't lose track.

alvrogd avatar Aug 20 '25 10:08 alvrogd