x86_64: implement optimized float @reduce(.Min)

This commit is contained in:
Jacob Young
2025-05-27 22:23:51 -04:00
parent 8bacf3e757
commit 114a4eaf5c
3 changed files with 1722 additions and 19 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1111,10 +1111,10 @@
.{ .fcomp, .z, .{ }, .{ 0xd8, 0xd9 }, 0, .none, .x87 },
.{ .fcompp, .z, .{ }, .{ 0xde, 0xd9 }, 0, .none, .x87 },
.{ .fcomi, .zo, .{ .st0, .st }, .{ 0xdb, 0xf0 }, 0, .none, .x87 },
.{ .fcomip, .zo, .{ .st0, .st }, .{ 0xdf, 0xf0 }, 0, .none, .x87 },
.{ .fucomi, .zo, .{ .st0, .st }, .{ 0xdb, 0xe8 }, 0, .none, .x87 },
.{ .fucomip, .zo, .{ .st0, .st }, .{ 0xdf, 0xe8 }, 0, .none, .x87 },
.{ .fcomi, .zo, .{ .st0, .st }, .{ 0xdb, 0xf0 }, 0, .none, .@"cmov x87" },
.{ .fcomip, .zo, .{ .st0, .st }, .{ 0xdf, 0xf0 }, 0, .none, .@"cmov x87" },
.{ .fucomi, .zo, .{ .st0, .st }, .{ 0xdb, 0xe8 }, 0, .none, .@"cmov x87" },
.{ .fucomip, .zo, .{ .st0, .st }, .{ 0xdf, 0xe8 }, 0, .none, .@"cmov x87" },
.{ .fcos, .z, .{}, .{ 0xd9, 0xff }, 0, .none, .x87 },

View File

@@ -5128,6 +5128,15 @@ test reduceMul {
try test_reduce_mul.testFloatVectors();
}
inline fn reduceMinOptimized(comptime Type: type, rhs: Type) @typeInfo(Type).vector.child {
@setFloatMode(.optimized);
return @reduce(.Min, rhs);
}
test reduceMinOptimized {
const test_reduce_min_optimized = unary(reduceMinOptimized, .{});
try test_reduce_min_optimized.testFloatVectors();
}
inline fn reduceAddOptimized(comptime Type: type, rhs: Type) @typeInfo(Type).vector.child {
@setFloatMode(.optimized);
return @reduce(.Add, rhs);