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
#include <cmath>
#include "common/assert.h"
#include "core/libraries/libc/libc_math.h"
namespace Libraries::LibC {
@ -38,8 +39,13 @@ double PS4_SYSV_ABI ps4__Sin(double x) {
return sin(x);
}
float PS4_SYSV_ABI ps4__Fsin(float arg) {
return sinf(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);
}
}
double PS4_SYSV_ABI ps4_exp2(double arg) {

View file

@ -13,7 +13,7 @@ float PS4_SYSV_ABI ps4_tanf(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__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);
float PS4_SYSV_ABI ps4_powf(float x, float y);
float PS4_SYSV_ABI ps4_roundf(float arg);