From 2f00c0c1f26a10f93f4a133bec69f4d0b95df685 Mon Sep 17 00:00:00 2001 From: Yunsup Lee Date: Thu, 17 Oct 2013 19:35:34 -0700 Subject: add hwacha exception support --- isa/macros/scalar/test_macros.h | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'isa/macros') diff --git a/isa/macros/scalar/test_macros.h b/isa/macros/scalar/test_macros.h index 7da0b59..b856701 100644 --- a/isa/macros/scalar/test_macros.h +++ b/isa/macros/scalar/test_macros.h @@ -559,10 +559,11 @@ test_ ## testnum: \ #----------------------------------------------------------------------- -# RV64UV MACROS +# RV64SV MACROS #----------------------------------------------------------------------- -#define TEST_ILLEGAL_VT_REGID( testnum, nxreg, nfreg, inst, reg1, reg2, reg3) \ +#define TEST_ILLEGAL_TVEC_REGID( testnum, nxreg, nfreg, inst, reg1, reg2) \ + setpcr status, SR_EI; \ la a0, handler ## testnum; \ mtpcr a0, evec; \ vsetcfg nxreg, nfreg; \ @@ -574,13 +575,14 @@ test_ ## testnum: \ vld vx3, a1; \ lui a0,%hi(vtcode1 ## testnum); \ vf %lo(vtcode1 ## testnum)(a0); \ + la reg2, dest; \ +illegal ## testnum: \ + inst reg1, reg2; \ la a3, dest; \ vsd vx2, a3; \ fence; \ vtcode1 ## testnum: \ add x2, x2, x3; \ -illegal ## testnum: \ - inst reg1, reg2, reg3; \ stop; \ vtcode2 ## testnum: \ add x2, x2, x3; \ @@ -588,12 +590,13 @@ vtcode2 ## testnum: \ handler ## testnum: \ vxcptkill; \ li x28,2; \ - mfpcr a0,cr6; \ - li a1,26; \ - bne a0,a1,fail; \ - mfpcr a0,cr2; \ - la a1,illegal ## testnum; \ + vxcptcause a0; \ + li a1,HWACHA_CAUSE_TVEC_ILLEGAL_REGID; \ bne a0,a1,fail; \ + vxcptaux a0; \ + la a1, illegal ## testnum; \ + lw a2, 0(a1); \ + bne a0, a2, fail; \ vsetcfg 32,0; \ li a0,4; \ vsetvl a0,a0; \ @@ -620,7 +623,8 @@ handler ## testnum: \ li x28,5; \ bne a1,a2,fail; \ -#define TEST_ILLEGAL_TVEC_REGID( testnum, nxreg, nfreg, inst, reg1, reg2, aux) \ +#define TEST_ILLEGAL_VT_REGID( testnum, nxreg, nfreg, inst, reg1, reg2, reg3) \ + setpcr status, SR_EI; \ la a0, handler ## testnum; \ mtpcr a0, evec; \ vsetcfg nxreg, nfreg; \ @@ -632,14 +636,13 @@ handler ## testnum: \ vld vx3, a1; \ lui a0,%hi(vtcode1 ## testnum); \ vf %lo(vtcode1 ## testnum)(a0); \ - la reg2, dest; \ -illegal ## testnum: \ - inst reg1, reg2; \ la a3, dest; \ vsd vx2, a3; \ fence; \ vtcode1 ## testnum: \ add x2, x2, x3; \ +illegal ## testnum: \ + inst reg1, reg2, reg3; \ stop; \ vtcode2 ## testnum: \ add x2, x2, x3; \ @@ -647,12 +650,12 @@ vtcode2 ## testnum: \ handler ## testnum: \ vxcptkill; \ li x28,2; \ - mfpcr a0,cr6; \ - li a1,27; \ + vxcptcause a0; \ + li a1,HWACHA_CAUSE_VF_ILLEGAL_REGID; \ + bne a0,a1,fail; \ + vxcptaux a0; \ + la a1,illegal ## testnum; \ bne a0,a1,fail; \ - mfpcr a0, cr2; \ - li a1, aux; \ - bne a0, a1, fail; \ vsetcfg 32,0; \ li a0,4; \ vsetvl a0,a0; \ @@ -679,7 +682,6 @@ handler ## testnum: \ li x28,5; \ bne a1,a2,fail; \ - #----------------------------------------------------------------------- # Pass and fail code (assumes test num is in x28) #----------------------------------------------------------------------- -- cgit v1.1