Search
lxdream.org :: lxdream/test/sh4/div1.s
lxdream 0.9.1
released Jun 29
Download Now
filename test/sh4/div1.s
changeset 384:c9d5c194984b
author nkeynes
date Tue Nov 20 08:31:34 2007 +0000 (15 years ago)
permissions -rw-r--r--
last change Fix TRAPA (translator) and add test case
view annotate diff log raw
     1 .section .text
     2 .include "sh4/inc.s"
     3 !
     4 ! Test DIV1 operation
     5 !
     6 .global _test_div1
     7 _test_div1:
     8 	start_test
     9 	mov.l r11, @-r15
    10 	mov.l r10, @-r15
    12 	mova test_div1_data, r0
    13 	mov r0, r11
    14 	mov #12, r10	
    15 test_div1_loop:	
    16 	add #1, r12
    18 	mov.l @r11+, r4
    19 	mov.l @r11+, r5
    20 	mov.l @r11+, r6
    22 	stc sr, r2
    23 	mov.l test_div1_sr_mask, r0
    24 	not r0, r1
    25 	and r1, r2
    26 	or r6, r2
    27 	ldc r2, sr
    28 	mov r4, r3
    30 	div1 r4, r5
    32 	stc sr, r2
    33 	and r0, r2
    34 	cmp/eq r3, r4
    35 	bf test_div1_fail
    36 	mov.l @r11+, r3
    37 	cmp/eq r3, r5
    38 	bf test_div1_fail
    39 	mov.l @r11+, r3
    40 	cmp/eq r3, r2
    41 	bt test_div1_next
    42 test_div1_fail:
    43 	fail test_div1_str_k
    45 test_div1_next:	
    46 	dt r10
    47 	bf test_div1_loop	
    49 test_div1_end:
    50 	mov.l @r15+, r10
    51 	mov.l @r15+, r11
    52 	end_test test_div1_str_k
    54 test_div1_data:
    55 	.long 0x12345678
    56 	.long 0x01234123
    57 	.long 0x00000001
    58 	.long 0xF0122BCF
    59 	.long 0x00000100
    61 	.long 0x11223344
    62 	.long 0xF0122BCF
    63 	.long 0x00000100
    64 	.long 0xF1468AE2
    65 	.long 0x00000100
    67 	.long 0x20103040
    68 	.long 0xF1468AE2
    69 	.long 0x00000101
    70 	.long 0x029D4605
    71 	.long 0x00000001
    73 	.long 0x01231231
    74 	.long 0x029D4605
    75 	.long 0x00000000
    76 	.long 0x041779D9
    77 	.long 0x00000001
    79 	.long 0xF1234123
    80 	.long 0x13434454
    81 	.long 0x00000100
    82 	.long 0x17A9C9CB
    83 	.long 0x00000100
    85 	.long 0x65432123
    86 	.long 0x12312312
    87 	.long 0x00000101
    88 	.long 0x89A56748
    89 	.long 0x00000001
    91 ! and now the m=1 cases
    92 	.long 0x12345678
    93 	.long 0x01234123
    94 	.long 0x00000301
    95 	.long 0xF0122BCF
    96 	.long 0x00000200
    98 	.long 0x11223344
    99 	.long 0xF0122BCF
   100 	.long 0x00000200
   101 	.long 0xF1468AE2
   102 	.long 0x00000200
   104 	.long 0x20103040
   105 	.long 0xF1468AE2
   106 	.long 0x00000201
   107 	.long 0x029D4605
   108 	.long 0x00000301
   110 	.long 0x01231231
   111 	.long 0x029D4605
   112 	.long 0x00000300
   113 	.long 0x041779D9
   114 	.long 0x00000301
   116 	.long 0xF1234123
   117 	.long 0x13434454
   118 	.long 0x00000200
   119 	.long 0x17A9C9CB
   120 	.long 0x00000200
   122 	.long 0x65432123
   123 	.long 0x12312312
   124 	.long 0x00000201
   125 	.long 0x89A56748
   126 	.long 0x00000301
   128 test_div1_data_end:
   130 test_div1_sr_mask:
   131 	.long 0x00000301
   133 test_div1_str_k:
   134 	.long test_div1_str
   135 test_div1_str:
   136 	.string "DIV1"
.