Search
lxdream.org :: lxdream/test/sh4/bt.s :: diff
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
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/sh4/bt.s Tue Sep 26 11:05:38 2006 +0000
1.3 @@ -0,0 +1,140 @@
1.4 +.section .text
1.5 +.include "sh4/inc.s"
1.6 +!
1.7 +! Test bt pcrel
1.8 +! Test bt/s pcrel
1.9 +
1.10 +.global _test_bt
1.11 +_test_bt:
1.12 + start_test
1.13 +
1.14 +test_bt_1: ! Test branch not taken
1.15 + add #1, r12
1.16 + clc
1.17 + bt test_bt_1_b
1.18 + bra test_bt_2
1.19 + nop
1.20 +test_bt_1_b:
1.21 + fail test_bt_str_k
1.22 +
1.23 +test_bt_2: ! Test branch taken
1.24 + add #1, r12
1.25 + setc
1.26 + bt test_bt_3
1.27 + fail test_bt_str_k
1.28 +
1.29 +test_bt_3: ! Test branch taken (backwards)
1.30 + add #1, r12
1.31 + setc
1.32 + bra test_bt_3_b
1.33 + nop
1.34 + fail test_bt_str_k
1.35 + bra test_bt_4
1.36 +test_bt_3_c:
1.37 + nop
1.38 + bra test_bt_4
1.39 + nop
1.40 + fail test_bt_str_k
1.41 + bra test_bt_4
1.42 +test_bt_3_b:
1.43 + nop
1.44 + bt test_bt_3_c
1.45 + fail test_bt_str_k
1.46 + bra test_bt_4
1.47 + nop
1.48 +test_bt_4: ! Test branch not taken w/ delay
1.49 + add #1, r12
1.50 + clc
1.51 + xor r0, r0
1.52 + bt/s test_bt_4_b
1.53 + add #1, r0
1.54 + bra test_bt_4_c
1.55 + nop
1.56 +test_bt_4_b:
1.57 + fail test_bt_str_k
1.58 + bra test_bt_5
1.59 + nop
1.60 +test_bt_4_c:
1.61 + xor r1,r1
1.62 + add #1, r1
1.63 + cmp/eq r0, r1
1.64 +
1.65 +test_bt_5: ! Test branch taken w/ delay
1.66 + add #1, r12
1.67 + setc
1.68 + xor r0,r0
1.69 + bt/s test_bt_5_b
1.70 + add #1, r0
1.71 + fail test_bt_str_k
1.72 + bra test_bt_6
1.73 +test_bt_5_b:
1.74 + xor r1,r1
1.75 + add #1, r1
1.76 + cmp/eq r0,r1
1.77 + bt test_bt_6
1.78 + fail test_bt_str_k
1.79 +
1.80 +test_bt_6: ! Test back-branch taken w/ delay
1.81 + add #1, r12
1.82 + setc
1.83 + xor r0, r0
1.84 + bra test_bt_6_b
1.85 + nop
1.86 + fail test_bt_str_k
1.87 + bra test_bt_7
1.88 + nop
1.89 + add #1, r13
1.90 +test_bt_6_c:
1.91 + mov #1, r1
1.92 + cmp/eq r0, r1
1.93 + bt test_bt_7
1.94 + fail test_bt_str_k
1.95 + bra test_bt_7
1.96 + nop
1.97 + fail test_bt_str_k
1.98 + bra test_bt_7
1.99 +test_bt_6_b:
1.100 + nop
1.101 + bt/s test_bt_6_c
1.102 + add #1, r0
1.103 + fail test_bt_str_k
1.104 + bra test_bt_7
1.105 + nop
1.106 +
1.107 +test_bt_7:
1.108 + add #1, r12
1.109 + expect_exc 0x000001A0 ! BT is slot illegal
1.110 +test_bt_7_exc:
1.111 + bra test_bt_7_b
1.112 + bt test_bt_7_b
1.113 + assert_exc_caught test_bt_str_k test_bt_7_exc
1.114 + bra test_bt_8
1.115 + nop
1.116 +test_bt_7_b:
1.117 +test_bt_7_c:
1.118 + fail test_bt_str_k
1.119 +
1.120 +test_bt_8:
1.121 + add #1, r12
1.122 + expect_exc 0x000001A0 ! BT/S is slot illegal
1.123 +test_bt_8_exc:
1.124 + bra test_bt_8_b
1.125 + bt/s test_bt_8_b
1.126 + nop
1.127 + assert_exc_caught test_bt_str_k test_bt_8_exc
1.128 + bra test_bt_end
1.129 + nop
1.130 +test_bt_8_b:
1.131 +test_bt_8_c:
1.132 + fail test_bt_str_k
1.133 +
1.134 +test_bt_end:
1.135 + end_test test_bt_str_k
1.136 +
1.137 +test_bt_str:
1.138 + .string "BT"
1.139 +
1.140 +.align 4
1.141 +test_bt_str_k:
1.142 + .long test_bt_str
1.143 +
1.144 \ No newline at end of file
.