[PATCH] D68392: [RISCV] Add obsolete aliases of fscsr, frcsr (fssr, frsr)
Edward Jones via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 3 07:59:13 PDT 2019
edward-jones updated this revision to Diff 223022.
edward-jones added a comment.
Added tests!
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68392/new/
https://reviews.llvm.org/D68392
Files:
llvm/lib/Target/RISCV/RISCVInstrInfoF.td
llvm/test/MC/RISCV/rvf-aliases-valid.s
Index: llvm/test/MC/RISCV/rvf-aliases-valid.s
===================================================================
--- llvm/test/MC/RISCV/rvf-aliases-valid.s
+++ llvm/test/MC/RISCV/rvf-aliases-valid.s
@@ -55,6 +55,18 @@
# CHECK-ALIAS: fscsr t3
fscsr x28
+# These are obsolete aliases of frcsr/fscsr. They are accepted by the assembler
+# but the disassembler should always print them as the equivalent, new aliases.
+# CHECK-INST: csrrs t4, fcsr, zero
+# CHECK-ALIAS: frcsr t4
+frsr x29
+# CHECK-INST: csrrw t5, fcsr, t6
+# CHECK-ALIAS: fscsr t5, t6
+fssr x30, x31
+# CHECK-INST: csrrw zero, fcsr, s0
+# CHECK-ALIAS: fscsr s0
+fssr x8
+
# CHECK-INST: csrrs t4, frm, zero
# CHECK-ALIAS: frrm t4
frrm x29
Index: llvm/lib/Target/RISCV/RISCVInstrInfoF.td
===================================================================
--- llvm/lib/Target/RISCV/RISCVInstrInfoF.td
+++ llvm/lib/Target/RISCV/RISCVInstrInfoF.td
@@ -227,6 +227,12 @@
def : InstAlias<"fscsr $rd, $rs", (CSRRW GPR:$rd, FCSR.Encoding, GPR:$rs)>;
def : InstAlias<"fscsr $rs", (CSRRW X0, FCSR.Encoding, GPR:$rs), 2>;
+// frsr, fssr are obsolete aliases replaced by frcsr, fscsr, so give them
+// zero weight.
+def : InstAlias<"frsr $rd", (CSRRS GPR:$rd, FCSR.Encoding, X0), 0>;
+def : InstAlias<"fssr $rd, $rs", (CSRRW GPR:$rd, FCSR.Encoding, GPR:$rs), 0>;
+def : InstAlias<"fssr $rs", (CSRRW X0, FCSR.Encoding, GPR:$rs), 0>;
+
def : InstAlias<"frrm $rd", (CSRRS GPR:$rd, FRM.Encoding, X0), 2>;
def : InstAlias<"fsrm $rd, $rs", (CSRRW GPR:$rd, FRM.Encoding, GPR:$rs)>;
def : InstAlias<"fsrm $rs", (CSRRW X0, FRM.Encoding, GPR:$rs), 2>;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68392.223022.patch
Type: text/x-patch
Size: 1659 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191003/7619cdd2/attachment.bin>
More information about the llvm-commits
mailing list