[all-commits] [llvm/llvm-project] 2ae76d: [AMDGPU] Use different values for SISrcMods::NEG a...

Frederik Harwath via All-commits all-commits at lists.llvm.org
Thu Jul 10 23:35:40 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2ae76d55550781326f3d1b2996143d880304353c
      https://github.com/llvm/llvm-project/commit/2ae76d55550781326f3d1b2996143d880304353c
  Author: Frederik Harwath <frederik.harwath at amd.com>
  Date:   2025-07-11 (Fri, 11 Jul 2025)

  Changed paths:
    M llvm/lib/Target/AMDGPU/SIDefines.h
    M llvm/lib/Target/AMDGPU/VOPInstructions.td
    M llvm/test/CodeGen/AMDGPU/sdwa-peephole-instr-combine-sel-src.mir
    M llvm/test/MC/AMDGPU/gfx9_asm_vop2_features.s
    M llvm/test/MC/Disassembler/AMDGPU/gfx9_vop2_features.txt

  Log Message:
  -----------
  [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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list