2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
6 #include <aros/libcall.h>
8 #include "mathieeedoubtrans_intern.h"
13 Problem (ONLY on Linux/M68K with binary compatibility turned on):
14 In order to get binary compatibility with the original Amiga OS
15 we have to return the value in D0/D1. This is NOT automatically
16 done by the compiler. The result would be returned in one of the
17 FPU registers instead. So we're using the trick with the QUADs.
21 #define RETURN_TYPE QUAD /* For Linux/M68k & AmigaOS w/ bin. compat. */
23 #define RETURN_TYPE double /* for the rest */
27 AROS_LHQUAD1(RETURN_TYPE
, FPU_IEEEDPAtan
,
28 AROS_LHAQUAD(double, y
, D0
, D1
),
29 struct MathIeeeDoubTransBase
*, MathIeeeDoubTransBase
, 5, MathIeeeDoubTrans
33 QUAD
* Res
= (QUAD
*)&y
; /* this forces the returned value to be in D0/D1 */
39 } /* FPU_IEEEDPAtan */
41 AROS_LHQUAD1(RETURN_TYPE
, FPU_IEEEDPSin
,
42 AROS_LHAQUAD(double, y
, D0
, D1
),
43 struct MathIeeeDoubTransBase
*, MathIeeeDoubTransBase
, 6, MathIeeeDoubTrans
47 QUAD
* Res
= (QUAD
*)&y
; /* this forces the returned value to be in D0/D1 */
55 AROS_LHQUAD1(RETURN_TYPE
, FPU_IEEEDPCos
,
56 AROS_LHAQUAD(double, y
, D0
, D1
),
57 struct MathIeeeDoubTransBase
*, MathIeeeDoubTransBase
, 7, MathIeeeDoubTrans
61 QUAD
* Res
= (QUAD
*)&y
; /* this forces the returned value to be in D0/D1 */
69 AROS_LHQUAD1(RETURN_TYPE
, FPU_IEEEDPTan
,
70 AROS_LHAQUAD(double, y
, D0
, D1
),
71 struct MathIeeeDoubTransBase
*, MathIeeeDoubTransBase
, 8, MathIeeeDoubTrans
75 QUAD
* Res
= (QUAD
*)&y
; /* this forces the returned value to be in D0/D1 */
83 AROS_LHQUAD2(RETURN_TYPE
, FPU_IEEEDPSincos
,
84 AROS_LHAQUAD(double *, pf2
, A0
, D1
),
85 AROS_LHAQUAD(double, y
, D0
, D1
),
86 struct MathIeeeDoubTransBase
*, MathIeeeDoubTransBase
, 9, MathIeeeDoubTrans
90 QUAD
* Res
= (QUAD
*)&y
; /* this forces the returned value to be in D0/D1 */
98 } /* FPU_IEEEDPSincos */
100 AROS_LHQUAD1(RETURN_TYPE
, FPU_IEEEDPSinh
,
101 AROS_LHAQUAD(double, y
, D0
, D1
),
102 struct MathIeeeDoubTransBase
*, MathIeeeDoubTransBase
, 10, MathIeeeDoubTrans
106 QUAD
* Res
= (QUAD
*)&y
; /* this forces the returned value to be in D0/D1 */
112 } /* FPU_IEEEDPSinh */
114 AROS_LHQUAD1(RETURN_TYPE
, FPU_IEEEDPCosh
,
115 AROS_LHAQUAD(double, y
, D0
, D1
),
116 struct MathIeeeDoubTransBase
*, MathIeeeDoubTransBase
, 11, MathIeeeDoubTrans
120 QUAD
* Res
= (QUAD
*)&y
; /* this forces the returned value to be in D0/D1 */
126 } /* FPU_IEEEDPCosh */
128 AROS_LHQUAD1(RETURN_TYPE
, FPU_IEEEDPTanh
,
129 AROS_LHAQUAD(double, y
, D0
, D1
),
130 struct MathIeeeDoubTransBase
*, MathIeeeDoubTransBase
, 12, MathIeeeDoubTrans
134 QUAD
* Res
= (QUAD
*)&y
; /* this forces the returned value to be in D0/D1 */
140 } /* FPU_IEEEDPTanh */
142 AROS_LHQUAD1(RETURN_TYPE
, FPU_IEEEDPExp
,
143 AROS_LHAQUAD(double, y
, D0
, D1
),
144 struct MathIeeeDoubTransBase
*, MathIeeeDoubTransBase
, 13, MathIeeeDoubTrans
148 QUAD
* Res
= (QUAD
*)&y
; /* this forces the returned value to be in D0/D1 */
154 } /* FPU_IEEEDPExp */
156 AROS_LHQUAD1(RETURN_TYPE
, FPU_IEEEDPLog
,
157 AROS_LHAQUAD(double, y
, D0
, D1
),
158 struct MathIeeeDoubTransBase
*, MathIeeeDoubTransBase
, 14, MathIeeeDoubTrans
162 QUAD
* Res
= (QUAD
*)&y
; /* this forces the returned value to be in D0/D1 */
168 } /* FPU_IEEEDPLog */
170 AROS_LHQUAD2(RETURN_TYPE
, FPU_IEEEDPPow
,
171 AROS_LHAQUAD(double, y
, D2
, D3
),
172 AROS_LHAQUAD(double, z
, D0
, D1
),
173 struct MathIeeeDoubTransBase
*, MathIeeeDoubTransBase
, 15, MathIeeeDoubTrans
177 QUAD
* Res
= (QUAD
*)&y
; /* this forces the returned value to be in D0/D1 */
183 } /* FPU_IEEEDPPow */
185 AROS_LHQUAD1(RETURN_TYPE
, FPU_IEEEDPSqrt
,
186 AROS_LHAQUAD(double, y
, D0
, D1
),
187 struct MathIeeeDoubTransBase
*, MathIeeeDoubTransBase
, 16, MathIeeeDoubTrans
191 QUAD
* Res
= (QUAD
*)&y
; /* this forces the returned value to be in D0/D1 */
197 } /* FPU_IEEEDPSqrt */
199 AROS_LHQUAD1(RETURN_TYPE
, FPU_IEEEDPTieee
,
200 AROS_LHAQUAD(double, y
, D0
, D1
),
201 struct MathIeeeDoubTransBase
*, MathIeeeDoubTransBase
, 17, MathIeeeDoubTrans
205 QUAD
* Res
= (QUAD
*)&y
; /* this forces the returned value to be in D0/D1 */
210 } /* FPU_IEEEDPTieee */
212 AROS_LHQUAD1(RETURN_TYPE
, FPU_IEEEDPFieee
,
213 AROS_LHAQUAD(double, y
, D0
, D1
),
214 struct MathIeeeDoubTransBase
*, MathIeeeDoubTransBase
, 18, MathIeeeDoubTrans
218 QUAD
* Res
= (QUAD
*)&y
; /* this forces the returned value to be in D0/D1 */
223 } /* FPU_IEEEDPFieee */
225 AROS_LHQUAD1(RETURN_TYPE
, FPU_IEEEDPAsin
,
226 AROS_LHAQUAD(double, y
, D0
, D1
),
227 struct MathIeeeDoubTransBase
*, MathIeeeDoubTransBase
, 19, MathIeeeDoubTrans
231 QUAD
* Res
= (QUAD
*)&y
; /* this forces the returned value to be in D0/D1 */
237 } /* FPU_IEEEDPAsin */
239 AROS_LHQUAD1(RETURN_TYPE
, FPU_IEEEDPAcos
,
240 AROS_LHAQUAD(double, y
, D0
, D1
),
241 struct MathIeeeDoubTransBase
*, MathIeeeDoubTransBase
, 20, MathIeeeDoubTrans
245 QUAD
* Res
= (QUAD
*)&y
; /* this forces the returned value to be in D0/D1 */
251 } /* FPU_IEEEDPAcos */
253 AROS_LHQUAD1(RETURN_TYPE
, FPU_IEEEDPLog10
,
254 AROS_LHAQUAD(double, y
, D0
, D1
),
255 struct MathIeeeDoubTransBase
*, MathIeeeDoubTransBase
, 21, MathIeeeDoubTrans
259 QUAD
* Res
= (QUAD
*)&y
; /* this forces the returned value to be in D0/D1 */
265 } /* FPU_IEEEDPLog10 */