On Mar 4, 2026, Oleg Endo <[email protected]> wrote: > No, there is no explicit state kept outside the insns. > And there is also nothing explicit that would determine validity.
For SH, one thing we could conceivably do is to check that the relevant attributes (fp_mode and fp_set) is the same before and after the substitution. We don't need global state for that. If it's unchanged, the transformation is definitely good; if they differ then we'd need global state to tell, so it would be reasonable to punt at this point. Unfortunately, the mode switching APIs take a HARD_REG_SET (that SH ignores; AFAICT only aarch64 uses it), so it would be tricky to check this with existing generic mode switching APIs. We'd need some means to compute all the modes before the transformation, make the transformation tentatively, recompute all the modes with the new alternative, and if they changed, revert the change. -- Alexandre Oliva, happy hacker https://blog.lx.oliva.nom.br/ Free Software Activist FSFLA co-founder GNU Toolchain Engineer More tolerance and less prejudice are key for inclusion and diversity. Excluding neuro-others for not behaving ""normal"" is *not* inclusive!
