| ... | @@ -11470,9 +11470,13 @@ fn airFloatFromInt(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -11470,9 +11470,13 @@ fn airFloatFromInt(self: *Self, inst: Air.Inst.Index) !void { |
| 11470 | const result = result: { | 11470 | const result = result: { |
| 11471 | if (switch (dst_bits) { | 11471 | if (switch (dst_bits) { |
| 11472 | 16, 80, 128 => true, | 11472 | 16, 80, 128 => true, |
| 11473 | 32, 64 => src_size > 8 and src_size < 16, | 11473 | 32, 64 => src_size > 8, |
| 11474 | else => unreachable, | 11474 | else => unreachable, |
| 11475 | }) { | 11475 | }) { |
| | 11476 | if (src_bits > 128) return self.fail("TODO implement airFloatFromInt from {} to {}", .{ |
| | 11477 | src_ty.fmt(mod), dst_ty.fmt(mod), |
| | 11478 | }); |
| | 11479 | |
| 11476 | var callee: ["__floatun?i?f".len]u8 = undefined; | 11480 | var callee: ["__floatun?i?f".len]u8 = undefined; |
| 11477 | break :result try self.genCall(.{ .lib = .{ | 11481 | break :result try self.genCall(.{ .lib = .{ |
| 11478 | .return_type = dst_ty.toIntern(), | 11482 | .return_type = dst_ty.toIntern(), |
| ... | @@ -11488,10 +11492,6 @@ fn airFloatFromInt(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -11488,10 +11492,6 @@ fn airFloatFromInt(self: *Self, inst: Air.Inst.Index) !void { |
| 11488 | } }, &.{src_ty}, &.{.{ .air_ref = ty_op.operand }}); | 11492 | } }, &.{src_ty}, &.{.{ .air_ref = ty_op.operand }}); |
| 11489 | } | 11493 | } |
| 11490 | | 11494 | |
| 11491 | if (src_size > 8) return self.fail("TODO implement airFloatFromInt from {} to {}", .{ | | |
| 11492 | src_ty.fmt(mod), dst_ty.fmt(mod), | | |
| 11493 | }); | | |
| 11494 | | | |
| 11495 | const src_mcv = try self.resolveInst(ty_op.operand); | 11495 | const src_mcv = try self.resolveInst(ty_op.operand); |
| 11496 | const src_reg = if (src_mcv.isRegister()) | 11496 | const src_reg = if (src_mcv.isRegister()) |
| 11497 | src_mcv.getReg().? | 11497 | src_mcv.getReg().? |
| ... | @@ -11549,9 +11549,13 @@ fn airIntFromFloat(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -11549,9 +11549,13 @@ fn airIntFromFloat(self: *Self, inst: Air.Inst.Index) !void { |
| 11549 | const result = result: { | 11549 | const result = result: { |
| 11550 | if (switch (src_bits) { | 11550 | if (switch (src_bits) { |
| 11551 | 16, 80, 128 => true, | 11551 | 16, 80, 128 => true, |
| 11552 | 32, 64 => dst_size > 8 and dst_size < 16, | 11552 | 32, 64 => dst_size > 8, |
| 11553 | else => unreachable, | 11553 | else => unreachable, |
| 11554 | }) { | 11554 | }) { |
| | 11555 | if (dst_bits > 128) return self.fail("TODO implement airIntFromFloat from {} to {}", .{ |
| | 11556 | src_ty.fmt(mod), dst_ty.fmt(mod), |
| | 11557 | }); |
| | 11558 | |
| 11555 | var callee: ["__fixuns?f?i".len]u8 = undefined; | 11559 | var callee: ["__fixuns?f?i".len]u8 = undefined; |
| 11556 | break :result try self.genCall(.{ .lib = .{ | 11560 | break :result try self.genCall(.{ .lib = .{ |
| 11557 | .return_type = dst_ty.toIntern(), | 11561 | .return_type = dst_ty.toIntern(), |
| ... | @@ -11567,10 +11571,6 @@ fn airIntFromFloat(self: *Self, inst: Air.Inst.Index) !void { | ... | @@ -11567,10 +11571,6 @@ fn airIntFromFloat(self: *Self, inst: Air.Inst.Index) !void { |
| 11567 | } }, &.{src_ty}, &.{.{ .air_ref = ty_op.operand }}); | 11571 | } }, &.{src_ty}, &.{.{ .air_ref = ty_op.operand }}); |
| 11568 | } | 11572 | } |
| 11569 | | 11573 | |
| 11570 | if (dst_size > 8) return self.fail("TODO implement airIntFromFloat from {} to {}", .{ | | |
| 11571 | src_ty.fmt(mod), dst_ty.fmt(mod), | | |
| 11572 | }); | | |
| 11573 | | | |
| 11574 | const src_mcv = try self.resolveInst(ty_op.operand); | 11574 | const src_mcv = try self.resolveInst(ty_op.operand); |
| 11575 | const src_reg = if (src_mcv.isRegister()) | 11575 | const src_reg = if (src_mcv.isRegister()) |
| 11576 | src_mcv.getReg().? | 11576 | src_mcv.getReg().? |