[PATCH] D68392: [RISCV] Add obsolete aliases of fscsr, frcsr (fssr, frsr)

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 3 08:47:27 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL373618: [RISCV] Add obsolete aliases of fscsr, frcsr (fssr, frsr) (authored by edjones, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D68392?vs=223022&id=223034#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68392/new/

https://reviews.llvm.org/D68392

Files:
  llvm/trunk/lib/Target/RISCV/RISCVInstrInfoF.td
  llvm/trunk/test/MC/RISCV/rvf-aliases-valid.s


Index: llvm/trunk/lib/Target/RISCV/RISCVInstrInfoF.td
===================================================================
--- llvm/trunk/lib/Target/RISCV/RISCVInstrInfoF.td
+++ llvm/trunk/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>;
Index: llvm/trunk/test/MC/RISCV/rvf-aliases-valid.s
===================================================================
--- llvm/trunk/test/MC/RISCV/rvf-aliases-valid.s
+++ llvm/trunk/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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68392.223034.patch
Type: text/x-patch
Size: 1695 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191003/eb80e8d5/attachment-0001.bin>


More information about the llvm-commits mailing list