| author | |
| committer | |
| log | 83da6827fdda6f0304228bba3e78e8624c4540ee |
| tree | cfa420a140126a467978ad20a968540677b8ebc6 |
| parent | 4590712804a0392d838a839572c722cf8640960c |
4 files changed, 4 insertions(+), 28 deletions(-)
lib/compiler/aro/aro/Preprocessor.zig+2-2| ... | @@ -45,11 +45,11 @@ const IfContext = struct { | ... | @@ -45,11 +45,11 @@ const IfContext = struct { |
| 45 | level: u8, | 45 | level: u8, |
| 46 | 46 | ||
| 47 | fn get(self: *const IfContext) Nesting { | 47 | fn get(self: *const IfContext) Nesting { |
| 48 | return @enumFromInt(std.mem.readPackedIntNative(Backing, &self.kind, @as(usize, self.level) * 2)); | 48 | return @enumFromInt(std.mem.readPackedInt(Backing, &self.kind, @as(usize, self.level) * 2, .native)); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | fn set(self: *IfContext, context: Nesting) void { | 51 | fn set(self: *IfContext, context: Nesting) void { |
| 52 | std.mem.writePackedIntNative(Backing, &self.kind, @as(usize, self.level) * 2, @intFromEnum(context)); | 52 | std.mem.writePackedInt(Backing, &self.kind, @as(usize, self.level) * 2, @intFromEnum(context), .native); |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | fn increment(self: *IfContext) bool { | 55 | fn increment(self: *IfContext) bool { |
lib/compiler_rt/float_from_int.zig+1-1| ... | @@ -97,7 +97,7 @@ pub inline fn floatFromBigInt(comptime T: type, comptime signedness: std.builtin | ... | @@ -97,7 +97,7 @@ pub inline fn floatFromBigInt(comptime T: type, comptime signedness: std.builtin |
| 97 | if (limb(x, limb_index) != 0) break true; | 97 | if (limb(x, limb_index) != 0) break true; |
| 98 | } else limb(x, exponent_limb) & ((@as(u32, 1) << @truncate(exponent)) - 1) != 0; | 98 | } else limb(x, exponent_limb) & ((@as(u32, 1) << @truncate(exponent)) - 1) != 0; |
| 99 | return math.ldexp(@as(T, @floatFromInt( | 99 | return math.ldexp(@as(T, @floatFromInt( |
| 100 | std.mem.readPackedIntNative(I, std.mem.sliceAsBytes(x), exponent) | @intFromBool(sticky), | 100 | std.mem.readPackedInt(I, std.mem.sliceAsBytes(x), exponent, .native) | @intFromBool(sticky), |
| 101 | )), @intCast(exponent)); | 101 | )), @intCast(exponent)); |
| 102 | } | 102 | } |
| 103 | 103 |
lib/compiler_rt/int_from_float.zig+1-1| ... | @@ -141,7 +141,7 @@ pub inline fn bigIntFromFloat(comptime signedness: std.builtin.Signedness, resul | ... | @@ -141,7 +141,7 @@ pub inline fn bigIntFromFloat(comptime signedness: std.builtin.Signedness, resul |
| 141 | }, | 141 | }, |
| 142 | .unsigned => @memset(result, 0), | 142 | .unsigned => @memset(result, 0), |
| 143 | } | 143 | } |
| 144 | std.mem.writePackedIntNative(I, std.mem.sliceAsBytes(result), exponent, int); | 144 | std.mem.writePackedInt(I, std.mem.sliceAsBytes(result), exponent, int, .native); |
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | test { | 147 | test { |
lib/std/mem.zig-24| ... | @@ -1973,18 +1973,6 @@ fn readPackedIntBig(comptime T: type, bytes: []const u8, bit_offset: usize) T { | ... | @@ -1973,18 +1973,6 @@ fn readPackedIntBig(comptime T: type, bytes: []const u8, bit_offset: usize) T { |
| 1973 | } else return @as(T, @bitCast(val)); | 1973 | } else return @as(T, @bitCast(val)); |
| 1974 | } | 1974 | } |
| 1975 | 1975 | ||
| 1976 | /// Deprecated: use readPackedInt(T, bytes, bit_offset, value, .native) | ||
| 1977 | pub const readPackedIntNative = switch (native_endian) { | ||
| 1978 | .little => readPackedIntLittle, | ||
| 1979 | .big => readPackedIntBig, | ||
| 1980 | }; | ||
| 1981 | |||
| 1982 | /// Deprecated: use readPackedInt(T, bytes, bit_offset, value, .foreign) | ||
| 1983 | pub const readPackedIntForeign = switch (native_endian) { | ||
| 1984 | .little => readPackedIntBig, | ||
| 1985 | .big => readPackedIntLittle, | ||
| 1986 | }; | ||
| 1987 | |||
| 1988 | /// Loads an integer from packed memory. | 1976 | /// Loads an integer from packed memory. |
| 1989 | /// Asserts that buffer contains at least bit_offset + @bitSizeOf(T) bits. | 1977 | /// Asserts that buffer contains at least bit_offset + @bitSizeOf(T) bits. |
| 1990 | pub fn readPackedInt(comptime T: type, bytes: []const u8, bit_offset: usize, endian: Endian) T { | 1978 | pub fn readPackedInt(comptime T: type, bytes: []const u8, bit_offset: usize, endian: Endian) T { |
| ... | @@ -2128,18 +2116,6 @@ fn writePackedIntBig(comptime T: type, bytes: []u8, bit_offset: usize, value: T) | ... | @@ -2128,18 +2116,6 @@ fn writePackedIntBig(comptime T: type, bytes: []u8, bit_offset: usize, value: T) |
| 2128 | writeInt(StoreInt, write_bytes[(byte_count - store_size)..][0..store_size], write_value, .big); | 2116 | writeInt(StoreInt, write_bytes[(byte_count - store_size)..][0..store_size], write_value, .big); |
| 2129 | } | 2117 | } |
| 2130 | 2118 | ||
| 2131 | /// Deprecated: use writePackedInt(T, bytes, bit_offset, value, .native) | ||
| 2132 | pub const writePackedIntNative = switch (native_endian) { | ||
| 2133 | .little => writePackedIntLittle, | ||
| 2134 | .big => writePackedIntBig, | ||
| 2135 | }; | ||
| 2136 | |||
| 2137 | /// Deprecated: use writePackedInt(T, bytes, bit_offset, value, .foreign) | ||
| 2138 | pub const writePackedIntForeign = switch (native_endian) { | ||
| 2139 | .little => writePackedIntBig, | ||
| 2140 | .big => writePackedIntLittle, | ||
| 2141 | }; | ||
| 2142 | |||
| 2143 | /// Stores an integer to packed memory. | 2119 | /// Stores an integer to packed memory. |
| 2144 | /// Asserts that buffer contains at least bit_offset + @bitSizeOf(T) bits. | 2120 | /// Asserts that buffer contains at least bit_offset + @bitSizeOf(T) bits. |
| 2145 | pub fn writePackedInt(comptime T: type, bytes: []u8, bit_offset: usize, value: T, endian: Endian) void { | 2121 | pub fn writePackedInt(comptime T: type, bytes: []u8, bit_offset: usize, value: T, endian: Endian) void { |