| ... | ... | @@ -53,9 +53,12 @@ tracked_allocas: std.AutoHashMapUnmanaged(Id, ?Id) = .empty, |
| 53 | 53 | loop_switches: std.AutoHashMapUnmanaged(Air.Inst.Index, LoopSwitch) = .empty, |
| 54 | 54 | id_scratch: std.ArrayList(Id) = .empty, |
| 55 | 55 | |
| 56 | fn hasInt64(target: *const std.Target) bool { |
| 57 | return target.cpu.arch == .spirv64 or target.cpu.has(.spirv, .int64); |
| 58 | } |
| 59 | |
| 56 | 60 | fn bigIntBits(cg: *const CodeGen) u16 { |
| 57 | | const target = cg.zcu.getTarget(); |
| 58 | | return if (target.cpu.has(.spirv, .int64)) 64 else 32; |
| 61 | return if (hasInt64(cg.zcu.getTarget())) 64 else 32; |
| 59 | 62 | } |
| 60 | 63 | |
| 61 | 64 | fn limbType(cg: *const CodeGen) Type { |
| ... | ... | @@ -487,7 +490,7 @@ pub fn backingIntBits(cg: *const CodeGen, bits: u16) struct { u16, bool } { |
| 487 | 490 | .{ .bits = 8, .enabled = target.cpu.has(.spirv, .int8) }, |
| 488 | 491 | .{ .bits = 16, .enabled = target.cpu.has(.spirv, .int16) }, |
| 489 | 492 | .{ .bits = 32, .enabled = true }, |
| 490 | | .{ .bits = 64, .enabled = target.cpu.has(.spirv, .int64) or target.cpu.arch == .spirv64 }, |
| 493 | .{ .bits = 64, .enabled = hasInt64(target) }, |
| 491 | 494 | }; |
| 492 | 495 | |
| 493 | 496 | for (ints) |int| { |
| ... | ... | @@ -5273,7 +5276,7 @@ fn airMulOverflow(cg: *CodeGen, inst: Air.Inst.Index) !?Id { |
| 5273 | 5276 | // of the result too. |
| 5274 | 5277 | |
| 5275 | 5278 | const target = cg.zcu.getTarget(); |
| 5276 | | const largest_int_bits: u16 = if (target.cpu.has(.spirv, .int64) or target.cpu.arch == .spirv64) 64 else 32; |
| 5279 | const largest_int_bits: u16 = if (hasInt64(target)) 64 else 32; |
| 5277 | 5280 | // If non-null, the number of bits that the multiplication should be performed in. If |
| 5278 | 5281 | // null, we have to use wide multiplication. |
| 5279 | 5282 | const maybe_op_ty_bits: ?u16 = switch (info.bits) { |