| author | |
| committer | |
| log | 14685e59b26c8dc002ce6c25c6916cbad54e79d0 |
| tree | 00ed70d37e4a50a99170d75859471b519da3c453 |
| parent | 32568dba742a31051f2390b55b936a03b5146e17 |
7 files changed, 49 insertions(+), 11 deletions(-)
src/AstGen.zig+6-2| ... | ... | @@ -291,8 +291,8 @@ pub const ResultLoc = union(enum) { |
| 291 | 291 | } |
| 292 | 292 | }; |
| 293 | 293 | |
| 294 | pub const align_rl: ResultLoc = .{ .ty = .u16_type }; | |
| 295 | pub const coerced_align_rl: ResultLoc = .{ .coerced_ty = .u16_type }; | |
| 294 | pub const align_rl: ResultLoc = .{ .ty = .u29_type }; | |
| 295 | pub const coerced_align_rl: ResultLoc = .{ .coerced_ty = .u29_type }; | |
| 296 | 296 | pub const bool_rl: ResultLoc = .{ .ty = .bool_type }; |
| 297 | 297 | pub const type_rl: ResultLoc = .{ .ty = .type_type }; |
| 298 | 298 | pub const coerced_type_rl: ResultLoc = .{ .coerced_ty = .type_type }; |
| ... | ... | @@ -8077,6 +8077,7 @@ const primitives = std.ComptimeStringMap(Zir.Inst.Ref, .{ |
| 8077 | 8077 | .{ "true", .bool_true }, |
| 8078 | 8078 | .{ "type", .type_type }, |
| 8079 | 8079 | .{ "u16", .u16_type }, |
| 8080 | .{ "u29", .u29_type }, | |
| 8080 | 8081 | .{ "u32", .u32_type }, |
| 8081 | 8082 | .{ "u64", .u64_type }, |
| 8082 | 8083 | .{ "u128", .u128_type }, |
| ... | ... | @@ -8749,6 +8750,7 @@ fn nodeImpliesMoreThanOnePossibleValue(tree: *const Ast, start_node: Ast.Node.In |
| 8749 | 8750 | .isize_type, |
| 8750 | 8751 | .type_type, |
| 8751 | 8752 | .u16_type, |
| 8753 | .u29_type, | |
| 8752 | 8754 | .u32_type, |
| 8753 | 8755 | .u64_type, |
| 8754 | 8756 | .u128_type, |
| ... | ... | @@ -8988,6 +8990,7 @@ fn nodeImpliesComptimeOnly(tree: *const Ast, start_node: Ast.Node.Index) bool { |
| 8988 | 8990 | .i8_type, |
| 8989 | 8991 | .isize_type, |
| 8990 | 8992 | .u16_type, |
| 8993 | .u29_type, | |
| 8991 | 8994 | .u32_type, |
| 8992 | 8995 | .u64_type, |
| 8993 | 8996 | .u128_type, |
| ... | ... | @@ -9063,6 +9066,7 @@ fn rvalue( |
| 9063 | 9066 | as_ty | @enumToInt(Zir.Inst.Ref.u8_type), |
| 9064 | 9067 | as_ty | @enumToInt(Zir.Inst.Ref.i8_type), |
| 9065 | 9068 | as_ty | @enumToInt(Zir.Inst.Ref.u16_type), |
| 9069 | as_ty | @enumToInt(Zir.Inst.Ref.u29_type), | |
| 9066 | 9070 | as_ty | @enumToInt(Zir.Inst.Ref.i16_type), |
| 9067 | 9071 | as_ty | @enumToInt(Zir.Inst.Ref.u32_type), |
| 9068 | 9072 | as_ty | @enumToInt(Zir.Inst.Ref.i32_type), |
src/Module.zig+1-1| ... | ... | @@ -4016,7 +4016,7 @@ fn semaDecl(mod: *Module, decl_index: Decl.Index) !bool { |
| 4016 | 4016 | try wip_captures.finalize(); |
| 4017 | 4017 | const src: LazySrcLoc = .{ .node_offset = 0 }; |
| 4018 | 4018 | const decl_tv = try sema.resolveInstValue(&block_scope, src, result_ref); |
| 4019 | const decl_align: u16 = blk: { | |
| 4019 | const decl_align: u32 = blk: { | |
| 4020 | 4020 | const align_ref = decl.zirAlignRef(); |
| 4021 | 4021 | if (align_ref == .none) break :blk 0; |
| 4022 | 4022 | break :blk try sema.resolveAlign(&block_scope, src, align_ref); |
src/Sema.zig+9-6| ... | ... | @@ -1739,9 +1739,9 @@ pub fn resolveAlign( |
| 1739 | 1739 | block: *Block, |
| 1740 | 1740 | src: LazySrcLoc, |
| 1741 | 1741 | zir_ref: Zir.Inst.Ref, |
| 1742 | ) !u16 { | |
| 1743 | const alignment_big = try sema.resolveInt(block, src, zir_ref, Type.initTag(.u16)); | |
| 1744 | const alignment = @intCast(u16, alignment_big); // We coerce to u16 in the prev line. | |
| 1742 | ) !u32 { | |
| 1743 | const alignment_big = try sema.resolveInt(block, src, zir_ref, Type.initTag(.u29)); | |
| 1744 | const alignment = @intCast(u32, alignment_big); // We coerce to u16 in the prev line. | |
| 1745 | 1745 | if (alignment == 0) return sema.fail(block, src, "alignment must be >= 1", .{}); |
| 1746 | 1746 | if (!std.math.isPowerOfTwo(alignment)) { |
| 1747 | 1747 | return sema.fail(block, src, "alignment value {d} is not a power of two", .{ |
| ... | ... | @@ -2663,7 +2663,7 @@ fn zirAllocExtended( |
| 2663 | 2663 | break :blk try sema.resolveType(block, ty_src, type_ref); |
| 2664 | 2664 | } else undefined; |
| 2665 | 2665 | |
| 2666 | const alignment: u16 = if (small.has_align) blk: { | |
| 2666 | const alignment: u32 = if (small.has_align) blk: { | |
| 2667 | 2667 | const align_ref = @intToEnum(Zir.Inst.Ref, sema.code.extra[extra_index]); |
| 2668 | 2668 | extra_index += 1; |
| 2669 | 2669 | const alignment = try sema.resolveAlign(block, align_src, align_ref); |
| ... | ... | @@ -14210,7 +14210,7 @@ fn zirReify(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.I |
| 14210 | 14210 | .size = ptr_size, |
| 14211 | 14211 | .mutable = !is_const_val.toBool(), |
| 14212 | 14212 | .@"volatile" = is_volatile_val.toBool(), |
| 14213 | .@"align" = @intCast(u16, alignment_val.toUnsignedInt(target)), // TODO: Validate this value. | |
| 14213 | .@"align" = @intCast(u29, alignment_val.toUnsignedInt(target)), // TODO: Validate this value. | |
| 14214 | 14214 | .@"addrspace" = address_space_val.toEnum(std.builtin.AddressSpace), |
| 14215 | 14215 | .pointee_type = try child_ty.copy(sema.arena), |
| 14216 | 14216 | .@"allowzero" = is_allowzero_val.toBool(), |
| ... | ... | @@ -16984,7 +16984,7 @@ fn zirFuncFancy(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A |
| 16984 | 16984 | const body = sema.code.extra[extra_index..][0..body_len]; |
| 16985 | 16985 | extra_index += body.len; |
| 16986 | 16986 | |
| 16987 | const val = try sema.resolveGenericBody(block, align_src, body, inst, Type.u16); | |
| 16987 | const val = try sema.resolveGenericBody(block, align_src, body, inst, Type.u29); | |
| 16988 | 16988 | if (val.tag() == .generic_poison) { |
| 16989 | 16989 | break :blk null; |
| 16990 | 16990 | } |
| ... | ... | @@ -23886,6 +23886,7 @@ pub fn typeHasOnePossibleValue( |
| 23886 | 23886 | .i8, |
| 23887 | 23887 | .u16, |
| 23888 | 23888 | .i16, |
| 23889 | .u29, | |
| 23889 | 23890 | .u32, |
| 23890 | 23891 | .i32, |
| 23891 | 23892 | .u64, |
| ... | ... | @@ -24179,6 +24180,7 @@ pub fn addType(sema: *Sema, ty: Type) !Air.Inst.Ref { |
| 24179 | 24180 | .u8 => return .u8_type, |
| 24180 | 24181 | .i8 => return .i8_type, |
| 24181 | 24182 | .u16 => return .u16_type, |
| 24183 | .u29 => return .u29_type, | |
| 24182 | 24184 | .i16 => return .i16_type, |
| 24183 | 24185 | .u32 => return .u32_type, |
| 24184 | 24186 | .i32 => return .i32_type, |
| ... | ... | @@ -24549,6 +24551,7 @@ pub fn typeRequiresComptime(sema: *Sema, block: *Block, src: LazySrcLoc, ty: Typ |
| 24549 | 24551 | .i8, |
| 24550 | 24552 | .u16, |
| 24551 | 24553 | .i16, |
| 24554 | .u29, | |
| 24552 | 24555 | .u32, |
| 24553 | 24556 | .i32, |
| 24554 | 24557 | .u64, |
src/TypedValue.zig+1| ... | ... | @@ -79,6 +79,7 @@ pub fn print( |
| 79 | 79 | .i8_type => return writer.writeAll("i8"), |
| 80 | 80 | .u16_type => return writer.writeAll("u16"), |
| 81 | 81 | .i16_type => return writer.writeAll("i16"), |
| 82 | .u29_type => return writer.writeAll("u29"), | |
| 82 | 83 | .u32_type => return writer.writeAll("u32"), |
| 83 | 84 | .i32_type => return writer.writeAll("i32"), |
| 84 | 85 | .u64_type => return writer.writeAll("u64"), |
src/Zir.zig+5| ... | ... | @@ -1961,6 +1961,7 @@ pub const Inst = struct { |
| 1961 | 1961 | i8_type, |
| 1962 | 1962 | u16_type, |
| 1963 | 1963 | i16_type, |
| 1964 | u29_type, | |
| 1964 | 1965 | u32_type, |
| 1965 | 1966 | i32_type, |
| 1966 | 1967 | u64_type, |
| ... | ... | @@ -2072,6 +2073,10 @@ pub const Inst = struct { |
| 2072 | 2073 | .ty = Type.initTag(.type), |
| 2073 | 2074 | .val = Value.initTag(.i16_type), |
| 2074 | 2075 | }, |
| 2076 | .u29_type = .{ | |
| 2077 | .ty = Type.initTag(.type), | |
| 2078 | .val = Value.initTag(.u29_type), | |
| 2079 | }, | |
| 2075 | 2080 | .u32_type = .{ |
| 2076 | 2081 | .ty = Type.initTag(.type), |
| 2077 | 2082 | .val = Value.initTag(.u32_type), |
src/type.zig+20| ... | ... | @@ -36,6 +36,7 @@ pub const Type = extern union { |
| 36 | 36 | .i8, |
| 37 | 37 | .u16, |
| 38 | 38 | .i16, |
| 39 | .u29, | |
| 39 | 40 | .u32, |
| 40 | 41 | .i32, |
| 41 | 42 | .u64, |
| ... | ... | @@ -568,6 +569,7 @@ pub const Type = extern union { |
| 568 | 569 | .i8, |
| 569 | 570 | .u16, |
| 570 | 571 | .i16, |
| 572 | .u29, | |
| 571 | 573 | .u32, |
| 572 | 574 | .i32, |
| 573 | 575 | .u64, |
| ... | ... | @@ -979,6 +981,7 @@ pub const Type = extern union { |
| 979 | 981 | .i8, |
| 980 | 982 | .u16, |
| 981 | 983 | .i16, |
| 984 | .u29, | |
| 982 | 985 | .u32, |
| 983 | 986 | .i32, |
| 984 | 987 | .u64, |
| ... | ... | @@ -1261,6 +1264,7 @@ pub const Type = extern union { |
| 1261 | 1264 | .i8, |
| 1262 | 1265 | .u16, |
| 1263 | 1266 | .i16, |
| 1267 | .u29, | |
| 1264 | 1268 | .u32, |
| 1265 | 1269 | .i32, |
| 1266 | 1270 | .u64, |
| ... | ... | @@ -1551,6 +1555,7 @@ pub const Type = extern union { |
| 1551 | 1555 | .i8, |
| 1552 | 1556 | .u16, |
| 1553 | 1557 | .i16, |
| 1558 | .u29, | |
| 1554 | 1559 | .u32, |
| 1555 | 1560 | .i32, |
| 1556 | 1561 | .u64, |
| ... | ... | @@ -1935,6 +1940,7 @@ pub const Type = extern union { |
| 1935 | 1940 | .i8, |
| 1936 | 1941 | .u16, |
| 1937 | 1942 | .i16, |
| 1943 | .u29, | |
| 1938 | 1944 | .u32, |
| 1939 | 1945 | .i32, |
| 1940 | 1946 | .u64, |
| ... | ... | @@ -2235,6 +2241,7 @@ pub const Type = extern union { |
| 2235 | 2241 | .u8 => return Value.initTag(.u8_type), |
| 2236 | 2242 | .i8 => return Value.initTag(.i8_type), |
| 2237 | 2243 | .u16 => return Value.initTag(.u16_type), |
| 2244 | .u29 => return Value.initTag(.u29_type), | |
| 2238 | 2245 | .i16 => return Value.initTag(.i16_type), |
| 2239 | 2246 | .u32 => return Value.initTag(.u32_type), |
| 2240 | 2247 | .i32 => return Value.initTag(.i32_type), |
| ... | ... | @@ -2312,6 +2319,7 @@ pub const Type = extern union { |
| 2312 | 2319 | .i8, |
| 2313 | 2320 | .u16, |
| 2314 | 2321 | .i16, |
| 2322 | .u29, | |
| 2315 | 2323 | .u32, |
| 2316 | 2324 | .i32, |
| 2317 | 2325 | .u64, |
| ... | ... | @@ -2560,6 +2568,7 @@ pub const Type = extern union { |
| 2560 | 2568 | .i8, |
| 2561 | 2569 | .u16, |
| 2562 | 2570 | .i16, |
| 2571 | .u29, | |
| 2563 | 2572 | .u32, |
| 2564 | 2573 | .i32, |
| 2565 | 2574 | .u64, |
| ... | ... | @@ -2953,6 +2962,7 @@ pub const Type = extern union { |
| 2953 | 2962 | .vector => return AbiAlignmentAdvanced{ .scalar = 16 }, |
| 2954 | 2963 | |
| 2955 | 2964 | .i16, .u16 => return AbiAlignmentAdvanced{ .scalar = intAbiAlignment(16, target) }, |
| 2965 | .u29 => return AbiAlignmentAdvanced{ .scalar = intAbiAlignment(29, target) }, | |
| 2956 | 2966 | .i32, .u32 => return AbiAlignmentAdvanced{ .scalar = intAbiAlignment(32, target) }, |
| 2957 | 2967 | .i64, .u64 => return AbiAlignmentAdvanced{ .scalar = intAbiAlignment(64, target) }, |
| 2958 | 2968 | .u128, .i128 => return AbiAlignmentAdvanced{ .scalar = intAbiAlignment(128, target) }, |
| ... | ... | @@ -3416,6 +3426,7 @@ pub const Type = extern union { |
| 3416 | 3426 | }, |
| 3417 | 3427 | |
| 3418 | 3428 | .i16, .u16 => return AbiSizeAdvanced{ .scalar = intAbiSize(16, target) }, |
| 3429 | .u29 => return AbiSizeAdvanced{ .scalar = intAbiSize(29, target) }, | |
| 3419 | 3430 | .i32, .u32 => return AbiSizeAdvanced{ .scalar = intAbiSize(32, target) }, |
| 3420 | 3431 | .i64, .u64 => return AbiSizeAdvanced{ .scalar = intAbiSize(64, target) }, |
| 3421 | 3432 | .u128, .i128 => return AbiSizeAdvanced{ .scalar = intAbiSize(128, target) }, |
| ... | ... | @@ -3569,6 +3580,7 @@ pub const Type = extern union { |
| 3569 | 3580 | .bool, .u1 => 1, |
| 3570 | 3581 | .u8, .i8 => 8, |
| 3571 | 3582 | .i16, .u16, .f16 => 16, |
| 3583 | .u29 => 29, | |
| 3572 | 3584 | .i32, .u32, .f32 => 32, |
| 3573 | 3585 | .i64, .u64, .f64 => 64, |
| 3574 | 3586 | .f80 => 80, |
| ... | ... | @@ -4524,6 +4536,7 @@ pub const Type = extern union { |
| 4524 | 4536 | .u1, |
| 4525 | 4537 | .u8, |
| 4526 | 4538 | .u16, |
| 4539 | .u29, | |
| 4527 | 4540 | .u32, |
| 4528 | 4541 | .u64, |
| 4529 | 4542 | .u128, |
| ... | ... | @@ -4550,6 +4563,7 @@ pub const Type = extern union { |
| 4550 | 4563 | .i8 => return .{ .signedness = .signed, .bits = 8 }, |
| 4551 | 4564 | .u16 => return .{ .signedness = .unsigned, .bits = 16 }, |
| 4552 | 4565 | .i16 => return .{ .signedness = .signed, .bits = 16 }, |
| 4566 | .u29 => return .{ .signedness = .unsigned, .bits = 29 }, | |
| 4553 | 4567 | .u32 => return .{ .signedness = .unsigned, .bits = 32 }, |
| 4554 | 4568 | .i32 => return .{ .signedness = .signed, .bits = 32 }, |
| 4555 | 4569 | .u64 => return .{ .signedness = .unsigned, .bits = 64 }, |
| ... | ... | @@ -4814,6 +4828,7 @@ pub const Type = extern union { |
| 4814 | 4828 | .i8, |
| 4815 | 4829 | .u16, |
| 4816 | 4830 | .i16, |
| 4831 | .u29, | |
| 4817 | 4832 | .u32, |
| 4818 | 4833 | .i32, |
| 4819 | 4834 | .u64, |
| ... | ... | @@ -4856,6 +4871,7 @@ pub const Type = extern union { |
| 4856 | 4871 | .i8, |
| 4857 | 4872 | .u16, |
| 4858 | 4873 | .i16, |
| 4874 | .u29, | |
| 4859 | 4875 | .u32, |
| 4860 | 4876 | .i32, |
| 4861 | 4877 | .u64, |
| ... | ... | @@ -5072,6 +5088,7 @@ pub const Type = extern union { |
| 5072 | 5088 | .i8, |
| 5073 | 5089 | .u16, |
| 5074 | 5090 | .i16, |
| 5091 | .u29, | |
| 5075 | 5092 | .u32, |
| 5076 | 5093 | .i32, |
| 5077 | 5094 | .u64, |
| ... | ... | @@ -5816,6 +5833,7 @@ pub const Type = extern union { |
| 5816 | 5833 | i8, |
| 5817 | 5834 | u16, |
| 5818 | 5835 | i16, |
| 5836 | u29, | |
| 5819 | 5837 | u32, |
| 5820 | 5838 | i32, |
| 5821 | 5839 | u64, |
| ... | ... | @@ -5939,6 +5957,7 @@ pub const Type = extern union { |
| 5939 | 5957 | .i8, |
| 5940 | 5958 | .u16, |
| 5941 | 5959 | .i16, |
| 5960 | .u29, | |
| 5942 | 5961 | .u32, |
| 5943 | 5962 | .i32, |
| 5944 | 5963 | .u64, |
| ... | ... | @@ -6302,6 +6321,7 @@ pub const Type = extern union { |
| 6302 | 6321 | pub const @"u1" = initTag(.u1); |
| 6303 | 6322 | pub const @"u8" = initTag(.u8); |
| 6304 | 6323 | pub const @"u16" = initTag(.u16); |
| 6324 | pub const @"u29" = initTag(.u29); | |
| 6305 | 6325 | pub const @"u32" = initTag(.u32); |
| 6306 | 6326 | pub const @"u64" = initTag(.u64); |
| 6307 | 6327 |
src/value.zig+7-2| ... | ... | @@ -30,6 +30,7 @@ pub const Value = extern union { |
| 30 | 30 | i8_type, |
| 31 | 31 | u16_type, |
| 32 | 32 | i16_type, |
| 33 | u29_type, | |
| 33 | 34 | u32_type, |
| 34 | 35 | i32_type, |
| 35 | 36 | u64_type, |
| ... | ... | @@ -196,6 +197,7 @@ pub const Value = extern union { |
| 196 | 197 | .i8_type, |
| 197 | 198 | .u16_type, |
| 198 | 199 | .i16_type, |
| 200 | .u29_type, | |
| 199 | 201 | .u32_type, |
| 200 | 202 | .i32_type, |
| 201 | 203 | .u64_type, |
| ... | ... | @@ -397,6 +399,7 @@ pub const Value = extern union { |
| 397 | 399 | .i8_type, |
| 398 | 400 | .u16_type, |
| 399 | 401 | .i16_type, |
| 402 | .u29_type, | |
| 400 | 403 | .u32_type, |
| 401 | 404 | .i32_type, |
| 402 | 405 | .u64_type, |
| ... | ... | @@ -660,6 +663,7 @@ pub const Value = extern union { |
| 660 | 663 | .u8_type => return out_stream.writeAll("u8"), |
| 661 | 664 | .i8_type => return out_stream.writeAll("i8"), |
| 662 | 665 | .u16_type => return out_stream.writeAll("u16"), |
| 666 | .u29_type => return out_stream.writeAll("u29"), | |
| 663 | 667 | .i16_type => return out_stream.writeAll("i16"), |
| 664 | 668 | .u32_type => return out_stream.writeAll("u32"), |
| 665 | 669 | .i32_type => return out_stream.writeAll("i32"), |
| ... | ... | @@ -900,6 +904,7 @@ pub const Value = extern union { |
| 900 | 904 | .i8_type => Type.initTag(.i8), |
| 901 | 905 | .u16_type => Type.initTag(.u16), |
| 902 | 906 | .i16_type => Type.initTag(.i16), |
| 907 | .u29_type => Type.initTag(.u29), | |
| 903 | 908 | .u32_type => Type.initTag(.u32), |
| 904 | 909 | .i32_type => Type.initTag(.i32), |
| 905 | 910 | .u64_type => Type.initTag(.u64), |
| ... | ... | @@ -4905,7 +4910,7 @@ pub const Value = extern union { |
| 4905 | 4910 | /// `Module.resolvePeerTypes`. |
| 4906 | 4911 | stored_inst_list: std.ArrayListUnmanaged(Air.Inst.Ref) = .{}, |
| 4907 | 4912 | /// 0 means ABI-aligned. |
| 4908 | alignment: u16, | |
| 4913 | alignment: u32, | |
| 4909 | 4914 | }, |
| 4910 | 4915 | }; |
| 4911 | 4916 | |
| ... | ... | @@ -4916,7 +4921,7 @@ pub const Value = extern union { |
| 4916 | 4921 | data: struct { |
| 4917 | 4922 | decl_index: Module.Decl.Index, |
| 4918 | 4923 | /// 0 means ABI-aligned. |
| 4919 | alignment: u16, | |
| 4924 | alignment: u32, | |
| 4920 | 4925 | }, |
| 4921 | 4926 | }; |
| 4922 | 4927 |