.option push
.option norvc
- li a2, 0
- li a3, 0
- li a4, 0
+ li a2, 0
+ li a3, 0
+ li a4, 0
+
+ SET_SV_MVL(3)
+ SET_SV_2CSRS( SV_REG_CSR(1, 12, 0, 12, 1),
+ SV_REG_CSR(1, 2, 0, 28, 1) )
+ SET_SV_VL(3)
+
+ # store addr of data in x28 because CSR redirects x2 to x28
+ # and c.lwsp is an element-offset (if isvec=true that is)
+ la x28, data;
+
+ .option push;
+ .option rvc;
+ .align 2;
+ c.lwsp a2, 0(sp); # SP is actually redirected to x28!
+ .option pop
+
+
+ SET_SV_VL(1)
+ CLR_SV_CSRS()
+ SET_SV_MVL(1)
+
+ TEST_SV_IMM(a2, 1001)
+ TEST_SV_IMM(a3, 1002)
+ TEST_SV_IMM(a4, 1005)
+
+ .option pop
+
+ .align 2
+ .option push
+ .option norvc
+
+ li a2, 0
+ li a3, 0
+ li a4, 0
SET_SV_MVL(3)
SET_SV_2CSRS( SV_REG_CSR(1, 12, 0, 12, 1),
la sp, data;
.option push;
- .option rvc;
- .align 2;
+ .option rvc;
+ .align 2;
c.lwsp a2, 0(sp);
#lw a2, 0(sp);
.option pop
mv sp, a1
- TEST_SV_IMM(a2, 1001)
+ TEST_SV_IMM(a2, 1001)
TEST_SV_IMM(a3, 1002)
TEST_SV_IMM(a4, 1005)
RVTEST_RV64U
RVTEST_CODE_BEGIN
+ .align 2
+ .option push
+ .option norvc
+
+ li a2, 1000;
+ li a3, 1001;
+ li a4, 1004;
+
+ SET_SV_MVL(3)
+ SET_SV_2CSRS( SV_REG_CSR(1, 12, 0, 12, 1),
+ SV_REG_CSR(1, 2, 0, 28, 1) )
+ SET_SV_VL(3)
+
+ # CSR redirects SP (x2) to x28
+ la x28, data;
+
+ .option push;
+ .option rvc;
+ .align 2;
+ c.swsp a2, 0(sp); # not SP, actually x28!
+ .option pop
+
+
+ SET_SV_VL(1)
+ CLR_SV_CSRS()
+ SET_SV_MVL(1)
+
+ la a2, data;
+ lw a4, 0(a2);
+ lw a5, 4(a2);
+ lw a6, 8(a2);
+
+ TEST_SV_IMM(a4, 1000)
+ TEST_SV_IMM(a5, 1001)
+ TEST_SV_IMM(a6, 1004)
+
+ .option pop
+
.align 2
.option push
.option norvc
la sp, data;
.option push;
- .option rvc;
- .align 2;
+ .option rvc;
+ .align 2;
c.swsp a2, 0(sp);
#lw a2, 0(sp);
.option pop
lw a5, 4(a2);
lw a6, 8(a2);
- TEST_SV_IMM(a4, 1000)
+ TEST_SV_IMM(a4, 1000)
TEST_SV_IMM(a5, 1001)
TEST_SV_IMM(a6, 1004)