llvm.org GIT mirror llvm / 7cb38d5
[RISCV] Allow fp as an alias of s0 The RISC-V Assembly Programmer's Manual defines fp as another alias of x8. However, our tablegen rules only recognise s0. This patch adds fp as another alias of x8. GCC also accepts fp. Differential Revision: https://reviews.llvm.org/D59209 Patch by Ferran Pallarès Roca. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355867 91177308-0d34-0410-b5e6-96231b3b80d8 Alex Bradbury 1 year, 8 months ago
2 changed file(s) with 17 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
5454 def X6 : RISCVReg<6, "x6", ["t1"]>, DwarfRegNum<[6]>;
5555 def X7 : RISCVReg<7, "x7", ["t2"]>, DwarfRegNum<[7]>;
5656 }
57 def X8 : RISCVReg<8, "x8", ["s0"]>, DwarfRegNum<[8]>;
57 def X8 : RISCVReg<8, "x8", ["s0", "fp"]>, DwarfRegNum<[8]>;
5858 def X9 : RISCVReg<9, "x9", ["s1"]>, DwarfRegNum<[9]>;
5959 def X10 : RISCVReg<10,"x10", ["a0"]>, DwarfRegNum<[10]>;
6060 def X11 : RISCVReg<11,"x11", ["a1"]>, DwarfRegNum<[11]>;
0 # RUN: llvm-mc %s -triple=riscv32 \
1 # RUN: | FileCheck %s
2 # RUN: llvm-mc %s -triple=riscv64 \
3 # RUN: | FileCheck %s
4 # RUN: llvm-mc -filetype=obj -triple riscv32 < %s \
5 # RUN: | llvm-objdump -d -r - \
6 # RUN: | FileCheck %s
7 # RUN: llvm-mc -filetype=obj -triple riscv64 < %s \
8 # RUN: | llvm-objdump -d -r - \
9 # RUN: | FileCheck %s
10
11 # 'fp' is an alternate ABI name for 's0' and it should be accepted in input.
12 # However, 's0' should be printed in preference.
13
14 # CHECK: addi s0, s0, -4
15 addi fp, fp, -4