Search
lxdream.org :: lxdream/test/sh4/sub.s
lxdream 0.9.1
released Jun 29
Download Now
filename test/sh4/sub.s
changeset 393:5e5335b61373
author nkeynes
date Fri Dec 02 18:18:04 2011 +1000 (10 years ago)
permissions -rw-r--r--
last change SH4 shadow-mode tweaks
- Fix exceptions generated by the translator to account for the excepting
instruction(s) in the cycle counts.
- Compare floating point regs bitwise rather than with FP comparisons
(otherwise can fail due to nan != nan)
- Dump the translated block when we abort with an inconsistency
view annotate diff log raw
     1 .section .text
     2 .include "sh4/inc.s"
     4 .global _test_sub
     5 _test_sub:
     6 	start_test
     8 test_sub_1:	! test subing 0+0 = 0
     9 	add #1, r12
    10 	xor r0,r0
    11 	xor r1,r1
    12 	xor r2,r2
    13 	sett
    14 	sub r0,r1
    15 	bf test_sub_1_fail
    16 	cmp/eq r1, r2
    17 	bt test_sub_2
    18 test_sub_1_fail:	
    19 	fail test_sub_str_k
    21 test_sub_2:	! test 0+ constant 1 = 1
    22 	add #1, r12
    23 	xor r0, r0
    24 	xor r1, r1
    25 	mov.l test_sub_2_input, r0
    26 	mov.l test_sub_2_result, r2
    27 	clrt
    28 	sub r0, r1
    29 	bt test_sub_2_fail
    30 	cmp/eq r1, r2
    31 	bt test_sub_3
    32 test_sub_2_fail:	
    33 	fail test_sub_str_k
    34 	bra test_sub_3
    35 	nop
    37 	.align 4
    38 test_sub_2_input:
    39 	.long 0x00000001
    40 test_sub_2_result:
    41 	.long 0xFFFFFFFF
    43 test_sub_3:	! test 0 + constant -1 = -1
    44 	add #1, r12
    45 	mov.l test_sub_3_input_1, r0
    46 	mov r0, r1
    47 	mov.l test_sub_3_input_2, r1
    48 	sett
    49 	sub r0, r1
    50 	bf test_sub_3_fail
    51 	mov.l test_sub_3_result, r2
    52 	cmp/eq r1, r2
    53 	bt test_sub_4
    54 test_sub_3_fail:	
    55 	fail test_sub_str_k
    56 	bra test_sub_4
    57 	nop
    59 	.align 4
    60 test_sub_3_input_1:
    61 	.long 0xFFFFFF84
    62 test_sub_3_input_2:	
    63 	.long 0x43217000
    64 test_sub_3_result:
    65 	.long 0x4321707C
    67 test_sub_4:	! Test 0 result
    68 	add #1, r12
    69 	mov.l test_sub_4_op1, r2
    70 	mov.l test_sub_4_op2, r1
    71 	mov r2, r3
    72 	sub r1, r3
    73 	mov.l test_sub_4_result_1, r0
    74 	cmp/eq r0, r3
    75 	bf test_sub_4_fail
    76 	mov r2, r3
    77 	sub r3, r1
    78 	mov.l test_sub_4_result_2, r2
    79 	cmp/eq r1, r2
    80 	bt test_sub_5
    81 test_sub_4_fail:	
    82 	fail test_sub_str_k
    83 	bra test_sub_5
    84 	nop
    85 test_sub_4_op1:
    86 	.long 0x00000001
    87 test_sub_4_op2:
    88 	.long 0xFFFFFFFF
    89 test_sub_4_result_1:
    90 	.long 0x00000002
    91 test_sub_4_result_2:
    92 	.long 0xFFFFFFFE
    94 test_sub_5:
    95 	add #1, r12
    96 	mov.l test_sub_5_op, r2
    97 	sett
    98 	sub r2, r2
    99 	bf test_sub_5_fail
   100 	tst r2, r2
   101 	bt test_sub_end
   102 test_sub_5_fail:	
   103 	fail test_sub_str_k
   104 	bra test_sub_end
   105 	nop
   107 test_sub_5_op:	
   108 	.long 0xABCD1234	
   110 test_sub_end:
   111 	end_test test_sub_str_k
   113 test_sub_str:
   114 	.string "SUB"
   116 .align 4	
   117 test_sub_str_k:	
   118 	.long test_sub_str
.