| ... | ... | @@ -548,8 +548,8 @@ fn genBody(self: *Self, body: []const Air.Inst.Index) InnerError!void { |
| 548 | 548 | .cmp_vector => @panic("TODO try self.airCmpVector(inst)"), |
| 549 | 549 | .cmp_lt_errors_len => try self.airCmpLtErrorsLen(inst), |
| 550 | 550 | |
| 551 | | .bool_and => @panic("TODO try self.airBoolOp(inst)"), |
| 552 | | .bool_or => @panic("TODO try self.airBoolOp(inst)"), |
| 551 | .bool_and => try self.airBinOp(inst, .bool_and), |
| 552 | .bool_or => try self.airBinOp(inst, .bool_or), |
| 553 | 553 | .bit_and => try self.airBinOp(inst, .bit_and), |
| 554 | 554 | .bit_or => try self.airBinOp(inst, .bit_or), |
| 555 | 555 | .xor => try self.airBinOp(inst, .xor), |
| ... | ... | @@ -2525,6 +2525,26 @@ fn binOp( |
| 2525 | 2525 | } |
| 2526 | 2526 | }, |
| 2527 | 2527 | |
| 2528 | .bool_and, |
| 2529 | .bool_or, |
| 2530 | => { |
| 2531 | switch (lhs_ty.zigTypeTag()) { |
| 2532 | .Bool => { |
| 2533 | assert(lhs != .immediate); // should have been handled by Sema |
| 2534 | assert(rhs != .immediate); // should have been handled by Sema |
| 2535 | |
| 2536 | const mir_tag: Mir.Inst.Tag = switch (tag) { |
| 2537 | .bool_and => .@"and", |
| 2538 | .bool_or => .@"or", |
| 2539 | else => unreachable, |
| 2540 | }; |
| 2541 | |
| 2542 | return try self.binOpRegister(mir_tag, lhs, rhs, lhs_ty, rhs_ty, metadata); |
| 2543 | }, |
| 2544 | else => unreachable, |
| 2545 | } |
| 2546 | }, |
| 2547 | |
| 2528 | 2548 | .shl => { |
| 2529 | 2549 | const base_tag: Air.Inst.Tag = switch (tag) { |
| 2530 | 2550 | .shl => .shl_exact, |