Tests for extsb, extsh, extsw.

This commit is contained in:
gibbed 2015-05-14 15:56:25 -05:00
parent a5483ced29
commit cfaa72cae6
3 changed files with 397 additions and 0 deletions

View File

@ -0,0 +1,129 @@
test_extsb_1:
#_ REGISTER_IN r4 0x0F
extsb r3, r4
blr
#_ REGISTER_OUT r3 0x0F
#_ REGISTER_OUT r4 0x0F
test_extsb_1_constant:
li r4, 0x0F
extsb r3, r4
blr
#_ REGISTER_OUT r3 0x0F
#_ REGISTER_OUT r4 0x0F
test_extsb_2:
#_ REGISTER_IN r4 0x7F
extsb r3, r4
blr
#_ REGISTER_OUT r3 0x7F
#_ REGISTER_OUT r4 0x7F
test_extsb_2_constant:
li r4, 0x7F
extsb r3, r4
blr
#_ REGISTER_OUT r3 0x7F
#_ REGISTER_OUT r4 0x7F
test_extsb_3:
#_ REGISTER_IN r4 0x80
extsb r3, r4
blr
#_ REGISTER_OUT r3 0xFFFFFFFFFFFFFF80
#_ REGISTER_OUT r4 0x80
test_extsb_3_constant:
li r4, 0x80
extsb r3, r4
blr
#_ REGISTER_OUT r3 0xFFFFFFFFFFFFFF80
#_ REGISTER_OUT r4 0x80
test_extsb_4:
#_ REGISTER_IN r4 0xFFFFFFFFFFFFF080
extsb r3, r4
blr
#_ REGISTER_OUT r3 0xFFFFFFFFFFFFFF80
#_ REGISTER_OUT r4 0xFFFFFFFFFFFFF080
test_extsb_4_constant:
li r4, 0xF7F
not r4, r4
extsb r3, r4
blr
#_ REGISTER_OUT r3 0xFFFFFFFFFFFFFF80
#_ REGISTER_OUT r4 0xFFFFFFFFFFFFF080
test_extsb_cr_1:
#_ REGISTER_IN r4 0x0F
extsb. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0x0F
#_ REGISTER_OUT r4 0x0F
#_ REGISTER_OUT r12 0x40000000
test_extsb_cr_1_constant:
li r4, 0x0F
extsb. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0x0F
#_ REGISTER_OUT r4 0x0F
#_ REGISTER_OUT r12 0x40000000
test_extsb_cr_2:
#_ REGISTER_IN r4 0x7F
extsb. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0x7F
#_ REGISTER_OUT r4 0x7F
#_ REGISTER_OUT r12 0x40000000
test_extsb_cr_2_constant:
li r4, 0x7F
extsb. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0x7F
#_ REGISTER_OUT r4 0x7F
#_ REGISTER_OUT r12 0x40000000
test_extsb_cr_3:
#_ REGISTER_IN r4 0x80
extsb. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0xFFFFFFFFFFFFFF80
#_ REGISTER_OUT r4 0x80
#_ REGISTER_OUT r12 0x80000000
test_extsb_cr_3_constant:
li r4, 0x80
extsb. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0xFFFFFFFFFFFFFF80
#_ REGISTER_OUT r4 0x80
#_ REGISTER_OUT r12 0x80000000
test_extsb_cr_4:
#_ REGISTER_IN r4 0xFFFFFFFFFFFFF080
extsb. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0xFFFFFFFFFFFFFF80
#_ REGISTER_OUT r4 0xFFFFFFFFFFFFF080
#_ REGISTER_OUT r12 0x80000000
test_extsb_cr_4_constant:
li r4, 0xF7F
not r4, r4
extsb. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0xFFFFFFFFFFFFFF80
#_ REGISTER_OUT r4 0xFFFFFFFFFFFFF080
#_ REGISTER_OUT r12 0x80000000

View File

@ -0,0 +1,133 @@
test_extsh_1:
#_ REGISTER_IN r4 0x0F
extsh r3, r4
blr
#_ REGISTER_OUT r3 0x0F
#_ REGISTER_OUT r4 0x0F
test_extsh_1_constant:
li r4, 0x0F
extsh r3, r4
blr
#_ REGISTER_OUT r3 0x0F
#_ REGISTER_OUT r4 0x0F
test_extsh_2:
#_ REGISTER_IN r4 0x7FFF
extsh r3, r4
blr
#_ REGISTER_OUT r3 0x7FFF
#_ REGISTER_OUT r4 0x7FFF
test_extsh_2_constant:
li r4, 0x7FFF
extsh r3, r4
blr
#_ REGISTER_OUT r3 0x7FFF
#_ REGISTER_OUT r4 0x7FFF
test_extsh_3:
#_ REGISTER_IN r4 0x8000
extsh r3, r4
blr
#_ REGISTER_OUT r3 0xFFFFFFFFFFFF8000
#_ REGISTER_OUT r4 0x8000
test_extsh_3_constant:
li r4, 0x80
sldi r4, r4, 8
extsh r3, r4
blr
#_ REGISTER_OUT r3 0xFFFFFFFFFFFF8000
#_ REGISTER_OUT r4 0x8000
test_extsh_4:
#_ REGISTER_IN r4 0xFFFFFFFFFFF08000
extsh r3, r4
blr
#_ REGISTER_OUT r3 0xFFFFFFFFFFFF8000
#_ REGISTER_OUT r4 0xFFFFFFFFFFF08000
test_extsh_4_constant:
li r4, 0xF7F
not r4, r4
sldi r4, r4, 8
extsh r3, r4
blr
#_ REGISTER_OUT r3 0xFFFFFFFFFFFF8000
#_ REGISTER_OUT r4 0xFFFFFFFFFFF08000
test_extsh_cr_1:
#_ REGISTER_IN r4 0x0F
extsh. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0x0F
#_ REGISTER_OUT r4 0x0F
#_ REGISTER_OUT r12 0x40000000
test_extsh_cr_1_constant:
li r4, 0x0F
extsh. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0x0F
#_ REGISTER_OUT r4 0x0F
#_ REGISTER_OUT r12 0x40000000
test_extsh_cr_2:
#_ REGISTER_IN r4 0x7FFF
extsh. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0x7FFF
#_ REGISTER_OUT r4 0x7FFF
#_ REGISTER_OUT r12 0x40000000
test_extsh_cr_2_constant:
li r4, 0x7FFF
extsh. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0x7FFF
#_ REGISTER_OUT r4 0x7FFF
#_ REGISTER_OUT r12 0x40000000
test_extsh_cr_3:
#_ REGISTER_IN r4 0x8000
extsh. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0xFFFFFFFFFFFF8000
#_ REGISTER_OUT r4 0x8000
#_ REGISTER_OUT r12 0x80000000
test_extsh_cr_3_constant:
li r4, 0x80
sldi r4, r4, 8
extsh. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0xFFFFFFFFFFFF8000
#_ REGISTER_OUT r4 0x8000
#_ REGISTER_OUT r12 0x80000000
test_extsh_cr_4:
#_ REGISTER_IN r4 0xFFFFFFFFFFF08000
extsh. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0xFFFFFFFFFFFF8000
#_ REGISTER_OUT r4 0xFFFFFFFFFFF08000
#_ REGISTER_OUT r12 0x80000000
test_extsh_cr_4_constant:
li r4, 0xF7F
not r4, r4
sldi r4, r4, 8
extsh. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0xFFFFFFFFFFFF8000
#_ REGISTER_OUT r4 0xFFFFFFFFFFF08000
#_ REGISTER_OUT r12 0x80000000

View File

@ -0,0 +1,135 @@
test_extsw_1:
#_ REGISTER_IN r4 0x0F
extsw r3, r4
blr
#_ REGISTER_OUT r3 0x0F
#_ REGISTER_OUT r4 0x0F
test_extsw_1_constant:
li r4, 0x0F
extsw r3, r4
blr
#_ REGISTER_OUT r3 0x0F
#_ REGISTER_OUT r4 0x0F
test_extsw_2:
#_ REGISTER_IN r4 0x7FFFFFFF
extsw r3, r4
blr
#_ REGISTER_OUT r3 0x7FFFFFFF
#_ REGISTER_OUT r4 0x7FFFFFFF
test_extsw_2_constant:
lis r4, 0x7FFF
ori r4, r4, 0xFFFF
extsw r3, r4
blr
#_ REGISTER_OUT r3 0x7FFFFFFF
#_ REGISTER_OUT r4 0x7FFFFFFF
test_extsw_3:
#_ REGISTER_IN r4 0x80000000
extsw r3, r4
blr
#_ REGISTER_OUT r3 0xFFFFFFFF80000000
#_ REGISTER_OUT r4 0x80000000
test_extsw_3_constant:
li r4, 0x80
sldi r4, r4, 24
extsw r3, r4
blr
#_ REGISTER_OUT r3 0xFFFFFFFF80000000
#_ REGISTER_OUT r4 0x80000000
test_extsw_4:
#_ REGISTER_IN r4 0xFFFFFFF080000000
extsw r3, r4
blr
#_ REGISTER_OUT r3 0xFFFFFFFF80000000
#_ REGISTER_OUT r4 0xFFFFFFF080000000
test_extsw_4_constant:
li r4, 0xF7F
not r4, r4
sldi r4, r4, 24
extsw r3, r4
blr
#_ REGISTER_OUT r3 0xFFFFFFFF80000000
#_ REGISTER_OUT r4 0xFFFFFFF080000000
test_extsw_cr_1:
#_ REGISTER_IN r4 0x0F
extsw. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0x0F
#_ REGISTER_OUT r4 0x0F
#_ REGISTER_OUT r12 0x40000000
test_extsw_cr_1_constant:
li r4, 0x0F
extsw. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0x0F
#_ REGISTER_OUT r4 0x0F
#_ REGISTER_OUT r12 0x40000000
test_extsw_cr_2:
#_ REGISTER_IN r4 0x7FFFFFFF
extsw. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0x7FFFFFFF
#_ REGISTER_OUT r4 0x7FFFFFFF
#_ REGISTER_OUT r12 0x40000000
test_extsw_cr_2_constant:
lis r4, 0x7FFF
ori r4, r4, 0xFFFF
extsw. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0x7FFFFFFF
#_ REGISTER_OUT r4 0x7FFFFFFF
#_ REGISTER_OUT r12 0x40000000
test_extsw_cr_3:
#_ REGISTER_IN r4 0x80000000
extsw. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0xFFFFFFFF80000000
#_ REGISTER_OUT r4 0x80000000
#_ REGISTER_OUT r12 0x80000000
test_extsw_cr_3_constant:
li r4, 0x80
sldi r4, r4, 24
extsw. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0xFFFFFFFF80000000
#_ REGISTER_OUT r4 0x80000000
#_ REGISTER_OUT r12 0x80000000
test_extsw_cr_4:
#_ REGISTER_IN r4 0xFFFFFFF080000000
extsw. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0xFFFFFFFF80000000
#_ REGISTER_OUT r4 0xFFFFFFF080000000
#_ REGISTER_OUT r12 0x80000000
test_extsw_cr_4_constant:
li r4, 0xF7F
not r4, r4
sldi r4, r4, 24
extsw. r3, r4
mfcr r12
blr
#_ REGISTER_OUT r3 0xFFFFFFFF80000000
#_ REGISTER_OUT r4 0xFFFFFFF080000000
#_ REGISTER_OUT r12 0x80000000