On 6/30/24 6:46 PM, Vineet Gupta wrote:


On 6/30/24 06:59, Jeff Law wrote:
Any ideas on how I can keep this and then adjust rest of patterns.
Yea.  Drop the "SImode" references from the RTL template of the
expander.   Then you'll need to verify the modes in the C fragment that
generates code.  You'd want to test the mode of operand0 and the mode of
the UNSPEC.  If they aren't word_mode, then FAIL.

Testing specifically for word_mode doesn't work for int operand.
Oh, yea.  If it's always a CONST_INT, then it'll always be VOIDmode.



This works because those expanders are allowed to use FAIL.  Some
expanders aren't allowed to do that (they're supposed to be documented
appropriately in the internals manual).

In the matching define_insns, you can use X and adjust their names.

Sorry I'm still not sure how to use X in the define insn. It seems we
have to skip mode in match_operand specification there as well.
I'll post v2 and take it from there.
It's the expander I was most focused on. For the fclass case I'd indirect through an expander. ie, have an expander without a model ike I've suggested for isfinite/isnormal, then match it with a define_insn that accepts X.

The define_insn's name can have an additional <X:mode> suffix in that case to distinguish between the SI and DI variants.

jeff

Reply via email to