diff --git a/std/math/acos.zig b/std/math/acos.zig index ae7afce03223b1e41b039a34c182190b6bde15eb..7690497da5f627183f4b4420cb29b2ed877df501 100644 --- a/std/math/acos.zig +++ b/std/math/acos.zig @@ -8,8 +8,8 @@ const assert = @import("../debug.zig").assert; pub fn acos(x: var) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(acos32, x), - f64 => @inlineCall(acos64, x), + f32 => acos32(x), + f64 => acos64(x), else => @compileError("acos not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/acosh.zig b/std/math/acosh.zig index 0fdf9e41e0a524f17c716b3868645a153bfab0ea..3b2c2c0f31472c0daf383d20f35e235fbaed4ed8 100644 --- a/std/math/acosh.zig +++ b/std/math/acosh.zig @@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert; pub fn acosh(x: var) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(acosh32, x), - f64 => @inlineCall(acosh64, x), + f32 => acosh32(x), + f64 => acosh64(x), else => @compileError("acosh not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/asin.zig b/std/math/asin.zig index 11aad04107b22f550e6b8e193b69f06d1f43f9aa..c5d24c35e515f372df3edc8091091e9af3082a99 100644 --- a/std/math/asin.zig +++ b/std/math/asin.zig @@ -9,8 +9,8 @@ const assert = @import("../debug.zig").assert; pub fn asin(x: var) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(asin32, x), - f64 => @inlineCall(asin64, x), + f32 => asin32(x), + f64 => asin64(x), else => @compileError("asin not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/asinh.zig b/std/math/asinh.zig index eda7e15861172b7330931db8a5d7c93488e72daf..f963dae77bdf7f672d3fcabf80aff315e04aec99 100644 --- a/std/math/asinh.zig +++ b/std/math/asinh.zig @@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert; pub fn asinh(x: var) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(asinh32, x), - f64 => @inlineCall(asinh64, x), + f32 => asinh32(x), + f64 => asinh64(x), else => @compileError("asinh not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/atan.zig b/std/math/atan.zig index 4527f6bf288d7405fdff9a9df6e258d74d74fff6..cf244eb7627769464097b1f8e891e65053fdf0e4 100644 --- a/std/math/atan.zig +++ b/std/math/atan.zig @@ -9,8 +9,8 @@ const assert = @import("../debug.zig").assert; pub fn atan(x: var) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(atan32, x), - f64 => @inlineCall(atan64, x), + f32 => atan32(x), + f64 => atan64(x), else => @compileError("atan not implemented for " ++ @typeName(T)), }; } @@ -99,11 +99,11 @@ fn atan32(x_: f32) -> f32 { const s1 = z * (aT[0] + w * (aT[2] + w * aT[4])); const s2 = w * (aT[1] + w * aT[3]); - if (id == null) { - return x - x * (s1 + s2); - } else { - const zz = atanhi[??id] - ((x * (s1 + s2) - atanlo[??id]) - x); + if (id) |id_value| { + const zz = atanhi[id_value] - ((x * (s1 + s2) - atanlo[id_value]) - x); return if (sign != 0) -zz else zz; + } else { + return x - x * (s1 + s2); } } @@ -198,16 +198,16 @@ fn atan64(x_: f64) -> f64 { const s1 = z * (aT[0] + w * (aT[2] + w * (aT[4] + w * (aT[6] + w * (aT[8] + w * aT[10]))))); const s2 = w * (aT[1] + w * (aT[3] + w * (aT[5] + w * (aT[7] + w * aT[9])))); - if (id == null) { - return x - x * (s1 + s2); - } else { - const zz = atanhi[??id] - ((x * (s1 + s2) - atanlo[??id]) - x); + if (id) |id_value| { + const zz = atanhi[id_value] - ((x * (s1 + s2) - atanlo[id_value]) - x); return if (sign != 0) -zz else zz; + } else { + return x - x * (s1 + s2); } } test "math.atan" { - assert(atan(f32(0.2)) == atan32(0.2)); + assert(@bitCast(u32, atan(f32(0.2))) == @bitCast(u32, atan32(0.2))); assert(atan(f64(0.2)) == atan64(0.2)); } diff --git a/std/math/atan2.zig b/std/math/atan2.zig index 9124952b74151c67591c19c1b04f422ab4a88cbf..b3af18cd9e71f26ac660541c82e4e2594fec69a3 100644 --- a/std/math/atan2.zig +++ b/std/math/atan2.zig @@ -23,8 +23,8 @@ const assert = @import("../debug.zig").assert; fn atan2(comptime T: type, x: T, y: T) -> T { return switch (T) { - f32 => @inlineCall(atan2_32, x, y), - f64 => @inlineCall(atan2_64, x, y), + f32 => atan2_32(x, y), + f64 => atan2_64(x, y), else => @compileError("atan2 not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/atanh.zig b/std/math/atanh.zig index 2f87efbbd3d26334bb4c798797323dae89eae4df..13de90279bdb3dddc4d2efdbf57a37566f008ae9 100644 --- a/std/math/atanh.zig +++ b/std/math/atanh.zig @@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert; pub fn atanh(x: var) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(atanh_32, x), - f64 => @inlineCall(atanh_64, x), + f32 => atanh_32(x), + f64 => atanh_64(x), else => @compileError("atanh not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/cbrt.zig b/std/math/cbrt.zig index ff353655b56945b195f42ace598172a07e0c0cf0..a8df75dff215c037307551e42b1db09de4f4905a 100644 --- a/std/math/cbrt.zig +++ b/std/math/cbrt.zig @@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert; pub fn cbrt(x: var) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(cbrt32, x), - f64 => @inlineCall(cbrt64, x), + f32 => cbrt32(x), + f64 => cbrt64(x), else => @compileError("cbrt not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/ceil.zig b/std/math/ceil.zig index a8db486f92791bbf21cd90fc28238d25d314cab3..8e27132e25d1e61783e051aa2851a18237330df7 100644 --- a/std/math/ceil.zig +++ b/std/math/ceil.zig @@ -11,8 +11,8 @@ const assert = @import("../debug.zig").assert; pub fn ceil(x: var) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(ceil32, x), - f64 => @inlineCall(ceil64, x), + f32 => ceil32(x), + f64 => ceil64(x), else => @compileError("ceil not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/copysign.zig b/std/math/copysign.zig index 12e092c9abf3508df1c8b3931c53dd5f9cda9401..05205e1a0e7e435901eca10138d02f13116ff84e 100644 --- a/std/math/copysign.zig +++ b/std/math/copysign.zig @@ -3,8 +3,8 @@ const assert = @import("../debug.zig").assert; pub fn copysign(comptime T: type, x: T, y: T) -> T { return switch (T) { - f32 => @inlineCall(copysign32, x, y), - f64 => @inlineCall(copysign64, x, y), + f32 => copysign32(x, y), + f64 => copysign64(x, y), else => @compileError("copysign not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/cos.zig b/std/math/cos.zig index 285a2e538bbf8109a0ee80e294c6089ee400eff5..4c3b8e1282c477632028b23a4653ce9874aae64a 100644 --- a/std/math/cos.zig +++ b/std/math/cos.zig @@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert; pub fn cos(x: var) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(cos32, x), - f64 => @inlineCall(cos64, x), + f32 => cos32(x), + f64 => cos64(x), else => @compileError("cos not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/cosh.zig b/std/math/cosh.zig index f7fea99bcc113348dfe9c74f423b7c7fa24d2f9a..6d40d71b8da23e03f1feaae2c49800155dcbe531 100644 --- a/std/math/cosh.zig +++ b/std/math/cosh.zig @@ -12,8 +12,8 @@ const assert = @import("../debug.zig").assert; pub fn cosh(x: var) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(cosh32, x), - f64 => @inlineCall(cosh64, x), + f32 => cosh32(x), + f64 => cosh64(x), else => @compileError("cosh not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/exp.zig b/std/math/exp.zig index e51221a74a912055cd40af29e51ab7f41ceb49d7..6e591daea3e0430c6f6d4fc05d88ffd347fabbdf 100644 --- a/std/math/exp.zig +++ b/std/math/exp.zig @@ -9,8 +9,8 @@ const assert = @import("../debug.zig").assert; pub fn exp(x: var) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(exp32, x), - f64 => @inlineCall(exp64, x), + f32 => exp32(x), + f64 => exp64(x), else => @compileError("exp not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/exp2.zig b/std/math/exp2.zig index e867aabe2311e1372cac54257385854d25a61294..6061f323918f5005254d315c43d027620664a071 100644 --- a/std/math/exp2.zig +++ b/std/math/exp2.zig @@ -9,8 +9,8 @@ const assert = @import("../debug.zig").assert; pub fn exp2(x: var) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(exp2_32, x), - f64 => @inlineCall(exp2_64, x), + f32 => exp2_32(x), + f64 => exp2_64(x), else => @compileError("exp2 not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/expm1.zig b/std/math/expm1.zig index 14a69958e8b685ca05b784d1d66191a492e0000a..fbe18410303f3d17de0ad05374b5492cb7ca72d0 100644 --- a/std/math/expm1.zig +++ b/std/math/expm1.zig @@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert; pub fn expm1(x: var) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(expm1_32, x), - f64 => @inlineCall(expm1_64, x), + f32 => expm1_32(x), + f64 => expm1_64(x), else => @compileError("exp1m not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/fabs.zig b/std/math/fabs.zig index 58244f4f2e47ea0dd0def2073d917d40dcf5a451..cf1b8f1f14cc49a4bd417d45b369fa8820c670a2 100644 --- a/std/math/fabs.zig +++ b/std/math/fabs.zig @@ -9,8 +9,8 @@ const assert = @import("../debug.zig").assert; pub fn fabs(x: var) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(fabs32, x), - f64 => @inlineCall(fabs64, x), + f32 => fabs32(x), + f64 => fabs64(x), else => @compileError("fabs not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/floor.zig b/std/math/floor.zig index 875070397deebe432e6ef779b3712c132cb5de35..d7de45e9d01214526fd00cbdaea68bb7fc2a1c20 100644 --- a/std/math/floor.zig +++ b/std/math/floor.zig @@ -11,8 +11,8 @@ const math = @import("index.zig"); pub fn floor(x: var) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(floor32, x), - f64 => @inlineCall(floor64, x), + f32 => floor32(x), + f64 => floor64(x), else => @compileError("floor not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/fma.zig b/std/math/fma.zig index c870dfd293492f5d32a90ed3ea4b6168ff4f7038..8e5adc80b24db5d6401b693884a4da9f26a80286 100644 --- a/std/math/fma.zig +++ b/std/math/fma.zig @@ -3,8 +3,8 @@ const assert = @import("../debug.zig").assert; pub fn fma(comptime T: type, x: T, y: T, z: T) -> T { return switch (T) { - f32 => @inlineCall(fma32, x, y, z), - f64 => @inlineCall(fma64, x, y ,z), + f32 => fma32(x, y, z), + f64 => fma64(x, y ,z), else => @compileError("fma not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/frexp.zig b/std/math/frexp.zig index e648555e312707a644ca6b1bab270e8b09c3bd17..1a317a2c80cf5e77c2d5083d8613d687f9d39268 100644 --- a/std/math/frexp.zig +++ b/std/math/frexp.zig @@ -19,8 +19,8 @@ pub const frexp64_result = frexp_result(f64); pub fn frexp(x: var) -> frexp_result(@typeOf(x)) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(frexp32, x), - f64 => @inlineCall(frexp64, x), + f32 => frexp32(x), + f64 => frexp64(x), else => @compileError("frexp not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/hypot.zig b/std/math/hypot.zig index 68794e24fe6ca164e757888fef70b478ef6bca3d..9b09ed53a41159c43322bac16d063d0ad87b2a44 100644 --- a/std/math/hypot.zig +++ b/std/math/hypot.zig @@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert; pub fn hypot(comptime T: type, x: T, y: T) -> T { return switch (T) { - f32 => @inlineCall(hypot32, x, y), - f64 => @inlineCall(hypot64, x, y), + f32 => hypot32(x, y), + f64 => hypot64(x, y), else => @compileError("hypot not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/ilogb.zig b/std/math/ilogb.zig index e056ceb097a825d9b377d8de0f389a053732b41f..41a1e2d83f522a111861cd036a10fcd758a19a5e 100644 --- a/std/math/ilogb.zig +++ b/std/math/ilogb.zig @@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert; pub fn ilogb(x: var) -> i32 { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(ilogb32, x), - f64 => @inlineCall(ilogb64, x), + f32 => ilogb32(x), + f64 => ilogb64(x), else => @compileError("ilogb not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/log1p.zig b/std/math/log1p.zig index 433a7c619215cb34eb814d262c6ffc57f7220f87..b369385038d3bb014b4b1c545781b0236af9a96b 100644 --- a/std/math/log1p.zig +++ b/std/math/log1p.zig @@ -12,8 +12,8 @@ const assert = @import("../debug.zig").assert; pub fn log1p(x: var) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(log1p_32, x), - f64 => @inlineCall(log1p_64, x), + f32 => log1p_32(x), + f64 => log1p_64(x), else => @compileError("log1p not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/modf.zig b/std/math/modf.zig index 5b78680c51b5a81317b9121f4f48427c7699a5a2..72730b67d78c1ebc8a9db959e4e1471938e703e8 100644 --- a/std/math/modf.zig +++ b/std/math/modf.zig @@ -18,8 +18,8 @@ pub const modf64_result = modf_result(f64); pub fn modf(x: var) -> modf_result(@typeOf(x)) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(modf32, x), - f64 => @inlineCall(modf64, x), + f32 => modf32(x), + f64 => modf64(x), else => @compileError("modf not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/round.zig b/std/math/round.zig index 8e604d1b683790102e0e4b0e7b95cae42c23bfd5..1e193fb1d7a752fdf65d64015eac49946c6e62e6 100644 --- a/std/math/round.zig +++ b/std/math/round.zig @@ -11,8 +11,8 @@ const math = @import("index.zig"); pub fn round(x: var) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(round32, x), - f64 => @inlineCall(round64, x), + f32 => round32(x), + f64 => round64(x), else => @compileError("round not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/scalbn.zig b/std/math/scalbn.zig index 0c898a783c9d1f6317f72554f79c795b55518728..0be6a3d47ef98043f384bf4c08ac5c27ce2f793c 100644 --- a/std/math/scalbn.zig +++ b/std/math/scalbn.zig @@ -4,8 +4,8 @@ const assert = @import("../debug.zig").assert; pub fn scalbn(x: var, n: i32) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(scalbn32, x, n), - f64 => @inlineCall(scalbn64, x, n), + f32 => scalbn32(x, n), + f64 => scalbn64(x, n), else => @compileError("scalbn not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/signbit.zig b/std/math/signbit.zig index 6efbc4db5442f1883f61904c2a6871c24953ed70..b8ccecfa1bcdb177739ec2d2b02739a7da659c32 100644 --- a/std/math/signbit.zig +++ b/std/math/signbit.zig @@ -4,8 +4,8 @@ const assert = @import("../debug.zig").assert; pub fn signbit(x: var) -> bool { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(signbit32, x), - f64 => @inlineCall(signbit64, x), + f32 => signbit32(x), + f64 => signbit64(x), else => @compileError("signbit not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/sin.zig b/std/math/sin.zig index 6fbbaff291eb47b6f7c974ac8724fb7e18f1ef57..392bef1bc076921bc06cb69a2663262cbd1a741e 100644 --- a/std/math/sin.zig +++ b/std/math/sin.zig @@ -11,8 +11,8 @@ const assert = @import("../debug.zig").assert; pub fn sin(x: var) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(sin32, x), - f64 => @inlineCall(sin64, x), + f32 => sin32(x), + f64 => sin64(x), else => @compileError("sin not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/sinh.zig b/std/math/sinh.zig index 095dd7ea068916270df337fdc965f1f07ba29488..4c575f10ec8cdf5dfaa753b58a14fa1172b26227 100644 --- a/std/math/sinh.zig +++ b/std/math/sinh.zig @@ -12,8 +12,8 @@ const expo2 = @import("expo2.zig").expo2; pub fn sinh(x: var) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(sinh32, x), - f64 => @inlineCall(sinh64, x), + f32 => sinh32(x), + f64 => sinh64(x), else => @compileError("sinh not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/tan.zig b/std/math/tan.zig index 2a3c46eb6fa4eae4ca31673b0b97d8665c85d744..ff53a758b4a3e19ffe2df814637ad8eb02f075f5 100644 --- a/std/math/tan.zig +++ b/std/math/tan.zig @@ -11,8 +11,8 @@ const assert = @import("../debug.zig").assert; pub fn tan(x: var) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(tan32, x), - f64 => @inlineCall(tan64, x), + f32 => tan32(x), + f64 => tan64(x), else => @compileError("tan not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/tanh.zig b/std/math/tanh.zig index c4fe8f2031f0728569a2f44ed9a51875cb5a4950..7715029361b065fd733c6281e383270430d91d30 100644 --- a/std/math/tanh.zig +++ b/std/math/tanh.zig @@ -12,8 +12,8 @@ const expo2 = @import("expo2.zig").expo2; pub fn tanh(x: var) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(tanh32, x), - f64 => @inlineCall(tanh64, x), + f32 => tanh32(x), + f64 => tanh64(x), else => @compileError("tanh not implemented for " ++ @typeName(T)), }; } diff --git a/std/math/trunc.zig b/std/math/trunc.zig index 01cb1bb84a8cc63a4bdb85f5c7281700cc53d834..81eacb30bae791ee253bc4e7b58746d722e47e68 100644 --- a/std/math/trunc.zig +++ b/std/math/trunc.zig @@ -10,8 +10,8 @@ const assert = @import("../debug.zig").assert; pub fn trunc(x: var) -> @typeOf(x) { const T = @typeOf(x); return switch (T) { - f32 => @inlineCall(trunc32, x), - f64 => @inlineCall(trunc64, x), + f32 => trunc32(x), + f64 => trunc64(x), else => @compileError("trunc not implemented for " ++ @typeName(T)), }; }