1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00
llvm-mirror/lib/Target/ARC
Fangrui Song 7f7bfe12ea [MCInstPrinter] Pass Address parameter to MCOI::OPERAND_PCREL typed operands. NFC
Follow-up of D72172 and D72180

This patch passes `uint64_t Address` to print methods of PC-relative
operands so that subsequent target specific patches can change
`*InstPrinter::print{Operand,PCRelImm,...}` to customize the output.

Add MCInstPrinter::PrintBranchImmAsAddress which is set to true by
llvm-objdump.

```
// Current llvm-objdump -d output
aarch64: 20000: bl #0
ppc:     20000: bl .+4
x86:     20000: callq 0

// Ideal output
aarch64: 20000: bl 0x20000
ppc:     20000: bl 0x20004
x86:     20000: callq 0x20005

// GNU objdump -d. The lack of 0x is not ideal because the result cannot be re-assembled
aarch64: 20000: bl 20000
ppc:     20000: bl 0x20004
x86:     20000: callq 20005
```

In `lib/Target/X86/X86GenAsmWriter1.inc` (generated by `llvm-tblgen -gen-asm-writer`):

```
   case 12:
     // CALL64pcrel32, CALLpcrel16, CALLpcrel32, EH_SjLj_Setup, JCXZ, JECXZ, J...
-    printPCRelImm(MI, 0, O);
+    printPCRelImm(MI, Address, 0, O);
     return;
```

Some targets have 2 `printOperand` overloads, one without `Address` and
one with `Address`. They should annotate derived `Operand` properly with
`let OperandType = "OPERAND_PCREL"`.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D76574
2020-03-26 08:21:15 -07:00
..
Disassembler CMake: Make most target symbols hidden by default 2020-01-14 19:46:52 -08:00
MCTargetDesc [MCInstPrinter] Pass Address parameter to MCOI::OPERAND_PCREL typed operands. NFC 2020-03-26 08:21:15 -07:00
TargetInfo CMake: Make most target symbols hidden by default 2020-01-14 19:46:52 -08:00
ARC.h
ARC.td
ARCAsmPrinter.cpp [AsmPrinter][MCStreamer] De-capitalize EmitInstruction and EmitCFI* 2020-02-13 22:08:55 -08:00
ARCBranchFinalize.cpp
ARCCallingConv.td
ARCExpandPseudos.cpp
ARCFrameLowering.cpp ArrayRef'ize restoreCalleeSavedRegisters. NFCI. 2020-02-29 09:50:23 +01:00
ARCFrameLowering.h ArrayRef'ize restoreCalleeSavedRegisters. NFCI. 2020-02-29 09:50:23 +01:00
ARCInstrFormats.td [ARC][NFC] Remove trailing space 2020-02-26 13:38:51 +08:00
ARCInstrInfo.cpp [NFC] unsigned->Register in storeRegTo/loadRegFromStack 2020-02-03 14:22:16 +01:00
ARCInstrInfo.h [NFC] unsigned->Register in storeRegTo/loadRegFromStack 2020-02-03 14:22:16 +01:00
ARCInstrInfo.td [ARC][NFC] Remove trailing space 2020-02-26 13:38:51 +08:00
ARCISelDAGToDAG.cpp
ARCISelLowering.cpp [Alignment][NFC] Use Align for getMemcpy/Memmove/Memset 2020-02-03 17:13:19 +01:00
ARCISelLowering.h
ARCMachineFunctionInfo.cpp
ARCMachineFunctionInfo.h
ARCMCInstLower.cpp
ARCMCInstLower.h
ARCOptAddrMode.cpp
ARCRegisterInfo.cpp [TargetRegisterInfo] Default trackLivenessAfterRegAlloc() to true 2020-01-19 14:20:37 -08:00
ARCRegisterInfo.h [TargetRegisterInfo] Default trackLivenessAfterRegAlloc() to true 2020-01-19 14:20:37 -08:00
ARCRegisterInfo.td [ARC][NFC] Remove trailing space 2020-02-26 13:38:51 +08:00
ARCSubtarget.cpp
ARCSubtarget.h
ARCTargetMachine.cpp [ARC] Fix ARCTargetMachine after 777180a32b6107 2020-01-29 00:59:16 -08:00
ARCTargetMachine.h
ARCTargetStreamer.h
ARCTargetTransformInfo.h
CMakeLists.txt
LLVMBuild.txt