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
view annotate diff log raw
     1 .section .text
     2 .include "sh4/inc.s"
     3 !
     4 ! Test bt pcrel
     5 ! Test bt/s pcrel
     7 .global _test_bt
     8 _test_bt:
     9 	start_test
    11 test_bt_1:   ! Test branch not taken
    12 	add #1, r12
    13 	clc
    14 	bt test_bt_1_b
    15 	bra test_bt_2
    16 	nop
    17 test_bt_1_b:
    18 	fail test_bt_str_k
    20 test_bt_2:	! Test branch taken
    21 	add #1, r12
    22 	setc
    23 	bt test_bt_3
    24 	fail test_bt_str_k
    26 test_bt_3:	! Test branch taken (backwards)
    27 	add #1, r12
    28 	setc
    29 	bra test_bt_3_b
    30 	nop
    31 	fail test_bt_str_k
    32 	bra test_bt_4
    33 test_bt_3_c:	
    34 	nop
    35 	bra test_bt_4
    36 	nop
    37 	fail test_bt_str_k
    38 	bra test_bt_4
    39 test_bt_3_b:
    40 	nop
    41 	bt test_bt_3_c
    42 	fail test_bt_str_k
    43 	bra test_bt_4	
    44 	nop
    45 test_bt_4:	! Test branch not taken w/ delay
    46 	add #1, r12
    47 	clc
    48 	xor r0, r0
    49 	bt/s test_bt_4_b
    50 	add #1, r0
    51 	bra test_bt_4_c
    52 	nop
    53 test_bt_4_b:
    54 	fail test_bt_str_k
    55 	bra test_bt_5
    56 	nop
    57 test_bt_4_c:
    58 	xor r1,r1
    59 	add #1, r1
    60 	cmp/eq r0, r1
    62 test_bt_5:	! Test branch taken w/ delay
    63 	add #1, r12
    64 	setc
    65 	xor r0,r0
    66 	bt/s test_bt_5_b
    67 	add #1, r0
    68 	fail test_bt_str_k
    69 	bra test_bt_6
    70 test_bt_5_b:	
    71 	xor r1,r1
    72 	add #1, r1
    73 	cmp/eq r0,r1
    74 	bt test_bt_6
    75 	fail test_bt_str_k
    77 test_bt_6:	! Test back-branch taken w/ delay
    78 	add #1, r12
    79 	setc
    80 	xor r0, r0
    81 	bra test_bt_6_b
    82 	nop
    83 	fail test_bt_str_k
    84 	bra test_bt_7
    85 	nop
    86 	add #1, r13
    87 test_bt_6_c:
    88 	mov #1, r1
    89 	cmp/eq r0, r1
    90 	bt test_bt_7
    91 	fail test_bt_str_k
    92 	bra test_bt_7
    93 	nop
    94 	fail test_bt_str_k
    95 	bra test_bt_7
    96 test_bt_6_b:
    97 	nop
    98 	bt/s test_bt_6_c
    99 	add #1, r0
   100 	fail test_bt_str_k
   101 	bra test_bt_7	
   102 	nop
   104 test_bt_7:
   105 	add #1, r12
   106 	expect_exc 0x000001A0 ! BT is slot illegal
   107 test_bt_7_exc:	
   108 	bra test_bt_7_b
   109 	bt test_bt_7_b
   110 	assert_exc_caught test_bt_str_k test_bt_7_exc
   111 	bra test_bt_8
   112 	nop
   113 test_bt_7_b:
   114 test_bt_7_c:	
   115 	fail test_bt_str_k
   117 test_bt_8:
   118 	add #1, r12
   119 	expect_exc 0x000001A0 ! BT/S is slot illegal
   120 test_bt_8_exc:	
   121 	bra test_bt_8_b
   122 	bt/s test_bt_8_b
   123 	nop
   124 	assert_exc_caught test_bt_str_k test_bt_8_exc
   125 	bra test_bt_end
   126 	nop
   127 test_bt_8_b:
   128 test_bt_8_c:	
   129 	fail test_bt_str_k
   131 test_bt_end:
   132 	end_test test_bt_str_k
   134 test_bt_str:
   135 	.string "BT"
   137 .align 4	
   138 test_bt_str_k:	
   139 	.long test_bt_str
.