lib/libm: Reduce size of static two_over_pi array.
Thanks to Jeff Epler for the idea. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
40ad8f1666
commit
38959ed8f1
|
@ -35,9 +35,9 @@
|
||||||
* Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi
|
* Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi
|
||||||
*/
|
*/
|
||||||
#ifdef __STDC__
|
#ifdef __STDC__
|
||||||
static const __int32_t two_over_pi[] = {
|
static const __uint8_t two_over_pi[] = {
|
||||||
#else
|
#else
|
||||||
static __int32_t two_over_pi[] = {
|
static __uint8_t two_over_pi[] = {
|
||||||
#endif
|
#endif
|
||||||
0xA2, 0xF9, 0x83, 0x6E, 0x4E, 0x44, 0x15, 0x29, 0xFC,
|
0xA2, 0xF9, 0x83, 0x6E, 0x4E, 0x44, 0x15, 0x29, 0xFC,
|
||||||
0x27, 0x57, 0xD1, 0xF5, 0x34, 0xDD, 0xC0, 0xDB, 0x62,
|
0x27, 0x57, 0xD1, 0xF5, 0x34, 0xDD, 0xC0, 0xDB, 0x62,
|
||||||
|
|
|
@ -188,7 +188,7 @@ extern float __ieee754_scalbf __P((float,float));
|
||||||
extern float __kernel_sinf __P((float,float,int));
|
extern float __kernel_sinf __P((float,float,int));
|
||||||
extern float __kernel_cosf __P((float,float));
|
extern float __kernel_cosf __P((float,float));
|
||||||
extern float __kernel_tanf __P((float,float,int));
|
extern float __kernel_tanf __P((float,float,int));
|
||||||
extern int __kernel_rem_pio2f __P((float*,float*,int,int,int,const __int32_t*));
|
extern int __kernel_rem_pio2f __P((float*,float*,int,int,int,const __uint8_t*));
|
||||||
|
|
||||||
/* A union which permits us to convert between a float and a 32 bit
|
/* A union which permits us to convert between a float and a 32 bit
|
||||||
int. */
|
int. */
|
||||||
|
|
|
@ -62,10 +62,10 @@ two8 = 2.5600000000e+02f, /* 0x43800000 */
|
||||||
twon8 = 3.9062500000e-03f; /* 0x3b800000 */
|
twon8 = 3.9062500000e-03f; /* 0x3b800000 */
|
||||||
|
|
||||||
#ifdef __STDC__
|
#ifdef __STDC__
|
||||||
int __kernel_rem_pio2f(float *x, float *y, int e0, int nx, int prec, const __int32_t *ipio2)
|
int __kernel_rem_pio2f(float *x, float *y, int e0, int nx, int prec, const __uint8_t *ipio2)
|
||||||
#else
|
#else
|
||||||
int __kernel_rem_pio2f(x,y,e0,nx,prec,ipio2)
|
int __kernel_rem_pio2f(x,y,e0,nx,prec,ipio2)
|
||||||
float x[], y[]; int e0,nx,prec; __int32_t ipio2[];
|
float x[], y[]; int e0,nx,prec; __uint8_t ipio2[];
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
__int32_t jz,jx,jv,jp,jk,carry,n,iq[20],i,j,k,m,q0,ih;
|
__int32_t jz,jx,jv,jp,jk,carry,n,iq[20],i,j,k,m,q0,ih;
|
||||||
|
|
Loading…
Reference in New Issue