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