| ... | @@ -11261,7 +11261,12 @@ fn zirDiv(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.Ins | ... | @@ -11261,7 +11261,12 @@ fn zirDiv(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.Ins |
| 11261 | try sema.addDivByZeroSafety(block, resolved_type, maybe_rhs_val, casted_rhs, is_int); | 11261 | try sema.addDivByZeroSafety(block, resolved_type, maybe_rhs_val, casted_rhs, is_int); |
| 11262 | } | 11262 | } |
| 11263 | | 11263 | |
| 11264 | const air_tag = if (is_int) Air.Inst.Tag.div_trunc else switch (block.float_mode) { | 11264 | const air_tag = if (is_int) blk: { |
| | 11265 | if (lhs_ty.isSignedInt() or rhs_ty.isSignedInt()) { |
| | 11266 | return sema.fail(block, src, "division with '{s}' and '{s}': signed integers must use @divTrunc, @divFloor, or @divExact", .{ @tagName(lhs_ty.tag()), @tagName(rhs_ty.tag()) }); |
| | 11267 | } |
| | 11268 | break :blk Air.Inst.Tag.div_trunc; |
| | 11269 | } else switch (block.float_mode) { |
| 11265 | .Optimized => Air.Inst.Tag.div_float_optimized, | 11270 | .Optimized => Air.Inst.Tag.div_float_optimized, |
| 11266 | .Strict => Air.Inst.Tag.div_float, | 11271 | .Strict => Air.Inst.Tag.div_float, |
| 11267 | }; | 11272 | }; |