Search
lxdream.org :: lxdream/test/sh4/div1.s :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename test/sh4/div1.s
changeset 384:c9d5c194984b
author nkeynes
date Fri Feb 08 00:06:56 2008 +0000 (16 years ago)
permissions -rw-r--r--
last change Fix LDS/STS to FPUL/FPSCR to check the FPU disabled bit. Fixes
the linux 2.4.0-test8 kernel boot
(this wasn't exactly very well documented in the original manual)
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/sh4/div1.s Fri Feb 08 00:06:56 2008 +0000
1.3 @@ -0,0 +1,137 @@
1.4 +.section .text
1.5 +.include "sh4/inc.s"
1.6 +!
1.7 +! Test DIV1 operation
1.8 +!
1.9 +.global _test_div1
1.10 +_test_div1:
1.11 + start_test
1.12 + mov.l r11, @-r15
1.13 + mov.l r10, @-r15
1.14 +
1.15 + mova test_div1_data, r0
1.16 + mov r0, r11
1.17 + mov #12, r10
1.18 +test_div1_loop:
1.19 + add #1, r12
1.20 +
1.21 + mov.l @r11+, r4
1.22 + mov.l @r11+, r5
1.23 + mov.l @r11+, r6
1.24 +
1.25 + stc sr, r2
1.26 + mov.l test_div1_sr_mask, r0
1.27 + not r0, r1
1.28 + and r1, r2
1.29 + or r6, r2
1.30 + ldc r2, sr
1.31 + mov r4, r3
1.32 +
1.33 + div1 r4, r5
1.34 +
1.35 + stc sr, r2
1.36 + and r0, r2
1.37 + cmp/eq r3, r4
1.38 + bf test_div1_fail
1.39 + mov.l @r11+, r3
1.40 + cmp/eq r3, r5
1.41 + bf test_div1_fail
1.42 + mov.l @r11+, r3
1.43 + cmp/eq r3, r2
1.44 + bt test_div1_next
1.45 +test_div1_fail:
1.46 + fail test_div1_str_k
1.47 +
1.48 +test_div1_next:
1.49 + dt r10
1.50 + bf test_div1_loop
1.51 +
1.52 +test_div1_end:
1.53 + mov.l @r15+, r10
1.54 + mov.l @r15+, r11
1.55 + end_test test_div1_str_k
1.56 +
1.57 +test_div1_data:
1.58 + .long 0x12345678
1.59 + .long 0x01234123
1.60 + .long 0x00000001
1.61 + .long 0xF0122BCF
1.62 + .long 0x00000100
1.63 +
1.64 + .long 0x11223344
1.65 + .long 0xF0122BCF
1.66 + .long 0x00000100
1.67 + .long 0xF1468AE2
1.68 + .long 0x00000100
1.69 +
1.70 + .long 0x20103040
1.71 + .long 0xF1468AE2
1.72 + .long 0x00000101
1.73 + .long 0x029D4605
1.74 + .long 0x00000001
1.75 +
1.76 + .long 0x01231231
1.77 + .long 0x029D4605
1.78 + .long 0x00000000
1.79 + .long 0x041779D9
1.80 + .long 0x00000001
1.81 +
1.82 + .long 0xF1234123
1.83 + .long 0x13434454
1.84 + .long 0x00000100
1.85 + .long 0x17A9C9CB
1.86 + .long 0x00000100
1.87 +
1.88 + .long 0x65432123
1.89 + .long 0x12312312
1.90 + .long 0x00000101
1.91 + .long 0x89A56748
1.92 + .long 0x00000001
1.93 +
1.94 +! and now the m=1 cases
1.95 + .long 0x12345678
1.96 + .long 0x01234123
1.97 + .long 0x00000301
1.98 + .long 0xF0122BCF
1.99 + .long 0x00000200
1.100 +
1.101 + .long 0x11223344
1.102 + .long 0xF0122BCF
1.103 + .long 0x00000200
1.104 + .long 0xF1468AE2
1.105 + .long 0x00000200
1.106 +
1.107 + .long 0x20103040
1.108 + .long 0xF1468AE2
1.109 + .long 0x00000201
1.110 + .long 0x029D4605
1.111 + .long 0x00000301
1.112 +
1.113 + .long 0x01231231
1.114 + .long 0x029D4605
1.115 + .long 0x00000300
1.116 + .long 0x041779D9
1.117 + .long 0x00000301
1.118 +
1.119 + .long 0xF1234123
1.120 + .long 0x13434454
1.121 + .long 0x00000200
1.122 + .long 0x17A9C9CB
1.123 + .long 0x00000200
1.124 +
1.125 + .long 0x65432123
1.126 + .long 0x12312312
1.127 + .long 0x00000201
1.128 + .long 0x89A56748
1.129 + .long 0x00000301
1.130 +
1.131 +test_div1_data_end:
1.132 +
1.133 +test_div1_sr_mask:
1.134 + .long 0x00000301
1.135 +
1.136 +test_div1_str_k:
1.137 + .long test_div1_str
1.138 +test_div1_str:
1.139 + .string "DIV1"
1.140 +
1.141 \ No newline at end of file
.