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 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
nkeynes@185
     1
#
nkeynes@185
     2
# Assembler functions to invoke the non-standard FP operations
nkeynes@185
     3
#
nkeynes@185
     4
.global _clear_fpscr
nkeynes@185
     5
_clear_fpscr:
nkeynes@185
     6
	xor r0, r0
nkeynes@185
     7
	lds r0, fpscr
nkeynes@185
     8
	rts
nkeynes@185
     9
	nop
nkeynes@185
    10
nkeynes@185
    11
.global _get_fpscr
nkeynes@185
    12
_get_fpscr:
nkeynes@185
    13
	rts
nkeynes@185
    14
	sts fpscr, r0
nkeynes@185
    15
nkeynes@185
    16
.global _set_fpscr
nkeynes@185
    17
_set_fpscr:
nkeynes@185
    18
	rts
nkeynes@185
    19
	lds r4, fpscr
nkeynes@185
    20
nkeynes@185
    21
.global _do_fsca
nkeynes@185
    22
_do_fsca:
nkeynes@185
    23
	sts fpscr, r0
nkeynes@185
    24
	mov #0x08, r1
nkeynes@185
    25
	shll16 r1
nkeynes@185
    26
	not r1, r1
nkeynes@185
    27
	and r0, r1
nkeynes@185
    28
	lds r1, fpscr
nkeynes@185
    29
	lds r4, fpul
nkeynes@185
    30
	.word 0xF0FD
nkeynes@185
    31
	fmov fr0, @r5
nkeynes@185
    32
	fmov fr1, @r6
nkeynes@185
    33
	xor r0,r0
nkeynes@185
    34
	rts
nkeynes@185
    35
	lds r1, fpscr
nkeynes@185
    36
nkeynes@185
    37
.global _do_fsrra
nkeynes@185
    38
_do_fsrra:
nkeynes@185
    39
	sts fpscr, r0
nkeynes@185
    40
	mov #0x08, r1
nkeynes@185
    41
	shll16 r1
nkeynes@185
    42
	not r1, r1
nkeynes@185
    43
	and r0, r1
nkeynes@185
    44
	lds r1, fpscr
nkeynes@185
    45
	fmov fr4, fr0
nkeynes@185
    46
	.word 0xF07D
nkeynes@185
    47
	rts
nkeynes@185
    48
	lds r0, fpscr
nkeynes@185
    49
nkeynes@185
    50
.global _do_fipr
nkeynes@185
    51
_do_fipr:
nkeynes@185
    52
	sts fpscr, r0
nkeynes@185
    53
	mov #0x08, r1
nkeynes@185
    54
	shll16 r1
nkeynes@185
    55
	not r1, r1
nkeynes@185
    56
	and r0, r1
nkeynes@185
    57
	lds r1, fpscr
nkeynes@185
    58
	fmov.s @r4+, fr0
nkeynes@185
    59
	fmov.s @r4+, fr1
nkeynes@185
    60
	fmov.s @r4+, fr2
nkeynes@185
    61
	fmov.s @r4+, fr3
nkeynes@185
    62
	fmov.s @r5+, fr4
nkeynes@185
    63
	fmov.s @r5+, fr5
nkeynes@185
    64
	fmov.s @r5+, fr6
nkeynes@185
    65
	fmov.s @r5+, fr7
nkeynes@185
    66
	fipr fv0, fv4
nkeynes@185
    67
	lds r0, fpscr
nkeynes@185
    68
	rts
nkeynes@185
    69
	fmov fr7, fr0
nkeynes@185
    70
nkeynes@185
    71
.global _do_fipr2
nkeynes@185
    72
_do_fipr2:
nkeynes@185
    73
	sts fpscr, r0
nkeynes@185
    74
	mov #0x08, r1
nkeynes@185
    75
	shll16 r1
nkeynes@185
    76
	not r1, r1
nkeynes@185
    77
	and r0, r1
nkeynes@185
    78
	lds r1, fpscr
nkeynes@185
    79
	fschg
nkeynes@185
    80
	fmov @r4+, dr0
nkeynes@185
    81
	fmov @r4+, dr2
nkeynes@185
    82
	fmov @r5+, dr4
nkeynes@185
    83
	fmov @r5+, dr6
nkeynes@185
    84
	fschg
nkeynes@185
    85
	fipr fv0, fv4
nkeynes@185
    86
	lds r0, fpscr
nkeynes@185
    87
	rts
nkeynes@185
    88
	fmov fr7, fr0
nkeynes@185
    89
nkeynes@185
    90
.global _do_ftrv
nkeynes@185
    91
_do_ftrv:
nkeynes@185
    92
	sts fpscr, r0
nkeynes@185
    93
	mov #0x08, r1
nkeynes@185
    94
	shll16 r1
nkeynes@185
    95
	not r1, r1
nkeynes@185
    96
	and r0, r1
nkeynes@185
    97
	lds r1, fpscr
nkeynes@185
    98
	fschg
nkeynes@185
    99
	fmov @r4+, xd0
nkeynes@185
   100
	fmov @r4+, xd2
nkeynes@185
   101
	fmov @r4+, xd4
nkeynes@185
   102
	fmov @r4+, xd6
nkeynes@185
   103
	fmov @r4+, xd8
nkeynes@185
   104
	fmov @r4+, xd10
nkeynes@185
   105
	fmov @r4+, xd12
nkeynes@185
   106
	fmov @r4, xd14
nkeynes@185
   107
	fmov @r5+, dr0
nkeynes@185
   108
	fmov @r5, dr2
nkeynes@185
   109
	ftrv xmtrx, fv0
nkeynes@185
   110
	fmov dr2, @r5
nkeynes@185
   111
	fmov dr0, @-r5
nkeynes@185
   112
	fschg
nkeynes@185
   113
	rts
nkeynes@185
   114
	lds r0, fpscr
nkeynes@185
   115
nkeynes@185
   116
.global _do_ftrv2
nkeynes@185
   117
_do_ftrv2:
nkeynes@185
   118
	sts fpscr, r0
nkeynes@185
   119
	mov #0x08, r1
nkeynes@185
   120
	shll16 r1
nkeynes@185
   121
	not r1, r1
nkeynes@185
   122
	and r0, r1
nkeynes@185
   123
	lds r1, fpscr
nkeynes@185
   124
	fschg
nkeynes@185
   125
	frchg
nkeynes@185
   126
	fmov @r4+, dr0
nkeynes@185
   127
	fmov @r4+, dr2
nkeynes@185
   128
	fmov @r4+, dr4
nkeynes@185
   129
	fmov @r4+, dr6
nkeynes@185
   130
	fmov @r4+, dr8
nkeynes@185
   131
	fmov @r4+, dr10
nkeynes@185
   132
	fmov @r4+, dr12
nkeynes@185
   133
	fmov @r4+, dr14
nkeynes@185
   134
	frchg
nkeynes@185
   135
	fmov @r5+, dr0
nkeynes@185
   136
	fmov @r5, dr2
nkeynes@185
   137
	ftrv xmtrx, fv0
nkeynes@185
   138
	fmov dr2, @-r5
nkeynes@185
   139
	fmov dr0, @-r5
nkeynes@185
   140
	fschg
nkeynes@185
   141
	rts
nkeynes@185
   142
	lds r0, fpscr
.