| ... | @@ -3591,6 +3591,10 @@ fn airOverflow(f: *Function, inst: Air.Inst.Index, operation: []const u8, info: | ... | @@ -3591,6 +3591,10 @@ fn airOverflow(f: *Function, inst: Air.Inst.Index, operation: []const u8, info: |
| 3591 | } | 3591 | } |
| 3592 | | 3592 | |
| 3593 | fn airNot(f: *Function, inst: Air.Inst.Index) !CValue { | 3593 | fn airNot(f: *Function, inst: Air.Inst.Index) !CValue { |
| | 3594 | const inst_ty = f.air.typeOfIndex(inst); |
| | 3595 | if (inst_ty.tag() != .bool) |
| | 3596 | return try airUnBuiltinCall(f, inst, "not", .Bits); |
| | 3597 | |
| 3594 | const ty_op = f.air.instructions.items(.data)[inst].ty_op; | 3598 | const ty_op = f.air.instructions.items(.data)[inst].ty_op; |
| 3595 | | 3599 | |
| 3596 | if (f.liveness.isUnused(inst)) { | 3600 | if (f.liveness.isUnused(inst)) { |
| ... | @@ -3602,11 +3606,10 @@ fn airNot(f: *Function, inst: Air.Inst.Index) !CValue { | ... | @@ -3602,11 +3606,10 @@ fn airNot(f: *Function, inst: Air.Inst.Index) !CValue { |
| 3602 | try reap(f, inst, &.{ty_op.operand}); | 3606 | try reap(f, inst, &.{ty_op.operand}); |
| 3603 | | 3607 | |
| 3604 | const writer = f.object.writer(); | 3608 | const writer = f.object.writer(); |
| 3605 | const inst_ty = f.air.typeOfIndex(inst); | | |
| 3606 | const local = try f.allocLocal(inst, inst_ty); | 3609 | const local = try f.allocLocal(inst, inst_ty); |
| 3607 | try f.writeCValue(writer, local, .Other); | 3610 | try f.writeCValue(writer, local, .Other); |
| 3608 | try writer.writeAll(" = "); | 3611 | try writer.writeAll(" = "); |
| 3609 | try writer.writeByte(if (inst_ty.tag() == .bool) '!' else '~'); | 3612 | try writer.writeByte('!'); |
| 3610 | try f.writeCValue(writer, op, .Other); | 3613 | try f.writeCValue(writer, op, .Other); |
| 3611 | try writer.writeAll(";\n"); | 3614 | try writer.writeAll(";\n"); |
| 3612 | | 3615 | |