@zigc/lib 0.17.0-dev.9 → 0.17.0-dev.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/c/fcntl.zig +6 -1
- package/c/inttypes.zig +0 -10
- package/c/math.zig +46 -122
- package/c/search.zig +1 -27
- package/c/stdlib/drand48.zig +0 -57
- package/c/stdlib.zig +0 -100
- package/c/string.zig +0 -7
- package/c/strings.zig +0 -38
- package/c/unistd.zig +27 -26
- package/c.zig +1 -2
- package/compiler/aro/aro/CodeGen.zig +3 -2
- package/compiler/aro/aro/Compilation.zig +15 -12
- package/compiler/aro/aro/Driver.zig +9 -6
- package/compiler/aro/aro/Parser.zig +18 -12
- package/compiler/aro/aro/Pragma.zig +3 -2
- package/compiler/aro/aro/Preprocessor.zig +9 -6
- package/compiler/aro/aro/pragmas/message.zig +3 -2
- package/compiler/aro/aro/text_literal.zig +3 -2
- package/compiler/aro/assembly_backend/x86_64.zig +3 -2
- package/compiler/build_runner.zig +0 -2
- package/compiler/test_runner.zig +1 -1
- package/compiler/translate-c/Translator.zig +4 -0
- package/compiler_rt/cos.zig +0 -2
- package/compiler_rt/divmodei4.zig +40 -17
- package/compiler_rt/exp.zig +1 -6
- package/compiler_rt/exp2.zig +1 -6
- package/compiler_rt/exp_f128.zig +377 -0
- package/compiler_rt/fabs.zig +0 -2
- package/compiler_rt/fma.zig +0 -2
- package/compiler_rt/fmax.zig +0 -2
- package/compiler_rt/fmin.zig +0 -2
- package/compiler_rt/fmod.zig +0 -2
- package/compiler_rt/limb64.zig +876 -15
- package/compiler_rt/log.zig +0 -2
- package/compiler_rt/log10.zig +0 -2
- package/compiler_rt/log2.zig +0 -2
- package/compiler_rt/mulXi3.zig +1 -1
- package/compiler_rt/round.zig +0 -2
- package/compiler_rt/sin.zig +0 -2
- package/compiler_rt/sincos.zig +0 -2
- package/compiler_rt/sqrt.zig +0 -2
- package/compiler_rt/ssp.zig +1 -1
- package/compiler_rt/tan.zig +0 -2
- package/compiler_rt/trunc.zig +0 -2
- package/compiler_rt/udivmodei4.zig +28 -0
- package/fuzzer.zig +2 -0
- package/libc/musl/arch/mipsn32/syscall_arch.h +35 -32
- package/package.json +1 -1
- package/std/Build/Step/Compile.zig +0 -1
- package/std/Build.zig +0 -3
- package/std/Io/Dispatch.zig +3 -13
- package/std/Io/Semaphore.zig +112 -17
- package/std/Io/Threaded.zig +167 -33
- package/std/Io/Uring.zig +12 -14
- package/std/Io/Writer.zig +46 -42
- package/std/Io/net.zig +11 -11
- package/std/Io.zig +89 -25
- package/std/Target.zig +50 -5
- package/std/builtin.zig +4 -0
- package/std/c/haiku.zig +3 -0
- package/std/c/serenity.zig +1 -6
- package/std/c.zig +59 -6
- package/std/debug.zig +4 -3
- package/std/fmt.zig +7 -2
- package/std/fs/path.zig +6 -4
- package/std/heap/BufferFirstAllocator.zig +165 -0
- package/std/heap.zig +2 -126
- package/std/http/Client.zig +21 -24
- package/std/os/linux/aarch64.zig +41 -12
- package/std/os/linux/arc.zig +41 -12
- package/std/os/linux/arm.zig +41 -12
- package/std/os/linux/hexagon.zig +33 -11
- package/std/os/linux/loongarch32.zig +41 -13
- package/std/os/linux/loongarch64.zig +41 -12
- package/std/os/linux/m68k.zig +41 -13
- package/std/os/linux/mips.zig +67 -36
- package/std/os/linux/mips64.zig +60 -29
- package/std/os/linux/mipsn32.zig +60 -29
- package/std/os/linux/or1k.zig +41 -12
- package/std/os/linux/powerpc.zig +41 -12
- package/std/os/linux/powerpc64.zig +41 -12
- package/std/os/linux/riscv32.zig +41 -12
- package/std/os/linux/riscv64.zig +41 -12
- package/std/os/linux/s390x.zig +44 -7
- package/std/os/linux/sparc64.zig +83 -52
- package/std/os/linux/thumb.zig +52 -36
- package/std/os/linux/x32.zig +41 -12
- package/std/os/linux/x86.zig +42 -13
- package/std/os/linux/x86_64.zig +41 -12
- package/std/os/linux.zig +398 -434
- package/std/os.zig +41 -0
- package/std/sort.zig +3 -3
- package/std/zig/AstGen.zig +22 -92
- package/std/zig/AstRlAnnotate.zig +0 -11
- package/std/zig/BuiltinFn.zig +0 -32
- package/std/zig/LibCInstallation.zig +1 -0
- package/std/zig/Zir.zig +50 -63
- package/std/zig/ZonGen.zig +5 -4
- package/std/zig/llvm/Builder.zig +12 -12
- package/std/zig.zig +0 -10
- package/zig.h +340 -1
- package/libc/mingw/math/fdiml.c +0 -24
- package/libc/musl/src/linux/tee.c +0 -8
- package/libc/musl/src/math/fdimf.c +0 -10
- package/libc/musl/src/math/fdiml.c +0 -18
- package/libc/musl/src/unistd/dup2.c +0 -20
- package/libc/musl/src/unistd/dup3.c +0 -26
|
@@ -1761,8 +1761,9 @@ fn addToSearchPath(comp: *Compilation, include: Include, verbose: bool) !void {
|
|
|
1761
1761
|
try comp.search_path.append(comp.gpa, include);
|
|
1762
1762
|
}
|
|
1763
1763
|
fn removeDuplicateSearchPaths(comp: *Compilation, start: usize, verbose: bool) !void {
|
|
1764
|
-
var
|
|
1765
|
-
|
|
1764
|
+
var bfa_buf: [1024]u8 = undefined;
|
|
1765
|
+
var bfa: std.heap.BufferFirstAllocator = .init(&bfa_buf, comp.gpa);
|
|
1766
|
+
const allocator = bfa.allocator();
|
|
1766
1767
|
var seen_includes: std.StringHashMapUnmanaged(void) = .empty;
|
|
1767
1768
|
defer seen_includes.deinit(allocator);
|
|
1768
1769
|
var seen_frameworks: std.StringHashMapUnmanaged(void) = .empty;
|
|
@@ -1976,10 +1977,11 @@ const FindInclude = struct {
|
|
|
1976
1977
|
) Allocator.Error!?Result {
|
|
1977
1978
|
const comp = find.comp;
|
|
1978
1979
|
|
|
1979
|
-
var
|
|
1980
|
-
|
|
1981
|
-
const
|
|
1982
|
-
|
|
1980
|
+
var bfa_buf: [path_buf_stack_limit]u8 = undefined;
|
|
1981
|
+
var bfa_state: std.heap.BufferFirstAllocator = .init(&bfa_buf, comp.gpa);
|
|
1982
|
+
const bfa = bfa_state.allocator();
|
|
1983
|
+
const header_path = try std.fmt.allocPrint(bfa, format, args);
|
|
1984
|
+
defer bfa.free(header_path);
|
|
1983
1985
|
find.comp.normalizePath(header_path);
|
|
1984
1986
|
|
|
1985
1987
|
const source = comp.addSourceFromPathExtra(header_path, kind) catch |err| switch (err) {
|
|
@@ -2068,14 +2070,15 @@ pub fn findEmbed(
|
|
|
2068
2070
|
}
|
|
2069
2071
|
}
|
|
2070
2072
|
|
|
2071
|
-
var
|
|
2072
|
-
|
|
2073
|
+
var bfa_buf: [path_buf_stack_limit]u8 = undefined;
|
|
2074
|
+
var bfa_state: std.heap.BufferFirstAllocator = .init(&bfa_buf, comp.gpa);
|
|
2075
|
+
const bfa = bfa_state.allocator();
|
|
2073
2076
|
|
|
2074
2077
|
switch (include_type) {
|
|
2075
2078
|
.quotes, .cli => {
|
|
2076
2079
|
const dir = std.fs.path.dirname(comp.getSource(includer_token_source).path) orelse ".";
|
|
2077
|
-
const path = try std.fs.path.join(
|
|
2078
|
-
defer
|
|
2080
|
+
const path = try std.fs.path.join(bfa, &.{ dir, filename });
|
|
2081
|
+
defer bfa.free(path);
|
|
2079
2082
|
comp.normalizePath(path);
|
|
2080
2083
|
if (comp.getPathContents(path, limit)) |some| {
|
|
2081
2084
|
errdefer comp.gpa.free(some);
|
|
@@ -2089,8 +2092,8 @@ pub fn findEmbed(
|
|
|
2089
2092
|
.angle_brackets => {},
|
|
2090
2093
|
}
|
|
2091
2094
|
for (comp.embed_dirs.items) |embed_dir| {
|
|
2092
|
-
const path = try std.fs.path.join(
|
|
2093
|
-
defer
|
|
2095
|
+
const path = try std.fs.path.join(bfa, &.{ embed_dir, filename });
|
|
2096
|
+
defer bfa.free(path);
|
|
2094
2097
|
comp.normalizePath(path);
|
|
2095
2098
|
if (comp.getPathContents(path, limit)) |some| {
|
|
2096
2099
|
errdefer comp.gpa.free(some);
|
|
@@ -947,8 +947,9 @@ fn addImacros(d: *Driver, path: []const u8) !void {
|
|
|
947
947
|
}
|
|
948
948
|
|
|
949
949
|
pub fn err(d: *Driver, fmt: []const u8, args: anytype) Compilation.Error!void {
|
|
950
|
-
var
|
|
951
|
-
var
|
|
950
|
+
var bfa_buf: [1024]u8 = undefined;
|
|
951
|
+
var bfa: std.heap.BufferFirstAllocator = .init(&bfa_buf, d.comp.gpa);
|
|
952
|
+
var allocating: std.Io.Writer.Allocating = .init(bfa.allocator());
|
|
952
953
|
defer allocating.deinit();
|
|
953
954
|
|
|
954
955
|
Diagnostics.formatArgs(&allocating.writer, fmt, args) catch return error.OutOfMemory;
|
|
@@ -956,8 +957,9 @@ pub fn err(d: *Driver, fmt: []const u8, args: anytype) Compilation.Error!void {
|
|
|
956
957
|
}
|
|
957
958
|
|
|
958
959
|
pub fn warn(d: *Driver, fmt: []const u8, args: anytype) Compilation.Error!void {
|
|
959
|
-
var
|
|
960
|
-
var
|
|
960
|
+
var bfa_buf: [1024]u8 = undefined;
|
|
961
|
+
var bfa: std.heap.BufferFirstAllocator = .init(&bfa_buf, d.comp.gpa);
|
|
962
|
+
var allocating: std.Io.Writer.Allocating = .init(bfa.allocator());
|
|
961
963
|
defer allocating.deinit();
|
|
962
964
|
|
|
963
965
|
Diagnostics.formatArgs(&allocating.writer, fmt, args) catch return error.OutOfMemory;
|
|
@@ -1101,8 +1103,9 @@ fn parseTarget(d: *Driver, arch_os_abi: []const u8, opt_cpu_features: ?[]const u
|
|
|
1101
1103
|
}
|
|
1102
1104
|
|
|
1103
1105
|
pub fn fatal(d: *Driver, comptime fmt: []const u8, args: anytype) error{ FatalError, OutOfMemory } {
|
|
1104
|
-
var
|
|
1105
|
-
var
|
|
1106
|
+
var bfa_buf: [1024]u8 = undefined;
|
|
1107
|
+
var bfa: std.heap.BufferFirstAllocator = .init(&bfa_buf, d.comp.gpa);
|
|
1108
|
+
var allocating: std.Io.Writer.Allocating = .init(bfa.allocator());
|
|
1106
1109
|
defer allocating.deinit();
|
|
1107
1110
|
|
|
1108
1111
|
Diagnostics.formatArgs(&allocating.writer, fmt, args) catch return error.OutOfMemory;
|
|
@@ -215,8 +215,9 @@ fn checkIdentifierCodepointWarnings(p: *Parser, codepoint: u21, loc: Source.Loca
|
|
|
215
215
|
assert(codepoint >= 0x80);
|
|
216
216
|
|
|
217
217
|
const prev_total = p.diagnostics.total;
|
|
218
|
-
var
|
|
219
|
-
var
|
|
218
|
+
var bfa_buf: [1024]u8 = undefined;
|
|
219
|
+
var bfa: std.heap.BufferFirstAllocator = .init(&bfa_buf, p.comp.gpa);
|
|
220
|
+
var allocating: std.Io.Writer.Allocating = .init(bfa.allocator());
|
|
220
221
|
defer allocating.deinit();
|
|
221
222
|
|
|
222
223
|
if (!char_info.isC99IdChar(codepoint)) {
|
|
@@ -429,8 +430,9 @@ pub fn err(p: *Parser, tok_i: TokenIndex, diagnostic: Diagnostic, args: anytype)
|
|
|
429
430
|
if (diagnostic.suppress_unless_version) |some| if (!p.comp.langopts.standard.atLeast(some)) return;
|
|
430
431
|
if (p.diagnostics.effectiveKind(diagnostic) == .off) return;
|
|
431
432
|
|
|
432
|
-
var
|
|
433
|
-
var
|
|
433
|
+
var bfa_buf: [1024]u8 = undefined;
|
|
434
|
+
var bfa: std.heap.BufferFirstAllocator = .init(&bfa_buf, p.comp.gpa);
|
|
435
|
+
var allocating: std.Io.Writer.Allocating = .init(bfa.allocator());
|
|
434
436
|
defer allocating.deinit();
|
|
435
437
|
|
|
436
438
|
p.formatArgs(&allocating.writer, diagnostic.fmt, args) catch return error.OutOfMemory;
|
|
@@ -1537,8 +1539,9 @@ fn staticAssert(p: *Parser) Error!bool {
|
|
|
1537
1539
|
}
|
|
1538
1540
|
} else {
|
|
1539
1541
|
if (!res.val.toBool(p.comp)) {
|
|
1540
|
-
var
|
|
1541
|
-
var
|
|
1542
|
+
var bfa_buf: [1024]u8 = undefined;
|
|
1543
|
+
var bfa: std.heap.BufferFirstAllocator = .init(&bfa_buf, gpa);
|
|
1544
|
+
var allocating: std.Io.Writer.Allocating = .init(bfa.allocator());
|
|
1542
1545
|
defer allocating.deinit();
|
|
1543
1546
|
|
|
1544
1547
|
if (p.staticAssertMessage(res_node, str, &allocating) catch return error.OutOfMemory) |message| {
|
|
@@ -4837,8 +4840,9 @@ fn gnuAsmStmt(p: *Parser, quals: Tree.GNUAssemblyQualifiers, asm_tok: TokenIndex
|
|
|
4837
4840
|
const expected_items = 8; // arbitrarily chosen, most assembly will have fewer than 8 inputs/outputs/constraints/names
|
|
4838
4841
|
const bytes_needed = expected_items * @sizeOf(Tree.Node.AsmStmt.Operand) + expected_items * 2 * @sizeOf(Node.Index);
|
|
4839
4842
|
|
|
4840
|
-
var
|
|
4841
|
-
|
|
4843
|
+
var bfa_buf: [bytes_needed]u8 = undefined;
|
|
4844
|
+
var bfa: std.heap.BufferFirstAllocator = .init(&bfa_buf, gpa);
|
|
4845
|
+
const allocator = bfa.allocator();
|
|
4842
4846
|
|
|
4843
4847
|
var operands: std.ArrayList(Tree.Node.AsmStmt.Operand) = .empty;
|
|
4844
4848
|
defer operands.deinit(allocator);
|
|
@@ -9922,8 +9926,9 @@ fn primaryExpr(p: *Parser) Error!?Result {
|
|
|
9922
9926
|
if (p.func.pretty_ident) |some| {
|
|
9923
9927
|
qt = some.qt;
|
|
9924
9928
|
} else if (p.func.qt) |func_qt| {
|
|
9925
|
-
var
|
|
9926
|
-
var
|
|
9929
|
+
var bfa_buf: [1024]u8 = undefined;
|
|
9930
|
+
var bfa: std.heap.BufferFirstAllocator = .init(&bfa_buf, gpa);
|
|
9931
|
+
var allocating: std.Io.Writer.Allocating = .init(bfa.allocator());
|
|
9927
9932
|
defer allocating.deinit();
|
|
9928
9933
|
|
|
9929
9934
|
func_qt.printNamed(p.tokSlice(p.func.name), p.comp, &allocating.writer) catch return error.OutOfMemory;
|
|
@@ -10212,8 +10217,9 @@ fn charLiteral(p: *Parser) Error!?Result {
|
|
|
10212
10217
|
};
|
|
10213
10218
|
|
|
10214
10219
|
const max_chars_expected = 4;
|
|
10215
|
-
var
|
|
10216
|
-
|
|
10220
|
+
var bfa_buf: [max_chars_expected]u32 = undefined;
|
|
10221
|
+
var bfa: std.heap.BufferFirstAllocator = .init(@ptrCast(&bfa_buf), gpa);
|
|
10222
|
+
const allocator = bfa.allocator();
|
|
10217
10223
|
var chars: std.ArrayList(u32) = .empty;
|
|
10218
10224
|
defer chars.deinit(allocator);
|
|
10219
10225
|
|
|
@@ -212,8 +212,9 @@ pub const Diagnostic = struct {
|
|
|
212
212
|
};
|
|
213
213
|
|
|
214
214
|
pub fn err(pp: *Preprocessor, tok_i: TokenIndex, diagnostic: Diagnostic, args: anytype) Compilation.Error!void {
|
|
215
|
-
var
|
|
216
|
-
var
|
|
215
|
+
var buf: [1024]u8 = undefined;
|
|
216
|
+
var bfa: std.heap.BufferFirstAllocator = .init(&buf, pp.comp.gpa);
|
|
217
|
+
var allocating: std.Io.Writer.Allocating = .init(bfa.allocator());
|
|
217
218
|
defer allocating.deinit();
|
|
218
219
|
|
|
219
220
|
Diagnostics.formatArgs(&allocating.writer, diagnostic.fmt, args) catch return error.OutOfMemory;
|
|
@@ -1023,8 +1023,9 @@ fn err(pp: *Preprocessor, loc: anytype, diagnostic: Diagnostic, args: anytype) C
|
|
|
1023
1023
|
defer pp.diagnostics.state.suppress_system_headers = old_suppress_system;
|
|
1024
1024
|
if (diagnostic.show_in_system_headers) pp.diagnostics.state.suppress_system_headers = false;
|
|
1025
1025
|
|
|
1026
|
-
var
|
|
1027
|
-
var
|
|
1026
|
+
var bfa_buf: [1024]u8 = undefined;
|
|
1027
|
+
var bfa: std.heap.BufferFirstAllocator = .init(&bfa_buf, pp.comp.gpa);
|
|
1028
|
+
var allocating: std.Io.Writer.Allocating = .init(bfa.allocator());
|
|
1028
1029
|
defer allocating.deinit();
|
|
1029
1030
|
|
|
1030
1031
|
Diagnostics.formatArgs(&allocating.writer, diagnostic.fmt, args) catch return error.OutOfMemory;
|
|
@@ -1052,8 +1053,9 @@ fn err(pp: *Preprocessor, loc: anytype, diagnostic: Diagnostic, args: anytype) C
|
|
|
1052
1053
|
}
|
|
1053
1054
|
|
|
1054
1055
|
fn fatal(pp: *Preprocessor, raw: RawToken, comptime fmt: []const u8, args: anytype) Compilation.Error {
|
|
1055
|
-
var
|
|
1056
|
-
var
|
|
1056
|
+
var bfa_buf: [1024]u8 = undefined;
|
|
1057
|
+
var bfa: std.heap.BufferFirstAllocator = .init(&bfa_buf, pp.comp.gpa);
|
|
1058
|
+
var allocating: std.Io.Writer.Allocating = .init(bfa.allocator());
|
|
1057
1059
|
defer allocating.deinit();
|
|
1058
1060
|
|
|
1059
1061
|
Diagnostics.formatArgs(&allocating.writer, fmt, args) catch return error.OutOfMemory;
|
|
@@ -1074,8 +1076,9 @@ fn fatalNotFound(pp: *Preprocessor, tok: TokenWithExpansionLocs, filename: []con
|
|
|
1074
1076
|
pp.diagnostics.state.fatal_errors = true;
|
|
1075
1077
|
defer pp.diagnostics.state.fatal_errors = old;
|
|
1076
1078
|
|
|
1077
|
-
var
|
|
1078
|
-
|
|
1079
|
+
var bfa_buf: [1024]u8 = undefined;
|
|
1080
|
+
var bfa: std.heap.BufferFirstAllocator = .init(&bfa_buf, pp.comp.gpa);
|
|
1081
|
+
const allocator = bfa.allocator();
|
|
1079
1082
|
var buf: std.ArrayList(u8) = .empty;
|
|
1080
1083
|
defer buf.deinit(allocator);
|
|
1081
1084
|
|
|
@@ -44,8 +44,9 @@ fn preprocessorHandler(_: *Pragma, pp: *Preprocessor, start_idx: TokenIndex) Pra
|
|
|
44
44
|
|
|
45
45
|
const diagnostic: Pragma.Diagnostic = .pragma_message;
|
|
46
46
|
|
|
47
|
-
var
|
|
48
|
-
var
|
|
47
|
+
var bfa_buf: [1024]u8 = undefined;
|
|
48
|
+
var bfa: std.heap.BufferFirstAllocator = .init(&bfa_buf, pp.comp.gpa);
|
|
49
|
+
var allocating: std.Io.Writer.Allocating = .init(bfa.allocator());
|
|
49
50
|
defer allocating.deinit();
|
|
50
51
|
|
|
51
52
|
Diagnostics.formatArgs(&allocating.writer, diagnostic.fmt, .{str}) catch return error.OutOfMemory;
|
|
@@ -315,8 +315,9 @@ pub const Parser = struct {
|
|
|
315
315
|
if (p.errored) return;
|
|
316
316
|
if (p.comp.diagnostics.effectiveKind(diagnostic) == .off) return;
|
|
317
317
|
|
|
318
|
-
var
|
|
319
|
-
var
|
|
318
|
+
var bfa_buf: [1024]u8 = undefined;
|
|
319
|
+
var bfa: std.heap.BufferFirstAllocator = .init(&bfa_buf, p.comp.gpa);
|
|
320
|
+
var allocating: std.Io.Writer.Allocating = .init(bfa.allocator());
|
|
320
321
|
defer allocating.deinit();
|
|
321
322
|
|
|
322
323
|
formatArgs(&allocating.writer, diagnostic.fmt, args) catch return error.OutOfMemory;
|
|
@@ -68,8 +68,9 @@ fn serializeFloat(comptime T: type, value: T, w: *std.Io.Writer) !void {
|
|
|
68
68
|
pub fn todo(c: *AsmCodeGen, msg: []const u8, tok: Tree.TokenIndex) Error {
|
|
69
69
|
const loc: Source.Location = c.tree.tokens.items(.loc)[tok];
|
|
70
70
|
|
|
71
|
-
var
|
|
72
|
-
|
|
71
|
+
var bfa_buf: [u8]1024 = undefined;
|
|
72
|
+
var bfa: std.heap.BufferFirstAllocator = .init(&bfa_buf, c.comp.gpa);
|
|
73
|
+
const allocator = bfa.allocator();
|
|
73
74
|
var buf: std.ArrayList(u8) = .empty;
|
|
74
75
|
defer buf.deinit(allocator);
|
|
75
76
|
|
|
@@ -333,8 +333,6 @@ pub fn main(init: process.Init.Minimal) !void {
|
|
|
333
333
|
builder.verbose_llvm_ir = arg["--verbose-llvm-ir=".len..];
|
|
334
334
|
} else if (mem.startsWith(u8, arg, "--verbose-llvm-bc=")) {
|
|
335
335
|
builder.verbose_llvm_bc = arg["--verbose-llvm-bc=".len..];
|
|
336
|
-
} else if (mem.eql(u8, arg, "--verbose-cimport")) {
|
|
337
|
-
builder.verbose_cimport = true;
|
|
338
336
|
} else if (mem.eql(u8, arg, "--verbose-cc")) {
|
|
339
337
|
builder.verbose_cc = true;
|
|
340
338
|
} else if (mem.eql(u8, arg, "--verbose-llvm-cpu-features")) {
|
package/compiler/test_runner.zig
CHANGED
|
@@ -563,7 +563,7 @@ pub fn fuzz(
|
|
|
563
563
|
const stderr = std.debug.lockStderr(&.{}).terminal();
|
|
564
564
|
p: {
|
|
565
565
|
if (@errorReturnTrace()) |trace| {
|
|
566
|
-
std.debug.
|
|
566
|
+
std.debug.writeErrorReturnTrace(trace, stderr) catch break :p;
|
|
567
567
|
}
|
|
568
568
|
stderr.writer.print("failed with error.{t}\n", .{err}) catch break :p;
|
|
569
569
|
}
|
|
@@ -475,8 +475,12 @@ pub const builtin_typedef_map = std.StaticStringMap([]const u8).initComptime(.{
|
|
|
475
475
|
.{ "int8_t", "i8" },
|
|
476
476
|
.{ "uint16_t", "u16" },
|
|
477
477
|
.{ "int16_t", "i16" },
|
|
478
|
+
.{ "uint24_t", "u24" },
|
|
479
|
+
.{ "int24_t", "i24" },
|
|
478
480
|
.{ "uint32_t", "u32" },
|
|
479
481
|
.{ "int32_t", "i32" },
|
|
482
|
+
.{ "uint48_t", "u48" },
|
|
483
|
+
.{ "int48_t", "i48" },
|
|
480
484
|
.{ "uint64_t", "u64" },
|
|
481
485
|
.{ "int64_t", "i64" },
|
|
482
486
|
.{ "intptr_t", "isize" },
|
package/compiler_rt/cos.zig
CHANGED
|
@@ -173,8 +173,6 @@ pub fn cosq(x: f128) callconv(.c) f128 {
|
|
|
173
173
|
|
|
174
174
|
pub fn cosl(x: c_longdouble) callconv(.c) c_longdouble {
|
|
175
175
|
switch (@typeInfo(c_longdouble).float.bits) {
|
|
176
|
-
16 => return cosh(x),
|
|
177
|
-
32 => return cosf(x),
|
|
178
176
|
64 => return cos(x),
|
|
179
177
|
80 => return cosx(x),
|
|
180
178
|
128 => return cosq(x),
|
|
@@ -10,29 +10,30 @@ const symbol = @import("../compiler_rt.zig").symbol;
|
|
|
10
10
|
comptime {
|
|
11
11
|
symbol(&__divei4, "__divei4");
|
|
12
12
|
symbol(&__modei4, "__modei4");
|
|
13
|
+
symbol(&__divei5, "__divei5");
|
|
14
|
+
symbol(&__modei5, "__modei5");
|
|
13
15
|
}
|
|
14
16
|
|
|
15
|
-
inline fn limb(
|
|
16
|
-
return if (endian == .little)
|
|
17
|
+
inline fn limb(i: usize, len: usize) usize {
|
|
18
|
+
return if (endian == .little) i else len - 1 - i;
|
|
17
19
|
}
|
|
18
20
|
|
|
19
|
-
inline fn neg(
|
|
21
|
+
inline fn neg(out: []u32, in: []const u32) void {
|
|
20
22
|
var ov: u1 = 1;
|
|
21
|
-
for (0..
|
|
22
|
-
const
|
|
23
|
-
|
|
23
|
+
for (0..in.len) |limb_index| {
|
|
24
|
+
const new, ov = @addWithOverflow(~in[limb(limb_index, in.len)], ov);
|
|
25
|
+
out[limb(limb_index, out.len)] = new;
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
if (
|
|
32
|
-
if (v_sign < 0)
|
|
33
|
-
|
|
34
|
-
if (
|
|
35
|
-
if (r) |x| if (u_sign < 0) neg(x);
|
|
29
|
+
fn divmod(q: ?[]u32, r: ?[]u32, u: []const u32, v: []const u32, tu: []u32, tv: []u32) !void {
|
|
30
|
+
const u_sign: i32 = @bitCast(u[limb(u.len - 1, u.len)]);
|
|
31
|
+
const v_sign: i32 = @bitCast(v[limb(v.len - 1, v.len)]);
|
|
32
|
+
if (u_sign < 0) neg(tu, u);
|
|
33
|
+
if (v_sign < 0) neg(tv, v);
|
|
34
|
+
try @call(.always_inline, udivmod, .{ q, r, if (u_sign < 0) tu else u, if (v_sign < 0) tv else v });
|
|
35
|
+
if (q) |x| if (u_sign ^ v_sign < 0) neg(x, x);
|
|
36
|
+
if (r) |x| if (u_sign < 0) neg(x, x);
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
pub fn __divei4(q_p: [*]u8, u_p: [*]u8, v_p: [*]u8, bits: usize) callconv(.c) void {
|
|
@@ -41,7 +42,7 @@ pub fn __divei4(q_p: [*]u8, u_p: [*]u8, v_p: [*]u8, bits: usize) callconv(.c) vo
|
|
|
41
42
|
const q: []u32 = @ptrCast(@alignCast(q_p[0..byte_size]));
|
|
42
43
|
const u: []u32 = @ptrCast(@alignCast(u_p[0..byte_size]));
|
|
43
44
|
const v: []u32 = @ptrCast(@alignCast(v_p[0..byte_size]));
|
|
44
|
-
@call(.always_inline, divmod, .{ q, null, u, v }) catch unreachable;
|
|
45
|
+
@call(.always_inline, divmod, .{ q, null, u, v, u, v }) catch unreachable;
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
pub fn __modei4(r_p: [*]u8, u_p: [*]u8, v_p: [*]u8, bits: usize) callconv(.c) void {
|
|
@@ -50,5 +51,27 @@ pub fn __modei4(r_p: [*]u8, u_p: [*]u8, v_p: [*]u8, bits: usize) callconv(.c) vo
|
|
|
50
51
|
const r: []u32 = @ptrCast(@alignCast(r_p[0..byte_size]));
|
|
51
52
|
const u: []u32 = @ptrCast(@alignCast(u_p[0..byte_size]));
|
|
52
53
|
const v: []u32 = @ptrCast(@alignCast(v_p[0..byte_size]));
|
|
53
|
-
@call(.always_inline, divmod, .{ null, r, u, v }) catch unreachable;
|
|
54
|
+
@call(.always_inline, divmod, .{ null, r, u, v, u, v }) catch unreachable;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
pub fn __divei5(q_p: [*]u8, u_p: [*]const u8, v_p: [*]const u8, t_p: [*]u8, bits: usize) callconv(.c) void {
|
|
58
|
+
@setRuntimeSafety(compiler_rt.test_safety);
|
|
59
|
+
const byte_size = std.zig.target.intByteSize(&builtin.target, @intCast(bits));
|
|
60
|
+
const q: []u32 = @ptrCast(@alignCast(q_p[0..byte_size]));
|
|
61
|
+
const u: []const u32 = @ptrCast(@alignCast(u_p[0..byte_size]));
|
|
62
|
+
const v: []const u32 = @ptrCast(@alignCast(v_p[0..byte_size]));
|
|
63
|
+
const tu: []u32 = @ptrCast(@alignCast(t_p[0..byte_size]));
|
|
64
|
+
const tv: []u32 = @ptrCast(@alignCast(t_p[byte_size..][0..byte_size]));
|
|
65
|
+
@call(.always_inline, divmod, .{ q, null, u, v, tu, tv }) catch unreachable;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
pub fn __modei5(r_p: [*]u8, u_p: [*]const u8, v_p: [*]const u8, t_p: [*]u8, bits: usize) callconv(.c) void {
|
|
69
|
+
@setRuntimeSafety(compiler_rt.test_safety);
|
|
70
|
+
const byte_size = std.zig.target.intByteSize(&builtin.target, @intCast(bits));
|
|
71
|
+
const r: []u32 = @ptrCast(@alignCast(r_p[0..byte_size]));
|
|
72
|
+
const u: []const u32 = @ptrCast(@alignCast(u_p[0..byte_size]));
|
|
73
|
+
const v: []const u32 = @ptrCast(@alignCast(v_p[0..byte_size]));
|
|
74
|
+
const tu: []u32 = @ptrCast(@alignCast(t_p[0..byte_size]));
|
|
75
|
+
const tv: []u32 = @ptrCast(@alignCast(t_p[byte_size..][0..byte_size]));
|
|
76
|
+
@call(.always_inline, divmod, .{ null, r, u, v, tu, tv }) catch unreachable;
|
|
54
77
|
}
|
package/compiler_rt/exp.zig
CHANGED
|
@@ -194,15 +194,10 @@ pub fn __expx(a: f80) callconv(.c) f80 {
|
|
|
194
194
|
return @floatCast(expq(a));
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
|
|
198
|
-
// TODO: more correct implementation
|
|
199
|
-
return exp(@floatCast(a));
|
|
200
|
-
}
|
|
197
|
+
const expq = @import("exp_f128.zig").exp;
|
|
201
198
|
|
|
202
199
|
pub fn expl(x: c_longdouble) callconv(.c) c_longdouble {
|
|
203
200
|
switch (@typeInfo(c_longdouble).float.bits) {
|
|
204
|
-
16 => return __exph(x),
|
|
205
|
-
32 => return expf(x),
|
|
206
201
|
64 => return exp(x),
|
|
207
202
|
80 => return __expx(x),
|
|
208
203
|
128 => return expq(x),
|
package/compiler_rt/exp2.zig
CHANGED
|
@@ -161,15 +161,10 @@ pub fn __exp2x(x: f80) callconv(.c) f80 {
|
|
|
161
161
|
return @floatCast(exp2q(x));
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
pub
|
|
165
|
-
// TODO: more correct implementation
|
|
166
|
-
return exp2(@floatCast(x));
|
|
167
|
-
}
|
|
164
|
+
pub const exp2q = @import("exp_f128.zig").exp2;
|
|
168
165
|
|
|
169
166
|
pub fn exp2l(x: c_longdouble) callconv(.c) c_longdouble {
|
|
170
167
|
switch (@typeInfo(c_longdouble).float.bits) {
|
|
171
|
-
16 => return __exp2h(x),
|
|
172
|
-
32 => return exp2f(x),
|
|
173
168
|
64 => return exp2(x),
|
|
174
169
|
80 => return __exp2x(x),
|
|
175
170
|
128 => return exp2q(x),
|