Skip to content

Commit

Permalink
merge in more MSL
Browse files Browse the repository at this point in the history
  • Loading branch information
shibbo committed Oct 29, 2024
1 parent 0e791c7 commit f846d2e
Show file tree
Hide file tree
Showing 32 changed files with 146 additions and 96 deletions.
34 changes: 31 additions & 3 deletions config/RMGK01/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11209,7 +11209,7 @@ MSL_C/strtold.c:
extabindex start:0x80006FAC end:0x80006FB8
.text start:0x80520000 end:0x805213F4
.rodata start:0x805628E0 end:0x80562EF0
.sdata2 start:0x806C23B0 end:0x806C28E8
.sdata2 start:0x806C23B0 end:0x806C23D8

MSL_C/strtoul.c:
extab start:0x80006910 end:0x80006930
Expand All @@ -11224,7 +11224,7 @@ MSL_C/wprintf.c:
extab start:0x80006930 end:0x80006970
extabindex start:0x80006FE8 end:0x80007048
.text start:0x80521E84 end:0x805240C8
.rodata start:0x80562EF0 end:0x80563210
.rodata start:0x80562EF0 end:0x80562EF8
.data start:0x80609FC0 end:0x8060A268

MSL_C/wstring.c:
Expand All @@ -11243,7 +11243,7 @@ MSL_C/abort_exit_ppc_eabi.c:
extab start:0x80006978 end:0x80006980
extabindex start:0x80007054 end:0x80007060
.text start:0x80524300 end:0x80524334
.sbss start:0x806B7BD0 end:0x806B7BE8
.sbss start:0x806B7BD0 end:0x806B7BD8

MSL_C/math_sun.c:
extab start:0x80006980 end:0x80006988
Expand All @@ -11255,66 +11255,93 @@ MSL_C/extras.c:

MSL_C/MSL_Common_Embedded/Math/Double_precision/e_acos.c:
.text start:0x805244C8 end:0x8052478C
.sdata2 start:0x806C23D8 end:0x806C2460

MSL_C/MSL_Common_Embedded/Math/Double_precision/e_asin.c:
.text start:0x8052478C end:0x80524A24
.sdata2 start:0x806C2460 end:0x806C24E8

MSL_C/MSL_Common_Embedded/Math/Double_precision/e_atan2.c:
.text start:0x80524A24 end:0x80524C94
.sdata2 start:0x806C24E8 end:0x806C2540

MSL_C/MSL_Common_Embedded/Math/Double_precision/e_fmod.c:
.text start:0x80524C94 end:0x80524FC4
.rodata start:0x80562EF8 end:0x80562F08

MSL_C/MSL_Common_Embedded/Math/Double_precision/e_log.c:
.text start:0x80524FC4 end:0x80525278
.sbss start:0x806B7BD8 end:0x806B7BE0
.sdata2 start:0x806C2540 end:0x806C25C0

MSL_C/MSL_Common_Embedded/Math/Double_precision/e_log10.c:
.text start:0x80525278 end:0x8052538C
.sbss start:0x806B7BE0 end:0x806B7BE8
.sdata2 start:0x806C25C0 end:0x806C25F0

MSL_C/MSL_Common_Embedded/Math/Double_precision/e_pow.c:
.text start:0x8052538C end:0x80525BD4
.rodata start:0x80562F08 end:0x80563040
.sdata2 start:0x806C25F0 end:0x806C2700

MSL_C/MSL_Common_Embedded/Math/Double_precision/e_rem_pio2.c:
.text start:0x80525BD4 end:0x80525F6C
.rodata start:0x80563040 end:0x805630C0
.sdata2 start:0x806C2700 end:0x806C2758

MSL_C/MSL_Common_Embedded/Math/Double_precision/k_cos.c:
.text start:0x80525F6C end:0x8052607C
.sdata2 start:0x806C2758 end:0x806C27A0

MSL_C/MSL_Common_Embedded/Math/Double_precision/k_rem_pio2.c:
.text start:0x8052607C end:0x80527788
.rodata start:0x805630C0 end:0x80563110
.sdata2 start:0x806C27A0 end:0x806C27E0

MSL_C/MSL_Common_Embedded/Math/Double_precision/k_sin.c:
.text start:0x80527788 end:0x80527848
.sdata2 start:0x806C27E0 end:0x806C2818

MSL_C/MSL_Common_Embedded/Math/Double_precision/k_tan.c:
.text start:0x80527848 end:0x80527AA0
.rodata start:0x80563110 end:0x80563178
.sdata2 start:0x806C2818 end:0x806C2850

MSL_C/MSL_Common_Embedded/Math/Double_precision/s_atan.c:
.text start:0x80527AA0 end:0x80527CE0
.rodata start:0x80563178 end:0x80563210
.sdata2 start:0x806C2850 end:0x806C2878

MSL_C/MSL_Common_Embedded/Math/Double_precision/s_ceil.c:
.text start:0x80527CE0 end:0x80527E20
.sdata2 start:0x806C2878 end:0x806C2888

MSL_C/MSL_Common_Embedded/Math/Double_precision/s_copysign.c:
.text start:0x80527E20 end:0x80527E4C

MSL_C/MSL_Common_Embedded/Math/Double_precision/s_cos.c:
.text start:0x80527E4C end:0x80527F20
.sdata2 start:0x806C2888 end:0x806C2890

MSL_C/MSL_Common_Embedded/Math/Double_precision/s_floor.c:
.text start:0x80527F20 end:0x80528064
.sdata2 start:0x806C2890 end:0x806C28A0

MSL_C/MSL_Common_Embedded/Math/Double_precision/s_frexp.c:
.text start:0x80528064 end:0x805280EC
.sdata2 start:0x806C28A0 end:0x806C28A8

MSL_C/MSL_Common_Embedded/Math/Double_precision/s_ldexp.c:
.text start:0x805280EC end:0x80528258
.sdata2 start:0x806C28A8 end:0x806C28D0

MSL_C/MSL_Common_Embedded/Math/Double_precision/s_sin.c:
.text start:0x80528258 end:0x80528330
.sdata2 start:0x806C28D0 end:0x806C28D8

MSL_C/MSL_Common_Embedded/Math/Double_precision/s_tan.c:
.text start:0x80528330 end:0x805283A8
.sdata2 start:0x806C28D8 end:0x806C28E0

MSL_C/MSL_Common_Embedded/Math/Double_precision/w_acos.c:
.text start:0x805283A8 end:0x805283AC
Expand All @@ -11336,6 +11363,7 @@ MSL_C/MSL_Common_Embedded/Math/Double_precision/w_pow.c:

MSL_C/MSL_Common_Embedded/Math/Double_precision/e_sqrt.c:
.text start:0x805283C0 end:0x80528608
.sdata2 start:0x806C28E0 end:0x806C28E8

MSL_C/PPC_EABI/SRC/math_ppc.c:
.text start:0x80528608 end:0x8052860C
Expand Down
70 changes: 35 additions & 35 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,18 +322,18 @@
"-align powerpc",
"-enum int",
"-fp hardware",
"-Cpp_exceptions on",
"-Cpp_exceptions off",
"-O4,p",
"-inline auto",
'-pragma "cats off"',
'-pragma "warn_notinlined off"',
"-maxerrors 1",
"-nosyspath",
"-RTTI off",
"-fp_contract on",
"-str reuse",
"-enc SJIS",
"-ipa file",
"-use_lmw_stmw on",
"-i libs/MSL_C/include",
"-i libs/MetroTRK/include",
"-i libs/RVL_SDK/include",
Expand Down Expand Up @@ -2790,48 +2790,48 @@ def JSysLib(lib_name: str, objects: List[Object]) -> Dict[str, Any]:
Object(NonMatching, "MSL_C/misc_io.c"),
Object(NonMatching, "MSL_C/printf.c"),
Object(NonMatching, "MSL_C/scanf.c"),
Object(NonMatching, "MSL_C/signal.c"),
Object(NonMatching, "MSL_C/string.c"),
Object(Matching, "MSL_C/signal.c"),
Object(Matching, "MSL_C/string.c"),
Object(NonMatching, "MSL_C/strtold.c"),
Object(NonMatching, "MSL_C/strtoul.c"),
Object(NonMatching, "MSL_C/wmem.c"),
Object(Matching, "MSL_C/strtoul.c"),
Object(Matching, "MSL_C/wmem.c"),
Object(NonMatching, "MSL_C/wprintf.c"),
Object(NonMatching, "MSL_C/wstring.c"),
Object(NonMatching, "MSL_C/wchar_io.c"),
Object(Matching, "MSL_C/wstring.c"),
Object(Matching, "MSL_C/wchar_io.c"),
Object(NonMatching, "MSL_C/uart_console_io_gcn.c"),
Object(NonMatching, "MSL_C/abort_exit_ppc_eabi.c"),
Object(NonMatching, "MSL_C/math_sun.c"),
Object(NonMatching, "MSL_C/extras.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_acos.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_asin.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_atan2.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_fmod.c"),
Object(Matching, "MSL_C/math_sun.c"),
Object(Matching, "MSL_C/extras.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_acos.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_asin.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_atan2.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_fmod.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_log.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_log10.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_log10.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_pow.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_rem_pio2.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/k_cos.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/k_rem_pio2.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/k_sin.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/k_tan.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/k_cos.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/k_rem_pio2.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/k_sin.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/k_tan.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/s_atan.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/s_ceil.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/s_copysign.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/s_cos.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/s_floor.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/s_frexp.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/s_ldexp.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/s_sin.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/s_tan.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/w_acos.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/w_asin.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/w_atan2.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/w_fmod.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/w_log10.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/w_pow.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_sqrt.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/s_ceil.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/s_copysign.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/s_cos.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/s_floor.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/s_frexp.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/s_ldexp.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/s_sin.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/s_tan.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/w_acos.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/w_asin.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/w_atan2.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/w_fmod.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/w_log10.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/w_pow.c"),
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_sqrt.c"),
Object(NonMatching, "MSL_C/PPC_EABI/SRC/math_ppc.c"),
Object(NonMatching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/w_sqrt.c")
Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/w_sqrt.c")
]
),

Expand Down
File renamed without changes.
79 changes: 79 additions & 0 deletions src/MSL_C/MSL_Common_Embedded/Math/Double_precision/e_asin.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#include <cmath>

extern double sqrt(double);
int __float_nan[];
#define NAN (*(float*) __float_nan)

#define __LO(x) ( sizeof(x)==8 ? *(1+(int*)&x) : (*(int*)&x))
#define __HI(x) (*(int*)&x)
#define __ULO(x) ( sizeof(x)==8 ? *(1+(uint*)&x) : (*(uint*)&x))
#define __UHI(x) (*(uint*)&x)

#ifdef __STDC__
static const double
#else
static double
#endif
one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
big = 1.000e+300,
pio2_hi = 1.57079632679489655800e+00, /* 0x3FF921FB, 0x54442D18 */
pio2_lo = 6.12323399573676603587e-17, /* 0x3C91A626, 0x33145C07 */
pio4_hi = 7.85398163397448278999e-01, /* 0x3FE921FB, 0x54442D18 */
/* coefficient for R(x^2) */
pS0 = 1.66666666666666657415e-01, /* 0x3FC55555, 0x55555555 */
pS1 = -3.25565818622400915405e-01, /* 0xBFD4D612, 0x03EB6F7D */
pS2 = 2.01212532134862925881e-01, /* 0x3FC9C155, 0x0E884455 */
pS3 = -4.00555345006794114027e-02, /* 0xBFA48228, 0xB5688F3B */
pS4 = 7.91534994289814532176e-04, /* 0x3F49EFE0, 0x7501B288 */
pS5 = 3.47933107596021167570e-05, /* 0x3F023DE1, 0x0DFDF709 */
qS1 = -2.40339491173441421878e+00, /* 0xC0033A27, 0x1C8A2D4B */
qS2 = 2.02094576023350569471e+00, /* 0x40002AE5, 0x9C598AC8 */
qS3 = -6.88283971605453293030e-01, /* 0xBFE6066C, 0x1B8D0159 */
qS4 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */

#ifdef __STDC__
double __ieee754_asin(double x)
#else
double __ieee754_asin(x)
double x;
#endif
{
double t,w,p,q,c,r,s;
int hx,ix; /*- cc 020130 -*/
hx = __HI(x);
ix = hx&0x7fffffff;
if(ix>= 0x3ff00000) { /* |x|>= 1 */
if(((ix-0x3ff00000)|__LO(x))==0)
/* asin(1)=+-pi/2 with inexact */
return x*pio2_hi+x*pio2_lo;
return NAN; /* asin(|x|>1) is NaN */
} else if (ix<0x3fe00000) { /* |x|<0.5 */
if(ix<0x3e400000) { /* if |x| < 2**-27 */
if(big+x>one) return x;/* return x with inexact if x!=0*/
} else
t = x*x;
p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
w = p/q;
return x+x*w;
}
/* 1> |x|>= 0.5 */
w = one-__fabs(x);
t = w*0.5;
p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
s = sqrt(t);
if(ix>=0x3FEF3333) { /* if |x| > 0.975 */
w = p/q;
t = pio2_hi-(2.0*(s+s*w)-pio2_lo);
} else {
w = s;
__LO(w) = 0;
c = (t-w*w)/(s+w);
r = p/q;
p = 2.0*s*r-(pio2_lo-2.0*c);
q = pio4_hi-2.0*w;
t = pio4_hi-(p-q);
}
if(hx>0) return t; else return -t;
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,4 @@ double __ieee754_fmod(double x, double y) {
}

return x;
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
57 changes: 0 additions & 57 deletions src/MSL_C/e_asin.c

This file was deleted.

0 comments on commit f846d2e

Please sign in to comment.