[RFC 3/4] RISC-V: Hypervisor ext: tests for new isns/csr and cleanup old csrs

Vineet Gupta vineetg@rivosinc.com
Thu Dec 16 17:33:27 GMT 2021


Since the prior versions were not fully supported (and or functional
even from ISA pov), we just remove any old baggage - this avoids the
mess in keeping csr with same names but different addresses etc.

Signed-off-by: Vineet Gupta <vineetg@rivosinc.com>
---
 gas/testsuite/gas/riscv/csr-dw-regnums.d      | 10 ---
 gas/testsuite/gas/riscv/csr-dw-regnums.s      | 10 ---
 gas/testsuite/gas/riscv/h-ext-32.s            | 61 +++++++++++++++++
 gas/testsuite/gas/riscv/h-ext-64.s            | 68 +++++++++++++++++++
 .../gas/riscv/priv-reg-fail-read-only-01.s    | 10 ---
 .../gas/riscv/priv-reg-fail-version-1p10.l    | 10 ---
 .../gas/riscv/priv-reg-fail-version-1p11.l    | 10 ---
 .../gas/riscv/priv-reg-version-1p10.d         | 10 ---
 .../gas/riscv/priv-reg-version-1p11.d         | 10 ---
 .../gas/riscv/priv-reg-version-1p9p1.d        | 10 ---
 gas/testsuite/gas/riscv/priv-reg.s            | 10 ---
 11 files changed, 129 insertions(+), 90 deletions(-)
 create mode 100644 gas/testsuite/gas/riscv/h-ext-32.s
 create mode 100644 gas/testsuite/gas/riscv/h-ext-64.s

diff --git a/gas/testsuite/gas/riscv/csr-dw-regnums.d b/gas/testsuite/gas/riscv/csr-dw-regnums.d
index de17ad81fbde..ea0a445c39ce 100644
--- a/gas/testsuite/gas/riscv/csr-dw-regnums.d
+++ b/gas/testsuite/gas/riscv/csr-dw-regnums.d
@@ -229,16 +229,6 @@ Contents of the .* section:
   DW_CFA_offset_extended_sf: r4925 \(mhpmevent29\) at cfa\+3316
   DW_CFA_offset_extended_sf: r4926 \(mhpmevent30\) at cfa\+3320
   DW_CFA_offset_extended_sf: r4927 \(mhpmevent31\) at cfa\+3324
-  DW_CFA_offset_extended_sf: r4608 \(hstatus\) at cfa\+2048
-  DW_CFA_offset_extended_sf: r4610 \(hedeleg\) at cfa\+2056
-  DW_CFA_offset_extended_sf: r4611 \(hideleg\) at cfa\+2060
-  DW_CFA_offset_extended_sf: r4612 \(hie\) at cfa\+2064
-  DW_CFA_offset_extended_sf: r4613 \(htvec\) at cfa\+2068
-  DW_CFA_offset_extended_sf: r4672 \(hscratch\) at cfa\+2304
-  DW_CFA_offset_extended_sf: r4673 \(hepc\) at cfa\+2308
-  DW_CFA_offset_extended_sf: r4674 \(hcause\) at cfa\+2312
-  DW_CFA_offset_extended_sf: r4675 \(hbadaddr\) at cfa\+2316
-  DW_CFA_offset_extended_sf: r4676 \(hip\) at cfa\+2320
   DW_CFA_offset_extended_sf: r4992 \(mbase\) at cfa\+3584
   DW_CFA_offset_extended_sf: r4993 \(mbound\) at cfa\+3588
   DW_CFA_offset_extended_sf: r4994 \(mibase\) at cfa\+3592
diff --git a/gas/testsuite/gas/riscv/csr-dw-regnums.s b/gas/testsuite/gas/riscv/csr-dw-regnums.s
index ecc801469763..549475d650e8 100644
--- a/gas/testsuite/gas/riscv/csr-dw-regnums.s
+++ b/gas/testsuite/gas/riscv/csr-dw-regnums.s
@@ -220,16 +220,6 @@ _start:
 	.cfi_offset mhpmevent30, 3320
 	.cfi_offset mhpmevent31, 3324
 	# dropped
-	.cfi_offset hstatus, 2048
-	.cfi_offset hedeleg, 2056
-	.cfi_offset hideleg, 2060
-	.cfi_offset hie, 2064
-	.cfi_offset htvec, 2068
-	.cfi_offset hscratch, 2304
-	.cfi_offset hepc, 2308
-	.cfi_offset hcause, 2312
-	.cfi_offset hbadaddr, 2316
-	.cfi_offset hip, 2320
 	.cfi_offset mbase, 3584
 	.cfi_offset mbound, 3588
 	.cfi_offset mibase, 3592
diff --git a/gas/testsuite/gas/riscv/h-ext-32.s b/gas/testsuite/gas/riscv/h-ext-32.s
new file mode 100644
index 000000000000..2818d7d17381
--- /dev/null
+++ b/gas/testsuite/gas/riscv/h-ext-32.s
@@ -0,0 +1,61 @@
+target:
+	hlv.b   a0, (a1)
+	hlv.bu  a0, (a1)
+	hlv.h   a1, (a2)
+	hlv.hu  a1, (a1)
+	hlvx.hu a1, (a2)
+	hlv.w   a2, (a2)
+	hlvx.wu a2, (a3)
+
+	hsv.b   a0, (a1)
+	hsv.h   a0, (a1)
+	hsv.w   a0, (a1)
+
+	csrr    a0, hstatus
+	csrw    hstatus, a1
+	csrr    a0, hedeleg
+	csrw    hedeleg, a1
+	csrr    a0, hideleg
+	csrw    hideleg, a1
+	csrr    a0, hie
+	csrw    hie, a1
+	csrr    a0, hcounteren
+	csrw    hcounteren, a1
+	csrr    a0, hgeie
+	csrw    hgeie, a1
+	csrr    a0, htval
+	csrw    htval, a1
+	csrr    a0, hip
+	csrw    hip, a1
+	csrr    a0, hvip
+	csrw    hvip, a1
+	csrr    a0, htinst
+	csrw    htinst, a1
+	csrr    a0, hgeip
+	csrw    hgeip, a1
+	csrr    a0, henvcfg
+	csrw    henvcfg, a1
+	csrr    a0, hgatp
+	csrw    hgatp, a1
+	csrr    a0, hcontext
+	csrw    hcontext, a1
+	csrr    a0, htimedelta
+	csrw    htimedelta, a1
+	csrr    a0, vsstatus
+	csrw    vsstatus, a1
+	csrr    a0, vsie
+	csrw    vsie, a1
+	csrr    a0, vstvec
+	csrw    vstvec, a1
+	csrr    a0, vsscratch
+	csrw    vsscratch, a1
+	csrr    a0, vsepc
+	csrw    vsepc, a1
+	csrr    a0, vscause
+	csrw    vscause, a1
+	csrr    a0, vstval
+	csrw    vstval, a1
+	csrr    a0, vsip
+	csrw    vsip, a1
+	csrr    a0, vsatp
+	csrw    vsatp, a1
diff --git a/gas/testsuite/gas/riscv/h-ext-64.s b/gas/testsuite/gas/riscv/h-ext-64.s
new file mode 100644
index 000000000000..25455fd4fdca
--- /dev/null
+++ b/gas/testsuite/gas/riscv/h-ext-64.s
@@ -0,0 +1,68 @@
+target:
+	hlv.b   a0, (a1)
+	hlv.bu  a0, (a1)
+	hlv.h   a1, (a2)
+	hlv.hu  a1, (a1)
+	hlvx.hu a1, (a2)
+	hlv.w   a2, (a2)
+	hlv.wu  a2, (a3)
+	hlvx.wu a2, (a3)
+	hlv.d   a3, (a4)
+
+	hsv.b   a0, (a1)
+	hsv.h   a0, (a1)
+	hsv.w   a0, (a1)
+	hsv.d   a0, (a1)
+
+	csrr    a0, hstatus
+	csrw    hstatus, a1
+	csrr    a0, hedeleg
+	csrw    hedeleg, a1
+	csrr    a0, hideleg
+	csrw    hideleg, a1
+	csrr    a0, hie
+	csrw    hie, a1
+	csrr    a0, hcounteren
+	csrw    hcounteren, a1
+	csrr    a0, hgeie
+	csrw    hgeie, a1
+	csrr    a0, htval
+	csrw    htval, a1
+	csrr    a0, hip
+	csrw    hip, a1
+	csrr    a0, hvip
+	csrw    hvip, a1
+	csrr    a0, htinst
+	csrw    htinst, a1
+	csrr    a0, hgeip
+	csrw    hgeip, a1
+	csrr    a0, henvcfg
+	csrw    henvcfg, a1
+	csrr    a0, henvcfgh
+	csrw    henvcfgh, a1
+	csrr    a0, hgatp
+	csrw    hgatp, a1
+	csrr    a0, hcontext
+	csrw    hcontext, a1
+	csrr    a0, htimedelta
+	csrw    htimedelta, a1
+	csrr    a0, htimedeltah
+	csrw    htimedeltah, a1
+	csrr    a0, vsstatus
+	csrw    vsstatus, a1
+	csrr    a0, vsie
+	csrw    vsie, a1
+	csrr    a0, vstvec
+	csrw    vstvec, a1
+	csrr    a0, vsscratch
+	csrw    vsscratch, a1
+	csrr    a0, vsepc
+	csrw    vsepc, a1
+	csrr    a0, vscause
+	csrw    vscause, a1
+	csrr    a0, vstval
+	csrw    vstval, a1
+	csrr    a0, vsip
+	csrw    vsip, a1
+	csrr    a0, vsatp
+	csrw    vsatp, a1
diff --git a/gas/testsuite/gas/riscv/priv-reg-fail-read-only-01.s b/gas/testsuite/gas/riscv/priv-reg-fail-read-only-01.s
index af0fc4e14a42..aff34e9a3470 100644
--- a/gas/testsuite/gas/riscv/priv-reg-fail-read-only-01.s
+++ b/gas/testsuite/gas/riscv/priv-reg-fail-read-only-01.s
@@ -249,16 +249,6 @@
 	csr mucounteren         # 0x320 in 1.9.1, dropped in 1.10, but the value is mcountinhibit since 1.11
 	csr dscratch            # 0x7b2 in 1.10,  but the value is dscratch0 since 1.11
 
-	csr hstatus             # 0x200, dropped in 1.10
-	csr hedeleg             # 0x202, dropped in 1.10
-	csr hideleg             # 0x203, dropped in 1.10
-	csr hie                 # 0x204, dropped in 1.10
-	csr htvec               # 0x205, dropped in 1.10
-	csr hscratch            # 0x240, dropped in 1.10
-	csr hepc                # 0x241, dropped in 1.10
-	csr hcause              # 0x242, dropped in 1.10
-	csr hbadaddr            # 0x243, dropped in 1.10
-	csr hip                 # 0x244, dropped in 1.10
 	csr mbase               # 0x380, dropped in 1.10
 	csr mbound              # 0x381, dropped in 1.10
 	csr mibase              # 0x382, dropped in 1.10
diff --git a/gas/testsuite/gas/riscv/priv-reg-fail-version-1p10.l b/gas/testsuite/gas/riscv/priv-reg-fail-version-1p10.l
index fbba6e525670..5f7a8d60d7dd 100644
--- a/gas/testsuite/gas/riscv/priv-reg-fail-version-1p10.l
+++ b/gas/testsuite/gas/riscv/priv-reg-fail-version-1p10.l
@@ -5,16 +5,6 @@
 .*Warning: invalid CSR `sptbr' for the privileged spec `1.10'
 .*Warning: invalid CSR `mbadaddr' for the privileged spec `1.10'
 .*Warning: invalid CSR `mucounteren' for the privileged spec `1.10'
-.*Warning: invalid CSR `hstatus' for the privileged spec `1.10'
-.*Warning: invalid CSR `hedeleg' for the privileged spec `1.10'
-.*Warning: invalid CSR `hideleg' for the privileged spec `1.10'
-.*Warning: invalid CSR `hie' for the privileged spec `1.10'
-.*Warning: invalid CSR `htvec' for the privileged spec `1.10'
-.*Warning: invalid CSR `hscratch' for the privileged spec `1.10'
-.*Warning: invalid CSR `hepc' for the privileged spec `1.10'
-.*Warning: invalid CSR `hcause' for the privileged spec `1.10'
-.*Warning: invalid CSR `hbadaddr' for the privileged spec `1.10'
-.*Warning: invalid CSR `hip' for the privileged spec `1.10'
 .*Warning: invalid CSR `mbase' for the privileged spec `1.10'
 .*Warning: invalid CSR `mbound' for the privileged spec `1.10'
 .*Warning: invalid CSR `mibase' for the privileged spec `1.10'
diff --git a/gas/testsuite/gas/riscv/priv-reg-fail-version-1p11.l b/gas/testsuite/gas/riscv/priv-reg-fail-version-1p11.l
index 68354ce25ce9..888cbb211d7f 100644
--- a/gas/testsuite/gas/riscv/priv-reg-fail-version-1p11.l
+++ b/gas/testsuite/gas/riscv/priv-reg-fail-version-1p11.l
@@ -4,16 +4,6 @@
 .*Warning: invalid CSR `sptbr' for the privileged spec `1.11'
 .*Warning: invalid CSR `mbadaddr' for the privileged spec `1.11'
 .*Warning: invalid CSR `mucounteren' for the privileged spec `1.11'
-.*Warning: invalid CSR `hstatus' for the privileged spec `1.11'
-.*Warning: invalid CSR `hedeleg' for the privileged spec `1.11'
-.*Warning: invalid CSR `hideleg' for the privileged spec `1.11'
-.*Warning: invalid CSR `hie' for the privileged spec `1.11'
-.*Warning: invalid CSR `htvec' for the privileged spec `1.11'
-.*Warning: invalid CSR `hscratch' for the privileged spec `1.11'
-.*Warning: invalid CSR `hepc' for the privileged spec `1.11'
-.*Warning: invalid CSR `hcause' for the privileged spec `1.11'
-.*Warning: invalid CSR `hbadaddr' for the privileged spec `1.11'
-.*Warning: invalid CSR `hip' for the privileged spec `1.11'
 .*Warning: invalid CSR `mbase' for the privileged spec `1.11'
 .*Warning: invalid CSR `mbound' for the privileged spec `1.11'
 .*Warning: invalid CSR `mibase' for the privileged spec `1.11'
diff --git a/gas/testsuite/gas/riscv/priv-reg-version-1p10.d b/gas/testsuite/gas/riscv/priv-reg-version-1p10.d
index ee4f405adaae..44e9af63a31f 100644
--- a/gas/testsuite/gas/riscv/priv-reg-version-1p10.d
+++ b/gas/testsuite/gas/riscv/priv-reg-version-1p10.d
@@ -225,16 +225,6 @@ Disassembly of section .text:
 [ 	]+[0-9a-f]+:[  	]+18002573[    	]+csrr[        	]+a0,satp
 [ 	]+[0-9a-f]+:[  	]+34302573[    	]+csrr[        	]+a0,mtval
 [ 	]+[0-9a-f]+:[  	]+32002573[    	]+csrr[        	]+a0,0x320
-[ 	]+[0-9a-f]+:[  	]+20002573[    	]+csrr[        	]+a0,0x200
-[ 	]+[0-9a-f]+:[  	]+20202573[    	]+csrr[        	]+a0,0x202
-[ 	]+[0-9a-f]+:[  	]+20302573[    	]+csrr[        	]+a0,0x203
-[ 	]+[0-9a-f]+:[  	]+20402573[    	]+csrr[        	]+a0,0x204
-[ 	]+[0-9a-f]+:[  	]+20502573[    	]+csrr[        	]+a0,0x205
-[ 	]+[0-9a-f]+:[  	]+24002573[    	]+csrr[        	]+a0,0x240
-[ 	]+[0-9a-f]+:[  	]+24102573[    	]+csrr[        	]+a0,0x241
-[ 	]+[0-9a-f]+:[  	]+24202573[    	]+csrr[        	]+a0,0x242
-[ 	]+[0-9a-f]+:[  	]+24302573[    	]+csrr[        	]+a0,0x243
-[ 	]+[0-9a-f]+:[  	]+24402573[    	]+csrr[        	]+a0,0x244
 [ 	]+[0-9a-f]+:[  	]+38002573[    	]+csrr[        	]+a0,0x380
 [ 	]+[0-9a-f]+:[  	]+38102573[    	]+csrr[        	]+a0,0x381
 [ 	]+[0-9a-f]+:[  	]+38202573[    	]+csrr[        	]+a0,0x382
diff --git a/gas/testsuite/gas/riscv/priv-reg-version-1p11.d b/gas/testsuite/gas/riscv/priv-reg-version-1p11.d
index 185e84dbd70f..c456cb945689 100644
--- a/gas/testsuite/gas/riscv/priv-reg-version-1p11.d
+++ b/gas/testsuite/gas/riscv/priv-reg-version-1p11.d
@@ -225,16 +225,6 @@ Disassembly of section .text:
 [     	]+[0-9a-f]+:[  	]+18002573[    	]+csrr[        	]+a0,satp
 [     	]+[0-9a-f]+:[  	]+34302573[    	]+csrr[        	]+a0,mtval
 [     	]+[0-9a-f]+:[  	]+32002573[    	]+csrr[        	]+a0,mcountinhibit
-[     	]+[0-9a-f]+:[  	]+20002573[    	]+csrr[        	]+a0,0x200
-[     	]+[0-9a-f]+:[  	]+20202573[    	]+csrr[        	]+a0,0x202
-[     	]+[0-9a-f]+:[  	]+20302573[    	]+csrr[        	]+a0,0x203
-[     	]+[0-9a-f]+:[  	]+20402573[    	]+csrr[        	]+a0,0x204
-[     	]+[0-9a-f]+:[  	]+20502573[    	]+csrr[        	]+a0,0x205
-[     	]+[0-9a-f]+:[  	]+24002573[    	]+csrr[        	]+a0,0x240
-[     	]+[0-9a-f]+:[  	]+24102573[    	]+csrr[        	]+a0,0x241
-[     	]+[0-9a-f]+:[  	]+24202573[    	]+csrr[        	]+a0,0x242
-[     	]+[0-9a-f]+:[  	]+24302573[    	]+csrr[        	]+a0,0x243
-[     	]+[0-9a-f]+:[  	]+24402573[    	]+csrr[        	]+a0,0x244
 [     	]+[0-9a-f]+:[  	]+38002573[    	]+csrr[        	]+a0,0x380
 [     	]+[0-9a-f]+:[  	]+38102573[    	]+csrr[        	]+a0,0x381
 [     	]+[0-9a-f]+:[  	]+38202573[    	]+csrr[        	]+a0,0x382
diff --git a/gas/testsuite/gas/riscv/priv-reg-version-1p9p1.d b/gas/testsuite/gas/riscv/priv-reg-version-1p9p1.d
index 0e0ba7797014..432aecc6691c 100644
--- a/gas/testsuite/gas/riscv/priv-reg-version-1p9p1.d
+++ b/gas/testsuite/gas/riscv/priv-reg-version-1p9p1.d
@@ -225,16 +225,6 @@ Disassembly of section .text:
 [     	]+[0-9a-f]+:[  	]+18002573[    	]+csrr[        	]+a0,sptbr
 [     	]+[0-9a-f]+:[  	]+34302573[    	]+csrr[        	]+a0,mbadaddr
 [     	]+[0-9a-f]+:[  	]+32002573[    	]+csrr[        	]+a0,mucounteren
-[     	]+[0-9a-f]+:[  	]+20002573[    	]+csrr[        	]+a0,hstatus
-[     	]+[0-9a-f]+:[  	]+20202573[    	]+csrr[        	]+a0,hedeleg
-[     	]+[0-9a-f]+:[  	]+20302573[    	]+csrr[        	]+a0,hideleg
-[     	]+[0-9a-f]+:[  	]+20402573[    	]+csrr[        	]+a0,hie
-[     	]+[0-9a-f]+:[  	]+20502573[    	]+csrr[        	]+a0,htvec
-[     	]+[0-9a-f]+:[  	]+24002573[    	]+csrr[        	]+a0,hscratch
-[     	]+[0-9a-f]+:[  	]+24102573[    	]+csrr[        	]+a0,hepc
-[     	]+[0-9a-f]+:[  	]+24202573[    	]+csrr[        	]+a0,hcause
-[     	]+[0-9a-f]+:[  	]+24302573[    	]+csrr[        	]+a0,hbadaddr
-[     	]+[0-9a-f]+:[  	]+24402573[    	]+csrr[        	]+a0,hip
 [     	]+[0-9a-f]+:[  	]+38002573[    	]+csrr[        	]+a0,mbase
 [     	]+[0-9a-f]+:[  	]+38102573[    	]+csrr[        	]+a0,mbound
 [     	]+[0-9a-f]+:[  	]+38202573[    	]+csrr[        	]+a0,mibase
diff --git a/gas/testsuite/gas/riscv/priv-reg.s b/gas/testsuite/gas/riscv/priv-reg.s
index 5cf3ebc1b3e0..8c507fec4bb9 100644
--- a/gas/testsuite/gas/riscv/priv-reg.s
+++ b/gas/testsuite/gas/riscv/priv-reg.s
@@ -234,16 +234,6 @@
 	csr mbadaddr		# 0x343 in 1.9.1, but the value is mtval since 1.10
 	csr mucounteren		# 0x320 in 1.9.1, dropped in 1.10, but the value is mcountinhibit since 1.11
 
-	csr hstatus		# 0x200, dropped in 1.10
-	csr hedeleg		# 0x202, dropped in 1.10
-	csr hideleg		# 0x203, dropped in 1.10
-	csr hie			# 0x204, dropped in 1.10
-	csr htvec		# 0x205, dropped in 1.10
-	csr hscratch		# 0x240, dropped in 1.10
-	csr hepc		# 0x241, dropped in 1.10
-	csr hcause		# 0x242, dropped in 1.10
-	csr hbadaddr		# 0x243, dropped in 1.10
-	csr hip			# 0x244, dropped in 1.10
 	csr mbase		# 0x380, dropped in 1.10
 	csr mbound		# 0x381, dropped in 1.10
 	csr mibase		# 0x382, dropped in 1.10
-- 
2.30.2



More information about the Binutils mailing list