Search
lxdream.org :: lxdream :: r404:c5ed3c8642a2
lxdream 0.9.1
released Jun 29
Download Now
changeset404:c5ed3c8642a2
parent403:1cf393db32f2
child405:570d93abb5b7
authornkeynes
dateFri Sep 28 07:21:58 2007 +0000 (12 years ago)
Add BSR tests
test/Makefile
test/sh4/bsr.s
test/sh4/testsh4.c
1.1 --- a/test/Makefile Thu Sep 20 11:24:45 2007 +0000
1.2 +++ b/test/Makefile Fri Sep 28 07:21:58 2007 +0000
1.3 @@ -73,8 +73,9 @@
1.4
1.5 testsh4: crt0.so sh4/testsh4.so timer.so interrupt.so \
1.6 sh4/add.so sh4/addc.so sh4/addv.so sh4/and.so sh4/andi.so \
1.7 - sh4/bf.so sh4/bt.so sh4/cmp.so sh4/cmpstr.so sh4/div0.so \
1.8 - sh4/div1.so sh4/float.so sh4/fmov.so sh4/ftrc.so sh4/mac.s \
1.9 + sh4/bf.so sh4/bsr.so sh4/bt.so sh4/cmp.so sh4/cmpstr.so \
1.10 + sh4/div0.so sh4/div1.so sh4/float.so sh4/fmov.so sh4/ftrc.so \
1.11 + sh4/mac.s \
1.12 sh4/rot.so sh4/shl.so sh4/shld.so sh4/sub.so sh4/subc.so \
1.13 sh4/tas.so sh4/xtrct.so \
1.14 sh4/excslot.so sh4/undef.so
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/test/sh4/bsr.s Fri Sep 28 07:21:58 2007 +0000
2.3 @@ -0,0 +1,99 @@
2.4 +.section .text
2.5 +.include "sh4/inc.s"
2.6 +!
2.7 +
2.8 +.global _test_bsr
2.9 +_test_bsr:
2.10 + start_test
2.11 + mov.l r11, @-r15
2.12 +
2.13 +test_bsr_1: ! Ordinary case
2.14 + add #1, r12
2.15 + sts pr, r11
2.16 + mova test_bsr_1_fail, r0
2.17 + mov r0, r5
2.18 + xor r1, r1
2.19 + bsr test_bsr_1_target
2.20 + add #1, r1
2.21 +test_bsr_1_fail:
2.22 + fail test_bsr_str_k
2.23 + bra test_bsr_2
2.24 + nop
2.25 +test_bsr_1_target:
2.26 + sts pr, r3
2.27 + cmp/eq r5,r3
2.28 + bf test_bsr_1_fail
2.29 + mov #1, r2
2.30 + cmp/eq r1, r2
2.31 + bf test_bsr_1_fail
2.32 +
2.33 +test_bsr_2: ! Write PR in delay slot
2.34 + add #1, r12
2.35 +
2.36 + bsr test_bsr_2_target
2.37 + lds r11, pr
2.38 +test_bsr_2_fail:
2.39 + fail test_bsr_str_k
2.40 + bra test_bsr_3
2.41 + nop
2.42 +test_bsr_2_target:
2.43 + sts pr, r4
2.44 + cmp/eq r4,r11
2.45 + bf test_bsr_2_fail
2.46 +
2.47 +test_bsr_3: ! Read PR in delay slot
2.48 + add #1, r12
2.49 +
2.50 + mova test_bsr_3_fail, r0
2.51 + mov r0, r5
2.52 + bsr test_bsr_3_target
2.53 + sts pr, r2
2.54 +test_bsr_3_fail:
2.55 + fail test_bsr_str_k
2.56 + bra test_bsr_4
2.57 +test_bsr_3_target:
2.58 + cmp/eq r2, r5
2.59 + bf test_bsr_3_fail
2.60 + sts pr, r3
2.61 + cmp/eq r3, r5
2.62 + bf test_bsr_3_fail
2.63 +
2.64 +test_bsr_4: ! Exception in delay slot
2.65 + add #1, r12
2.66 +
2.67 + mova test_bsr_4_fail, r0
2.68 + add #1, r0
2.69 + expect_exc 0x000001A0
2.70 + mova test_bsr_4_rte, r0
2.71 + mov r0, r11
2.72 +test_bsr_4_fault_pc:
2.73 + bsr test_bsr_4_fail
2.74 + bt test_bsr_4_rte
2.75 +test_bsr_4_rte:
2.76 + sts pr, r1
2.77 + cmp/eq r1, r11
2.78 + bf test_bsr_4_fail
2.79 + assert_exc_caught test_bsr_str_k test_bsr_4_fault_pc
2.80 + bra test_bsr_5
2.81 + nop
2.82 +test_bsr_4_fail:
2.83 + fail test_bsr_str_k
2.84 +
2.85 +test_bsr_5:
2.86 +
2.87 +test_bsr_end:
2.88 + mov.l @r15+, r11
2.89 + end_test test_bsr_str_k
2.90 +
2.91 +! Branch point used for tests that should never be reached (under correct
2.92 +! operation. Returns immediately, which should hit the "no exception" test
2.93 +test_bsr_fail:
2.94 + rts
2.95 + nop
2.96 +
2.97 +test_bsr_str_k:
2.98 + .long test_bsr_str
2.99 +test_bsr_str:
2.100 + .string "BSR"
2.101 +
2.102 +
2.103 \ No newline at end of file
3.1 --- a/test/sh4/testsh4.c Thu Sep 20 11:24:45 2007 +0000
3.2 +++ b/test/sh4/testsh4.c Fri Sep 28 07:21:58 2007 +0000
3.3 @@ -53,6 +53,7 @@
3.4 test_andi();
3.5 test_bf();
3.6 test_bt();
3.7 + test_bsr();
3.8 test_cmp();
3.9 test_cmpstr();
3.10 test_div0();
.