Search
lxdream.org :: lxdream/test/sh4/bf.s
lxdream 0.9.1
released Jun 29
Download Now
filename test/sh4/bf.s
changeset 872:a3041742bb7d
prev231:a9e61a96a885
author nkeynes
date Tue Oct 14 06:52:06 2008 +0000 (13 years ago)
permissions -rw-r--r--
last change Fix CLRS/SETS - These kill the carry value, they don't set it.
file annotate diff log raw
nkeynes@228
     1
.section .text
nkeynes@228
     2
.include "sh4/inc.s"
nkeynes@228
     3
!
nkeynes@228
     4
! Test bf pcrel
nkeynes@228
     5
! Test bf/s pcrel
nkeynes@228
     6
nkeynes@228
     7
.global _test_bf
nkeynes@228
     8
_test_bf:
nkeynes@228
     9
	start_test
nkeynes@228
    10
	
nkeynes@228
    11
test_bf_1:   ! Test branch not taken
nkeynes@228
    12
	add #1, r12
nkeynes@228
    13
	setc
nkeynes@228
    14
	bf test_bf_1_b
nkeynes@228
    15
	bra test_bf_2
nkeynes@228
    16
	nop
nkeynes@228
    17
test_bf_1_b:
nkeynes@228
    18
	fail test_bf_str_k
nkeynes@228
    19
	
nkeynes@228
    20
test_bf_2:	! Test branch taken
nkeynes@228
    21
	add #1, r12
nkeynes@228
    22
	clc
nkeynes@228
    23
	bf test_bf_3
nkeynes@228
    24
	fail test_bf_str_k
nkeynes@228
    25
nkeynes@228
    26
test_bf_3:	! Test branch taken (backwards)
nkeynes@228
    27
	add #1, r12
nkeynes@228
    28
	clc
nkeynes@228
    29
	bra test_bf_3_b
nkeynes@228
    30
	nop
nkeynes@228
    31
	fail test_bf_str_k
nkeynes@228
    32
	bra test_bf_4
nkeynes@228
    33
test_bf_3_c:	
nkeynes@228
    34
	nop
nkeynes@228
    35
	bra test_bf_4
nkeynes@228
    36
	nop
nkeynes@228
    37
	fail test_bf_str_k
nkeynes@228
    38
	bra test_bf_4
nkeynes@228
    39
test_bf_3_b:
nkeynes@228
    40
	nop
nkeynes@228
    41
	bf test_bf_3_c
nkeynes@228
    42
	fail test_bf_str_k
nkeynes@228
    43
	bra test_bf_4	
nkeynes@228
    44
	nop
nkeynes@231
    45
nkeynes@228
    46
test_bf_4:	! Test branch not taken w/ delay
nkeynes@228
    47
	add #1, r12
nkeynes@228
    48
	setc
nkeynes@228
    49
	xor r0, r0
nkeynes@228
    50
	bf/s test_bf_4_b
nkeynes@228
    51
	add #1, r0
nkeynes@228
    52
	bra test_bf_4_c
nkeynes@228
    53
	nop
nkeynes@228
    54
test_bf_4_b:
nkeynes@228
    55
	fail test_bf_str_k
nkeynes@228
    56
	bra test_bf_5
nkeynes@228
    57
	nop
nkeynes@228
    58
test_bf_4_c:
nkeynes@228
    59
	xor r1,r1
nkeynes@228
    60
	add #1, r1
nkeynes@228
    61
	cmp/eq r0, r1
nkeynes@228
    62
nkeynes@228
    63
test_bf_5:	! Test branch taken w/ delay
nkeynes@228
    64
	add #1, r12
nkeynes@228
    65
	clc
nkeynes@228
    66
	xor r0,r0
nkeynes@228
    67
	bf/s test_bf_5_b
nkeynes@228
    68
	add #1, r0
nkeynes@228
    69
	fail test_bf_str_k
nkeynes@228
    70
	bra test_bf_6
nkeynes@228
    71
test_bf_5_b:	
nkeynes@228
    72
	xor r1,r1
nkeynes@228
    73
	add #1, r1
nkeynes@228
    74
	cmp/eq r0,r1
nkeynes@228
    75
	bt test_bf_6
nkeynes@228
    76
	fail test_bf_str_k
nkeynes@228
    77
nkeynes@231
    78
test_bf_6:	! Test back-branch taken w/ delay
nkeynes@231
    79
	add #1, r12
nkeynes@231
    80
	clc
nkeynes@231
    81
	xor r0, r0
nkeynes@231
    82
	bra test_bf_6_b
nkeynes@231
    83
	nop
nkeynes@231
    84
	fail test_bf_str_k
nkeynes@231
    85
	bra test_bf_7
nkeynes@231
    86
	nop
nkeynes@231
    87
	add #1, r13
nkeynes@231
    88
test_bf_6_c:
nkeynes@231
    89
	mov #1, r1
nkeynes@231
    90
	cmp/eq r0, r1
nkeynes@231
    91
	bt test_bf_7
nkeynes@231
    92
	fail test_bf_str_k
nkeynes@231
    93
	bra test_bf_7
nkeynes@231
    94
	nop
nkeynes@231
    95
	fail test_bf_str_k
nkeynes@231
    96
	bra test_bf_7
nkeynes@231
    97
	nop
nkeynes@231
    98
	add #1, r13
nkeynes@231
    99
test_bf_6_b:
nkeynes@231
   100
	nop
nkeynes@231
   101
	bf/s test_bf_6_c
nkeynes@231
   102
	add #1, r0
nkeynes@231
   103
	fail test_bf_str_k
nkeynes@231
   104
	bra test_bf_7	
nkeynes@231
   105
	nop
nkeynes@231
   106
	
nkeynes@231
   107
test_bf_7:
nkeynes@228
   108
	add #1, r12
nkeynes@228
   109
	expect_exc 0x000001A0 ! BF is slot illegal
nkeynes@231
   110
test_bf_7_exc:	
nkeynes@231
   111
	bra test_bf_7_b
nkeynes@231
   112
	bf test_bf_7_b
nkeynes@231
   113
	assert_exc_caught test_bf_str_k test_bf_7_exc
nkeynes@231
   114
	bra test_bf_8
nkeynes@231
   115
	nop
nkeynes@231
   116
test_bf_7_b:
nkeynes@231
   117
test_bf_7_c:	
nkeynes@231
   118
	fail test_bf_str_k
nkeynes@231
   119
nkeynes@231
   120
test_bf_8:
nkeynes@231
   121
	add #1, r12
nkeynes@231
   122
	expect_exc 0x000001A0 ! BF/S is slot illegal
nkeynes@231
   123
test_bf_8_exc:	
nkeynes@231
   124
	bra test_bf_8_b
nkeynes@231
   125
	bf/s test_bf_8_b
nkeynes@231
   126
	nop
nkeynes@231
   127
	assert_exc_caught test_bf_str_k test_bf_8_exc
nkeynes@872
   128
	bra test_bf_9
nkeynes@228
   129
	nop
nkeynes@231
   130
test_bf_8_b:
nkeynes@231
   131
test_bf_8_c:	
nkeynes@228
   132
	fail test_bf_str_k
nkeynes@231
   133
nkeynes@872
   134
test_bf_9: ! Regression test that sets does not affect branch  
nkeynes@872
   135
	add #1, r12
nkeynes@872
   136
	clrt
nkeynes@872
   137
	sets
nkeynes@872
   138
	bf test_bf_10
nkeynes@872
   139
	fail test_bf_str_k
nkeynes@872
   140
nkeynes@872
   141
test_bf_10: ! Regression test that clrs does not affect branch
nkeynes@872
   142
	add #1, r12
nkeynes@872
   143
	sett
nkeynes@872
   144
	clrs
nkeynes@872
   145
	bf test_bf_10_a
nkeynes@872
   146
	bra test_bf_end
nkeynes@872
   147
	nop
nkeynes@872
   148
	
nkeynes@872
   149
test_bf_10_a:
nkeynes@872
   150
	fail test_bf_str_k
nkeynes@872
   151
	
nkeynes@228
   152
test_bf_end:
nkeynes@228
   153
	end_test test_bf_str_k
nkeynes@228
   154
nkeynes@228
   155
test_bf_str:
nkeynes@228
   156
	.string "BF"
nkeynes@228
   157
nkeynes@228
   158
.align 4	
nkeynes@228
   159
test_bf_str_k:	
nkeynes@228
   160
	.long test_bf_str
nkeynes@228
   161
	
.