Search
lxdream.org :: lxdream/test/math.s
lxdream 0.9.1
released Jun 29
Download Now
filename test/math.s
changeset 185:6755a04c447f
author nkeynes
date Thu Jul 24 07:27:48 2008 +0000 (11 years ago)
permissions -rw-r--r--
last change Halt emulation after reporting an error
view annotate diff log raw
     1 #
     2 # Assembler functions to invoke the non-standard FP operations
     3 #
     4 .global _clear_fpscr
     5 _clear_fpscr:
     6 	xor r0, r0
     7 	lds r0, fpscr
     8 	rts
     9 	nop
    11 .global _get_fpscr
    12 _get_fpscr:
    13 	rts
    14 	sts fpscr, r0
    16 .global _set_fpscr
    17 _set_fpscr:
    18 	rts
    19 	lds r4, fpscr
    21 .global _do_fsca
    22 _do_fsca:
    23 	sts fpscr, r0
    24 	mov #0x08, r1
    25 	shll16 r1
    26 	not r1, r1
    27 	and r0, r1
    28 	lds r1, fpscr
    29 	lds r4, fpul
    30 	.word 0xF0FD
    31 	fmov fr0, @r5
    32 	fmov fr1, @r6
    33 	xor r0,r0
    34 	rts
    35 	lds r1, fpscr
    37 .global _do_fsrra
    38 _do_fsrra:
    39 	sts fpscr, r0
    40 	mov #0x08, r1
    41 	shll16 r1
    42 	not r1, r1
    43 	and r0, r1
    44 	lds r1, fpscr
    45 	fmov fr4, fr0
    46 	.word 0xF07D
    47 	rts
    48 	lds r0, fpscr
    50 .global _do_fipr
    51 _do_fipr:
    52 	sts fpscr, r0
    53 	mov #0x08, r1
    54 	shll16 r1
    55 	not r1, r1
    56 	and r0, r1
    57 	lds r1, fpscr
    58 	fmov.s @r4+, fr0
    59 	fmov.s @r4+, fr1
    60 	fmov.s @r4+, fr2
    61 	fmov.s @r4+, fr3
    62 	fmov.s @r5+, fr4
    63 	fmov.s @r5+, fr5
    64 	fmov.s @r5+, fr6
    65 	fmov.s @r5+, fr7
    66 	fipr fv0, fv4
    67 	lds r0, fpscr
    68 	rts
    69 	fmov fr7, fr0
    71 .global _do_fipr2
    72 _do_fipr2:
    73 	sts fpscr, r0
    74 	mov #0x08, r1
    75 	shll16 r1
    76 	not r1, r1
    77 	and r0, r1
    78 	lds r1, fpscr
    79 	fschg
    80 	fmov @r4+, dr0
    81 	fmov @r4+, dr2
    82 	fmov @r5+, dr4
    83 	fmov @r5+, dr6
    84 	fschg
    85 	fipr fv0, fv4
    86 	lds r0, fpscr
    87 	rts
    88 	fmov fr7, fr0
    90 .global _do_ftrv
    91 _do_ftrv:
    92 	sts fpscr, r0
    93 	mov #0x08, r1
    94 	shll16 r1
    95 	not r1, r1
    96 	and r0, r1
    97 	lds r1, fpscr
    98 	fschg
    99 	fmov @r4+, xd0
   100 	fmov @r4+, xd2
   101 	fmov @r4+, xd4
   102 	fmov @r4+, xd6
   103 	fmov @r4+, xd8
   104 	fmov @r4+, xd10
   105 	fmov @r4+, xd12
   106 	fmov @r4, xd14
   107 	fmov @r5+, dr0
   108 	fmov @r5, dr2
   109 	ftrv xmtrx, fv0
   110 	fmov dr2, @r5
   111 	fmov dr0, @-r5
   112 	fschg
   113 	rts
   114 	lds r0, fpscr
   116 .global _do_ftrv2
   117 _do_ftrv2:
   118 	sts fpscr, r0
   119 	mov #0x08, r1
   120 	shll16 r1
   121 	not r1, r1
   122 	and r0, r1
   123 	lds r1, fpscr
   124 	fschg
   125 	frchg
   126 	fmov @r4+, dr0
   127 	fmov @r4+, dr2
   128 	fmov @r4+, dr4
   129 	fmov @r4+, dr6
   130 	fmov @r4+, dr8
   131 	fmov @r4+, dr10
   132 	fmov @r4+, dr12
   133 	fmov @r4+, dr14
   134 	frchg
   135 	fmov @r5+, dr0
   136 	fmov @r5, dr2
   137 	ftrv xmtrx, fv0
   138 	fmov dr2, @-r5
   139 	fmov dr0, @-r5
   140 	fschg
   141 	rts
   142 	lds r0, fpscr
.