-Subproject commit 497efbd0fa104b70f058ea550ed0c7f8a554662b
+Subproject commit 286b047fbe29a7c54448c88dac025f78d38681a9
#define SEXT_IMM(x) ((x) | (-(((x) >> 11) & 1) << 11))
#define TEST_IMM_OP( testnum, inst, result, val1, imm ) \
- TEST_CASE( testnum, x3, result, \
+ TEST_CASE( testnum, x30, result, \
li x1, MASK_XLEN(val1); \
- inst x3, x1, SEXT_IMM(imm); \
+ inst x30, x1, SEXT_IMM(imm); \
)
#define TEST_IMM_SRC1_EQ_DEST( testnum, inst, result, val1, imm ) \
TEST_CASE( testnum, x6, result, \
li x4, 0; \
1: li x1, MASK_XLEN(val1); \
- inst x3, x1, SEXT_IMM(imm); \
+ inst x30, x1, SEXT_IMM(imm); \
TEST_INSERT_NOPS_ ## nop_cycles \
- addi x6, x3, 0; \
+ addi x6, x30, 0; \
addi x4, x4, 1; \
li x5, 2; \
bne x4, x5, 1b \
)
#define TEST_IMM_SRC1_BYPASS( testnum, nop_cycles, inst, result, val1, imm ) \
- TEST_CASE( testnum, x3, result, \
+ TEST_CASE( testnum, x30, result, \
li x4, 0; \
1: li x1, MASK_XLEN(val1); \
TEST_INSERT_NOPS_ ## nop_cycles \
- inst x3, x1, SEXT_IMM(imm); \
+ inst x30, x1, SEXT_IMM(imm); \
addi x4, x4, 1; \
li x5, 2; \
bne x4, x5, 1b \
#-----------------------------------------------------------------------
#define TEST_R_OP( testnum, inst, result, val1 ) \
- TEST_CASE( testnum, x3, result, \
+ TEST_CASE( testnum, x30, result, \
li x1, val1; \
- inst x3, x1; \
+ inst x30, x1; \
)
#define TEST_R_SRC1_EQ_DEST( testnum, inst, result, val1 ) \
TEST_CASE( testnum, x6, result, \
li x4, 0; \
1: li x1, val1; \
- inst x3, x1; \
+ inst x30, x1; \
TEST_INSERT_NOPS_ ## nop_cycles \
- addi x6, x3, 0; \
+ addi x6, x30, 0; \
addi x4, x4, 1; \
li x5, 2; \
bne x4, x5, 1b \
#-----------------------------------------------------------------------
#define TEST_RR_OP( testnum, inst, result, val1, val2 ) \
- TEST_CASE( testnum, x3, result, \
+ TEST_CASE( testnum, x30, result, \
li x1, MASK_XLEN(val1); \
li x2, MASK_XLEN(val2); \
- inst x3, x1, x2; \
+ inst x30, x1, x2; \
)
#define TEST_RR_SRC1_EQ_DEST( testnum, inst, result, val1, val2 ) \
li x4, 0; \
1: li x1, MASK_XLEN(val1); \
li x2, MASK_XLEN(val2); \
- inst x3, x1, x2; \
+ inst x30, x1, x2; \
TEST_INSERT_NOPS_ ## nop_cycles \
- addi x6, x3, 0; \
+ addi x6, x30, 0; \
addi x4, x4, 1; \
li x5, 2; \
bne x4, x5, 1b \
)
#define TEST_RR_SRC12_BYPASS( testnum, src1_nops, src2_nops, inst, result, val1, val2 ) \
- TEST_CASE( testnum, x3, result, \
+ TEST_CASE( testnum, x30, result, \
li x4, 0; \
1: li x1, MASK_XLEN(val1); \
TEST_INSERT_NOPS_ ## src1_nops \
li x2, MASK_XLEN(val2); \
TEST_INSERT_NOPS_ ## src2_nops \
- inst x3, x1, x2; \
+ inst x30, x1, x2; \
addi x4, x4, 1; \
li x5, 2; \
bne x4, x5, 1b \
)
#define TEST_RR_SRC21_BYPASS( testnum, src1_nops, src2_nops, inst, result, val1, val2 ) \
- TEST_CASE( testnum, x3, result, \
+ TEST_CASE( testnum, x30, result, \
li x4, 0; \
1: li x2, MASK_XLEN(val2); \
TEST_INSERT_NOPS_ ## src1_nops \
li x1, MASK_XLEN(val1); \
TEST_INSERT_NOPS_ ## src2_nops \
- inst x3, x1, x2; \
+ inst x30, x1, x2; \
addi x4, x4, 1; \
li x5, 2; \
bne x4, x5, 1b \
#-----------------------------------------------------------------------
#define TEST_LD_OP( testnum, inst, result, offset, base ) \
- TEST_CASE( testnum, x3, result, \
+ TEST_CASE( testnum, x30, result, \
la x1, base; \
- inst x3, offset(x1); \
+ inst x30, offset(x1); \
)
#define TEST_ST_OP( testnum, load_inst, store_inst, result, offset, base ) \
- TEST_CASE( testnum, x3, result, \
+ TEST_CASE( testnum, x30, result, \
la x1, base; \
li x2, result; \
store_inst x2, offset(x1); \
- load_inst x3, offset(x1); \
+ load_inst x30, offset(x1); \
)
#define TEST_LD_DEST_BYPASS( testnum, nop_cycles, inst, result, offset, base ) \
li TESTNUM, testnum; \
li x4, 0; \
1: la x1, base; \
- inst x3, offset(x1); \
+ inst x30, offset(x1); \
TEST_INSERT_NOPS_ ## nop_cycles \
- addi x6, x3, 0; \
+ addi x6, x30, 0; \
li x29, result; \
bne x6, x29, fail; \
addi x4, x4, 1; \
li x4, 0; \
1: la x1, base; \
TEST_INSERT_NOPS_ ## nop_cycles \
- inst x3, offset(x1); \
+ inst x30, offset(x1); \
li x29, result; \
- bne x3, x29, fail; \
+ bne x30, x29, fail; \
addi x4, x4, 1; \
li x5, 2; \
bne x4, x5, 1b \
la x2, base; \
TEST_INSERT_NOPS_ ## src2_nops \
store_inst x1, offset(x2); \
- load_inst x3, offset(x2); \
+ load_inst x30, offset(x2); \
li x29, result; \
- bne x3, x29, fail; \
+ bne x30, x29, fail; \
addi x4, x4, 1; \
li x5, 2; \
bne x4, x5, 1b \
li x1, result; \
TEST_INSERT_NOPS_ ## src2_nops \
store_inst x1, offset(x2); \
- load_inst x3, offset(x2); \
+ load_inst x30, offset(x2); \
li x29, result; \
- bne x3, x29, fail; \
+ bne x30, x29, fail; \
addi x4, x4, 1; \
li x5, 2; \
bne x4, x5, 1b \
nops ;\
fsgnj.s f3, f1, f1 ;\
fmv.x.d x4, f4 ;\
- fmv.x.s x3, f3 ;\
- beq x1, x3, 2f ;\
+ fmv.x.s x5, f3 ;\
+ beq x1, x5, 2f ;\
RVTEST_FAIL ;\
2:beq x2, x4, 2f ;\
RVTEST_FAIL; \
li TESTNUM, 2
li ra, 0
- jal x3, target_2
+ jal x4, target_2
linkaddr_2:
nop
nop
target_2:
la x2, linkaddr_2
- bne x2, x3, fail
+ bne x2, x4, fail
#-------------------------------------------------------------
# Test delay slot instructions not executed nor bypassed
# Test with a negative base
- TEST_CASE( 10, x3, 0xffffffffffffffff, \
+ TEST_CASE( 10, x5, 0xffffffffffffffff, \
la x1, tdat; \
addi x1, x1, -32; \
- lb x3, 32(x1); \
+ lb x5, 32(x1); \
)
# Test with unaligned base
- TEST_CASE( 11, x3, 0x0000000000000000, \
+ TEST_CASE( 11, x5, 0x0000000000000000, \
la x1, tdat; \
addi x1, x1, -6; \
- lb x3, 7(x1); \
+ lb x5, 7(x1); \
)
#-------------------------------------------------------------
#-------------------------------------------------------------
TEST_CASE( 18, x2, 2, \
- la x3, tdat; \
- lb x2, 0(x3); \
+ la x5, tdat; \
+ lb x2, 0(x5); \
li x2, 2; \
)
TEST_CASE( 19, x2, 2, \
- la x3, tdat; \
- lb x2, 0(x3); \
+ la x5, tdat; \
+ lb x2, 0(x5); \
nop; \
li x2, 2; \
)
# Test with a negative base
- TEST_CASE( 10, x3, 0x00000000000000ff, \
+ TEST_CASE( 10, x5, 0x00000000000000ff, \
la x1, tdat; \
addi x1, x1, -32; \
- lbu x3, 32(x1); \
+ lbu x5, 32(x1); \
)
# Test with unaligned base
- TEST_CASE( 11, x3, 0x0000000000000000, \
+ TEST_CASE( 11, x5, 0x0000000000000000, \
la x1, tdat; \
addi x1, x1, -6; \
- lbu x3, 7(x1); \
+ lbu x5, 7(x1); \
)
#-------------------------------------------------------------
#-------------------------------------------------------------
TEST_CASE( 18, x2, 2, \
- la x3, tdat; \
- lbu x2, 0(x3); \
+ la x5, tdat; \
+ lbu x2, 0(x5); \
li x2, 2; \
)
TEST_CASE( 19, x2, 2, \
- la x3, tdat; \
- lbu x2, 0(x3); \
+ la x5, tdat; \
+ lbu x2, 0(x5); \
nop; \
li x2, 2; \
)
# Test with a negative base
- TEST_CASE( 10, x3, 0x00ff00ff00ff00ff, \
+ TEST_CASE( 10, x5, 0x00ff00ff00ff00ff, \
la x1, tdat; \
addi x1, x1, -32; \
- ld x3, 32(x1); \
+ ld x5, 32(x1); \
)
# Test with unaligned base
- TEST_CASE( 11, x3, 0xff00ff00ff00ff00, \
+ TEST_CASE( 11, x5, 0xff00ff00ff00ff00, \
la x1, tdat; \
addi x1, x1, -3; \
- ld x3, 11(x1); \
+ ld x5, 11(x1); \
)
#-------------------------------------------------------------
#-------------------------------------------------------------
TEST_CASE( 18, x2, 2, \
- la x3, tdat; \
- ld x2, 0(x3); \
+ la x5, tdat; \
+ ld x2, 0(x5); \
li x2, 2; \
)
TEST_CASE( 19, x2, 2, \
- la x3, tdat; \
- ld x2, 0(x3); \
+ la x5, tdat; \
+ ld x2, 0(x5); \
nop; \
li x2, 2; \
)
# Test with a negative base
- TEST_CASE( 10, x3, 0x00000000000000ff, \
+ TEST_CASE( 10, x5, 0x00000000000000ff, \
la x1, tdat; \
addi x1, x1, -32; \
- lh x3, 32(x1); \
+ lh x5, 32(x1); \
)
# Test with unaligned base
- TEST_CASE( 11, x3, 0xffffffffffffff00, \
+ TEST_CASE( 11, x5, 0xffffffffffffff00, \
la x1, tdat; \
addi x1, x1, -5; \
- lh x3, 7(x1); \
+ lh x5, 7(x1); \
)
#-------------------------------------------------------------
#-------------------------------------------------------------
TEST_CASE( 18, x2, 2, \
- la x3, tdat; \
- lh x2, 0(x3); \
+ la x5, tdat; \
+ lh x2, 0(x5); \
li x2, 2; \
)
TEST_CASE( 19, x2, 2, \
- la x3, tdat; \
- lh x2, 0(x3); \
+ la x5, tdat; \
+ lh x2, 0(x5); \
nop; \
li x2, 2; \
)
# Test with a negative base
- TEST_CASE( 10, x3, 0x00000000000000ff, \
+ TEST_CASE( 10, x5, 0x00000000000000ff, \
la x1, tdat; \
addi x1, x1, -32; \
- lhu x3, 32(x1); \
+ lhu x5, 32(x1); \
)
# Test with unaligned base
- TEST_CASE( 11, x3, 0x000000000000ff00, \
+ TEST_CASE( 11, x5, 0x000000000000ff00, \
la x1, tdat; \
addi x1, x1, -5; \
- lhu x3, 7(x1); \
+ lhu x5, 7(x1); \
)
#-------------------------------------------------------------
#-------------------------------------------------------------
TEST_CASE( 18, x2, 2, \
- la x3, tdat; \
- lhu x2, 0(x3); \
+ la x5, tdat; \
+ lhu x2, 0(x5); \
li x2, 2; \
)
TEST_CASE( 19, x2, 2, \
- la x3, tdat; \
- lhu x2, 0(x3); \
+ la x5, tdat; \
+ lhu x2, 0(x5); \
nop; \
li x2, 2; \
)
# Test with a negative base
- TEST_CASE( 10, x3, 0x0000000000ff00ff, \
+ TEST_CASE( 10, x5, 0x0000000000ff00ff, \
la x1, tdat; \
addi x1, x1, -32; \
- lw x3, 32(x1); \
+ lw x5, 32(x1); \
)
# Test with unaligned base
- TEST_CASE( 11, x3, 0xffffffffff00ff00, \
+ TEST_CASE( 11, x5, 0xffffffffff00ff00, \
la x1, tdat; \
addi x1, x1, -3; \
- lw x3, 7(x1); \
+ lw x5, 7(x1); \
)
#-------------------------------------------------------------
#-------------------------------------------------------------
TEST_CASE( 18, x2, 2, \
- la x3, tdat; \
- lw x2, 0(x3); \
+ la x5, tdat; \
+ lw x2, 0(x5); \
li x2, 2; \
)
TEST_CASE( 19, x2, 2, \
- la x3, tdat; \
- lw x2, 0(x3); \
+ la x5, tdat; \
+ lw x2, 0(x5); \
nop; \
li x2, 2; \
)
# Test with a negative base
- TEST_CASE( 10, x3, 0x0000000000ff00ff, \
+ TEST_CASE( 10, x5, 0x0000000000ff00ff, \
la x1, tdat; \
addi x1, x1, -32; \
- lwu x3, 32(x1); \
+ lwu x5, 32(x1); \
)
# Test with unaligned base
- TEST_CASE( 11, x3, 0x00000000ff00ff00, \
+ TEST_CASE( 11, x5, 0x00000000ff00ff00, \
la x1, tdat; \
addi x1, x1, -3; \
- lwu x3, 7(x1); \
+ lwu x5, 7(x1); \
)
#-------------------------------------------------------------
#-------------------------------------------------------------
TEST_CASE( 18, x2, 2, \
- la x3, tdat; \
- lwu x2, 0(x3); \
+ la x5, tdat; \
+ lwu x2, 0(x5); \
li x2, 2; \
)
TEST_CASE( 19, x2, 2, \
- la x3, tdat; \
- lwu x2, 0(x3); \
+ la x5, tdat; \
+ lwu x2, 0(x5); \
nop; \
li x2, 2; \
)
# Test with a negative base
- TEST_CASE( 10, x3, 0x78, \
+ TEST_CASE( 10, x5, 0x78, \
la x1, tdat9; \
li x2, 0x12345678; \
addi x4, x1, -32; \
sb x2, 32(x4); \
- lb x3, 0(x1); \
+ lb x5, 0(x1); \
)
# Test with unaligned base
- TEST_CASE( 11, x3, 0xffffffffffffff98, \
+ TEST_CASE( 11, x5, 0xffffffffffffff98, \
la x1, tdat9; \
li x2, 0x00003098; \
addi x1, x1, -6; \
sb x2, 7(x1); \
la x4, tdat10; \
- lb x3, 0(x4); \
+ lb x5, 0(x4); \
)
#-------------------------------------------------------------
# Test with a negative base
- TEST_CASE( 10, x3, 0x1234567812345678, \
+ TEST_CASE( 10, x5, 0x1234567812345678, \
la x1, tdat9; \
li x2, 0x1234567812345678; \
addi x4, x1, -32; \
sd x2, 32(x4); \
- ld x3, 0(x1); \
+ ld x5, 0(x1); \
)
# Test with unaligned base
- TEST_CASE( 11, x3, 0x5821309858213098, \
+ TEST_CASE( 11, x5, 0x5821309858213098, \
la x1, tdat9; \
li x2, 0x5821309858213098; \
addi x1, x1, -3; \
sd x2, 11(x1); \
la x4, tdat10; \
- ld x3, 0(x4); \
+ ld x5, 0(x4); \
)
#-------------------------------------------------------------
# Test with a negative base
- TEST_CASE( 10, x3, 0x5678, \
+ TEST_CASE( 10, x5, 0x5678, \
la x1, tdat9; \
li x2, 0x12345678; \
addi x4, x1, -32; \
sh x2, 32(x4); \
- lh x3, 0(x1); \
+ lh x5, 0(x1); \
)
# Test with unaligned base
- TEST_CASE( 11, x3, 0x3098, \
+ TEST_CASE( 11, x5, 0x3098, \
la x1, tdat9; \
li x2, 0x00003098; \
addi x1, x1, -5; \
sh x2, 7(x1); \
la x4, tdat10; \
- lh x3, 0(x4); \
+ lh x5, 0(x4); \
)
#-------------------------------------------------------------
# Test with a negative base
- TEST_CASE( 10, x3, 0x12345678, \
+ TEST_CASE( 10, x5, 0x12345678, \
la x1, tdat9; \
li x2, 0x12345678; \
addi x4, x1, -32; \
sw x2, 32(x4); \
- lw x3, 0(x1); \
+ lw x5, 0(x1); \
)
# Test with unaligned base
- TEST_CASE( 11, x3, 0x58213098, \
+ TEST_CASE( 11, x5, 0x58213098, \
la x1, tdat9; \
li x2, 0x58213098; \
addi x1, x1, -3; \
sw x2, 7(x1); \
la x4, tdat10; \
- lw x3, 0(x4); \
+ lw x5, 0(x4); \
)
#-------------------------------------------------------------