On 12/29/2025 8:19 AM, Tamar Christina wrote:
For a few math IFNs we never declared the conditional variants. This is needed
to handle trapping math correctly. SVE already implements all of these using
the expected optabs.
This just adds the COND and COND_LEN optabs for SQRT, CEIL, FLOOR, ROUND and
RINT.
Note that we don't seem to have any documentation for the math IFNs as they look
like they're all on the optabs/original builtins. As such I only documented the
optabs as that's consistent.
Bootstrapped Regtested on aarch64-none-linux-gnu,
arm-none-linux-gnueabihf, x86_64-pc-linux-gnu
-m32, -m64 and no issues.
Ok for master?
Thanks,
Tamar
gcc/ChangeLog:
PR tree-optimization/122103
* doc/md.texi: Document them
* internal-fn.cc (FOR_EACH_COND_FN_PAIR, internal_fn_else_index): Add
SQRT, CEIL, FLOOR, ROUND and RINT.
* internal-fn.def (IFN_COND_SQRT, IFN_COND_CEIL, IFN_COND_FLOOR,
IFN_COND_ROUND, IFN_COND_RINT, IFN_COND_LEN_SQRT, IFN_COND_LEN_CEIL,
IFN_COND_LEN_FLOOR, IFN_COND_LEN_ROUND, IFN_COND_LEN_RINT): New.
* optabs.def (cond_rint_optab, cond_sqrt_optab, cond_round_optab,
cond_ceil_optab, cond_floor_optab, cond_len_rint_optab,
cond_len_sqrt_optab, cond_len_round_optab, cond_len_ceil_optab,
cond_len_floor_optab): New.
OK
jeff