libraries: libc: fix for `FSin` implementation

This commit is contained in:
psucien 2024-05-29 16:02:49 +02:00
parent efeb78f59c
commit fb237bddad
2 changed files with 9 additions and 3 deletions

View File

@ -2,6 +2,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#include <cmath> #include <cmath>
#include "common/assert.h"
#include "core/libraries/libc/libc_math.h" #include "core/libraries/libc/libc_math.h"
namespace Libraries::LibC { namespace Libraries::LibC {
@ -38,9 +39,14 @@ double PS4_SYSV_ABI ps4__Sin(double x) {
return sin(x); return sin(x);
} }
float PS4_SYSV_ABI ps4__Fsin(float arg) { float PS4_SYSV_ABI ps4__Fsin(float arg, unsigned int m, int n) {
ASSERT(n == 0);
if (m != 0) {
return cosf(arg);
} else {
return sinf(arg); return sinf(arg);
} }
}
double PS4_SYSV_ABI ps4_exp2(double arg) { double PS4_SYSV_ABI ps4_exp2(double arg) {
return exp2(arg); return exp2(arg);

View File

@ -13,7 +13,7 @@ float PS4_SYSV_ABI ps4_tanf(float num);
float PS4_SYSV_ABI ps4_asinf(float num); float PS4_SYSV_ABI ps4_asinf(float num);
double PS4_SYSV_ABI ps4_pow(double base, double exponent); double PS4_SYSV_ABI ps4_pow(double base, double exponent);
double PS4_SYSV_ABI ps4__Sin(double x); double PS4_SYSV_ABI ps4__Sin(double x);
float PS4_SYSV_ABI ps4__Fsin(float arg); float PS4_SYSV_ABI ps4__Fsin(float arg, unsigned int,int);
double PS4_SYSV_ABI ps4_exp2(double arg); double PS4_SYSV_ABI ps4_exp2(double arg);
float PS4_SYSV_ABI ps4_powf(float x, float y); float PS4_SYSV_ABI ps4_powf(float x, float y);
float PS4_SYSV_ABI ps4_roundf(float arg); float PS4_SYSV_ABI ps4_roundf(float arg);