Search
lxdream.org :: lxdream/test/sh4/tas.s
lxdream 0.9.1
released Jun 29
Download Now
filename test/sh4/tas.s
changeset 399:23e51a2b4f99
author nkeynes
date Mon Oct 08 12:09:06 2007 +0000 (16 years ago)
permissions -rw-r--r--
last change Fix compilation warnings
view annotate diff log raw
     1 .section .text
     2 .include "sh4/inc.s"
     4 .global _test_tas
     5 _test_tas:
     6 	start_test
     8 test_tas_1:
     9 	add #1, r12
    11 	mova test_tas_1_data, r0  ! test with byte == 0
    12 	mov r0, r4
    13 	mov r4, r5
    14 	tas.b @r4
    15 	bf test_tas_1_fail
    16 	cmp/eq r4, r5
    17 	bf test_tas_1_fail
    18 	mov #0x40, r1
    19 	shll r1
    20 	mov.l test_tas_1_data, r3
    21 	cmp/eq r1, r3
    22 	bt test_tas_2
    24 test_tas_1_fail:
    25 	fail test_tas_str_k
    26 	bra test_tas_2
    27 	nop
    28 test_tas_1_data:
    29 	.long 0x00000000
    31 test_tas_2:	
    32 	add #1, r12
    34 	mova test_tas_2_data, r0  ! test with byte == 0x80
    35 	mov r0, r4
    36 	mov r4, r5
    37 	tas.b @r4                  ! follow up test with byte == 0x00000080
    38 	bt test_tas_2_fail
    39 	cmp/eq r4, r5
    40 	bf test_tas_2_fail
    41 	mov.l @r4, r3
    42 	mov #0x40, r1
    43 	shll r1
    44 	cmp/eq r1, r3
    45 	bt test_tas_3
    46 test_tas_2_fail:
    47 	fail test_tas_str_k
    48 	bra test_tas_3
    49 	nop
    50 test_tas_2_data:
    51 	.long 0x00000080
    53 test_tas_3:	 ! Test with byte = 0x45 (ensure existing bits aren't changed)
    54 	add #1, r12
    55 	mova test_tas_3_data, r0
    56 	mov r0, r4
    57 	mov.l test_tas_3_result, r1
    58 	mov r4, r5
    59 	tas.b @r4
    60 	bt test_tas_3_fail
    61 	cmp/eq r4,r5
    62 	bf test_tas_3_fail
    63 	mov.l test_tas_3_data, r3
    64 	cmp/eq r1, r3
    65 	bt test_tas_4
    67 test_tas_3_fail:
    68 	fail test_tas_str_k
    69 	bra test_tas_4
    70 	nop
    71 test_tas_3_data:
    72 	.long 0x00000045
    73 test_tas_3_result:
    74 	.long 0x000000C5
    76 test_tas_4:	 ! Test that it's really a byte op
    77 	add #1, r12
    78 	mova test_tas_4_data, r0
    79 	mov r0, r4
    80 	mov.l test_tas_4_result, r1
    81 	add #1, r4
    82 	mov r4, r5
    83 	tas.b @r4
    84 	bf test_tas_4_fail
    85 	cmp/eq r4, r5
    86 	mov.l test_tas_4_data, r3
    87 	cmp/eq r1, r3
    88 	bt test_tas_end
    89 test_tas_4_fail:
    90 	fail test_tas_str_k
    91 	bra test_tas_end
    92 	nop
    93 test_tas_4_data:
    94 	.long 0xAB9C00ED
    95 test_tas_4_result:
    96 	.long 0xAB9C80ED
    98 test_tas_end:
    99 	end_test test_tas_str_k
   101 test_tas_str:
   102 	.string "TAS"
   104 .align 4	
   105 test_tas_str_k:	
   106 	.long test_tas_str
.