From 19e733cff73aff80f8613088b70a36fe7344300a Mon Sep 17 00:00:00 2001 From: gibbed Date: Tue, 12 May 2015 01:19:56 -0500 Subject: [PATCH] Added constant tests for cntlzd and cntlzw. --- src/xenia/cpu/frontend/test/instr_cntlzd.s | 31 +++++++++++++++++++++ src/xenia/cpu/frontend/test/instr_cntlzw.s | 32 ++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/src/xenia/cpu/frontend/test/instr_cntlzd.s b/src/xenia/cpu/frontend/test/instr_cntlzd.s index a95abf431..c97b61aad 100644 --- a/src/xenia/cpu/frontend/test/instr_cntlzd.s +++ b/src/xenia/cpu/frontend/test/instr_cntlzd.s @@ -5,6 +5,13 @@ test_cntlzd_1: #_ REGISTER_OUT r5 0 #_ REGISTER_OUT r6 64 +test_cntlzd_1_constant: + li r5, 0 + cntlzd r6, r5 + blr + #_ REGISTER_OUT r5 0 + #_ REGISTER_OUT r6 64 + test_cntlzd_2: #_ REGISTER_IN r5 1 cntlzd r6, r5 @@ -12,6 +19,13 @@ test_cntlzd_2: #_ REGISTER_OUT r5 1 #_ REGISTER_OUT r6 63 +test_cntlzd_2_constant: + li r5, 1 + cntlzd r6, r5 + blr + #_ REGISTER_OUT r5 1 + #_ REGISTER_OUT r6 63 + test_cntlzd_3: #_ REGISTER_IN r5 0xFFFFFFFFFFFFFFFF cntlzd r6, r5 @@ -19,9 +33,26 @@ test_cntlzd_3: #_ REGISTER_OUT r5 0xFFFFFFFFFFFFFFFF #_ REGISTER_OUT r6 0 +test_cntlzd_3_constant: + li r5, 0 + not r5, r5 + cntlzd r6, r5 + blr + #_ REGISTER_OUT r5 0xFFFFFFFFFFFFFFFF + #_ REGISTER_OUT r6 0 + test_cntlzd_4: #_ REGISTER_IN r5 0x7FFFFFFFFFFFFFFF cntlzd r6, r5 blr #_ REGISTER_OUT r5 0x7FFFFFFFFFFFFFFF #_ REGISTER_OUT r6 1 + +test_cntlzd_4_constant: + li r5, 0 + not r5, r5 + srdi r5, r5, 1 + cntlzd r6, r5 + blr + #_ REGISTER_OUT r5 0x7FFFFFFFFFFFFFFF + #_ REGISTER_OUT r6 1 diff --git a/src/xenia/cpu/frontend/test/instr_cntlzw.s b/src/xenia/cpu/frontend/test/instr_cntlzw.s index 5174aaf82..e3229aa02 100644 --- a/src/xenia/cpu/frontend/test/instr_cntlzw.s +++ b/src/xenia/cpu/frontend/test/instr_cntlzw.s @@ -5,6 +5,13 @@ test_cntlzw_1: #_ REGISTER_OUT r5 0 #_ REGISTER_OUT r6 32 +test_cntlzw_1_constant: + li r5, 0 + cntlzw r6, r5 + blr + #_ REGISTER_OUT r5 0 + #_ REGISTER_OUT r6 32 + test_cntlzw_2: #_ REGISTER_IN r5 1 cntlzw r6, r5 @@ -12,6 +19,13 @@ test_cntlzw_2: #_ REGISTER_OUT r5 1 #_ REGISTER_OUT r6 31 +test_cntlzw_2_constant: + li r5, 1 + cntlzw r6, r5 + blr + #_ REGISTER_OUT r5 1 + #_ REGISTER_OUT r6 31 + test_cntlzw_3: #_ REGISTER_IN r5 0xFFFFFFFF cntlzw r6, r5 @@ -19,9 +33,27 @@ test_cntlzw_3: #_ REGISTER_OUT r5 0xFFFFFFFF #_ REGISTER_OUT r6 0 +test_cntlzw_3_constant: + li r5, 0 + not r5, r5 + srwi r5, r5, 0 + cntlzw r6, r5 + blr + #_ REGISTER_OUT r5 0xFFFFFFFF + #_ REGISTER_OUT r6 0 + test_cntlzw_4: #_ REGISTER_IN r5 0x7FFFFFFF cntlzw r6, r5 blr #_ REGISTER_OUT r5 0x7FFFFFFF #_ REGISTER_OUT r6 1 + +test_cntlzw_4_constant: + li r5, 0 + not r5, r5 + srwi r5, r5, 1 + cntlzw r6, r5 + blr + #_ REGISTER_OUT r5 0x7FFFFFFF + #_ REGISTER_OUT r6 1