I believe this is checking that if 1 is shifted 31 bits then this will be a negative for 32 bit and not negative for 64 bit lengths, and will branch if correct. If this is not correct then RVTEST_PASS is executed. I would expect this to be RVTEST_FAIL. A bug in an implementation meant that the code did not branch but then set the test 'passed' criteria and did the ecall. This gave a false positive. and was picked up because a smaller number of instructions were retired than expected.
The
RVTEST_CODE_BEGIN
macro, defined inriscv_test.h
uses macro theCHECK_XLEN
macro. This macro is defined as:I believe this is checking that if 1 is shifted 31 bits then this will be a negative for 32 bit and not negative for 64 bit lengths, and will branch if correct. If this is not correct then RVTEST_PASS is executed. I would expect this to be RVTEST_FAIL. A bug in an implementation meant that the code did not branch but then set the test 'passed' criteria and did the
ecall
. This gave a false positive. and was picked up because a smaller number of instructions were retired than expected.