Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
Fix frexp implementation, update to tot slang. (#68)
Browse files Browse the repository at this point in the history
* Fix frexp implementation

* Update slang

* Fix.

---------

Co-authored-by: Yong He <[email protected]>
  • Loading branch information
csyonghe and csyonghe authored Oct 26, 2023
1 parent 0e48669 commit ab3647e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion external/slang
Submodule slang updated 426 files
16 changes: 6 additions & 10 deletions source/slang-llvm/slang-llvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,19 +321,15 @@ struct NameAndFunc
#define SLANG_LLVM_FUNC(name, cppName, retType, paramTypes) NameAndFunc{ #name, (NameAndFunc::Func)static_cast<retType (*) paramTypes>(&SLANG_LLVM_EXPAND(cppName)) },

// Implementations of maths functions available to JIT
static float F32_frexp(float x, float* e)
static float F32_frexp(float x, int* e)
{
int ei;
float m = ::frexpf(x, &ei);
*e = float(ei);
float m = ::frexpf(x, e);
return m;
}

static double F64_frexp(double x, double* e)
static double F64_frexp(double x, int* e)
{
int ei;
double m = ::frexp(x, &ei);
*e = double(ei);
double m = ::frexp(x, e);
return m;
}

Expand Down Expand Up @@ -422,7 +418,7 @@ static uint64_t __stdcall _aulldiv(uint64_t a, uint64_t b)
\
x(F64_atan2, atan2, double, (double, double)) \
\
x(F64_frexp, F64_frexp, double, (double, double*)) \
x(F64_frexp, F64_frexp, double, (double, int*)) \
x(F64_pow, pow, double, (double, double)) \
\
x(F64_modf, modf, double, (double, double*)) \
Expand Down Expand Up @@ -457,7 +453,7 @@ static uint64_t __stdcall _aulldiv(uint64_t a, uint64_t b)
\
x(F32_atan2, atan2f, float, (float, float)) \
\
x(F32_frexp, F32_frexp, float, (float, float*)) \
x(F32_frexp, F32_frexp, float, (float, int*)) \
x(F32_pow, powf, float, (float, float)) \
\
x(F32_modf, modff, float, (float, float*)) \
Expand Down

0 comments on commit ab3647e

Please sign in to comment.