| ... | @@ -3642,8 +3642,17 @@ pub const FuncGen = struct { | ... | @@ -3642,8 +3642,17 @@ pub const FuncGen = struct { |
| 3642 | } | 3642 | } |
| 3643 | | 3643 | |
| 3644 | fn airCmpVector(self: *FuncGen, inst: Air.Inst.Index) !?*const llvm.Value { | 3644 | fn airCmpVector(self: *FuncGen, inst: Air.Inst.Index) !?*const llvm.Value { |
| 3645 | _ = inst; | 3645 | if (self.liveness.isUnused(inst)) return null; |
| 3646 | return self.todo("implement airCmpVector"); | 3646 | |
| | 3647 | const ty_pl = self.air.instructions.items(.data)[inst].ty_pl; |
| | 3648 | const extra = self.air.extraData(Air.VectorCmp, ty_pl.payload).data; |
| | 3649 | |
| | 3650 | const lhs = try self.resolveInst(extra.lhs); |
| | 3651 | const rhs = try self.resolveInst(extra.rhs); |
| | 3652 | const vec_ty = self.air.typeOf(extra.lhs); |
| | 3653 | const cmp_op = extra.compareOperator(); |
| | 3654 | |
| | 3655 | return self.cmp(lhs, rhs, vec_ty, cmp_op); |
| 3647 | } | 3656 | } |
| 3648 | | 3657 | |
| 3649 | fn cmp( | 3658 | fn cmp( |
| ... | @@ -3656,9 +3665,10 @@ pub const FuncGen = struct { | ... | @@ -3656,9 +3665,10 @@ pub const FuncGen = struct { |
| 3656 | var int_buffer: Type.Payload.Bits = undefined; | 3665 | var int_buffer: Type.Payload.Bits = undefined; |
| 3657 | var opt_buffer: Type.Payload.ElemType = undefined; | 3666 | var opt_buffer: Type.Payload.ElemType = undefined; |
| 3658 | | 3667 | |
| 3659 | const int_ty = switch (operand_ty.zigTypeTag()) { | 3668 | const scalar_ty = operand_ty.scalarType(); |
| 3660 | .Enum => operand_ty.intTagType(&int_buffer), | 3669 | const int_ty = switch (scalar_ty.zigTypeTag()) { |
| 3661 | .Int, .Bool, .Pointer, .ErrorSet => operand_ty, | 3670 | .Enum => scalar_ty.intTagType(&int_buffer), |
| | 3671 | .Int, .Bool, .Pointer, .ErrorSet => scalar_ty, |
| 3662 | .Optional => blk: { | 3672 | .Optional => blk: { |
| 3663 | const payload_ty = operand_ty.optionalChild(&opt_buffer); | 3673 | const payload_ty = operand_ty.optionalChild(&opt_buffer); |
| 3664 | if (!payload_ty.hasRuntimeBitsIgnoreComptime() or operand_ty.isPtrLikeOptional()) { | 3674 | if (!payload_ty.hasRuntimeBitsIgnoreComptime() or operand_ty.isPtrLikeOptional()) { |