+CC Hao Chen Gui On 7/9/24 16:21, Jeff Law wrote: >>>> - Don't hardcode SI in patterns, try to keep X to avoid potential >>>> sign extension pitfalls. Implementation wise requires skipping >>>> :MODE specifier in match_operand which is flagged as missing mode >>>> warning. >>> I'm unsure about this. GCC Internal says: >>> >>> ‘isfinitem2’ >>> Return 1 if operand 1 is a finite floating point number and 0 otherwise. >>> m is a scalar floating point mode. Operand 0 has mode SImode, and >>> operand 1 has mode m. >>> >>> Likewise for isnormalm2. BTW isinfm2 is missing in the page. >>> >>> So per the doc SImode is required. At least the doc should be updated >>> to say "operand 0 has an integer mode" or something if doing so is >>> intentionally allowed. >> While the man page does say these return int, for which SI mode whould >> suffice, I feel that keeping it X is more flexible. >> >> So we should change the gcc documentation - so you want to send a patch ? > Oh, how weird that it explicitly wants SImode for operand[0]. Any > change you could review the discussion with Haochen from June to see if > it discusses the SImode requirement at all?
FWIW above comment and ask for patch was for Xi, not you :-) So it seems initial versions of the patch didn't specify anything about output mode. Richi asked for it in review and in v4 Hao added it. But I don't see anyone asking specifically for SImode. I guess that can be relaxed. Hao do you have any inputs here ? Thx, -Vineet [v3] https://gcc.gnu.org/pipermail/gcc-patches/2024-May/652813.html +@item @samp{isfinite@var{m}2} +Set operand 0 to nonzero if operand 1 is a finite @code{SFmode}, +@code{DFmode}, or @code{TFmode} floating point number and to 0 +otherwise. [v4] https://gcc.gnu.org/pipermail/gcc-patches/2024-May/652864.html +@item @samp{isfinite@var{m}2} +Set operand 0 to nonzero if operand 1 is a finite floating point +number and to 0 otherwise. Input mode should be a scalar floating +point mode and output mode should be @code{SImode}.