@@ -1919,8 +1919,7 @@ void CodeGen::genLclHeap(GenTree* tree)
1919
1919
genConsumeRegAndCopy (size, targetReg);
1920
1920
endLabel = genCreateTempLabel ();
1921
1921
getEmitter ()->emitIns_R_R (INS_tst, easz, targetReg, targetReg);
1922
- emitJumpKind jmpEqual = genJumpKindForOper (GT_EQ, CK_SIGNED);
1923
- inst_JMP (jmpEqual, endLabel);
1922
+ inst_JMP (EJ_eq, endLabel);
1924
1923
1925
1924
// Compute the size of the block to allocate and perform alignment.
1926
1925
// If compInitMem=true, we can reuse targetReg as regcnt,
@@ -2040,8 +2039,7 @@ void CodeGen::genLclHeap(GenTree* tree)
2040
2039
// Therefore we need to subtract 16 from regcnt here.
2041
2040
assert (genIsValidIntReg (regCnt));
2042
2041
inst_RV_IV (INS_subs, regCnt, 16 , emitActualTypeSize (type));
2043
- emitJumpKind jmpNotEqual = genJumpKindForOper (GT_NE, CK_SIGNED);
2044
- inst_JMP (jmpNotEqual, loop);
2042
+ inst_JMP (EJ_ne, loop);
2045
2043
}
2046
2044
else
2047
2045
{
@@ -2099,8 +2097,7 @@ void CodeGen::genLclHeap(GenTree* tree)
2099
2097
getEmitter ()->emitIns_R_R_I (INS_sub, EA_PTRSIZE, regTmp, REG_SPBASE, compiler->eeGetPageSize ());
2100
2098
2101
2099
getEmitter ()->emitIns_R_R (INS_cmp, EA_PTRSIZE, regTmp, regCnt);
2102
- emitJumpKind jmpLTU = genJumpKindForOper (GT_LT, CK_UNSIGNED);
2103
- inst_JMP (jmpLTU, done);
2100
+ inst_JMP (EJ_lo, done);
2104
2101
2105
2102
// Update SP to be at the next page of stack that we will tickle
2106
2103
getEmitter ()->emitIns_R_R (INS_mov, EA_PTRSIZE, REG_SPBASE, regTmp);
@@ -2246,17 +2243,15 @@ void CodeGen::genCodeForDivMod(GenTreeOp* tree)
2246
2243
{
2247
2244
// Check if the divisor is zero throw a DivideByZeroException
2248
2245
emit->emitIns_R_I (INS_cmp, size, divisorReg, 0 );
2249
- emitJumpKind jmpEqual = genJumpKindForOper (GT_EQ, CK_SIGNED);
2250
- genJumpToThrowHlpBlk (jmpEqual, SCK_DIV_BY_ZERO);
2246
+ genJumpToThrowHlpBlk (EJ_eq, SCK_DIV_BY_ZERO);
2251
2247
}
2252
2248
2253
2249
if (checkDividend)
2254
2250
{
2255
2251
// Check if the divisor is not -1 branch to 'sdivLabel'
2256
2252
emit->emitIns_R_I (INS_cmp, size, divisorReg, -1 );
2257
2253
2258
- emitJumpKind jmpNotEqual = genJumpKindForOper (GT_NE, CK_SIGNED);
2259
- inst_JMP (jmpNotEqual, sdivLabel);
2254
+ inst_JMP (EJ_ne, sdivLabel);
2260
2255
// If control flow continues past here the 'divisorReg' is known to be -1
2261
2256
2262
2257
regNumber dividendReg = tree->gtGetOp1 ()->gtRegNum ;
@@ -2266,7 +2261,7 @@ void CodeGen::genCodeForDivMod(GenTreeOp* tree)
2266
2261
// this will set both the Z and V flags only when dividendReg is MinInt
2267
2262
//
2268
2263
emit->emitIns_R_R_R (INS_adds, size, REG_ZR, dividendReg, dividendReg);
2269
- inst_JMP (jmpNotEqual , sdivLabel); // goto sdiv if the Z flag is clear
2264
+ inst_JMP (EJ_ne , sdivLabel); // goto sdiv if the Z flag is clear
2270
2265
genJumpToThrowHlpBlk (EJ_vs, SCK_ARITH_EXCPN); // if the V flags is set throw
2271
2266
// ArithmeticException
2272
2267
@@ -2287,8 +2282,7 @@ void CodeGen::genCodeForDivMod(GenTreeOp* tree)
2287
2282
// divisorOp is not a constant, so it could be zero
2288
2283
//
2289
2284
emit->emitIns_R_I (INS_cmp, size, divisorReg, 0 );
2290
- emitJumpKind jmpEqual = genJumpKindForOper (GT_EQ, CK_SIGNED);
2291
- genJumpToThrowHlpBlk (jmpEqual, SCK_DIV_BY_ZERO);
2285
+ genJumpToThrowHlpBlk (EJ_eq, SCK_DIV_BY_ZERO);
2292
2286
}
2293
2287
genCodeForBinary (tree);
2294
2288
}
@@ -2998,8 +2992,7 @@ void CodeGen::genCodeForReturnTrap(GenTreeOp* tree)
2998
2992
2999
2993
BasicBlock* skipLabel = genCreateTempLabel ();
3000
2994
3001
- emitJumpKind jmpEqual = genJumpKindForOper (GT_EQ, CK_SIGNED);
3002
- inst_JMP (jmpEqual, skipLabel);
2995
+ inst_JMP (EJ_eq, skipLabel);
3003
2996
// emit the call to the EE-helper that stops for GC (or other reasons)
3004
2997
3005
2998
genEmitHelperCall (CORINFO_HELP_STOP_FOR_GC, 0 , EA_UNKNOWN);
@@ -3175,63 +3168,6 @@ void CodeGen::genCodeForSwap(GenTreeOp* tree)
3175
3168
gcInfo.gcMarkRegPtrVal (oldOp1Reg, type2);
3176
3169
}
3177
3170
3178
- // -------------------------------------------------------------------------------------------
3179
- // genSetRegToCond: Set a register 'dstReg' to the appropriate one or zero value
3180
- // corresponding to a binary Relational operator result.
3181
- //
3182
- // Arguments:
3183
- // dstReg - The target register to set to 1 or 0
3184
- // tree - The GenTree Relop node that was used to set the Condition codes
3185
- //
3186
- // Return Value: none
3187
- //
3188
- // Notes:
3189
- // A full 64-bit value of either 1 or 0 is setup in the 'dstReg'
3190
- // -------------------------------------------------------------------------------------------
3191
-
3192
- void CodeGen::genSetRegToCond (regNumber dstReg, GenTree* tree)
3193
- {
3194
- emitJumpKind jumpKind[2 ];
3195
- bool branchToTrueLabel[2 ];
3196
- genJumpKindsForTree (tree, jumpKind, branchToTrueLabel);
3197
- assert (jumpKind[0 ] != EJ_NONE);
3198
-
3199
- // Set the reg according to the flags
3200
- inst_SET (jumpKind[0 ], dstReg);
3201
-
3202
- // Do we need to use two operation to set the flags?
3203
- //
3204
- if (jumpKind[1 ] != EJ_NONE)
3205
- {
3206
- emitter* emit = getEmitter ();
3207
- bool ordered = ((tree->gtFlags & GTF_RELOP_NAN_UN) == 0 );
3208
- insCond secondCond;
3209
-
3210
- // The only ones that require two operations are the
3211
- // floating point compare operations of BEQ or BNE.UN
3212
- //
3213
- if (tree->gtOper == GT_EQ)
3214
- {
3215
- // This must be an ordered comparison.
3216
- assert (ordered);
3217
- assert (jumpKind[1 ] == EJ_vs); // We complement this value
3218
- secondCond = INS_COND_VC; // for the secondCond
3219
- }
3220
- else // gtOper == GT_NE
3221
- {
3222
- // This must be BNE.UN (unordered comparison)
3223
- assert ((tree->gtOper == GT_NE) && !ordered);
3224
- assert (jumpKind[1 ] == EJ_lo); // We complement this value
3225
- secondCond = INS_COND_HS; // for the secondCond
3226
- }
3227
-
3228
- // The second instruction is a 'csinc' instruction that either selects the previous dstReg
3229
- // or increments the ZR register, which produces a 1 result.
3230
-
3231
- emit->emitIns_R_R_R_COND (INS_csinc, EA_8BYTE, dstReg, dstReg, REG_ZR, secondCond);
3232
- }
3233
- }
3234
-
3235
3171
// ------------------------------------------------------------------------
3236
3172
// genIntToFloatCast: Generate code to cast an int/long to float/double
3237
3173
//
@@ -3424,8 +3360,7 @@ void CodeGen::genCkfinite(GenTree* treeNode)
3424
3360
emit->emitIns_R_I (INS_cmp, EA_4BYTE, intReg, expMask);
3425
3361
3426
3362
// If exponent is all 1's, throw ArithmeticException
3427
- emitJumpKind jmpEqual = genJumpKindForOper (GT_EQ, CK_SIGNED);
3428
- genJumpToThrowHlpBlk (jmpEqual, SCK_ARITH_EXCPN);
3363
+ genJumpToThrowHlpBlk (EJ_eq, SCK_ARITH_EXCPN);
3429
3364
3430
3365
// if it is a finite value copy it to targetReg
3431
3366
if (treeNode->gtRegNum != fpReg)
@@ -3499,7 +3434,7 @@ void CodeGen::genCodeForCompare(GenTreeOp* tree)
3499
3434
// Are we evaluating this into a register?
3500
3435
if (targetReg != REG_NA)
3501
3436
{
3502
- genSetRegToCond (targetReg , tree);
3437
+ inst_SETCC ( GenCondition::FromRelop (tree) , tree-> TypeGet (), targetReg );
3503
3438
genProduceReg (tree);
3504
3439
}
3505
3440
}
@@ -5192,8 +5127,7 @@ void CodeGen::genHWIntrinsicSwitchTable(regNumber swReg,
5192
5127
// Detect and throw out of range exception
5193
5128
getEmitter ()->emitIns_R_I (INS_cmp, EA_4BYTE, swReg, swMax);
5194
5129
5195
- emitJumpKind jmpGEU = genJumpKindForOper (GT_GE, CK_UNSIGNED);
5196
- genJumpToThrowHlpBlk (jmpGEU, SCK_ARG_RNG_EXCPN);
5130
+ genJumpToThrowHlpBlk (EJ_hs, SCK_ARG_RNG_EXCPN);
5197
5131
5198
5132
// Calculate switch target
5199
5133
labelFirst->bbFlags |= BBF_JMP_TARGET;
0 commit comments