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) {
6868};
6969
7070/// 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 {
7272 switch (std.Target.current.cpu.arch) {
7373 .i386, .x86_64 => {
7474 asm volatile ("pause" ::: "memory");
lib/std/bit_set.zig+5-5
......@@ -83,7 +83,7 @@ pub fn IntegerBitSet(comptime size: u16) type {
8383 }
8484
8585 /// 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 {
8787 return bit_length;
8888 }
8989
......@@ -310,7 +310,7 @@ pub fn ArrayBitSet(comptime MaskIntType: type, comptime size: usize) type {
310310 }
311311
312312 /// 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 {
314314 return bit_length;
315315 }
316316
......@@ -574,7 +574,7 @@ pub const DynamicBitSetUnmanaged = struct {
574574 }
575575
576576 /// 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 {
578578 return self.bit_length;
579579 }
580580
......@@ -789,7 +789,7 @@ pub const DynamicBitSet = struct {
789789 }
790790
791791 /// 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 {
793793 return self.unmanaged.capacity();
794794 }
795795
......@@ -969,7 +969,7 @@ fn BitSetIterator(comptime MaskInt: type, comptime options: IteratorOptions) typ
969969 // isn't a next word. If the next word is the
970970 // last word, mask off the padding bits so we
971971 // 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 {
973973 var word = switch (direction) {
974974 .forward => self.words_remain[0],
975975 .reverse => self.words_remain[self.words_remain.len - 1],
lib/std/c/builtins.zig+46-46
......@@ -6,136 +6,136 @@
66
77const std = @import("std");
88
9pub fn __builtin_bswap16(val: u16) callconv(.Inline) u16 {
9pub inline fn __builtin_bswap16(val: u16) u16 {
1010 return @byteSwap(u16, val);
1111}
12pub fn __builtin_bswap32(val: u32) callconv(.Inline) u32 {
12pub inline fn __builtin_bswap32(val: u32) u32 {
1313 return @byteSwap(u32, val);
1414}
15pub fn __builtin_bswap64(val: u64) callconv(.Inline) u64 {
15pub inline fn __builtin_bswap64(val: u64) u64 {
1616 return @byteSwap(u64, val);
1717}
1818
19pub fn __builtin_signbit(val: f64) callconv(.Inline) c_int {
19pub inline fn __builtin_signbit(val: f64) c_int {
2020 return @boolToInt(std.math.signbit(val));
2121}
22pub fn __builtin_signbitf(val: f32) callconv(.Inline) c_int {
22pub inline fn __builtin_signbitf(val: f32) c_int {
2323 return @boolToInt(std.math.signbit(val));
2424}
2525
26pub fn __builtin_popcount(val: c_uint) callconv(.Inline) c_int {
26pub inline fn __builtin_popcount(val: c_uint) c_int {
2727 // popcount of a c_uint will never exceed the capacity of a c_int
2828 @setRuntimeSafety(false);
2929 return @bitCast(c_int, @as(c_uint, @popCount(c_uint, val)));
3030}
31pub fn __builtin_ctz(val: c_uint) callconv(.Inline) c_int {
31pub inline fn __builtin_ctz(val: c_uint) c_int {
3232 // Returns the number of trailing 0-bits in val, starting at the least significant bit position.
3333 // In C if `val` is 0, the result is undefined; in zig it's the number of bits in a c_uint
3434 @setRuntimeSafety(false);
3535 return @bitCast(c_int, @as(c_uint, @ctz(c_uint, val)));
3636}
37pub fn __builtin_clz(val: c_uint) callconv(.Inline) c_int {
37pub inline fn __builtin_clz(val: c_uint) c_int {
3838 // Returns the number of leading 0-bits in x, starting at the most significant bit position.
3939 // In C if `val` is 0, the result is undefined; in zig it's the number of bits in a c_uint
4040 @setRuntimeSafety(false);
4141 return @bitCast(c_int, @as(c_uint, @clz(c_uint, val)));
4242}
4343
44pub fn __builtin_sqrt(val: f64) callconv(.Inline) f64 {
44pub inline fn __builtin_sqrt(val: f64) f64 {
4545 return @sqrt(val);
4646}
47pub fn __builtin_sqrtf(val: f32) callconv(.Inline) f32 {
47pub inline fn __builtin_sqrtf(val: f32) f32 {
4848 return @sqrt(val);
4949}
5050
51pub fn __builtin_sin(val: f64) callconv(.Inline) f64 {
51pub inline fn __builtin_sin(val: f64) f64 {
5252 return @sin(val);
5353}
54pub fn __builtin_sinf(val: f32) callconv(.Inline) f32 {
54pub inline fn __builtin_sinf(val: f32) f32 {
5555 return @sin(val);
5656}
57pub fn __builtin_cos(val: f64) callconv(.Inline) f64 {
57pub inline fn __builtin_cos(val: f64) f64 {
5858 return @cos(val);
5959}
60pub fn __builtin_cosf(val: f32) callconv(.Inline) f32 {
60pub inline fn __builtin_cosf(val: f32) f32 {
6161 return @cos(val);
6262}
6363
64pub fn __builtin_exp(val: f64) callconv(.Inline) f64 {
64pub inline fn __builtin_exp(val: f64) f64 {
6565 return @exp(val);
6666}
67pub fn __builtin_expf(val: f32) callconv(.Inline) f32 {
67pub inline fn __builtin_expf(val: f32) f32 {
6868 return @exp(val);
6969}
70pub fn __builtin_exp2(val: f64) callconv(.Inline) f64 {
70pub inline fn __builtin_exp2(val: f64) f64 {
7171 return @exp2(val);
7272}
73pub fn __builtin_exp2f(val: f32) callconv(.Inline) f32 {
73pub inline fn __builtin_exp2f(val: f32) f32 {
7474 return @exp2(val);
7575}
76pub fn __builtin_log(val: f64) callconv(.Inline) f64 {
76pub inline fn __builtin_log(val: f64) f64 {
7777 return @log(val);
7878}
79pub fn __builtin_logf(val: f32) callconv(.Inline) f32 {
79pub inline fn __builtin_logf(val: f32) f32 {
8080 return @log(val);
8181}
82pub fn __builtin_log2(val: f64) callconv(.Inline) f64 {
82pub inline fn __builtin_log2(val: f64) f64 {
8383 return @log2(val);
8484}
85pub fn __builtin_log2f(val: f32) callconv(.Inline) f32 {
85pub inline fn __builtin_log2f(val: f32) f32 {
8686 return @log2(val);
8787}
88pub fn __builtin_log10(val: f64) callconv(.Inline) f64 {
88pub inline fn __builtin_log10(val: f64) f64 {
8989 return @log10(val);
9090}
91pub fn __builtin_log10f(val: f32) callconv(.Inline) f32 {
91pub inline fn __builtin_log10f(val: f32) f32 {
9292 return @log10(val);
9393}
9494
9595// 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 {
9797 return std.math.absInt(val) catch std.math.minInt(c_int);
9898}
99pub fn __builtin_fabs(val: f64) callconv(.Inline) f64 {
99pub inline fn __builtin_fabs(val: f64) f64 {
100100 return @fabs(val);
101101}
102pub fn __builtin_fabsf(val: f32) callconv(.Inline) f32 {
102pub inline fn __builtin_fabsf(val: f32) f32 {
103103 return @fabs(val);
104104}
105105
106pub fn __builtin_floor(val: f64) callconv(.Inline) f64 {
106pub inline fn __builtin_floor(val: f64) f64 {
107107 return @floor(val);
108108}
109pub fn __builtin_floorf(val: f32) callconv(.Inline) f32 {
109pub inline fn __builtin_floorf(val: f32) f32 {
110110 return @floor(val);
111111}
112pub fn __builtin_ceil(val: f64) callconv(.Inline) f64 {
112pub inline fn __builtin_ceil(val: f64) f64 {
113113 return @ceil(val);
114114}
115pub fn __builtin_ceilf(val: f32) callconv(.Inline) f32 {
115pub inline fn __builtin_ceilf(val: f32) f32 {
116116 return @ceil(val);
117117}
118pub fn __builtin_trunc(val: f64) callconv(.Inline) f64 {
118pub inline fn __builtin_trunc(val: f64) f64 {
119119 return @trunc(val);
120120}
121pub fn __builtin_truncf(val: f32) callconv(.Inline) f32 {
121pub inline fn __builtin_truncf(val: f32) f32 {
122122 return @trunc(val);
123123}
124pub fn __builtin_round(val: f64) callconv(.Inline) f64 {
124pub inline fn __builtin_round(val: f64) f64 {
125125 return @round(val);
126126}
127pub fn __builtin_roundf(val: f32) callconv(.Inline) f32 {
127pub inline fn __builtin_roundf(val: f32) f32 {
128128 return @round(val);
129129}
130130
131pub fn __builtin_strlen(s: [*c]const u8) callconv(.Inline) usize {
131pub inline fn __builtin_strlen(s: [*c]const u8) usize {
132132 return std.mem.lenZ(s);
133133}
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 {
135135 return @as(c_int, std.cstr.cmp(s1, s2));
136136}
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 {
139139 // clang semantics match gcc's: https://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html
140140 // If it is not possible to determine which objects ptr points to at compile time,
141141 // __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
145145 unreachable;
146146}
147147
148pub fn __builtin___memset_chk(
148pub inline fn __builtin___memset_chk(
149149 dst: ?*c_void,
150150 val: c_int,
151151 len: usize,
152152 remaining: usize,
153) callconv(.Inline) ?*c_void {
153) ?*c_void {
154154 if (len > remaining) @panic("std.c.builtins.memset_chk called with len > remaining");
155155 return __builtin_memset(dst, val, len);
156156}
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 {
159159 const dst_cast = @ptrCast([*c]u8, dst);
160160 @memset(dst_cast, @bitCast(u8, @truncate(i8, val)), len);
161161 return dst;
162162}
163163
164pub fn __builtin___memcpy_chk(
164pub inline fn __builtin___memcpy_chk(
165165 noalias dst: ?*c_void,
166166 noalias src: ?*const c_void,
167167 len: usize,
168168 remaining: usize,
169) callconv(.Inline) ?*c_void {
169) ?*c_void {
170170 if (len > remaining) @panic("std.c.builtins.memcpy_chk called with len > remaining");
171171 return __builtin_memcpy(dst, src, len);
172172}
173173
174pub fn __builtin_memcpy(
174pub inline fn __builtin_memcpy(
175175 noalias dst: ?*c_void,
176176 noalias src: ?*const c_void,
177177 len: usize,
178) callconv(.Inline) ?*c_void {
178) ?*c_void {
179179 const dst_cast = @ptrCast([*c]u8, dst);
180180 const src_cast = @ptrCast([*c]const u8, src);
181181
......@@ -185,7 +185,7 @@ pub fn __builtin_memcpy(
185185
186186/// The return value of __builtin_expect is `expr`. `c` is the expected value
187187/// 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 {
189189 return expr;
190190}
191191
lib/std/compress/deflate.zig+1-1
......@@ -209,7 +209,7 @@ pub fn InflateStream(comptime ReaderType: type) type {
209209
210210 // Insert a single byte into the window.
211211 // Assumes there's enough space.
212 fn appendUnsafe(self: *WSelf, value: u8) callconv(.Inline) void {
212 inline fn appendUnsafe(self: *WSelf, value: u8) void {
213213 self.buf[self.wi] = value;
214214 self.wi = (self.wi + 1) & (self.buf.len - 1);
215215 self.el += 1;
lib/std/crypto/25519/curve25519.zig+2-2
......@@ -20,12 +20,12 @@ pub const Curve25519 = struct {
2020 x: Fe,
2121
2222 /// 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 {
2424 return .{ .x = Fe.fromBytes(s) };
2525 }
2626
2727 /// Encode a Curve25519 point.
28 pub fn toBytes(p: Curve25519) callconv(.Inline) [32]u8 {
28 pub inline fn toBytes(p: Curve25519) [32]u8 {
2929 return p.x.toBytes();
3030 }
3131
lib/std/crypto/25519/edwards25519.zig+3-3
......@@ -91,7 +91,7 @@ pub const Edwards25519 = struct {
9191 }
9292
9393 /// Flip the sign of the X coordinate.
94 pub fn neg(p: Edwards25519) callconv(.Inline) Edwards25519 {
94 pub inline fn neg(p: Edwards25519) Edwards25519 {
9595 return .{ .x = p.x.neg(), .y = p.y, .z = p.z, .t = p.t.neg() };
9696 }
9797
......@@ -136,14 +136,14 @@ pub const Edwards25519 = struct {
136136 return p.add(q.neg());
137137 }
138138
139 fn cMov(p: *Edwards25519, a: Edwards25519, c: u64) callconv(.Inline) void {
139 inline fn cMov(p: *Edwards25519, a: Edwards25519, c: u64) void {
140140 p.x.cMov(a.x, c);
141141 p.y.cMov(a.y, c);
142142 p.z.cMov(a.z, c);
143143 p.t.cMov(a.t, c);
144144 }
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 {
147147 var t = Edwards25519.identityElement;
148148 comptime var i: u8 = 1;
149149 inline while (i < pc.len) : (i += 1) {
lib/std/crypto/25519/field.zig+14-14
......@@ -56,7 +56,7 @@ pub const Fe = struct {
5656 pub const edwards25519sqrtam2 = Fe{ .limbs = .{ 1693982333959686, 608509411481997, 2235573344831311, 947681270984193, 266558006233600 } };
5757
5858 /// 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 {
6060 var reduced = fe;
6161 reduced.reduce();
6262 const limbs = reduced.limbs;
......@@ -64,7 +64,7 @@ pub const Fe = struct {
6464 }
6565
6666 /// 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 {
6868 return a.sub(b).isZero();
6969 }
7070
......@@ -168,7 +168,7 @@ pub const Fe = struct {
168168 }
169169
170170 /// 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 {
172172 var fe: Fe = undefined;
173173 comptime var i = 0;
174174 inline while (i < 5) : (i += 1) {
......@@ -178,7 +178,7 @@ pub const Fe = struct {
178178 }
179179
180180 /// 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 {
182182 var fe = b;
183183 comptime var i = 0;
184184 inline while (i < 4) : (i += 1) {
......@@ -197,17 +197,17 @@ pub const Fe = struct {
197197 }
198198
199199 /// Negate a field element
200 pub fn neg(a: Fe) callconv(.Inline) Fe {
200 pub inline fn neg(a: Fe) Fe {
201201 return zero.sub(a);
202202 }
203203
204204 /// 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 {
206206 return (a.toBytes()[0] & 1) != 0;
207207 }
208208
209209 /// 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 {
211211 const mask: u64 = 0 -% c;
212212 var x = fe.*;
213213 comptime var i = 0;
......@@ -248,7 +248,7 @@ pub const Fe = struct {
248248 }
249249 }
250250
251 fn _carry128(r: *[5]u128) callconv(.Inline) Fe {
251 inline fn _carry128(r: *[5]u128) Fe {
252252 var rs: [5]u64 = undefined;
253253 comptime var i = 0;
254254 inline while (i < 4) : (i += 1) {
......@@ -269,7 +269,7 @@ pub const Fe = struct {
269269 }
270270
271271 /// 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 {
273273 var ax: [5]u128 = undefined;
274274 var bx: [5]u128 = undefined;
275275 var a19: [5]u128 = undefined;
......@@ -292,7 +292,7 @@ pub const Fe = struct {
292292 return _carry128(&r);
293293 }
294294
295 fn _sq(a: Fe, comptime double: bool) callconv(.Inline) Fe {
295 inline fn _sq(a: Fe, comptime double: bool) Fe {
296296 var ax: [5]u128 = undefined;
297297 var r: [5]u128 = undefined;
298298 comptime var i = 0;
......@@ -321,17 +321,17 @@ pub const Fe = struct {
321321 }
322322
323323 /// Square a field element
324 pub fn sq(a: Fe) callconv(.Inline) Fe {
324 pub inline fn sq(a: Fe) Fe {
325325 return _sq(a, false);
326326 }
327327
328328 /// Square and double a field element
329 pub fn sq2(a: Fe) callconv(.Inline) Fe {
329 pub inline fn sq2(a: Fe) Fe {
330330 return _sq(a, true);
331331 }
332332
333333 /// 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 {
335335 const sn = @intCast(u128, n);
336336 var fe: Fe = undefined;
337337 var x: u128 = 0;
......@@ -346,7 +346,7 @@ pub const Fe = struct {
346346 }
347347
348348 /// 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 {
350350 var i: usize = 0;
351351 var fe = a;
352352 while (i < n) : (i += 1) {
lib/std/crypto/25519/ristretto255.zig+4-4
......@@ -47,7 +47,7 @@ pub const Ristretto255 = struct {
4747 }
4848
4949 /// Reject the neutral element.
50 pub fn rejectIdentity(p: Ristretto255) callconv(.Inline) IdentityElementError!void {
50 pub inline fn rejectIdentity(p: Ristretto255) IdentityElementError!void {
5151 return p.p.rejectIdentity();
5252 }
5353
......@@ -146,19 +146,19 @@ pub const Ristretto255 = struct {
146146 }
147147
148148 /// Double a Ristretto255 element.
149 pub fn dbl(p: Ristretto255) callconv(.Inline) Ristretto255 {
149 pub inline fn dbl(p: Ristretto255) Ristretto255 {
150150 return .{ .p = p.p.dbl() };
151151 }
152152
153153 /// 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 {
155155 return .{ .p = p.p.add(q.p) };
156156 }
157157
158158 /// Multiply a Ristretto255 element with a scalar.
159159 /// Return error.WeakPublicKey if the resulting element is
160160 /// 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 {
162162 return Ristretto255{ .p = try p.p.mul(s) };
163163 }
164164
lib/std/crypto/25519/scalar.zig+1-1
......@@ -48,7 +48,7 @@ pub fn reduce64(s: [64]u8) [32]u8 {
4848
4949/// Perform the X25519 "clamping" operation.
5050/// 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 {
5252 s[0] &= 248;
5353 s[31] = (s[31] & 127) | 64;
5454}
lib/std/crypto/aegis.zig+2-2
......@@ -36,7 +36,7 @@ const State128L = struct {
3636 return state;
3737 }
3838
39 fn update(state: *State128L, d1: AesBlock, d2: AesBlock) callconv(.Inline) void {
39 inline fn update(state: *State128L, d1: AesBlock, d2: AesBlock) void {
4040 const blocks = &state.blocks;
4141 const tmp = blocks[7];
4242 comptime var i: usize = 7;
......@@ -208,7 +208,7 @@ const State256 = struct {
208208 return state;
209209 }
210210
211 fn update(state: *State256, d: AesBlock) callconv(.Inline) void {
211 inline fn update(state: *State256, d: AesBlock) void {
212212 const blocks = &state.blocks;
213213 const tmp = blocks[5].encrypt(blocks[0]);
214214 comptime var i: usize = 5;
lib/std/crypto/aes/aesni.zig+16-16
......@@ -19,24 +19,24 @@ pub const Block = struct {
1919 repr: BlockVec,
2020
2121 /// 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 {
2323 const repr = mem.bytesToValue(BlockVec, bytes);
2424 return Block{ .repr = repr };
2525 }
2626
2727 /// 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 {
2929 return mem.toBytes(block.repr);
3030 }
3131
3232 /// 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 {
3434 const x = block.repr ^ fromBytes(bytes).repr;
3535 return mem.toBytes(x);
3636 }
3737
3838 /// 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 {
4040 return Block{
4141 .repr = asm (
4242 \\ vaesenc %[rk], %[in], %[out]
......@@ -48,7 +48,7 @@ pub const Block = struct {
4848 }
4949
5050 /// 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 {
5252 return Block{
5353 .repr = asm (
5454 \\ vaesenclast %[rk], %[in], %[out]
......@@ -60,7 +60,7 @@ pub const Block = struct {
6060 }
6161
6262 /// 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 {
6464 return Block{
6565 .repr = asm (
6666 \\ vaesdec %[rk], %[in], %[out]
......@@ -72,7 +72,7 @@ pub const Block = struct {
7272 }
7373
7474 /// 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 {
7676 return Block{
7777 .repr = asm (
7878 \\ vaesdeclast %[rk], %[in], %[out]
......@@ -84,17 +84,17 @@ pub const Block = struct {
8484 }
8585
8686 /// 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 {
8888 return Block{ .repr = block1.repr ^ block2.repr };
8989 }
9090
9191 /// 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 {
9393 return Block{ .repr = block1.repr & block2.repr };
9494 }
9595
9696 /// 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 {
9898 return Block{ .repr = block1.repr | block2.repr };
9999 }
100100
......@@ -114,7 +114,7 @@ pub const Block = struct {
114114 };
115115
116116 /// 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 {
118118 comptime var i = 0;
119119 var out: [count]Block = undefined;
120120 inline while (i < count) : (i += 1) {
......@@ -124,7 +124,7 @@ pub const Block = struct {
124124 }
125125
126126 /// 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 {
128128 comptime var i = 0;
129129 var out: [count]Block = undefined;
130130 inline while (i < count) : (i += 1) {
......@@ -134,7 +134,7 @@ pub const Block = struct {
134134 }
135135
136136 /// 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 {
138138 comptime var i = 0;
139139 var out: [count]Block = undefined;
140140 inline while (i < count) : (i += 1) {
......@@ -144,7 +144,7 @@ pub const Block = struct {
144144 }
145145
146146 /// 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 {
148148 comptime var i = 0;
149149 var out: [count]Block = undefined;
150150 inline while (i < count) : (i += 1) {
......@@ -154,7 +154,7 @@ pub const Block = struct {
154154 }
155155
156156 /// 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 {
158158 comptime var i = 0;
159159 var out: [count]Block = undefined;
160160 inline while (i < count) : (i += 1) {
......@@ -164,7 +164,7 @@ pub const Block = struct {
164164 }
165165
166166 /// 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 {
168168 comptime var i = 0;
169169 var out: [count]Block = undefined;
170170 inline while (i < count) : (i += 1) {
lib/std/crypto/aes/armcrypto.zig+16-16
......@@ -19,18 +19,18 @@ pub const Block = struct {
1919 repr: BlockVec,
2020
2121 /// 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 {
2323 const repr = mem.bytesToValue(BlockVec, bytes);
2424 return Block{ .repr = repr };
2525 }
2626
2727 /// 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 {
2929 return mem.toBytes(block.repr);
3030 }
3131
3232 /// 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 {
3434 const x = block.repr ^ fromBytes(bytes).repr;
3535 return mem.toBytes(x);
3636 }
......@@ -38,7 +38,7 @@ pub const Block = struct {
3838 const zero = Vector(2, u64){ 0, 0 };
3939
4040 /// 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 {
4242 return Block{
4343 .repr = asm (
4444 \\ mov %[out].16b, %[in].16b
......@@ -54,7 +54,7 @@ pub const Block = struct {
5454 }
5555
5656 /// 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 {
5858 return Block{
5959 .repr = asm (
6060 \\ mov %[out].16b, %[in].16b
......@@ -69,7 +69,7 @@ pub const Block = struct {
6969 }
7070
7171 /// 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 {
7373 return Block{
7474 .repr = asm (
7575 \\ mov %[out].16b, %[in].16b
......@@ -85,7 +85,7 @@ pub const Block = struct {
8585 }
8686
8787 /// 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 {
8989 return Block{
9090 .repr = asm (
9191 \\ mov %[out].16b, %[in].16b
......@@ -100,17 +100,17 @@ pub const Block = struct {
100100 }
101101
102102 /// 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 {
104104 return Block{ .repr = block1.repr ^ block2.repr };
105105 }
106106
107107 /// 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 {
109109 return Block{ .repr = block1.repr & block2.repr };
110110 }
111111
112112 /// 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 {
114114 return Block{ .repr = block1.repr | block2.repr };
115115 }
116116
......@@ -120,7 +120,7 @@ pub const Block = struct {
120120 pub const optimal_parallel_blocks = 8;
121121
122122 /// 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 {
124124 comptime var i = 0;
125125 var out: [count]Block = undefined;
126126 inline while (i < count) : (i += 1) {
......@@ -130,7 +130,7 @@ pub const Block = struct {
130130 }
131131
132132 /// 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 {
134134 comptime var i = 0;
135135 var out: [count]Block = undefined;
136136 inline while (i < count) : (i += 1) {
......@@ -140,7 +140,7 @@ pub const Block = struct {
140140 }
141141
142142 /// 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 {
144144 comptime var i = 0;
145145 var out: [count]Block = undefined;
146146 inline while (i < count) : (i += 1) {
......@@ -150,7 +150,7 @@ pub const Block = struct {
150150 }
151151
152152 /// 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 {
154154 comptime var i = 0;
155155 var out: [count]Block = undefined;
156156 inline while (i < count) : (i += 1) {
......@@ -160,7 +160,7 @@ pub const Block = struct {
160160 }
161161
162162 /// 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 {
164164 comptime var i = 0;
165165 var out: [count]Block = undefined;
166166 inline while (i < count) : (i += 1) {
......@@ -170,7 +170,7 @@ pub const Block = struct {
170170 }
171171
172172 /// 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 {
174174 comptime var i = 0;
175175 var out: [count]Block = undefined;
176176 inline while (i < count) : (i += 1) {
lib/std/crypto/aes/soft.zig+10-10
......@@ -18,7 +18,7 @@ pub const Block = struct {
1818 repr: BlockVec align(16),
1919
2020 /// 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 {
2222 const s0 = mem.readIntBig(u32, bytes[0..4]);
2323 const s1 = mem.readIntBig(u32, bytes[4..8]);
2424 const s2 = mem.readIntBig(u32, bytes[8..12]);
......@@ -27,7 +27,7 @@ pub const Block = struct {
2727 }
2828
2929 /// 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 {
3131 var bytes: [16]u8 = undefined;
3232 mem.writeIntBig(u32, bytes[0..4], block.repr[0]);
3333 mem.writeIntBig(u32, bytes[4..8], block.repr[1]);
......@@ -37,7 +37,7 @@ pub const Block = struct {
3737 }
3838
3939 /// 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 {
4141 const block_bytes = block.toBytes();
4242 var x: [16]u8 = undefined;
4343 comptime var i: usize = 0;
......@@ -48,7 +48,7 @@ pub const Block = struct {
4848 }
4949
5050 /// 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 {
5252 const src = &block.repr;
5353
5454 const s0 = block.repr[0];
......@@ -65,7 +65,7 @@ pub const Block = struct {
6565 }
6666
6767 /// 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 {
6969 const src = &block.repr;
7070
7171 const t0 = block.repr[0];
......@@ -87,7 +87,7 @@ pub const Block = struct {
8787 }
8888
8989 /// 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 {
9191 const src = &block.repr;
9292
9393 const s0 = block.repr[0];
......@@ -104,7 +104,7 @@ pub const Block = struct {
104104 }
105105
106106 /// 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 {
108108 const src = &block.repr;
109109
110110 const t0 = block.repr[0];
......@@ -126,7 +126,7 @@ pub const Block = struct {
126126 }
127127
128128 /// 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 {
130130 var x: BlockVec = undefined;
131131 comptime var i = 0;
132132 inline while (i < 4) : (i += 1) {
......@@ -136,7 +136,7 @@ pub const Block = struct {
136136 }
137137
138138 /// 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 {
140140 var x: BlockVec = undefined;
141141 comptime var i = 0;
142142 inline while (i < 4) : (i += 1) {
......@@ -146,7 +146,7 @@ pub const Block = struct {
146146 }
147147
148148 /// 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 {
150150 var x: BlockVec = undefined;
151151 comptime var i = 0;
152152 inline while (i < 4) : (i += 1) {
lib/std/crypto/aes_ocb.zig+3-3
......@@ -33,7 +33,7 @@ fn AesOcb(comptime Aes: anytype) type {
3333 table: [56]Block align(16) = undefined,
3434 upto: usize,
3535
36 fn double(l: Block) callconv(.Inline) Block {
36 inline fn double(l: Block) Block {
3737 const l_ = mem.readIntBig(u128, &l);
3838 const l_2 = (l_ << 1) ^ (0x87 & -%(l_ >> 127));
3939 var l2: Block = undefined;
......@@ -245,7 +245,7 @@ fn AesOcb(comptime Aes: anytype) type {
245245 };
246246}
247247
248fn xorBlocks(x: Block, y: Block) callconv(.Inline) Block {
248inline fn xorBlocks(x: Block, y: Block) Block {
249249 var z: Block = x;
250250 for (z) |*v, i| {
251251 v.* = x[i] ^ y[i];
......@@ -253,7 +253,7 @@ fn xorBlocks(x: Block, y: Block) callconv(.Inline) Block {
253253 return z;
254254}
255255
256fn xorWith(x: *Block, y: Block) callconv(.Inline) void {
256inline fn xorWith(x: *Block, y: Block) void {
257257 for (x) |*v, i| {
258258 v.* ^= y[i];
259259 }
lib/std/crypto/blake3.zig+3-3
......@@ -66,7 +66,7 @@ const CompressVectorized = struct {
6666 const Lane = Vector(4, u32);
6767 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 {
7070 rows[0] +%= rows[1] +% m;
7171 rows[3] ^= rows[0];
7272 rows[3] = math.rotr(Lane, rows[3], if (even) 8 else 16);
......@@ -75,13 +75,13 @@ const CompressVectorized = struct {
7575 rows[1] = math.rotr(Lane, rows[1], if (even) 7 else 12);
7676 }
7777
78 fn diagonalize(rows: *Rows) callconv(.Inline) void {
78 inline fn diagonalize(rows: *Rows) void {
7979 rows[0] = @shuffle(u32, rows[0], undefined, [_]i32{ 3, 0, 1, 2 });
8080 rows[3] = @shuffle(u32, rows[3], undefined, [_]i32{ 2, 3, 0, 1 });
8181 rows[2] = @shuffle(u32, rows[2], undefined, [_]i32{ 1, 2, 3, 0 });
8282 }
8383
84 fn undiagonalize(rows: *Rows) callconv(.Inline) void {
84 inline fn undiagonalize(rows: *Rows) void {
8585 rows[0] = @shuffle(u32, rows[0], undefined, [_]i32{ 1, 2, 3, 0 });
8686 rows[3] = @shuffle(u32, rows[3], undefined, [_]i32{ 2, 3, 0, 1 });
8787 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 {
102102 };
103103 }
104104
105 fn chacha20Core(x: *BlockVec, input: BlockVec) callconv(.Inline) void {
105 inline fn chacha20Core(x: *BlockVec, input: BlockVec) void {
106106 x.* = input;
107107
108108 var r: usize = 0;
......@@ -147,7 +147,7 @@ fn ChaChaVecImpl(comptime rounds_nb: usize) type {
147147 }
148148 }
149149
150 fn hashToBytes(out: *[64]u8, x: BlockVec) callconv(.Inline) void {
150 inline fn hashToBytes(out: *[64]u8, x: BlockVec) void {
151151 var i: usize = 0;
152152 while (i < 4) : (i += 1) {
153153 mem.writeIntLittle(u32, out[16 * i + 0 ..][0..4], x[i][0]);
......@@ -157,7 +157,7 @@ fn ChaChaVecImpl(comptime rounds_nb: usize) type {
157157 }
158158 }
159159
160 fn contextFeedback(x: *BlockVec, ctx: BlockVec) callconv(.Inline) void {
160 inline fn contextFeedback(x: *BlockVec, ctx: BlockVec) void {
161161 x[0] +%= ctx[0];
162162 x[1] +%= ctx[1];
163163 x[2] +%= ctx[2];
......@@ -259,7 +259,7 @@ fn ChaChaNonVecImpl(comptime rounds_nb: usize) type {
259259 };
260260 }
261261
262 fn chacha20Core(x: *BlockVec, input: BlockVec) callconv(.Inline) void {
262 inline fn chacha20Core(x: *BlockVec, input: BlockVec) void {
263263 x.* = input;
264264
265265 const rounds = comptime [_]QuarterRound{
......@@ -288,7 +288,7 @@ fn ChaChaNonVecImpl(comptime rounds_nb: usize) type {
288288 }
289289 }
290290
291 fn hashToBytes(out: *[64]u8, x: BlockVec) callconv(.Inline) void {
291 inline fn hashToBytes(out: *[64]u8, x: BlockVec) void {
292292 var i: usize = 0;
293293 while (i < 4) : (i += 1) {
294294 mem.writeIntLittle(u32, out[16 * i + 0 ..][0..4], x[i * 4 + 0]);
......@@ -298,7 +298,7 @@ fn ChaChaNonVecImpl(comptime rounds_nb: usize) type {
298298 }
299299 }
300300
301 fn contextFeedback(x: *BlockVec, ctx: BlockVec) callconv(.Inline) void {
301 inline fn contextFeedback(x: *BlockVec, ctx: BlockVec) void {
302302 var i: usize = 0;
303303 while (i < 16) : (i += 1) {
304304 x[i] +%= ctx[i];
lib/std/crypto/ghash.zig+2-2
......@@ -95,7 +95,7 @@ pub const Ghash = struct {
9595 }
9696 }
9797
98 fn clmul_pclmul(x: u64, y: u64) callconv(.Inline) u64 {
98 inline fn clmul_pclmul(x: u64, y: u64) u64 {
9999 const Vector = std.meta.Vector;
100100 const product = asm (
101101 \\ vpclmulqdq $0x00, %[x], %[y], %[out]
......@@ -106,7 +106,7 @@ pub const Ghash = struct {
106106 return product[0];
107107 }
108108
109 fn clmul_pmull(x: u64, y: u64) callconv(.Inline) u64 {
109 inline fn clmul_pmull(x: u64, y: u64) u64 {
110110 const Vector = std.meta.Vector;
111111 const product = asm (
112112 \\ pmull %[out].1q, %[x].1d, %[y].1d
lib/std/crypto/gimli.zig+2-2
......@@ -49,7 +49,7 @@ pub const State = struct {
4949 return mem.asBytes(&self.data);
5050 }
5151
52 fn endianSwap(self: *Self) callconv(.Inline) void {
52 inline fn endianSwap(self: *Self) void {
5353 for (self.data) |*w| {
5454 w.* = mem.littleToNative(u32, w.*);
5555 }
......@@ -117,7 +117,7 @@ pub const State = struct {
117117
118118 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 {
121121 return x << @splat(4, @as(u5, n));
122122 }
123123
lib/std/crypto/pcurves/p256/p256_64.zig+4-4
......@@ -35,7 +35,7 @@ pub const Limbs = [4]u64;
3535/// Output Bounds:
3636/// out1: [0x0 ~> 0xffffffffffffffff]
3737/// 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 {
3939 @setRuntimeSafety(mode == .Debug);
4040
4141 var t: u64 = undefined;
......@@ -56,7 +56,7 @@ fn addcarryxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) callconv(
5656/// Output Bounds:
5757/// out1: [0x0 ~> 0xffffffffffffffff]
5858/// 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 {
6060 @setRuntimeSafety(mode == .Debug);
6161
6262 var t: u64 = undefined;
......@@ -76,7 +76,7 @@ fn subborrowxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) callconv
7676/// Output Bounds:
7777/// out1: [0x0 ~> 0xffffffffffffffff]
7878/// 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 {
8080 @setRuntimeSafety(mode == .Debug);
8181
8282 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
9494/// arg3: [0x0 ~> 0xffffffffffffffff]
9595/// Output Bounds:
9696/// 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 {
9898 @setRuntimeSafety(mode == .Debug);
9999
100100 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;
3535/// Output Bounds:
3636/// out1: [0x0 ~> 0xffffffffffffffff]
3737/// 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 {
3939 @setRuntimeSafety(mode == .Debug);
4040
4141 var t: u64 = undefined;
......@@ -56,7 +56,7 @@ fn addcarryxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) callconv(
5656/// Output Bounds:
5757/// out1: [0x0 ~> 0xffffffffffffffff]
5858/// 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 {
6060 @setRuntimeSafety(mode == .Debug);
6161
6262 var t: u64 = undefined;
......@@ -76,7 +76,7 @@ fn subborrowxU64(out1: *u64, out2: *u1, arg1: u1, arg2: u64, arg3: u64) callconv
7676/// Output Bounds:
7777/// out1: [0x0 ~> 0xffffffffffffffff]
7878/// 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 {
8080 @setRuntimeSafety(mode == .Debug);
8181
8282 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
9494/// arg3: [0x0 ~> 0xffffffffffffffff]
9595/// Output Bounds:
9696/// 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 {
9898 @setRuntimeSafety(mode == .Debug);
9999
100100 const mask = 0 -% @as(u64, arg1);
lib/std/crypto/salsa20.zig+3-3
......@@ -41,7 +41,7 @@ const Salsa20VecImpl = struct {
4141 };
4242 }
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 {
4545 const n1n2n3n0 = Lane{ input[3][1], input[3][2], input[3][3], input[3][0] };
4646 const n1n2 = Half{ n1n2n3n0[0], n1n2n3n0[1] };
4747 const n3n0 = Half{ n1n2n3n0[2], n1n2n3n0[3] };
......@@ -215,7 +215,7 @@ const Salsa20NonVecImpl = struct {
215215 d: u6,
216216 };
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 {
219219 return QuarterRound{
220220 .a = a,
221221 .b = b,
......@@ -224,7 +224,7 @@ const Salsa20NonVecImpl = struct {
224224 };
225225 }
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 {
228228 const arx_steps = comptime [_]QuarterRound{
229229 Rp(4, 0, 12, 7), Rp(8, 4, 0, 9), Rp(12, 8, 4, 13), Rp(0, 12, 8, 18),
230230 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 {
721721 r_offset: Elf32_Addr,
722722 r_info: Elf32_Word,
723723
724 pub fn r_sym(self: @This()) callconv(.Inline) u24 {
724 pub inline fn r_sym(self: @This()) u24 {
725725 return @truncate(u24, self.r_info >> 8);
726726 }
727 pub fn r_type(self: @This()) callconv(.Inline) u8 {
727 pub inline fn r_type(self: @This()) u8 {
728728 return @truncate(u8, self.r_info & 0xff);
729729 }
730730};
......@@ -732,10 +732,10 @@ pub const Elf64_Rel = extern struct {
732732 r_offset: Elf64_Addr,
733733 r_info: Elf64_Xword,
734734
735 pub fn r_sym(self: @This()) callconv(.Inline) u32 {
735 pub inline fn r_sym(self: @This()) u32 {
736736 return @truncate(u32, self.r_info >> 32);
737737 }
738 pub fn r_type(self: @This()) callconv(.Inline) u32 {
738 pub inline fn r_type(self: @This()) u32 {
739739 return @truncate(u32, self.r_info & 0xffffffff);
740740 }
741741};
......@@ -744,10 +744,10 @@ pub const Elf32_Rela = extern struct {
744744 r_info: Elf32_Word,
745745 r_addend: Elf32_Sword,
746746
747 pub fn r_sym(self: @This()) callconv(.Inline) u24 {
747 pub inline fn r_sym(self: @This()) u24 {
748748 return @truncate(u24, self.r_info >> 8);
749749 }
750 pub fn r_type(self: @This()) callconv(.Inline) u8 {
750 pub inline fn r_type(self: @This()) u8 {
751751 return @truncate(u8, self.r_info & 0xff);
752752 }
753753};
......@@ -756,10 +756,10 @@ pub const Elf64_Rela = extern struct {
756756 r_info: Elf64_Xword,
757757 r_addend: Elf64_Sxword,
758758
759 pub fn r_sym(self: @This()) callconv(.Inline) u32 {
759 pub inline fn r_sym(self: @This()) u32 {
760760 return @truncate(u32, self.r_info >> 32);
761761 }
762 pub fn r_type(self: @This()) callconv(.Inline) u32 {
762 pub inline fn r_type(self: @This()) u32 {
763763 return @truncate(u32, self.r_info & 0xffffffff);
764764 }
765765};
lib/std/fmt/parse_float.zig+4-4
......@@ -52,21 +52,21 @@ const Z96 = struct {
5252 d2: u32,
5353
5454 // d = s >> 1
55 fn shiftRight1(d: *Z96, s: Z96) callconv(.Inline) void {
55 inline fn shiftRight1(d: *Z96, s: Z96) void {
5656 d.d0 = (s.d0 >> 1) | ((s.d1 & 1) << 31);
5757 d.d1 = (s.d1 >> 1) | ((s.d2 & 1) << 31);
5858 d.d2 = s.d2 >> 1;
5959 }
6060
6161 // d = s << 1
62 fn shiftLeft1(d: *Z96, s: Z96) callconv(.Inline) void {
62 inline fn shiftLeft1(d: *Z96, s: Z96) void {
6363 d.d2 = (s.d2 << 1) | ((s.d1 & (1 << 31)) >> 31);
6464 d.d1 = (s.d1 << 1) | ((s.d0 & (1 << 31)) >> 31);
6565 d.d0 = s.d0 << 1;
6666 }
6767
6868 // d += s
69 fn add(d: *Z96, s: Z96) callconv(.Inline) void {
69 inline fn add(d: *Z96, s: Z96) void {
7070 var w = @as(u64, d.d0) + @as(u64, s.d0);
7171 d.d0 = @truncate(u32, w);
7272
......@@ -80,7 +80,7 @@ const Z96 = struct {
8080 }
8181
8282 // d -= s
83 fn sub(d: *Z96, s: Z96) callconv(.Inline) void {
83 inline fn sub(d: *Z96, s: Z96) void {
8484 var w = @as(u64, d.d0) -% @as(u64, s.d0);
8585 d.d0 = @truncate(u32, w);
8686
lib/std/hash/cityhash.zig+1-1
......@@ -6,7 +6,7 @@
66const std = @import("std");
77const 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 {
1010 // ptr + offset doesn't work at comptime so we need this instead.
1111 return @ptrCast([*]const u8, &ptr[offset]);
1212}
lib/std/json.zig+2-5
......@@ -2014,12 +2014,9 @@ test "parse into struct with duplicate field" {
20142014 const ballast = try testing.allocator.alloc(u64, 1);
20152015 defer testing.allocator.free(ballast);
20162016
2017 const options_first = ParseOptions{
2018 .allocator = testing.allocator,
2019 .duplicate_field_behavior = .UseFirst
2020 };
2017 const options_first = ParseOptions{ .allocator = testing.allocator, .duplicate_field_behavior = .UseFirst };
20212018
2022 const options_last = ParseOptions{
2019 const options_last = ParseOptions{
20232020 .allocator = testing.allocator,
20242021 .duplicate_field_behavior = .UseLast,
20252022 };
lib/std/math.zig+1-1
......@@ -1334,7 +1334,7 @@ test "math.comptime" {
13341334/// Returns a mask of all ones if value is true,
13351335/// and a mask of all zeroes if value is false.
13361336/// 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 {
13381338 if (@typeInfo(MaskInt) != .Int)
13391339 @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 {
3838
3939 /// Imaginary part.
4040 im: T,
41
41
4242 /// Deprecated, use init()
4343 pub const new = init;
4444
lib/std/os/bits/freebsd.zig+4-4
......@@ -823,16 +823,16 @@ pub const sigval = extern union {
823823pub const _SIG_WORDS = 4;
824824pub const _SIG_MAXSIG = 128;
825825
826pub fn _SIG_IDX(sig: usize) callconv(.Inline) usize {
826pub inline fn _SIG_IDX(sig: usize) usize {
827827 return sig - 1;
828828}
829pub fn _SIG_WORD(sig: usize) callconv(.Inline) usize {
829pub inline fn _SIG_WORD(sig: usize) usize {
830830 return_SIG_IDX(sig) >> 5;
831831}
832pub fn _SIG_BIT(sig: usize) callconv(.Inline) usize {
832pub inline fn _SIG_BIT(sig: usize) usize {
833833 return 1 << (_SIG_IDX(sig) & 31);
834834}
835pub fn _SIG_VALID(sig: usize) callconv(.Inline) usize {
835pub inline fn _SIG_VALID(sig: usize) usize {
836836 return sig <= _SIG_MAXSIG and sig > 0;
837837}
838838
lib/std/os/bits/haiku.zig+4-4
......@@ -721,16 +721,16 @@ pub const Sigaction = extern struct {
721721
722722pub const _SIG_WORDS = 4;
723723pub const _SIG_MAXSIG = 128;
724pub fn _SIG_IDX(sig: usize) callconv(.Inline) usize {
724pub inline fn _SIG_IDX(sig: usize) usize {
725725 return sig - 1;
726726}
727pub fn _SIG_WORD(sig: usize) callconv(.Inline) usize {
727pub inline fn _SIG_WORD(sig: usize) usize {
728728 return_SIG_IDX(sig) >> 5;
729729}
730pub fn _SIG_BIT(sig: usize) callconv(.Inline) usize {
730pub inline fn _SIG_BIT(sig: usize) usize {
731731 return 1 << (_SIG_IDX(sig) & 31);
732732}
733pub fn _SIG_VALID(sig: usize) callconv(.Inline) usize {
733pub inline fn _SIG_VALID(sig: usize) usize {
734734 return sig <= _SIG_MAXSIG and sig > 0;
735735}
736736
lib/std/os/bits/netbsd.zig+4-4
......@@ -804,16 +804,16 @@ pub const _ksiginfo = extern struct {
804804pub const _SIG_WORDS = 4;
805805pub const _SIG_MAXSIG = 128;
806806
807pub fn _SIG_IDX(sig: usize) callconv(.Inline) usize {
807pub inline fn _SIG_IDX(sig: usize) usize {
808808 return sig - 1;
809809}
810pub fn _SIG_WORD(sig: usize) callconv(.Inline) usize {
810pub inline fn _SIG_WORD(sig: usize) usize {
811811 return_SIG_IDX(sig) >> 5;
812812}
813pub fn _SIG_BIT(sig: usize) callconv(.Inline) usize {
813pub inline fn _SIG_BIT(sig: usize) usize {
814814 return 1 << (_SIG_IDX(sig) & 31);
815815}
816pub fn _SIG_VALID(sig: usize) callconv(.Inline) usize {
816pub inline fn _SIG_VALID(sig: usize) usize {
817817 return sig <= _SIG_MAXSIG and sig > 0;
818818}
819819
lib/std/os/linux.zig+1-1
......@@ -145,7 +145,7 @@ pub fn fork() usize {
145145/// It is advised to avoid this function and use clone instead, because
146146/// the compiler is not aware of how vfork affects control flow and you may
147147/// see different results in optimized builds.
148pub fn vfork() callconv(.Inline) usize {
148pub inline fn vfork() usize {
149149 return @call(.{ .modifier = .always_inline }, syscall0, .{.vfork});
150150}
151151
lib/std/os/linux/tls.zig+1-1
......@@ -307,7 +307,7 @@ fn initTLS() void {
307307 };
308308}
309309
310fn alignPtrCast(comptime T: type, ptr: [*]u8) callconv(.Inline) *T {
310inline fn alignPtrCast(comptime T: type, ptr: [*]u8) *T {
311311 return @ptrCast(*T, @alignCast(@alignOf(T), ptr));
312312}
313313
lib/std/os/windows.zig+1-1
......@@ -1745,7 +1745,7 @@ pub fn wToPrefixedFileW(s: []const u16) !PathSpace {
17451745 return path_space;
17461746}
17471747
1748fn MAKELANGID(p: c_ushort, s: c_ushort) callconv(.Inline) LANGID {
1748inline fn MAKELANGID(p: c_ushort, s: c_ushort) LANGID {
17491749 return (s << 10) | p;
17501750}
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
375375
376376// This is marked inline because for some reason LLVM in release mode fails to inline it,
377377// and we want fewer call frames in stack traces.
378fn initEventLoopAndCallMain() callconv(.Inline) u8 {
378inline fn initEventLoopAndCallMain() u8 {
379379 if (std.event.Loop.instance) |loop| {
380380 if (!@hasDecl(root, "event_loop")) {
381381 loop.init() catch |err| {
......@@ -404,7 +404,7 @@ fn initEventLoopAndCallMain() callconv(.Inline) u8 {
404404// and we want fewer call frames in stack traces.
405405// TODO This function is duplicated from initEventLoopAndCallMain instead of using generics
406406// because it is working around stage1 compiler bugs.
407fn initEventLoopAndCallWinMain() callconv(.Inline) std.os.windows.INT {
407inline fn initEventLoopAndCallWinMain() std.os.windows.INT {
408408 if (std.event.Loop.instance) |loop| {
409409 if (!@hasDecl(root, "event_loop")) {
410410 loop.init() catch |err| {
lib/std/target/spirv.zig+55-110
......@@ -732,8 +732,7 @@ pub const all_features = blk: {
732732 result[@enumToInt(Feature.Matrix)] = .{
733733 .llvm_name = null,
734734 .description = "Enable SPIR-V capability Matrix",
735 .dependencies = featureSet(&[_]Feature{
736 }),
735 .dependencies = featureSet(&[_]Feature{}),
737736 };
738737 result[@enumToInt(Feature.Shader)] = .{
739738 .llvm_name = null,
......@@ -759,20 +758,17 @@ pub const all_features = blk: {
759758 result[@enumToInt(Feature.Addresses)] = .{
760759 .llvm_name = null,
761760 .description = "Enable SPIR-V capability Addresses",
762 .dependencies = featureSet(&[_]Feature{
763 }),
761 .dependencies = featureSet(&[_]Feature{}),
764762 };
765763 result[@enumToInt(Feature.Linkage)] = .{
766764 .llvm_name = null,
767765 .description = "Enable SPIR-V capability Linkage",
768 .dependencies = featureSet(&[_]Feature{
769 }),
766 .dependencies = featureSet(&[_]Feature{}),
770767 };
771768 result[@enumToInt(Feature.Kernel)] = .{
772769 .llvm_name = null,
773770 .description = "Enable SPIR-V capability Kernel",
774 .dependencies = featureSet(&[_]Feature{
775 }),
771 .dependencies = featureSet(&[_]Feature{}),
776772 };
777773 result[@enumToInt(Feature.Vector16)] = .{
778774 .llvm_name = null,
......@@ -791,20 +787,17 @@ pub const all_features = blk: {
791787 result[@enumToInt(Feature.Float16)] = .{
792788 .llvm_name = null,
793789 .description = "Enable SPIR-V capability Float16",
794 .dependencies = featureSet(&[_]Feature{
795 }),
790 .dependencies = featureSet(&[_]Feature{}),
796791 };
797792 result[@enumToInt(Feature.Float64)] = .{
798793 .llvm_name = null,
799794 .description = "Enable SPIR-V capability Float64",
800 .dependencies = featureSet(&[_]Feature{
801 }),
795 .dependencies = featureSet(&[_]Feature{}),
802796 };
803797 result[@enumToInt(Feature.Int64)] = .{
804798 .llvm_name = null,
805799 .description = "Enable SPIR-V capability Int64",
806 .dependencies = featureSet(&[_]Feature{
807 }),
800 .dependencies = featureSet(&[_]Feature{}),
808801 };
809802 result[@enumToInt(Feature.Int64Atomics)] = .{
810803 .llvm_name = null,
......@@ -844,8 +837,7 @@ pub const all_features = blk: {
844837 result[@enumToInt(Feature.Groups)] = .{
845838 .llvm_name = null,
846839 .description = "Enable SPIR-V capability Groups",
847 .dependencies = featureSet(&[_]Feature{
848 }),
840 .dependencies = featureSet(&[_]Feature{}),
849841 };
850842 result[@enumToInt(Feature.DeviceEnqueue)] = .{
851843 .llvm_name = null,
......@@ -871,8 +863,7 @@ pub const all_features = blk: {
871863 result[@enumToInt(Feature.Int16)] = .{
872864 .llvm_name = null,
873865 .description = "Enable SPIR-V capability Int16",
874 .dependencies = featureSet(&[_]Feature{
875 }),
866 .dependencies = featureSet(&[_]Feature{}),
876867 };
877868 result[@enumToInt(Feature.TessellationPointSize)] = .{
878869 .llvm_name = null,
......@@ -982,8 +973,7 @@ pub const all_features = blk: {
982973 result[@enumToInt(Feature.Int8)] = .{
983974 .llvm_name = null,
984975 .description = "Enable SPIR-V capability Int8",
985 .dependencies = featureSet(&[_]Feature{
986 }),
976 .dependencies = featureSet(&[_]Feature{}),
987977 };
988978 result[@enumToInt(Feature.InputAttachment)] = .{
989979 .llvm_name = null,
......@@ -1009,8 +999,7 @@ pub const all_features = blk: {
1009999 result[@enumToInt(Feature.Sampled1D)] = .{
10101000 .llvm_name = null,
10111001 .description = "Enable SPIR-V capability Sampled1D",
1012 .dependencies = featureSet(&[_]Feature{
1013 }),
1002 .dependencies = featureSet(&[_]Feature{}),
10141003 };
10151004 result[@enumToInt(Feature.Image1D)] = .{
10161005 .llvm_name = null,
......@@ -1029,8 +1018,7 @@ pub const all_features = blk: {
10291018 result[@enumToInt(Feature.SampledBuffer)] = .{
10301019 .llvm_name = null,
10311020 .description = "Enable SPIR-V capability SampledBuffer",
1032 .dependencies = featureSet(&[_]Feature{
1033 }),
1021 .dependencies = featureSet(&[_]Feature{}),
10341022 };
10351023 result[@enumToInt(Feature.ImageBuffer)] = .{
10361024 .llvm_name = null,
......@@ -1220,8 +1208,7 @@ pub const all_features = blk: {
12201208 result[@enumToInt(Feature.SubgroupBallotKHR)] = .{
12211209 .llvm_name = null,
12221210 .description = "Enable SPIR-V capability SubgroupBallotKHR",
1223 .dependencies = featureSet(&[_]Feature{
1224 }),
1211 .dependencies = featureSet(&[_]Feature{}),
12251212 };
12261213 result[@enumToInt(Feature.DrawParameters)] = .{
12271214 .llvm_name = null,
......@@ -1255,8 +1242,7 @@ pub const all_features = blk: {
12551242 result[@enumToInt(Feature.SubgroupVoteKHR)] = .{
12561243 .llvm_name = null,
12571244 .description = "Enable SPIR-V capability SubgroupVoteKHR",
1258 .dependencies = featureSet(&[_]Feature{
1259 }),
1245 .dependencies = featureSet(&[_]Feature{}),
12601246 };
12611247 result[@enumToInt(Feature.StorageBuffer16BitAccess)] = .{
12621248 .llvm_name = null,
......@@ -1338,14 +1324,12 @@ pub const all_features = blk: {
13381324 result[@enumToInt(Feature.AtomicStorageOps)] = .{
13391325 .llvm_name = null,
13401326 .description = "Enable SPIR-V capability AtomicStorageOps",
1341 .dependencies = featureSet(&[_]Feature{
1342 }),
1327 .dependencies = featureSet(&[_]Feature{}),
13431328 };
13441329 result[@enumToInt(Feature.SampleMaskPostDepthCoverage)] = .{
13451330 .llvm_name = null,
13461331 .description = "Enable SPIR-V capability SampleMaskPostDepthCoverage",
1347 .dependencies = featureSet(&[_]Feature{
1348 }),
1332 .dependencies = featureSet(&[_]Feature{}),
13491333 };
13501334 result[@enumToInt(Feature.StorageBuffer8BitAccess)] = .{
13511335 .llvm_name = null,
......@@ -1548,20 +1532,17 @@ pub const all_features = blk: {
15481532 result[@enumToInt(Feature.ImageFootprintNV)] = .{
15491533 .llvm_name = null,
15501534 .description = "Enable SPIR-V capability ImageFootprintNV",
1551 .dependencies = featureSet(&[_]Feature{
1552 }),
1535 .dependencies = featureSet(&[_]Feature{}),
15531536 };
15541537 result[@enumToInt(Feature.FragmentBarycentricNV)] = .{
15551538 .llvm_name = null,
15561539 .description = "Enable SPIR-V capability FragmentBarycentricNV",
1557 .dependencies = featureSet(&[_]Feature{
1558 }),
1540 .dependencies = featureSet(&[_]Feature{}),
15591541 };
15601542 result[@enumToInt(Feature.ComputeDerivativeGroupQuadsNV)] = .{
15611543 .llvm_name = null,
15621544 .description = "Enable SPIR-V capability ComputeDerivativeGroupQuadsNV",
1563 .dependencies = featureSet(&[_]Feature{
1564 }),
1545 .dependencies = featureSet(&[_]Feature{}),
15651546 };
15661547 result[@enumToInt(Feature.FragmentDensityEXT)] = .{
15671548 .llvm_name = null,
......@@ -1580,8 +1561,7 @@ pub const all_features = blk: {
15801561 result[@enumToInt(Feature.GroupNonUniformPartitionedNV)] = .{
15811562 .llvm_name = null,
15821563 .description = "Enable SPIR-V capability GroupNonUniformPartitionedNV",
1583 .dependencies = featureSet(&[_]Feature{
1584 }),
1564 .dependencies = featureSet(&[_]Feature{}),
15851565 };
15861566 result[@enumToInt(Feature.ShaderNonUniform)] = .{
15871567 .llvm_name = null,
......@@ -1835,8 +1815,7 @@ pub const all_features = blk: {
18351815 result[@enumToInt(Feature.ComputeDerivativeGroupLinearNV)] = .{
18361816 .llvm_name = null,
18371817 .description = "Enable SPIR-V capability ComputeDerivativeGroupLinearNV",
1838 .dependencies = featureSet(&[_]Feature{
1839 }),
1818 .dependencies = featureSet(&[_]Feature{}),
18401819 };
18411820 result[@enumToInt(Feature.RayTracingProvisionalKHR)] = .{
18421821 .llvm_name = null,
......@@ -1890,38 +1869,32 @@ pub const all_features = blk: {
18901869 result[@enumToInt(Feature.SubgroupShuffleINTEL)] = .{
18911870 .llvm_name = null,
18921871 .description = "Enable SPIR-V capability SubgroupShuffleINTEL",
1893 .dependencies = featureSet(&[_]Feature{
1894 }),
1872 .dependencies = featureSet(&[_]Feature{}),
18951873 };
18961874 result[@enumToInt(Feature.SubgroupBufferBlockIOINTEL)] = .{
18971875 .llvm_name = null,
18981876 .description = "Enable SPIR-V capability SubgroupBufferBlockIOINTEL",
1899 .dependencies = featureSet(&[_]Feature{
1900 }),
1877 .dependencies = featureSet(&[_]Feature{}),
19011878 };
19021879 result[@enumToInt(Feature.SubgroupImageBlockIOINTEL)] = .{
19031880 .llvm_name = null,
19041881 .description = "Enable SPIR-V capability SubgroupImageBlockIOINTEL",
1905 .dependencies = featureSet(&[_]Feature{
1906 }),
1882 .dependencies = featureSet(&[_]Feature{}),
19071883 };
19081884 result[@enumToInt(Feature.SubgroupImageMediaBlockIOINTEL)] = .{
19091885 .llvm_name = null,
19101886 .description = "Enable SPIR-V capability SubgroupImageMediaBlockIOINTEL",
1911 .dependencies = featureSet(&[_]Feature{
1912 }),
1887 .dependencies = featureSet(&[_]Feature{}),
19131888 };
19141889 result[@enumToInt(Feature.RoundToInfinityINTEL)] = .{
19151890 .llvm_name = null,
19161891 .description = "Enable SPIR-V capability RoundToInfinityINTEL",
1917 .dependencies = featureSet(&[_]Feature{
1918 }),
1892 .dependencies = featureSet(&[_]Feature{}),
19191893 };
19201894 result[@enumToInt(Feature.FloatingPointModeINTEL)] = .{
19211895 .llvm_name = null,
19221896 .description = "Enable SPIR-V capability FloatingPointModeINTEL",
1923 .dependencies = featureSet(&[_]Feature{
1924 }),
1897 .dependencies = featureSet(&[_]Feature{}),
19251898 };
19261899 result[@enumToInt(Feature.IntegerFunctions2INTEL)] = .{
19271900 .llvm_name = null,
......@@ -1933,38 +1906,32 @@ pub const all_features = blk: {
19331906 result[@enumToInt(Feature.FunctionPointersINTEL)] = .{
19341907 .llvm_name = null,
19351908 .description = "Enable SPIR-V capability FunctionPointersINTEL",
1936 .dependencies = featureSet(&[_]Feature{
1937 }),
1909 .dependencies = featureSet(&[_]Feature{}),
19381910 };
19391911 result[@enumToInt(Feature.IndirectReferencesINTEL)] = .{
19401912 .llvm_name = null,
19411913 .description = "Enable SPIR-V capability IndirectReferencesINTEL",
1942 .dependencies = featureSet(&[_]Feature{
1943 }),
1914 .dependencies = featureSet(&[_]Feature{}),
19441915 };
19451916 result[@enumToInt(Feature.AsmINTEL)] = .{
19461917 .llvm_name = null,
19471918 .description = "Enable SPIR-V capability AsmINTEL",
1948 .dependencies = featureSet(&[_]Feature{
1949 }),
1919 .dependencies = featureSet(&[_]Feature{}),
19501920 };
19511921 result[@enumToInt(Feature.AtomicFloat32MinMaxEXT)] = .{
19521922 .llvm_name = null,
19531923 .description = "Enable SPIR-V capability AtomicFloat32MinMaxEXT",
1954 .dependencies = featureSet(&[_]Feature{
1955 }),
1924 .dependencies = featureSet(&[_]Feature{}),
19561925 };
19571926 result[@enumToInt(Feature.AtomicFloat64MinMaxEXT)] = .{
19581927 .llvm_name = null,
19591928 .description = "Enable SPIR-V capability AtomicFloat64MinMaxEXT",
1960 .dependencies = featureSet(&[_]Feature{
1961 }),
1929 .dependencies = featureSet(&[_]Feature{}),
19621930 };
19631931 result[@enumToInt(Feature.AtomicFloat16MinMaxEXT)] = .{
19641932 .llvm_name = null,
19651933 .description = "Enable SPIR-V capability AtomicFloat16MinMaxEXT",
1966 .dependencies = featureSet(&[_]Feature{
1967 }),
1934 .dependencies = featureSet(&[_]Feature{}),
19681935 };
19691936 result[@enumToInt(Feature.VectorComputeINTEL)] = .{
19701937 .llvm_name = null,
......@@ -1976,50 +1943,42 @@ pub const all_features = blk: {
19761943 result[@enumToInt(Feature.VectorAnyINTEL)] = .{
19771944 .llvm_name = null,
19781945 .description = "Enable SPIR-V capability VectorAnyINTEL",
1979 .dependencies = featureSet(&[_]Feature{
1980 }),
1946 .dependencies = featureSet(&[_]Feature{}),
19811947 };
19821948 result[@enumToInt(Feature.ExpectAssumeKHR)] = .{
19831949 .llvm_name = null,
19841950 .description = "Enable SPIR-V capability ExpectAssumeKHR",
1985 .dependencies = featureSet(&[_]Feature{
1986 }),
1951 .dependencies = featureSet(&[_]Feature{}),
19871952 };
19881953 result[@enumToInt(Feature.SubgroupAvcMotionEstimationINTEL)] = .{
19891954 .llvm_name = null,
19901955 .description = "Enable SPIR-V capability SubgroupAvcMotionEstimationINTEL",
1991 .dependencies = featureSet(&[_]Feature{
1992 }),
1956 .dependencies = featureSet(&[_]Feature{}),
19931957 };
19941958 result[@enumToInt(Feature.SubgroupAvcMotionEstimationIntraINTEL)] = .{
19951959 .llvm_name = null,
19961960 .description = "Enable SPIR-V capability SubgroupAvcMotionEstimationIntraINTEL",
1997 .dependencies = featureSet(&[_]Feature{
1998 }),
1961 .dependencies = featureSet(&[_]Feature{}),
19991962 };
20001963 result[@enumToInt(Feature.SubgroupAvcMotionEstimationChromaINTEL)] = .{
20011964 .llvm_name = null,
20021965 .description = "Enable SPIR-V capability SubgroupAvcMotionEstimationChromaINTEL",
2003 .dependencies = featureSet(&[_]Feature{
2004 }),
1966 .dependencies = featureSet(&[_]Feature{}),
20051967 };
20061968 result[@enumToInt(Feature.VariableLengthArrayINTEL)] = .{
20071969 .llvm_name = null,
20081970 .description = "Enable SPIR-V capability VariableLengthArrayINTEL",
2009 .dependencies = featureSet(&[_]Feature{
2010 }),
1971 .dependencies = featureSet(&[_]Feature{}),
20111972 };
20121973 result[@enumToInt(Feature.FunctionFloatControlINTEL)] = .{
20131974 .llvm_name = null,
20141975 .description = "Enable SPIR-V capability FunctionFloatControlINTEL",
2015 .dependencies = featureSet(&[_]Feature{
2016 }),
1976 .dependencies = featureSet(&[_]Feature{}),
20171977 };
20181978 result[@enumToInt(Feature.FPGAMemoryAttributesINTEL)] = .{
20191979 .llvm_name = null,
20201980 .description = "Enable SPIR-V capability FPGAMemoryAttributesINTEL",
2021 .dependencies = featureSet(&[_]Feature{
2022 }),
1981 .dependencies = featureSet(&[_]Feature{}),
20231982 };
20241983 result[@enumToInt(Feature.FPFastMathModeINTEL)] = .{
20251984 .llvm_name = null,
......@@ -2031,80 +1990,67 @@ pub const all_features = blk: {
20311990 result[@enumToInt(Feature.ArbitraryPrecisionIntegersINTEL)] = .{
20321991 .llvm_name = null,
20331992 .description = "Enable SPIR-V capability ArbitraryPrecisionIntegersINTEL",
2034 .dependencies = featureSet(&[_]Feature{
2035 }),
1993 .dependencies = featureSet(&[_]Feature{}),
20361994 };
20371995 result[@enumToInt(Feature.UnstructuredLoopControlsINTEL)] = .{
20381996 .llvm_name = null,
20391997 .description = "Enable SPIR-V capability UnstructuredLoopControlsINTEL",
2040 .dependencies = featureSet(&[_]Feature{
2041 }),
1998 .dependencies = featureSet(&[_]Feature{}),
20421999 };
20432000 result[@enumToInt(Feature.FPGALoopControlsINTEL)] = .{
20442001 .llvm_name = null,
20452002 .description = "Enable SPIR-V capability FPGALoopControlsINTEL",
2046 .dependencies = featureSet(&[_]Feature{
2047 }),
2003 .dependencies = featureSet(&[_]Feature{}),
20482004 };
20492005 result[@enumToInt(Feature.KernelAttributesINTEL)] = .{
20502006 .llvm_name = null,
20512007 .description = "Enable SPIR-V capability KernelAttributesINTEL",
2052 .dependencies = featureSet(&[_]Feature{
2053 }),
2008 .dependencies = featureSet(&[_]Feature{}),
20542009 };
20552010 result[@enumToInt(Feature.FPGAKernelAttributesINTEL)] = .{
20562011 .llvm_name = null,
20572012 .description = "Enable SPIR-V capability FPGAKernelAttributesINTEL",
2058 .dependencies = featureSet(&[_]Feature{
2059 }),
2013 .dependencies = featureSet(&[_]Feature{}),
20602014 };
20612015 result[@enumToInt(Feature.FPGAMemoryAccessesINTEL)] = .{
20622016 .llvm_name = null,
20632017 .description = "Enable SPIR-V capability FPGAMemoryAccessesINTEL",
2064 .dependencies = featureSet(&[_]Feature{
2065 }),
2018 .dependencies = featureSet(&[_]Feature{}),
20662019 };
20672020 result[@enumToInt(Feature.FPGAClusterAttributesINTEL)] = .{
20682021 .llvm_name = null,
20692022 .description = "Enable SPIR-V capability FPGAClusterAttributesINTEL",
2070 .dependencies = featureSet(&[_]Feature{
2071 }),
2023 .dependencies = featureSet(&[_]Feature{}),
20722024 };
20732025 result[@enumToInt(Feature.LoopFuseINTEL)] = .{
20742026 .llvm_name = null,
20752027 .description = "Enable SPIR-V capability LoopFuseINTEL",
2076 .dependencies = featureSet(&[_]Feature{
2077 }),
2028 .dependencies = featureSet(&[_]Feature{}),
20782029 };
20792030 result[@enumToInt(Feature.FPGABufferLocationINTEL)] = .{
20802031 .llvm_name = null,
20812032 .description = "Enable SPIR-V capability FPGABufferLocationINTEL",
2082 .dependencies = featureSet(&[_]Feature{
2083 }),
2033 .dependencies = featureSet(&[_]Feature{}),
20842034 };
20852035 result[@enumToInt(Feature.USMStorageClassesINTEL)] = .{
20862036 .llvm_name = null,
20872037 .description = "Enable SPIR-V capability USMStorageClassesINTEL",
2088 .dependencies = featureSet(&[_]Feature{
2089 }),
2038 .dependencies = featureSet(&[_]Feature{}),
20902039 };
20912040 result[@enumToInt(Feature.IOPipesINTEL)] = .{
20922041 .llvm_name = null,
20932042 .description = "Enable SPIR-V capability IOPipesINTEL",
2094 .dependencies = featureSet(&[_]Feature{
2095 }),
2043 .dependencies = featureSet(&[_]Feature{}),
20962044 };
20972045 result[@enumToInt(Feature.BlockingPipesINTEL)] = .{
20982046 .llvm_name = null,
20992047 .description = "Enable SPIR-V capability BlockingPipesINTEL",
2100 .dependencies = featureSet(&[_]Feature{
2101 }),
2048 .dependencies = featureSet(&[_]Feature{}),
21022049 };
21032050 result[@enumToInt(Feature.FPGARegINTEL)] = .{
21042051 .llvm_name = null,
21052052 .description = "Enable SPIR-V capability FPGARegINTEL",
2106 .dependencies = featureSet(&[_]Feature{
2107 }),
2053 .dependencies = featureSet(&[_]Feature{}),
21082054 };
21092055 result[@enumToInt(Feature.AtomicFloat32AddEXT)] = .{
21102056 .llvm_name = null,
......@@ -2123,8 +2069,7 @@ pub const all_features = blk: {
21232069 result[@enumToInt(Feature.LongConstantCompositeINTEL)] = .{
21242070 .llvm_name = null,
21252071 .description = "Enable SPIR-V capability LongConstantCompositeINTEL",
2126 .dependencies = featureSet(&[_]Feature{
2127 }),
2072 .dependencies = featureSet(&[_]Feature{}),
21282073 };
21292074 const ti = @typeInfo(Feature);
21302075 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
1919 if (enabled) cpu.features.addFeature(idx) else cpu.features.removeFeature(idx);
2020}
2121
22fn bit(input: u32, offset: u5) callconv(.Inline) bool {
22inline fn bit(input: u32, offset: u5) bool {
2323 return (input >> offset) & 1 != 0;
2424}
2525
26fn hasMask(input: u32, mask: u32) callconv(.Inline) bool {
26inline fn hasMask(input: u32, mask: u32) bool {
2727 return (input & mask) == mask;
2828}
2929
src/DepTokenizer.zig+1-4
......@@ -275,10 +275,7 @@ fn errorIllegalChar(comptime id: std.meta.Tag(Token), index: usize, char: u8) To
275275}
276276
277277fn finishTarget(must_resolve: bool, bytes: []const u8) Token {
278 return if (must_resolve)
279 .{ .target_must_resolve = bytes }
280 else
281 .{ .target = bytes };
278 return if (must_resolve) .{ .target_must_resolve = bytes } else .{ .target = bytes };
282279}
283280
284281const State = enum {
src/libc_installation.zig+1-2
......@@ -286,8 +286,7 @@ pub const LibCInstallation = struct {
286286 else if (is_haiku)
287287 "posix/errno.h"
288288 else
289 "sys/errno.h"
290 ;
289 "sys/errno.h";
291290
292291 var path_i: usize = 0;
293292 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 {
25142514 return min_pos - start;
25152515}
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 {
25182518 const increased_size = padToIdeal(size);
25192519 const test_end = off + increased_size;
25202520 if (end > off and start < test_end) {
src/link/MachO/reloc/aarch64.zig+1-1
......@@ -585,7 +585,7 @@ pub const Parser = struct {
585585 }
586586};
587587
588fn isArithmeticOp(inst: *const [4]u8) callconv(.Inline) bool {
588inline fn isArithmeticOp(inst: *const [4]u8) bool {
589589 const group_decode = @truncate(u5, inst[3]);
590590 return ((group_decode >> 2) == 4);
591591}
src/tracy.zig+1-1
......@@ -31,7 +31,7 @@ pub const Ctx = if (enable) ___tracy_c_zone_context else struct {
3131 pub fn end(self: Ctx) void {}
3232};
3333
34pub fn trace(comptime src: std.builtin.SourceLocation) callconv(.Inline) Ctx {
34pub inline fn trace(comptime src: std.builtin.SourceLocation) Ctx {
3535 if (!enable) return .{};
3636
3737 const loc: ___tracy_source_location_data = .{