llvm-project/llvm/test/MC
Shiva Chen 98f9389f65 [RISCV] Support "call" pseudoinstruction in the MC layer
To do this:
1. Add PseudoCALLIndirct to match indirect function call.

2. Add PseudoCALL to support parsing and print pseudo `call` in assembly

3. Expand PseudoCALL to the following form with R_RISCV_CALL relocation type
   while encoding:
        auipc ra, func
        jalr ra, ra, 0

If we expand PseudoCALL before emitting assembly, we will see auipc and jalr
pair when compile with -S. It's hard for assembly parser to parsing this
pair and identify it's semantic is function call and then insert R_RISCV_CALL
relocation type. Although we could insert R_RISCV_PCREL_HI20 and
R_RISCV_PCREL_LO12_I relocation types instead of R_RISCV_CALL.
Due to RISCV relocation design, auipc and jalr pair only can relax to jal with
R_RISCV_CALL + R_RISCV_RELAX relocation types.

We expand PseudoCALL as late as encoding(RISCVMCCodeEmitter) instead of before
emitting assembly(RISCVAsmPrinter) because we want to preserve call
pseudoinstruction in assembly code. It's more readable and assembly parser
could identify call assembly and insert R_RISCV_CALL relocation type.

Differential Revision: https://reviews.llvm.org/D45859

llvm-svn: 330826
2018-04-25 14:18:55 +00:00
..
AArch64 [AArch64][SVE] Asm: Support for contiguous, first-faulting LDFF1 (scalar+scalar) load instructions. 2018-04-24 08:59:08 +00:00
AMDGPU [AMDGPU][MC][VI][GFX9] Added support of SDWA/DPP for v_cndmask_b32 2018-04-16 12:41:38 +00:00
ARM [ARM] Do not convert some vmov instructions 2018-04-04 08:54:19 +00:00
AVR [AVR] Implement some missing code paths 2017-12-11 11:01:27 +00:00
AsmParser [llvm-mc] Make error handling more consistent. 2018-04-22 08:01:35 +00:00
BPF bpf: New disassembler testcases for 32-bit subregister support 2018-02-23 23:49:35 +00:00
COFF [IR] Avoid the need to prefix MS C++ symbols with '\01' 2018-03-16 20:13:32 +00:00
Disassembler [mips] Fix the definition of sync, synci 2018-04-25 10:19:22 +00:00
ELF [test] Fix MC/ELF/nocompression.s 2018-04-22 08:46:27 +00:00
Hexagon [Hexagon] Recognize and handle :endloop01 2018-03-30 15:29:47 +00:00
Lanai
MachO MachO: trap unreachable instructions 2018-04-13 22:25:20 +00:00
Mips [mips] Fix the definition of sync, synci 2018-04-25 10:19:22 +00:00
PowerPC [PowerPC] Code cleanup. Remove instructions that were withdrawn from Power 9. 2018-02-23 15:55:16 +00:00
RISCV [RISCV] Support "call" pseudoinstruction in the MC layer 2018-04-25 14:18:55 +00:00
Sparc [Sparc] invalid adjustments in TLS_LE/TLS_LDO relocations removed 2017-07-25 15:28:28 +00:00
SystemZ [SystemZ, AsmParser] Enable the mnemonic spell corrector. 2017-07-18 09:17:00 +00:00
WebAssembly [WebAssembly] Enabled -triple=wasm32-unknown-unknown-wasm path using ELF directive parser. 2018-04-19 22:00:53 +00:00
X86 [X86] Revert r330638 - accidental commit 2018-04-23 20:05:51 +00:00