[all-commits] [llvm/llvm-project] fb21ef: [SystemZ] Support PrintBranchImmAsAddress in disas...

Ulrich Weigand via All-commits all-commits at lists.llvm.org
Thu May 22 07:59:30 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fb21efa258d84a159a5951c3cc8184edfe5ba796
      https://github.com/llvm/llvm-project/commit/fb21efa258d84a159a5951c3cc8184edfe5ba796
  Author: Ulrich Weigand <ulrich.weigand at de.ibm.com>
  Date:   2025-05-22 (Thu, 22 May 2025)

  Changed paths:
    M llvm/lib/Target/SystemZ/Disassembler/SystemZDisassembler.cpp
    M llvm/lib/Target/SystemZ/MCTargetDesc/SystemZInstPrinterCommon.cpp
    M llvm/lib/Target/SystemZ/MCTargetDesc/SystemZInstPrinterCommon.h
    R llvm/test/MC/Disassembler/SystemZ/insns-pcrel.txt
    M llvm/test/MC/Disassembler/SystemZ/insns-z13-bad.txt
    M llvm/test/MC/Disassembler/SystemZ/insns-z13.txt
    M llvm/test/MC/Disassembler/SystemZ/insns-z14.txt
    M llvm/test/MC/Disassembler/SystemZ/insns-z15.txt
    M llvm/test/MC/Disassembler/SystemZ/insns-z16.txt
    M llvm/test/MC/Disassembler/SystemZ/insns-z17.txt
    M llvm/test/MC/Disassembler/SystemZ/insns.txt
    M llvm/test/MC/Disassembler/SystemZ/marked-up.txt

  Log Message:
  -----------
  [SystemZ] Support PrintBranchImmAsAddress in disassembler (#141064)

As noticed in https://github.com/llvm/llvm-project/pull/140471, the
SystemZ target currently implements disassembly of PC-relative target
addresses differently from other back-ends. This patch brings SystemZ in
line with other targets.

Specifically, this patch changes the relevant MCInst instructions to
carry a PC-relative displacement instead of an absolute target address
in their immediate fields. When printing the instruction, this
displacement will either be shown as is (e.g. for llvm-mc), or else
translated into an absolute address at print time (e.g. for
llvm-objdump).

The existing llvm-mc based tests using PC-relative operands no longer
work and have to be rewritten, but printing displacements makes those
tests easier to maintain anyway.



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