| ... | @@ -11450,7 +11450,11 @@ fn addDivIntOverflowSafety( | ... | @@ -11450,7 +11450,11 @@ fn addDivIntOverflowSafety( |
| 11450 | } | 11450 | } |
| 11451 | | 11451 | |
| 11452 | const min_int = try resolved_type.minInt(sema.arena, target); | 11452 | const min_int = try resolved_type.minInt(sema.arena, target); |
| 11453 | const neg_one = try Value.Tag.int_i64.create(sema.arena, -1); | 11453 | const neg_one_scalar = try Value.Tag.int_i64.create(sema.arena, -1); |
| | 11454 | const neg_one = if (resolved_type.zigTypeTag() == .Vector) |
| | 11455 | try Value.Tag.repeated.create(sema.arena, neg_one_scalar) |
| | 11456 | else |
| | 11457 | neg_one_scalar; |
| 11454 | | 11458 | |
| 11455 | // If the LHS is comptime-known to be not equal to the min int, | 11459 | // If the LHS is comptime-known to be not equal to the min int, |
| 11456 | // no overflow is possible. | 11460 | // no overflow is possible. |
| ... | @@ -11467,17 +11471,11 @@ fn addDivIntOverflowSafety( | ... | @@ -11467,17 +11471,11 @@ fn addDivIntOverflowSafety( |
| 11467 | if (resolved_type.zigTypeTag() == .Vector) { | 11471 | if (resolved_type.zigTypeTag() == .Vector) { |
| 11468 | const vector_ty_ref = try sema.addType(resolved_type); | 11472 | const vector_ty_ref = try sema.addType(resolved_type); |
| 11469 | if (maybe_lhs_val == null) { | 11473 | if (maybe_lhs_val == null) { |
| 11470 | const min_int_ref = try sema.addConstant( | 11474 | const min_int_ref = try sema.addConstant(resolved_type, min_int); |
| 11471 | resolved_type, | | |
| 11472 | try Value.Tag.repeated.create(sema.arena, min_int), | | |
| 11473 | ); | | |
| 11474 | ok = try block.addCmpVector(casted_lhs, min_int_ref, .neq, vector_ty_ref); | 11475 | ok = try block.addCmpVector(casted_lhs, min_int_ref, .neq, vector_ty_ref); |
| 11475 | } | 11476 | } |
| 11476 | if (maybe_rhs_val == null) { | 11477 | if (maybe_rhs_val == null) { |
| 11477 | const neg_one_ref = try sema.addConstant( | 11478 | const neg_one_ref = try sema.addConstant(resolved_type, neg_one); |
| 11478 | resolved_type, | | |
| 11479 | try Value.Tag.repeated.create(sema.arena, neg_one), | | |
| 11480 | ); | | |
| 11481 | const rhs_ok = try block.addCmpVector(casted_rhs, neg_one_ref, .neq, vector_ty_ref); | 11479 | const rhs_ok = try block.addCmpVector(casted_rhs, neg_one_ref, .neq, vector_ty_ref); |
| 11482 | if (ok == .none) { | 11480 | if (ok == .none) { |
| 11483 | ok = rhs_ok; | 11481 | ok = rhs_ok; |