The regression test no longer fails. (It's interesting that the fastest and smallest result is for MAPN=1024.) r13744: MAPN=1024 Summary for 'ucz80': 0 failures, 3 tests, 1 test cases, 1156 bytes, 23058 ticks MAPN=2048 Summary for 'ucz80': 0 failures, 3 tests, 1 test cases, 1157 bytes, 23075 ticks MAPN=4096 Summary for 'ucz80': 0 failures, 3 tests, 1 test cases, 1159 bytes, 23083 ticks MAPN=8192 Summary for 'ucz80': 0 failures, 3 tests, 1 test cases, 1158 bytes, 23071 ticks MAPN=16384 Summary for...
peep rule 174a now has the notSame(%1 'ix' 'iy') and notSame(%2 'ix' 'iy') restrictions twice.
The regression test for this bug fails (for me) without treedec with --max-allocs-per-node between 38142 and 170117.
... additionally, this replacement is not an optimization: ld iy, #0x0000 ; 4B, 14T ld iyh, b ; 2B, 8T ld iyl, c ; 2B, 8T It is not smaller, and it takes 2 more cycles.
moduschar for sm83
Example to reproduce: sdcc -mz80 --max-allocs-per-node 50000 -c device/lib/_fsadd.c _fsadd.asm:512: Error: <a> Invalid Addressing Mode. _fsadd.asm:513: Error: <a> Invalid Addressing Mode. removing _fsadd.rel 509: jr 00142$ 510: 00141$: 511: ld bc, #0x0000 512: ld iyh, b 513: ld iyl, c 514: 00142$: 515: ld e, -9 (ix) 516: ld a, -8 (ix)
The test for unsignedness of left could be done on the original left This gets rid of the negativity test and the conditional addition: --- a/src/SDCCicode.c +++ b/src/SDCCicode.c @@ -2256,6 +2256,7 @@ geniCodeDivision (operand *left, operand *right, RESULT_TYPE resultType, bool pt { iCode *ic; int p2 = 0; + bool left_unsigned = IS_UNSIGNED (getSpec (operandType (left))); sym_link *resType = usualBinaryConversions (&left, &right, resultType, '/'); sym_link *rtype = operandType (right); sym_link *retype...
geniCodeDivision() can do a simple right shift if left is unsigned and right is a power of two, but usualBinaryConversions() makes left signed if right is signed, as it casts both operands to the result type. The test for unsignedness of left could be done on the original left before it gets cast by usualBinaryConversions.