@@ -15276,6 +15276,7 @@ static zend_regset zend_jit_get_scratch_regset(const zend_op *opline, const zend
15276
15276
op2_info = OP2_INFO();
15277
15277
if (!(op1_info & ((MAY_BE_ANY|MAY_BE_REF|MAY_BE_UNDEF)-MAY_BE_LONG)) &&
15278
15278
!(op2_info & ((MAY_BE_ANY|MAY_BE_REF|MAY_BE_UNDEF)-MAY_BE_LONG))) {
15279
+ bw_op:
15279
15280
regset = ZEND_REGSET_EMPTY;
15280
15281
if (ssa_op->result_def != current_var &&
15281
15282
(ssa_op->op1_use != current_var || !last_use)) {
@@ -15291,25 +15292,15 @@ static zend_regset zend_jit_get_scratch_regset(const zend_op *opline, const zend
15291
15292
op2_info = OP2_INFO();
15292
15293
if (!(op1_info & ((MAY_BE_ANY|MAY_BE_REF|MAY_BE_UNDEF)-MAY_BE_LONG)) &&
15293
15294
!(op2_info & ((MAY_BE_ANY|MAY_BE_REF|MAY_BE_UNDEF)-MAY_BE_LONG))) {
15294
- regset = ZEND_REGSET_EMPTY;
15295
15295
if (opline->op2_type == IS_CONST &&
15296
15296
Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) == IS_LONG &&
15297
15297
zend_long_is_power_of_two(Z_LVAL_P(RT_CONSTANT(opline, opline->op2))) &&
15298
15298
OP1_HAS_RANGE() &&
15299
15299
OP1_MIN_RANGE() >= 0) {
15300
- if (ssa_op->result_def != current_var &&
15301
- (ssa_op->op1_use != current_var || !last_use)) {
15302
- ZEND_REGSET_INCL(regset, ZREG_R0);
15303
- }
15304
- if (sizeof(void*) == 8
15305
- && !IS_SIGNED_32BIT(Z_LVAL_P(RT_CONSTANT(opline, opline->op2)) - 1)) {
15306
- if (!ZEND_REGSET_IN(regset, ZREG_R0)) {
15307
- ZEND_REGSET_INCL(regset, ZREG_R0);
15308
- } else {
15309
- ZEND_REGSET_INCL(regset, ZREG_R1);
15310
- }
15311
- }
15300
+ /* MOD is going to be optimized into AND */
15301
+ goto bw_op;
15312
15302
} else {
15303
+ regset = ZEND_REGSET_EMPTY;
15313
15304
ZEND_REGSET_INCL(regset, ZREG_R0);
15314
15305
ZEND_REGSET_INCL(regset, ZREG_R2);
15315
15306
if (opline->op2_type == IS_CONST) {
0 commit comments