authorgravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2021-05-20 17:07:06+02:00
committergravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2021-05-20 17:14:18+02:00
log5b850d5c9251900962e52154eb0fb9c2a344476d
tree56978e4ad48b44dc723a24d9b62c4d2fe6ab8a32
parent4a582734fd84f2096ca9bb559387ddd04c70ed57
signaturelock-open Commit is signed but in an unrecognized format.

Run `zig fmt` on src/ and lib/std/

This replaces callconv(.Inline) with the more idiomatic inline keyword.

41 files changed, 244 insertions(+), 306 deletions(-)

lib/std/Thread.zig+1-1
...@@ -68,7 +68,7 @@ else switch (std.Target.current.os.tag) {...@@ -68,7 +68,7 @@ else switch (std.Target.current.os.tag) {
68};68};
6969
70/// Signals the processor that it is inside a busy-wait spin-loop ("spin lock").70/// Signals the processor that it is inside a busy-wait spin-loop ("spin lock").
71pub fn spinLoopHint() callconv(.Inline) void {71pub inline fn spinLoopHint() void {
72 switch (std.Target.current.cpu.arch) {72 switch (std.Target.current.cpu.arch) {
73 .i386, .x86_64 => {73 .i386, .x86_64 => {
74 asm volatile ("pause" ::: "memory");74 asm volatile ("pause" ::: "memory");
lib/std/bit_set.zig+5-5
...@@ -83,7 +83,7 @@ pub fn IntegerBitSet(comptime size: u16) type {...@@ -83,7 +83,7 @@ pub fn IntegerBitSet(comptime size: u16) type {
83 }83 }
8484
85 /// Returns the number of bits in this bit set85 /// Returns the number of bits in this bit set
86 pub fn capacity(self: Self) callconv(.Inline) usize {86 pub inline fn capacity(self: Self) usize {
87 return bit_length;87 return bit_length;
88 }88 }
8989
...@@ -310,7 +310,7 @@ pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type {...@@ -310,7 +310,7 @@ pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type {
310 }310 }
311311
312 /// Returns the number of bits in this bit set312 /// Returns the number of bits in this bit set
313 pub fn capacity(self: Self) callconv(.Inline) usize {313 pub inline fn capacity(self: Self) usize {
314 return bit_length;314 return bit_length;
315 }315 }
316316
...@@ -574,7 +574,7 @@ pub const DynamicBitSetUnmanaged = struct {...@@ -574,7 +574,7 @@ pub const DynamicBitSetUnmanaged = struct {
574 }574 }
575575
576 /// Returns the number of bits in this bit set576 /// Returns the number of bits in this bit set
577 pub fn capacity(self: Self) callconv(.Inline) usize {577 pub inline fn capacity(self: Self) usize {
578 return self.bit_length;578 return self.bit_length;
579 }579 }
580580
...@@ -789,7 +789,7 @@ pub const DynamicBitSet = struct {...@@ -789,7 +789,7 @@ pub const DynamicBitSet = struct {
789 }789 }
790790
791 /// Returns the number of bits in this bit set791 /// Returns the number of bits in this bit set
792 pub fn capacity(self: Self) callconv(.Inline) usize {792 pub inline fn capacity(self: Self) usize {
793 return self.unmanaged.capacity();793 return self.unmanaged.capacity();
794 }794 }
795795
...@@ -969,7 +969,7 @@ fn BitSetIterator(comptime MaskInt: type, comptime options: IteratorOptions) typ...@@ -969,7 +969,7 @@ fn BitSetIterator(comptime MaskInt: type, comptime options: IteratorOptions) typ
969 // isn't a next word. If the next word is the969 // isn't a next word. If the next word is the
970 // last word, mask off the padding bits so we970 // last word, mask off the padding bits so we
971 // don't visit them.971 // don't visit them.
972 fn nextWord(self: *Self, comptime is_first_word: bool) callconv(.Inline) void {972 inline fn nextWord(self: *Self, comptime is_first_word: bool) void {
973 var word = switch (direction) {973 var word = switch (direction) {
974 .forward => self.words_remain[0],974 .forward => self.words_remain[0],
975 .reverse => self.words_remain[self.words_remain.len - 1],975 .reverse => self.words_remain[self.words_remain.len - 1],
lib/std/c/builtins.zig+46-46
...@@ -6,136 +6,136 @@...@@ -6,136 +6,136 @@
66
7const std = @import("std");7const std = @import("std");
88
9pub fn __builtin_bswap16(val: u16) callconv(.Inline) u16 {9pub inline fn __builtin_bswap16(val: u16) u16 {
10 return @byteSwap(u16, val);10 return @byteSwap(u16, val);
11}11}
12pub fn __builtin_bswap32(val: u32) callconv(.Inline) u32 {12pub inline fn __builtin_bswap32(val: u32) u32 {
13 return @byteSwap(u32, val);13 return @byteSwap(u32, val);
14}14}
15pub fn __builtin_bswap64(val: u64) callconv(.Inline) u64 {15pub inline fn __builtin_bswap64(val: u64) u64 {
16 return @byteSwap(u64, val);16 return @byteSwap(u64, val);
17}17}
1818
19pub fn __builtin_signbit(val: f64) callconv(.Inline) c_int {19pub inline fn __builtin_signbit(val: f64) c_int {
20 return @boolToInt(std.math.signbit(val));20 return @boolToInt(std.math.signbit(val));
21}21}
22pub fn __builtin_signbitf(val: f32) callconv(.Inline) c_int {22pub inline fn __builtin_signbitf(val: f32) c_int {
23 return @boolToInt(std.math.signbit(val));23 return @boolToInt(std.math.signbit(val));
24}24}
2525
26pub fn __builtin_popcount(val: c_uint) callconv(.Inline) c_int {26pub inline fn __builtin_popcount(val: c_uint) c_int {
27 // popcount of a c_uint will never exceed the capacity of a c_int27 // popcount of a c_uint will never exceed the capacity of a c_int
28 @setRuntimeSafety(false);28 @setRuntimeSafety(false);
29 return @bitCast(c_int, @as(c_uint, @popCount(c_uint, val)));29 return @bitCast(c_int, @as(c_uint, @popCount(c_uint, val)));
30}30}
31pub fn __builtin_ctz(val: c_uint) callconv(.Inline) c_int {31pub inline fn __builtin_ctz(val: c_uint) c_int {
32 // Returns the number of trailing 0-bits in val, starting at the least significant bit position.32 // Returns the number of trailing 0-bits in val, starting at the least significant bit position.
33 // In C if `val` is 0, the result is undefined; in zig it's the number of bits in a c_uint33 // In C if `val` is 0, the result is undefined; in zig it's the number of bits in a c_uint
34 @setRuntimeSafety(false);34 @setRuntimeSafety(false);
35 return @bitCast(c_int, @as(c_uint, @ctz(c_uint, val)));35 return @bitCast(c_int, @as(c_uint, @ctz(c_uint, val)));
36}36}
37pub fn __builtin_clz(val: c_uint) callconv(.Inline) c_int {37pub inline fn __builtin_clz(val: c_uint) c_int {
38 // Returns the number of leading 0-bits in x, starting at the most significant bit position.38 // Returns the number of leading 0-bits in x, starting at the most significant bit position.
39 // In C if `val` is 0, the result is undefined; in zig it's the number of bits in a c_uint39 // In C if `val` is 0, the result is undefined; in zig it's the number of bits in a c_uint
40 @setRuntimeSafety(false);40 @setRuntimeSafety(false);
41 return @bitCast(c_int, @as(c_uint, @clz(c_uint, val)));41 return @bitCast(c_int, @as(c_uint, @clz(c_uint, val)));
42}42}
4343
44pub fn __builtin_sqrt(val: f64) callconv(.Inline) f64 {44pub inline fn __builtin_sqrt(val: f64) f64 {
45 return @sqrt(val);45 return @sqrt(val);
46}46}
47pub fn __builtin_sqrtf(val: f32) callconv(.Inline) f32 {47pub inline fn __builtin_sqrtf(val: f32) f32 {
48 return @sqrt(val);48 return @sqrt(val);
49}49}
5050
51pub fn __builtin_sin(val: f64) callconv(.Inline) f64 {51pub inline fn __builtin_sin(val: f64) f64 {
52 return @sin(val);52 return @sin(val);
53}53}
54pub fn __builtin_sinf(val: f32) callconv(.Inline) f32 {54pub inline fn __builtin_sinf(val: f32) f32 {
55 return @sin(val);55 return @sin(val);
56}56}
57pub fn __builtin_cos(val: f64) callconv(.Inline) f64 {57pub inline fn __builtin_cos(val: f64) f64 {
58 return @cos(val);58 return @cos(val);
59}59}
60pub fn __builtin_cosf(val: f32) callconv(.Inline) f32 {60pub inline fn __builtin_cosf(val: f32) f32 {
61 return @cos(val);61 return @cos(val);
62}62}
6363
64pub fn __builtin_exp(val: f64) callconv(.Inline) f64 {64pub inline fn __builtin_exp(val: f64) f64 {
65 return @exp(val);65 return @exp(val);
66}66}
67pub fn __builtin_expf(val: f32) callconv(.Inline) f32 {67pub inline fn __builtin_expf(val: f32) f32 {
68 return @exp(val);68 return @exp(val);
69}69}
70pub fn __builtin_exp2(val: f64) callconv(.Inline) f64 {70pub inline fn __builtin_exp2(val: f64) f64 {
71 return @exp2(val);71 return @exp2(val);
72}72}
73pub fn __builtin_exp2f(val: f32) callconv(.Inline) f32 {73pub inline fn __builtin_exp2f(val: f32) f32 {
74 return @exp2(val);74 return @exp2(val);
75}75}
76pub fn __builtin_log(val: f64) callconv(.Inline) f64 {76pub inline fn __builtin_log(val: f64) f64 {
77 return @log(val);77 return @log(val);
78}78}
79pub fn __builtin_logf(val: f32) callconv(.Inline) f32 {79pub inline fn __builtin_logf(val: f32) f32 {
80 return @log(val);80 return @log(val);
81}81}
82pub fn __builtin_log2(val: f64) callconv(.Inline) f64 {82pub inline fn __builtin_log2(val: f64) f64 {
83 return @log2(val);83 return @log2(val);
84}84}
85pub fn __builtin_log2f(val: f32) callconv(.Inline) f32 {85pub inline fn __builtin_log2f(val: f32) f32 {
86 return @log2(val);86 return @log2(val);
87}87}
88pub fn __builtin_log10(val: f64) callconv(.Inline) f64 {88pub inline fn __builtin_log10(val: f64) f64 {
89 return @log10(val);89 return @log10(val);
90}90}
91pub fn __builtin_log10f(val: f32) callconv(.Inline) f32 {91pub inline fn __builtin_log10f(val: f32) f32 {
92 return @log10(val);92 return @log10(val);
93}93}
9494
95// Standard C Library bug: The absolute value of the most negative integer remains negative.95// Standard C Library bug: The absolute value of the most negative integer remains negative.
96pub fn __builtin_abs(val: c_int) callconv(.Inline) c_int {96pub inline fn __builtin_abs(val: c_int) c_int {
97 return std.math.absInt(val) catch std.math.minInt(c_int);97 return std.math.absInt(val) catch std.math.minInt(c_int);
98}98}
99pub fn __builtin_fabs(val: f64) callconv(.Inline) f64 {99pub inline fn __builtin_fabs(val: f64) f64 {
100 return @fabs(val);100 return @fabs(val);
101}101}
102pub fn __builtin_fabsf(val: f32) callconv(.Inline) f32 {102pub inline fn __builtin_fabsf(val: f32) f32 {
103 return @fabs(val);103 return @fabs(val);
104}104}
105105
106pub fn __builtin_floor(val: f64) callconv(.Inline) f64 {106pub inline fn __builtin_floor(val: f64) f64 {
107 return @floor(val);107 return @floor(val);
108}108}
109pub fn __builtin_floorf(val: f32) callconv(.Inline) f32 {109pub inline fn __builtin_floorf(val: f32) f32 {
110 return @floor(val);110 return @floor(val);
111}111}
112pub fn __builtin_ceil(val: f64) callconv(.Inline) f64 {112pub inline fn __builtin_ceil(val: f64) f64 {
113 return @ceil(val);113 return @ceil(val);
114}114}
115pub fn __builtin_ceilf(val: f32) callconv(.Inline) f32 {115pub inline fn __builtin_ceilf(val: f32) f32 {
116 return @ceil(val);116 return @ceil(val);
117}117}
118pub fn __builtin_trunc(val: f64) callconv(.Inline) f64 {118pub inline fn __builtin_trunc(val: f64) f64 {
119 return @trunc(val);119 return @trunc(val);
120}120}
121pub fn __builtin_truncf(val: f32) callconv(.Inline) f32 {121pub inline fn __builtin_truncf(val: f32) f32 {
122 return @trunc(val);122 return @trunc(val);
123}123}
124pub fn __builtin_round(val: f64) callconv(.Inline) f64 {124pub inline fn __builtin_round(val: f64) f64 {
125 return @round(val);125 return @round(val);
126}126}
127pub fn __builtin_roundf(val: f32) callconv(.Inline) f32 {127pub inline fn __builtin_roundf(val: f32) f32 {
128 return @round(val);128 return @round(val);
129}129}
130130
131pub fn __builtin_strlen(s: [*c]const u8) callconv(.Inline) usize {131pub inline fn __builtin_strlen(s: [*c]const u8) usize {
132 return std.mem.lenZ(s);132 return std.mem.lenZ(s);
133}133}
134pub fn __builtin_strcmp(s1: [*c]const u8, s2: [*c]const u8) callconv(.Inline) c_int {134pub inline fn __builtin_strcmp(s1: [*c]const u8, s2: [*c]const u8) c_int {
135 return @as(c_int, std.cstr.cmp(s1, s2));135 return @as(c_int, std.cstr.cmp(s1, s2));
136}136}
137137
138pub fn __builtin_object_size(ptr: ?*const c_void, ty: c_int) callconv(.Inline) usize {138pub inline fn __builtin_object_size(ptr: ?*const c_void, ty: c_int) usize {
139 // clang semantics match gcc's: https://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html139 // clang semantics match gcc's: https://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html
140 // If it is not possible to determine which objects ptr points to at compile time,140 // If it is not possible to determine which objects ptr points to at compile time,
141 // __builtin_object_size should return (size_t) -1 for type 0 or 1 and (size_t) 0141 // __builtin_object_size should return (size_t) -1 for type 0 or 1 and (size_t) 0
...@@ -145,37 +145,37 @@ pub fn __builtin_object_size(ptr: ?*const c_void, ty: c_int) callconv(.Inline) u...@@ -145,37 +145,37 @@ pub fn __builtin_object_size(ptr: ?*const c_void, ty: c_int) callconv(.Inline) u
145 unreachable;145 unreachable;
146}146}
147147
148pub fn __builtin___memset_chk(148pub inline fn __builtin___memset_chk(
149 dst: ?*c_void,149 dst: ?*c_void,
150 val: c_int,150 val: c_int,
151 len: usize,151 len: usize,
152 remaining: usize,152 remaining: usize,
153) callconv(.Inline) ?*c_void {153) ?*c_void {
154 if (len > remaining) @panic("std.c.builtins.memset_chk called with len > remaining");154 if (len > remaining) @panic("std.c.builtins.memset_chk called with len > remaining");
155 return __builtin_memset(dst, val, len);155 return __builtin_memset(dst, val, len);
156}156}
157157
158pub fn __builtin_memset(dst: ?*c_void, val: c_int, len: usize) callconv(.Inline) ?*c_void {158pub inline fn __builtin_memset(dst: ?*c_void, val: c_int, len: usize) ?*c_void {
159 const dst_cast = @ptrCast([*c]u8, dst);159 const dst_cast = @ptrCast([*c]u8, dst);
160 @memset(dst_cast, @bitCast(u8, @truncate(i8, val)), len);160 @memset(dst_cast, @bitCast(u8, @truncate(i8, val)), len);
161 return dst;161 return dst;
162}162}
163163
164pub fn __builtin___memcpy_chk(164pub inline fn __builtin___memcpy_chk(
165 noalias dst: ?*c_void,165 noalias dst: ?*c_void,
166 noalias src: ?*const c_void,166 noalias src: ?*const c_void,
167 len: usize,167 len: usize,
168 remaining: usize,168 remaining: usize,
169) callconv(.Inline) ?*c_void {169) ?*c_void {
170 if (len > remaining) @panic("std.c.builtins.memcpy_chk called with len > remaining");170 if (len > remaining) @panic("std.c.builtins.memcpy_chk called with len > remaining");
171 return __builtin_memcpy(dst, src, len);171 return __builtin_memcpy(dst, src, len);
172}172}
173173
174pub fn __builtin_memcpy(174pub inline fn __builtin_memcpy(
175 noalias dst: ?*c_void,175 noalias dst: ?*c_void,
176 noalias src: ?*const c_void,176 noalias src: ?*const c_void,
177 len: usize,177 len: usize,
178) callconv(.Inline) ?*c_void {178) ?*c_void {
179 const dst_cast = @ptrCast([*c]u8, dst);179 const dst_cast = @ptrCast([*c]u8, dst);
180 const src_cast = @ptrCast([*c]const u8, src);180 const src_cast = @ptrCast([*c]const u8, src);
181181
...@@ -185,7 +185,7 @@ pub fn __builtin_memcpy(...@@ -185,7 +185,7 @@ pub fn __builtin_memcpy(
185185
186/// The return value of __builtin_expect is `expr`. `c` is the expected value186/// The return value of __builtin_expect is `expr`. `c` is the expected value
187/// of `expr` and is used as a hint to the compiler in C. Here it is unused.187/// of `expr` and is used as a hint to the compiler in C. Here it is unused.
188pub fn __builtin_expect(expr: c_long, c: c_long) callconv(.Inline) c_long {188pub inline fn __builtin_expect(expr: c_long, c: c_long) c_long {
189 return expr;189 return expr;
190}190}
191191
lib/std/compress/deflate.zig+1-1
...@@ -209,7 +209,7 @@ pub fn InflateStream(comptime ReaderType: type) type {...@@ -209,7 +209,7 @@ pub fn InflateStream(comptime ReaderType: type) type {
209209
210 // Insert a single byte into the window.210 // Insert a single byte into the window.
211 // Assumes there's enough space.211 // Assumes there's enough space.
212 fn appendUnsafe(self: *WSelf, value: u8) callconv(.Inline) void {212 inline fn appendUnsafe(self: *WSelf, value: u8) void {
213 self.buf[self.wi] = value;213 self.buf[self.wi] = value;
214 self.wi = (self.wi + 1) & (self.buf.len - 1);214 self.wi = (self.wi + 1) & (self.buf.len - 1);
215 self.el += 1;215 self.el += 1;
lib/std/crypto/25519/curve25519.zig+2-2
...@@ -20,12 +20,12 @@ pub const Curve25519 = struct {...@@ -20,12 +20,12 @@ pub const Curve25519 = struct {
20 x: Fe,20 x: Fe,
2121
22 /// Decode a Curve25519 point from its compressed (X) coordinates.22 /// Decode a Curve25519 point from its compressed (X) coordinates.
23 pub fn fromBytes(s: [32]u8) callconv(.Inline) Curve25519 {23 pub inline fn fromBytes(s: [32]u8) Curve25519 {
24 return .{ .x = Fe.fromBytes(s) };24 return .{ .x = Fe.fromBytes(s) };
25 }25 }
2626
27 /// Encode a Curve25519 point.27 /// Encode a Curve25519 point.
28 pub fn toBytes(p: Curve25519) callconv(.Inline) [32]u8 {28 pub inline fn toBytes(p: Curve25519) [32]u8 {
29 return p.x.toBytes();29 return p.x.toBytes();
30 }30 }
3131
lib/std/crypto/25519/edwards25519.zig+3-3
...@@ -91,7 +91,7 @@ pub const Edwards25519 = struct {...@@ -91,7 +91,7 @@ pub const Edwards25519 = struct {
91 }91 }
9292
93 /// Flip the sign of the X coordinate.93 /// Flip the sign of the X coordinate.
94 pub fn neg(p: Edwards25519) callconv(.Inline) Edwards25519 {94 pub inline fn neg(p: Edwards25519) Edwards25519 {
95 return .{ .x = p.x.neg(), .y = p.y, .z = p.z, .t = p.t.neg() };95 return .{ .x = p.x.neg(), .y = p.y, .z = p.z, .t = p.t.neg() };
96 }96 }
9797
...@@ -136,14 +136,14 @@ pub const Edwards25519 = struct {...@@ -136,14 +136,14 @@ pub const Edwards25519 = struct {
136 return p.add(q.neg());136 return p.add(q.neg());
137 }137 }
138138
139 fn cMov(p: *Edwards25519, a: Edwards25519, c: u64) callconv(.Inline) void {139 inline fn cMov(p: *Edwards25519, a: Edwards25519, c: u64) void {
140 p.x.cMov(a.x, c);140 p.x.cMov(a.x, c);
141 p.y.cMov(a.y, c);141 p.y.cMov(a.y, c);
142 p.z.cMov(a.z, c);142 p.z.cMov(a.z, c);
143 p.t.cMov(a.t, c);143 p.t.cMov(a.t, c);
144 }144 }
145145
146 fn pcSelect(comptime n: usize, pc: [n]Edwards25519, b: u8) callconv(.Inline) Edwards25519 {146 inline fn pcSelect(comptime n: usize, pc: [n]Edwards25519, b: u8) Edwards25519 {
147 var t = Edwards25519.identityElement;147 var t = Edwards25519.identityElement;
148 comptime var i: u8 = 1;148 comptime var i: u8 = 1;
149 inline while (i < pc.len) : (i += 1) {149 inline while (i < pc.len) : (i += 1) {
lib/std/crypto/25519/field.zig+14-14
...@@ -56,7 +56,7 @@ pub const Fe = struct {...@@ -56,7 +56,7 @@ pub const Fe = struct {
56 pub const edwards25519sqrtam2 = Fe{ .limbs = .{ 1693982333959686, 608509411481997, 2235573344831311, 947681270984193, 266558006233600 } };56 pub const edwards25519sqrtam2 = Fe{ .limbs = .{ 1693982333959686, 608509411481997, 2235573344831311, 947681270984193, 266558006233600 } };
5757
58 /// Return true if the field element is zero58 /// Return true if the field element is zero
59 pub fn isZero(fe: Fe) callconv(.Inline) bool {59 pub inline fn isZero(fe: Fe) bool {
60 var reduced = fe;60 var reduced = fe;
61 reduced.reduce();61 reduced.reduce();
62 const limbs = reduced.limbs;62 const limbs = reduced.limbs;
...@@ -64,7 +64,7 @@ pub const Fe = struct {...@@ -64,7 +64,7 @@ pub const Fe = struct {
64 }64 }
6565
66 /// Return true if both field elements are equivalent66 /// Return true if both field elements are equivalent
67 pub fn equivalent(a: Fe, b: Fe) callconv(.Inline) bool {67 pub inline fn equivalent(a: Fe, b: Fe) bool {
68 return a.sub(b).isZero();68 return a.sub(b).isZero();
69 }69 }
7070
...@@ -168,7 +168,7 @@ pub const Fe = struct {...@@ -168,7 +168,7 @@ pub const Fe = struct {
168 }168 }
169169
170 /// Add a field element170 /// Add a field element
171 pub fn add(a: Fe, b: Fe) callconv(.Inline) Fe {171 pub inline fn add(a: Fe, b: Fe) Fe {
172 var fe: Fe = undefined;172 var fe: Fe = undefined;
173 comptime var i = 0;173 comptime var i = 0;
174 inline while (i < 5) : (i += 1) {174 inline while (i < 5) : (i += 1) {
...@@ -178,7 +178,7 @@ pub const Fe = struct {...@@ -178,7 +178,7 @@ pub const Fe = struct {
178 }178 }
179179
180 /// Substract a field elememnt180 /// Substract a field elememnt
181 pub fn sub(a: Fe, b: Fe) callconv(.Inline) Fe {181 pub inline fn sub(a: Fe, b: Fe) Fe {
182 var fe = b;182 var fe = b;
183 comptime var i = 0;183 comptime var i = 0;
184 inline while (i < 4) : (i += 1) {184 inline while (i < 4) : (i += 1) {
...@@ -197,17 +197,17 @@ pub const Fe = struct {...@@ -197,17 +197,17 @@ pub const Fe = struct {
197 }197 }
198198
199 /// Negate a field element199 /// Negate a field element
200 pub fn neg(a: Fe) callconv(.Inline) Fe {200 pub inline fn neg(a: Fe) Fe {
201 return zero.sub(a);201 return zero.sub(a);
202 }202 }
203203
204 /// Return true if a field element is negative204 /// Return true if a field element is negative
205 pub fn isNegative(a: Fe) callconv(.Inline) bool {205 pub inline fn isNegative(a: Fe) bool {
206 return (a.toBytes()[0] & 1) != 0;206 return (a.toBytes()[0] & 1) != 0;
207 }207 }
208208
209 /// Conditonally replace a field element with `a` if `c` is positive209 /// Conditonally replace a field element with `a` if `c` is positive
210 pub fn cMov(fe: *Fe, a: Fe, c: u64) callconv(.Inline) void {210 pub inline fn cMov(fe: *Fe, a: Fe, c: u64) void {
211 const mask: u64 = 0 -% c;211 const mask: u64 = 0 -% c;
212 var x = fe.*;212 var x = fe.*;
213 comptime var i = 0;213 comptime var i = 0;
...@@ -248,7 +248,7 @@ pub const Fe = struct {...@@ -248,7 +248,7 @@ pub const Fe = struct {
248 }248 }
249 }249 }
250250
251 fn _carry128(r: *[5]u128) callconv(.Inline) Fe {251 inline fn _carry128(r: *[5]u128) Fe {
252 var rs: [5]u64 = undefined;252 var rs: [5]u64 = undefined;
253 comptime var i = 0;253 comptime var i = 0;
254 inline while (i < 4) : (i += 1) {254 inline while (i < 4) : (i += 1) {
...@@ -269,7 +269,7 @@ pub const Fe = struct {...@@ -269,7 +269,7 @@ pub const Fe = struct {
269 }269 }
270270
271 /// Multiply two field elements271 /// Multiply two field elements
272 pub fn mul(a: Fe, b: Fe) callconv(.Inline) Fe {272 pub inline fn mul(a: Fe, b: Fe) Fe {
273 var ax: [5]u128 = undefined;273 var ax: [5]u128 = undefined;
274 var bx: [5]u128 = undefined;274 var bx: [5]u128 = undefined;
275 var a19: [5]u128 = undefined;275 var a19: [5]u128 = undefined;
...@@ -292,7 +292,7 @@ pub const Fe = struct {...@@ -292,7 +292,7 @@ pub const Fe = struct {
292 return _carry128(&r);292 return _carry128(&r);
293 }293 }
294294
295 fn _sq(a: Fe, comptime double: bool) callconv(.Inline) Fe {295 inline fn _sq(a: Fe, comptime double: bool) Fe {
296 var ax: [5]u128 = undefined;296 var ax: [5]u128 = undefined;
297 var r: [5]u128 = undefined;297 var r: [5]u128 = undefined;
298 comptime var i = 0;298 comptime var i = 0;
...@@ -321,17 +321,17 @@ pub const Fe = struct {...@@ -321,17 +321,17 @@ pub const Fe = struct {
321 }321 }
322322
323 /// Square a field element323 /// Square a field element
324 pub fn sq(a: Fe) callconv(.Inline) Fe {324 pub inline fn sq(a: Fe) Fe {
325 return _sq(a, false);325 return _sq(a, false);
326 }326 }
327327
328 /// Square and double a field element328 /// Square and double a field element
329 pub fn sq2(a: Fe) callconv(.Inline) Fe {329 pub inline fn sq2(a: Fe) Fe {
330 return _sq(a, true);330 return _sq(a, true);
331 }331 }
332332
333 /// Multiply a field element with a small (32-bit) integer333 /// Multiply a field element with a small (32-bit) integer
334 pub fn mul32(a: Fe, comptime n: u32) callconv(.Inline) Fe {334 pub inline fn mul32(a: Fe, comptime n: u32) Fe {
335 const sn = @intCast(u128, n);335 const sn = @intCast(u128, n);
336 var fe: Fe = undefined;336 var fe: Fe = undefined;
337 var x: u128 = 0;337 var x: u128 = 0;
...@@ -346,7 +346,7 @@ pub const Fe = struct {...@@ -346,7 +346,7 @@ pub const Fe = struct {
346 }346 }
347347
348 /// Square a field element `n` times348 /// Square a field element `n` times
349 fn sqn(a: Fe, comptime n: comptime_int) callconv(.Inline) Fe {349 inline fn sqn(a: Fe, comptime n: comptime_int) Fe {
350 var i: usize = 0;350 var i: usize = 0;
351 var fe = a;351 var fe = a;
352 while (i < n) : (i += 1) {352 while (i < n) : (i += 1) {
lib/std/crypto/25519/ristretto255.zig+4-4
...@@ -47,7 +47,7 @@ pub const Ristretto255 = struct {...@@ -47,7 +47,7 @@ pub const Ristretto255 = struct {
47 }47 }
4848
49 /// Reject the neutral element.49 /// Reject the neutral element.
50 pub fn rejectIdentity(p: Ristretto255) callconv(.Inline) IdentityElementError!void {50 pub inline fn rejectIdentity(p: Ristretto255) IdentityElementError!void {
51 return p.p.rejectIdentity();51 return p.p.rejectIdentity();
52 }52 }
5353
...@@ -146,19 +146,19 @@ pub const Ristretto255 = struct {...@@ -146,19 +146,19 @@ pub const Ristretto255 = struct {
146 }146 }
147147
148 /// Double a Ristretto255 element.148 /// Double a Ristretto255 element.
149 pub fn dbl(p: Ristretto255) callconv(.Inline) Ristretto255 {149 pub inline fn dbl(p: Ristretto255) Ristretto255 {
150 return .{ .p = p.p.dbl() };150 return .{ .p = p.p.dbl() };
151 }151 }
152152
153 /// Add two Ristretto255 elements.153 /// Add two Ristretto255 elements.
154 pub fn add(p: Ristretto255, q: Ristretto255) callconv(.Inline) Ristretto255 {154 pub inline fn add(p: Ristretto255, q: Ristretto255) Ristretto255 {
155 return .{ .p = p.p.add(q.p) };155 return .{ .p = p.p.add(q.p) };
156 }156 }
157157
158 /// Multiply a Ristretto255 element with a scalar.158 /// Multiply a Ristretto255 element with a scalar.
159 /// Return error.WeakPublicKey if the resulting element is159 /// Return error.WeakPublicKey if the resulting element is
160 /// the identity element.160 /// the identity element.
161 pub fn mul(p: Ristretto255, s: [encoded_length]u8) callconv(.Inline) (IdentityElementError || WeakPublicKeyError)!Ristretto255 {161 pub inline fn mul(p: Ristretto255, s: [encoded_length]u8) (IdentityElementError || WeakPublicKeyError)!Ristretto255 {
162 return Ristretto255{ .p = try p.p.mul(s) };162 return Ristretto255{ .p = try p.p.mul(s) };
163 }163 }
164164
lib/std/crypto/25519/scalar.zig+1-1
...@@ -48,7 +48,7 @@ pub fn reduce64(s: [64]u8) [32]u8 {...@@ -48,7 +48,7 @@ pub fn reduce64(s: [64]u8) [32]u8 {
4848
49/// Perform the X25519 "clamping" operation.49/// Perform the X25519 "clamping" operation.
50/// The scalar is then guaranteed to be a multiple of the cofactor.50/// The scalar is then guaranteed to be a multiple of the cofactor.
51pub fn clamp(s: *[32]u8) callconv(.Inline) void {51pub inline fn clamp(s: *[32]u8) void {
52 s[0] &= 248;52 s[0] &= 248;
53 s[31] = (s[31] & 127) | 64;53 s[31] = (s[31] & 127) | 64;
54}54}
lib/std/crypto/aegis.zig+2-2
...@@ -36,7 +36,7 @@ const State128L = struct {...@@ -36,7 +36,7 @@ const State128L = struct {
36 return state;36 return state;
37 }37 }
3838
39 fn update(state: *State128L, d1: AesBlock, d2: AesBlock) callconv(.Inline) void {39 inline fn update(state: *State128L, d1: AesBlock, d2: AesBlock) void {
40 const blocks = &state.blocks;40 const blocks = &state.blocks;
41 const tmp = blocks[7];41 const tmp = blocks[7];
42 comptime var i: usize = 7;42 comptime var i: usize = 7;
...@@ -208,7 +208,7 @@ const State256 = struct {...@@ -208,7 +208,7 @@ const State256 = struct {
208 return state;208 return state;
209 }209 }
210210
211 fn update(state: *State256, d: AesBlock) callconv(.Inline) void {211 inline fn update(state: *State256, d: AesBlock) void {
212 const blocks = &state.blocks;212 const blocks = &state.blocks;
213 const tmp = blocks[5].encrypt(blocks[0]);213 const tmp = blocks[5].encrypt(blocks[0]);
214 comptime var i: usize = 5;214 comptime var i: usize = 5;
lib/std/crypto/aes/aesni.zig+16-16
...@@ -19,24 +19,24 @@ pub const Block = struct {...@@ -19,24 +19,24 @@ pub const Block = struct {
19 repr: BlockVec,19 repr: BlockVec,
2020
21 /// Convert a byte sequence into an internal representation.21 /// Convert a byte sequence into an internal representation.
22 pub fn fromBytes(bytes: *const [16]u8) callconv(.Inline) Block {22 pub inline fn fromBytes(bytes: *const [16]u8) Block {
23 const repr = mem.bytesToValue(BlockVec, bytes);23 const repr = mem.bytesToValue(BlockVec, bytes);
24 return Block{ .repr = repr };24 return Block{ .repr = repr };
25 }25 }
2626
27 /// Convert the internal representation of a block into a byte sequence.27 /// Convert the internal representation of a block into a byte sequence.
28 pub fn toBytes(block: Block) callconv(.Inline) [16]u8 {28 pub inline fn toBytes(block: Block) [16]u8 {
29 return mem.toBytes(block.repr);29 return mem.toBytes(block.repr);
30 }30 }
3131
32 /// XOR the block with a byte sequence.32 /// XOR the block with a byte sequence.
33 pub fn xorBytes(block: Block, bytes: *const [16]u8) callconv(.Inline) [16]u8 {33 pub inline fn xorBytes(block: Block, bytes: *const [16]u8) [16]u8 {
34 const x = block.repr ^ fromBytes(bytes).repr;34 const x = block.repr ^ fromBytes(bytes).repr;
35 return mem.toBytes(x);35 return mem.toBytes(x);
36 }36 }
3737
38 /// Encrypt a block with a round key.38 /// Encrypt a block with a round key.
39 pub fn encrypt(block: Block, round_key: Block) callconv(.Inline) Block {39 pub inline fn encrypt(block: Block, round_key: Block) Block {
40 return Block{40 return Block{
41 .repr = asm (41 .repr = asm (
42 \\ vaesenc %[rk], %[in], %[out]42 \\ vaesenc %[rk], %[in], %[out]
...@@ -48,7 +48,7 @@ pub const Block = struct {...@@ -48,7 +48,7 @@ pub const Block = struct {
48 }48 }
4949
50 /// Encrypt a block with the last round key.50 /// Encrypt a block with the last round key.
51 pub fn encryptLast(block: Block, round_key: Block) callconv(.Inline) Block {51 pub inline fn encryptLast(block: Block, round_key: Block) Block {
52 return Block{52 return Block{
53 .repr = asm (53 .repr = asm (
54 \\ vaesenclast %[rk], %[in], %[out]54 \\ vaesenclast %[rk], %[in], %[out]
...@@ -60,7 +60,7 @@ pub const Block = struct {...@@ -60,7 +60,7 @@ pub const Block = struct {
60 }60 }
6161
62 /// Decrypt a block with a round key.62 /// Decrypt a block with a round key.
63 pub fn decrypt(block: Block, inv_round_key: Block) callconv(.Inline) Block {63 pub inline fn decrypt(block: Block, inv_round_key: Block) Block {
64 return Block{64 return Block{
65 .repr = asm (65 .repr = asm (
66 \\ vaesdec %[rk], %[in], %[out]66 \\ vaesdec %[rk], %[in], %[out]
...@@ -72,7 +72,7 @@ pub const Block = struct {...@@ -72,7 +72,7 @@ pub const Block = struct {
72 }72 }
7373
74 /// Decrypt a block with the last round key.74 /// Decrypt a block with the last round key.
75 pub fn decryptLast(block: Block, inv_round_key: Block) callconv(.Inline) Block {75 pub inline fn decryptLast(block: Block, inv_round_key: Block) Block {
76 return Block{76 return Block{
77 .repr = asm (77 .repr = asm (
78 \\ vaesdeclast %[rk], %[in], %[out]78 \\ vaesdeclast %[rk], %[in], %[out]
...@@ -84,17 +84,17 @@ pub const Block = struct {...@@ -84,17 +84,17 @@ pub const Block = struct {
84 }84 }
8585
86 /// Apply the bitwise XOR operation to the content of two blocks.86 /// Apply the bitwise XOR operation to the content of two blocks.
87 pub fn xorBlocks(block1: Block, block2: Block) callconv(.Inline) Block {87 pub inline fn xorBlocks(block1: Block, block2: Block) Block {
88 return Block{ .repr = block1.repr ^ block2.repr };88 return Block{ .repr = block1.repr ^ block2.repr };
89 }89 }
9090
91 /// Apply the bitwise AND operation to the content of two blocks.91 /// Apply the bitwise AND operation to the content of two blocks.
92 pub fn andBlocks(block1: Block, block2: Block) callconv(.Inline) Block {92 pub inline fn andBlocks(block1: Block, block2: Block) Block {
93 return Block{ .repr = block1.repr & block2.repr };93 return Block{ .repr = block1.repr & block2.repr };
94 }94 }
9595
96 /// Apply the bitwise OR operation to the content of two blocks.96 /// Apply the bitwise OR operation to the content of two blocks.
97 pub fn orBlocks(block1: Block, block2: Block) callconv(.Inline) Block {97 pub inline fn orBlocks(block1: Block, block2: Block) Block {
98 return Block{ .repr = block1.repr | block2.repr };98 return Block{ .repr = block1.repr | block2.repr };
99 }99 }
100100
...@@ -114,7 +114,7 @@ pub const Block = struct {...@@ -114,7 +114,7 @@ pub const Block = struct {
114 };114 };
115115
116 /// Encrypt multiple blocks in parallel, each their own round key.116 /// Encrypt multiple blocks in parallel, each their own round key.
117 pub fn encryptParallel(comptime count: usize, blocks: [count]Block, round_keys: [count]Block) callconv(.Inline) [count]Block {117 pub inline fn encryptParallel(comptime count: usize, blocks: [count]Block, round_keys: [count]Block) [count]Block {
118 comptime var i = 0;118 comptime var i = 0;
119 var out: [count]Block = undefined;119 var out: [count]Block = undefined;
120 inline while (i < count) : (i += 1) {120 inline while (i < count) : (i += 1) {
...@@ -124,7 +124,7 @@ pub const Block = struct {...@@ -124,7 +124,7 @@ pub const Block = struct {
124 }124 }
125125
126 /// Decrypt multiple blocks in parallel, each their own round key.126 /// Decrypt multiple blocks in parallel, each their own round key.
127 pub fn decryptParallel(comptime count: usize, blocks: [count]Block, round_keys: [count]Block) callconv(.Inline) [count]Block {127 pub inline fn decryptParallel(comptime count: usize, blocks: [count]Block, round_keys: [count]Block) [count]Block {
128 comptime var i = 0;128 comptime var i = 0;
129 var out: [count]Block = undefined;129 var out: [count]Block = undefined;
130 inline while (i < count) : (i += 1) {130 inline while (i < count) : (i += 1) {
...@@ -134,7 +134,7 @@ pub const Block = struct {...@@ -134,7 +134,7 @@ pub const Block = struct {
134 }134 }
135135
136 /// Encrypt multiple blocks in parallel with the same round key.136 /// Encrypt multiple blocks in parallel with the same round key.
137 pub fn encryptWide(comptime count: usize, blocks: [count]Block, round_key: Block) callconv(.Inline) [count]Block {137 pub inline fn encryptWide(comptime count: usize, blocks: [count]Block, round_key: Block) [count]Block {
138 comptime var i = 0;138 comptime var i = 0;
139 var out: [count]Block = undefined;139 var out: [count]Block = undefined;
140 inline while (i < count) : (i += 1) {140 inline while (i < count) : (i += 1) {
...@@ -144,7 +144,7 @@ pub const Block = struct {...@@ -144,7 +144,7 @@ pub const Block = struct {
144 }144 }
145145
146 /// Decrypt multiple blocks in parallel with the same round key.146 /// Decrypt multiple blocks in parallel with the same round key.
147 pub fn decryptWide(comptime count: usize, blocks: [count]Block, round_key: Block) callconv(.Inline) [count]Block {147 pub inline fn decryptWide(comptime count: usize, blocks: [count]Block, round_key: Block) [count]Block {
148 comptime var i = 0;148 comptime var i = 0;
149 var out: [count]Block = undefined;149 var out: [count]Block = undefined;
150 inline while (i < count) : (i += 1) {150 inline while (i < count) : (i += 1) {
...@@ -154,7 +154,7 @@ pub const Block = struct {...@@ -154,7 +154,7 @@ pub const Block = struct {
154 }154 }
155155
156 /// Encrypt multiple blocks in parallel with the same last round key.156 /// Encrypt multiple blocks in parallel with the same last round key.
157 pub fn encryptLastWide(comptime count: usize, blocks: [count]Block, round_key: Block) callconv(.Inline) [count]Block {157 pub inline fn encryptLastWide(comptime count: usize, blocks: [count]Block, round_key: Block) [count]Block {
158 comptime var i = 0;158 comptime var i = 0;
159 var out: [count]Block = undefined;159 var out: [count]Block = undefined;
160 inline while (i < count) : (i += 1) {160 inline while (i < count) : (i += 1) {
...@@ -164,7 +164,7 @@ pub const Block = struct {...@@ -164,7 +164,7 @@ pub const Block = struct {
164 }164 }
165165
166 /// Decrypt multiple blocks in parallel with the same last round key.166 /// Decrypt multiple blocks in parallel with the same last round key.
167 pub fn decryptLastWide(comptime count: usize, blocks: [count]Block, round_key: Block) callconv(.Inline) [count]Block {167 pub inline fn decryptLastWide(comptime count: usize, blocks: [count]Block, round_key: Block) [count]Block {
168 comptime var i = 0;168 comptime var i = 0;
169 var out: [count]Block = undefined;169 var out: [count]Block = undefined;
170 inline while (i < count) : (i += 1) {170 inline while (i < count) : (i += 1) {
lib/std/crypto/aes/armcrypto.zig+16-16
...@@ -19,18 +19,18 @@ pub const Block = struct {...@@ -19,18 +19,18 @@ pub const Block = struct {
19 repr: BlockVec,19 repr: BlockVec,
2020
21 /// Convert a byte sequence into an internal representation.21 /// Convert a byte sequence into an internal representation.
22 pub fn fromBytes(bytes: *const [16]u8) callconv(.Inline) Block {22 pub inline fn fromBytes(bytes: *const [16]u8) Block {
23 const repr = mem.bytesToValue(BlockVec, bytes);23 const repr = mem.bytesToValue(BlockVec, bytes);
24 return Block{ .repr = repr };24 return Block{ .repr = repr };
25 }25 }
2626
27 /// Convert the internal representation of a block into a byte sequence.27 /// Convert the internal representation of a block into a byte sequence.
28 pub fn toBytes(block: Block) callconv(.Inline) [16]u8 {28 pub inline fn toBytes(block: Block) [16]u8 {
29 return mem.toBytes(block.repr);29 return mem.toBytes(block.repr);
30 }30 }
3131
32 /// XOR the block with a byte sequence.32 /// XOR the block with a byte sequence.
33 pub fn xorBytes(block: Block, bytes: *const [16]u8) callconv(.Inline) [16]u8 {33 pub inline fn xorBytes(block: Block, bytes: *const [16]u8) [16]u8 {
34 const x = block.repr ^ fromBytes(bytes).repr;34 const x = block.repr ^ fromBytes(bytes).repr;
35 return mem.toBytes(x);35 return mem.toBytes(x);
36 }36 }
...@@ -38,7 +38,7 @@ pub const Block = struct {...@@ -38,7 +38,7 @@ pub const Block = struct {
38 const zero = Vector(2, u64){ 0, 0 };38 const zero = Vector(2, u64){ 0, 0 };
3939
40 /// Encrypt a block with a round key.40 /// Encrypt a block with a round key.
41 pub fn encrypt(block: Block, round_key: Block) callconv(.Inline) Block {41 pub inline fn encrypt(block: Block, round_key: Block) Block {
42 return Block{42 return Block{
43 .repr = asm (43 .repr = asm (
44 \\ mov %[out].16b, %[in].16b44 \\ mov %[out].16b, %[in].16b
...@@ -54,7 +54,7 @@ pub const Block = struct {...@@ -54,7 +54,7 @@ pub const Block = struct {
54 }54 }
5555
56 /// Encrypt a block with the last round key.56 /// Encrypt a block with the last round key.
57 pub fn encryptLast(block: Block, round_key: Block) callconv(.Inline) Block {57 pub inline fn encryptLast(block: Block, round_key: Block) Block {
58 return Block{58 return Block{
59 .repr = asm (59 .repr = asm (
60 \\ mov %[out].16b, %[in].16b60 \\ mov %[out].16b, %[in].16b
...@@ -69,7 +69,7 @@ pub const Block = struct {...@@ -69,7 +69,7 @@ pub const Block = struct {
69 }69 }
7070
71 /// Decrypt a block with a round key.71 /// Decrypt a block with a round key.
72 pub fn decrypt(block: Block, inv_round_key: Block) callconv(.Inline) Block {72 pub inline fn decrypt(block: Block, inv_round_key: Block) Block {
73 return Block{73 return Block{
74 .repr = asm (74 .repr = asm (
75 \\ mov %[out].16b, %[in].16b75 \\ mov %[out].16b, %[in].16b
...@@ -85,7 +85,7 @@ pub const Block = struct {...@@ -85,7 +85,7 @@ pub const Block = struct {
85 }85 }
8686
87 /// Decrypt a block with the last round key.87 /// Decrypt a block with the last round key.
88 pub fn decryptLast(block: Block, inv_round_key: Block) callconv(.Inline) Block {88 pub inline fn decryptLast(block: Block, inv_round_key: Block) Block {
89 return Block{89 return Block{
90 .repr = asm (90 .repr = asm (
91 \\ mov %[out].16b, %[in].16b91 \\ mov %[out].16b, %[in].16b
...@@ -100,17 +100,17 @@ pub const Block = struct {...@@ -100,17 +100,17 @@ pub const Block = struct {
100 }100 }
101101
102 /// Apply the bitwise XOR operation to the content of two blocks.102 /// Apply the bitwise XOR operation to the content of two blocks.
103 pub fn xorBlocks(block1: Block, block2: Block) callconv(.Inline) Block {103 pub inline fn xorBlocks(block1: Block, block2: Block) Block {
104 return Block{ .repr = block1.repr ^ block2.repr };104 return Block{ .repr = block1.repr ^ block2.repr };
105 }105 }
106106
107 /// Apply the bitwise AND operation to the content of two blocks.107 /// Apply the bitwise AND operation to the content of two blocks.
108 pub fn andBlocks(block1: Block, block2: Block) callconv(.Inline) Block {108 pub inline fn andBlocks(block1: Block, block2: Block) Block {
109 return Block{ .repr = block1.repr & block2.repr };109 return Block{ .repr = block1.repr & block2.repr };
110 }110 }
111111
112 /// Apply the bitwise OR operation to the content of two blocks.112 /// Apply the bitwise OR operation to the content of two blocks.
113 pub fn orBlocks(block1: Block, block2: Block) callconv(.Inline) Block {113 pub inline fn orBlocks(block1: Block, block2: Block) Block {
114 return Block{ .repr = block1.repr | block2.repr };114 return Block{ .repr = block1.repr | block2.repr };
115 }115 }
116116
...@@ -120,7 +120,7 @@ pub const Block = struct {...@@ -120,7 +120,7 @@ pub const Block = struct {
120 pub const optimal_parallel_blocks = 8;120 pub const optimal_parallel_blocks = 8;
121121
122 /// Encrypt multiple blocks in parallel, each their own round key.122 /// Encrypt multiple blocks in parallel, each their own round key.
123 pub fn encryptParallel(comptime count: usize, blocks: [count]Block, round_keys: [count]Block) callconv(.Inline) [count]Block {123 pub inline fn encryptParallel(comptime count: usize, blocks: [count]Block, round_keys: [count]Block) [count]Block {
124 comptime var i = 0;124 comptime var i = 0;
125 var out: [count]Block = undefined;125 var out: [count]Block = undefined;
126 inline while (i < count) : (i += 1) {126 inline while (i < count) : (i += 1) {
...@@ -130,7 +130,7 @@ pub const Block = struct {...@@ -130,7 +130,7 @@ pub const Block = struct {
130 }130 }
131131
132 /// Decrypt multiple blocks in parallel, each their own round key.132 /// Decrypt multiple blocks in parallel, each their own round key.
133 pub fn decryptParallel(comptime count: usize, blocks: [count]Block, round_keys: [count]Block) callconv(.Inline) [count]Block {133 pub inline fn decryptParallel(comptime count: usize, blocks: [count]Block, round_keys: [count]Block) [count]Block {
134 comptime var i = 0;134 comptime var i = 0;
135 var out: [count]Block = undefined;135 var out: [count]Block = undefined;
136 inline while (i < count) : (i += 1) {136 inline while (i < count) : (i += 1) {
...@@ -140,7 +140,7 @@ pub const Block = struct {...@@ -140,7 +140,7 @@ pub const Block = struct {
140 }140 }
141141
142 /// Encrypt multiple blocks in parallel with the same round key.142 /// Encrypt multiple blocks in parallel with the same round key.
143 pub fn encryptWide(comptime count: usize, blocks: [count]Block, round_key: Block) callconv(.Inline) [count]Block {143 pub inline fn encryptWide(comptime count: usize, blocks: [count]Block, round_key: Block) [count]Block {
144 comptime var i = 0;144 comptime var i = 0;
145 var out: [count]Block = undefined;145 var out: [count]Block = undefined;
146 inline while (i < count) : (i += 1) {146 inline while (i < count) : (i += 1) {
...@@ -150,7 +150,7 @@ pub const Block = struct {...@@ -150,7 +150,7 @@ pub const Block = struct {
150 }150 }
151151
152 /// Decrypt multiple blocks in parallel with the same round key.152 /// Decrypt multiple blocks in parallel with the same round key.
153 pub fn decryptWide(comptime count: usize, blocks: [count]Block, round_key: Block) callconv(.Inline) [count]Block {153 pub inline fn decryptWide(comptime count: usize, blocks: [count]Block, round_key: Block) [count]Block {
154 comptime var i = 0;154 comptime var i = 0;
155 var out: [count]Block = undefined;155 var out: [count]Block = undefined;
156 inline while (i < count) : (i += 1) {156 inline while (i < count) : (i += 1) {
...@@ -160,7 +160,7 @@ pub const Block = struct {...@@ -160,7 +160,7 @@ pub const Block = struct {
160 }160 }
161161
162 /// Encrypt multiple blocks in parallel with the same last round key.162 /// Encrypt multiple blocks in parallel with the same last round key.
163 pub fn encryptLastWide(comptime count: usize, blocks: [count]Block, round_key: Block) callconv(.Inline) [count]Block {163 pub inline fn encryptLastWide(comptime count: usize, blocks: [count]Block, round_key: Block) [count]Block {
164 comptime var i = 0;164 comptime var i = 0;
165 var out: [count]Block = undefined;165 var out: [count]Block = undefined;
166 inline while (i < count) : (i += 1) {166 inline while (i < count) : (i += 1) {
...@@ -170,7 +170,7 @@ pub const Block = struct {...@@ -170,7 +170,7 @@ pub const Block = struct {
170 }170 }
171171
172 /// Decrypt multiple blocks in parallel with the same last round key.172 /// Decrypt multiple blocks in parallel with the same last round key.
173 pub fn decryptLastWide(comptime count: usize, blocks: [count]Block, round_key: Block) callconv(.Inline) [count]Block {173 pub inline fn decryptLastWide(comptime count: usize, blocks: [count]Block, round_key: Block) [count]Block {
174 comptime var i = 0;174 comptime var i = 0;
175 var out: [count]Block = undefined;175 var out: [count]Block = undefined;
176 inline while (i < count) : (i += 1) {176 inline while (i < count) : (i += 1) {
lib/std/crypto/aes/soft.zig+10-10
...@@ -18,7 +18,7 @@ pub const Block = struct {...@@ -18,7 +18,7 @@ pub const Block = struct {
18 repr: BlockVec align(16),18 repr: BlockVec align(16),
1919
20 /// Convert a byte sequence into an internal representation.20 /// Convert a byte sequence into an internal representation.
21 pub fn fromBytes(bytes: *const [16]u8) callconv(.Inline) Block {21 pub inline fn fromBytes(bytes: *const [16]u8) Block {
22 const s0 = mem.readIntBig(u32, bytes[0..4]);22 const s0 = mem.readIntBig(u32, bytes[0..4]);
23 const s1 = mem.readIntBig(u32, bytes[4..8]);23 const s1 = mem.readIntBig(u32, bytes[4..8]);
24 const s2 = mem.readIntBig(u32, bytes[8..12]);24 const s2 = mem.readIntBig(u32, bytes[8..12]);
...@@ -27,7 +27,7 @@ pub const Block = struct {...@@ -27,7 +27,7 @@ pub const Block = struct {
27 }27 }
2828
29 /// Convert the internal representation of a block into a byte sequence.29 /// Convert the internal representation of a block into a byte sequence.
30 pub fn toBytes(block: Block) callconv(.Inline) [16]u8 {30 pub inline fn toBytes(block: Block) [16]u8 {
31 var bytes: [16]u8 = undefined;31 var bytes: [16]u8 = undefined;
32 mem.writeIntBig(u32, bytes[0..4], block.repr[0]);32 mem.writeIntBig(u32, bytes[0..4], block.repr[0]);
33 mem.writeIntBig(u32, bytes[4..8], block.repr[1]);33 mem.writeIntBig(u32, bytes[4..8], block.repr[1]);
...@@ -37,7 +37,7 @@ pub const Block = struct {...@@ -37,7 +37,7 @@ pub const Block = struct {
37 }37 }
3838
39 /// XOR the block with a byte sequence.39 /// XOR the block with a byte sequence.
40 pub fn xorBytes(block: Block, bytes: *const [16]u8) callconv(.Inline) [16]u8 {40 pub inline fn xorBytes(block: Block, bytes: *const [16]u8) [16]u8 {
41 const block_bytes = block.toBytes();41 const block_bytes = block.toBytes();
42 var x: [16]u8 = undefined;42 var x: [16]u8 = undefined;
43 comptime var i: usize = 0;43 comptime var i: usize = 0;
...@@ -48,7 +48,7 @@ pub const Block = struct {...@@ -48,7 +48,7 @@ pub const Block = struct {
48 }48 }
4949
50 /// Encrypt a block with a round key.50 /// Encrypt a block with a round key.
51 pub fn encrypt(block: Block, round_key: Block) callconv(.Inline) Block {51 pub inline fn encrypt(block: Block, round_key: Block) Block {
52 const src = &block.repr;52 const src = &block.repr;
5353
54 const s0 = block.repr[0];54 const s0 = block.repr[0];
...@@ -65,7 +65,7 @@ pub const Block = struct {...@@ -65,7 +65,7 @@ pub const Block = struct {
65 }65 }
6666
67 /// Encrypt a block with the last round key.67 /// Encrypt a block with the last round key.
68 pub fn encryptLast(block: Block, round_key: Block) callconv(.Inline) Block {68 pub inline fn encryptLast(block: Block, round_key: Block) Block {
69 const src = &block.repr;69 const src = &block.repr;
7070
71 const t0 = block.repr[0];71 const t0 = block.repr[0];
...@@ -87,7 +87,7 @@ pub const Block = struct {...@@ -87,7 +87,7 @@ pub const Block = struct {
87 }87 }
8888
89 /// Decrypt a block with a round key.89 /// Decrypt a block with a round key.
90 pub fn decrypt(block: Block, round_key: Block) callconv(.Inline) Block {90 pub inline fn decrypt(block: Block, round_key: Block) Block {
91 const src = &block.repr;91 const src = &block.repr;
9292
93 const s0 = block.repr[0];93 const s0 = block.repr[0];
...@@ -104,7 +104,7 @@ pub const Block = struct {...@@ -104,7 +104,7 @@ pub const Block = struct {
104 }104 }
105105
106 /// Decrypt a block with the last round key.106 /// Decrypt a block with the last round key.
107 pub fn decryptLast(block: Block, round_key: Block) callconv(.Inline) Block {107 pub inline fn decryptLast(block: Block, round_key: Block) Block {
108 const src = &block.repr;108 const src = &block.repr;
109109
110 const t0 = block.repr[0];110 const t0 = block.repr[0];
...@@ -126,7 +126,7 @@ pub const Block = struct {...@@ -126,7 +126,7 @@ pub const Block = struct {
126 }126 }
127127
128 /// Apply the bitwise XOR operation to the content of two blocks.128 /// Apply the bitwise XOR operation to the content of two blocks.
129 pub fn xorBlocks(block1: Block, block2: Block) callconv(.Inline) Block {129 pub inline fn xorBlocks(block1: Block, block2: Block) Block {
130 var x: BlockVec = undefined;130 var x: BlockVec = undefined;
131 comptime var i = 0;131 comptime var i = 0;
132 inline while (i < 4) : (i += 1) {132 inline while (i < 4) : (i += 1) {
...@@ -136,7 +136,7 @@ pub const Block = struct {...@@ -136,7 +136,7 @@ pub const Block = struct {
136 }136 }
137137
138 /// Apply the bitwise AND operation to the content of two blocks.138 /// Apply the bitwise AND operation to the content of two blocks.
139 pub fn andBlocks(block1: Block, block2: Block) callconv(.Inline) Block {139 pub inline fn andBlocks(block1: Block, block2: Block) Block {
140 var x: BlockVec = undefined;140 var x: BlockVec = undefined;
141 comptime var i = 0;141 comptime var i = 0;
142 inline while (i < 4) : (i += 1) {142 inline while (i < 4) : (i += 1) {
...@@ -146,7 +146,7 @@ pub const Block = struct {...@@ -146,7 +146,7 @@ pub const Block = struct {
146 }146 }
147147
148 /// Apply the bitwise OR operation to the content of two blocks.148 /// Apply the bitwise OR operation to the content of two blocks.
149 pub fn orBlocks(block1: Block, block2: Block) callconv(.Inline) Block {149 pub inline fn orBlocks(block1: Block, block2: Block) Block {
150 var x: BlockVec = undefined;150 var x: BlockVec = undefined;
151 comptime var i = 0;151 comptime var i = 0;
152 inline while (i < 4) : (i += 1) {152 inline while (i < 4) : (i += 1) {
lib/std/crypto/aes_ocb.zig+3-3
...@@ -33,7 +33,7 @@ fn AesOcb(comptime Aes: anytype) type {...@@ -33,7 +33,7 @@ fn AesOcb(comptime Aes: anytype) type {
33 table: [56]Block align(16) = undefined,33 table: [56]Block align(16) = undefined,
34 upto: usize,34 upto: usize,
3535
36 fn double(l: Block) callconv(.Inline) Block {36 inline fn double(l: Block) Block {
37 const l_ = mem.readIntBig(u128, &l);37 const l_ = mem.readIntBig(u128, &l);
38 const l_2 = (l_ << 1) ^ (0x87 & -%(l_ >> 127));38 const l_2 = (l_ << 1) ^ (0x87 & -%(l_ >> 127));
39 var l2: Block = undefined;39 var l2: Block = undefined;
...@@ -245,7 +245,7 @@ fn AesOcb(comptime Aes: anytype) type {...@@ -245,7 +245,7 @@ fn AesOcb(comptime Aes: anytype) type {
245 };245 };
246}246}
247247
248fn xorBlocks(x: Block, y: Block) callconv(.Inline) Block {248inline fn xorBlocks(x: Block, y: Block) Block {
249 var z: Block = x;249 var z: Block = x;
250 for (z) |*v, i| {250 for (z) |*v, i| {
251 v.* = x[i] ^ y[i];251 v.* = x[i] ^ y[i];
...@@ -253,7 +253,7 @@ fn xorBlocks(x: Block, y: Block) callconv(.Inline) Block {...@@ -253,7 +253,7 @@ fn xorBlocks(x: Block, y: Block) callconv(.Inline) Block {
253 return z;253 return z;
254}254}
255255
256fn xorWith(x: *Block, y: Block) callconv(.Inline) void {256inline fn xorWith(x: *Block, y: Block) void {
257 for (x) |*v, i| {257 for (x) |*v, i| {
258 v.* ^= y[i];258 v.* ^= y[i];
259 }259 }
lib/std/crypto/blake3.zig+3-3
...@@ -66,7 +66,7 @@ const CompressVectorized = struct {...@@ -66,7 +66,7 @@ const CompressVectorized = struct {
66 const Lane = Vector(4, u32);66 const Lane = Vector(4, u32);
67 const Rows = [4]Lane;67 const Rows = [4]Lane;
6868
69 fn g(comptime even: bool, rows: *Rows, m: Lane) callconv(.Inline) void {69 inline fn g(comptime even: bool, rows: *Rows, m: Lane) void {
70 rows[0] +%= rows[1] +% m;70 rows[0] +%= rows[1] +% m;
71 rows[3] ^= rows[0];71 rows[3] ^= rows[0];
72 rows[3] = math.rotr(Lane, rows[3], if (even) 8 else 16);72 rows[3] = math.rotr(Lane, rows[3], if (even) 8 else 16);
...@@ -75,13 +75,13 @@ const CompressVectorized = struct {...@@ -75,13 +75,13 @@ const CompressVectorized = struct {
75 rows[1] = math.rotr(Lane, rows[1], if (even) 7 else 12);75 rows[1] = math.rotr(Lane, rows[1], if (even) 7 else 12);
76 }76 }
7777
78 fn diagonalize(rows: *Rows) callconv(.Inline) void {78 inline fn diagonalize(rows: *Rows) void {
79 rows[0] = @shuffle(u32, rows[0], undefined, [_]i32{ 3, 0, 1, 2 });79 rows[0] = @shuffle(u32, rows[0], undefined, [_]i32{ 3, 0, 1, 2 });
80 rows[3] = @shuffle(u32, rows[3], undefined, [_]i32{ 2, 3, 0, 1 });80 rows[3] = @shuffle(u32, rows[3], undefined, [_]i32{ 2, 3, 0, 1 });
81 rows[2] = @shuffle(u32, rows[2], undefined, [_]i32{ 1, 2, 3, 0 });81 rows[2] = @shuffle(u32, rows[2], undefined, [_]i32{ 1, 2, 3, 0 });
82 }82 }
8383
84 fn undiagonalize(rows: *Rows) callconv(.Inline) void {84 inline fn undiagonalize(rows: *Rows) void {
85 rows[0] = @shuffle(u32, rows[0], undefined, [_]i32{ 1, 2, 3, 0 });85 rows[0] = @shuffle(u32, rows[0], undefined, [_]i32{ 1, 2, 3, 0 });
86 rows[3] = @shuffle(u32, rows[3], undefined, [_]i32{ 2, 3, 0, 1 });86 rows[3] = @shuffle(u32, rows[3], undefined, [_]i32{ 2, 3, 0, 1 });
87 rows[2] = @shuffle(u32, rows[2], undefined, [_]i32{ 3, 0, 1, 2 });87 rows[2] = @shuffle(u32, rows[2], undefined, [_]i32{ 3, 0, 1, 2 });
lib/std/crypto/chacha20.zig+6-6
...@@ -102,7 +102,7 @@ fn ChaChaVecImpl(comptime rounds_nb: usize) type {...@@ -102,7 +102,7 @@ fn ChaChaVecImpl(comptime rounds_nb: usize) type {
102 };102 };
103 }103 }
104104
105 fn chacha20Core(x: *BlockVec, input: BlockVec) callconv(.Inline) void {105 inline fn chacha20Core(x: *BlockVec, input: BlockVec) void {
106 x.* = input;106 x.* = input;
107107
108 var r: usize = 0;108 var r: usize = 0;
...@@ -147,7 +147,7 @@ fn ChaChaVecImpl(comptime rounds_nb: usize) type {...@@ -147,7 +147,7 @@ fn ChaChaVecImpl(comptime rounds_nb: usize) type {
147 }147 }
148 }148 }
149149
150 fn hashToBytes(out: *[64]u8, x: BlockVec) callconv(.Inline) void {150 inline fn hashToBytes(out: *[64]u8, x: BlockVec) void {
151 var i: usize = 0;151 var i: usize = 0;
152 while (i < 4) : (i += 1) {152 while (i < 4) : (i += 1) {
153 mem.writeIntLittle(u32, out[16 * i + 0 ..][0..4], x[i][0]);153 mem.writeIntLittle(u32, out[16 * i + 0 ..][0..4], x[i][0]);
...@@ -157,7 +157,7 @@ fn ChaChaVecImpl(comptime rounds_nb: usize) type {...@@ -157,7 +157,7 @@ fn ChaChaVecImpl(comptime rounds_nb: usize) type {
157 }157 }
158 }158 }
159159
160 fn contextFeedback(x: *BlockVec, ctx: BlockVec) callconv(.Inline) void {160 inline fn contextFeedback(x: *BlockVec, ctx: BlockVec) void {
161 x[0] +%= ctx[0];161 x[0] +%= ctx[0];
162 x[1] +%= ctx[1];162 x[1] +%= ctx[1];
163 x[2] +%= ctx[2];163 x[2] +%= ctx[2];
...@@ -259,7 +259,7 @@ fn ChaChaNonVecImpl(comptime rounds_nb: usize) type {...@@ -259,7 +259,7 @@ fn ChaChaNonVecImpl(comptime rounds_nb: usize) type {
259 };259 };
260 }260 }
261261
262 fn chacha20Core(x: *BlockVec, input: BlockVec) callconv(.Inline) void {262 inline fn chacha20Core(x: *BlockVec, input: BlockVec) void {
263 x.* = input;263 x.* = input;
264264
265 const rounds = comptime [_]QuarterRound{265 const rounds = comptime [_]QuarterRound{
...@@ -288,7 +288,7 @@ fn ChaChaNonVecImpl(comptime rounds_nb: usize) type {...@@ -288,7 +288,7 @@ fn ChaChaNonVecImpl(comptime rounds_nb: usize) type {
288 }288 }
289 }289 }
290290
291 fn hashToBytes(out: *[64]u8, x: BlockVec) callconv(.Inline) void {291 inline fn hashToBytes(out: *[64]u8, x: BlockVec) void {
292 var i: usize = 0;292 var i: usize = 0;
293 while (i < 4) : (i += 1) {293 while (i < 4) : (i += 1) {
294 mem.writeIntLittle(u32, out[16 * i + 0 ..][0..4], x[i * 4 + 0]);294 mem.writeIntLittle(u32, out[16 * i + 0 ..][0..4], x[i * 4 + 0]);
...@@ -298,7 +298,7 @@ fn ChaChaNonVecImpl(comptime rounds_nb: usize) type {...@@ -298,7 +298,7 @@ fn ChaChaNonVecImpl(comptime rounds_nb: usize) type {
298 }298 }
299 }299 }
300300
301 fn contextFeedback(x: *BlockVec, ctx: BlockVec) callconv(.Inline) void {301 inline fn contextFeedback(x: *BlockVec, ctx: BlockVec) void {
302 var i: usize = 0;302 var i: usize = 0;
303 while (i < 16) : (i += 1) {303 while (i < 16) : (i += 1) {
304 x[i] +%= ctx[i];304 x[i] +%= ctx[i];
lib/std/crypto/ghash.zig+2-2
...@@ -95,7 +95,7 @@ pub const Ghash = struct {...@@ -95,7 +95,7 @@ pub const Ghash = struct {
95 }95 }
96 }96 }
9797
98 fn clmul_pclmul(x: u64, y: u64) callconv(.Inline) u64 {98 inline fn clmul_pclmul(x: u64, y: u64) u64 {
99 const Vector = std.meta.Vector;99 const Vector = std.meta.Vector;
100 const product = asm (100 const product = asm (
101 \\ vpclmulqdq $0x00, %[x], %[y], %[out]101 \\ vpclmulqdq $0x00, %[x], %[y], %[out]
...@@ -106,7 +106,7 @@ pub const Ghash = struct {...@@ -106,7 +106,7 @@ pub const Ghash = struct {
106 return product[0];106 return product[0];
107 }107 }
108108
109 fn clmul_pmull(x: u64, y: u64) callconv(.Inline) u64 {109 inline fn clmul_pmull(x: u64, y: u64) u64 {
110 const Vector = std.meta.Vector;110 const Vector = std.meta.Vector;
111 const product = asm (111 const product = asm (
112 \\ pmull %[out].1q, %[x].1d, %[y].1d112 \\ pmull %[out].1q, %[x].1d, %[y].1d
lib/std/crypto/gimli.zig+2-2
...@@ -49,7 +49,7 @@ pub const State = struct {...@@ -49,7 +49,7 @@ pub const State = struct {
49 return mem.asBytes(&self.data);49 return mem.asBytes(&self.data);
50 }50 }
5151
52 fn endianSwap(self: *Self) callconv(.Inline) void {52 inline fn endianSwap(self: *Self) void {
53 for (self.data) |*w| {53 for (self.data) |*w| {
54 w.* = mem.littleToNative(u32, w.*);54 w.* = mem.littleToNative(u32, w.*);
55 }55 }
...@@ -117,7 +117,7 @@ pub const State = struct {...@@ -117,7 +117,7 @@ pub const State = struct {
117117
118 const Lane = Vector(4, u32);118 const Lane = Vector(4, u32);
119119
120 fn shift(x: Lane, comptime n: comptime_int) callconv(.Inline) Lane {120 inline fn shift(x: Lane, comptime n: comptime_int) Lane {
121 return x << @splat(4, @as(u5, n));121 return x << @splat(4, @as(u5, n));
122 }122 }
123123
lib/std/crypto/pcurves/p256/p256_64.zig+4-4
...@@ -35,7 +35,7 @@ pub const Limbs = [4]u64;...@@ -35,7 +35,7 @@ pub const Limbs = [4]u64;
35/// Output Bounds:35/// Output Bounds:
36/// out1: [0x0 ~> 0xffffffffffffffff]36/// out1: [0x0 ~> 0xffffffffffffffff]
37/// out2: [0x0 ~> 0x1]37/// out2: [0x0 ~> 0x1]
38fn addcarryxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) callconv(.Inline) void {38inline fn addcarryxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) void {
39 @setRuntimeSafety(mode == .Debug);39 @setRuntimeSafety(mode == .Debug);
4040
41 var t: u64 = undefined;41 var t: u64 = undefined;
...@@ -56,7 +56,7 @@ fn addcarryxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) callconv(...@@ -56,7 +56,7 @@ fn addcarryxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) callconv(
56/// Output Bounds:56/// Output Bounds:
57/// out1: [0x0 ~> 0xffffffffffffffff]57/// out1: [0x0 ~> 0xffffffffffffffff]
58/// out2: [0x0 ~> 0x1]58/// out2: [0x0 ~> 0x1]
59fn subborrowxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) callconv(.Inline) void {59inline fn subborrowxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) void {
60 @setRuntimeSafety(mode == .Debug);60 @setRuntimeSafety(mode == .Debug);
6161
62 var t: u64 = undefined;62 var t: u64 = undefined;
...@@ -76,7 +76,7 @@ fn subborrowxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) callconv...@@ -76,7 +76,7 @@ fn subborrowxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) callconv
76/// Output Bounds:76/// Output Bounds:
77/// out1: [0x0 ~> 0xffffffffffffffff]77/// out1: [0x0 ~> 0xffffffffffffffff]
78/// out2: [0x0 ~> 0xffffffffffffffff]78/// out2: [0x0 ~> 0xffffffffffffffff]
79fn mulxU64(out1: *u64, out2: *u64, arg1: u64, arg2: u64) callconv(.Inline) void {79inline fn mulxU64(out1: *u64, out2: *u64, arg1: u64, arg2: u64) void {
80 @setRuntimeSafety(mode == .Debug);80 @setRuntimeSafety(mode == .Debug);
8181
82 const x = @as(u128, arg1) * @as(u128, arg2);82 const x = @as(u128, arg1) * @as(u128, arg2);
...@@ -94,7 +94,7 @@ fn mulxU64(out1: *u64, out2: *u64, arg1: u64, arg2: u64) callconv(.Inline) void...@@ -94,7 +94,7 @@ fn mulxU64(out1: *u64, out2: *u64, arg1: u64, arg2: u64) callconv(.Inline) void
94/// arg3: [0x0 ~> 0xffffffffffffffff]94/// arg3: [0x0 ~> 0xffffffffffffffff]
95/// Output Bounds:95/// Output Bounds:
96/// out1: [0x0 ~> 0xffffffffffffffff]96/// out1: [0x0 ~> 0xffffffffffffffff]
97fn cmovznzU64(out1: *u64, arg1: u1, arg2: u64, arg3: u64) callconv(.Inline) void {97inline fn cmovznzU64(out1: *u64, arg1: u1, arg2: u64, arg3: u64) void {
98 @setRuntimeSafety(mode == .Debug);98 @setRuntimeSafety(mode == .Debug);
9999
100 const mask = 0 -% @as(u64, arg1);100 const mask = 0 -% @as(u64, arg1);
lib/std/crypto/pcurves/p256/p256_scalar_64.zig+4-4
...@@ -35,7 +35,7 @@ pub const Limbs = [4]u64;...@@ -35,7 +35,7 @@ pub const Limbs = [4]u64;
35/// Output Bounds:35/// Output Bounds:
36/// out1: [0x0 ~> 0xffffffffffffffff]36/// out1: [0x0 ~> 0xffffffffffffffff]
37/// out2: [0x0 ~> 0x1]37/// out2: [0x0 ~> 0x1]
38fn addcarryxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) callconv(.Inline) void {38inline fn addcarryxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) void {
39 @setRuntimeSafety(mode == .Debug);39 @setRuntimeSafety(mode == .Debug);
4040
41 var t: u64 = undefined;41 var t: u64 = undefined;
...@@ -56,7 +56,7 @@ fn addcarryxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) callconv(...@@ -56,7 +56,7 @@ fn addcarryxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) callconv(
56/// Output Bounds:56/// Output Bounds:
57/// out1: [0x0 ~> 0xffffffffffffffff]57/// out1: [0x0 ~> 0xffffffffffffffff]
58/// out2: [0x0 ~> 0x1]58/// out2: [0x0 ~> 0x1]
59fn subborrowxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) callconv(.Inline) void {59inline fn subborrowxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) void {
60 @setRuntimeSafety(mode == .Debug);60 @setRuntimeSafety(mode == .Debug);
6161
62 var t: u64 = undefined;62 var t: u64 = undefined;
...@@ -76,7 +76,7 @@ fn subborrowxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) callconv...@@ -76,7 +76,7 @@ fn subborrowxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) callconv
76/// Output Bounds:76/// Output Bounds:
77/// out1: [0x0 ~> 0xffffffffffffffff]77/// out1: [0x0 ~> 0xffffffffffffffff]
78/// out2: [0x0 ~> 0xffffffffffffffff]78/// out2: [0x0 ~> 0xffffffffffffffff]
79fn mulxU64(out1: *u64, out2: *u64, arg1: u64, arg2: u64) callconv(.Inline) void {79inline fn mulxU64(out1: *u64, out2: *u64, arg1: u64, arg2: u64) void {
80 @setRuntimeSafety(mode == .Debug);80 @setRuntimeSafety(mode == .Debug);
8181
82 const x = @as(u128, arg1) * @as(u128, arg2);82 const x = @as(u128, arg1) * @as(u128, arg2);
...@@ -94,7 +94,7 @@ fn mulxU64(out1: *u64, out2: *u64, arg1: u64, arg2: u64) callconv(.Inline) void...@@ -94,7 +94,7 @@ fn mulxU64(out1: *u64, out2: *u64, arg1: u64, arg2: u64) callconv(.Inline) void
94/// arg3: [0x0 ~> 0xffffffffffffffff]94/// arg3: [0x0 ~> 0xffffffffffffffff]
95/// Output Bounds:95/// Output Bounds:
96/// out1: [0x0 ~> 0xffffffffffffffff]96/// out1: [0x0 ~> 0xffffffffffffffff]
97fn cmovznzU64(out1: *u64, arg1: u1, arg2: u64, arg3: u64) callconv(.Inline) void {97inline fn cmovznzU64(out1: *u64, arg1: u1, arg2: u64, arg3: u64) void {
98 @setRuntimeSafety(mode == .Debug);98 @setRuntimeSafety(mode == .Debug);
9999
100 const mask = 0 -% @as(u64, arg1);100 const mask = 0 -% @as(u64, arg1);
lib/std/crypto/salsa20.zig+3-3
...@@ -41,7 +41,7 @@ const Salsa20VecImpl = struct {...@@ -41,7 +41,7 @@ const Salsa20VecImpl = struct {
41 };41 };
42 }42 }
4343
44 fn salsa20Core(x: *BlockVec, input: BlockVec, comptime feedback: bool) callconv(.Inline) void {44 inline fn salsa20Core(x: *BlockVec, input: BlockVec, comptime feedback: bool) void {
45 const n1n2n3n0 = Lane{ input[3][1], input[3][2], input[3][3], input[3][0] };45 const n1n2n3n0 = Lane{ input[3][1], input[3][2], input[3][3], input[3][0] };
46 const n1n2 = Half{ n1n2n3n0[0], n1n2n3n0[1] };46 const n1n2 = Half{ n1n2n3n0[0], n1n2n3n0[1] };
47 const n3n0 = Half{ n1n2n3n0[2], n1n2n3n0[3] };47 const n3n0 = Half{ n1n2n3n0[2], n1n2n3n0[3] };
...@@ -215,7 +215,7 @@ const Salsa20NonVecImpl = struct {...@@ -215,7 +215,7 @@ const Salsa20NonVecImpl = struct {
215 d: u6,215 d: u6,
216 };216 };
217217
218 fn Rp(a: usize, b: usize, c: usize, d: u6) callconv(.Inline) QuarterRound {218 inline fn Rp(a: usize, b: usize, c: usize, d: u6) QuarterRound {
219 return QuarterRound{219 return QuarterRound{
220 .a = a,220 .a = a,
221 .b = b,221 .b = b,
...@@ -224,7 +224,7 @@ const Salsa20NonVecImpl = struct {...@@ -224,7 +224,7 @@ const Salsa20NonVecImpl = struct {
224 };224 };
225 }225 }
226226
227 fn salsa20Core(x: *BlockVec, input: BlockVec, comptime feedback: bool) callconv(.Inline) void {227 inline fn salsa20Core(x: *BlockVec, input: BlockVec, comptime feedback: bool) void {
228 const arx_steps = comptime [_]QuarterRound{228 const arx_steps = comptime [_]QuarterRound{
229 Rp(4, 0, 12, 7), Rp(8, 4, 0, 9), Rp(12, 8, 4, 13), Rp(0, 12, 8, 18),229 Rp(4, 0, 12, 7), Rp(8, 4, 0, 9), Rp(12, 8, 4, 13), Rp(0, 12, 8, 18),
230 Rp(9, 5, 1, 7), Rp(13, 9, 5, 9), Rp(1, 13, 9, 13), Rp(5, 1, 13, 18),230 Rp(9, 5, 1, 7), Rp(13, 9, 5, 9), Rp(1, 13, 9, 13), Rp(5, 1, 13, 18),
lib/std/elf.zig+8-8
...@@ -721,10 +721,10 @@ pub const Elf32_Rel = extern struct {...@@ -721,10 +721,10 @@ pub const Elf32_Rel = extern struct {
721 r_offset: Elf32_Addr,721 r_offset: Elf32_Addr,
722 r_info: Elf32_Word,722 r_info: Elf32_Word,
723723
724 pub fn r_sym(self: @This()) callconv(.Inline) u24 {724 pub inline fn r_sym(self: @This()) u24 {
725 return @truncate(u24, self.r_info >> 8);725 return @truncate(u24, self.r_info >> 8);
726 }726 }
727 pub fn r_type(self: @This()) callconv(.Inline) u8 {727 pub inline fn r_type(self: @This()) u8 {
728 return @truncate(u8, self.r_info & 0xff);728 return @truncate(u8, self.r_info & 0xff);
729 }729 }
730};730};
...@@ -732,10 +732,10 @@ pub const Elf64_Rel = extern struct {...@@ -732,10 +732,10 @@ pub const Elf64_Rel = extern struct {
732 r_offset: Elf64_Addr,732 r_offset: Elf64_Addr,
733 r_info: Elf64_Xword,733 r_info: Elf64_Xword,
734734
735 pub fn r_sym(self: @This()) callconv(.Inline) u32 {735 pub inline fn r_sym(self: @This()) u32 {
736 return @truncate(u32, self.r_info >> 32);736 return @truncate(u32, self.r_info >> 32);
737 }737 }
738 pub fn r_type(self: @This()) callconv(.Inline) u32 {738 pub inline fn r_type(self: @This()) u32 {
739 return @truncate(u32, self.r_info & 0xffffffff);739 return @truncate(u32, self.r_info & 0xffffffff);
740 }740 }
741};741};
...@@ -744,10 +744,10 @@ pub const Elf32_Rela = extern struct {...@@ -744,10 +744,10 @@ pub const Elf32_Rela = extern struct {
744 r_info: Elf32_Word,744 r_info: Elf32_Word,
745 r_addend: Elf32_Sword,745 r_addend: Elf32_Sword,
746746
747 pub fn r_sym(self: @This()) callconv(.Inline) u24 {747 pub inline fn r_sym(self: @This()) u24 {
748 return @truncate(u24, self.r_info >> 8);748 return @truncate(u24, self.r_info >> 8);
749 }749 }
750 pub fn r_type(self: @This()) callconv(.Inline) u8 {750 pub inline fn r_type(self: @This()) u8 {
751 return @truncate(u8, self.r_info & 0xff);751 return @truncate(u8, self.r_info & 0xff);
752 }752 }
753};753};
...@@ -756,10 +756,10 @@ pub const Elf64_Rela = extern struct {...@@ -756,10 +756,10 @@ pub const Elf64_Rela = extern struct {
756 r_info: Elf64_Xword,756 r_info: Elf64_Xword,
757 r_addend: Elf64_Sxword,757 r_addend: Elf64_Sxword,
758758
759 pub fn r_sym(self: @This()) callconv(.Inline) u32 {759 pub inline fn r_sym(self: @This()) u32 {
760 return @truncate(u32, self.r_info >> 32);760 return @truncate(u32, self.r_info >> 32);
761 }761 }
762 pub fn r_type(self: @This()) callconv(.Inline) u32 {762 pub inline fn r_type(self: @This()) u32 {
763 return @truncate(u32, self.r_info & 0xffffffff);763 return @truncate(u32, self.r_info & 0xffffffff);
764 }764 }
765};765};
lib/std/fmt/parse_float.zig+4-4
...@@ -52,21 +52,21 @@ const Z96 = struct {...@@ -52,21 +52,21 @@ const Z96 = struct {
52 d2: u32,52 d2: u32,
5353
54 // d = s >> 154 // d = s >> 1
55 fn shiftRight1(d: *Z96, s: Z96) callconv(.Inline) void {55 inline fn shiftRight1(d: *Z96, s: Z96) void {
56 d.d0 = (s.d0 >> 1) | ((s.d1 & 1) << 31);56 d.d0 = (s.d0 >> 1) | ((s.d1 & 1) << 31);
57 d.d1 = (s.d1 >> 1) | ((s.d2 & 1) << 31);57 d.d1 = (s.d1 >> 1) | ((s.d2 & 1) << 31);
58 d.d2 = s.d2 >> 1;58 d.d2 = s.d2 >> 1;
59 }59 }
6060
61 // d = s << 161 // d = s << 1
62 fn shiftLeft1(d: *Z96, s: Z96) callconv(.Inline) void {62 inline fn shiftLeft1(d: *Z96, s: Z96) void {
63 d.d2 = (s.d2 << 1) | ((s.d1 & (1 << 31)) >> 31);63 d.d2 = (s.d2 << 1) | ((s.d1 & (1 << 31)) >> 31);
64 d.d1 = (s.d1 << 1) | ((s.d0 & (1 << 31)) >> 31);64 d.d1 = (s.d1 << 1) | ((s.d0 & (1 << 31)) >> 31);
65 d.d0 = s.d0 << 1;65 d.d0 = s.d0 << 1;
66 }66 }
6767
68 // d += s68 // d += s
69 fn add(d: *Z96, s: Z96) callconv(.Inline) void {69 inline fn add(d: *Z96, s: Z96) void {
70 var w = @as(u64, d.d0) + @as(u64, s.d0);70 var w = @as(u64, d.d0) + @as(u64, s.d0);
71 d.d0 = @truncate(u32, w);71 d.d0 = @truncate(u32, w);
7272
...@@ -80,7 +80,7 @@ const Z96 = struct {...@@ -80,7 +80,7 @@ const Z96 = struct {
80 }80 }
8181
82 // d -= s82 // d -= s
83 fn sub(d: *Z96, s: Z96) callconv(.Inline) void {83 inline fn sub(d: *Z96, s: Z96) void {
84 var w = @as(u64, d.d0) -% @as(u64, s.d0);84 var w = @as(u64, d.d0) -% @as(u64, s.d0);
85 d.d0 = @truncate(u32, w);85 d.d0 = @truncate(u32, w);
8686
lib/std/hash/cityhash.zig+1-1
...@@ -6,7 +6,7 @@...@@ -6,7 +6,7 @@
6const std = @import("std");6const std = @import("std");
7const builtin = std.builtin;7const builtin = std.builtin;
88
9fn offsetPtr(ptr: [*]const u8, offset: usize) callconv(.Inline) [*]const u8 {9inline fn offsetPtr(ptr: [*]const u8, offset: usize) [*]const u8 {
10 // ptr + offset doesn't work at comptime so we need this instead.10 // ptr + offset doesn't work at comptime so we need this instead.
11 return @ptrCast([*]const u8, &ptr[offset]);11 return @ptrCast([*]const u8, &ptr[offset]);
12}12}
lib/std/json.zig+2-5
...@@ -2014,12 +2014,9 @@ test "parse into struct with duplicate field" {...@@ -2014,12 +2014,9 @@ test "parse into struct with duplicate field" {
2014 const ballast = try testing.allocator.alloc(u64, 1);2014 const ballast = try testing.allocator.alloc(u64, 1);
2015 defer testing.allocator.free(ballast);2015 defer testing.allocator.free(ballast);
20162016
2017 const options_first = ParseOptions{ 2017 const options_first = ParseOptions{ .allocator = testing.allocator, .duplicate_field_behavior = .UseFirst };
2018 .allocator = testing.allocator,
2019 .duplicate_field_behavior = .UseFirst
2020 };
20212018
2022 const options_last = ParseOptions{ 2019 const options_last = ParseOptions{
2023 .allocator = testing.allocator,2020 .allocator = testing.allocator,
2024 .duplicate_field_behavior = .UseLast,2021 .duplicate_field_behavior = .UseLast,
2025 };2022 };
lib/std/math.zig+1-1
...@@ -1334,7 +1334,7 @@ test "math.comptime" {...@@ -1334,7 +1334,7 @@ test "math.comptime" {
1334/// Returns a mask of all ones if value is true,1334/// Returns a mask of all ones if value is true,
1335/// and a mask of all zeroes if value is false.1335/// and a mask of all zeroes if value is false.
1336/// Compiles to one instruction for register sized integers.1336/// Compiles to one instruction for register sized integers.
1337pub fn boolMask(comptime MaskInt: type, value: bool) callconv(.Inline) MaskInt {1337pub inline fn boolMask(comptime MaskInt: type, value: bool) MaskInt {
1338 if (@typeInfo(MaskInt) != .Int)1338 if (@typeInfo(MaskInt) != .Int)
1339 @compileError("boolMask requires an integer mask type.");1339 @compileError("boolMask requires an integer mask type.");
13401340
lib/std/math/complex.zig+1-1
...@@ -38,7 +38,7 @@ pub fn Complex(comptime T: type) type {...@@ -38,7 +38,7 @@ pub fn Complex(comptime T: type) type {
3838
39 /// Imaginary part.39 /// Imaginary part.
40 im: T,40 im: T,
41 41
42 /// Deprecated, use init()42 /// Deprecated, use init()
43 pub const new = init;43 pub const new = init;
4444
lib/std/os/bits/freebsd.zig+4-4
...@@ -823,16 +823,16 @@ pub const sigval = extern union {...@@ -823,16 +823,16 @@ pub const sigval = extern union {
823pub const _SIG_WORDS = 4;823pub const _SIG_WORDS = 4;
824pub const _SIG_MAXSIG = 128;824pub const _SIG_MAXSIG = 128;
825825
826pub fn _SIG_IDX(sig: usize) callconv(.Inline) usize {826pub inline fn _SIG_IDX(sig: usize) usize {
827 return sig - 1;827 return sig - 1;
828}828}
829pub fn _SIG_WORD(sig: usize) callconv(.Inline) usize {829pub inline fn _SIG_WORD(sig: usize) usize {
830 return_SIG_IDX(sig) >> 5;830 return_SIG_IDX(sig) >> 5;
831}831}
832pub fn _SIG_BIT(sig: usize) callconv(.Inline) usize {832pub inline fn _SIG_BIT(sig: usize) usize {
833 return 1 << (_SIG_IDX(sig) & 31);833 return 1 << (_SIG_IDX(sig) & 31);
834}834}
835pub fn _SIG_VALID(sig: usize) callconv(.Inline) usize {835pub inline fn _SIG_VALID(sig: usize) usize {
836 return sig <= _SIG_MAXSIG and sig > 0;836 return sig <= _SIG_MAXSIG and sig > 0;
837}837}
838838
lib/std/os/bits/haiku.zig+4-4
...@@ -721,16 +721,16 @@ pub const Sigaction = extern struct {...@@ -721,16 +721,16 @@ pub const Sigaction = extern struct {
721721
722pub const _SIG_WORDS = 4;722pub const _SIG_WORDS = 4;
723pub const _SIG_MAXSIG = 128;723pub const _SIG_MAXSIG = 128;
724pub fn _SIG_IDX(sig: usize) callconv(.Inline) usize {724pub inline fn _SIG_IDX(sig: usize) usize {
725 return sig - 1;725 return sig - 1;
726}726}
727pub fn _SIG_WORD(sig: usize) callconv(.Inline) usize {727pub inline fn _SIG_WORD(sig: usize) usize {
728 return_SIG_IDX(sig) >> 5;728 return_SIG_IDX(sig) >> 5;
729}729}
730pub fn _SIG_BIT(sig: usize) callconv(.Inline) usize {730pub inline fn _SIG_BIT(sig: usize) usize {
731 return 1 << (_SIG_IDX(sig) & 31);731 return 1 << (_SIG_IDX(sig) & 31);
732}732}
733pub fn _SIG_VALID(sig: usize) callconv(.Inline) usize {733pub inline fn _SIG_VALID(sig: usize) usize {
734 return sig <= _SIG_MAXSIG and sig > 0;734 return sig <= _SIG_MAXSIG and sig > 0;
735}735}
736736
lib/std/os/bits/netbsd.zig+4-4
...@@ -804,16 +804,16 @@ pub const _ksiginfo = extern struct {...@@ -804,16 +804,16 @@ pub const _ksiginfo = extern struct {
804pub const _SIG_WORDS = 4;804pub const _SIG_WORDS = 4;
805pub const _SIG_MAXSIG = 128;805pub const _SIG_MAXSIG = 128;
806806
807pub fn _SIG_IDX(sig: usize) callconv(.Inline) usize {807pub inline fn _SIG_IDX(sig: usize) usize {
808 return sig - 1;808 return sig - 1;
809}809}
810pub fn _SIG_WORD(sig: usize) callconv(.Inline) usize {810pub inline fn _SIG_WORD(sig: usize) usize {
811 return_SIG_IDX(sig) >> 5;811 return_SIG_IDX(sig) >> 5;
812}812}
813pub fn _SIG_BIT(sig: usize) callconv(.Inline) usize {813pub inline fn _SIG_BIT(sig: usize) usize {
814 return 1 << (_SIG_IDX(sig) & 31);814 return 1 << (_SIG_IDX(sig) & 31);
815}815}
816pub fn _SIG_VALID(sig: usize) callconv(.Inline) usize {816pub inline fn _SIG_VALID(sig: usize) usize {
817 return sig <= _SIG_MAXSIG and sig > 0;817 return sig <= _SIG_MAXSIG and sig > 0;
818}818}
819819
lib/std/os/linux.zig+1-1
...@@ -145,7 +145,7 @@ pub fn fork() usize {...@@ -145,7 +145,7 @@ pub fn fork() usize {
145/// It is advised to avoid this function and use clone instead, because145/// It is advised to avoid this function and use clone instead, because
146/// the compiler is not aware of how vfork affects control flow and you may146/// the compiler is not aware of how vfork affects control flow and you may
147/// see different results in optimized builds.147/// see different results in optimized builds.
148pub fn vfork() callconv(.Inline) usize {148pub inline fn vfork() usize {
149 return @call(.{ .modifier = .always_inline }, syscall0, .{.vfork});149 return @call(.{ .modifier = .always_inline }, syscall0, .{.vfork});
150}150}
151151
lib/std/os/linux/tls.zig+1-1
...@@ -307,7 +307,7 @@ fn initTLS() void {...@@ -307,7 +307,7 @@ fn initTLS() void {
307 };307 };
308}308}
309309
310fn alignPtrCast(comptime T: type, ptr: [*]u8) callconv(.Inline) *T {310inline fn alignPtrCast(comptime T: type, ptr: [*]u8) *T {
311 return @ptrCast(*T, @alignCast(@alignOf(T), ptr));311 return @ptrCast(*T, @alignCast(@alignOf(T), ptr));
312}312}
313313
lib/std/os/windows.zig+1-1
...@@ -1745,7 +1745,7 @@ pub fn wToPrefixedFileW(s: []const u16) !PathSpace {...@@ -1745,7 +1745,7 @@ pub fn wToPrefixedFileW(s: []const u16) !PathSpace {
1745 return path_space;1745 return path_space;
1746}1746}
17471747
1748fn MAKELANGID(p: c_ushort, s: c_ushort) callconv(.Inline) LANGID {1748inline fn MAKELANGID(p: c_ushort, s: c_ushort) LANGID {
1749 return (s << 10) | p;1749 return (s << 10) | p;
1750}1750}
17511751
lib/std/start.zig+2-2
...@@ -375,7 +375,7 @@ const bad_main_ret = "expected return type of main to be 'void', '!void', 'noret...@@ -375,7 +375,7 @@ const bad_main_ret = "expected return type of main to be 'void', '!void', 'noret
375375
376// This is marked inline because for some reason LLVM in release mode fails to inline it,376// This is marked inline because for some reason LLVM in release mode fails to inline it,
377// and we want fewer call frames in stack traces.377// and we want fewer call frames in stack traces.
378fn initEventLoopAndCallMain() callconv(.Inline) u8 {378inline fn initEventLoopAndCallMain() u8 {
379 if (std.event.Loop.instance) |loop| {379 if (std.event.Loop.instance) |loop| {
380 if (!@hasDecl(root, "event_loop")) {380 if (!@hasDecl(root, "event_loop")) {
381 loop.init() catch |err| {381 loop.init() catch |err| {
...@@ -404,7 +404,7 @@ fn initEventLoopAndCallMain() callconv(.Inline) u8 {...@@ -404,7 +404,7 @@ fn initEventLoopAndCallMain() callconv(.Inline) u8 {
404// and we want fewer call frames in stack traces.404// and we want fewer call frames in stack traces.
405// TODO This function is duplicated from initEventLoopAndCallMain instead of using generics405// TODO This function is duplicated from initEventLoopAndCallMain instead of using generics
406// because it is working around stage1 compiler bugs.406// because it is working around stage1 compiler bugs.
407fn initEventLoopAndCallWinMain() callconv(.Inline) std.os.windows.INT {407inline fn initEventLoopAndCallWinMain() std.os.windows.INT {
408 if (std.event.Loop.instance) |loop| {408 if (std.event.Loop.instance) |loop| {
409 if (!@hasDecl(root, "event_loop")) {409 if (!@hasDecl(root, "event_loop")) {
410 loop.init() catch |err| {410 loop.init() catch |err| {
lib/std/target/spirv.zig+55-110
...@@ -732,8 +732,7 @@ pub const all_features = blk: {...@@ -732,8 +732,7 @@ pub const all_features = blk: {
732 result[@enumToInt(Feature.Matrix)] = .{732 result[@enumToInt(Feature.Matrix)] = .{
733 .llvm_name = null,733 .llvm_name = null,
734 .description = "Enable SPIR-V capability Matrix",734 .description = "Enable SPIR-V capability Matrix",
735 .dependencies = featureSet(&[_]Feature{735 .dependencies = featureSet(&[_]Feature{}),
736 }),
737 };736 };
738 result[@enumToInt(Feature.Shader)] = .{737 result[@enumToInt(Feature.Shader)] = .{
739 .llvm_name = null,738 .llvm_name = null,
...@@ -759,20 +758,17 @@ pub const all_features = blk: {...@@ -759,20 +758,17 @@ pub const all_features = blk: {
759 result[@enumToInt(Feature.Addresses)] = .{758 result[@enumToInt(Feature.Addresses)] = .{
760 .llvm_name = null,759 .llvm_name = null,
761 .description = "Enable SPIR-V capability Addresses",760 .description = "Enable SPIR-V capability Addresses",
762 .dependencies = featureSet(&[_]Feature{761 .dependencies = featureSet(&[_]Feature{}),
763 }),
764 };762 };
765 result[@enumToInt(Feature.Linkage)] = .{763 result[@enumToInt(Feature.Linkage)] = .{
766 .llvm_name = null,764 .llvm_name = null,
767 .description = "Enable SPIR-V capability Linkage",765 .description = "Enable SPIR-V capability Linkage",
768 .dependencies = featureSet(&[_]Feature{766 .dependencies = featureSet(&[_]Feature{}),
769 }),
770 };767 };
771 result[@enumToInt(Feature.Kernel)] = .{768 result[@enumToInt(Feature.Kernel)] = .{
772 .llvm_name = null,769 .llvm_name = null,
773 .description = "Enable SPIR-V capability Kernel",770 .description = "Enable SPIR-V capability Kernel",
774 .dependencies = featureSet(&[_]Feature{771 .dependencies = featureSet(&[_]Feature{}),
775 }),
776 };772 };
777 result[@enumToInt(Feature.Vector16)] = .{773 result[@enumToInt(Feature.Vector16)] = .{
778 .llvm_name = null,774 .llvm_name = null,
...@@ -791,20 +787,17 @@ pub const all_features = blk: {...@@ -791,20 +787,17 @@ pub const all_features = blk: {
791 result[@enumToInt(Feature.Float16)] = .{787 result[@enumToInt(Feature.Float16)] = .{
792 .llvm_name = null,788 .llvm_name = null,
793 .description = "Enable SPIR-V capability Float16",789 .description = "Enable SPIR-V capability Float16",
794 .dependencies = featureSet(&[_]Feature{790 .dependencies = featureSet(&[_]Feature{}),
795 }),
796 };791 };
797 result[@enumToInt(Feature.Float64)] = .{792 result[@enumToInt(Feature.Float64)] = .{
798 .llvm_name = null,793 .llvm_name = null,
799 .description = "Enable SPIR-V capability Float64",794 .description = "Enable SPIR-V capability Float64",
800 .dependencies = featureSet(&[_]Feature{795 .dependencies = featureSet(&[_]Feature{}),
801 }),
802 };796 };
803 result[@enumToInt(Feature.Int64)] = .{797 result[@enumToInt(Feature.Int64)] = .{
804 .llvm_name = null,798 .llvm_name = null,
805 .description = "Enable SPIR-V capability Int64",799 .description = "Enable SPIR-V capability Int64",
806 .dependencies = featureSet(&[_]Feature{800 .dependencies = featureSet(&[_]Feature{}),
807 }),
808 };801 };
809 result[@enumToInt(Feature.Int64Atomics)] = .{802 result[@enumToInt(Feature.Int64Atomics)] = .{
810 .llvm_name = null,803 .llvm_name = null,
...@@ -844,8 +837,7 @@ pub const all_features = blk: {...@@ -844,8 +837,7 @@ pub const all_features = blk: {
844 result[@enumToInt(Feature.Groups)] = .{837 result[@enumToInt(Feature.Groups)] = .{
845 .llvm_name = null,838 .llvm_name = null,
846 .description = "Enable SPIR-V capability Groups",839 .description = "Enable SPIR-V capability Groups",
847 .dependencies = featureSet(&[_]Feature{840 .dependencies = featureSet(&[_]Feature{}),
848 }),
849 };841 };
850 result[@enumToInt(Feature.DeviceEnqueue)] = .{842 result[@enumToInt(Feature.DeviceEnqueue)] = .{
851 .llvm_name = null,843 .llvm_name = null,
...@@ -871,8 +863,7 @@ pub const all_features = blk: {...@@ -871,8 +863,7 @@ pub const all_features = blk: {
871 result[@enumToInt(Feature.Int16)] = .{863 result[@enumToInt(Feature.Int16)] = .{
872 .llvm_name = null,864 .llvm_name = null,
873 .description = "Enable SPIR-V capability Int16",865 .description = "Enable SPIR-V capability Int16",
874 .dependencies = featureSet(&[_]Feature{866 .dependencies = featureSet(&[_]Feature{}),
875 }),
876 };867 };
877 result[@enumToInt(Feature.TessellationPointSize)] = .{868 result[@enumToInt(Feature.TessellationPointSize)] = .{
878 .llvm_name = null,869 .llvm_name = null,
...@@ -982,8 +973,7 @@ pub const all_features = blk: {...@@ -982,8 +973,7 @@ pub const all_features = blk: {
982 result[@enumToInt(Feature.Int8)] = .{973 result[@enumToInt(Feature.Int8)] = .{
983 .llvm_name = null,974 .llvm_name = null,
984 .description = "Enable SPIR-V capability Int8",975 .description = "Enable SPIR-V capability Int8",
985 .dependencies = featureSet(&[_]Feature{976 .dependencies = featureSet(&[_]Feature{}),
986 }),
987 };977 };
988 result[@enumToInt(Feature.InputAttachment)] = .{978 result[@enumToInt(Feature.InputAttachment)] = .{
989 .llvm_name = null,979 .llvm_name = null,
...@@ -1009,8 +999,7 @@ pub const all_features = blk: {...@@ -1009,8 +999,7 @@ pub const all_features = blk: {
1009 result[@enumToInt(Feature.Sampled1D)] = .{999 result[@enumToInt(Feature.Sampled1D)] = .{
1010 .llvm_name = null,1000 .llvm_name = null,
1011 .description = "Enable SPIR-V capability Sampled1D",1001 .description = "Enable SPIR-V capability Sampled1D",
1012 .dependencies = featureSet(&[_]Feature{1002 .dependencies = featureSet(&[_]Feature{}),
1013 }),
1014 };1003 };
1015 result[@enumToInt(Feature.Image1D)] = .{1004 result[@enumToInt(Feature.Image1D)] = .{
1016 .llvm_name = null,1005 .llvm_name = null,
...@@ -1029,8 +1018,7 @@ pub const all_features = blk: {...@@ -1029,8 +1018,7 @@ pub const all_features = blk: {
1029 result[@enumToInt(Feature.SampledBuffer)] = .{1018 result[@enumToInt(Feature.SampledBuffer)] = .{
1030 .llvm_name = null,1019 .llvm_name = null,
1031 .description = "Enable SPIR-V capability SampledBuffer",1020 .description = "Enable SPIR-V capability SampledBuffer",
1032 .dependencies = featureSet(&[_]Feature{1021 .dependencies = featureSet(&[_]Feature{}),
1033 }),
1034 };1022 };
1035 result[@enumToInt(Feature.ImageBuffer)] = .{1023 result[@enumToInt(Feature.ImageBuffer)] = .{
1036 .llvm_name = null,1024 .llvm_name = null,
...@@ -1220,8 +1208,7 @@ pub const all_features = blk: {...@@ -1220,8 +1208,7 @@ pub const all_features = blk: {
1220 result[@enumToInt(Feature.SubgroupBallotKHR)] = .{1208 result[@enumToInt(Feature.SubgroupBallotKHR)] = .{
1221 .llvm_name = null,1209 .llvm_name = null,
1222 .description = "Enable SPIR-V capability SubgroupBallotKHR",1210 .description = "Enable SPIR-V capability SubgroupBallotKHR",
1223 .dependencies = featureSet(&[_]Feature{1211 .dependencies = featureSet(&[_]Feature{}),
1224 }),
1225 };1212 };
1226 result[@enumToInt(Feature.DrawParameters)] = .{1213 result[@enumToInt(Feature.DrawParameters)] = .{
1227 .llvm_name = null,1214 .llvm_name = null,
...@@ -1255,8 +1242,7 @@ pub const all_features = blk: {...@@ -1255,8 +1242,7 @@ pub const all_features = blk: {
1255 result[@enumToInt(Feature.SubgroupVoteKHR)] = .{1242 result[@enumToInt(Feature.SubgroupVoteKHR)] = .{
1256 .llvm_name = null,1243 .llvm_name = null,
1257 .description = "Enable SPIR-V capability SubgroupVoteKHR",1244 .description = "Enable SPIR-V capability SubgroupVoteKHR",
1258 .dependencies = featureSet(&[_]Feature{1245 .dependencies = featureSet(&[_]Feature{}),
1259 }),
1260 };1246 };
1261 result[@enumToInt(Feature.StorageBuffer16BitAccess)] = .{1247 result[@enumToInt(Feature.StorageBuffer16BitAccess)] = .{
1262 .llvm_name = null,1248 .llvm_name = null,
...@@ -1338,14 +1324,12 @@ pub const all_features = blk: {...@@ -1338,14 +1324,12 @@ pub const all_features = blk: {
1338 result[@enumToInt(Feature.AtomicStorageOps)] = .{1324 result[@enumToInt(Feature.AtomicStorageOps)] = .{
1339 .llvm_name = null,1325 .llvm_name = null,
1340 .description = "Enable SPIR-V capability AtomicStorageOps",1326 .description = "Enable SPIR-V capability AtomicStorageOps",
1341 .dependencies = featureSet(&[_]Feature{1327 .dependencies = featureSet(&[_]Feature{}),
1342 }),
1343 };1328 };
1344 result[@enumToInt(Feature.SampleMaskPostDepthCoverage)] = .{1329 result[@enumToInt(Feature.SampleMaskPostDepthCoverage)] = .{
1345 .llvm_name = null,1330 .llvm_name = null,
1346 .description = "Enable SPIR-V capability SampleMaskPostDepthCoverage",1331 .description = "Enable SPIR-V capability SampleMaskPostDepthCoverage",
1347 .dependencies = featureSet(&[_]Feature{1332 .dependencies = featureSet(&[_]Feature{}),
1348 }),
1349 };1333 };
1350 result[@enumToInt(Feature.StorageBuffer8BitAccess)] = .{1334 result[@enumToInt(Feature.StorageBuffer8BitAccess)] = .{
1351 .llvm_name = null,1335 .llvm_name = null,
...@@ -1548,20 +1532,17 @@ pub const all_features = blk: {...@@ -1548,20 +1532,17 @@ pub const all_features = blk: {
1548 result[@enumToInt(Feature.ImageFootprintNV)] = .{1532 result[@enumToInt(Feature.ImageFootprintNV)] = .{
1549 .llvm_name = null,1533 .llvm_name = null,
1550 .description = "Enable SPIR-V capability ImageFootprintNV",1534 .description = "Enable SPIR-V capability ImageFootprintNV",
1551 .dependencies = featureSet(&[_]Feature{1535 .dependencies = featureSet(&[_]Feature{}),
1552 }),
1553 };1536 };
1554 result[@enumToInt(Feature.FragmentBarycentricNV)] = .{1537 result[@enumToInt(Feature.FragmentBarycentricNV)] = .{
1555 .llvm_name = null,1538 .llvm_name = null,
1556 .description = "Enable SPIR-V capability FragmentBarycentricNV",1539 .description = "Enable SPIR-V capability FragmentBarycentricNV",
1557 .dependencies = featureSet(&[_]Feature{1540 .dependencies = featureSet(&[_]Feature{}),
1558 }),
1559 };1541 };
1560 result[@enumToInt(Feature.ComputeDerivativeGroupQuadsNV)] = .{1542 result[@enumToInt(Feature.ComputeDerivativeGroupQuadsNV)] = .{
1561 .llvm_name = null,1543 .llvm_name = null,
1562 .description = "Enable SPIR-V capability ComputeDerivativeGroupQuadsNV",1544 .description = "Enable SPIR-V capability ComputeDerivativeGroupQuadsNV",
1563 .dependencies = featureSet(&[_]Feature{1545 .dependencies = featureSet(&[_]Feature{}),
1564 }),
1565 };1546 };
1566 result[@enumToInt(Feature.FragmentDensityEXT)] = .{1547 result[@enumToInt(Feature.FragmentDensityEXT)] = .{
1567 .llvm_name = null,1548 .llvm_name = null,
...@@ -1580,8 +1561,7 @@ pub const all_features = blk: {...@@ -1580,8 +1561,7 @@ pub const all_features = blk: {
1580 result[@enumToInt(Feature.GroupNonUniformPartitionedNV)] = .{1561 result[@enumToInt(Feature.GroupNonUniformPartitionedNV)] = .{
1581 .llvm_name = null,1562 .llvm_name = null,
1582 .description = "Enable SPIR-V capability GroupNonUniformPartitionedNV",1563 .description = "Enable SPIR-V capability GroupNonUniformPartitionedNV",
1583 .dependencies = featureSet(&[_]Feature{1564 .dependencies = featureSet(&[_]Feature{}),
1584 }),
1585 };1565 };
1586 result[@enumToInt(Feature.ShaderNonUniform)] = .{1566 result[@enumToInt(Feature.ShaderNonUniform)] = .{
1587 .llvm_name = null,1567 .llvm_name = null,
...@@ -1835,8 +1815,7 @@ pub const all_features = blk: {...@@ -1835,8 +1815,7 @@ pub const all_features = blk: {
1835 result[@enumToInt(Feature.ComputeDerivativeGroupLinearNV)] = .{1815 result[@enumToInt(Feature.ComputeDerivativeGroupLinearNV)] = .{
1836 .llvm_name = null,1816 .llvm_name = null,
1837 .description = "Enable SPIR-V capability ComputeDerivativeGroupLinearNV",1817 .description = "Enable SPIR-V capability ComputeDerivativeGroupLinearNV",
1838 .dependencies = featureSet(&[_]Feature{1818 .dependencies = featureSet(&[_]Feature{}),
1839 }),
1840 };1819 };
1841 result[@enumToInt(Feature.RayTracingProvisionalKHR)] = .{1820 result[@enumToInt(Feature.RayTracingProvisionalKHR)] = .{
1842 .llvm_name = null,1821 .llvm_name = null,
...@@ -1890,38 +1869,32 @@ pub const all_features = blk: {...@@ -1890,38 +1869,32 @@ pub const all_features = blk: {
1890 result[@enumToInt(Feature.SubgroupShuffleINTEL)] = .{1869 result[@enumToInt(Feature.SubgroupShuffleINTEL)] = .{
1891 .llvm_name = null,1870 .llvm_name = null,
1892 .description = "Enable SPIR-V capability SubgroupShuffleINTEL",1871 .description = "Enable SPIR-V capability SubgroupShuffleINTEL",
1893 .dependencies = featureSet(&[_]Feature{1872 .dependencies = featureSet(&[_]Feature{}),
1894 }),
1895 };1873 };
1896 result[@enumToInt(Feature.SubgroupBufferBlockIOINTEL)] = .{1874 result[@enumToInt(Feature.SubgroupBufferBlockIOINTEL)] = .{
1897 .llvm_name = null,1875 .llvm_name = null,
1898 .description = "Enable SPIR-V capability SubgroupBufferBlockIOINTEL",1876 .description = "Enable SPIR-V capability SubgroupBufferBlockIOINTEL",
1899 .dependencies = featureSet(&[_]Feature{1877 .dependencies = featureSet(&[_]Feature{}),
1900 }),
1901 };1878 };
1902 result[@enumToInt(Feature.SubgroupImageBlockIOINTEL)] = .{1879 result[@enumToInt(Feature.SubgroupImageBlockIOINTEL)] = .{
1903 .llvm_name = null,1880 .llvm_name = null,
1904 .description = "Enable SPIR-V capability SubgroupImageBlockIOINTEL",1881 .description = "Enable SPIR-V capability SubgroupImageBlockIOINTEL",
1905 .dependencies = featureSet(&[_]Feature{1882 .dependencies = featureSet(&[_]Feature{}),
1906 }),
1907 };1883 };
1908 result[@enumToInt(Feature.SubgroupImageMediaBlockIOINTEL)] = .{1884 result[@enumToInt(Feature.SubgroupImageMediaBlockIOINTEL)] = .{
1909 .llvm_name = null,1885 .llvm_name = null,
1910 .description = "Enable SPIR-V capability SubgroupImageMediaBlockIOINTEL",1886 .description = "Enable SPIR-V capability SubgroupImageMediaBlockIOINTEL",
1911 .dependencies = featureSet(&[_]Feature{1887 .dependencies = featureSet(&[_]Feature{}),
1912 }),
1913 };1888 };
1914 result[@enumToInt(Feature.RoundToInfinityINTEL)] = .{1889 result[@enumToInt(Feature.RoundToInfinityINTEL)] = .{
1915 .llvm_name = null,1890 .llvm_name = null,
1916 .description = "Enable SPIR-V capability RoundToInfinityINTEL",1891 .description = "Enable SPIR-V capability RoundToInfinityINTEL",
1917 .dependencies = featureSet(&[_]Feature{1892 .dependencies = featureSet(&[_]Feature{}),
1918 }),
1919 };1893 };
1920 result[@enumToInt(Feature.FloatingPointModeINTEL)] = .{1894 result[@enumToInt(Feature.FloatingPointModeINTEL)] = .{
1921 .llvm_name = null,1895 .llvm_name = null,
1922 .description = "Enable SPIR-V capability FloatingPointModeINTEL",1896 .description = "Enable SPIR-V capability FloatingPointModeINTEL",
1923 .dependencies = featureSet(&[_]Feature{1897 .dependencies = featureSet(&[_]Feature{}),
1924 }),
1925 };1898 };
1926 result[@enumToInt(Feature.IntegerFunctions2INTEL)] = .{1899 result[@enumToInt(Feature.IntegerFunctions2INTEL)] = .{
1927 .llvm_name = null,1900 .llvm_name = null,
...@@ -1933,38 +1906,32 @@ pub const all_features = blk: {...@@ -1933,38 +1906,32 @@ pub const all_features = blk: {
1933 result[@enumToInt(Feature.FunctionPointersINTEL)] = .{1906 result[@enumToInt(Feature.FunctionPointersINTEL)] = .{
1934 .llvm_name = null,1907 .llvm_name = null,
1935 .description = "Enable SPIR-V capability FunctionPointersINTEL",1908 .description = "Enable SPIR-V capability FunctionPointersINTEL",
1936 .dependencies = featureSet(&[_]Feature{1909 .dependencies = featureSet(&[_]Feature{}),
1937 }),
1938 };1910 };
1939 result[@enumToInt(Feature.IndirectReferencesINTEL)] = .{1911 result[@enumToInt(Feature.IndirectReferencesINTEL)] = .{
1940 .llvm_name = null,1912 .llvm_name = null,
1941 .description = "Enable SPIR-V capability IndirectReferencesINTEL",1913 .description = "Enable SPIR-V capability IndirectReferencesINTEL",
1942 .dependencies = featureSet(&[_]Feature{1914 .dependencies = featureSet(&[_]Feature{}),
1943 }),
1944 };1915 };
1945 result[@enumToInt(Feature.AsmINTEL)] = .{1916 result[@enumToInt(Feature.AsmINTEL)] = .{
1946 .llvm_name = null,1917 .llvm_name = null,
1947 .description = "Enable SPIR-V capability AsmINTEL",1918 .description = "Enable SPIR-V capability AsmINTEL",
1948 .dependencies = featureSet(&[_]Feature{1919 .dependencies = featureSet(&[_]Feature{}),
1949 }),
1950 };1920 };
1951 result[@enumToInt(Feature.AtomicFloat32MinMaxEXT)] = .{1921 result[@enumToInt(Feature.AtomicFloat32MinMaxEXT)] = .{
1952 .llvm_name = null,1922 .llvm_name = null,
1953 .description = "Enable SPIR-V capability AtomicFloat32MinMaxEXT",1923 .description = "Enable SPIR-V capability AtomicFloat32MinMaxEXT",
1954 .dependencies = featureSet(&[_]Feature{1924 .dependencies = featureSet(&[_]Feature{}),
1955 }),
1956 };1925 };
1957 result[@enumToInt(Feature.AtomicFloat64MinMaxEXT)] = .{1926 result[@enumToInt(Feature.AtomicFloat64MinMaxEXT)] = .{
1958 .llvm_name = null,1927 .llvm_name = null,
1959 .description = "Enable SPIR-V capability AtomicFloat64MinMaxEXT",1928 .description = "Enable SPIR-V capability AtomicFloat64MinMaxEXT",
1960 .dependencies = featureSet(&[_]Feature{1929 .dependencies = featureSet(&[_]Feature{}),
1961 }),
1962 };1930 };
1963 result[@enumToInt(Feature.AtomicFloat16MinMaxEXT)] = .{1931 result[@enumToInt(Feature.AtomicFloat16MinMaxEXT)] = .{
1964 .llvm_name = null,1932 .llvm_name = null,
1965 .description = "Enable SPIR-V capability AtomicFloat16MinMaxEXT",1933 .description = "Enable SPIR-V capability AtomicFloat16MinMaxEXT",
1966 .dependencies = featureSet(&[_]Feature{1934 .dependencies = featureSet(&[_]Feature{}),
1967 }),
1968 };1935 };
1969 result[@enumToInt(Feature.VectorComputeINTEL)] = .{1936 result[@enumToInt(Feature.VectorComputeINTEL)] = .{
1970 .llvm_name = null,1937 .llvm_name = null,
...@@ -1976,50 +1943,42 @@ pub const all_features = blk: {...@@ -1976,50 +1943,42 @@ pub const all_features = blk: {
1976 result[@enumToInt(Feature.VectorAnyINTEL)] = .{1943 result[@enumToInt(Feature.VectorAnyINTEL)] = .{
1977 .llvm_name = null,1944 .llvm_name = null,
1978 .description = "Enable SPIR-V capability VectorAnyINTEL",1945 .description = "Enable SPIR-V capability VectorAnyINTEL",
1979 .dependencies = featureSet(&[_]Feature{1946 .dependencies = featureSet(&[_]Feature{}),
1980 }),
1981 };1947 };
1982 result[@enumToInt(Feature.ExpectAssumeKHR)] = .{1948 result[@enumToInt(Feature.ExpectAssumeKHR)] = .{
1983 .llvm_name = null,1949 .llvm_name = null,
1984 .description = "Enable SPIR-V capability ExpectAssumeKHR",1950 .description = "Enable SPIR-V capability ExpectAssumeKHR",
1985 .dependencies = featureSet(&[_]Feature{1951 .dependencies = featureSet(&[_]Feature{}),
1986 }),
1987 };1952 };
1988 result[@enumToInt(Feature.SubgroupAvcMotionEstimationINTEL)] = .{1953 result[@enumToInt(Feature.SubgroupAvcMotionEstimationINTEL)] = .{
1989 .llvm_name = null,1954 .llvm_name = null,
1990 .description = "Enable SPIR-V capability SubgroupAvcMotionEstimationINTEL",1955 .description = "Enable SPIR-V capability SubgroupAvcMotionEstimationINTEL",
1991 .dependencies = featureSet(&[_]Feature{1956 .dependencies = featureSet(&[_]Feature{}),
1992 }),
1993 };1957 };
1994 result[@enumToInt(Feature.SubgroupAvcMotionEstimationIntraINTEL)] = .{1958 result[@enumToInt(Feature.SubgroupAvcMotionEstimationIntraINTEL)] = .{
1995 .llvm_name = null,1959 .llvm_name = null,
1996 .description = "Enable SPIR-V capability SubgroupAvcMotionEstimationIntraINTEL",1960 .description = "Enable SPIR-V capability SubgroupAvcMotionEstimationIntraINTEL",
1997 .dependencies = featureSet(&[_]Feature{1961 .dependencies = featureSet(&[_]Feature{}),
1998 }),
1999 };1962 };
2000 result[@enumToInt(Feature.SubgroupAvcMotionEstimationChromaINTEL)] = .{1963 result[@enumToInt(Feature.SubgroupAvcMotionEstimationChromaINTEL)] = .{
2001 .llvm_name = null,1964 .llvm_name = null,
2002 .description = "Enable SPIR-V capability SubgroupAvcMotionEstimationChromaINTEL",1965 .description = "Enable SPIR-V capability SubgroupAvcMotionEstimationChromaINTEL",
2003 .dependencies = featureSet(&[_]Feature{1966 .dependencies = featureSet(&[_]Feature{}),
2004 }),
2005 };1967 };
2006 result[@enumToInt(Feature.VariableLengthArrayINTEL)] = .{1968 result[@enumToInt(Feature.VariableLengthArrayINTEL)] = .{
2007 .llvm_name = null,1969 .llvm_name = null,
2008 .description = "Enable SPIR-V capability VariableLengthArrayINTEL",1970 .description = "Enable SPIR-V capability VariableLengthArrayINTEL",
2009 .dependencies = featureSet(&[_]Feature{1971 .dependencies = featureSet(&[_]Feature{}),
2010 }),
2011 };1972 };
2012 result[@enumToInt(Feature.FunctionFloatControlINTEL)] = .{1973 result[@enumToInt(Feature.FunctionFloatControlINTEL)] = .{
2013 .llvm_name = null,1974 .llvm_name = null,
2014 .description = "Enable SPIR-V capability FunctionFloatControlINTEL",1975 .description = "Enable SPIR-V capability FunctionFloatControlINTEL",
2015 .dependencies = featureSet(&[_]Feature{1976 .dependencies = featureSet(&[_]Feature{}),
2016 }),
2017 };1977 };
2018 result[@enumToInt(Feature.FPGAMemoryAttributesINTEL)] = .{1978 result[@enumToInt(Feature.FPGAMemoryAttributesINTEL)] = .{
2019 .llvm_name = null,1979 .llvm_name = null,
2020 .description = "Enable SPIR-V capability FPGAMemoryAttributesINTEL",1980 .description = "Enable SPIR-V capability FPGAMemoryAttributesINTEL",
2021 .dependencies = featureSet(&[_]Feature{1981 .dependencies = featureSet(&[_]Feature{}),
2022 }),
2023 };1982 };
2024 result[@enumToInt(Feature.FPFastMathModeINTEL)] = .{1983 result[@enumToInt(Feature.FPFastMathModeINTEL)] = .{
2025 .llvm_name = null,1984 .llvm_name = null,
...@@ -2031,80 +1990,67 @@ pub const all_features = blk: {...@@ -2031,80 +1990,67 @@ pub const all_features = blk: {
2031 result[@enumToInt(Feature.ArbitraryPrecisionIntegersINTEL)] = .{1990 result[@enumToInt(Feature.ArbitraryPrecisionIntegersINTEL)] = .{
2032 .llvm_name = null,1991 .llvm_name = null,
2033 .description = "Enable SPIR-V capability ArbitraryPrecisionIntegersINTEL",1992 .description = "Enable SPIR-V capability ArbitraryPrecisionIntegersINTEL",
2034 .dependencies = featureSet(&[_]Feature{1993 .dependencies = featureSet(&[_]Feature{}),
2035 }),
2036 };1994 };
2037 result[@enumToInt(Feature.UnstructuredLoopControlsINTEL)] = .{1995 result[@enumToInt(Feature.UnstructuredLoopControlsINTEL)] = .{
2038 .llvm_name = null,1996 .llvm_name = null,
2039 .description = "Enable SPIR-V capability UnstructuredLoopControlsINTEL",1997 .description = "Enable SPIR-V capability UnstructuredLoopControlsINTEL",
2040 .dependencies = featureSet(&[_]Feature{1998 .dependencies = featureSet(&[_]Feature{}),
2041 }),
2042 };1999 };
2043 result[@enumToInt(Feature.FPGALoopControlsINTEL)] = .{2000 result[@enumToInt(Feature.FPGALoopControlsINTEL)] = .{
2044 .llvm_name = null,2001 .llvm_name = null,
2045 .description = "Enable SPIR-V capability FPGALoopControlsINTEL",2002 .description = "Enable SPIR-V capability FPGALoopControlsINTEL",
2046 .dependencies = featureSet(&[_]Feature{2003 .dependencies = featureSet(&[_]Feature{}),
2047 }),
2048 };2004 };
2049 result[@enumToInt(Feature.KernelAttributesINTEL)] = .{2005 result[@enumToInt(Feature.KernelAttributesINTEL)] = .{
2050 .llvm_name = null,2006 .llvm_name = null,
2051 .description = "Enable SPIR-V capability KernelAttributesINTEL",2007 .description = "Enable SPIR-V capability KernelAttributesINTEL",
2052 .dependencies = featureSet(&[_]Feature{2008 .dependencies = featureSet(&[_]Feature{}),
2053 }),
2054 };2009 };
2055 result[@enumToInt(Feature.FPGAKernelAttributesINTEL)] = .{2010 result[@enumToInt(Feature.FPGAKernelAttributesINTEL)] = .{
2056 .llvm_name = null,2011 .llvm_name = null,
2057 .description = "Enable SPIR-V capability FPGAKernelAttributesINTEL",2012 .description = "Enable SPIR-V capability FPGAKernelAttributesINTEL",
2058 .dependencies = featureSet(&[_]Feature{2013 .dependencies = featureSet(&[_]Feature{}),
2059 }),
2060 };2014 };
2061 result[@enumToInt(Feature.FPGAMemoryAccessesINTEL)] = .{2015 result[@enumToInt(Feature.FPGAMemoryAccessesINTEL)] = .{
2062 .llvm_name = null,2016 .llvm_name = null,
2063 .description = "Enable SPIR-V capability FPGAMemoryAccessesINTEL",2017 .description = "Enable SPIR-V capability FPGAMemoryAccessesINTEL",
2064 .dependencies = featureSet(&[_]Feature{2018 .dependencies = featureSet(&[_]Feature{}),
2065 }),
2066 };2019 };
2067 result[@enumToInt(Feature.FPGAClusterAttributesINTEL)] = .{2020 result[@enumToInt(Feature.FPGAClusterAttributesINTEL)] = .{
2068 .llvm_name = null,2021 .llvm_name = null,
2069 .description = "Enable SPIR-V capability FPGAClusterAttributesINTEL",2022 .description = "Enable SPIR-V capability FPGAClusterAttributesINTEL",
2070 .dependencies = featureSet(&[_]Feature{2023 .dependencies = featureSet(&[_]Feature{}),
2071 }),
2072 };2024 };
2073 result[@enumToInt(Feature.LoopFuseINTEL)] = .{2025 result[@enumToInt(Feature.LoopFuseINTEL)] = .{
2074 .llvm_name = null,2026 .llvm_name = null,
2075 .description = "Enable SPIR-V capability LoopFuseINTEL",2027 .description = "Enable SPIR-V capability LoopFuseINTEL",
2076 .dependencies = featureSet(&[_]Feature{2028 .dependencies = featureSet(&[_]Feature{}),
2077 }),
2078 };2029 };
2079 result[@enumToInt(Feature.FPGABufferLocationINTEL)] = .{2030 result[@enumToInt(Feature.FPGABufferLocationINTEL)] = .{
2080 .llvm_name = null,2031 .llvm_name = null,
2081 .description = "Enable SPIR-V capability FPGABufferLocationINTEL",2032 .description = "Enable SPIR-V capability FPGABufferLocationINTEL",
2082 .dependencies = featureSet(&[_]Feature{2033 .dependencies = featureSet(&[_]Feature{}),
2083 }),
2084 };2034 };
2085 result[@enumToInt(Feature.USMStorageClassesINTEL)] = .{2035 result[@enumToInt(Feature.USMStorageClassesINTEL)] = .{
2086 .llvm_name = null,2036 .llvm_name = null,
2087 .description = "Enable SPIR-V capability USMStorageClassesINTEL",2037 .description = "Enable SPIR-V capability USMStorageClassesINTEL",
2088 .dependencies = featureSet(&[_]Feature{2038 .dependencies = featureSet(&[_]Feature{}),
2089 }),
2090 };2039 };
2091 result[@enumToInt(Feature.IOPipesINTEL)] = .{2040 result[@enumToInt(Feature.IOPipesINTEL)] = .{
2092 .llvm_name = null,2041 .llvm_name = null,
2093 .description = "Enable SPIR-V capability IOPipesINTEL",2042 .description = "Enable SPIR-V capability IOPipesINTEL",
2094 .dependencies = featureSet(&[_]Feature{2043 .dependencies = featureSet(&[_]Feature{}),
2095 }),
2096 };2044 };
2097 result[@enumToInt(Feature.BlockingPipesINTEL)] = .{2045 result[@enumToInt(Feature.BlockingPipesINTEL)] = .{
2098 .llvm_name = null,2046 .llvm_name = null,
2099 .description = "Enable SPIR-V capability BlockingPipesINTEL",2047 .description = "Enable SPIR-V capability BlockingPipesINTEL",
2100 .dependencies = featureSet(&[_]Feature{2048 .dependencies = featureSet(&[_]Feature{}),
2101 }),
2102 };2049 };
2103 result[@enumToInt(Feature.FPGARegINTEL)] = .{2050 result[@enumToInt(Feature.FPGARegINTEL)] = .{
2104 .llvm_name = null,2051 .llvm_name = null,
2105 .description = "Enable SPIR-V capability FPGARegINTEL",2052 .description = "Enable SPIR-V capability FPGARegINTEL",
2106 .dependencies = featureSet(&[_]Feature{2053 .dependencies = featureSet(&[_]Feature{}),
2107 }),
2108 };2054 };
2109 result[@enumToInt(Feature.AtomicFloat32AddEXT)] = .{2055 result[@enumToInt(Feature.AtomicFloat32AddEXT)] = .{
2110 .llvm_name = null,2056 .llvm_name = null,
...@@ -2123,8 +2069,7 @@ pub const all_features = blk: {...@@ -2123,8 +2069,7 @@ pub const all_features = blk: {
2123 result[@enumToInt(Feature.LongConstantCompositeINTEL)] = .{2069 result[@enumToInt(Feature.LongConstantCompositeINTEL)] = .{
2124 .llvm_name = null,2070 .llvm_name = null,
2125 .description = "Enable SPIR-V capability LongConstantCompositeINTEL",2071 .description = "Enable SPIR-V capability LongConstantCompositeINTEL",
2126 .dependencies = featureSet(&[_]Feature{2072 .dependencies = featureSet(&[_]Feature{}),
2127 }),
2128 };2073 };
2129 const ti = @typeInfo(Feature);2074 const ti = @typeInfo(Feature);
2130 for (result) |*elem, i| {2075 for (result) |*elem, i| {
lib/std/zig/system/x86.zig+2-2
...@@ -19,11 +19,11 @@ fn setFeature(cpu: *Target.Cpu, feature: Target.x86.Feature, enabled: bool) void...@@ -19,11 +19,11 @@ fn setFeature(cpu: *Target.Cpu, feature: Target.x86.Feature, enabled: bool) void
19 if (enabled) cpu.features.addFeature(idx) else cpu.features.removeFeature(idx);19 if (enabled) cpu.features.addFeature(idx) else cpu.features.removeFeature(idx);
20}20}
2121
22fn bit(input: u32, offset: u5) callconv(.Inline) bool {22inline fn bit(input: u32, offset: u5) bool {
23 return (input >> offset) & 1 != 0;23 return (input >> offset) & 1 != 0;
24}24}
2525
26fn hasMask(input: u32, mask: u32) callconv(.Inline) bool {26inline fn hasMask(input: u32, mask: u32) bool {
27 return (input & mask) == mask;27 return (input & mask) == mask;
28}28}
2929
src/DepTokenizer.zig+1-4
...@@ -275,10 +275,7 @@ fn errorIllegalChar(comptime id: std.meta.Tag(Token), index: usize, char: u8) To...@@ -275,10 +275,7 @@ fn errorIllegalChar(comptime id: std.meta.Tag(Token), index: usize, char: u8) To
275}275}
276276
277fn finishTarget(must_resolve: bool, bytes: []const u8) Token {277fn finishTarget(must_resolve: bool, bytes: []const u8) Token {
278 return if (must_resolve)278 return if (must_resolve) .{ .target_must_resolve = bytes } else .{ .target = bytes };
279 .{ .target_must_resolve = bytes }
280 else
281 .{ .target = bytes };
282}279}
283280
284const State = enum {281const State = enum {
src/libc_installation.zig+1-2
...@@ -286,8 +286,7 @@ pub const LibCInstallation = struct {...@@ -286,8 +286,7 @@ pub const LibCInstallation = struct {
286 else if (is_haiku)286 else if (is_haiku)
287 "posix/errno.h"287 "posix/errno.h"
288 else288 else
289 "sys/errno.h"289 "sys/errno.h";
290 ;
291290
292 var path_i: usize = 0;291 var path_i: usize = 0;
293 while (path_i < search_paths.items.len) : (path_i += 1) {292 while (path_i < search_paths.items.len) : (path_i += 1) {
src/link/MachO.zig+1-1
...@@ -2514,7 +2514,7 @@ fn allocatedSizeLinkedit(self: *MachO, start: u64) u64 {...@@ -2514,7 +2514,7 @@ fn allocatedSizeLinkedit(self: *MachO, start: u64) u64 {
2514 return min_pos - start;2514 return min_pos - start;
2515}2515}
25162516
2517fn checkForCollision(start: u64, end: u64, off: u64, size: u64) callconv(.Inline) ?u64 {2517inline fn checkForCollision(start: u64, end: u64, off: u64, size: u64) ?u64 {
2518 const increased_size = padToIdeal(size);2518 const increased_size = padToIdeal(size);
2519 const test_end = off + increased_size;2519 const test_end = off + increased_size;
2520 if (end > off and start < test_end) {2520 if (end > off and start < test_end) {
src/link/MachO/reloc/aarch64.zig+1-1
...@@ -585,7 +585,7 @@ pub const Parser = struct {...@@ -585,7 +585,7 @@ pub const Parser = struct {
585 }585 }
586};586};
587587
588fn isArithmeticOp(inst: *const [4]u8) callconv(.Inline) bool {588inline fn isArithmeticOp(inst: *const [4]u8) bool {
589 const group_decode = @truncate(u5, inst[3]);589 const group_decode = @truncate(u5, inst[3]);
590 return ((group_decode >> 2) == 4);590 return ((group_decode >> 2) == 4);
591}591}
src/tracy.zig+1-1
...@@ -31,7 +31,7 @@ pub const Ctx = if (enable) ___tracy_c_zone_context else struct {...@@ -31,7 +31,7 @@ pub const Ctx = if (enable) ___tracy_c_zone_context else struct {
31 pub fn end(self: Ctx) void {}31 pub fn end(self: Ctx) void {}
32};32};
3333
34pub fn trace(comptime src: std.builtin.SourceLocation) callconv(.Inline) Ctx {34pub inline fn trace(comptime src: std.builtin.SourceLocation) Ctx {
35 if (!enable) return .{};35 if (!enable) return .{};
3636
37 const loc: ___tracy_source_location_data = .{37 const loc: ___tracy_source_location_data = .{