Skip to content

Commit 399da54

Browse files
authoredApr 28, 2025
Merge pull request ziglang#23720 from alexrp/sparc-stuff
2 parents 8facd99 + 12f56b8 commit 399da54

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed
 

‎lib/compiler_rt/sqrt.zig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ comptime {
1313
@export(&__sqrtx, .{ .name = "__sqrtx", .linkage = common.linkage, .visibility = common.visibility });
1414
if (common.want_ppc_abi) {
1515
@export(&sqrtq, .{ .name = "sqrtf128", .linkage = common.linkage, .visibility = common.visibility });
16+
} else if (common.want_sparc_abi) {
17+
@export(&_Qp_sqrt, .{ .name = "_Qp_sqrt", .linkage = common.linkage, .visibility = common.visibility });
1618
}
1719
@export(&sqrtq, .{ .name = "sqrtq", .linkage = common.linkage, .visibility = common.visibility });
1820
@export(&sqrtl, .{ .name = "sqrtl", .linkage = common.linkage, .visibility = common.visibility });
@@ -242,6 +244,10 @@ pub fn sqrtq(x: f128) callconv(.c) f128 {
242244
return sqrt(@floatCast(x));
243245
}
244246

247+
fn _Qp_sqrt(c: *f128, a: *f128) callconv(.c) void {
248+
c.* = sqrt(@floatCast(a.*));
249+
}
250+
245251
pub fn sqrtl(x: c_longdouble) callconv(.c) c_longdouble {
246252
switch (@typeInfo(c_longdouble).float.bits) {
247253
16 => return __sqrth(x),

‎lib/std/os/linux/sparc64.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ pub const msghdr_const = extern struct {
304304

305305
pub const off_t = i64;
306306
pub const ino_t = u64;
307+
pub const time_t = isize;
307308
pub const mode_t = u32;
308309
pub const dev_t = usize;
309310
pub const nlink_t = u32;

‎test/behavior/var_args.zig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ test "simple variadic function" {
106106
}
107107
if (builtin.cpu.arch == .x86_64 and builtin.os.tag == .windows) return error.SkipZigTest; // TODO
108108
if (builtin.cpu.arch == .s390x and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21350
109+
if (builtin.cpu.arch.isSPARC() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23718
109110

110111
const S = struct {
111112
fn simple(...) callconv(.c) c_int {
@@ -200,6 +201,7 @@ test "variadic functions" {
200201
}
201202
if (builtin.cpu.arch == .x86_64 and builtin.os.tag == .windows) return error.SkipZigTest; // TODO
202203
if (builtin.cpu.arch == .s390x and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21350
204+
if (builtin.cpu.arch.isSPARC() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23718
203205

204206
const S = struct {
205207
fn printf(list_ptr: *std.ArrayList(u8), format: [*:0]const u8, ...) callconv(.c) void {
@@ -245,6 +247,7 @@ test "copy VaList" {
245247
}
246248
if (builtin.cpu.arch == .x86_64 and builtin.os.tag == .windows) return error.SkipZigTest; // TODO
247249
if (builtin.cpu.arch == .s390x and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21350
250+
if (builtin.cpu.arch.isSPARC() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23718
248251

249252
const S = struct {
250253
fn add(count: c_int, ...) callconv(.c) c_int {
@@ -282,6 +285,7 @@ test "unused VaList arg" {
282285
return error.SkipZigTest; // TODO
283286
}
284287
if (builtin.cpu.arch == .s390x and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21350
288+
if (builtin.cpu.arch.isSPARC() and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23718
285289

286290
const S = struct {
287291
fn thirdArg(dummy: c_int, ...) callconv(.c) c_int {

‎test/behavior/vector.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,7 @@ test "vector reduce operation" {
765765
if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArm()) return error.SkipZigTest;
766766
if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest;
767767
if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21091
768+
if (builtin.cpu.arch.isSPARC()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23719
768769

769770
const S = struct {
770771
fn testReduce(comptime op: std.builtin.ReduceOp, x: anytype, expected: anytype) !void {

0 commit comments

Comments
 (0)