Search
lxdream.org :: lxdream/test/sh4/andi.s
lxdream 0.9.1
released Jun 29
Download Now
filename test/sh4/andi.s
changeset 226:0eeeb25447d3
next228:70adc8ffa8d1
author nkeynes
date Sat Sep 23 10:35:29 2006 +0000 (14 years ago)
permissions -rw-r--r--
last change SH4 tests: Add tests for addc, addv, and
view annotate diff log raw
     1 .section .text
     2 .include "sh4/inc.s"
     3 !
     4 ! Test AND #imm, R0 operation
     5 ! Test AND #imm, @(r0,GBR)
     7 .global _test_andi
     8 _test_andi:
     9 	start_test
    11 test_andi_1:	! test and ff, 0
    12 	add #1, r12
    13 	xor r0, r0
    14 	xor r1, r1
    15 	and #255, r0
    16 	cmp/eq r0, r1
    17 	bt test_andi_2
    18 	fail test_andi_str_k
    20 test_andi_2:	! test 0-extend
    21 	add #1, r12
    22 	mov.l test_andi_2_op1, r0
    23 	and #255, r0
    24 	mov.l test_andi_2_result, r4
    25 	cmp/eq r0, r4
    26 	bt test_andi_3
    27 	fail test_andi_str_k
    28 	bra test_andi_3
    29 	nop
    31 test_andi_2_op1:
    32 	.long 0x98765432
    33 test_andi_2_result:
    34 	.long 0x00000032
    36 test_andi_3:     ! Test single-bit AND
    37 	add #1, r12
    38 	mov.l test_andi_3_op1, r0
    39 	and #128, r0
    40 	mov.l test_andi_3_result, r3
    41 	cmp/eq r0, r3
    42 	bt test_andi_4
    43 	fail test_andi_str_k
    44 	bra test_andi_4
    45 	nop
    46 test_andi_3_op1:
    47 	.long 0x123456AB
    48 test_andi_3_result:
    49 	.long 0x00000080
    51 test_andi_4:	! Test GBR version
    52 	add #1, r12
    53 	stc gbr, r4
    54 	mov.l test_andi_4_gbr, r0
    55 	ldc r0, gbr
    56 	mov.l test_andi_4_op1, r0
    57 	and.b #254, @(r0,gbr)
    58 	ldc r4, gbr
    59 	mov.l test_andi_4_output, r1
    60 	mov.l test_andi_4_result, r2
    61 	cmp/eq r1, r2
    62 	bt test_andi_5
    63 	fail test_andi_str_k
    64 	bra test_andi_5
    65 	nop
    66 test_andi_4_gbr:
    67 	.long test_andi_4_gbr
    68 test_andi_4_op1:
    69 	.long 0x00000008
    70 test_andi_4_output:
    71 	.long 0x123456AB
    72 test_andi_4_result:
    73 	.long 0x123456AA
    75 test_andi_5:	
    76 test_andi_end:
    77 	end_test test_andi_str_k
    79 test_andi_str:
    80 	.string "ANDi"
    82 .align 4	
    83 test_andi_str_k:	
    84 	.long test_andi_str
.