From 95b6f0ac46816d3c0a3f1073a533f17afc7df0fa Mon Sep 17 00:00:00 2001 From: gibbed Date: Thu, 14 May 2015 15:30:35 -0500 Subject: [PATCH] Tests for cmpi. --- src/xenia/cpu/frontend/test/instr_cmpi.s | 116 +++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 src/xenia/cpu/frontend/test/instr_cmpi.s diff --git a/src/xenia/cpu/frontend/test/instr_cmpi.s b/src/xenia/cpu/frontend/test/instr_cmpi.s new file mode 100644 index 000000000..19f94afbb --- /dev/null +++ b/src/xenia/cpu/frontend/test/instr_cmpi.s @@ -0,0 +1,116 @@ +test_cmpdi_1: + #_ REGISTER_IN r3 0x0000000100000000 + cmpdi r3, 2 + mfcr r12 + blr + #_ REGISTER_OUT r3 0x0000000100000000 + #_ REGISTER_OUT r12 0x40000000 + +test_cmpdi_1_constant: + li r3, 1 + sldi r3, r3, 32 + cmpdi r3, 2 + mfcr r12 + blr + #_ REGISTER_OUT r3 0x0000000100000000 + #_ REGISTER_OUT r12 0x40000000 + +test_cmpdi_2: + #_ REGISTER_IN r3 1 + cmpdi r3, 2 + mfcr r12 + blr + #_ REGISTER_OUT r3 1 + #_ REGISTER_OUT r12 0x80000000 + +test_cmpdi_2_constant: + li r3, 1 + cmpdi r3, 2 + mfcr r12 + blr + #_ REGISTER_OUT r3 1 + #_ REGISTER_OUT r12 0x80000000 + +test_cmpwi_1: + #_ REGISTER_IN r3 0x0000000100000000 + cmpwi r3, 2 + mfcr r12 + blr + #_ REGISTER_OUT r3 0x0000000100000000 + #_ REGISTER_OUT r12 0x80000000 + +test_cmpwi_1_constant: + li r3, 1 + sldi r3, r3, 32 + cmpwi r3, 2 + mfcr r12 + blr + #_ REGISTER_OUT r3 0x0000000100000000 + #_ REGISTER_OUT r12 0x80000000 + +test_cmpwi_2: + #_ REGISTER_IN r3 2 + cmpwi r3, 1 + mfcr r12 + blr + #_ REGISTER_OUT r3 2 + #_ REGISTER_OUT r12 0x40000000 + +test_cmpwi_2_constant: + li r3, 2 + cmpwi r3, 1 + mfcr r12 + blr + #_ REGISTER_OUT r3 2 + #_ REGISTER_OUT r12 0x40000000 + +test_cmpwi_5: + #_ REGISTER_IN r3 0x0000000100000002 + cmpwi r3, 1 + mfcr r12 + blr + #_ REGISTER_OUT r3 0x0000000100000002 + #_ REGISTER_OUT r12 0x40000000 + +test_cmpwi_5_constant: + li r3, 1 + sldi r3, r3, 32 + sldi r4, r3, 1 + addi r3, r3, 2 + cmpwi r3, 1 + mfcr r12 + blr + #_ REGISTER_OUT r3 0x0000000100000002 + #_ REGISTER_OUT r12 0x40000000 + +test_cmpi_1: + #_ REGISTER_IN r3 1 + cmpi 5, 0, r3, 2 + mfcr r12 + blr + #_ REGISTER_OUT r3 1 + #_ REGISTER_OUT r12 0x00000800 + +test_cmpi_1_constant: + li r3, 1 + cmpi 5, 0, r3, 2 + mfcr r12 + blr + #_ REGISTER_OUT r3 1 + #_ REGISTER_OUT r12 0x00000800 + +test_cmpi_2: + #_ REGISTER_IN r3 2 + cmpi 3, 0, r3, 1 + mfcr r12 + blr + #_ REGISTER_OUT r3 2 + #_ REGISTER_OUT r12 0x00040000 + +test_cmpi_2_constant: + li r3, 2 + cmpi 3, 0, r3, 1 + mfcr r12 + blr + #_ REGISTER_OUT r3 2 + #_ REGISTER_OUT r12 0x00040000