Search
lxdream.org :: lxdream/test/sh4/bf.s :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename test/sh4/bf.s
changeset 228:70adc8ffa8d1
next231:a9e61a96a885
author nkeynes
date Mon Sep 25 11:13:56 2006 +0000 (14 years ago)
permissions -rw-r--r--
last change Commit BF tests and initial exception handler
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/sh4/bf.s Mon Sep 25 11:13:56 2006 +0000
1.3 @@ -0,0 +1,99 @@
1.4 +.section .text
1.5 +.include "sh4/inc.s"
1.6 +!
1.7 +! Test bf pcrel
1.8 +! Test bf/s pcrel
1.9 +
1.10 +.global _test_bf
1.11 +_test_bf:
1.12 + start_test
1.13 +
1.14 +test_bf_1: ! Test branch not taken
1.15 + add #1, r12
1.16 + setc
1.17 + bf test_bf_1_b
1.18 + bra test_bf_2
1.19 + nop
1.20 +test_bf_1_b:
1.21 + fail test_bf_str_k
1.22 +
1.23 +test_bf_2: ! Test branch taken
1.24 + add #1, r12
1.25 + clc
1.26 + bf test_bf_3
1.27 + fail test_bf_str_k
1.28 +
1.29 +test_bf_3: ! Test branch taken (backwards)
1.30 + add #1, r12
1.31 + clc
1.32 + bra test_bf_3_b
1.33 + nop
1.34 + fail test_bf_str_k
1.35 + bra test_bf_4
1.36 +test_bf_3_c:
1.37 + nop
1.38 + bra test_bf_4
1.39 + nop
1.40 + fail test_bf_str_k
1.41 + bra test_bf_4
1.42 +test_bf_3_b:
1.43 + nop
1.44 + bf test_bf_3_c
1.45 + fail test_bf_str_k
1.46 + bra test_bf_4
1.47 + nop
1.48 +test_bf_4: ! Test branch not taken w/ delay
1.49 + add #1, r12
1.50 + setc
1.51 + xor r0, r0
1.52 + bf/s test_bf_4_b
1.53 + add #1, r0
1.54 + bra test_bf_4_c
1.55 + nop
1.56 +test_bf_4_b:
1.57 + fail test_bf_str_k
1.58 + bra test_bf_5
1.59 + nop
1.60 +test_bf_4_c:
1.61 + xor r1,r1
1.62 + add #1, r1
1.63 + cmp/eq r0, r1
1.64 +
1.65 +test_bf_5: ! Test branch taken w/ delay
1.66 + add #1, r12
1.67 + clc
1.68 + xor r0,r0
1.69 + bf/s test_bf_5_b
1.70 + add #1, r0
1.71 + fail test_bf_str_k
1.72 + bra test_bf_6
1.73 +test_bf_5_b:
1.74 + xor r1,r1
1.75 + add #1, r1
1.76 + cmp/eq r0,r1
1.77 + bt test_bf_6
1.78 + fail test_bf_str_k
1.79 +
1.80 +test_bf_6:
1.81 + add #1, r12
1.82 + expect_exc 0x000001A0 ! BF is slot illegal
1.83 +test_bf_6_exc:
1.84 + bra test_bf_6_b
1.85 + bf test_bf_6_b
1.86 + assert_exc_caught test_bf_str_k test_bf_6_exc
1.87 + bra test_bf_end
1.88 + nop
1.89 +test_bf_6_b:
1.90 +test_bf_6_c:
1.91 + fail test_bf_str_k
1.92 +
1.93 +test_bf_end:
1.94 + end_test test_bf_str_k
1.95 +
1.96 +test_bf_str:
1.97 + .string "BF"
1.98 +
1.99 +.align 4
1.100 +test_bf_str_k:
1.101 + .long test_bf_str
1.102 +
1.103 \ No newline at end of file
.