authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2025-02-04 19:09:46-05:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2025-02-06 16:14:53-05:00
log288d3062d0ff4bb2c93a4557fd973bef6c92aa40
tree3b75bd40e58d787f5278abd3e3cf51bfb3b17bd9
parent96ed1a2b46cd13adda1ceba3a03c55a4cae528cd

x86_64: avoid comparing different transcendental function impls


2 files changed, 54 insertions(+), 143 deletions(-)

src/arch/x86_64/CodeGen.zig+13-127
...@@ -28849,166 +28849,52 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {...@@ -28849,166 +28849,52 @@ fn genBody(cg: *CodeGen, body: []const Air.Inst.Index) InnerError!void {
28849 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },28849 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
28850 } },28850 } },
28851 }, .{28851 }, .{
28852 .required_features = .{ .avx, .x87, null, null },28852 .required_features = .{ .x87, null, null, null },
28853 .src_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .tbyte } }, .any, .any },
28854 .patterns = &.{
28855 .{ .src = .{ .to_mem, .none, .none } },
28856 },
28857 .call_frame = .{ .size = 16, .alignment = .@"16" },
28858 .extra_temps = .{
28859 .{ .type = .f80, .kind = .{ .reg = .xmm0 } },
28860 .{ .type = .f80, .kind = .{ .frame = .call_frame } },
28861 .{ .type = .usize, .kind = .{ .symbol = &.{ .name = "__sqrtx" } } },
28862 .unused,
28863 .unused,
28864 .unused,
28865 .unused,
28866 .unused,
28867 .unused,
28868 },
28869 .dst_temps = .{.{ .reg = .st0 }},
28870 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
28871 .each = .{ .once = &.{
28872 .{ ._, .v_dqa, .mov, .tmp0x, .mem(.src0x), ._, ._ },
28873 .{ ._, .v_dqa, .mov, .mem(.tmp1x), .tmp0x, ._, ._ },
28874 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
28875 } },
28876 }, .{
28877 .required_features = .{ .sse2, .x87, null, null },
28878 .src_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .tbyte } }, .any, .any },
28879 .patterns = &.{
28880 .{ .src = .{ .to_mem, .none, .none } },
28881 },
28882 .call_frame = .{ .size = 16, .alignment = .@"16" },
28883 .extra_temps = .{
28884 .{ .type = .f80, .kind = .{ .reg = .xmm0 } },
28885 .{ .type = .f80, .kind = .{ .frame = .call_frame } },
28886 .{ .type = .usize, .kind = .{ .symbol = &.{ .name = "__sqrtx" } } },
28887 .unused,
28888 .unused,
28889 .unused,
28890 .unused,
28891 .unused,
28892 .unused,
28893 },
28894 .dst_temps = .{.{ .reg = .st0 }},
28895 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
28896 .each = .{ .once = &.{
28897 .{ ._, ._dqa, .mov, .tmp0x, .mem(.src0x), ._, ._ },
28898 .{ ._, ._dqa, .mov, .mem(.tmp1x), .tmp0x, ._, ._ },
28899 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
28900 } },
28901 }, .{
28902 .required_features = .{ .sse, .x87, null, null },
28903 .src_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .tbyte } }, .any, .any },28853 .src_constraints = .{ .{ .scalar_float = .{ .of = .xword, .is = .tbyte } }, .any, .any },
28904 .patterns = &.{28854 .patterns = &.{
28905 .{ .src = .{ .to_mem, .none, .none } },28855 .{ .src = .{ .mem, .none, .none } },
28856 .{ .src = .{ .to_x87, .none, .none } },
28906 },28857 },
28907 .call_frame = .{ .size = 16, .alignment = .@"16" },
28908 .extra_temps = .{28858 .extra_temps = .{
28909 .{ .type = .f80, .kind = .{ .reg = .xmm0 } },28859 .{ .type = .f80, .kind = .{ .reg = .st7 } },
28910 .{ .type = .f80, .kind = .{ .frame = .call_frame } },
28911 .{ .type = .usize, .kind = .{ .symbol = &.{ .name = "__sqrtx" } } },
28912 .unused,
28913 .unused,
28914 .unused,
28915 .unused,28860 .unused,
28916 .unused,28861 .unused,
28917 .unused,28862 .unused,
28918 },
28919 .dst_temps = .{.{ .reg = .st0 }},
28920 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
28921 .each = .{ .once = &.{
28922 .{ ._, ._ps, .mova, .tmp0x, .mem(.src0x), ._, ._ },
28923 .{ ._, ._ps, .mova, .mem(.tmp1x), .tmp0x, ._, ._ },
28924 .{ ._, ._, .call, .tmp2d, ._, ._, ._ },
28925 } },
28926 }, .{
28927 .required_features = .{ .avx, .x87, null, null },
28928 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .tbyte } }, .any, .any },
28929 .patterns = &.{
28930 .{ .src = .{ .to_mem, .none, .none } },
28931 },
28932 .call_frame = .{ .size = 16, .alignment = .@"16" },
28933 .extra_temps = .{
28934 .{ .type = .isize, .kind = .{ .rc = .general_purpose } },
28935 .{ .type = .f80, .kind = .{ .reg = .xmm0 } },
28936 .{ .type = .f80, .kind = .{ .frame = .call_frame } },
28937 .{ .type = .usize, .kind = .{ .symbol = &.{ .name = "__sqrtx" } } },
28938 .unused,28863 .unused,
28939 .unused,28864 .unused,
28940 .unused,28865 .unused,
28941 .unused,28866 .unused,
28942 .unused,28867 .unused,
28943 },28868 },
28944 .dst_temps = .{.mem},28869 .dst_temps = .{.{ .mut_rc = .{ .ref = .src0, .rc = .x87 } }},
28945 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
28946 .each = .{ .once = &.{28870 .each = .{ .once = &.{
28947 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ },28871 .{ ._, .f_, .ld, .src0t, ._, ._, ._ },
28948 .{ .@"0:", .v_dqa, .mov, .tmp1x, .memia(.src0x, .tmp0, .add_unaligned_size), ._, ._ },28872 .{ ._, .f_, .sqrt, ._, ._, ._, ._ },
28949 .{ ._, .v_dqa, .mov, .mem(.tmp2x), .tmp1x, ._, ._ },28873 .{ ._, .f_p, .st, .dst0t, ._, ._, ._ },
28950 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
28951 .{ .pseudo, .f_cstp, .de, ._, ._, ._, ._ },
28952 .{ ._, .f_p, .st, .memia(.dst0t, .tmp0, .add_unaligned_size), ._, ._, ._ },
28953 .{ ._, ._, .add, .tmp0p, .si(16), ._, ._ },
28954 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
28955 } },28874 } },
28956 }, .{28875 }, .{
28957 .required_features = .{ .sse2, .x87, null, null },28876 .required_features = .{ .x87, null, null, null },
28958 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .tbyte } }, .any, .any },28877 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .tbyte } }, .any, .any },
28959 .patterns = &.{28878 .patterns = &.{
28960 .{ .src = .{ .to_mem, .none, .none } },28879 .{ .src = .{ .to_mem, .none, .none } },
28961 },28880 },
28962 .call_frame = .{ .size = 16, .alignment = .@"16" },
28963 .extra_temps = .{28881 .extra_temps = .{
28964 .{ .type = .isize, .kind = .{ .rc = .general_purpose } },28882 .{ .type = .isize, .kind = .{ .rc = .general_purpose } },
28965 .{ .type = .f80, .kind = .{ .reg = .xmm0 } },28883 .{ .type = .f80, .kind = .{ .reg = .st7 } },
28966 .{ .type = .f80, .kind = .{ .frame = .call_frame } },
28967 .{ .type = .usize, .kind = .{ .symbol = &.{ .name = "__sqrtx" } } },
28968 .unused,
28969 .unused,
28970 .unused,28884 .unused,
28971 .unused,28885 .unused,
28972 .unused,28886 .unused,
28973 },
28974 .dst_temps = .{.mem},
28975 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },
28976 .each = .{ .once = &.{
28977 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ },
28978 .{ .@"0:", ._dqa, .mov, .tmp1x, .memia(.src0x, .tmp0, .add_unaligned_size), ._, ._ },
28979 .{ ._, ._dqa, .mov, .mem(.tmp2x), .tmp1x, ._, ._ },
28980 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
28981 .{ .pseudo, .f_cstp, .de, ._, ._, ._, ._ },
28982 .{ ._, .f_p, .st, .memia(.dst0t, .tmp0, .add_unaligned_size), ._, ._, ._ },
28983 .{ ._, ._, .add, .tmp0p, .si(16), ._, ._ },
28984 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
28985 } },
28986 }, .{
28987 .required_features = .{ .sse, .x87, null, null },
28988 .src_constraints = .{ .{ .multiple_scalar_float = .{ .of = .xword, .is = .tbyte } }, .any, .any },
28989 .patterns = &.{
28990 .{ .src = .{ .to_mem, .none, .none } },
28991 },
28992 .call_frame = .{ .size = 16, .alignment = .@"16" },
28993 .extra_temps = .{
28994 .{ .type = .isize, .kind = .{ .rc = .general_purpose } },
28995 .{ .type = .f80, .kind = .{ .reg = .xmm0 } },
28996 .{ .type = .f80, .kind = .{ .frame = .call_frame } },
28997 .{ .type = .usize, .kind = .{ .symbol = &.{ .name = "__sqrtx" } } },
28998 .unused,
28999 .unused,28887 .unused,
29000 .unused,28888 .unused,
29001 .unused,28889 .unused,
29002 .unused,28890 .unused,
29003 },28891 },
29004 .dst_temps = .{.mem},28892 .dst_temps = .{.mem},
29005 .clobbers = .{ .eflags = true, .caller_preserved = .ccc },28893 .clobbers = .{ .eflags = true },
29006 .each = .{ .once = &.{28894 .each = .{ .once = &.{
29007 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ },28895 .{ ._, ._, .mov, .tmp0p, .sa(.src0, .sub_unaligned_size), ._, ._ },
29008 .{ .@"0:", ._ps, .mova, .tmp1x, .memia(.src0x, .tmp0, .add_unaligned_size), ._, ._ },28896 .{ .@"0:", .f_, .ld, .memia(.src0t, .tmp0, .add_unaligned_size), ._, ._, ._ },
29009 .{ ._, ._ps, .mova, .mem(.tmp2x), .tmp1x, ._, ._ },28897 .{ ._, .f_, .sqrt, ._, ._, ._, ._ },
29010 .{ ._, ._, .call, .tmp3d, ._, ._, ._ },
29011 .{ .pseudo, .f_cstp, .de, ._, ._, ._, ._ },
29012 .{ ._, .f_p, .st, .memia(.dst0t, .tmp0, .add_unaligned_size), ._, ._, ._ },28898 .{ ._, .f_p, .st, .memia(.dst0t, .tmp0, .add_unaligned_size), ._, ._, ._ },
29013 .{ ._, ._, .add, .tmp0p, .si(16), ._, ._ },28899 .{ ._, ._, .add, .tmp0p, .si(16), ._, ._ },
29014 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },28900 .{ ._, ._nc, .j, .@"0b", ._, ._, ._ },
test/behavior/x86_64/math.zig+41-16
...@@ -163,7 +163,10 @@ test checkExpected {...@@ -163,7 +163,10 @@ test checkExpected {
163 if (checkExpected(@as(f128, 0.0), @as(f128, -0.0), .strict) != error.Unexpected) return error.Unexpected;163 if (checkExpected(@as(f128, 0.0), @as(f128, -0.0), .strict) != error.Unexpected) return error.Unexpected;
164}164}
165165
166fn unary(comptime op: anytype, comptime opts: struct { compare: Compare = .relaxed }) type {166fn unary(comptime op: anytype, comptime opts: struct {
167 libc_name: ?[]const u8 = null,
168 compare: Compare = .relaxed,
169}) type {
167 return struct {170 return struct {
168 // noinline so that `mem_arg` is on the stack171 // noinline so that `mem_arg` is on the stack
169 noinline fn testArgKinds(172 noinline fn testArgKinds(
...@@ -187,12 +190,34 @@ fn unary(comptime op: anytype, comptime opts: struct { compare: Compare = .relax...@@ -187,12 +190,34 @@ fn unary(comptime op: anytype, comptime opts: struct { compare: Compare = .relax
187 comptime imm_arg: Type,190 comptime imm_arg: Type,
188 mem_arg: Type,191 mem_arg: Type,
189 ) !void {192 ) !void {
190 const expected = comptime op(Type, imm_arg);193 const expected = expected: {
194 if (opts.libc_name) |libc_name| libc: {
195 const libc_func = @extern(*const fn (Scalar(Type)) callconv(.c) Scalar(Type), .{
196 .name = switch (Scalar(Type)) {
197 f16 => "__" ++ libc_name ++ "h",
198 f32 => libc_name ++ "f",
199 f64 => libc_name,
200 f80 => "__" ++ libc_name ++ "x",
201 f128 => libc_name ++ "q",
202 else => break :libc,
203 },
204 });
205 switch (@typeInfo(Type)) {
206 else => break :expected libc_func(imm_arg),
207 .vector => |vector| {
208 var res: Type = undefined;
209 inline for (0..vector.len) |i| res[i] = libc_func(imm_arg[i]);
210 break :expected res;
211 },
212 }
213 }
214 break :expected comptime op(Type, imm_arg);
215 };
191 var reg_arg = mem_arg;216 var reg_arg = mem_arg;
192 _ = .{&reg_arg};217 _ = .{&reg_arg};
193 try checkExpected(expected, op(Type, reg_arg), opts.compare);218 try checkExpected(expected, op(Type, reg_arg), opts.compare);
194 try checkExpected(expected, op(Type, mem_arg), opts.compare);219 try checkExpected(expected, op(Type, mem_arg), opts.compare);
195 try checkExpected(expected, op(Type, imm_arg), opts.compare);220 if (opts.libc_name == null) try checkExpected(expected, op(Type, imm_arg), opts.compare);
196 }221 }
197 // noinline for a more helpful stack trace222 // noinline for a more helpful stack trace
198 noinline fn testArgs(comptime Type: type, comptime imm_arg: Type) !void {223 noinline fn testArgs(comptime Type: type, comptime imm_arg: Type) !void {
...@@ -11476,7 +11501,7 @@ inline fn sqrt(comptime Type: type, rhs: Type) @TypeOf(@sqrt(rhs)) {...@@ -11476,7 +11501,7 @@ inline fn sqrt(comptime Type: type, rhs: Type) @TypeOf(@sqrt(rhs)) {
11476 return @sqrt(rhs);11501 return @sqrt(rhs);
11477}11502}
11478test sqrt {11503test sqrt {
11479 const test_sqrt = unary(sqrt, .{});11504 const test_sqrt = unary(sqrt, .{ .libc_name = "sqrt", .compare = .approx });
11480 try test_sqrt.testFloats();11505 try test_sqrt.testFloats();
11481 try test_sqrt.testFloatVectors();11506 try test_sqrt.testFloatVectors();
11482}11507}
...@@ -11485,7 +11510,7 @@ inline fn sin(comptime Type: type, rhs: Type) @TypeOf(@sin(rhs)) {...@@ -11485,7 +11510,7 @@ inline fn sin(comptime Type: type, rhs: Type) @TypeOf(@sin(rhs)) {
11485 return @sin(rhs);11510 return @sin(rhs);
11486}11511}
11487test sin {11512test sin {
11488 const test_sin = unary(sin, .{ .compare = .strict });11513 const test_sin = unary(sin, .{ .libc_name = "sin", .compare = .strict });
11489 try test_sin.testFloats();11514 try test_sin.testFloats();
11490 try test_sin.testFloatVectors();11515 try test_sin.testFloatVectors();
11491}11516}
...@@ -11494,7 +11519,7 @@ inline fn cos(comptime Type: type, rhs: Type) @TypeOf(@cos(rhs)) {...@@ -11494,7 +11519,7 @@ inline fn cos(comptime Type: type, rhs: Type) @TypeOf(@cos(rhs)) {
11494 return @cos(rhs);11519 return @cos(rhs);
11495}11520}
11496test cos {11521test cos {
11497 const test_cos = unary(cos, .{ .compare = .strict });11522 const test_cos = unary(cos, .{ .libc_name = "cos", .compare = .strict });
11498 try test_cos.testFloats();11523 try test_cos.testFloats();
11499 try test_cos.testFloatVectors();11524 try test_cos.testFloatVectors();
11500}11525}
...@@ -11503,7 +11528,7 @@ inline fn tan(comptime Type: type, rhs: Type) @TypeOf(@tan(rhs)) {...@@ -11503,7 +11528,7 @@ inline fn tan(comptime Type: type, rhs: Type) @TypeOf(@tan(rhs)) {
11503 return @tan(rhs);11528 return @tan(rhs);
11504}11529}
11505test tan {11530test tan {
11506 const test_tan = unary(tan, .{ .compare = .strict });11531 const test_tan = unary(tan, .{ .libc_name = "tan", .compare = .strict });
11507 try test_tan.testFloats();11532 try test_tan.testFloats();
11508 try test_tan.testFloatVectors();11533 try test_tan.testFloatVectors();
11509}11534}
...@@ -11512,7 +11537,7 @@ inline fn exp(comptime Type: type, rhs: Type) @TypeOf(@exp(rhs)) {...@@ -11512,7 +11537,7 @@ inline fn exp(comptime Type: type, rhs: Type) @TypeOf(@exp(rhs)) {
11512 return @exp(rhs);11537 return @exp(rhs);
11513}11538}
11514test exp {11539test exp {
11515 const test_exp = unary(exp, .{ .compare = .strict });11540 const test_exp = unary(exp, .{ .libc_name = "exp", .compare = .strict });
11516 try test_exp.testFloats();11541 try test_exp.testFloats();
11517 try test_exp.testFloatVectors();11542 try test_exp.testFloatVectors();
11518}11543}
...@@ -11521,7 +11546,7 @@ inline fn exp2(comptime Type: type, rhs: Type) @TypeOf(@exp2(rhs)) {...@@ -11521,7 +11546,7 @@ inline fn exp2(comptime Type: type, rhs: Type) @TypeOf(@exp2(rhs)) {
11521 return @exp2(rhs);11546 return @exp2(rhs);
11522}11547}
11523test exp2 {11548test exp2 {
11524 const test_exp2 = unary(exp2, .{ .compare = .strict });11549 const test_exp2 = unary(exp2, .{ .libc_name = "exp2", .compare = .strict });
11525 try test_exp2.testFloats();11550 try test_exp2.testFloats();
11526 try test_exp2.testFloatVectors();11551 try test_exp2.testFloatVectors();
11527}11552}
...@@ -11530,7 +11555,7 @@ inline fn log(comptime Type: type, rhs: Type) @TypeOf(@log(rhs)) {...@@ -11530,7 +11555,7 @@ inline fn log(comptime Type: type, rhs: Type) @TypeOf(@log(rhs)) {
11530 return @log(rhs);11555 return @log(rhs);
11531}11556}
11532test log {11557test log {
11533 const test_log = unary(log, .{ .compare = .strict });11558 const test_log = unary(log, .{ .libc_name = "log", .compare = .strict });
11534 try test_log.testFloats();11559 try test_log.testFloats();
11535 try test_log.testFloatVectors();11560 try test_log.testFloatVectors();
11536}11561}
...@@ -11539,7 +11564,7 @@ inline fn log2(comptime Type: type, rhs: Type) @TypeOf(@log2(rhs)) {...@@ -11539,7 +11564,7 @@ inline fn log2(comptime Type: type, rhs: Type) @TypeOf(@log2(rhs)) {
11539 return @log2(rhs);11564 return @log2(rhs);
11540}11565}
11541test log2 {11566test log2 {
11542 const test_log2 = unary(log2, .{ .compare = .strict });11567 const test_log2 = unary(log2, .{ .libc_name = "log2", .compare = .strict });
11543 try test_log2.testFloats();11568 try test_log2.testFloats();
11544 try test_log2.testFloatVectors();11569 try test_log2.testFloatVectors();
11545}11570}
...@@ -11548,7 +11573,7 @@ inline fn log10(comptime Type: type, rhs: Type) @TypeOf(@log10(rhs)) {...@@ -11548,7 +11573,7 @@ inline fn log10(comptime Type: type, rhs: Type) @TypeOf(@log10(rhs)) {
11548 return @log10(rhs);11573 return @log10(rhs);
11549}11574}
11550test log10 {11575test log10 {
11551 const test_log10 = unary(log10, .{ .compare = .strict });11576 const test_log10 = unary(log10, .{ .libc_name = "log10", .compare = .strict });
11552 try test_log10.testFloats();11577 try test_log10.testFloats();
11553 try test_log10.testFloatVectors();11578 try test_log10.testFloatVectors();
11554}11579}
...@@ -11568,7 +11593,7 @@ inline fn floor(comptime Type: type, rhs: Type) @TypeOf(@floor(rhs)) {...@@ -11568,7 +11593,7 @@ inline fn floor(comptime Type: type, rhs: Type) @TypeOf(@floor(rhs)) {
11568 return @floor(rhs);11593 return @floor(rhs);
11569}11594}
11570test floor {11595test floor {
11571 const test_floor = unary(floor, .{ .compare = .strict });11596 const test_floor = unary(floor, .{ .libc_name = "floor", .compare = .strict });
11572 try test_floor.testFloats();11597 try test_floor.testFloats();
11573 try test_floor.testFloatVectors();11598 try test_floor.testFloatVectors();
11574}11599}
...@@ -11577,7 +11602,7 @@ inline fn ceil(comptime Type: type, rhs: Type) @TypeOf(@ceil(rhs)) {...@@ -11577,7 +11602,7 @@ inline fn ceil(comptime Type: type, rhs: Type) @TypeOf(@ceil(rhs)) {
11577 return @ceil(rhs);11602 return @ceil(rhs);
11578}11603}
11579test ceil {11604test ceil {
11580 const test_ceil = unary(ceil, .{ .compare = .strict });11605 const test_ceil = unary(ceil, .{ .libc_name = "ceil", .compare = .strict });
11581 try test_ceil.testFloats();11606 try test_ceil.testFloats();
11582 try test_ceil.testFloatVectors();11607 try test_ceil.testFloatVectors();
11583}11608}
...@@ -11586,7 +11611,7 @@ inline fn round(comptime Type: type, rhs: Type) @TypeOf(@round(rhs)) {...@@ -11586,7 +11611,7 @@ inline fn round(comptime Type: type, rhs: Type) @TypeOf(@round(rhs)) {
11586 return @round(rhs);11611 return @round(rhs);
11587}11612}
11588test round {11613test round {
11589 const test_round = unary(round, .{ .compare = .strict });11614 const test_round = unary(round, .{ .libc_name = "round", .compare = .strict });
11590 try test_round.testFloats();11615 try test_round.testFloats();
11591 try test_round.testFloatVectors();11616 try test_round.testFloatVectors();
11592}11617}
...@@ -11595,7 +11620,7 @@ inline fn trunc(comptime Type: type, rhs: Type) @TypeOf(@trunc(rhs)) {...@@ -11595,7 +11620,7 @@ inline fn trunc(comptime Type: type, rhs: Type) @TypeOf(@trunc(rhs)) {
11595 return @trunc(rhs);11620 return @trunc(rhs);
11596}11621}
11597test trunc {11622test trunc {
11598 const test_trunc = unary(trunc, .{ .compare = .strict });11623 const test_trunc = unary(trunc, .{ .libc_name = "trunc", .compare = .strict });
11599 try test_trunc.testFloats();11624 try test_trunc.testFloats();
11600 try test_trunc.testFloatVectors();11625 try test_trunc.testFloatVectors();
11601}11626}