diff options
author | Jim Wilson <jimw@sifive.com> | 2019-07-30 14:42:16 -0700 |
---|---|---|
committer | Jim Wilson <jimw@sifive.com> | 2019-07-30 14:42:16 -0700 |
commit | c0d6f62fcec939ab896e4839f6aa14ebfcd43565 (patch) | |
tree | 7fd7bc88c705fde3cbfb775f47aadf88e6d0937d /gas | |
parent | aa3b653351504e262fb455af5efb6eea6d981597 (diff) | |
download | gdb-c0d6f62fcec939ab896e4839f6aa14ebfcd43565.zip gdb-c0d6f62fcec939ab896e4839f6aa14ebfcd43565.tar.gz gdb-c0d6f62fcec939ab896e4839f6aa14ebfcd43565.tar.bz2 |
RISC-V: Fix minor issues with FP csr instructions.
Mel Chen <mel.chen@sifive.com>
gas/
* testsuite/gas/riscv/alias-csr.s: Add testcase for CSR-access
alias instructions.
* testsuite/gas/riscv/no-aliases-csr.d: Run testcase alias-csr.s with
-Mno-aliases.
* testsuite/gas/riscv/alias-csr.d: Run testcase alias-csr.s.
* testsuite/gas/riscv/priv-reg.d: Update.
opcodes/
* riscv-opc.c (riscv_opcodes): Set frsr, fssr, frcsr, fscsr, frrm,
fsrm, fsrmi, frflags, fsflags, fsflagsi to alias instructions.
* riscv-opc.c (riscv_opcodes): Adjust order of frsr, frcsr, fssr,
fscsr.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 10 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/alias-csr.d | 23 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/alias-csr.s | 14 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/no-aliases-csr.d | 23 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/priv-reg.d | 2 |
5 files changed, 71 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 34581e0..4d6f902 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,13 @@ +2019-07-30 Mel Chen <mel.chen@sifive.com> + + * testsuite/gas/riscv/alias-csr.s: Add testcase for CSR-access + alias instructions. + * testsuite/gas/riscv/no-aliases-csr.d: Run testcase alias-csr.s with + -Mno-aliases. + + * testsuite/gas/riscv/alias-csr.d: Run testcase alias-csr.s. + * testsuite/gas/riscv/priv-reg.d: Update. + 2019-07-24 Nick Clifton <nickc@redhat.com> * po/sv.po: Updated Swedish translation. diff --git a/gas/testsuite/gas/riscv/alias-csr.d b/gas/testsuite/gas/riscv/alias-csr.d new file mode 100644 index 0000000..af5c591 --- /dev/null +++ b/gas/testsuite/gas/riscv/alias-csr.d @@ -0,0 +1,23 @@ +#source: alias-csr.s +#as: -march=rv64if +#objdump: -dr + +.*:[ ]+file format .* + + +Disassembly of section .text: + +0+000 <alias_csr>: +[ ]+0:[ ]+003022f3[ ]+frcsr[ ]+t0 +[ ]+4:[ ]+003392f3[ ]+fscsr[ ]+t0,t2 +[ ]+8:[ ]+00339073[ ]+fscsr[ ]+t2 +[ ]+c:[ ]+002022f3[ ]+frrm[ ]+t0 +[ ]+10:[ ]+002312f3[ ]+fsrm[ ]+t0,t1 +[ ]+14:[ ]+00231073[ ]+fsrm[ ]+t1 +[ ]+18:[ ]+002fd2f3[ ]+fsrmi[ ]+t0,31 +[ ]+1c:[ ]+002fd073[ ]+fsrmi[ ]+zero,31 +[ ]+20:[ ]+001022f3[ ]+frflags[ ]+t0 +[ ]+24:[ ]+001312f3[ ]+fsflags[ ]+t0,t1 +[ ]+28:[ ]+00131073[ ]+fsflags[ ]+t1 +[ ]+2c:[ ]+001fd2f3[ ]+fsflagsi[ ]+t0,31 +[ ]+30:[ ]+001fd073[ ]+fsflagsi[ ]+zero,31 diff --git a/gas/testsuite/gas/riscv/alias-csr.s b/gas/testsuite/gas/riscv/alias-csr.s new file mode 100644 index 0000000..8577de1 --- /dev/null +++ b/gas/testsuite/gas/riscv/alias-csr.s @@ -0,0 +1,14 @@ +alias_csr: + frcsr t0 + fscsr t0, t2 + fscsr t2 + frrm t0 + fsrm t0, t1 + fsrm t1 + fsrmi t0, 31 + fsrmi 31 + frflags t0 + fsflags t0, t1 + fsflags t1 + fsflagsi t0, 31 + fsflagsi 31 diff --git a/gas/testsuite/gas/riscv/no-aliases-csr.d b/gas/testsuite/gas/riscv/no-aliases-csr.d new file mode 100644 index 0000000..2275330 --- /dev/null +++ b/gas/testsuite/gas/riscv/no-aliases-csr.d @@ -0,0 +1,23 @@ +#source: alias-csr.s +#as: -march=rv64if +#objdump: -dr -Mno-aliases + +.*:[ ]+file format .* + + +Disassembly of section .text: + +0+000 <alias_csr>: +[ ]+0:[ ]+003022f3[ ]+csrrs[ ]+t0,fcsr,zero +[ ]+4:[ ]+003392f3[ ]+csrrw[ ]+t0,fcsr,t2 +[ ]+8:[ ]+00339073[ ]+csrrw[ ]+zero,fcsr,t2 +[ ]+c:[ ]+002022f3[ ]+csrrs[ ]+t0,frm,zero +[ ]+10:[ ]+002312f3[ ]+csrrw[ ]+t0,frm,t1 +[ ]+14:[ ]+00231073[ ]+csrrw[ ]+zero,frm,t1 +[ ]+18:[ ]+002fd2f3[ ]+csrrwi[ ]+t0,frm,31 +[ ]+1c:[ ]+002fd073[ ]+csrrwi[ ]+zero,frm,31 +[ ]+20:[ ]+001022f3[ ]+csrrs[ ]+t0,fflags,zero +[ ]+24:[ ]+001312f3[ ]+csrrw[ ]+t0,fflags,t1 +[ ]+28:[ ]+00131073[ ]+csrrw[ ]+zero,fflags,t1 +[ ]+2c:[ ]+001fd2f3[ ]+csrrwi[ ]+t0,fflags,31 +[ ]+30:[ ]+001fd073[ ]+csrrwi[ ]+zero,fflags,31 diff --git a/gas/testsuite/gas/riscv/priv-reg.d b/gas/testsuite/gas/riscv/priv-reg.d index 9ec5d97..d8ec868 100644 --- a/gas/testsuite/gas/riscv/priv-reg.d +++ b/gas/testsuite/gas/riscv/priv-reg.d @@ -17,7 +17,7 @@ Disassembly of section .text: [ ]+1c:[ ]+04402573[ ]+csrr[ ]+a0,uip [ ]+20:[ ]+00102573[ ]+frflags[ ]+a0 [ ]+24:[ ]+00202573[ ]+frrm[ ]+a0 -[ ]+28:[ ]+00302573[ ]+frsr[ ]+a0 +[ ]+28:[ ]+00302573[ ]+frcsr[ ]+a0 [ ]+2c:[ ]+c0002573[ ]+rdcycle[ ]+a0 [ ]+30:[ ]+c0102573[ ]+rdtime[ ]+a0 [ ]+34:[ ]+c0202573[ ]+rdinstret[ ]+a0 |