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
file annotate diff log raw
nkeynes@226
     1
.section .text
nkeynes@226
     2
.include "sh4/inc.s"
nkeynes@226
     3
!
nkeynes@226
     4
! Test AND #imm, R0 operation
nkeynes@226
     5
! Test AND #imm, @(r0,GBR)
nkeynes@226
     6
nkeynes@226
     7
.global _test_andi
nkeynes@226
     8
_test_andi:
nkeynes@226
     9
	start_test
nkeynes@226
    10
	
nkeynes@226
    11
test_andi_1:	! test and ff, 0
nkeynes@226
    12
	add #1, r12
nkeynes@226
    13
	xor r0, r0
nkeynes@226
    14
	xor r1, r1
nkeynes@226
    15
	and #255, r0
nkeynes@226
    16
	cmp/eq r0, r1
nkeynes@226
    17
	bt test_andi_2
nkeynes@226
    18
	fail test_andi_str_k
nkeynes@226
    19
nkeynes@226
    20
test_andi_2:	! test 0-extend
nkeynes@226
    21
	add #1, r12
nkeynes@226
    22
	mov.l test_andi_2_op1, r0
nkeynes@226
    23
	and #255, r0
nkeynes@226
    24
	mov.l test_andi_2_result, r4
nkeynes@226
    25
	cmp/eq r0, r4
nkeynes@226
    26
	bt test_andi_3
nkeynes@226
    27
	fail test_andi_str_k
nkeynes@226
    28
	bra test_andi_3
nkeynes@226
    29
	nop
nkeynes@226
    30
nkeynes@226
    31
test_andi_2_op1:
nkeynes@226
    32
	.long 0x98765432
nkeynes@226
    33
test_andi_2_result:
nkeynes@226
    34
	.long 0x00000032
nkeynes@226
    35
	
nkeynes@226
    36
test_andi_3:     ! Test single-bit AND
nkeynes@226
    37
	add #1, r12
nkeynes@226
    38
	mov.l test_andi_3_op1, r0
nkeynes@226
    39
	and #128, r0
nkeynes@226
    40
	mov.l test_andi_3_result, r3
nkeynes@226
    41
	cmp/eq r0, r3
nkeynes@226
    42
	bt test_andi_4
nkeynes@226
    43
	fail test_andi_str_k
nkeynes@226
    44
	bra test_andi_4
nkeynes@226
    45
	nop
nkeynes@226
    46
test_andi_3_op1:
nkeynes@226
    47
	.long 0x123456AB
nkeynes@226
    48
test_andi_3_result:
nkeynes@226
    49
	.long 0x00000080
nkeynes@226
    50
nkeynes@226
    51
test_andi_4:	! Test GBR version
nkeynes@226
    52
	add #1, r12
nkeynes@226
    53
	stc gbr, r4
nkeynes@226
    54
	mov.l test_andi_4_gbr, r0
nkeynes@226
    55
	ldc r0, gbr
nkeynes@226
    56
	mov.l test_andi_4_op1, r0
nkeynes@226
    57
	and.b #254, @(r0,gbr)
nkeynes@226
    58
	ldc r4, gbr
nkeynes@226
    59
	mov.l test_andi_4_output, r1
nkeynes@226
    60
	mov.l test_andi_4_result, r2
nkeynes@226
    61
	cmp/eq r1, r2
nkeynes@226
    62
	bt test_andi_5
nkeynes@226
    63
	fail test_andi_str_k
nkeynes@226
    64
	bra test_andi_5
nkeynes@226
    65
	nop
nkeynes@226
    66
test_andi_4_gbr:
nkeynes@226
    67
	.long test_andi_4_gbr
nkeynes@226
    68
test_andi_4_op1:
nkeynes@226
    69
	.long 0x00000008
nkeynes@226
    70
test_andi_4_output:
nkeynes@226
    71
	.long 0x123456AB
nkeynes@226
    72
test_andi_4_result:
nkeynes@226
    73
	.long 0x123456AA
nkeynes@226
    74
	
nkeynes@226
    75
test_andi_5:	
nkeynes@226
    76
test_andi_end:
nkeynes@226
    77
	end_test test_andi_str_k
nkeynes@226
    78
nkeynes@226
    79
test_andi_str:
nkeynes@226
    80
	.string "ANDi"
nkeynes@226
    81
nkeynes@226
    82
.align 4	
nkeynes@226
    83
test_andi_str_k:	
nkeynes@226
    84
	.long test_andi_str
nkeynes@226
    85
	
.