Implement & link initial_menu

This commit is contained in:
Cuyler36
2023-05-23 18:49:30 -04:00
parent 2f7b56bdef
commit b709ef9fbc
26 changed files with 1276 additions and 108 deletions
+19 -1
View File
@@ -2,7 +2,9 @@
#define W_MATH_H
#include "types.h"
inline float sqrtf(float x)
/* this is needed to keep $localstatic$ variables out of the rel */
#ifndef OPTIMIZED_SQRTF
extern inline float sqrtf(float x)
{
static const double _half=.5;
static const double _three=3.0;
@@ -18,6 +20,22 @@ inline float sqrtf(float x)
}
return x;
}
#else
extern inline float sqrtf(float x)
{
volatile float y;
if(x > 0.0f)
{
double guess = __frsqrte((double)x); // returns an approximation to
guess = .5*guess*(3.0 - guess*guess*x); // now have 12 sig bits
guess = .5*guess*(3.0 - guess*guess*x); // now have 24 sig bits
guess = .5*guess*(3.0 - guess*guess*x); // now have 32 sig bits
y=(float)(x*guess);
return y;
}
return x;
}
#endif
extern inline double fabs(double x)
{