Skip to content

Commit

Permalink
Add fmodf for float16, float, and double.
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubaker authored Oct 30, 2023
1 parent 5725fb8 commit 26584f6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions stdlib.ispc
Original file line number Diff line number Diff line change
Expand Up @@ -1631,16 +1631,28 @@ __declspec(safe, cost2) static inline uniform double ceil(uniform double x) { re
///////////////////////////
__declspec(safe, cost2) static inline float16 trunc(float16 x) { return __trunc_varying_half(x); }

__declspec(safe, cost2) static inline float16 fmodf(float16 x, float16 y) { return x - trunc(x / y) * y; }

__declspec(safe, cost2) static inline uniform float16 trunc(uniform float16 x) { return __trunc_uniform_half(x); }

__declspec(safe, cost2) static inline uniform float16 fmodf(uniform float16 x, uniform float16 y) { return x - trunc(x / y) * y; }

__declspec(safe, cost2) static inline float trunc(float x) { return __trunc_varying_float(x); }

__declspec(safe, cost2) static inline float fmodf(float x, float y) { return x - trunc(x / y) * y; }

__declspec(safe, cost2) static inline uniform float trunc(uniform float x) { return __trunc_uniform_float(x); }

__declspec(safe, cost2) static inline uniform float fmodf(uniform float x, uniform float y) { return x - trunc(x / y) * y; }

__declspec(safe, cost2) static inline double trunc(double x) { return __trunc_varying_double(x); }

__declspec(safe, cost2) static inline double fmodf(double x, double y) { return x - trunc(x / y) * y; }

__declspec(safe, cost2) static inline uniform double trunc(uniform double x) { return __trunc_uniform_double(x); }

__declspec(safe, cost2) static inline uniform double fmodf(uniform double x, uniform double y) { return x - trunc(x / y) * y; }

__declspec(safe) static inline float rcp(float v) { return __rcp_varying_float(v); }

__declspec(safe) static inline uniform float rcp(uniform float v) { return __rcp_uniform_float(v); }
Expand Down

0 comments on commit 26584f6

Please sign in to comment.