work on libc64

This commit is contained in:
Prakxo
2023-03-06 08:28:43 +00:00
parent ed41ef92d4
commit 4c8ff8c2a2
17 changed files with 164 additions and 12 deletions
+25
View File
@@ -0,0 +1,25 @@
#ifndef W_MATH_H
#define W_MATH_H
#include "types.h"
inline float sqrtf(float x)
{
static const double _half=.5;
static const double _three=3.0;
volatile float y;
if(x > 0.0f)
{
double guess = __frsqrte((double)x); // returns an approximation to
guess = _half*guess*(_three - guess*guess*x); // now have 12 sig bits
guess = _half*guess*(_three - guess*guess*x); // now have 24 sig bits
guess = _half*guess*(_three - guess*guess*x); // now have 32 sig bits
y=(float)(x*guess);
return y;
}
return x;
}
f64 atan2(f64, f64);
f64 acos(f32);
#endif
+5
View File
@@ -4,4 +4,9 @@
#include "types.h"
s16 sins(u16);
f32 fatan2(f32, f32);
f64 fsqrt(f32);
f32 facos(f32);
#endif
+11
View File
@@ -0,0 +1,11 @@
#ifndef LQRAND_H
#define LQRAND_H
#include "types.h"
u32 qrand(void);
void sqrand(u32);
f32 fqrand(void);
f64 fqrand2(void);
#endif
+8
View File
@@ -0,0 +1,8 @@
#ifndef LDEBUG_H
#define LDEBUG_H
#include "types.h"
void _dbg_hungup(const char*, s32);
#endif
+13
View File
@@ -0,0 +1,13 @@
#ifndef LOS_THREAD_H
#define LOS_THREAD_H
#include "types.h"
#include "dolphin/OSThread.h"
typedef s32 OSPri;
typedef s32 OSId;
OSId osGetThreadId(OSThread*);
#endif