mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:44:43 +01:00
Merge pull request #22717 from jacobly0/x86_64-rewrite
x86_64: rewrite `@truncate`
This commit is contained in:
commit
2d4954ad63
13 changed files with 26151 additions and 3725 deletions
|
|
@ -450,7 +450,7 @@ pub fn build(b: *std.Build) !void {
|
|||
.skip_non_native = skip_non_native,
|
||||
.skip_libc = skip_libc,
|
||||
.use_llvm = use_llvm,
|
||||
.max_rss = 1.25 * 1024 * 1024 * 1024,
|
||||
.max_rss = 2 * 1024 * 1024 * 1024,
|
||||
}));
|
||||
|
||||
test_modules_step.dependOn(tests.addModuleTests(b, .{
|
||||
|
|
|
|||
|
|
@ -1793,9 +1793,13 @@ pub const Mutable = struct {
|
|||
/// The upper bound is `calcTwosCompLimbCount(a.len)`.
|
||||
pub fn truncate(r: *Mutable, a: Const, signedness: Signedness, bit_count: usize) void {
|
||||
const req_limbs = calcTwosCompLimbCount(bit_count);
|
||||
const abs_trunc_a: Const = .{
|
||||
.positive = true,
|
||||
.limbs = a.limbs[0..@min(a.limbs.len, req_limbs)],
|
||||
};
|
||||
|
||||
// Handle 0-bit integers.
|
||||
if (req_limbs == 0 or a.eqlZero()) {
|
||||
if (req_limbs == 0 or abs_trunc_a.eqlZero()) {
|
||||
r.set(0);
|
||||
return;
|
||||
}
|
||||
|
|
@ -1810,15 +1814,10 @@ pub const Mutable = struct {
|
|||
// Note, we simply take req_limbs * @bitSizeOf(Limb) as the
|
||||
// target bit count.
|
||||
|
||||
r.addScalar(a.abs(), -1);
|
||||
r.addScalar(abs_trunc_a, -1);
|
||||
|
||||
// Zero-extend the result
|
||||
if (req_limbs > r.len) {
|
||||
@memset(r.limbs[r.len..req_limbs], 0);
|
||||
}
|
||||
|
||||
// Truncate to required number of limbs.
|
||||
assert(r.limbs.len >= req_limbs);
|
||||
@memset(r.limbs[r.len..req_limbs], 0);
|
||||
r.len = req_limbs;
|
||||
|
||||
// Without truncating, we can already peek at the sign bit of the result here.
|
||||
|
|
@ -1846,16 +1845,10 @@ pub const Mutable = struct {
|
|||
r.normalize(r.len);
|
||||
}
|
||||
} else {
|
||||
if (a.limbs.len < req_limbs) {
|
||||
// Integer fits within target bits, no wrapping required.
|
||||
r.copy(a);
|
||||
return;
|
||||
}
|
||||
r.copy(abs_trunc_a);
|
||||
// If the integer fits within target bits, no wrapping is required.
|
||||
if (r.len < req_limbs) return;
|
||||
|
||||
r.copy(.{
|
||||
.positive = a.positive,
|
||||
.limbs = a.limbs[0..req_limbs],
|
||||
});
|
||||
r.limbs[r.len - 1] &= mask;
|
||||
r.normalize(r.len);
|
||||
|
||||
|
|
|
|||
|
|
@ -1934,6 +1934,31 @@ test "truncate multi unsigned many" {
|
|||
try testing.expect((try b.toInt(i1)) == 0);
|
||||
}
|
||||
|
||||
test "truncate to mutable with fewer limbs" {
|
||||
var res_limbs: [1]Limb = undefined;
|
||||
var res: Mutable = .{
|
||||
.limbs = &res_limbs,
|
||||
.len = undefined,
|
||||
.positive = undefined,
|
||||
};
|
||||
res.truncate(.{ .positive = true, .limbs = &.{ 0, 1 } }, .unsigned, @bitSizeOf(Limb));
|
||||
try testing.expect(res.eqlZero());
|
||||
res.truncate(.{ .positive = true, .limbs = &.{ 0, 1 } }, .signed, @bitSizeOf(Limb));
|
||||
try testing.expect(res.eqlZero());
|
||||
res.truncate(.{ .positive = false, .limbs = &.{ 0, 1 } }, .unsigned, @bitSizeOf(Limb));
|
||||
try testing.expect(res.eqlZero());
|
||||
res.truncate(.{ .positive = false, .limbs = &.{ 0, 1 } }, .signed, @bitSizeOf(Limb));
|
||||
try testing.expect(res.eqlZero());
|
||||
res.truncate(.{ .positive = true, .limbs = &.{ std.math.maxInt(Limb), 1 } }, .unsigned, @bitSizeOf(Limb));
|
||||
try testing.expect(res.toConst().orderAgainstScalar(std.math.maxInt(Limb)).compare(.eq));
|
||||
res.truncate(.{ .positive = true, .limbs = &.{ std.math.maxInt(Limb), 1 } }, .signed, @bitSizeOf(Limb));
|
||||
try testing.expect(res.toConst().orderAgainstScalar(-1).compare(.eq));
|
||||
res.truncate(.{ .positive = false, .limbs = &.{ std.math.maxInt(Limb), 1 } }, .unsigned, @bitSizeOf(Limb));
|
||||
try testing.expect(res.toConst().orderAgainstScalar(1).compare(.eq));
|
||||
res.truncate(.{ .positive = false, .limbs = &.{ std.math.maxInt(Limb), 1 } }, .signed, @bitSizeOf(Limb));
|
||||
try testing.expect(res.toConst().orderAgainstScalar(1).compare(.eq));
|
||||
}
|
||||
|
||||
test "saturate single signed positive" {
|
||||
var a = try Managed.initSet(testing.allocator, 0xBBBB_BBBB);
|
||||
defer a.deinit();
|
||||
|
|
|
|||
|
|
@ -573,7 +573,7 @@ pub const Inst = struct {
|
|||
/// and the operand is not a valid value of this type; i.e. equivalent to
|
||||
/// a safety check based on `.is_named_enum_value`
|
||||
intcast_safe,
|
||||
/// Truncate higher bits from an integer, resulting in an integer with the same
|
||||
/// Truncate higher bits from an integer, resulting in an integer type with the same
|
||||
/// sign but an equal or smaller number of bits.
|
||||
/// Uses the `ty_op` field.
|
||||
trunc,
|
||||
|
|
|
|||
38
src/Sema.zig
38
src/Sema.zig
|
|
@ -23842,23 +23842,27 @@ fn zirTruncate(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Ai
|
|||
@tagName(dest_info.signedness), operand_ty.fmt(pt),
|
||||
});
|
||||
}
|
||||
if (operand_info.bits < dest_info.bits) {
|
||||
const msg = msg: {
|
||||
const msg = try sema.errMsg(
|
||||
src,
|
||||
"destination type '{}' has more bits than source type '{}'",
|
||||
.{ dest_ty.fmt(pt), operand_ty.fmt(pt) },
|
||||
);
|
||||
errdefer msg.destroy(sema.gpa);
|
||||
try sema.errNote(src, msg, "destination type has {d} bits", .{
|
||||
dest_info.bits,
|
||||
});
|
||||
try sema.errNote(operand_src, msg, "operand type has {d} bits", .{
|
||||
operand_info.bits,
|
||||
});
|
||||
break :msg msg;
|
||||
};
|
||||
return sema.failWithOwnedErrorMsg(block, msg);
|
||||
switch (std.math.order(dest_info.bits, operand_info.bits)) {
|
||||
.gt => {
|
||||
const msg = msg: {
|
||||
const msg = try sema.errMsg(
|
||||
src,
|
||||
"destination type '{}' has more bits than source type '{}'",
|
||||
.{ dest_ty.fmt(pt), operand_ty.fmt(pt) },
|
||||
);
|
||||
errdefer msg.destroy(sema.gpa);
|
||||
try sema.errNote(src, msg, "destination type has {d} bits", .{
|
||||
dest_info.bits,
|
||||
});
|
||||
try sema.errNote(operand_src, msg, "operand type has {d} bits", .{
|
||||
operand_info.bits,
|
||||
});
|
||||
break :msg msg;
|
||||
};
|
||||
return sema.failWithOwnedErrorMsg(block, msg);
|
||||
},
|
||||
.eq => return operand,
|
||||
.lt => {},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -177,7 +177,13 @@ pub const Condition = enum(u5) {
|
|||
|
||||
/// The immediate operand of vcvtps2ph.
|
||||
pub const RoundMode = packed struct(u5) {
|
||||
mode: enum(u4) {
|
||||
direction: Direction = .mxcsr,
|
||||
precision: enum(u1) {
|
||||
normal = 0b0,
|
||||
inexact = 0b1,
|
||||
} = .normal,
|
||||
|
||||
pub const Direction = enum(u4) {
|
||||
/// Round to nearest (even)
|
||||
nearest = 0b0_00,
|
||||
/// Round down (toward -∞)
|
||||
|
|
@ -188,11 +194,7 @@ pub const RoundMode = packed struct(u5) {
|
|||
zero = 0b0_11,
|
||||
/// Use current rounding mode of MXCSR.RC
|
||||
mxcsr = 0b1_00,
|
||||
} = .mxcsr,
|
||||
precision: enum(u1) {
|
||||
normal = 0b0,
|
||||
inexact = 0b1,
|
||||
} = .normal,
|
||||
};
|
||||
|
||||
pub fn imm(mode: RoundMode) Immediate {
|
||||
return .u(@as(@typeInfo(RoundMode).@"struct".backing_integer.?, @bitCast(mode)));
|
||||
|
|
@ -702,6 +704,7 @@ pub const Memory = struct {
|
|||
pub const Size = enum(u4) {
|
||||
none,
|
||||
ptr,
|
||||
gpr,
|
||||
byte,
|
||||
word,
|
||||
dword,
|
||||
|
|
@ -742,6 +745,11 @@ pub const Memory = struct {
|
|||
return switch (s) {
|
||||
.none => 0,
|
||||
.ptr => target.ptrBitWidth(),
|
||||
.gpr => switch (target.cpu.arch) {
|
||||
else => unreachable,
|
||||
.x86 => 32,
|
||||
.x86_64 => 64,
|
||||
},
|
||||
.byte => 8,
|
||||
.word => 16,
|
||||
.dword => 32,
|
||||
|
|
@ -763,7 +771,7 @@ pub const Memory = struct {
|
|||
try writer.writeAll(@tagName(s));
|
||||
switch (s) {
|
||||
.none => unreachable,
|
||||
.ptr => {},
|
||||
.ptr, .gpr => {},
|
||||
else => {
|
||||
try writer.writeByte(' ');
|
||||
try writer.writeAll("ptr");
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ pub const table = [_]Entry{
|
|||
.{ .aad, .zi, &.{ .imm8 }, &.{ 0xd5 }, 0, .none, .@"32bit" },
|
||||
|
||||
.{ .aam, .z, &.{ }, &.{ 0xd4, 0x0a }, 0, .none, .@"32bit" },
|
||||
.{ .aam, .z, &.{ .imm8 }, &.{ 0xd4 }, 0, .none, .@"32bit" },
|
||||
.{ .aam, .zi, &.{ .imm8 }, &.{ 0xd4 }, 0, .none, .@"32bit" },
|
||||
|
||||
.{ .aas, .z, &.{}, &.{ 0x3f }, 0, .none, .@"32bit" },
|
||||
|
||||
|
|
|
|||
|
|
@ -156,7 +156,13 @@ test "cmp f128" {
|
|||
}
|
||||
|
||||
test "cmp f80/c_longdouble" {
|
||||
if (true) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArm()) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
|
||||
|
||||
try testCmp(f80);
|
||||
try comptime testCmp(f80);
|
||||
|
|
@ -453,7 +459,7 @@ test "@sin with vectors" {
|
|||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
|
||||
|
||||
try testSinWithVectors();
|
||||
|
|
@ -526,7 +532,7 @@ test "@cos with vectors" {
|
|||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
|
||||
|
||||
try testCosWithVectors();
|
||||
|
|
@ -600,7 +606,7 @@ test "@tan with vectors" {
|
|||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
|
||||
|
||||
try testTanWithVectors();
|
||||
|
|
@ -677,7 +683,7 @@ test "@exp with vectors" {
|
|||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
|
||||
|
||||
try testExpWithVectors();
|
||||
|
|
@ -749,7 +755,7 @@ test "@exp2 with @vectors" {
|
|||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
|
||||
|
||||
try testExp2WithVectors();
|
||||
|
|
@ -822,7 +828,7 @@ test "@log with @vectors" {
|
|||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
|
||||
|
||||
{
|
||||
|
|
@ -896,7 +902,7 @@ test "@log2 with vectors" {
|
|||
if (builtin.zig_backend == .stage2_llvm and
|
||||
builtin.cpu.arch == .aarch64 and
|
||||
builtin.os.tag == .windows) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
||||
|
||||
try testLog2WithVectors();
|
||||
try comptime testLog2WithVectors();
|
||||
|
|
@ -967,7 +973,7 @@ test "@log10 with vectors" {
|
|||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
|
||||
|
||||
try testLog10WithVectors();
|
||||
|
|
@ -1188,8 +1194,7 @@ test "@floor with vectors" {
|
|||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64 and
|
||||
!comptime std.Target.x86.featureSetHas(builtin.cpu.features, .sse4_1)) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
||||
|
||||
try testFloorWithVectors();
|
||||
try comptime testFloorWithVectors();
|
||||
|
|
@ -1286,8 +1291,7 @@ test "@ceil with vectors" {
|
|||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64 and
|
||||
!comptime std.Target.x86.featureSetHas(builtin.cpu.features, .sse4_1)) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
||||
|
||||
try testCeilWithVectors();
|
||||
try comptime testCeilWithVectors();
|
||||
|
|
@ -1384,8 +1388,7 @@ test "@trunc with vectors" {
|
|||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64 and
|
||||
!comptime std.Target.x86.featureSetHas(builtin.cpu.features, .sse4_1)) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
||||
|
||||
try testTruncWithVectors();
|
||||
try comptime testTruncWithVectors();
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ test "memset with 1-byte struct element" {
|
|||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
|
||||
|
||||
const S = struct { x: bool };
|
||||
var buf: [5]S = undefined;
|
||||
|
|
@ -97,6 +98,7 @@ test "memset with 1-byte array element" {
|
|||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
|
||||
|
||||
const A = [1]bool;
|
||||
var buf: [5]A = undefined;
|
||||
|
|
|
|||
|
|
@ -2,16 +2,12 @@ const std = @import("std");
|
|||
const builtin = @import("builtin");
|
||||
const expect = std.testing.expect;
|
||||
|
||||
const no_x86_64_hardware_fma_support = builtin.zig_backend == .stage2_x86_64 and
|
||||
!std.Target.x86.featureSetHas(builtin.cpu.features, .fma);
|
||||
|
||||
test "@mulAdd" {
|
||||
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
|
||||
|
||||
if (no_x86_64_hardware_fma_support) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
|
||||
|
||||
try comptime testMulAdd();
|
||||
try testMulAdd();
|
||||
|
|
@ -110,10 +106,10 @@ fn vector16() !void {
|
|||
|
||||
test "vector f16" {
|
||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
|
||||
|
||||
try comptime vector16();
|
||||
|
|
@ -135,11 +131,11 @@ fn vector32() !void {
|
|||
|
||||
test "vector f32" {
|
||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
|
||||
if (no_x86_64_hardware_fma_support) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
|
||||
|
||||
try comptime vector32();
|
||||
try vector32();
|
||||
|
|
@ -160,11 +156,11 @@ fn vector64() !void {
|
|||
|
||||
test "vector f64" {
|
||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
|
||||
if (no_x86_64_hardware_fma_support) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
|
||||
|
||||
try comptime vector64();
|
||||
try vector64();
|
||||
|
|
@ -184,12 +180,12 @@ fn vector80() !void {
|
|||
|
||||
test "vector f80" {
|
||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArm()) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
|
||||
|
||||
try comptime vector80();
|
||||
|
|
@ -211,12 +207,12 @@ fn vector128() !void {
|
|||
|
||||
test "vector f128" {
|
||||
if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArm()) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
|
||||
|
||||
try comptime vector128();
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ test "vector float operators" {
|
|||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArm()) return error.SkipZigTest;
|
||||
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest;
|
||||
|
||||
if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .aarch64) {
|
||||
// Triggers an assertion with LLVM 18:
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue