@@ -3119,43 +3119,30 @@ static bool interp__builtin_cmp_mask(InterpState &S, CodePtr OpPC,
31193119
31203120 for (unsigned ElemNum = 0 ; ElemNum < VectorLen; ++ElemNum) {
31213121 INT_TYPE_SWITCH_NO_BOOL (ElemT, {
3122- APSInt B = RHS.elem <T>(ElemNum).toAPSInt ();
3122+ const APSInt &A = LHS.elem <T>(ElemNum).toAPSInt ();
3123+ const APSInt &B = RHS.elem <T>(ElemNum).toAPSInt ();
31233124 bool Result = false ;
31243125 switch (Opcode.getExtValue () & 0x7 ) {
31253126 case 0x00 : // _MM_CMPINT_EQ
3126- Result = (LHS.elem <T>(ElemNum).toAPSInt () ==
3127- RHS.elem <T>(ElemNum).toAPSInt ());
3127+ Result = (A == B);
31283128 break ;
31293129 case 0x01 : // _MM_CMPINT_LT
3130- Result = IsUnsigned ? LHS.elem <T>(ElemNum).toAPSInt ().ult (
3131- RHS.elem <T>(ElemNum).toAPSInt ())
3132- : LHS.elem <T>(ElemNum).toAPSInt ().slt (
3133- RHS.elem <T>(ElemNum).toAPSInt ());
3130+ Result = IsUnsigned ? A.ult (B) : A.slt (B);
31343131 break ;
31353132 case 0x02 : // _MM_CMPINT_LE
3136- Result = IsUnsigned ? LHS.elem <T>(ElemNum).toAPSInt ().ule (
3137- RHS.elem <T>(ElemNum).toAPSInt ())
3138- : LHS.elem <T>(ElemNum).toAPSInt ().sle (
3139- RHS.elem <T>(ElemNum).toAPSInt ());
3133+ Result = IsUnsigned ? A.ule (B) : A.sle (B);
31403134 break ;
31413135 case 0x03 : // _MM_CMPINT_FALSE
31423136 Result = false ;
31433137 break ;
31443138 case 0x04 : // _MM_CMPINT_NE
3145- Result = (LHS.elem <T>(ElemNum).toAPSInt () !=
3146- RHS.elem <T>(ElemNum).toAPSInt ());
3139+ Result = (A != B);
31473140 break ;
31483141 case 0x05 : // _MM_CMPINT_NLT (>=)
3149- Result = IsUnsigned ? LHS.elem <T>(ElemNum).toAPSInt ().uge (
3150- RHS.elem <T>(ElemNum).toAPSInt ())
3151- : LHS.elem <T>(ElemNum).toAPSInt ().sge (
3152- RHS.elem <T>(ElemNum).toAPSInt ());
3142+ Result = IsUnsigned ? A.uge (B) : A.sge (B);
31533143 break ;
31543144 case 0x06 : // _MM_CMPINT_NLE (>)
3155- Result = IsUnsigned ? LHS.elem <T>(ElemNum).toAPSInt ().ugt (
3156- RHS.elem <T>(ElemNum).toAPSInt ())
3157- : LHS.elem <T>(ElemNum).toAPSInt ().sgt (
3158- RHS.elem <T>(ElemNum).toAPSInt ());
3145+ Result = IsUnsigned ? A.ugt (B) : A.sgt (B);
31593146 break ;
31603147 case 0x07 : // _MM_CMPINT_TRUE
31613148 Result = true ;
0 commit comments