Small test case fixes for floating points

This commit is contained in:
dingusdev 2021-10-16 22:33:56 -07:00
parent 00dd99d851
commit 3c7fc58ac0
3 changed files with 1628 additions and 1629 deletions

View File

@ -513,7 +513,7 @@ if __name__ == "__main__":
out_file.write(",FPSCR=" + line[pos+3:pos+13])
checkstring = ''
if ("CR" in checkstring):
out_file.write(",CR=" + line[pos+3:pos+14])
out_file.write(",CR=0x0" + line[pos+6:pos+14])
checkstring = ''
pos += 1

File diff suppressed because it is too large Load Diff

View File

@ -224,7 +224,7 @@ static void read_test_float_data() {
exit(0);
}
} else if (tokens[i].rfind("FPSCR=", 0) == 0) {
check_cr = stoul(tokens[i].substr(6), NULL, 16);
check_fpscr = stoul(tokens[i].substr(6), NULL, 16);
} else if (tokens[i].rfind("CR=", 0) == 0) {
check_cr = stoul(tokens[i].substr(3), NULL, 16);
} else {
@ -241,7 +241,6 @@ static void read_test_float_data() {
ppc_state.fpr[4].dbl64_r = dfp_src2;
ppc_state.fpr[5].dbl64_r = dfp_src3;
ppc_state.spr[SPR::XER] = 0;
ppc_state.cr = 0;
ppc_cur_instruction = opcode;
@ -253,8 +252,8 @@ static void read_test_float_data() {
if ((tokens[0].rfind("FCMP") && (ppc_state.fpr[3].dbl64_r != dfp_dest)) ||
(ppc_state.fpscr != check_fpscr) ||
(ppc_state.cr != check_cr)) {
cout << "Mismatch: instr=" << tokens[0] << ", src1=0x" << scientific << dfp_src1 << ", src2=0x" << scientific << dfp_src2 << ", src3=0x" << scientific << dfp_src3 << endl;
cout << "expected: dest=0x" << hex << dfp_dest << ", FPSCR=0x" << hex << check_xer
cout << "Mismatch: instr=" << tokens[0] << ", src1=" << scientific << dfp_src1 << ", src2=" << scientific << dfp_src2 << ", src3=" << scientific << dfp_src3 << endl;
cout << "expected: dest=0x" << hex << dfp_dest << ", FPSCR=0x" << hex << check_fpscr
<< ", CR=0x"
<< hex << check_cr << endl;
cout << "got: dest=0x" << hex << ppc_state.fpr[3].dbl64_r << ", FPSCR=0x" << hex