Search
lxdream.org :: lxdream/test/sh4/bt.s
lxdream 0.9.1
released Jun 29
Download Now
filename test/sh4/bt.s
changeset 231:a9e61a96a885
author nkeynes
date Tue Sep 26 11:05:38 2006 +0000 (14 years ago)
permissions -rw-r--r--
last change Add BT, BT/S, CMP/EQ, CMP/GE, CMP/GT, CMP/HI, CMP/HS tests
Add general slot-illegal exception test
file annotate diff log raw
nkeynes@231
     1
.section .text
nkeynes@231
     2
.include "sh4/inc.s"
nkeynes@231
     3
!
nkeynes@231
     4
! Test bt pcrel
nkeynes@231
     5
! Test bt/s pcrel
nkeynes@231
     6
nkeynes@231
     7
.global _test_bt
nkeynes@231
     8
_test_bt:
nkeynes@231
     9
	start_test
nkeynes@231
    10
	
nkeynes@231
    11
test_bt_1:   ! Test branch not taken
nkeynes@231
    12
	add #1, r12
nkeynes@231
    13
	clc
nkeynes@231
    14
	bt test_bt_1_b
nkeynes@231
    15
	bra test_bt_2
nkeynes@231
    16
	nop
nkeynes@231
    17
test_bt_1_b:
nkeynes@231
    18
	fail test_bt_str_k
nkeynes@231
    19
	
nkeynes@231
    20
test_bt_2:	! Test branch taken
nkeynes@231
    21
	add #1, r12
nkeynes@231
    22
	setc
nkeynes@231
    23
	bt test_bt_3
nkeynes@231
    24
	fail test_bt_str_k
nkeynes@231
    25
nkeynes@231
    26
test_bt_3:	! Test branch taken (backwards)
nkeynes@231
    27
	add #1, r12
nkeynes@231
    28
	setc
nkeynes@231
    29
	bra test_bt_3_b
nkeynes@231
    30
	nop
nkeynes@231
    31
	fail test_bt_str_k
nkeynes@231
    32
	bra test_bt_4
nkeynes@231
    33
test_bt_3_c:	
nkeynes@231
    34
	nop
nkeynes@231
    35
	bra test_bt_4
nkeynes@231
    36
	nop
nkeynes@231
    37
	fail test_bt_str_k
nkeynes@231
    38
	bra test_bt_4
nkeynes@231
    39
test_bt_3_b:
nkeynes@231
    40
	nop
nkeynes@231
    41
	bt test_bt_3_c
nkeynes@231
    42
	fail test_bt_str_k
nkeynes@231
    43
	bra test_bt_4	
nkeynes@231
    44
	nop
nkeynes@231
    45
test_bt_4:	! Test branch not taken w/ delay
nkeynes@231
    46
	add #1, r12
nkeynes@231
    47
	clc
nkeynes@231
    48
	xor r0, r0
nkeynes@231
    49
	bt/s test_bt_4_b
nkeynes@231
    50
	add #1, r0
nkeynes@231
    51
	bra test_bt_4_c
nkeynes@231
    52
	nop
nkeynes@231
    53
test_bt_4_b:
nkeynes@231
    54
	fail test_bt_str_k
nkeynes@231
    55
	bra test_bt_5
nkeynes@231
    56
	nop
nkeynes@231
    57
test_bt_4_c:
nkeynes@231
    58
	xor r1,r1
nkeynes@231
    59
	add #1, r1
nkeynes@231
    60
	cmp/eq r0, r1
nkeynes@231
    61
nkeynes@231
    62
test_bt_5:	! Test branch taken w/ delay
nkeynes@231
    63
	add #1, r12
nkeynes@231
    64
	setc
nkeynes@231
    65
	xor r0,r0
nkeynes@231
    66
	bt/s test_bt_5_b
nkeynes@231
    67
	add #1, r0
nkeynes@231
    68
	fail test_bt_str_k
nkeynes@231
    69
	bra test_bt_6
nkeynes@231
    70
test_bt_5_b:	
nkeynes@231
    71
	xor r1,r1
nkeynes@231
    72
	add #1, r1
nkeynes@231
    73
	cmp/eq r0,r1
nkeynes@231
    74
	bt test_bt_6
nkeynes@231
    75
	fail test_bt_str_k
nkeynes@231
    76
nkeynes@231
    77
test_bt_6:	! Test back-branch taken w/ delay
nkeynes@231
    78
	add #1, r12
nkeynes@231
    79
	setc
nkeynes@231
    80
	xor r0, r0
nkeynes@231
    81
	bra test_bt_6_b
nkeynes@231
    82
	nop
nkeynes@231
    83
	fail test_bt_str_k
nkeynes@231
    84
	bra test_bt_7
nkeynes@231
    85
	nop
nkeynes@231
    86
	add #1, r13
nkeynes@231
    87
test_bt_6_c:
nkeynes@231
    88
	mov #1, r1
nkeynes@231
    89
	cmp/eq r0, r1
nkeynes@231
    90
	bt test_bt_7
nkeynes@231
    91
	fail test_bt_str_k
nkeynes@231
    92
	bra test_bt_7
nkeynes@231
    93
	nop
nkeynes@231
    94
	fail test_bt_str_k
nkeynes@231
    95
	bra test_bt_7
nkeynes@231
    96
test_bt_6_b:
nkeynes@231
    97
	nop
nkeynes@231
    98
	bt/s test_bt_6_c
nkeynes@231
    99
	add #1, r0
nkeynes@231
   100
	fail test_bt_str_k
nkeynes@231
   101
	bra test_bt_7	
nkeynes@231
   102
	nop
nkeynes@231
   103
	
nkeynes@231
   104
test_bt_7:
nkeynes@231
   105
	add #1, r12
nkeynes@231
   106
	expect_exc 0x000001A0 ! BT is slot illegal
nkeynes@231
   107
test_bt_7_exc:	
nkeynes@231
   108
	bra test_bt_7_b
nkeynes@231
   109
	bt test_bt_7_b
nkeynes@231
   110
	assert_exc_caught test_bt_str_k test_bt_7_exc
nkeynes@231
   111
	bra test_bt_8
nkeynes@231
   112
	nop
nkeynes@231
   113
test_bt_7_b:
nkeynes@231
   114
test_bt_7_c:	
nkeynes@231
   115
	fail test_bt_str_k
nkeynes@231
   116
nkeynes@231
   117
test_bt_8:
nkeynes@231
   118
	add #1, r12
nkeynes@231
   119
	expect_exc 0x000001A0 ! BT/S is slot illegal
nkeynes@231
   120
test_bt_8_exc:	
nkeynes@231
   121
	bra test_bt_8_b
nkeynes@231
   122
	bt/s test_bt_8_b
nkeynes@231
   123
	nop
nkeynes@231
   124
	assert_exc_caught test_bt_str_k test_bt_8_exc
nkeynes@231
   125
	bra test_bt_end
nkeynes@231
   126
	nop
nkeynes@231
   127
test_bt_8_b:
nkeynes@231
   128
test_bt_8_c:	
nkeynes@231
   129
	fail test_bt_str_k
nkeynes@231
   130
		
nkeynes@231
   131
test_bt_end:
nkeynes@231
   132
	end_test test_bt_str_k
nkeynes@231
   133
nkeynes@231
   134
test_bt_str:
nkeynes@231
   135
	.string "BT"
nkeynes@231
   136
nkeynes@231
   137
.align 4	
nkeynes@231
   138
test_bt_str_k:	
nkeynes@231
   139
	.long test_bt_str
nkeynes@231
   140
	
.