llvm-project
2ae76d55 - [AMDGPU] Use different values for SISrcMods::NEG and SISrcMods::SEXT (#147964)

Commit
71 days ago
[AMDGPU] Use different values for SISrcMods::NEG and SISrcMods::SEXT (#147964) The SISrcMods::NEG and SISrcMods::SEXT enumerators share the same enum value. At the time when they were introduced, it was assumed that the "floating point" "neg"/"abs" and the "integer" "sext" source modifiers are mutually exclusive. This can lead to miscompilation as a "sext" modifier may right now be accepted erroneously on some instructions which are encoded as floating point instructions (see the test case modified by this PR). The encoding will then use the "neg" modifier. Furthermore, the "neg"/"abs" and the "sext" modifiers are not necessarily mutually exclusive, i.e. the hardware may support both. This cannot be handled correctly with the current representation. This patch changes the SISrcMods enum to use different values for NEG and SEXT. This is meant as a first step to allow their coexistence on the same instruction.
Author
Parents
Loading