@@ -105,52 +105,74 @@ end
105105# ###########################################################################################
106106
107107MATH_INTR_FUNCS_1_ARG = [
108- abs,
109- acos,
110- # acosh, # not defined for values < 1, tested separately
111- asin,
112- asinh,
113- atan,
114- atanh,
115- ceil,
116- cos,
117- cosh,
118- cospi,
119- exp,
120- exp2,
121- exp10,
122- floor,
123- Metal. fract,
124- log,
125- log2,
126- log10,
127- # Metal.rint, # not sure what the behaviour actually is
128- round,
129- Metal. rsqrt,
130- sin,
131- sinh,
132- sinpi,
133- sqrt,
134- tan,
135- tanh,
136- tanpi,
137- trunc,
108+ # Common functions
109+ # saturate, # T saturate(T x) Clamp between 0.0 and 1.0
110+ # sign, # T sign(T x) returns 0.0 if x is NaN. Not tested because intrinsic not yet defined
111+
112+ # float math
113+ acos, # T acos(T x)
114+ asin, # T asin(T x)
115+ asinh, # T asinh(T x)
116+ atan, # T atan(T x)
117+ atanh, # T atanh(T x)
118+ ceil, # T ceil(T x)
119+ cos, # T cos(T x)
120+ cosh, # T cosh(T x)
121+ cospi, # T cospi(T x)
122+ exp, # T exp(T x)
123+ exp2, # T exp2(T x)
124+ exp10, # T exp10(T x)
125+ abs, # T [f]abs(T x)
126+ floor, # T floor(T x)
127+ Metal. fract, # T fract(T x)
128+ # ilogb, # Ti ilogb(T x)
129+ log, # T log(T x)
130+ log2, # T log2(T x)
131+ log10, # T log10(T x)
132+ # Metal.rint, # T rint(T x) # not sure what the behaviour actually is
133+ round, # T round(T x)
134+ Metal. rsqrt, # T rsqrt(T x)
135+ sin, # T sin(T x)
136+ sinh, # T sinh(T x)
137+ sinpi, # T sinpi(T x)
138+ sqrt, # sqrt(T x)
139+ tan, # T tan(T x)
140+ tanh, # T tanh(T x)
141+ tanpi, # T tanpi(T x)
142+ trunc, # T trunc(T x)
138143]
139144Metal. rsqrt (x:: Float16 ) = 1 / sqrt (x)
140145Metal. rsqrt (x:: Float32 ) = 1 / sqrt (x)
141146Metal. fract (x:: Float16 ) = mod (x, 1 )
142147Metal. fract (x:: Float32 ) = mod (x, 1 )
143148
144149MATH_INTR_FUNCS_2_ARG = [
145- min,
146- max,
147- pow, # :(^),
148- Metal. powr,
149- hypot,
150+ # Common function
151+ # step, # T step(T edge, T x) Returns 0.0 if x < edge, otherwise it returns 1.0
152+
153+ # float math
154+ # atan2, # T atan2(T x, T y) Compute arc tangent of y over x.
155+ # fdim, # T fdim(T x, T y)
156+ max, # T [f]max(T x, T y)
157+ min, # T [f]min(T x, T y)
158+ # fmod, # T fmod(T x, T y)
159+ # frexp, # T frexp(T x, Ti &exponent)
160+ # ldexp, # T ldexp(T x, Ti k)
161+ # modf, # T modf(T x, T &intval)
162+ # nextafter, # T nextafter(T x, T y) # Metal 3.1+
163+ # sincos,
164+ hypot, # NOT MSL but tested the same
150165]
151166
152167MATH_INTR_FUNCS_3_ARG = [
153- fma,
168+ # Common functions
169+ # clamp, # T clamp(T x, T minval, T maxval). Not tested because intrinsic not yet defined
170+ # mix, # T mix(T x, T y, T a) # x+(y-x)*a
171+ # smoothstep, # T smoothstep(T edge0, T edge1, T x)
172+ fma, # T fma(T a, T b, T c)
173+ # max3, # T max3(T x, T y, T z)
174+ # median3, # T median3(T x, T y, T z)
175+ # min3, # T min3(T x, T y, T z)
154176]
155177
156178@testset " math" begin
0 commit comments