| ... | @@ -5723,7 +5723,16 @@ pub const WipFunction = struct { | ... | @@ -5723,7 +5723,16 @@ pub const WipFunction = struct { |
| 5723 | .void => null, | 5723 | .void => null, |
| 5724 | else => name, | 5724 | else => name, |
| 5725 | }, .{ | 5725 | }, .{ |
| 5726 | .tag = .call, | 5726 | .tag = switch (kind) { |
| | 5727 | .normal => .call, |
| | 5728 | .fast => .@"call fast", |
| | 5729 | .musttail => .@"musttail call", |
| | 5730 | .musttail_fast => .@"musttail call fast", |
| | 5731 | .notail => .@"notail call", |
| | 5732 | .notail_fast => .@"notail call fast", |
| | 5733 | .tail => .@"tail call", |
| | 5734 | .tail_fast => .@"tail call fast", |
| | 5735 | }, |
| 5727 | .data = self.addExtraAssumeCapacity(Instruction.Call{ | 5736 | .data = self.addExtraAssumeCapacity(Instruction.Call{ |
| 5728 | .info = .{ .call_conv = call_conv }, | 5737 | .info = .{ .call_conv = call_conv }, |
| 5729 | .attributes = function_attributes, | 5738 | .attributes = function_attributes, |
| ... | @@ -7312,9 +7321,34 @@ pub const Constant = enum(u32) { | ... | @@ -7312,9 +7321,34 @@ pub const Constant = enum(u32) { |
| 7312 | .bfloat => 16, | 7321 | .bfloat => 16, |
| 7313 | else => unreachable, | 7322 | else => unreachable, |
| 7314 | } }), | 7323 | } }), |
| 7315 | .float => try writer.print("0x{X:0>16}", .{ | 7324 | .float => { |
| 7316 | @as(u64, @bitCast(@as(f64, @as(f32, @bitCast(item.data))))), | 7325 | const Float = struct { |
| 7317 | }), | 7326 | fn Repr(comptime T: type) type { |
| | 7327 | return packed struct(std.meta.Int(.unsigned, @bitSizeOf(T))) { |
| | 7328 | mantissa: std.meta.Int(.unsigned, std.math.floatMantissaBits(T)), |
| | 7329 | exponent: std.meta.Int(.unsigned, std.math.floatExponentBits(T)), |
| | 7330 | sign: u1, |
| | 7331 | }; |
| | 7332 | } |
| | 7333 | }; |
| | 7334 | const Exponent32 = std.meta.FieldType(Float.Repr(f32), .exponent); |
| | 7335 | const Exponent64 = std.meta.FieldType(Float.Repr(f64), .exponent); |
| | 7336 | const repr: Float.Repr(f32) = @bitCast(item.data); |
| | 7337 | try writer.print("0x{X:0>16}", .{@as(u64, @bitCast(Float.Repr(f64){ |
| | 7338 | .mantissa = std.math.shl( |
| | 7339 | std.meta.FieldType(Float.Repr(f64), .mantissa), |
| | 7340 | repr.mantissa, |
| | 7341 | std.math.floatMantissaBits(f64) - std.math.floatMantissaBits(f32), |
| | 7342 | ), |
| | 7343 | .exponent = switch (repr.exponent) { |
| | 7344 | std.math.minInt(Exponent32) => std.math.minInt(Exponent64), |
| | 7345 | else => @as(Exponent64, repr.exponent) + |
| | 7346 | (std.math.floatExponentMax(f64) - std.math.floatExponentMax(f32)), |
| | 7347 | std.math.maxInt(Exponent32) => std.math.maxInt(Exponent64), |
| | 7348 | }, |
| | 7349 | .sign = repr.sign, |
| | 7350 | }))}); |
| | 7351 | }, |
| 7318 | .double => { | 7352 | .double => { |
| 7319 | const extra = data.builder.constantExtraData(Double, item.data); | 7353 | const extra = data.builder.constantExtraData(Double, item.data); |
| 7320 | try writer.print("0x{X:0>8}{X:0>8}", .{ extra.hi, extra.lo }); | 7354 | try writer.print("0x{X:0>8}{X:0>8}", .{ extra.hi, extra.lo }); |
| ... | @@ -8361,6 +8395,7 @@ pub fn getIntrinsic( | ... | @@ -8361,6 +8395,7 @@ pub fn getIntrinsic( |
| 8361 | | 8395 | |
| 8362 | var overload_index: usize = 0; | 8396 | var overload_index: usize = 0; |
| 8363 | function_attributes[FunctionAttributes.function_index] = try attributes.get(signature.attrs); | 8397 | function_attributes[FunctionAttributes.function_index] = try attributes.get(signature.attrs); |
| | 8398 | function_attributes[FunctionAttributes.return_index] = .none; // needed for void return |
| 8364 | for (0.., param_types, signature.params) |param_index, *param_type, signature_param| { | 8399 | for (0.., param_types, signature.params) |param_index, *param_type, signature_param| { |
| 8365 | switch (signature_param.kind) { | 8400 | switch (signature_param.kind) { |
| 8366 | .type => |ty| param_type.* = ty, | 8401 | .type => |ty| param_type.* = ty, |
| ... | @@ -9573,7 +9608,7 @@ fn fnTypeAssumeCapacity( | ... | @@ -9573,7 +9608,7 @@ fn fnTypeAssumeCapacity( |
| 9573 | gop.key_ptr.* = {}; | 9608 | gop.key_ptr.* = {}; |
| 9574 | gop.value_ptr.* = {}; | 9609 | gop.value_ptr.* = {}; |
| 9575 | self.type_items.appendAssumeCapacity(.{ | 9610 | self.type_items.appendAssumeCapacity(.{ |
| 9576 | .tag = .function, | 9611 | .tag = tag, |
| 9577 | .data = self.addTypeExtraAssumeCapacity(Type.Function{ | 9612 | .data = self.addTypeExtraAssumeCapacity(Type.Function{ |
| 9578 | .ret = ret, | 9613 | .ret = ret, |
| 9579 | .params_len = @intCast(params.len), | 9614 | .params_len = @intCast(params.len), |