aboutsummaryrefslogtreecommitdiff
path: root/src/Type.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Type.zig')
-rw-r--r--src/Type.zig12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Type.zig b/src/Type.zig
index f3e33abbec..ba64fb633a 100644
--- a/src/Type.zig
+++ b/src/Type.zig
@@ -4096,6 +4096,7 @@ pub const single_const_pointer_to_comptime_int: Type = .{ .ip_index = .single_co
pub const slice_const_u8: Type = .{ .ip_index = .slice_const_u8_type };
pub const slice_const_u8_sentinel_0: Type = .{ .ip_index = .slice_const_u8_sentinel_0_type };
+pub const vector_8_i8: Type = .{ .ip_index = .vector_8_i8_type };
pub const vector_16_i8: Type = .{ .ip_index = .vector_16_i8_type };
pub const vector_32_i8: Type = .{ .ip_index = .vector_32_i8_type };
pub const vector_1_u8: Type = .{ .ip_index = .vector_1_u8_type };
@@ -4104,8 +4105,10 @@ pub const vector_4_u8: Type = .{ .ip_index = .vector_4_u8_type };
pub const vector_8_u8: Type = .{ .ip_index = .vector_8_u8_type };
pub const vector_16_u8: Type = .{ .ip_index = .vector_16_u8_type };
pub const vector_32_u8: Type = .{ .ip_index = .vector_32_u8_type };
+pub const vector_4_i16: Type = .{ .ip_index = .vector_4_i16_type };
pub const vector_8_i16: Type = .{ .ip_index = .vector_8_i16_type };
pub const vector_16_i16: Type = .{ .ip_index = .vector_16_i16_type };
+pub const vector_4_u16: Type = .{ .ip_index = .vector_4_u16_type };
pub const vector_8_u16: Type = .{ .ip_index = .vector_8_u16_type };
pub const vector_16_u16: Type = .{ .ip_index = .vector_16_u16_type };
pub const vector_4_i32: Type = .{ .ip_index = .vector_4_i32_type };
@@ -4116,6 +4119,7 @@ pub const vector_2_i64: Type = .{ .ip_index = .vector_2_i64_type };
pub const vector_4_i64: Type = .{ .ip_index = .vector_4_i64_type };
pub const vector_2_u64: Type = .{ .ip_index = .vector_2_u64_type };
pub const vector_4_u64: Type = .{ .ip_index = .vector_4_u64_type };
+pub const vector_2_u128: Type = .{ .ip_index = .vector_2_u128_type };
pub const vector_4_f16: Type = .{ .ip_index = .vector_4_f16_type };
pub const vector_8_f16: Type = .{ .ip_index = .vector_8_f16_type };
pub const vector_2_f32: Type = .{ .ip_index = .vector_2_f32_type };
@@ -4129,10 +4133,10 @@ pub const empty_tuple: Type = .{ .ip_index = .empty_tuple_type };
pub const generic_poison: Type = .{ .ip_index = .generic_poison_type };
pub fn smallestUnsignedBits(max: u64) u16 {
- if (max == 0) return 0;
- const base = std.math.log2(max);
- const upper = (@as(u64, 1) << @as(u6, @intCast(base))) - 1;
- return @as(u16, @intCast(base + @intFromBool(upper < max)));
+ return switch (max) {
+ 0 => 0,
+ else => 1 + std.math.log2_int(u64, max),
+ };
}
/// This is only used for comptime asserts. Bump this number when you make a change