Search
lxdream.org :: lxdream/test/math.s :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename test/math.s
changeset 185:6755a04c447f
author nkeynes
date Thu Jan 31 09:35:01 2008 +0000 (12 years ago)
permissions -rw-r--r--
last change Update release notes for 0.8.3
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/math.s Thu Jan 31 09:35:01 2008 +0000
1.3 @@ -0,0 +1,142 @@
1.4 +#
1.5 +# Assembler functions to invoke the non-standard FP operations
1.6 +#
1.7 +.global _clear_fpscr
1.8 +_clear_fpscr:
1.9 + xor r0, r0
1.10 + lds r0, fpscr
1.11 + rts
1.12 + nop
1.13 +
1.14 +.global _get_fpscr
1.15 +_get_fpscr:
1.16 + rts
1.17 + sts fpscr, r0
1.18 +
1.19 +.global _set_fpscr
1.20 +_set_fpscr:
1.21 + rts
1.22 + lds r4, fpscr
1.23 +
1.24 +.global _do_fsca
1.25 +_do_fsca:
1.26 + sts fpscr, r0
1.27 + mov #0x08, r1
1.28 + shll16 r1
1.29 + not r1, r1
1.30 + and r0, r1
1.31 + lds r1, fpscr
1.32 + lds r4, fpul
1.33 + .word 0xF0FD
1.34 + fmov fr0, @r5
1.35 + fmov fr1, @r6
1.36 + xor r0,r0
1.37 + rts
1.38 + lds r1, fpscr
1.39 +
1.40 +.global _do_fsrra
1.41 +_do_fsrra:
1.42 + sts fpscr, r0
1.43 + mov #0x08, r1
1.44 + shll16 r1
1.45 + not r1, r1
1.46 + and r0, r1
1.47 + lds r1, fpscr
1.48 + fmov fr4, fr0
1.49 + .word 0xF07D
1.50 + rts
1.51 + lds r0, fpscr
1.52 +
1.53 +.global _do_fipr
1.54 +_do_fipr:
1.55 + sts fpscr, r0
1.56 + mov #0x08, r1
1.57 + shll16 r1
1.58 + not r1, r1
1.59 + and r0, r1
1.60 + lds r1, fpscr
1.61 + fmov.s @r4+, fr0
1.62 + fmov.s @r4+, fr1
1.63 + fmov.s @r4+, fr2
1.64 + fmov.s @r4+, fr3
1.65 + fmov.s @r5+, fr4
1.66 + fmov.s @r5+, fr5
1.67 + fmov.s @r5+, fr6
1.68 + fmov.s @r5+, fr7
1.69 + fipr fv0, fv4
1.70 + lds r0, fpscr
1.71 + rts
1.72 + fmov fr7, fr0
1.73 +
1.74 +.global _do_fipr2
1.75 +_do_fipr2:
1.76 + sts fpscr, r0
1.77 + mov #0x08, r1
1.78 + shll16 r1
1.79 + not r1, r1
1.80 + and r0, r1
1.81 + lds r1, fpscr
1.82 + fschg
1.83 + fmov @r4+, dr0
1.84 + fmov @r4+, dr2
1.85 + fmov @r5+, dr4
1.86 + fmov @r5+, dr6
1.87 + fschg
1.88 + fipr fv0, fv4
1.89 + lds r0, fpscr
1.90 + rts
1.91 + fmov fr7, fr0
1.92 +
1.93 +.global _do_ftrv
1.94 +_do_ftrv:
1.95 + sts fpscr, r0
1.96 + mov #0x08, r1
1.97 + shll16 r1
1.98 + not r1, r1
1.99 + and r0, r1
1.100 + lds r1, fpscr
1.101 + fschg
1.102 + fmov @r4+, xd0
1.103 + fmov @r4+, xd2
1.104 + fmov @r4+, xd4
1.105 + fmov @r4+, xd6
1.106 + fmov @r4+, xd8
1.107 + fmov @r4+, xd10
1.108 + fmov @r4+, xd12
1.109 + fmov @r4, xd14
1.110 + fmov @r5+, dr0
1.111 + fmov @r5, dr2
1.112 + ftrv xmtrx, fv0
1.113 + fmov dr2, @r5
1.114 + fmov dr0, @-r5
1.115 + fschg
1.116 + rts
1.117 + lds r0, fpscr
1.118 +
1.119 +.global _do_ftrv2
1.120 +_do_ftrv2:
1.121 + sts fpscr, r0
1.122 + mov #0x08, r1
1.123 + shll16 r1
1.124 + not r1, r1
1.125 + and r0, r1
1.126 + lds r1, fpscr
1.127 + fschg
1.128 + frchg
1.129 + fmov @r4+, dr0
1.130 + fmov @r4+, dr2
1.131 + fmov @r4+, dr4
1.132 + fmov @r4+, dr6
1.133 + fmov @r4+, dr8
1.134 + fmov @r4+, dr10
1.135 + fmov @r4+, dr12
1.136 + fmov @r4+, dr14
1.137 + frchg
1.138 + fmov @r5+, dr0
1.139 + fmov @r5, dr2
1.140 + ftrv xmtrx, fv0
1.141 + fmov dr2, @-r5
1.142 + fmov dr0, @-r5
1.143 + fschg
1.144 + rts
1.145 + lds r0, fpscr
.