adjust the vector offsets to match stdc changes
[AROS.git] / arch / m68k-all / stdc / __stdc_fpumath.c
blob059a1815ce2d934f6b3d1c5de1ecef980b9336e5
1 /*
2 Copyright © 2018, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <aros/libcall.h>
7 #include <aros/symbolsets.h>
8 #include <exec/execbase.h>
9 #include <libraries/stdc.h>
11 #include <proto/exec.h>
13 #ifndef STDC_STATIC
15 /* FPU math functions */
16 extern void AROS_SLIB_ENTRY(acos881, STDC, 130)(void);
17 extern void AROS_SLIB_ENTRY(log2881, STDC, 152)(void);
18 extern void AROS_SLIB_ENTRY(log10881, STDC, 150)(void);
19 extern void AROS_SLIB_ENTRY(log881, STDC, 149)(void);
20 extern void AROS_SLIB_ENTRY(remainder881, STDC, 177)(void);
21 extern void AROS_SLIB_ENTRY(sinh881, STDC, 141)(void);
22 extern void AROS_SLIB_ENTRY(sqrt881, STDC, 161)(void);
23 extern void AROS_SLIB_ENTRY(atan881, STDC, 132)(void);
24 extern void AROS_SLIB_ENTRY(ceil881, STDC, 166)(void);
25 extern void AROS_SLIB_ENTRY(copysign881, STDC, 179)(void);
26 extern void AROS_SLIB_ENTRY(cos881, STDC, 134)(void);
27 extern void AROS_SLIB_ENTRY(exp2881, STDC, 144)(void);
28 extern void AROS_SLIB_ENTRY(fabs881, STDC, 158)(void);
29 extern void AROS_SLIB_ENTRY(fdim881, STDC, 183)(void);
30 extern void AROS_SLIB_ENTRY(floor881, STDC, 167)(void);
31 extern void AROS_SLIB_ENTRY(fma881, STDC, 186)(void);
32 extern void AROS_SLIB_ENTRY(fmax881, STDC, 184)(void);
33 extern void AROS_SLIB_ENTRY(fmin881, STDC, 185)(void);
34 extern void AROS_SLIB_ENTRY(fpclassify881, STDC, 113)(void);
35 extern void AROS_SLIB_ENTRY(isfinite881, STDC, 115)(void);
36 extern void AROS_SLIB_ENTRY(isinf881, STDC, 118)(void);
37 extern void AROS_SLIB_ENTRY(isnan881, STDC, 121)(void);
38 extern void AROS_SLIB_ENTRY(isnormal881, STDC, 124)(void);
39 extern void AROS_SLIB_ENTRY(lround881, STDC, 173)(void);
40 extern void AROS_SLIB_ENTRY(nearbyint881, STDC, 168)(void);
41 extern void AROS_SLIB_ENTRY(round881, STDC, 172)(void);
42 extern void AROS_SLIB_ENTRY(signbit881, STDC, 128)(void);
43 extern void AROS_SLIB_ENTRY(sin881, STDC, 135)(void);
44 extern void AROS_SLIB_ENTRY(tan881, STDC, 136)(void);
45 extern void AROS_SLIB_ENTRY(tanh881, STDC, 142)(void);
46 extern void AROS_SLIB_ENTRY(trunc881, STDC, 175)(void);
47 extern void AROS_SLIB_ENTRY(asin881, STDC, 131)(void);
48 extern void AROS_SLIB_ENTRY(atanh881, STDC, 139)(void);
49 extern void AROS_SLIB_ENTRY(cosh881, STDC, 140)(void);
50 extern void AROS_SLIB_ENTRY(exp881, STDC, 143)(void);
51 extern void AROS_SLIB_ENTRY(fmod881, STDC, 176)(void);
52 extern void AROS_SLIB_ENTRY(hypot881, STDC, 159)(void);
54 static int STDCM68KMATH_Init(struct StdCBase *StdCBase)
56 if ((SysBase->AttnFlags & AFF_68060) && (SysBase->AttnFlags & AFF_FPU)) {
57 /* Override supported MC68060+ math functions */
58 __AROS_SETVECADDR(StdCBase, 159, AROS_SLIB_ENTRY(hypot881, STDC, 159));
59 __AROS_SETVECADDR(StdCBase, 161, AROS_SLIB_ENTRY(sqrt881, STDC, 161));
60 __AROS_SETVECADDR(StdCBase, 166, AROS_SLIB_ENTRY(ceil881, STDC, 166));
61 __AROS_SETVECADDR(StdCBase, 179, AROS_SLIB_ENTRY(copysign881, STDC, 179));
62 __AROS_SETVECADDR(StdCBase, 158, AROS_SLIB_ENTRY(fabs881, STDC, 158));
63 __AROS_SETVECADDR(StdCBase, 183, AROS_SLIB_ENTRY(fdim881, STDC, 183));
64 __AROS_SETVECADDR(StdCBase, 167, AROS_SLIB_ENTRY(floor881, STDC, 167));
65 __AROS_SETVECADDR(StdCBase, 186, AROS_SLIB_ENTRY(fma881, STDC, 186));
66 __AROS_SETVECADDR(StdCBase, 184, AROS_SLIB_ENTRY(fmax881, STDC, 184));
67 __AROS_SETVECADDR(StdCBase, 185, AROS_SLIB_ENTRY(fmin881, STDC, 185));
68 __AROS_SETVECADDR(StdCBase, 113, AROS_SLIB_ENTRY(fpclassify881, STDC, 113));
69 __AROS_SETVECADDR(StdCBase, 115, AROS_SLIB_ENTRY(isfinite881, STDC, 115));
70 __AROS_SETVECADDR(StdCBase, 118, AROS_SLIB_ENTRY(isinf881, STDC, 118));
71 __AROS_SETVECADDR(StdCBase, 121, AROS_SLIB_ENTRY(isnan881, STDC, 121));
72 __AROS_SETVECADDR(StdCBase, 124, AROS_SLIB_ENTRY(isnormal881, STDC, 124));
73 __AROS_SETVECADDR(StdCBase, 173, AROS_SLIB_ENTRY(lround881, STDC, 173));
74 __AROS_SETVECADDR(StdCBase, 168, AROS_SLIB_ENTRY(nearbyint881, STDC, 168));
75 __AROS_SETVECADDR(StdCBase, 172, AROS_SLIB_ENTRY(round881, STDC, 172));
76 __AROS_SETVECADDR(StdCBase, 128, AROS_SLIB_ENTRY(signbit881, STDC, 128));
77 __AROS_SETVECADDR(StdCBase, 175, AROS_SLIB_ENTRY(trunc881, STDC, 175));
79 else if ((SysBase->AttnFlags & AFF_68881) || (SysBase->AttnFlags & AFF_68882)) {
80 /* Override supported 68881/68882 math functions */
81 __AROS_SETVECADDR(StdCBase, 130, AROS_SLIB_ENTRY(acos881, STDC, 130));
82 __AROS_SETVECADDR(StdCBase, 152, AROS_SLIB_ENTRY(log2881, STDC, 152));
83 __AROS_SETVECADDR(StdCBase, 150, AROS_SLIB_ENTRY(log10881, STDC, 150));
84 __AROS_SETVECADDR(StdCBase, 149, AROS_SLIB_ENTRY(log881, STDC, 149));
85 __AROS_SETVECADDR(StdCBase, 177, AROS_SLIB_ENTRY(remainder881, STDC, 177));
86 __AROS_SETVECADDR(StdCBase, 141, AROS_SLIB_ENTRY(sinh881, STDC, 141));
87 __AROS_SETVECADDR(StdCBase, 161, AROS_SLIB_ENTRY(sqrt881, STDC, 161));
88 __AROS_SETVECADDR(StdCBase, 132, AROS_SLIB_ENTRY(atan881, STDC, 132));
89 __AROS_SETVECADDR(StdCBase, 166, AROS_SLIB_ENTRY(ceil881, STDC, 166));
90 __AROS_SETVECADDR(StdCBase, 179, AROS_SLIB_ENTRY(copysign881, STDC, 179));
91 __AROS_SETVECADDR(StdCBase, 134, AROS_SLIB_ENTRY(cos881, STDC, 134));
92 __AROS_SETVECADDR(StdCBase, 144, AROS_SLIB_ENTRY(exp2881, STDC, 144));
93 __AROS_SETVECADDR(StdCBase, 158, AROS_SLIB_ENTRY(fabs881, STDC, 158));
94 __AROS_SETVECADDR(StdCBase, 183, AROS_SLIB_ENTRY(fdim881, STDC, 183));
95 __AROS_SETVECADDR(StdCBase, 167, AROS_SLIB_ENTRY(floor881, STDC, 167));
96 __AROS_SETVECADDR(StdCBase, 186, AROS_SLIB_ENTRY(fma881, STDC, 186));
97 __AROS_SETVECADDR(StdCBase, 184, AROS_SLIB_ENTRY(fmax881, STDC, 184));
98 __AROS_SETVECADDR(StdCBase, 185, AROS_SLIB_ENTRY(fmin881, STDC, 185));
99 __AROS_SETVECADDR(StdCBase, 113, AROS_SLIB_ENTRY(fpclassify881, STDC, 113));
100 __AROS_SETVECADDR(StdCBase, 115, AROS_SLIB_ENTRY(isfinite881, STDC, 115));
101 __AROS_SETVECADDR(StdCBase, 118, AROS_SLIB_ENTRY(isinf881, STDC, 118));
102 __AROS_SETVECADDR(StdCBase, 121, AROS_SLIB_ENTRY(isnan881, STDC, 121));
103 __AROS_SETVECADDR(StdCBase, 124, AROS_SLIB_ENTRY(isnormal881, STDC, 124));
104 __AROS_SETVECADDR(StdCBase, 173, AROS_SLIB_ENTRY(lround881, STDC, 173));
105 __AROS_SETVECADDR(StdCBase, 168, AROS_SLIB_ENTRY(nearbyint881, STDC, 168));
106 __AROS_SETVECADDR(StdCBase, 172, AROS_SLIB_ENTRY(round881, STDC, 172));
107 __AROS_SETVECADDR(StdCBase, 128, AROS_SLIB_ENTRY(signbit881, STDC, 128));
108 __AROS_SETVECADDR(StdCBase, 135, AROS_SLIB_ENTRY(sin881, STDC, 135));
109 __AROS_SETVECADDR(StdCBase, 136, AROS_SLIB_ENTRY(tan881, STDC, 136));
110 __AROS_SETVECADDR(StdCBase, 142, AROS_SLIB_ENTRY(tanh881, STDC, 142));
111 __AROS_SETVECADDR(StdCBase, 175, AROS_SLIB_ENTRY(trunc881, STDC, 175));
112 __AROS_SETVECADDR(StdCBase, 131, AROS_SLIB_ENTRY(asin881, STDC, 131));
113 __AROS_SETVECADDR(StdCBase, 139, AROS_SLIB_ENTRY(atanh881, STDC, 139));
114 __AROS_SETVECADDR(StdCBase, 140, AROS_SLIB_ENTRY(cosh881, STDC, 140));
115 __AROS_SETVECADDR(StdCBase, 143, AROS_SLIB_ENTRY(exp881, STDC, 143));
116 __AROS_SETVECADDR(StdCBase, 176, AROS_SLIB_ENTRY(fmod881, STDC, 176));
117 __AROS_SETVECADDR(StdCBase, 159, AROS_SLIB_ENTRY(hypot881, STDC, 159));
120 return TRUE;
123 ADD2INITLIB(STDCM68KMATH_Init, 0)
124 #endif