@@ -2856,22 +2856,6 @@ void LowererMD::GenerateFastCmXx(IR::Instr *instr)
28562856 done->InsertBefore (newInstr);
28572857 }
28582858
2859- #ifndef _M_X64
2860- if (isInt64Src)
2861- {
2862- IR::LabelInstr* skipLow = IR::LabelInstr::New (Js::OpCode::Label, m_func);
2863- newInstr = IR::BranchInstr::New (Js::OpCode::JNE, skipLow, this ->m_func );
2864- newInstr->AsBranchInstr ()->m_areCmpRegisterFlagsUsedLater = true ;
2865- done->InsertBefore (newInstr);
2866-
2867- newInstr = IR::Instr::New (cmpOp, this ->m_func );
2868- newInstr->SetSrc1 (src1Pair.low );
2869- newInstr->SetSrc2 (src2Pair.low );
2870- done->InsertBefore (newInstr);
2871- done->InsertBefore (skipLow);
2872- }
2873- #endif
2874-
28752859 if (!isIntDst)
28762860 {
28772861 opnd = this ->m_lowerer ->LoadLibraryValueOpnd (instr, LibraryValue::ValueFalse);
@@ -2950,6 +2934,36 @@ void LowererMD::GenerateFastCmXx(IR::Instr *instr)
29502934 }
29512935 done->InsertBefore (newInstr);
29522936
2937+ #ifndef _M_X64
2938+ if (isInt64Src)
2939+ {
2940+ IR::LabelInstr* skipLow = IR::LabelInstr::New (Js::OpCode::Label, m_func);
2941+ newInstr = IR::BranchInstr::New (Js::OpCode::JNE, skipLow, this ->m_func );
2942+ done->InsertBefore (newInstr);
2943+
2944+ newInstr = IR::Instr::New (cmpOp, this ->m_func );
2945+ newInstr->SetSrc1 (src1Pair.low );
2946+ newInstr->SetSrc2 (src2Pair.low );
2947+ done->InsertBefore (newInstr);
2948+
2949+ Js::OpCode lowUseCC = useCC;
2950+ // Need to do an unsigned compare for the lower part
2951+ switch (instr->m_opcode )
2952+ {
2953+ case Js::OpCode::CmGe_I4: lowUseCC = Js::OpCode::SETAE; break ;
2954+ case Js::OpCode::CmGt_I4: lowUseCC = Js::OpCode::SETA; break ;
2955+ case Js::OpCode::CmLe_I4: lowUseCC = Js::OpCode::SETBE; break ;
2956+ case Js::OpCode::CmLt_I4: lowUseCC = Js::OpCode::SETB; break ;
2957+ }
2958+
2959+ // tmp.i8 = SetCC tmp.i8
2960+ IR::Opnd *tmp_i8 = tmp->UseWithNewType (TyInt8, this ->m_func );
2961+ newInstr = IR::Instr::New (lowUseCC, tmp_i8, tmp_i8, this ->m_func );
2962+ done->InsertBefore (newInstr);
2963+ done->InsertBefore (skipLow);
2964+ }
2965+ #endif
2966+
29532967 if (tmp != dst)
29542968 {
29552969 newInstr = IR::Instr::New (Js::OpCode::MOV, dst, tmp, this ->m_func );
0 commit comments