| author | |
| committer | |
| log | 4fba7336a9038b4abf647caf822f89df717d3cc0 |
| tree | d2a5e61671fefce3ba53454b46311ba77dc31b7a |
| parent | 218cf059dd215282aa96d6b4715e68d533a4238e |
| parent | f1645772c1881a233ffcfc5072710040c4881deb |
| signature |
Fix soft float support, split musl triples by float ABI, and enable CI13 files changed, 251 insertions(+), 43 deletions(-)
lib/compiler_rt/truncdfhf2.zig+1-2| ... | @@ -6,9 +6,8 @@ pub const panic = common.panic; | ... | @@ -6,9 +6,8 @@ pub const panic = common.panic; |
| 6 | comptime { | 6 | comptime { |
| 7 | if (common.want_aeabi) { | 7 | if (common.want_aeabi) { |
| 8 | @export(&__aeabi_d2h, .{ .name = "__aeabi_d2h", .linkage = common.linkage, .visibility = common.visibility }); | 8 | @export(&__aeabi_d2h, .{ .name = "__aeabi_d2h", .linkage = common.linkage, .visibility = common.visibility }); |
| 9 | } else { | ||
| 10 | @export(&__truncdfhf2, .{ .name = "__truncdfhf2", .linkage = common.linkage, .visibility = common.visibility }); | ||
| 11 | } | 9 | } |
| 10 | @export(&__truncdfhf2, .{ .name = "__truncdfhf2", .linkage = common.linkage, .visibility = common.visibility }); | ||
| 12 | } | 11 | } |
| 13 | 12 | ||
| 14 | pub fn __truncdfhf2(a: f64) callconv(.C) common.F16T(f64) { | 13 | pub fn __truncdfhf2(a: f64) callconv(.C) common.F16T(f64) { |
lib/std/Target.zig+8-7| ... | @@ -765,12 +765,13 @@ pub const Abi = enum { | ... | @@ -765,12 +765,13 @@ pub const Abi = enum { |
| 765 | 765 | ||
| 766 | pub inline fn floatAbi(abi: Abi) FloatAbi { | 766 | pub inline fn floatAbi(abi: Abi) FloatAbi { |
| 767 | return switch (abi) { | 767 | return switch (abi) { |
| 768 | .gnueabihf, | 768 | .eabi, |
| 769 | .eabihf, | 769 | .gnueabi, |
| 770 | .musleabihf, | 770 | .musleabi, |
| 771 | => .hard, | 771 | .gnusf, |
| 772 | .ohos => .soft, | 772 | .ohos, |
| 773 | else => .soft, | 773 | => .soft, |
| 774 | else => .hard, | ||
| 774 | }; | 775 | }; |
| 775 | } | 776 | } |
| 776 | }; | 777 | }; |
| ... | @@ -1645,7 +1646,7 @@ pub const FloatAbi = enum { | ... | @@ -1645,7 +1646,7 @@ pub const FloatAbi = enum { |
| 1645 | soft, | 1646 | soft, |
| 1646 | }; | 1647 | }; |
| 1647 | 1648 | ||
| 1648 | pub inline fn getFloatAbi(target: Target) FloatAbi { | 1649 | pub inline fn floatAbi(target: Target) FloatAbi { |
| 1649 | return target.abi.floatAbi(); | 1650 | return target.abi.floatAbi(); |
| 1650 | } | 1651 | } |
| 1651 | 1652 |
lib/std/math/gamma.zig+3| ... | @@ -3,6 +3,7 @@ | ... | @@ -3,6 +3,7 @@ |
| 3 | // | 3 | // |
| 4 | // https://git.musl-libc.org/cgit/musl/tree/src/math/tgamma.c | 4 | // https://git.musl-libc.org/cgit/musl/tree/src/math/tgamma.c |
| 5 | 5 | ||
| 6 | const builtin = @import("builtin"); | ||
| 6 | const std = @import("../std.zig"); | 7 | const std = @import("../std.zig"); |
| 7 | 8 | ||
| 8 | /// Returns the gamma function of x, | 9 | /// Returns the gamma function of x, |
| ... | @@ -262,6 +263,8 @@ test gamma { | ... | @@ -262,6 +263,8 @@ test gamma { |
| 262 | } | 263 | } |
| 263 | 264 | ||
| 264 | test "gamma.special" { | 265 | test "gamma.special" { |
| 266 | if (builtin.cpu.arch.isArmOrThumb() and builtin.target.floatAbi() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234 | ||
| 267 | |||
| 265 | inline for (&.{ f32, f64 }) |T| { | 268 | inline for (&.{ f32, f64 }) |T| { |
| 266 | try expect(std.math.isNan(gamma(T, -std.math.nan(T)))); | 269 | try expect(std.math.isNan(gamma(T, -std.math.nan(T)))); |
| 267 | try expect(std.math.isNan(gamma(T, std.math.nan(T)))); | 270 | try expect(std.math.isNan(gamma(T, std.math.nan(T)))); |
lib/std/zig/system.zig+6| ... | @@ -384,6 +384,12 @@ pub fn resolveTargetQuery(query: Target.Query) DetectError!Target { | ... | @@ -384,6 +384,12 @@ pub fn resolveTargetQuery(query: Target.Query) DetectError!Target { |
| 384 | query.cpu_features_add, | 384 | query.cpu_features_add, |
| 385 | query.cpu_features_sub, | 385 | query.cpu_features_sub, |
| 386 | ); | 386 | ); |
| 387 | |||
| 388 | // https://github.com/llvm/llvm-project/issues/105978 | ||
| 389 | if (result.cpu.arch.isArmOrThumb() and result.floatAbi() == .soft) { | ||
| 390 | result.cpu.features.removeFeature(@intFromEnum(Target.arm.Feature.vfp2)); | ||
| 391 | } | ||
| 392 | |||
| 387 | return result; | 393 | return result; |
| 388 | } | 394 | } |
| 389 | 395 |
lib/std/zig/target.zig+6-3| ... | @@ -46,17 +46,20 @@ pub const available_libcs = [_]ArchOsAbi{ | ... | @@ -46,17 +46,20 @@ pub const available_libcs = [_]ArchOsAbi{ |
| 46 | .{ .arch = .mips64, .os = .linux, .abi = .musl }, | 46 | .{ .arch = .mips64, .os = .linux, .abi = .musl }, |
| 47 | .{ .arch = .mipsel, .os = .linux, .abi = .gnueabi }, | 47 | .{ .arch = .mipsel, .os = .linux, .abi = .gnueabi }, |
| 48 | .{ .arch = .mipsel, .os = .linux, .abi = .gnueabihf }, | 48 | .{ .arch = .mipsel, .os = .linux, .abi = .gnueabihf }, |
| 49 | .{ .arch = .mipsel, .os = .linux, .abi = .musl }, | 49 | .{ .arch = .mipsel, .os = .linux, .abi = .musleabi }, |
| 50 | .{ .arch = .mipsel, .os = .linux, .abi = .musleabihf }, | ||
| 50 | .{ .arch = .mips, .os = .linux, .abi = .gnueabi }, | 51 | .{ .arch = .mips, .os = .linux, .abi = .gnueabi }, |
| 51 | .{ .arch = .mips, .os = .linux, .abi = .gnueabihf }, | 52 | .{ .arch = .mips, .os = .linux, .abi = .gnueabihf }, |
| 52 | .{ .arch = .mips, .os = .linux, .abi = .musl }, | 53 | .{ .arch = .mips, .os = .linux, .abi = .musleabi }, |
| 54 | .{ .arch = .mips, .os = .linux, .abi = .musleabihf }, | ||
| 53 | .{ .arch = .powerpc64le, .os = .linux, .abi = .gnu, .glibc_min = .{ .major = 2, .minor = 19, .patch = 0 } }, | 55 | .{ .arch = .powerpc64le, .os = .linux, .abi = .gnu, .glibc_min = .{ .major = 2, .minor = 19, .patch = 0 } }, |
| 54 | .{ .arch = .powerpc64le, .os = .linux, .abi = .musl }, | 56 | .{ .arch = .powerpc64le, .os = .linux, .abi = .musl }, |
| 55 | .{ .arch = .powerpc64, .os = .linux, .abi = .gnu }, | 57 | .{ .arch = .powerpc64, .os = .linux, .abi = .gnu }, |
| 56 | .{ .arch = .powerpc64, .os = .linux, .abi = .musl }, | 58 | .{ .arch = .powerpc64, .os = .linux, .abi = .musl }, |
| 57 | .{ .arch = .powerpc, .os = .linux, .abi = .gnueabi }, | 59 | .{ .arch = .powerpc, .os = .linux, .abi = .gnueabi }, |
| 58 | .{ .arch = .powerpc, .os = .linux, .abi = .gnueabihf }, | 60 | .{ .arch = .powerpc, .os = .linux, .abi = .gnueabihf }, |
| 59 | .{ .arch = .powerpc, .os = .linux, .abi = .musl }, | 61 | .{ .arch = .powerpc, .os = .linux, .abi = .musleabi }, |
| 62 | .{ .arch = .powerpc, .os = .linux, .abi = .musleabihf }, | ||
| 60 | .{ .arch = .riscv32, .os = .linux, .abi = .gnu, .glibc_min = .{ .major = 2, .minor = 33, .patch = 0 } }, | 63 | .{ .arch = .riscv32, .os = .linux, .abi = .gnu, .glibc_min = .{ .major = 2, .minor = 33, .patch = 0 } }, |
| 61 | .{ .arch = .riscv32, .os = .linux, .abi = .musl }, | 64 | .{ .arch = .riscv32, .os = .linux, .abi = .musl }, |
| 62 | .{ .arch = .riscv64, .os = .linux, .abi = .gnu, .glibc_min = .{ .major = 2, .minor = 27, .patch = 0 } }, | 65 | .{ .arch = .riscv64, .os = .linux, .abi = .gnu, .glibc_min = .{ .major = 2, .minor = 27, .patch = 0 } }, |
src/Compilation.zig+25-4| ... | @@ -5484,6 +5484,9 @@ pub fn addCCArgs( | ... | @@ -5484,6 +5484,9 @@ pub fn addCCArgs( |
| 5484 | const is_enabled = target.cpu.features.isEnabled(index); | 5484 | const is_enabled = target.cpu.features.isEnabled(index); |
| 5485 | 5485 | ||
| 5486 | if (feature.llvm_name) |llvm_name| { | 5486 | if (feature.llvm_name) |llvm_name| { |
| 5487 | // We communicate float ABI to Clang through the dedicated options further down. | ||
| 5488 | if (std.mem.eql(u8, llvm_name, "soft-float")) continue; | ||
| 5489 | |||
| 5487 | argv.appendSliceAssumeCapacity(&[_][]const u8{ "-Xclang", "-target-feature", "-Xclang" }); | 5490 | argv.appendSliceAssumeCapacity(&[_][]const u8{ "-Xclang", "-target-feature", "-Xclang" }); |
| 5488 | const plus_or_minus = "-+"[@intFromBool(is_enabled)]; | 5491 | const plus_or_minus = "-+"[@intFromBool(is_enabled)]; |
| 5489 | const arg = try std.fmt.allocPrint(arena, "{c}{s}", .{ plus_or_minus, llvm_name }); | 5492 | const arg = try std.fmt.allocPrint(arena, "{c}{s}", .{ plus_or_minus, llvm_name }); |
| ... | @@ -5705,10 +5708,6 @@ pub fn addCCArgs( | ... | @@ -5705,10 +5708,6 @@ pub fn addCCArgs( |
| 5705 | if (target.cpu.model.llvm_name) |llvm_name| { | 5708 | if (target.cpu.model.llvm_name) |llvm_name| { |
| 5706 | try argv.append(try std.fmt.allocPrint(arena, "-march={s}", .{llvm_name})); | 5709 | try argv.append(try std.fmt.allocPrint(arena, "-march={s}", .{llvm_name})); |
| 5707 | } | 5710 | } |
| 5708 | |||
| 5709 | if (std.Target.mips.featureSetHas(target.cpu.features, .soft_float)) { | ||
| 5710 | try argv.append("-msoft-float"); | ||
| 5711 | } | ||
| 5712 | }, | 5711 | }, |
| 5713 | else => { | 5712 | else => { |
| 5714 | // TODO | 5713 | // TODO |
| ... | @@ -5751,6 +5750,28 @@ pub fn addCCArgs( | ... | @@ -5751,6 +5750,28 @@ pub fn addCCArgs( |
| 5751 | try argv.append(try std.fmt.allocPrint(arena, "-mabi={s}", .{mabi})); | 5750 | try argv.append(try std.fmt.allocPrint(arena, "-mabi={s}", .{mabi})); |
| 5752 | } | 5751 | } |
| 5753 | 5752 | ||
| 5753 | // We might want to support -mfloat-abi=softfp for Arm and CSKY here in the future. | ||
| 5754 | if (target_util.clangSupportsFloatAbiArg(target)) { | ||
| 5755 | const fabi = @tagName(target.floatAbi()); | ||
| 5756 | |||
| 5757 | try argv.append(switch (target.cpu.arch) { | ||
| 5758 | // For whatever reason, Clang doesn't support `-mfloat-abi` for s390x. | ||
| 5759 | .s390x => try std.fmt.allocPrint(arena, "-m{s}-float", .{fabi}), | ||
| 5760 | else => try std.fmt.allocPrint(arena, "-mfloat-abi={s}", .{fabi}), | ||
| 5761 | }); | ||
| 5762 | } | ||
| 5763 | |||
| 5764 | if (target_util.clangSupportsNoImplicitFloatArg(target) and target.floatAbi() == .soft) { | ||
| 5765 | try argv.append("-mno-implicit-float"); | ||
| 5766 | } | ||
| 5767 | |||
| 5768 | // https://github.com/llvm/llvm-project/issues/105972 | ||
| 5769 | if (target.cpu.arch.isPowerPC() and target.floatAbi() == .soft) { | ||
| 5770 | try argv.append("-D__NO_FPRS__"); | ||
| 5771 | try argv.append("-D_SOFT_FLOAT"); | ||
| 5772 | try argv.append("-D_SOFT_DOUBLE"); | ||
| 5773 | } | ||
| 5774 | |||
| 5754 | if (out_dep_path) |p| { | 5775 | if (out_dep_path) |p| { |
| 5755 | try argv.appendSlice(&[_][]const u8{ "-MD", "-MV", "-MF", p }); | 5776 | try argv.appendSlice(&[_][]const u8{ "-MD", "-MV", "-MF", p }); |
| 5756 | } | 5777 | } |
src/codegen/llvm.zig+35-2| ... | @@ -1285,8 +1285,7 @@ pub const Object = struct { | ... | @@ -1285,8 +1285,7 @@ pub const Object = struct { |
| 1285 | .large => .Large, | 1285 | .large => .Large, |
| 1286 | }; | 1286 | }; |
| 1287 | 1287 | ||
| 1288 | // TODO handle float ABI better- it should depend on the ABI portion of std.Target | 1288 | const float_abi: llvm.ABIType = if (comp.root_mod.resolved_target.result.floatAbi() == .hard) .Hard else .Soft; |
| 1289 | const float_abi: llvm.ABIType = .Default; | ||
| 1290 | 1289 | ||
| 1291 | var target_machine = llvm.TargetMachine.create( | 1290 | var target_machine = llvm.TargetMachine.create( |
| 1292 | target, | 1291 | target, |
| ... | @@ -3110,6 +3109,30 @@ pub const Object = struct { | ... | @@ -3110,6 +3109,30 @@ pub const Object = struct { |
| 3110 | .value = .empty, | 3109 | .value = .empty, |
| 3111 | } }, &o.builder); | 3110 | } }, &o.builder); |
| 3112 | } | 3111 | } |
| 3112 | if (target.floatAbi() == .soft) { | ||
| 3113 | // `use-soft-float` means "use software routines for floating point computations". In | ||
| 3114 | // other words, it configures how LLVM lowers basic float instructions like `fcmp`, | ||
| 3115 | // `fadd`, etc. The float calling convention is configured on `TargetMachine` and is | ||
| 3116 | // mostly an orthogonal concept, although obviously we do need hardware float operations | ||
| 3117 | // to actually be able to pass float values in float registers. | ||
| 3118 | // | ||
| 3119 | // Ideally, we would support something akin to the `-mfloat-abi=softfp` option that GCC | ||
| 3120 | // and Clang support for Arm32 and CSKY. We don't currently expose such an option in | ||
| 3121 | // Zig, and using CPU features as the source of truth for this makes for a miserable | ||
| 3122 | // user experience since people expect e.g. `arm-linux-gnueabi` to mean full soft float | ||
| 3123 | // unless the compiler has explicitly been told otherwise. (And note that our baseline | ||
| 3124 | // CPU models almost all include FPU features!) | ||
| 3125 | // | ||
| 3126 | // Revisit this at some point. | ||
| 3127 | try attributes.addFnAttr(.{ .string = .{ | ||
| 3128 | .kind = try o.builder.string("use-soft-float"), | ||
| 3129 | .value = try o.builder.string("true"), | ||
| 3130 | } }, &o.builder); | ||
| 3131 | |||
| 3132 | // This prevents LLVM from using FPU/SIMD code for things like `memcpy`. As for the | ||
| 3133 | // above, this should be revisited if `softfp` support is added. | ||
| 3134 | try attributes.addFnAttr(.noimplicitfloat, &o.builder); | ||
| 3135 | } | ||
| 3113 | } | 3136 | } |
| 3114 | 3137 | ||
| 3115 | fn resolveGlobalUav( | 3138 | fn resolveGlobalUav( |
| ... | @@ -12423,6 +12446,11 @@ fn backendSupportsF16(target: std.Target) bool { | ... | @@ -12423,6 +12446,11 @@ fn backendSupportsF16(target: std.Target) bool { |
| 12423 | .riscv32, | 12446 | .riscv32, |
| 12424 | .s390x, | 12447 | .s390x, |
| 12425 | => false, | 12448 | => false, |
| 12449 | .arm, | ||
| 12450 | .armeb, | ||
| 12451 | .thumb, | ||
| 12452 | .thumbeb, | ||
| 12453 | => target.floatAbi() == .soft or std.Target.arm.featureSetHas(target.cpu.features, .fp_armv8), | ||
| 12426 | .aarch64, | 12454 | .aarch64, |
| 12427 | .aarch64_be, | 12455 | .aarch64_be, |
| 12428 | => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8), | 12456 | => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8), |
| ... | @@ -12445,6 +12473,11 @@ fn backendSupportsF128(target: std.Target) bool { | ... | @@ -12445,6 +12473,11 @@ fn backendSupportsF128(target: std.Target) bool { |
| 12445 | .powerpc64, | 12473 | .powerpc64, |
| 12446 | .powerpc64le, | 12474 | .powerpc64le, |
| 12447 | => target.os.tag != .aix, | 12475 | => target.os.tag != .aix, |
| 12476 | .arm, | ||
| 12477 | .armeb, | ||
| 12478 | .thumb, | ||
| 12479 | .thumbeb, | ||
| 12480 | => target.floatAbi() == .soft or std.Target.arm.featureSetHas(target.cpu.features, .fp_armv8), | ||
| 12448 | .aarch64, | 12481 | .aarch64, |
| 12449 | .aarch64_be, | 12482 | .aarch64_be, |
| 12450 | => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8), | 12483 | => std.Target.aarch64.featureSetHas(target.cpu.features, .fp_armv8), |
src/musl.zig+1| ... | @@ -387,6 +387,7 @@ fn addCcArgs( | ... | @@ -387,6 +387,7 @@ fn addCcArgs( |
| 387 | "-fno-builtin", | 387 | "-fno-builtin", |
| 388 | "-fexcess-precision=standard", | 388 | "-fexcess-precision=standard", |
| 389 | "-frounding-math", | 389 | "-frounding-math", |
| 390 | "-ffp-contract=off", | ||
| 390 | "-fno-strict-aliasing", | 391 | "-fno-strict-aliasing", |
| 391 | "-Wa,--noexecstack", | 392 | "-Wa,--noexecstack", |
| 392 | "-D_XOPEN_SOURCE=700", | 393 | "-D_XOPEN_SOURCE=700", |
src/target.zig+42| ... | @@ -339,6 +339,48 @@ pub fn clangAssemblerSupportsMcpuArg(target: std.Target) bool { | ... | @@ -339,6 +339,48 @@ pub fn clangAssemblerSupportsMcpuArg(target: std.Target) bool { |
| 339 | }; | 339 | }; |
| 340 | } | 340 | } |
| 341 | 341 | ||
| 342 | pub fn clangSupportsFloatAbiArg(target: std.Target) bool { | ||
| 343 | return switch (target.cpu.arch) { | ||
| 344 | .arm, | ||
| 345 | .armeb, | ||
| 346 | .thumb, | ||
| 347 | .thumbeb, | ||
| 348 | .csky, | ||
| 349 | .mips, | ||
| 350 | .mipsel, | ||
| 351 | .mips64, | ||
| 352 | .mips64el, | ||
| 353 | .powerpc, | ||
| 354 | .powerpcle, | ||
| 355 | .powerpc64, | ||
| 356 | .powerpc64le, | ||
| 357 | .s390x, | ||
| 358 | .sparc, | ||
| 359 | .sparc64, | ||
| 360 | => true, | ||
| 361 | // We use the target triple for LoongArch. | ||
| 362 | .loongarch32, .loongarch64 => false, | ||
| 363 | else => false, | ||
| 364 | }; | ||
| 365 | } | ||
| 366 | |||
| 367 | pub fn clangSupportsNoImplicitFloatArg(target: std.Target) bool { | ||
| 368 | return switch (target.cpu.arch) { | ||
| 369 | .aarch64, | ||
| 370 | .aarch64_be, | ||
| 371 | .arm, | ||
| 372 | .armeb, | ||
| 373 | .thumb, | ||
| 374 | .thumbeb, | ||
| 375 | .riscv32, | ||
| 376 | .riscv64, | ||
| 377 | .x86, | ||
| 378 | .x86_64, | ||
| 379 | => true, | ||
| 380 | else => false, | ||
| 381 | }; | ||
| 382 | } | ||
| 383 | |||
| 342 | pub fn needUnwindTables(target: std.Target) bool { | 384 | pub fn needUnwindTables(target: std.Target) bool { |
| 343 | return target.os.tag == .windows or target.isDarwin() or std.debug.Dwarf.abi.supportsUnwinding(target); | 385 | return target.os.tag == .windows or target.isDarwin() or std.debug.Dwarf.abi.supportsUnwinding(target); |
| 344 | } | 386 | } |
test/behavior/floatop.zig+2| ... | @@ -126,6 +126,7 @@ test "cmp f16" { | ... | @@ -126,6 +126,7 @@ test "cmp f16" { |
| 126 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; | 126 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; |
| 127 | if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest; | 127 | if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest; |
| 128 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 128 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 129 | if (builtin.cpu.arch.isArmOrThumb() and builtin.target.floatAbi() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234 | ||
| 129 | 130 | ||
| 130 | try testCmp(f16); | 131 | try testCmp(f16); |
| 131 | try comptime testCmp(f16); | 132 | try comptime testCmp(f16); |
| ... | @@ -134,6 +135,7 @@ test "cmp f16" { | ... | @@ -134,6 +135,7 @@ test "cmp f16" { |
| 134 | test "cmp f32/f64" { | 135 | test "cmp f32/f64" { |
| 135 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO | 136 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| 136 | if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest; | 137 | if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest; |
| 138 | if (builtin.cpu.arch.isArmOrThumb() and builtin.target.floatAbi() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234 | ||
| 137 | 139 | ||
| 138 | try testCmp(f32); | 140 | try testCmp(f32); |
| 139 | try comptime testCmp(f32); | 141 | try comptime testCmp(f32); |
test/behavior/math.zig+1| ... | @@ -1597,6 +1597,7 @@ test "NaN comparison" { | ... | @@ -1597,6 +1597,7 @@ test "NaN comparison" { |
| 1597 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 1597 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 1598 | if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest; | 1598 | if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf and builtin.target.ofmt != .macho) return error.SkipZigTest; |
| 1599 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1599 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1600 | if (builtin.cpu.arch.isArmOrThumb() and builtin.target.floatAbi() == .soft) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21234 | ||
| 1600 | 1601 | ||
| 1601 | try testNanEqNan(f16); | 1602 | try testNanEqNan(f16); |
| 1602 | try testNanEqNan(f32); | 1603 | try testNanEqNan(f32); |
test/behavior/vector.zig+8-5| ... | @@ -1409,7 +1409,14 @@ test "store vector with memset" { | ... | @@ -1409,7 +1409,14 @@ test "store vector with memset" { |
| 1409 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; | 1409 | if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; |
| 1410 | 1410 | ||
| 1411 | if (builtin.zig_backend == .stage2_llvm) { | 1411 | if (builtin.zig_backend == .stage2_llvm) { |
| 1412 | // LLVM 16 ERROR: "Converting bits to bytes lost precision" | ||
| 1413 | // https://github.com/ziglang/zig/issues/16177 | ||
| 1412 | switch (builtin.target.cpu.arch) { | 1414 | switch (builtin.target.cpu.arch) { |
| 1415 | .arm, | ||
| 1416 | .armeb, | ||
| 1417 | .thumb, | ||
| 1418 | .thumbeb, | ||
| 1419 | => if (builtin.target.floatAbi() == .soft) return error.SkipZigTest, | ||
| 1413 | .wasm32, | 1420 | .wasm32, |
| 1414 | .mips, | 1421 | .mips, |
| 1415 | .mipsel, | 1422 | .mipsel, |
| ... | @@ -1418,11 +1425,7 @@ test "store vector with memset" { | ... | @@ -1418,11 +1425,7 @@ test "store vector with memset" { |
| 1418 | .riscv64, | 1425 | .riscv64, |
| 1419 | .powerpc, | 1426 | .powerpc, |
| 1420 | .powerpc64, | 1427 | .powerpc64, |
| 1421 | => { | 1428 | => return error.SkipZigTest, |
| 1422 | // LLVM 16 ERROR: "Converting bits to bytes lost precision" | ||
| 1423 | // https://github.com/ziglang/zig/issues/16177 | ||
| 1424 | return error.SkipZigTest; | ||
| 1425 | }, | ||
| 1426 | else => {}, | 1429 | else => {}, |
| 1427 | } | 1430 | } |
| 1428 | } | 1431 | } |
test/tests.zig+113-20| ... | @@ -291,23 +291,49 @@ const test_targets = blk: { | ... | @@ -291,23 +291,49 @@ const test_targets = blk: { |
| 291 | }, | 291 | }, |
| 292 | 292 | ||
| 293 | .{ | 293 | .{ |
| 294 | .target = std.Target.Query.parse(.{ | 294 | .target = .{ |
| 295 | .arch_os_abi = "arm-linux-none", | 295 | .cpu_arch = .arm, |
| 296 | .cpu_features = "generic+v8a", | 296 | .os_tag = .linux, |
| 297 | }) catch unreachable, | 297 | .abi = .eabi, |
| 298 | }, | ||
| 299 | }, | ||
| 300 | .{ | ||
| 301 | .target = .{ | ||
| 302 | .cpu_arch = .arm, | ||
| 303 | .os_tag = .linux, | ||
| 304 | .abi = .eabihf, | ||
| 305 | }, | ||
| 306 | }, | ||
| 307 | .{ | ||
| 308 | .target = .{ | ||
| 309 | .cpu_arch = .arm, | ||
| 310 | .os_tag = .linux, | ||
| 311 | .abi = .musleabi, | ||
| 312 | }, | ||
| 313 | .link_libc = true, | ||
| 314 | }, | ||
| 315 | .{ | ||
| 316 | .target = .{ | ||
| 317 | .cpu_arch = .arm, | ||
| 318 | .os_tag = .linux, | ||
| 319 | .abi = .musleabihf, | ||
| 320 | }, | ||
| 321 | .link_libc = true, | ||
| 298 | }, | 322 | }, |
| 299 | .{ | 323 | .{ |
| 300 | .target = std.Target.Query.parse(.{ | 324 | .target = .{ |
| 301 | .arch_os_abi = "arm-linux-musleabihf", | 325 | .cpu_arch = .arm, |
| 302 | .cpu_features = "generic+v8a", | 326 | .os_tag = .linux, |
| 303 | }) catch unreachable, | 327 | .abi = .gnueabi, |
| 328 | }, | ||
| 304 | .link_libc = true, | 329 | .link_libc = true, |
| 305 | }, | 330 | }, |
| 306 | .{ | 331 | .{ |
| 307 | .target = std.Target.Query.parse(.{ | 332 | .target = .{ |
| 308 | .arch_os_abi = "arm-linux-gnueabihf", | 333 | .cpu_arch = .arm, |
| 309 | .cpu_features = "generic+v8a", | 334 | .os_tag = .linux, |
| 310 | }) catch unreachable, | 335 | .abi = .gnueabihf, |
| 336 | }, | ||
| 311 | .link_libc = true, | 337 | .link_libc = true, |
| 312 | }, | 338 | }, |
| 313 | 339 | ||
| ... | @@ -315,7 +341,7 @@ const test_targets = blk: { | ... | @@ -315,7 +341,7 @@ const test_targets = blk: { |
| 315 | .target = .{ | 341 | .target = .{ |
| 316 | .cpu_arch = .mips, | 342 | .cpu_arch = .mips, |
| 317 | .os_tag = .linux, | 343 | .os_tag = .linux, |
| 318 | .abi = .none, | 344 | .abi = .eabi, |
| 319 | }, | 345 | }, |
| 320 | .slow_backend = true, | 346 | .slow_backend = true, |
| 321 | }, | 347 | }, |
| ... | @@ -323,7 +349,33 @@ const test_targets = blk: { | ... | @@ -323,7 +349,33 @@ const test_targets = blk: { |
| 323 | .target = .{ | 349 | .target = .{ |
| 324 | .cpu_arch = .mips, | 350 | .cpu_arch = .mips, |
| 325 | .os_tag = .linux, | 351 | .os_tag = .linux, |
| 326 | .abi = .musl, | 352 | .abi = .eabihf, |
| 353 | }, | ||
| 354 | .slow_backend = true, | ||
| 355 | }, | ||
| 356 | .{ | ||
| 357 | .target = .{ | ||
| 358 | .cpu_arch = .mips, | ||
| 359 | .os_tag = .linux, | ||
| 360 | .abi = .musleabi, | ||
| 361 | }, | ||
| 362 | .link_libc = true, | ||
| 363 | .slow_backend = true, | ||
| 364 | }, | ||
| 365 | .{ | ||
| 366 | .target = .{ | ||
| 367 | .cpu_arch = .mips, | ||
| 368 | .os_tag = .linux, | ||
| 369 | .abi = .musleabihf, | ||
| 370 | }, | ||
| 371 | .link_libc = true, | ||
| 372 | .slow_backend = true, | ||
| 373 | }, | ||
| 374 | .{ | ||
| 375 | .target = .{ | ||
| 376 | .cpu_arch = .mips, | ||
| 377 | .os_tag = .linux, | ||
| 378 | .abi = .gnueabi, | ||
| 327 | }, | 379 | }, |
| 328 | .link_libc = true, | 380 | .link_libc = true, |
| 329 | .slow_backend = true, | 381 | .slow_backend = true, |
| ... | @@ -342,7 +394,7 @@ const test_targets = blk: { | ... | @@ -342,7 +394,7 @@ const test_targets = blk: { |
| 342 | .target = .{ | 394 | .target = .{ |
| 343 | .cpu_arch = .mipsel, | 395 | .cpu_arch = .mipsel, |
| 344 | .os_tag = .linux, | 396 | .os_tag = .linux, |
| 345 | .abi = .none, | 397 | .abi = .eabi, |
| 346 | }, | 398 | }, |
| 347 | .slow_backend = true, | 399 | .slow_backend = true, |
| 348 | }, | 400 | }, |
| ... | @@ -350,7 +402,33 @@ const test_targets = blk: { | ... | @@ -350,7 +402,33 @@ const test_targets = blk: { |
| 350 | .target = .{ | 402 | .target = .{ |
| 351 | .cpu_arch = .mipsel, | 403 | .cpu_arch = .mipsel, |
| 352 | .os_tag = .linux, | 404 | .os_tag = .linux, |
| 353 | .abi = .musl, | 405 | .abi = .eabihf, |
| 406 | }, | ||
| 407 | .slow_backend = true, | ||
| 408 | }, | ||
| 409 | .{ | ||
| 410 | .target = .{ | ||
| 411 | .cpu_arch = .mipsel, | ||
| 412 | .os_tag = .linux, | ||
| 413 | .abi = .musleabi, | ||
| 414 | }, | ||
| 415 | .link_libc = true, | ||
| 416 | .slow_backend = true, | ||
| 417 | }, | ||
| 418 | .{ | ||
| 419 | .target = .{ | ||
| 420 | .cpu_arch = .mipsel, | ||
| 421 | .os_tag = .linux, | ||
| 422 | .abi = .musleabihf, | ||
| 423 | }, | ||
| 424 | .link_libc = true, | ||
| 425 | .slow_backend = true, | ||
| 426 | }, | ||
| 427 | .{ | ||
| 428 | .target = .{ | ||
| 429 | .cpu_arch = .mipsel, | ||
| 430 | .os_tag = .linux, | ||
| 431 | .abi = .gnueabi, | ||
| 354 | }, | 432 | }, |
| 355 | .link_libc = true, | 433 | .link_libc = true, |
| 356 | .slow_backend = true, | 434 | .slow_backend = true, |
| ... | @@ -417,14 +495,29 @@ const test_targets = blk: { | ... | @@ -417,14 +495,29 @@ const test_targets = blk: { |
| 417 | .target = .{ | 495 | .target = .{ |
| 418 | .cpu_arch = .powerpc, | 496 | .cpu_arch = .powerpc, |
| 419 | .os_tag = .linux, | 497 | .os_tag = .linux, |
| 420 | .abi = .none, | 498 | .abi = .eabi, |
| 421 | }, | 499 | }, |
| 422 | }, | 500 | }, |
| 423 | .{ | 501 | .{ |
| 424 | .target = .{ | 502 | .target = .{ |
| 425 | .cpu_arch = .powerpc, | 503 | .cpu_arch = .powerpc, |
| 426 | .os_tag = .linux, | 504 | .os_tag = .linux, |
| 427 | .abi = .musl, | 505 | .abi = .eabihf, |
| 506 | }, | ||
| 507 | }, | ||
| 508 | .{ | ||
| 509 | .target = .{ | ||
| 510 | .cpu_arch = .powerpc, | ||
| 511 | .os_tag = .linux, | ||
| 512 | .abi = .musleabi, | ||
| 513 | }, | ||
| 514 | .link_libc = true, | ||
| 515 | }, | ||
| 516 | .{ | ||
| 517 | .target = .{ | ||
| 518 | .cpu_arch = .powerpc, | ||
| 519 | .os_tag = .linux, | ||
| 520 | .abi = .musleabihf, | ||
| 428 | }, | 521 | }, |
| 429 | .link_libc = true, | 522 | .link_libc = true, |
| 430 | }, | 523 | }, |
| ... | @@ -661,7 +754,7 @@ const c_abi_targets = [_]CAbiTarget{ | ... | @@ -661,7 +754,7 @@ const c_abi_targets = [_]CAbiTarget{ |
| 661 | .target = .{ | 754 | .target = .{ |
| 662 | .cpu_arch = .mips, | 755 | .cpu_arch = .mips, |
| 663 | .os_tag = .linux, | 756 | .os_tag = .linux, |
| 664 | .abi = .musl, | 757 | .abi = .musleabihf, |
| 665 | }, | 758 | }, |
| 666 | }, | 759 | }, |
| 667 | .{ | 760 | .{ |
| ... | @@ -682,7 +775,7 @@ const c_abi_targets = [_]CAbiTarget{ | ... | @@ -682,7 +775,7 @@ const c_abi_targets = [_]CAbiTarget{ |
| 682 | .target = .{ | 775 | .target = .{ |
| 683 | .cpu_arch = .powerpc, | 776 | .cpu_arch = .powerpc, |
| 684 | .os_tag = .linux, | 777 | .os_tag = .linux, |
| 685 | .abi = .musl, | 778 | .abi = .musleabihf, |
| 686 | }, | 779 | }, |
| 687 | }, | 780 | }, |
| 688 | .{ | 781 | .{ |