Search
lxdream.org :: lxdream/test/sh4/bsr.s
lxdream 0.9.1
released Jun 29
Download Now
filename test/sh4/bsr.s
changeset 404:c5ed3c8642a2
author nkeynes
date Wed Dec 21 17:13:08 2011 +1000 (12 years ago)
permissions -rw-r--r--
last change Setup configure to detect/manage CC_FOR_BUILD
view annotate diff log raw
     1 .section .text
     2 .include "sh4/inc.s"
     3 !
     5 .global _test_bsr
     6 _test_bsr:	
     7 	start_test
     8 	mov.l r11, @-r15
    10 test_bsr_1:	! Ordinary case
    11 	add #1, r12
    12 	sts pr, r11
    13 	mova test_bsr_1_fail, r0
    14 	mov r0, r5
    15 	xor r1, r1
    16 	bsr test_bsr_1_target
    17 	add #1, r1
    18 test_bsr_1_fail:	
    19 	fail test_bsr_str_k
    20 	bra test_bsr_2
    21 	nop
    22 test_bsr_1_target:
    23 	sts pr, r3
    24 	cmp/eq r5,r3
    25 	bf test_bsr_1_fail
    26 	mov #1, r2
    27 	cmp/eq r1, r2
    28 	bf test_bsr_1_fail
    30 test_bsr_2:	! Write PR in delay slot
    31 	add #1, r12
    33 	bsr test_bsr_2_target
    34 	lds r11, pr
    35 test_bsr_2_fail:
    36 	fail test_bsr_str_k
    37 	bra test_bsr_3
    38 	nop
    39 test_bsr_2_target:
    40 	sts pr, r4
    41 	cmp/eq r4,r11
    42 	bf test_bsr_2_fail
    44 test_bsr_3:	! Read PR in delay slot
    45 	add #1, r12
    47 	mova test_bsr_3_fail, r0
    48 	mov r0, r5
    49 	bsr test_bsr_3_target
    50 	sts pr, r2
    51 test_bsr_3_fail:
    52 	fail test_bsr_str_k
    53 	bra test_bsr_4
    54 test_bsr_3_target:
    55 	cmp/eq r2, r5
    56 	bf test_bsr_3_fail
    57 	sts pr, r3
    58 	cmp/eq r3, r5
    59 	bf test_bsr_3_fail
    61 test_bsr_4:	! Exception in delay slot
    62 	add #1, r12
    64 	mova test_bsr_4_fail, r0
    65 	add #1, r0
    66 	expect_exc 0x000001A0
    67 	mova test_bsr_4_rte, r0
    68 	mov r0, r11
    69 test_bsr_4_fault_pc:	
    70 	bsr test_bsr_4_fail
    71 	bt test_bsr_4_rte
    72 test_bsr_4_rte:	
    73 	sts pr, r1
    74 	cmp/eq r1, r11
    75 	bf test_bsr_4_fail
    76 	assert_exc_caught test_bsr_str_k test_bsr_4_fault_pc
    77 	bra test_bsr_5
    78 	nop
    79 test_bsr_4_fail:
    80 	fail test_bsr_str_k
    82 test_bsr_5:	
    84 test_bsr_end:
    85 	mov.l @r15+, r11
    86 	end_test test_bsr_str_k
    88 ! Branch point used for tests that should never be reached (under correct
    89 ! operation. Returns immediately, which should hit the "no exception" test
    90 test_bsr_fail:
    91 	rts
    92 	nop
    94 test_bsr_str_k:
    95 	.long test_bsr_str
    96 test_bsr_str:
    97 	.string "BSR"
.