https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121343

            Bug ID: 121343
           Summary: [avr] Use hard-register constraints instead of
                    explicit hard-regs in avr.md
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gjl at gcc dot gnu.org
  Target Milestone: ---

Many insns in avr.md can be simplified and be made more robust by using
hard-register constraints, like

;; Swap Bytes (change byte-endianness)

(define_insn_and_split "bswapsi2"
  [(set (match_operand:SI 0 "register_operand"          "={r22}")
        (bswap:SI (match_operand:SI 1 "register_operand" "{r22}")))]
  ""
  "#"
  "&& reload_completed"
  [(parallel [(set (reg:SI 22)
                   (bswap:SI (reg:SI 22)))
              (clobber (reg:CC REG_CC))])])


instead of:

;; Swap Bytes (change byte-endianness)

(define_expand "bswapsi2"
  [(set (reg:SI 22)
        (match_operand:SI 1 "register_operand" ""))
   (set (reg:SI 22)
        (bswap:SI (reg:SI 22)))
   (set (match_operand:SI 0 "register_operand" "")
        (reg:SI 22))])

(define_insn_and_split "*bswapsi2.libgcc_split"
  [(set (reg:SI 22)
        (bswap:SI (reg:SI 22)))]
  ""
  "#"
  "&& reload_completed"
  [(parallel [(set (reg:SI 22)
                   (bswap:SI (reg:SI 22)))
              (clobber (reg:CC REG_CC))])])

Reply via email to