| ... | ... | @@ -1261,10 +1261,14 @@ fn airSlicePtr(self: *Self, inst: Air.Inst.Index) !void { |
| 1261 | 1261 | |
| 1262 | 1262 | fn airSliceLen(self: *Self, inst: Air.Inst.Index) !void { |
| 1263 | 1263 | const ty_op = self.air.instructions.items(.data)[inst].ty_op; |
| 1264 | | const result: MCValue = if (self.liveness.isUnused(inst)) |
| 1265 | | .dead |
| 1266 | | else |
| 1267 | | return self.fail("TODO implement slice_len for {}", .{self.target.cpu.arch}); |
| 1264 | const result: MCValue = if (self.liveness.isUnused(inst)) .dead else result: { |
| 1265 | const operand = try self.resolveInst(ty_op.operand); |
| 1266 | const dst_mcv: MCValue = switch (operand) { |
| 1267 | .stack_offset => |off| MCValue{ .stack_offset = off + 4 }, |
| 1268 | else => return self.fail("TODO implement slice_len for {}", .{operand}), |
| 1269 | }; |
| 1270 | break :result dst_mcv; |
| 1271 | }; |
| 1268 | 1272 | return self.finishAir(inst, result, .{ ty_op.operand, .none, .none }); |
| 1269 | 1273 | } |
| 1270 | 1274 | |