| ... | ... | @@ -30158,15 +30158,19 @@ fn cmpVector( |
| 30158 | 30158 | assert(rhs_ty.zigTypeTag() == .Vector); |
| 30159 | 30159 | try sema.checkVectorizableBinaryOperands(block, src, lhs_ty, rhs_ty, lhs_src, rhs_src); |
| 30160 | 30160 | |
| 30161 | const resolved_ty = try sema.resolvePeerTypes(block, src, &.{ lhs, rhs }, .{ .override = &.{ lhs_src, rhs_src } }); |
| 30162 | const casted_lhs = try sema.coerce(block, resolved_ty, lhs, lhs_src); |
| 30163 | const casted_rhs = try sema.coerce(block, resolved_ty, rhs, rhs_src); |
| 30164 | |
| 30161 | 30165 | const result_ty = try Type.vector(sema.arena, lhs_ty.vectorLen(), Type.bool); |
| 30162 | 30166 | |
| 30163 | 30167 | const runtime_src: LazySrcLoc = src: { |
| 30164 | | if (try sema.resolveMaybeUndefVal(lhs)) |lhs_val| { |
| 30165 | | if (try sema.resolveMaybeUndefVal(rhs)) |rhs_val| { |
| 30168 | if (try sema.resolveMaybeUndefVal(casted_lhs)) |lhs_val| { |
| 30169 | if (try sema.resolveMaybeUndefVal(casted_rhs)) |rhs_val| { |
| 30166 | 30170 | if (lhs_val.isUndef() or rhs_val.isUndef()) { |
| 30167 | 30171 | return sema.addConstUndef(result_ty); |
| 30168 | 30172 | } |
| 30169 | | const cmp_val = try sema.compareVector(lhs_val, op, rhs_val, lhs_ty); |
| 30173 | const cmp_val = try sema.compareVector(lhs_val, op, rhs_val, resolved_ty); |
| 30170 | 30174 | return sema.addConstant(result_ty, cmp_val); |
| 30171 | 30175 | } else { |
| 30172 | 30176 | break :src rhs_src; |
| ... | ... | @@ -30177,7 +30181,7 @@ fn cmpVector( |
| 30177 | 30181 | }; |
| 30178 | 30182 | |
| 30179 | 30183 | try sema.requireRuntimeBlock(block, src, runtime_src); |
| 30180 | | return block.addCmpVector(lhs, rhs, op); |
| 30184 | return block.addCmpVector(casted_lhs, casted_rhs, op); |
| 30181 | 30185 | } |
| 30182 | 30186 | |
| 30183 | 30187 | fn wrapOptional( |