]> git.sur5r.net Git - cc65/blobdiff - src/cc65/coptptrload.h
added optimization for indexed 16-bit array load of form (array[i & 0x7f])
[cc65] / src / cc65 / coptptrload.h
index 4581ccb45f7c6ef465f07feaa520dcc79155a005..8a118a268ec9890010b46b25b9ed089e260d33f4 100644 (file)
@@ -379,6 +379,31 @@ unsigned OptPtrLoad18 (CodeSeg* S);
 */
 
 
+unsigned OptPtrLoad19 (CodeSeg* S);
+/* Search for the sequence:
+**
+**     and     #mask           (any value < 128)
+**      jsr     aslax1/shlax1
+**      clc
+**      adc     #<(label+0)
+**      tay
+**      txa
+**      adc     #>(label+0)
+**      tax
+**      tya
+**      ldy     #$01
+**      jsr     ldaxidx
+**
+** and replace it by:
+**
+**     and     #mask           (remove if == 127)
+**     asl
+**     tay
+**     lda     label,y
+**     ldx     label+1,y
+*/
+
+
 /* End of coptptrload.h */
 
 #endif