This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Support vector type strict_fmaxnum/fminnum.
Needs ReviewPublic

Authored by fakepaper56 on Apr 5 2023, 11:37 PM.

Details

Summary

The patch models D145900 for strict_fmaxnum/fminnum.

Diff Detail

Event Timeline

fakepaper56 created this revision.Apr 5 2023, 11:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2023, 11:37 PM
fakepaper56 requested review of this revision.Apr 5 2023, 11:37 PM

Rebase and ping.

I'm not sure if we can do this. LLVM's maxnum/minnum intrinsics follow the IEEE 754-2008 definition. According to the vector spec, RISC-V follows the IEEE 758-2019 definition

Note that in version 2.2 of the F extension, the FMIN.S and FMAX.S instructions were amended to implement the proposed IEEE 754-201x minimumNumber and maximumNumber operations, rather than the IEEE 754-2008 minNum and maxNum operations. These operations differ in their handling of signaling NaNs.

Without STRICT we can ignore signalling nans so we can directly lower maxnum/minnum to vfmax/vfmin. We aren't able to do that with STRICT. That's why scalar STRICT_FMAXNUM/FMINNUM isn't implemented for RISC-V.