diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass2DuplicateRValueIdentification.java b/src/main/java/dk/camelot64/kickc/passes/Pass2DuplicateRValueIdentification.java index 3e3a5ebe3..09f8fa690 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass2DuplicateRValueIdentification.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass2DuplicateRValueIdentification.java @@ -111,10 +111,6 @@ public class Pass2DuplicateRValueIdentification extends Pass2SsaOptimization { if(operator instanceof OperatorCast) return true; if(operator.equals(Operators.PLUS)) return true; if(operator.equals(Operators.MINUS)) return true; - if(operator.equals(Operators.BOOL_AND)) return true; - if(operator.equals(Operators.BOOL_OR)) return true; - if(operator.equals(Operators.BOOL_XOR)) return true; - if(operator.equals(Operators.BOOL_NOT)) return true; if(operator.equals(Operators.LE)) return true; if(operator.equals(Operators.LT)) return true; if(operator.equals(Operators.GE)) return true; @@ -122,6 +118,8 @@ public class Pass2DuplicateRValueIdentification extends Pass2SsaOptimization { if(operator.equals(Operators.EQ)) return true; if(operator.equals(Operators.NEQ)) return true; if(operator.equals(Operators.LOGIC_NOT)) return true; + if(operator.equals(Operators.LOGIC_AND)) return true; + if(operator.equals(Operators.LOGIC_OR)) return true; return false; } diff --git a/src/test/ref/bitmap-plotter.asm b/src/test/ref/bitmap-plotter.asm index 4554d3c63..7762f5817 100644 --- a/src/test/ref/bitmap-plotter.asm +++ b/src/test/ref/bitmap-plotter.asm @@ -81,7 +81,7 @@ plot: { rts } init_plot_tables: { - .label _6 = 4 + .label _10 = 4 .label yoffs = 2 ldy #$80 ldx #0 @@ -109,15 +109,14 @@ init_plot_tables: { tax b3: lda #7 - sax _6 + sax _10 lda yoffs - ora _6 + ora _10 sta plot_ylo,x lda yoffs+1 sta plot_yhi,x - txa - and #7 - cmp #7 + lda #7 + cmp _10 bne b4 clc lda yoffs diff --git a/src/test/ref/bool-ifs.asm b/src/test/ref/bool-ifs.asm index c5dacee64..0fc00115b 100644 --- a/src/test/ref/bool-ifs.asm +++ b/src/test/ref/bool-ifs.asm @@ -11,34 +11,31 @@ main: { } bool_complex: { .label screen = $478 - ldy #0 + ldx #0 b1: - ldx #1 - tya - axs #0 - tya + txa and #1 - cpy #$a + cpx #$a bcc b6 b5: - cpy #$a + cpx #$a bcc b4 cmp #0 beq b4 b2: lda #'*' - sta screen,y + sta screen,x b3: - iny - cpy #$15 + inx + cpx #$15 bne b1 rts b4: lda #' ' - sta screen,y + sta screen,x jmp b3 b6: - cpx #0 + cmp #0 beq b2 jmp b5 } diff --git a/src/test/ref/examples/bresenham/bitmap-bresenham.asm b/src/test/ref/examples/bresenham/bitmap-bresenham.asm index 9c513d6a8..c6f38704b 100644 --- a/src/test/ref/examples/bresenham/bitmap-bresenham.asm +++ b/src/test/ref/examples/bresenham/bitmap-bresenham.asm @@ -364,7 +364,7 @@ bitmap_clear: { } // Initialize the bitmap plotter tables for a specific bitmap bitmap_init: { - .label _6 = 2 + .label _10 = 2 .label yoffs = 9 ldy #$80 ldx #0 @@ -392,15 +392,14 @@ bitmap_init: { tax b3: lda #7 - sax _6 + sax _10 lda yoffs - ora _6 + ora _10 sta bitmap_plot_ylo,x lda yoffs+1 sta bitmap_plot_yhi,x - txa - and #7 - cmp #7 + lda #7 + cmp _10 bne b4 clc lda yoffs diff --git a/src/test/ref/examples/sinplotter/sine-plotter.asm b/src/test/ref/examples/sinplotter/sine-plotter.asm index 341d95d20..e86b7ba4e 100644 --- a/src/test/ref/examples/sinplotter/sine-plotter.asm +++ b/src/test/ref/examples/sinplotter/sine-plotter.asm @@ -757,7 +757,7 @@ bitmap_clear: { } // Initialize bitmap plotting tables bitmap_init: { - .label _3 = $16 + .label _7 = $16 .label yoffs = 2 ldx #0 lda #$80 @@ -778,15 +778,14 @@ bitmap_init: { ldx #0 b3: lda #7 - sax _3 + sax _7 lda yoffs - ora _3 + ora _7 sta bitmap_plot_ylo,x lda yoffs+1 sta bitmap_plot_yhi,x - txa - and #7 - cmp #7 + lda #7 + cmp _7 bne b4 clc lda yoffs diff --git a/src/test/ref/line-anim.asm b/src/test/ref/line-anim.asm index 796e154ef..e787357ed 100644 --- a/src/test/ref/line-anim.asm +++ b/src/test/ref/line-anim.asm @@ -455,7 +455,7 @@ bitmap_clear: { rts } bitmap_init: { - .label _3 = 2 + .label _7 = 2 .label yoffs = 3 ldx #0 lda #$80 @@ -476,15 +476,14 @@ bitmap_init: { ldx #0 b3: lda #7 - sax _3 + sax _7 lda yoffs - ora _3 + ora _7 sta bitmap_plot_ylo,x lda yoffs+1 sta bitmap_plot_yhi,x - txa - and #7 - cmp #7 + lda #7 + cmp _7 bne b4 clc lda yoffs