| ... | ... | @@ -16,7 +16,6 @@ const nan = math.nan; |
| 16 | 16 | const Scalar = math.Scalar; |
| 17 | 17 | const select = math.select; |
| 18 | 18 | const sign = math.sign; |
| 19 | | const splat = math.splat; |
| 20 | 19 | const Sse = math.Sse; |
| 21 | 20 | const tmin = math.tmin; |
| 22 | 21 | |
| ... | ... | @@ -5250,7 +5249,7 @@ test divTruncUnoptimized { |
| 5250 | 5249 | |
| 5251 | 5250 | inline fn divTruncOptimized(comptime Type: type, lhs: Type, rhs: Type) Type { |
| 5252 | 5251 | @setFloatMode(.optimized); |
| 5253 | | return @divTrunc(lhs, select(@abs(rhs) > splat(Type, 0.0), rhs, splat(Type, 1.0))); |
| 5252 | return @divTrunc(lhs, select(@abs(rhs) > @as(Type, @splat(0.0)), rhs, @as(Type, @splat(1.0)))); |
| 5254 | 5253 | } |
| 5255 | 5254 | test divTruncOptimized { |
| 5256 | 5255 | const test_div_trunc_optimized = binary(divTruncOptimized, .{ .compare = .approx_int }); |
| ... | ... | @@ -5271,7 +5270,7 @@ test divFloorUnoptimized { |
| 5271 | 5270 | |
| 5272 | 5271 | inline fn divFloorOptimized(comptime Type: type, lhs: Type, rhs: Type) Type { |
| 5273 | 5272 | @setFloatMode(.optimized); |
| 5274 | | return @divFloor(lhs, select(@abs(rhs) > splat(Type, 0.0), rhs, splat(Type, 1.0))); |
| 5273 | return @divFloor(lhs, select(@abs(rhs) > @as(Type, @splat(0.0)), rhs, @as(Type, @splat(1.0)))); |
| 5275 | 5274 | } |
| 5276 | 5275 | test divFloorOptimized { |
| 5277 | 5276 | const test_div_floor_optimized = binary(divFloorOptimized, .{ .compare = .approx_int }); |
| ... | ... | @@ -5292,7 +5291,7 @@ test divCeilUnoptimized { |
| 5292 | 5291 | |
| 5293 | 5292 | inline fn divCeilOptimized(comptime Type: type, lhs: Type, rhs: Type) Type { |
| 5294 | 5293 | @setFloatMode(.optimized); |
| 5295 | | return @divCeil(lhs, select(@abs(rhs) > splat(Type, 0.0), rhs, splat(Type, 1.0))); |
| 5294 | return @divCeil(lhs, select(@abs(rhs) > @as(Type, @splat(0.0)), rhs, @as(Type, @splat(1.0)))); |
| 5296 | 5295 | } |
| 5297 | 5296 | test divCeilOptimized { |
| 5298 | 5297 | const test_div_ceil_optimized = binary(divCeilOptimized, .{ .compare = .approx_int }); |
| ... | ... | @@ -5393,7 +5392,7 @@ test mulWithOverflow { |
| 5393 | 5392 | inline fn shlWithOverflow(comptime Type: type, lhs: Type, rhs: Type) struct { Type, ChangeScalar(Type, u1) } { |
| 5394 | 5393 | const bit_cast_rhs: AsSignedness(Type, .unsigned) = @bitCast(rhs); |
| 5395 | 5394 | const truncate_rhs: Log2Int(Type) = @truncate(bit_cast_rhs); |
| 5396 | | return @shlWithOverflow(lhs, if (comptime cast(Log2Int(Scalar(Type)), @bitSizeOf(Scalar(Type)))) |bits| truncate_rhs % splat(Log2Int(Type), bits) else truncate_rhs); |
| 5395 | return @shlWithOverflow(lhs, if (comptime cast(Log2Int(Scalar(Type)), @bitSizeOf(Scalar(Type)))) |bits| truncate_rhs % @as(Log2Int(Type), @splat(bits)) else truncate_rhs); |
| 5397 | 5396 | } |
| 5398 | 5397 | test shlWithOverflow { |
| 5399 | 5398 | const test_shl_with_overflow = binary(shlWithOverflow, .{}); |
| ... | ... | @@ -5492,7 +5491,7 @@ test bitOr { |
| 5492 | 5491 | inline fn shr(comptime Type: type, lhs: Type, rhs: Type) Type { |
| 5493 | 5492 | const bit_cast_rhs: AsSignedness(Type, .unsigned) = @bitCast(rhs); |
| 5494 | 5493 | const truncate_rhs: Log2Int(Type) = @truncate(bit_cast_rhs); |
| 5495 | | return lhs >> if (comptime cast(Log2Int(Scalar(Type)), @bitSizeOf(Scalar(Type)))) |bits| truncate_rhs % splat(Log2Int(Type), bits) else truncate_rhs; |
| 5494 | return lhs >> if (comptime cast(Log2Int(Scalar(Type)), @bitSizeOf(Scalar(Type)))) |bits| truncate_rhs % @as(Log2Int(Type), @splat(bits)) else truncate_rhs; |
| 5496 | 5495 | } |
| 5497 | 5496 | test shr { |
| 5498 | 5497 | const test_shr = binary(shr, .{}); |
| ... | ... | @@ -5503,7 +5502,7 @@ test shr { |
| 5503 | 5502 | inline fn shrExact(comptime Type: type, lhs: Type, rhs: Type) Type { |
| 5504 | 5503 | const bit_cast_rhs: AsSignedness(Type, .unsigned) = @bitCast(rhs); |
| 5505 | 5504 | const truncate_rhs: Log2Int(Type) = @truncate(bit_cast_rhs); |
| 5506 | | const final_rhs = if (comptime cast(Log2Int(Scalar(Type)), @bitSizeOf(Scalar(Type)))) |bits| truncate_rhs % splat(Log2Int(Type), bits) else truncate_rhs; |
| 5505 | const final_rhs = if (comptime cast(Log2Int(Scalar(Type)), @bitSizeOf(Scalar(Type)))) |bits| truncate_rhs % @as(Log2Int(Type), @splat(bits)) else truncate_rhs; |
| 5507 | 5506 | return @shrExact(lhs >> final_rhs << final_rhs, final_rhs); |
| 5508 | 5507 | } |
| 5509 | 5508 | test shrExact { |
| ... | ... | @@ -5515,7 +5514,7 @@ test shrExact { |
| 5515 | 5514 | inline fn shl(comptime Type: type, lhs: Type, rhs: Type) Type { |
| 5516 | 5515 | const bit_cast_rhs: AsSignedness(Type, .unsigned) = @bitCast(rhs); |
| 5517 | 5516 | const truncate_rhs: Log2Int(Type) = @truncate(bit_cast_rhs); |
| 5518 | | return lhs << if (comptime cast(Log2Int(Scalar(Type)), @bitSizeOf(Scalar(Type)))) |bits| truncate_rhs % splat(Log2Int(Type), bits) else truncate_rhs; |
| 5517 | return lhs << if (comptime cast(Log2Int(Scalar(Type)), @bitSizeOf(Scalar(Type)))) |bits| truncate_rhs % @as(Log2Int(Type), @splat(bits)) else truncate_rhs; |
| 5519 | 5518 | } |
| 5520 | 5519 | test shl { |
| 5521 | 5520 | const test_shl = binary(shl, .{}); |
| ... | ... | @@ -5527,7 +5526,7 @@ inline fn shlExactUnsafe(comptime Type: type, lhs: Type, rhs: Type) Type { |
| 5527 | 5526 | @setRuntimeSafety(false); |
| 5528 | 5527 | const bit_cast_rhs: AsSignedness(Type, .unsigned) = @bitCast(rhs); |
| 5529 | 5528 | const truncate_rhs: Log2Int(Type) = @truncate(bit_cast_rhs); |
| 5530 | | const final_rhs = if (comptime cast(Log2Int(Scalar(Type)), @bitSizeOf(Scalar(Type)))) |bits| truncate_rhs % splat(Log2Int(Type), bits) else truncate_rhs; |
| 5529 | const final_rhs = if (comptime cast(Log2Int(Scalar(Type)), @bitSizeOf(Scalar(Type)))) |bits| truncate_rhs % @as(Log2Int(Type), @splat(bits)) else truncate_rhs; |
| 5531 | 5530 | return @shlExact(lhs << final_rhs >> final_rhs, final_rhs); |
| 5532 | 5531 | } |
| 5533 | 5532 | test shlExactUnsafe { |
| ... | ... | @@ -5540,7 +5539,7 @@ inline fn shlSaturate(comptime Type: type, lhs: Type, rhs: Type) Type { |
| 5540 | 5539 | // workaround https://github.com/ziglang/zig/issues/23034 |
| 5541 | 5540 | if (@inComptime()) { |
| 5542 | 5541 | // workaround https://github.com/ziglang/zig/issues/23139 |
| 5543 | | return lhs <<| @min(@abs(rhs), splat(ChangeScalar(Type, u64), imax(u64))); |
| 5542 | return lhs <<| @min(@abs(rhs), @as(ChangeScalar(Type, u64), @splat(imax(u64)))); |
| 5544 | 5543 | } |
| 5545 | 5544 | return lhs <<| @abs(rhs); |
| 5546 | 5545 | } |