Peephole rule 174b (and possibly others?) can generate iyl/iyh instructions when not allowed.
This is because the canSplitReg() restriction splits iy into iyl/iyh.
This problem goes away by testing for HAS_IYL_INST instead of !IS_SM83 in z80canSplitReg()
--- a/src/z80/peep.c
+++ b/src/z80/peep.c
@@ -1294,7 +1294,7 @@ bool z80canSplitReg (const char *reg, char dst[][16], int nDst)
dst[i][1] = '\0';
}
}
- else if (!IS_SM83 && (!strcmp (reg, "ix") || !strcmp (reg, "iy")))
+ else if (HAS_IYL_INST && (!strcmp (reg, "ix") || !strcmp (reg, "iy")))
{
for (i = 0; i < nDst; ++i)
{
Example to reproduce:
... additionally, this replacement is not an optimization:
It is not smaller, and it takes 2 more cycles.
These issues should be fixed in [r13742].
Related
Commit: [r13742]
peep rule 174a now has the notSame(%1 'ix' 'iy') and notSame(%2 'ix' 'iy') restrictions twice.
Thanks. Fixed in [r13744].
Related
Commit: [r13744]