1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-27 04:49:27 +00:00

Improved duplicate assignment right side optimization slightly.

This commit is contained in:
jespergravgaard 2019-05-22 08:19:43 +02:00
parent 2c808e59d6
commit 67db0f0f6f
6 changed files with 31 additions and 40 deletions

View File

@ -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;
}

View File

@ -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

View File

@ -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
}

View File

@ -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

View File

@ -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

View File

@ -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