Search
lxdream.org :: lxdream/test/sh4/bsr.s :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename test/sh4/bsr.s
changeset 404:c5ed3c8642a2
author nkeynes
date Sun Aug 24 01:40:58 2008 +0000 (15 years ago)
permissions -rw-r--r--
last change Mask fpscr correctly as well while we're in there
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/sh4/bsr.s Sun Aug 24 01:40:58 2008 +0000
1.3 @@ -0,0 +1,99 @@
1.4 +.section .text
1.5 +.include "sh4/inc.s"
1.6 +!
1.7 +
1.8 +.global _test_bsr
1.9 +_test_bsr:
1.10 + start_test
1.11 + mov.l r11, @-r15
1.12 +
1.13 +test_bsr_1: ! Ordinary case
1.14 + add #1, r12
1.15 + sts pr, r11
1.16 + mova test_bsr_1_fail, r0
1.17 + mov r0, r5
1.18 + xor r1, r1
1.19 + bsr test_bsr_1_target
1.20 + add #1, r1
1.21 +test_bsr_1_fail:
1.22 + fail test_bsr_str_k
1.23 + bra test_bsr_2
1.24 + nop
1.25 +test_bsr_1_target:
1.26 + sts pr, r3
1.27 + cmp/eq r5,r3
1.28 + bf test_bsr_1_fail
1.29 + mov #1, r2
1.30 + cmp/eq r1, r2
1.31 + bf test_bsr_1_fail
1.32 +
1.33 +test_bsr_2: ! Write PR in delay slot
1.34 + add #1, r12
1.35 +
1.36 + bsr test_bsr_2_target
1.37 + lds r11, pr
1.38 +test_bsr_2_fail:
1.39 + fail test_bsr_str_k
1.40 + bra test_bsr_3
1.41 + nop
1.42 +test_bsr_2_target:
1.43 + sts pr, r4
1.44 + cmp/eq r4,r11
1.45 + bf test_bsr_2_fail
1.46 +
1.47 +test_bsr_3: ! Read PR in delay slot
1.48 + add #1, r12
1.49 +
1.50 + mova test_bsr_3_fail, r0
1.51 + mov r0, r5
1.52 + bsr test_bsr_3_target
1.53 + sts pr, r2
1.54 +test_bsr_3_fail:
1.55 + fail test_bsr_str_k
1.56 + bra test_bsr_4
1.57 +test_bsr_3_target:
1.58 + cmp/eq r2, r5
1.59 + bf test_bsr_3_fail
1.60 + sts pr, r3
1.61 + cmp/eq r3, r5
1.62 + bf test_bsr_3_fail
1.63 +
1.64 +test_bsr_4: ! Exception in delay slot
1.65 + add #1, r12
1.66 +
1.67 + mova test_bsr_4_fail, r0
1.68 + add #1, r0
1.69 + expect_exc 0x000001A0
1.70 + mova test_bsr_4_rte, r0
1.71 + mov r0, r11
1.72 +test_bsr_4_fault_pc:
1.73 + bsr test_bsr_4_fail
1.74 + bt test_bsr_4_rte
1.75 +test_bsr_4_rte:
1.76 + sts pr, r1
1.77 + cmp/eq r1, r11
1.78 + bf test_bsr_4_fail
1.79 + assert_exc_caught test_bsr_str_k test_bsr_4_fault_pc
1.80 + bra test_bsr_5
1.81 + nop
1.82 +test_bsr_4_fail:
1.83 + fail test_bsr_str_k
1.84 +
1.85 +test_bsr_5:
1.86 +
1.87 +test_bsr_end:
1.88 + mov.l @r15+, r11
1.89 + end_test test_bsr_str_k
1.90 +
1.91 +! Branch point used for tests that should never be reached (under correct
1.92 +! operation. Returns immediately, which should hit the "no exception" test
1.93 +test_bsr_fail:
1.94 + rts
1.95 + nop
1.96 +
1.97 +test_bsr_str_k:
1.98 + .long test_bsr_str
1.99 +test_bsr_str:
1.100 + .string "BSR"
1.101 +
1.102 +
1.103 \ No newline at end of file
.