1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-25 20:32:25 +00:00

Working on #486 post increment problems inside conditions.

This commit is contained in:
Jesper Gravgaard 2020-07-06 17:40:15 +02:00
parent 862847b681
commit 7f3c378119
60 changed files with 1781 additions and 885 deletions

View File

@ -1,4 +1,4 @@
//KICKC FRAGMENT CACHE 160b015f22
//KICKC FRAGMENT CACHE 160b017651
//FRAGMENT vbuz1=vbuc1
lda #{c1}
sta {z1}

View File

@ -1,4 +1,4 @@
//KICKC FRAGMENT CACHE 160b015f22
//KICKC FRAGMENT CACHE 160b017651
//FRAGMENT vbuz1=vbuc1
lda #{c1}
sta {z1}
@ -6344,13 +6344,34 @@ tsx
txa
axs #-4
txs
//FRAGMENT pbuz1=_stackidxptr_vbuc1
tsx
lda STACK_BASE+{c1},x
sta {z1}
lda STACK_BASE+{c1}+1,x
sta {z1}+1
//FRAGMENT pbuc1_derefidx_vbuz1=_deref_pbuz2
ldy #0
lda ({z2}),y
ldy {z1}
sta {c1},y
//FRAGMENT _stackpushptr_=pbuc1
lda #>{c1}
pha
lda #<{c1}
pha
//FRAGMENT _stackpushbyte_=vbuc1
lda #{c1}
pha
//FRAGMENT _stackpullbyte_3
tsx
txa
axs #-3
txs
//FRAGMENT vbuz1=vbuz2_minus_1
ldx {z2}
dex
stx {z1}
//FRAGMENT _stackpushbyte_=vbuc1
lda #{c1}
pha
//FRAGMENT vbuaa=vbuz1_minus_1
lda {z1}
sec
@ -9046,6 +9067,21 @@ sta {z1}
lda #>{c1}
sbc {z1}+1
sta {z1}+1
//FRAGMENT pbuc1_derefidx_vbuaa=_deref_pbuz1
tax
ldy #0
lda ({z1}),y
sta {c1},x
//FRAGMENT pbuc1_derefidx_vbuxx=_deref_pbuz1
ldy #0
lda ({z1}),y
sta {c1},x
//FRAGMENT pbuc1_derefidx_vbuyy=_deref_pbuz1
tya
tax
ldy #0
lda ({z1}),y
sta {c1},x
//FRAGMENT pbsc1_derefidx_vbuz1=_deref_pbsc2
lda {c2}
ldy {z1}
@ -11465,6 +11501,180 @@ sta {z1}+1
asl $ff
rol {z1}
rol {z1}+1
//FRAGMENT vwuz1=pbuz2_bxor_vwuc1
lda #<{c1}
eor {z2}
sta {z1}
lda #>{c1}
eor {z2}+1
sta {z1}+1
//FRAGMENT pbuz1_derefidx_vbuz2=pbuz1_derefidx_vbuz2_bor_pbuc1_derefidx_vbuz3
ldy {z2}
lda ({z1}),y
ldy {z3}
ora {c1},y
ldy {z2}
sta ({z1}),y
//FRAGMENT vbuz1=vbuz1_bxor_pbuz2_derefidx_vbuz3
lda {z1}
ldy {z3}
eor ({z2}),y
sta {z1}
//FRAGMENT vbuz1=_neg_vbuz1
lda {z1}
eor #$ff
clc
adc #$01
sta {z1}
//FRAGMENT pbuz1_derefidx_vbuz2=pbuz1_derefidx_vbuz2_bor_pbuc1_derefidx_vbuaa
ldy {z2}
tax
lda ({z1}),y
ora {c1},x
ldy {z2}
sta ({z1}),y
//FRAGMENT pbuz1_derefidx_vbuz2=pbuz1_derefidx_vbuz2_bor_pbuc1_derefidx_vbuxx
ldy {z2}
lda ({z1}),y
ora {c1},x
ldy {z2}
sta ({z1}),y
//FRAGMENT pbuz1_derefidx_vbuz2=pbuz1_derefidx_vbuz2_bor_pbuc1_derefidx_vbuyy
tya
ldy {z2}
tax
lda ({z1}),y
ora {c1},x
ldy {z2}
sta ({z1}),y
//FRAGMENT pbuz1_derefidx_vbuxx=pbuz1_derefidx_vbuxx_bor_pbuc1_derefidx_vbuz2
txa
tay
lda ({z1}),y
ldy {z2}
stx $ff
ora {c1},y
ldy $ff
sta ({z1}),y
//FRAGMENT pbuz1_derefidx_vbuxx=pbuz1_derefidx_vbuxx_bor_pbuc1_derefidx_vbuaa
tay
txa
ldx {c1},y
tay
lda ({z1}),y
sty $ff
stx $ff
ora $ff
ldy $ff
sta ({z1}),y
//FRAGMENT pbuz1_derefidx_vbuxx=pbuz1_derefidx_vbuxx_bor_pbuc1_derefidx_vbuxx
txa
tay
lda ({z1}),y
stx $ff
ora {c1},x
ldy $ff
sta ({z1}),y
//FRAGMENT pbuz1_derefidx_vbuxx=pbuz1_derefidx_vbuxx_bor_pbuc1_derefidx_vbuyy
txa
ldx {c1},y
tay
lda ({z1}),y
sty $ff
stx $ff
ora $ff
ldy $ff
sta ({z1}),y
//FRAGMENT pbuz1_derefidx_vbuyy=pbuz1_derefidx_vbuyy_bor_pbuc1_derefidx_vbuz2
lda ({z1}),y
sty $ff
ldy {z2}
ora {c1},y
ldy $ff
sta ({z1}),y
//FRAGMENT pbuz1_derefidx_vbuyy=pbuz1_derefidx_vbuyy_bor_pbuc1_derefidx_vbuaa
tax
lda ({z1}),y
sty $ff
ora {c1},x
ldy $ff
sta ({z1}),y
//FRAGMENT pbuz1_derefidx_vbuyy=pbuz1_derefidx_vbuyy_bor_pbuc1_derefidx_vbuxx
lda ({z1}),y
sty $ff
ora {c1},x
ldy $ff
sta ({z1}),y
//FRAGMENT pbuz1_derefidx_vbuyy=pbuz1_derefidx_vbuyy_bor_pbuc1_derefidx_vbuyy
lda ({z1}),y
sty $ff
ora {c1},y
ldy $ff
sta ({z1}),y
//FRAGMENT vbuz1=vbuz1_bxor_pbuz2_derefidx_vbuaa
tay
lda {z1}
eor ({z2}),y
sta {z1}
//FRAGMENT vbuz1=vbuz1_bxor_pbuz2_derefidx_vbuxx
txa
tay
lda {z1}
eor ({z2}),y
sta {z1}
//FRAGMENT vbuz1=vbuz1_bxor_pbuz2_derefidx_vbuyy
lda {z1}
eor ({z2}),y
sta {z1}
//FRAGMENT vbuaa=vbuaa_bxor_pbuz1_derefidx_vbuz2
ldy {z2}
eor ({z1}),y
//FRAGMENT vbuaa=vbuaa_bxor_pbuz1_derefidx_vbuaa
tay
eor ({z1}),y
//FRAGMENT vbuaa=vbuaa_bxor_pbuz1_derefidx_vbuxx
stx $ff
ldy $ff
eor ({z1}),y
//FRAGMENT vbuaa=vbuaa_bxor_pbuz1_derefidx_vbuyy
eor ({z1}),y
//FRAGMENT vbuxx=vbuxx_bxor_pbuz1_derefidx_vbuz2
ldy {z2}
txa
eor ({z1}),y
tax
//FRAGMENT vbuxx=vbuxx_bxor_pbuz1_derefidx_vbuaa
tay
txa
eor ({z1}),y
tax
//FRAGMENT vbuxx=vbuxx_bxor_pbuz1_derefidx_vbuxx
txa
tay
eor ({z1}),y
tax
//FRAGMENT vbuxx=vbuxx_bxor_pbuz1_derefidx_vbuyy
txa
eor ({z1}),y
tax
//FRAGMENT vbuyy=_neg_vbuyy
dey
tya
eor #$ff
tay
//FRAGMENT vwuz1=pbuz1_bxor_vwuc1
lda #<{c1}
eor {z1}
sta {z1}
lda #>{c1}
eor {z1}+1
sta {z1}+1
//FRAGMENT vbsz1=vbsz2_plus_vbsc1
lax {z2}
axs #-[{c1}]
@ -12272,16 +12482,29 @@ ldy #{c2}
tax
lda ({z1}),y
sta {c1},x
//FRAGMENT _deref_qssc1=pssc2
lda #<{c2}
sta {c1}
lda #>{c2}
sta {c1}+1
//FRAGMENT pssz1=pssc1
lda #<{c1}
sta {z1}
lda #>{c1}
sta {z1}+1
//FRAGMENT pssz1=pssz1_plus_vbuc1
lda #{c1}
clc
adc {z1}
sta {z1}
bcc !+
inc {z1}+1
!:
//FRAGMENT pbuc1_derefidx_vbuaa=pbuz1_derefidx_vbuc2
ldy #{c2}
tax
lda ({z1}),y
sta {c1},x
//FRAGMENT _deref_qssc1=pssc2
lda #<{c2}
sta {c1}
lda #>{c2}
sta {c1}+1
//FRAGMENT pssc1_neq_pssz1_then_la1
lda {z1}+1
cmp #>{c1}
@ -12929,12 +13152,6 @@ lda #{c1}
sec
sbc {z1}
sta {z1}
//FRAGMENT vbuz1=_neg_vbuz1
lda {z1}
eor #$ff
clc
adc #$01
sta {z1}
//FRAGMENT vbsz1=vbsz2_ror_vbuz3
lda {z2}
ldy {z3}
@ -12986,11 +13203,6 @@ bne {la1}
tya
cmp #0
bne {la1}
//FRAGMENT vbuyy=_neg_vbuyy
dey
tya
eor #$ff
tay
//FRAGMENT vbsaa=vbsz1_ror_vbuz2
lda {z1}
ldy {z2}
@ -14523,14 +14735,6 @@ sta {z1}
lda #0
adc {z2}+1
sta {z1}+1
//FRAGMENT pssz1=pssz1_plus_vbuc1
lda #{c1}
clc
adc {z1}
sta {z1}
bcc !+
inc {z1}+1
!:
//FRAGMENT pssz1_lt_pssc1_then_la1
lda {z1}+1
cmp #>{c1}
@ -14602,11 +14806,6 @@ stx $fe
ldx {c1}+1
stx $ff
sta ($fe),y
//FRAGMENT pbuc1_derefidx_vbuaa=pbuz1_derefidx_vbuc2
ldy #{c2}
tax
lda ({z1}),y
sta {c1},x
//FRAGMENT pssz1_neq_pssc1_then_la1
lda {z1}+1
cmp #>{c1}
@ -14630,6 +14829,34 @@ sta {z1}
iny
lda ($fe),y
sta {z1}+1
//FRAGMENT pbuc1_derefidx_vbuz1=pbuc2_derefidx_(_deref_pbuz2)
ldy #0
lda ({z2}),y
tay
lda {c2},y
ldy {z1}
sta {c1},y
//FRAGMENT pbuc1_derefidx_vbuxx=pbuc2_derefidx_(_deref_pbuz1)
ldy #0
lda ({z1}),y
tay
lda {c2},y
sta {c1},x
//FRAGMENT pbuc1_derefidx_vbuaa=pbuc2_derefidx_(_deref_pbuz1)
tax
ldy #0
lda ({z1}),y
tay
lda {c2},y
sta {c1},x
//FRAGMENT pbuc1_derefidx_vbuyy=pbuc2_derefidx_(_deref_pbuz1)
tya
tax
ldy #0
lda ({z1}),y
tay
lda {c2},y
sta {c1},x
//FRAGMENT _deref_pwuc1=vbuc2
lda #0
sta {c1}+1
@ -17510,230 +17737,49 @@ sta {c1},x
lda #{c2}
ora {c1},y
sta {c1},y
//FRAGMENT pbuz1=_stackidxptr_vbuc1
tsx
lda STACK_BASE+{c1},x
//FRAGMENT vbuz1=_dec_vbuz2
ldy {z2}
dey
sty {z1}
//FRAGMENT vbuz1=_dec_vbuaa
sec
sbc #1
sta {z1}
lda STACK_BASE+{c1}+1,x
sta {z1}+1
//FRAGMENT pbuc1_derefidx_vbuz1=_deref_pbuz2
ldy #0
lda ({z2}),y
//FRAGMENT vbuz1=_dec_vbuxx
dex
stx {z1}
//FRAGMENT vbuz1=_dec_vbuyy
dey
sty {z1}
//FRAGMENT vbuaa=_dec_vbuz1
lda {z1}
sec
sbc #1
//FRAGMENT vbuaa=_dec_vbuxx
txa
sec
sbc #1
//FRAGMENT vbuaa=_dec_vbuyy
tya
sec
sbc #1
//FRAGMENT vbuxx=_dec_vbuz1
ldx {z1}
dex
//FRAGMENT vbuxx=_dec_vbuaa
tax
dex
//FRAGMENT vbuxx=_dec_vbuyy
tya
tax
dex
//FRAGMENT vbuyy=_dec_vbuz1
ldy {z1}
sta {c1},y
//FRAGMENT _stackpushptr_=pbuc1
lda #>{c1}
pha
lda #<{c1}
pha
//FRAGMENT _stackpullbyte_3
tsx
txa
axs #-3
txs
//FRAGMENT pbuc1_derefidx_vbuaa=_deref_pbuz1
tax
ldy #0
lda ({z1}),y
sta {c1},x
//FRAGMENT pbuc1_derefidx_vbuxx=_deref_pbuz1
ldy #0
lda ({z1}),y
sta {c1},x
//FRAGMENT pbuc1_derefidx_vbuyy=_deref_pbuz1
tya
tax
ldy #0
lda ({z1}),y
sta {c1},x
//FRAGMENT vwuz1=pbuz2_bxor_vwuc1
lda #<{c1}
eor {z2}
sta {z1}
lda #>{c1}
eor {z2}+1
sta {z1}+1
//FRAGMENT pbuz1_derefidx_vbuz2=pbuz1_derefidx_vbuz2_bor_pbuc1_derefidx_vbuz3
ldy {z2}
lda ({z1}),y
ldy {z3}
ora {c1},y
ldy {z2}
sta ({z1}),y
//FRAGMENT vbuz1=vbuz1_bxor_pbuz2_derefidx_vbuz3
lda {z1}
ldy {z3}
eor ({z2}),y
sta {z1}
//FRAGMENT pbuz1_derefidx_vbuz2=pbuz1_derefidx_vbuz2_bor_pbuc1_derefidx_vbuaa
ldy {z2}
tax
lda ({z1}),y
ora {c1},x
ldy {z2}
sta ({z1}),y
//FRAGMENT pbuz1_derefidx_vbuz2=pbuz1_derefidx_vbuz2_bor_pbuc1_derefidx_vbuxx
ldy {z2}
lda ({z1}),y
ora {c1},x
ldy {z2}
sta ({z1}),y
//FRAGMENT pbuz1_derefidx_vbuz2=pbuz1_derefidx_vbuz2_bor_pbuc1_derefidx_vbuyy
tya
ldy {z2}
tax
lda ({z1}),y
ora {c1},x
ldy {z2}
sta ({z1}),y
//FRAGMENT pbuz1_derefidx_vbuxx=pbuz1_derefidx_vbuxx_bor_pbuc1_derefidx_vbuz2
dey
//FRAGMENT vbuyy=_dec_vbuaa
tay
dey
//FRAGMENT vbuyy=_dec_vbuxx
txa
tay
lda ({z1}),y
ldy {z2}
stx $ff
ora {c1},y
ldy $ff
sta ({z1}),y
//FRAGMENT pbuz1_derefidx_vbuxx=pbuz1_derefidx_vbuxx_bor_pbuc1_derefidx_vbuaa
tay
txa
ldx {c1},y
tay
lda ({z1}),y
sty $ff
stx $ff
ora $ff
ldy $ff
sta ({z1}),y
//FRAGMENT pbuz1_derefidx_vbuxx=pbuz1_derefidx_vbuxx_bor_pbuc1_derefidx_vbuxx
txa
tay
lda ({z1}),y
stx $ff
ora {c1},x
ldy $ff
sta ({z1}),y
//FRAGMENT pbuz1_derefidx_vbuxx=pbuz1_derefidx_vbuxx_bor_pbuc1_derefidx_vbuyy
txa
ldx {c1},y
tay
lda ({z1}),y
sty $ff
stx $ff
ora $ff
ldy $ff
sta ({z1}),y
//FRAGMENT pbuz1_derefidx_vbuyy=pbuz1_derefidx_vbuyy_bor_pbuc1_derefidx_vbuz2
lda ({z1}),y
sty $ff
ldy {z2}
ora {c1},y
ldy $ff
sta ({z1}),y
//FRAGMENT pbuz1_derefidx_vbuyy=pbuz1_derefidx_vbuyy_bor_pbuc1_derefidx_vbuaa
tax
lda ({z1}),y
sty $ff
ora {c1},x
ldy $ff
sta ({z1}),y
//FRAGMENT pbuz1_derefidx_vbuyy=pbuz1_derefidx_vbuyy_bor_pbuc1_derefidx_vbuxx
lda ({z1}),y
sty $ff
ora {c1},x
ldy $ff
sta ({z1}),y
//FRAGMENT pbuz1_derefidx_vbuyy=pbuz1_derefidx_vbuyy_bor_pbuc1_derefidx_vbuyy
lda ({z1}),y
sty $ff
ora {c1},y
ldy $ff
sta ({z1}),y
//FRAGMENT vbuz1=vbuz1_bxor_pbuz2_derefidx_vbuaa
tay
lda {z1}
eor ({z2}),y
sta {z1}
//FRAGMENT vbuz1=vbuz1_bxor_pbuz2_derefidx_vbuxx
txa
tay
lda {z1}
eor ({z2}),y
sta {z1}
//FRAGMENT vbuz1=vbuz1_bxor_pbuz2_derefidx_vbuyy
lda {z1}
eor ({z2}),y
sta {z1}
//FRAGMENT vbuaa=vbuaa_bxor_pbuz1_derefidx_vbuz2
ldy {z2}
eor ({z1}),y
//FRAGMENT vbuaa=vbuaa_bxor_pbuz1_derefidx_vbuaa
tay
eor ({z1}),y
//FRAGMENT vbuaa=vbuaa_bxor_pbuz1_derefidx_vbuxx
stx $ff
ldy $ff
eor ({z1}),y
//FRAGMENT vbuaa=vbuaa_bxor_pbuz1_derefidx_vbuyy
eor ({z1}),y
//FRAGMENT vbuxx=vbuxx_bxor_pbuz1_derefidx_vbuz2
ldy {z2}
txa
eor ({z1}),y
tax
//FRAGMENT vbuxx=vbuxx_bxor_pbuz1_derefidx_vbuaa
tay
txa
eor ({z1}),y
tax
//FRAGMENT vbuxx=vbuxx_bxor_pbuz1_derefidx_vbuxx
txa
tay
eor ({z1}),y
tax
//FRAGMENT vbuxx=vbuxx_bxor_pbuz1_derefidx_vbuyy
txa
eor ({z1}),y
tax
//FRAGMENT vwuz1=pbuz1_bxor_vwuc1
lda #<{c1}
eor {z1}
sta {z1}
lda #>{c1}
eor {z1}+1
sta {z1}+1
//FRAGMENT pbuc1_derefidx_vbuz1=pbuc2_derefidx_(_deref_pbuz2)
ldy #0
lda ({z2}),y
tay
lda {c2},y
ldy {z1}
sta {c1},y
//FRAGMENT pbuc1_derefidx_vbuxx=pbuc2_derefidx_(_deref_pbuz1)
ldy #0
lda ({z1}),y
tay
lda {c2},y
sta {c1},x
//FRAGMENT pbuc1_derefidx_vbuaa=pbuc2_derefidx_(_deref_pbuz1)
tax
ldy #0
lda ({z1}),y
tay
lda {c2},y
sta {c1},x
//FRAGMENT pbuc1_derefidx_vbuyy=pbuc2_derefidx_(_deref_pbuz1)
tya
tax
ldy #0
lda ({z1}),y
tay
lda {c2},y
sta {c1},x
dey

View File

@ -460,6 +460,7 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
private RValue cycles;
/** Declared clobber for the inline kick-assembler . */
private AsmClobber declaredClobber;
public KickAsm(String kickAsmCode) {
this.kickAsmCode = kickAsmCode;
this.uses = new ArrayList<>();
@ -990,7 +991,7 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
if(variable.getScope().getRef().equals(ScopeRef.ROOT)) {
// Add comments to variable for global vars
variable.setComments(ensureUnusedComments(declComments));
} else {
} else {
// Add comments to statement for local vars
initStmt.setComments(ensureUnusedComments(declComments));
}
@ -1394,9 +1395,9 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
PrePostModifierHandler.addPreModifiers(this, conditionCtx, statementSource);
RValue rValue = (RValue) this.visit(conditionCtx);
// Add any post-modifiers
if(PrePostModifierHandler.hasPrePostModifiers(this, conditionCtx, statementSource)) {
if(PrePostModifierHandler.hasPostModifiers(this, conditionCtx, statementSource)) {
// If modifiers are present the RValue must be assigned before the post-modifier is executed
if(!(rValue instanceof VariableRef)) {
if(!(rValue instanceof VariableRef) || !((VariableRef) rValue).isIntermediate()) {
// Make a new temporary variable and assign that
Variable tmpVar = addIntermediateVar();
Statement stmtExpr = new StatementAssignment(tmpVar.getVariableRef(), rValue, true, statementSource, Comment.NO_COMMENTS);
@ -1534,7 +1535,9 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
addLoopContinueLabel(loopStack.peek(), ctx);
KickCParser.CommaExprContext incrementCtx = ctx.commaExpr(1);
if(incrementCtx != null) {
addCondition(incrementCtx, StatementSource.forClassic(ctx));
PrePostModifierHandler.addPreModifiers(this, incrementCtx, StatementSource.forClassic(ctx));
this.visit(incrementCtx);
PrePostModifierHandler.addPostModifiers(this, incrementCtx, StatementSource.forClassic(ctx));
}
// Jump back to beginning
Statement beginJmpStmt = new StatementJump(beginJumpLabel.getRef(), StatementSource.forClassic(ctx), Comment.NO_COMMENTS);
@ -2654,7 +2657,13 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
static boolean hasPrePostModifiers(Pass0GenerateStatementSequence parser, ParserRuleContext ctx, StatementSource statementSource) {
PrePostModifierHandler modifierHandler = new PrePostModifierHandler(parser);
modifierHandler.visit(ctx);
return modifierHandler.getPreMods().size() > 0 || (modifierHandler.getPostMods().size() > 0);
return (modifierHandler.getPreMods().size() > 0) || (modifierHandler.getPostMods().size() > 0);
}
static boolean hasPostModifiers(Pass0GenerateStatementSequence parser, ParserRuleContext ctx, StatementSource statementSource) {
PrePostModifierHandler modifierHandler = new PrePostModifierHandler(parser);
modifierHandler.visit(ctx);
return modifierHandler.getPostMods().size() > 0;
}

View File

@ -389,6 +389,16 @@ public class TestPrograms {
compileAndCompare("examples/conio/nacht-screen.c");
}
@Test
public void testPostIncrementProblem4() throws IOException, URISyntaxException {
compileAndCompare("post-increment-problem-4.c");
}
@Test
public void testPostIncrementProblem3() throws IOException, URISyntaxException {
compileAndCompare("post-increment-problem-3.c");
}
@Test
public void testPostIncrementProblem2() throws IOException, URISyntaxException {
compileAndCompare("post-increment-problem-2.c");

View File

@ -0,0 +1,14 @@
// Illustrates a problem with post-incrementing inside the while loop condition
// https://gitlab.com/camelot/kickc/-/issues/486
const unsigned char mmap[] = {
0x02, 0x5c, 0x1a, 0x03, 0x60, 0x1a, 0x07
};
void main(void)
{
unsigned char *ptr = mmap;
unsigned char n = *(ptr++);
while (n--)
*((unsigned char *)0x400) = n;
}

View File

@ -0,0 +1,12 @@
// Illustrates a problem with post-incrementing inside the while loop condition
// https://gitlab.com/camelot/kickc/-/issues/486
char MESSAGE[] = "hello world!";
char * const SCREEN = 0x0400;
void main(void) {
char * s = MESSAGE;
char c, i=0;
while(c=*s++)
SCREEN[i++] = c;
}

View File

@ -276,10 +276,9 @@ printf_sint: {
cputs: {
.label s = 5
__b1:
// c=*s++
// while(c=*s++)
ldy #0
lda (s),y
// while(c=*s++)
inc.z s
bne !+
inc.z s+1

View File

@ -615,9 +615,10 @@ cputs: scope:[cputs] from main::@3 main::@6 printf_number_buffer::@5
cputs::@1: scope:[cputs] from cputs cputs::@3
(to_nomodify byte*) cputs::s#4 ← phi( cputs/(to_nomodify byte*) cputs::s#5 cputs::@3/(to_nomodify byte*) cputs::s#6 )
(byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#4)
(byte~) cputs::$0 ← (byte) cputs::c#1
(to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#4
(bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
if((bool~) cputs::$1) goto cputs::@2
(bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
if((bool~) cputs::$2) goto cputs::@2
to:cputs::@return
cputs::@2: scope:[cputs] from cputs::@1
(to_nomodify byte*) cputs::s#7 ← phi( cputs::@1/(to_nomodify byte*) cputs::s#0 )
@ -1266,7 +1267,8 @@ SYMBOL TABLE SSA
(label) cputln::@1
(label) cputln::@return
(void()) cputs((to_nomodify byte*) cputs::s)
(bool~) cputs::$1
(byte~) cputs::$0
(bool~) cputs::$2
(label) cputs::@1
(label) cputs::@2
(label) cputs::@3
@ -2007,7 +2009,7 @@ Adding number conversion cast (unumber) $28 in (byte*) conio_line_text ← (byte
Adding number conversion cast (unumber) $28 in (byte*) conio_line_color ← (byte*) conio_line_color - (number) $28
Adding number conversion cast (unumber) 0 in (byte) gotoxy::x#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) gotoxy::y#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
Adding number conversion cast (unumber) 0 in (bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
Adding number conversion cast (unumber) 0 in *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) ← (number) 0
Adding number conversion cast (snumber) 0 in (bool~) printf_sint::$0 ← (signed word) printf_sint::value#3 < (number) 0
Adding number conversion cast (unumber) 0 in (bool~) printf_sint::$5 ← (number) 0 != (byte) printf_sint::format_sign_always#2
@ -2171,15 +2173,15 @@ Inversing boolean not [219] (bool~) gotoxy::$1 ← (byte) gotoxy::y#2 <= (byte)
Inversing boolean not [223] (bool~) gotoxy::$3 ← (byte) gotoxy::x#2 < (byte) $28 from [222] (bool~) gotoxy::$2 ← (byte) gotoxy::x#2 >= (byte) $28
Inversing boolean not [249] (bool~) cputc::$2 ← (byte) conio_cursor_x != (byte) $28 from [248] (bool~) cputc::$1 ← (byte) conio_cursor_x == (byte) $28
Inversing boolean not [260] (bool~) cscroll::$1 ← (byte) conio_cursor_y != (byte) $19 from [259] (bool~) cscroll::$0 ← (byte) conio_cursor_y == (byte) $19
Inversing boolean not [324] (bool~) printf_sint::$3 ← (byte) 0 == (byte) printf_sint::format_sign_always#2 from [323] (bool~) printf_sint::$5 ← (byte) 0 != (byte) printf_sint::format_sign_always#2
Inversing boolean not [348] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#1 from [347] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#1
Inversing boolean not [352] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#1 from [351] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#1
Inversing boolean not [354] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#1 from [353] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#1
Inversing boolean not [367] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#1 from [366] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#1
Inversing boolean not [374] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [373] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [382] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [381] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2
Inversing boolean not [399] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#1 from [398] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#1
Inversing boolean not [411] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#3 from [410] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#3
Inversing boolean not [325] (bool~) printf_sint::$3 ← (byte) 0 == (byte) printf_sint::format_sign_always#2 from [324] (bool~) printf_sint::$5 ← (byte) 0 != (byte) printf_sint::format_sign_always#2
Inversing boolean not [349] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#1 from [348] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#1
Inversing boolean not [353] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#1 from [352] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#1
Inversing boolean not [355] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#1 from [354] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#1
Inversing boolean not [368] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#1 from [367] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#1
Inversing boolean not [375] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [374] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [383] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [382] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2
Inversing boolean not [400] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#1 from [399] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#1
Inversing boolean not [412] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#3 from [411] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#3
Successful SSA optimization Pass2UnaryNotSimplification
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
@ -2243,7 +2245,7 @@ Alias gotoxy::x#4 = gotoxy::x#5
Alias gotoxy::line_offset#0 = gotoxy::$4
Alias gotoxy::y#4 = gotoxy::y#5
Alias cputc::c#3 = cputc::c#4
Alias cputs::c#1 = cputs::c#2
Alias cputs::c#1 = cputs::$0 cputs::c#2
Alias cputs::s#0 = cputs::s#7 cputs::s#6
Alias printf_padding::pad#3 = printf_padding::pad#4 printf_padding::pad#6
Alias printf_padding::i#2 = printf_padding::i#4 printf_padding::i#3
@ -2402,7 +2404,7 @@ Simple Condition (bool~) cputc::$0 [176] if((byte) cputc::c#3==(byte) '
Simple Condition (bool~) cputc::$2 [182] if((byte) conio_cursor_x!=(byte) $28) goto cputc::@return
Simple Condition (bool~) cscroll::$1 [192] if((byte) conio_cursor_y!=(byte) $19) goto cscroll::@return
Simple Condition (bool~) cscroll::$7 [194] if((byte) 0!=(byte) conio_scroll_enable) goto cscroll::@3
Simple Condition (bool~) cputs::$1 [228] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) cputs::$2 [228] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) printf_padding::$0 [236] if((byte) printf_padding::i#2<(byte) printf_padding::length#4) goto printf_padding::@2
Simple Condition (bool~) printf_sint::$0 [244] if((signed word) printf_sint::value#3<(signed byte) 0) goto printf_sint::@1
Simple Condition (bool~) printf_sint::$3 [248] if((byte) 0==(byte) printf_sint::format_sign_always#2) goto printf_sint::@2
@ -7163,11 +7165,10 @@ cputs: {
// [68] phi (to_nomodify byte*) cputs::s#4 = (to_nomodify byte*) cputs::s#5 [phi:cputs/cputs::@2->cputs::@1#0] -- register_copy
// cputs::@1
__b1:
// c=*s++
// while(c=*s++)
// [69] (byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#4) -- vbuaa=_deref_pbuz1
ldy #0
lda (s),y
// while(c=*s++)
// [70] (to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#4 -- pbuz1=_inc_pbuz1
inc.z s
bne !+

View File

@ -262,10 +262,9 @@ printf_uint: {
cputs: {
.label s = 7
__b1:
// c=*s++
// while(c=*s++)
ldy #0
lda (s),y
// while(c=*s++)
inc.z s
bne !+
inc.z s+1

View File

@ -428,9 +428,10 @@ cputs: scope:[cputs] from main::@11 printf_number_buffer::@5
cputs::@1: scope:[cputs] from cputs cputs::@3
(to_nomodify byte*) cputs::s#3 ← phi( cputs/(to_nomodify byte*) cputs::s#4 cputs::@3/(to_nomodify byte*) cputs::s#5 )
(byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#3)
(byte~) cputs::$0 ← (byte) cputs::c#1
(to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#3
(bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
if((bool~) cputs::$1) goto cputs::@2
(bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
if((bool~) cputs::$2) goto cputs::@2
to:cputs::@return
cputs::@2: scope:[cputs] from cputs::@1
(to_nomodify byte*) cputs::s#6 ← phi( cputs::@1/(to_nomodify byte*) cputs::s#0 )
@ -1225,7 +1226,8 @@ SYMBOL TABLE SSA
(label) cputln::@1
(label) cputln::@return
(void()) cputs((to_nomodify byte*) cputs::s)
(bool~) cputs::$1
(byte~) cputs::$0
(bool~) cputs::$2
(label) cputs::@1
(label) cputs::@2
(label) cputs::@3
@ -2101,7 +2103,7 @@ Adding number conversion cast (unumber) $28 in (byte*) conio_line_text ← (byte
Adding number conversion cast (unumber) $28 in (byte*) conio_line_color ← (byte*) conio_line_color - (number) $28
Adding number conversion cast (unumber) 0 in (byte) gotoxy::x#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) gotoxy::y#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
Adding number conversion cast (unumber) 0 in (bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
Adding number conversion cast (unumber) 5 in (byte) utoa::max_digits#1 ← (number) 5
Adding number conversion cast (unumber) 4 in (byte) utoa::max_digits#2 ← (number) 4
Adding number conversion cast (unumber) 6 in (byte) utoa::max_digits#3 ← (number) 6
@ -2321,15 +2323,15 @@ Inversing boolean not [140] (bool~) gotoxy::$1 ← (byte) gotoxy::y#3 <= (byte)
Inversing boolean not [144] (bool~) gotoxy::$3 ← (byte) gotoxy::x#3 < (byte) $28 from [143] (bool~) gotoxy::$2 ← (byte) gotoxy::x#3 >= (byte) $28
Inversing boolean not [170] (bool~) cputc::$2 ← (byte) conio_cursor_x != (byte) $28 from [169] (bool~) cputc::$1 ← (byte) conio_cursor_x == (byte) $28
Inversing boolean not [181] (bool~) cscroll::$1 ← (byte) conio_cursor_y != (byte) $19 from [180] (bool~) cscroll::$0 ← (byte) conio_cursor_y == (byte) $19
Inversing boolean not [343] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#1 from [342] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#1
Inversing boolean not [347] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#1 from [346] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#1
Inversing boolean not [349] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#1 from [348] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#1
Inversing boolean not [362] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#1 from [361] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#1
Inversing boolean not [369] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [368] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [377] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [376] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2
Inversing boolean not [394] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#1 from [393] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#1
Inversing boolean not [406] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#3 from [405] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#3
Inversing boolean not [474] (bool~) main::$13 ← (signed word) main::dist_sq#0 >= (signed word)(number) 2*(number) 9*(number) 2*(number) 9 from [473] (bool~) main::$12 ← (signed word) main::dist_sq#0 < (signed word)(number) 2*(number) 9*(number) 2*(number) 9
Inversing boolean not [344] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#1 from [343] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#1
Inversing boolean not [348] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#1 from [347] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#1
Inversing boolean not [350] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#1 from [349] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#1
Inversing boolean not [363] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#1 from [362] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#1
Inversing boolean not [370] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [369] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [378] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [377] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2
Inversing boolean not [395] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#1 from [394] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#1
Inversing boolean not [407] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#3 from [406] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#3
Inversing boolean not [475] (bool~) main::$13 ← (signed word) main::dist_sq#0 >= (signed word)(number) 2*(number) 9*(number) 2*(number) 9 from [474] (bool~) main::$12 ← (signed word) main::dist_sq#0 < (signed word)(number) 2*(number) 9*(number) 2*(number) 9
Successful SSA optimization Pass2UnaryNotSimplification
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
@ -2375,7 +2377,7 @@ Alias gotoxy::x#5 = gotoxy::x#6
Alias gotoxy::line_offset#0 = gotoxy::$4
Alias gotoxy::y#5 = gotoxy::y#6
Alias cputc::c#3 = cputc::c#4
Alias cputs::c#1 = cputs::c#2
Alias cputs::c#1 = cputs::$0 cputs::c#2
Alias cputs::s#0 = cputs::s#6 cputs::s#5
Alias utoa::value#10 = utoa::value#8 utoa::value#12 utoa::value#13 utoa::value#9 utoa::value#14 utoa::value#15 utoa::value#11
Alias utoa::buffer#10 = utoa::buffer#17 utoa::buffer#21 utoa::buffer#16 utoa::buffer#18 utoa::buffer#13 utoa::buffer#19 utoa::buffer#20 utoa::buffer#6
@ -2562,7 +2564,7 @@ Simple Condition (bool~) cputc::$0 [108] if((byte) cputc::c#3==(byte) '
Simple Condition (bool~) cputc::$2 [114] if((byte) conio_cursor_x!=(byte) $28) goto cputc::@return
Simple Condition (bool~) cscroll::$1 [124] if((byte) conio_cursor_y!=(byte) $19) goto cscroll::@return
Simple Condition (bool~) cscroll::$7 [126] if((byte) 0!=(byte) conio_scroll_enable) goto cscroll::@3
Simple Condition (bool~) cputs::$1 [160] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) cputs::$2 [160] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) utoa::$0 [168] if((byte) utoa::radix#0==(const byte) DECIMAL) goto utoa::@1
Simple Condition (bool~) utoa::$1 [172] if((byte) utoa::radix#0==(const byte) HEXADECIMAL) goto utoa::@2
Simple Condition (bool~) utoa::$2 [176] if((byte) utoa::radix#0==(const byte) OCTAL) goto utoa::@3
@ -7586,11 +7588,10 @@ cputs: {
// [64] phi (to_nomodify byte*) cputs::s#3 = (to_nomodify byte*) cputs::s#4 [phi:cputs/cputs::@2->cputs::@1#0] -- register_copy
// cputs::@1
__b1:
// c=*s++
// while(c=*s++)
// [65] (byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#3) -- vbuaa=_deref_pbuz1
ldy #0
lda (s),y
// while(c=*s++)
// [66] (to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#3 -- pbuz1=_inc_pbuz1
inc.z s
bne !+

View File

@ -665,10 +665,9 @@ cvline: {
cputs: {
.label s = 9
__b1:
// c=*s++
// while(c=*s++)
ldy #0
lda (s),y
// while(c=*s++)
inc.z s
bne !+
inc.z s+1

View File

@ -328,9 +328,10 @@ cputs: scope:[cputs] from cputsxy::@1
cputs::@1: scope:[cputs] from cputs cputs::@3
(to_nomodify byte*) cputs::s#2 ← phi( cputs/(to_nomodify byte*) cputs::s#3 cputs::@3/(to_nomodify byte*) cputs::s#4 )
(byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#2)
(byte~) cputs::$0 ← (byte) cputs::c#1
(to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#2
(bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
if((bool~) cputs::$1) goto cputs::@2
(bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
if((bool~) cputs::$2) goto cputs::@2
to:cputs::@return
cputs::@2: scope:[cputs] from cputs::@1
(to_nomodify byte*) cputs::s#5 ← phi( cputs::@1/(to_nomodify byte*) cputs::s#0 )
@ -1076,7 +1077,8 @@ SYMBOL TABLE SSA
(label) cputln::@1
(label) cputln::@return
(void()) cputs((to_nomodify byte*) cputs::s)
(bool~) cputs::$1
(byte~) cputs::$0
(bool~) cputs::$2
(label) cputs::@1
(label) cputs::@2
(label) cputs::@3
@ -1424,7 +1426,7 @@ Adding number conversion cast (unumber) $28 in (byte*) conio_line_text ← (byte
Adding number conversion cast (unumber) $28 in (byte*) conio_line_color ← (byte*) conio_line_color - (number) $28
Adding number conversion cast (unumber) 0 in (byte) gotoxy::x#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) gotoxy::y#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
Adding number conversion cast (unumber) 0 in (bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) kbhit::CIA1_PORT_A) ← (number) 0
Adding number conversion cast (unumber) $17 in *((const nomodify byte*) VIC_MEMORY) ← (number) $17
Adding number conversion cast (unumber) 0 in (bool~) main::$5 ← (number) 0 != (byte~) main::$3
@ -1608,7 +1610,7 @@ Inversing boolean not [77] (bool~) gotoxy::$1 ← (byte) gotoxy::y#6 <= (byte) $
Inversing boolean not [81] (bool~) gotoxy::$3 ← (byte) gotoxy::x#6 < (byte) $28 from [80] (bool~) gotoxy::$2 ← (byte) gotoxy::x#6 >= (byte) $28
Inversing boolean not [111] (bool~) cputc::$2 ← (byte) conio_cursor_x != (byte) $28 from [110] (bool~) cputc::$1 ← (byte) conio_cursor_x == (byte) $28
Inversing boolean not [122] (bool~) cscroll::$1 ← (byte) conio_cursor_y != (byte) $19 from [121] (bool~) cscroll::$0 ← (byte) conio_cursor_y == (byte) $19
Inversing boolean not [269] (bool~) main::$4 ← (byte) 0 == (byte~) main::$3 from [268] (bool~) main::$5 ← (byte) 0 != (byte~) main::$3
Inversing boolean not [270] (bool~) main::$4 ← (byte) 0 == (byte~) main::$3 from [269] (bool~) main::$5 ← (byte) 0 != (byte~) main::$3
Successful SSA optimization Pass2UnaryNotSimplification
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
@ -1639,7 +1641,7 @@ Alias gotoxy::x#8 = gotoxy::x#9
Alias gotoxy::line_offset#0 = gotoxy::$4
Alias gotoxy::y#8 = gotoxy::y#9
Alias cputc::c#8 = cputc::c#9
Alias cputs::c#1 = cputs::c#2
Alias cputs::c#1 = cputs::$0 cputs::c#2
Alias cputs::s#0 = cputs::s#5 cputs::s#4
Alias cputcxy::c#2 = cputcxy::c#3
Alias cputsxy::s#1 = cputsxy::s#2
@ -1716,7 +1718,7 @@ Simple Condition (bool~) cputc::$0 [78] if((byte) cputc::c#8==(byte) '
Simple Condition (bool~) cputc::$2 [84] if((byte) conio_cursor_x!=(byte) $28) goto cputc::@return
Simple Condition (bool~) cscroll::$1 [94] if((byte) conio_cursor_y!=(byte) $19) goto cscroll::@return
Simple Condition (bool~) cscroll::$7 [96] if((byte) 0!=(byte) conio_scroll_enable) goto cscroll::@3
Simple Condition (bool~) cputs::$1 [130] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) cputs::$2 [130] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) chline::$0 [175] if((byte) chline::i#2<(byte) chline::length#4) goto chline::@2
Simple Condition (bool~) cvline::$0 [186] if((byte) cvline::i#2<(byte) cvline::length#0) goto cvline::@2
Simple Condition (bool~) main::$4 [211] if((byte) 0==(byte~) main::$3) goto main::@1
@ -7986,11 +7988,10 @@ cputs: {
// [187] phi (to_nomodify byte*) cputs::s#2 = (to_nomodify byte*) cputs::s#1 [phi:cputs/cputs::@2->cputs::@1#0] -- register_copy
// cputs::@1
__b1:
// c=*s++
// while(c=*s++)
// [188] (byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#2) -- vbuaa=_deref_pbuz1
ldy #0
lda (s),y
// while(c=*s++)
// [189] (to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#2 -- pbuz1=_inc_pbuz1
inc.z s
bne !+

View File

@ -462,11 +462,10 @@ cputs: {
.label c = $d
.label s = $b
__b1:
// c=*s++
// while(c=*s++)
ldy #0
lda (s),y
sta.z c
// while(c=*s++)
inc.z s
bne !+
inc.z s+1

View File

@ -934,9 +934,10 @@ cputs: scope:[cputs] from main::@1 main::@11 main::@2 main::@7 main::@9 print::
cputs::@1: scope:[cputs] from cputs cputs::@3
(to_nomodify byte*) cputs::s#13 ← phi( cputs/(to_nomodify byte*) cputs::s#14 cputs::@3/(to_nomodify byte*) cputs::s#15 )
(byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#13)
(byte~) cputs::$0 ← (byte) cputs::c#1
(to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#13
(bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
if((bool~) cputs::$1) goto cputs::@2
(bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
if((bool~) cputs::$2) goto cputs::@2
to:cputs::@return
cputs::@2: scope:[cputs] from cputs::@1
(to_nomodify byte*) cputs::s#16 ← phi( cputs::@1/(to_nomodify byte*) cputs::s#0 )
@ -2161,7 +2162,8 @@ SYMBOL TABLE SSA
(label) cputln::@1
(label) cputln::@return
(void()) cputs((to_nomodify byte*) cputs::s)
(bool~) cputs::$1
(byte~) cputs::$0
(bool~) cputs::$2
(label) cputs::@1
(label) cputs::@2
(label) cputs::@3
@ -3706,7 +3708,7 @@ Adding number conversion cast (unumber) $28 in (byte*) conio_line_text ← (byte
Adding number conversion cast (unumber) $28 in (byte*) conio_line_color ← (byte*) conio_line_color - (number) $28
Adding number conversion cast (unumber) 0 in (byte) gotoxy::x#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) gotoxy::y#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
Adding number conversion cast (unumber) 0 in (bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
Adding number conversion cast (unumber) 0 in (bool~) printf_ulong::$5 ← (number) 0 != (byte) printf_ulong::format_sign_always#2
Adding number conversion cast (unumber) printf_ulong::$2 in (byte) printf_ulong::format_upper_case#3 ← phi( printf_ulong::@1/(byte) printf_ulong::format_upper_case#4 printf_ulong::@2/(byte) printf_ulong::format_upper_case#5 )
(byte) printf_ulong::format_zero_padding#3 ← phi( printf_ulong::@1/(byte) printf_ulong::format_zero_padding#4 printf_ulong::@2/(byte) printf_ulong::format_zero_padding#5 )
@ -4112,19 +4114,19 @@ Inversing boolean not [350] (bool~) gotoxy::$1 ← (byte) gotoxy::y#3 <= (byte)
Inversing boolean not [354] (bool~) gotoxy::$3 ← (byte) gotoxy::x#3 < (byte) $28 from [353] (bool~) gotoxy::$2 ← (byte) gotoxy::x#3 >= (byte) $28
Inversing boolean not [380] (bool~) cputc::$2 ← (byte) conio_cursor_x != (byte) $28 from [379] (bool~) cputc::$1 ← (byte) conio_cursor_x == (byte) $28
Inversing boolean not [391] (bool~) cscroll::$1 ← (byte) conio_cursor_y != (byte) $19 from [390] (bool~) cscroll::$0 ← (byte) conio_cursor_y == (byte) $19
Inversing boolean not [520] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#3 from [519] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#3
Inversing boolean not [524] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#3 from [523] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#3
Inversing boolean not [526] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#3 from [525] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#3
Inversing boolean not [539] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#3 from [538] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#3
Inversing boolean not [546] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [545] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [554] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#4 from [553] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#4
Inversing boolean not [571] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#3 from [570] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#3
Inversing boolean not [583] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#5 from [582] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#5
Inversing boolean not [601] (bool~) printf_string::$0 ← (byte) 0 == (byte) printf_string::format_min_length#1 from [600] (bool~) printf_string::$14 ← (byte) 0 != (byte) printf_string::format_min_length#1
Inversing boolean not [605] (bool~) printf_string::$1 ← (byte) 0 == (byte) printf_string::format_justify_left#1 from [604] (bool~) printf_string::$15 ← (byte) 0 != (byte) printf_string::format_justify_left#1
Inversing boolean not [620] (bool~) printf_string::$12 ← (signed byte) printf_string::padding#1 >= (signed byte) 0 from [619] (bool~) printf_string::$11 ← (signed byte) printf_string::padding#1 < (signed byte) 0
Inversing boolean not [768] (bool~) queen::$2 ← (byte) 0 == (byte~) queen::$1 from [767] (bool~) queen::$7 ← (byte) 0 != (byte~) queen::$1
Inversing boolean not [808] (bool~) legal::$6 ← (byte~) legal::$3 != (byte~) legal::$4 from [807] (bool~) legal::$5 ← (byte~) legal::$3 == (byte~) legal::$4
Inversing boolean not [521] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#3 from [520] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#3
Inversing boolean not [525] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#3 from [524] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#3
Inversing boolean not [527] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#3 from [526] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#3
Inversing boolean not [540] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#3 from [539] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#3
Inversing boolean not [547] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [546] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [555] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#4 from [554] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#4
Inversing boolean not [572] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#3 from [571] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#3
Inversing boolean not [584] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#5 from [583] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#5
Inversing boolean not [602] (bool~) printf_string::$0 ← (byte) 0 == (byte) printf_string::format_min_length#1 from [601] (bool~) printf_string::$14 ← (byte) 0 != (byte) printf_string::format_min_length#1
Inversing boolean not [606] (bool~) printf_string::$1 ← (byte) 0 == (byte) printf_string::format_justify_left#1 from [605] (bool~) printf_string::$15 ← (byte) 0 != (byte) printf_string::format_justify_left#1
Inversing boolean not [621] (bool~) printf_string::$12 ← (signed byte) printf_string::padding#1 >= (signed byte) 0 from [620] (bool~) printf_string::$11 ← (signed byte) printf_string::padding#1 < (signed byte) 0
Inversing boolean not [769] (bool~) queen::$2 ← (byte) 0 == (byte~) queen::$1 from [768] (bool~) queen::$7 ← (byte) 0 != (byte~) queen::$1
Inversing boolean not [809] (bool~) legal::$6 ← (byte~) legal::$3 != (byte~) legal::$4 from [808] (bool~) legal::$5 ← (byte~) legal::$3 == (byte~) legal::$4
Successful SSA optimization Pass2UnaryNotSimplification
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
@ -4211,7 +4213,7 @@ Alias gotoxy::x#5 = gotoxy::x#6
Alias gotoxy::line_offset#0 = gotoxy::$4
Alias gotoxy::y#5 = gotoxy::y#6
Alias cputc::c#3 = cputc::c#4
Alias cputs::c#1 = cputs::c#2
Alias cputs::c#1 = cputs::$0 cputs::c#2
Alias cputs::s#0 = cputs::s#16 cputs::s#15
Alias printf_padding::pad#5 = printf_padding::pad#6 printf_padding::pad#8
Alias printf_padding::i#2 = printf_padding::i#4 printf_padding::i#3
@ -4507,7 +4509,7 @@ Simple Condition (bool~) cputc::$0 [280] if((byte) cputc::c#3==(byte) '
Simple Condition (bool~) cputc::$2 [286] if((byte) conio_cursor_x!=(byte) $28) goto cputc::@return
Simple Condition (bool~) cscroll::$1 [296] if((byte) conio_cursor_y!=(byte) $19) goto cscroll::@return
Simple Condition (bool~) cscroll::$7 [298] if((byte) 0!=(byte) conio_scroll_enable) goto cscroll::@3
Simple Condition (bool~) cputs::$1 [332] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) cputs::$2 [332] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) printf_padding::$0 [340] if((byte) printf_padding::i#2<(byte) printf_padding::length#6) goto printf_padding::@2
Simple Condition (bool~) printf_ulong::$5 [347] if((byte) 0!=(byte) printf_ulong::format_sign_always#2) goto printf_ulong::@1
Simple Condition (bool~) printf_uint::$5 [368] if((byte) 0!=(byte) printf_uint::format_sign_always#0) goto printf_uint::@1
@ -15483,12 +15485,11 @@ cputs: {
// [133] phi (to_nomodify byte*) cputs::s#13 = (to_nomodify byte*) cputs::s#14 [phi:cputs/cputs::@2->cputs::@1#0] -- register_copy
// cputs::@1
__b1:
// c=*s++
// while(c=*s++)
// [134] (byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#13) -- vbuz1=_deref_pbuz2
ldy #0
lda (s),y
sta.z c
// while(c=*s++)
// [135] (to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#13 -- pbuz1=_inc_pbuz1
inc.z s
bne !+

View File

@ -160,10 +160,9 @@ clrscr: {
cputs: {
.label s = $13
__b1:
// c=*s++
// while(c=*s++)
ldy #0
lda (s),y
// while(c=*s++)
inc.z s
bne !+
inc.z s+1

View File

@ -926,9 +926,10 @@ cputs: scope:[cputs] from main::@1 main::@2 main::@5 main::@7 print::@11 print:
cputs::@1: scope:[cputs] from cputs cputs::@3
(to_nomodify byte*) cputs::s#11 ← phi( cputs/(to_nomodify byte*) cputs::s#12 cputs::@3/(to_nomodify byte*) cputs::s#13 )
(byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#11)
(byte~) cputs::$0 ← (byte) cputs::c#1
(to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#11
(bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
if((bool~) cputs::$1) goto cputs::@2
(bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
if((bool~) cputs::$2) goto cputs::@2
to:cputs::@return
cputs::@2: scope:[cputs] from cputs::@1
(to_nomodify byte*) cputs::s#14 ← phi( cputs::@1/(to_nomodify byte*) cputs::s#0 )
@ -2043,7 +2044,8 @@ SYMBOL TABLE SSA
(label) cputln::@1
(label) cputln::@return
(void()) cputs((to_nomodify byte*) cputs::s)
(bool~) cputs::$1
(byte~) cputs::$0
(bool~) cputs::$2
(label) cputs::@1
(label) cputs::@2
(label) cputs::@3
@ -3461,7 +3463,7 @@ Adding number conversion cast (unumber) $28 in (byte*) conio_line_text ← (byte
Adding number conversion cast (unumber) $28 in (byte*) conio_line_color ← (byte*) conio_line_color - (number) $28
Adding number conversion cast (unumber) 0 in (byte) gotoxy::x#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) gotoxy::y#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
Adding number conversion cast (unumber) 0 in (bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
Adding number conversion cast (unumber) 0 in (bool~) printf_ulong::$5 ← (number) 0 != (byte) printf_ulong::format_sign_always#2
Adding number conversion cast (unumber) printf_ulong::$2 in (byte) printf_ulong::format_upper_case#3 ← phi( printf_ulong::@1/(byte) printf_ulong::format_upper_case#4 printf_ulong::@2/(byte) printf_ulong::format_upper_case#5 )
(byte) printf_ulong::format_zero_padding#3 ← phi( printf_ulong::@1/(byte) printf_ulong::format_zero_padding#4 printf_ulong::@2/(byte) printf_ulong::format_zero_padding#5 )
@ -3779,16 +3781,16 @@ Inversing boolean not [350] (bool~) gotoxy::$1 ← (byte) gotoxy::y#3 <= (byte)
Inversing boolean not [354] (bool~) gotoxy::$3 ← (byte) gotoxy::x#3 < (byte) $28 from [353] (bool~) gotoxy::$2 ← (byte) gotoxy::x#3 >= (byte) $28
Inversing boolean not [380] (bool~) cputc::$2 ← (byte) conio_cursor_x != (byte) $28 from [379] (bool~) cputc::$1 ← (byte) conio_cursor_x == (byte) $28
Inversing boolean not [391] (bool~) cscroll::$1 ← (byte) conio_cursor_y != (byte) $19 from [390] (bool~) cscroll::$0 ← (byte) conio_cursor_y == (byte) $19
Inversing boolean not [520] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#3 from [519] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#3
Inversing boolean not [524] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#3 from [523] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#3
Inversing boolean not [526] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#3 from [525] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#3
Inversing boolean not [539] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#3 from [538] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#3
Inversing boolean not [546] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [545] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [554] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#4 from [553] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#4
Inversing boolean not [571] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#3 from [570] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#3
Inversing boolean not [583] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#5 from [582] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#5
Inversing boolean not [658] (bool~) queens::$3 ← (byte) 0 == (byte~) queens::$2 from [657] (bool~) queens::$8 ← (byte) 0 != (byte~) queens::$2
Inversing boolean not [717] (bool~) legal::$6 ← (byte~) legal::$3 != (byte~) legal::$4 from [716] (bool~) legal::$5 ← (byte~) legal::$3 == (byte~) legal::$4
Inversing boolean not [521] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#3 from [520] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#3
Inversing boolean not [525] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#3 from [524] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#3
Inversing boolean not [527] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#3 from [526] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#3
Inversing boolean not [540] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#3 from [539] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#3
Inversing boolean not [547] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [546] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [555] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#4 from [554] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#4
Inversing boolean not [572] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#3 from [571] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#3
Inversing boolean not [584] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#5 from [583] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#5
Inversing boolean not [659] (bool~) queens::$3 ← (byte) 0 == (byte~) queens::$2 from [658] (bool~) queens::$8 ← (byte) 0 != (byte~) queens::$2
Inversing boolean not [718] (bool~) legal::$6 ← (byte~) legal::$3 != (byte~) legal::$4 from [717] (bool~) legal::$5 ← (byte~) legal::$3 == (byte~) legal::$4
Successful SSA optimization Pass2UnaryNotSimplification
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
@ -3874,7 +3876,7 @@ Alias gotoxy::x#5 = gotoxy::x#6
Alias gotoxy::line_offset#0 = gotoxy::$4
Alias gotoxy::y#5 = gotoxy::y#6
Alias cputc::c#3 = cputc::c#4
Alias cputs::c#1 = cputs::c#2
Alias cputs::c#1 = cputs::$0 cputs::c#2
Alias cputs::s#0 = cputs::s#14 cputs::s#13
Alias printf_padding::pad#3 = printf_padding::pad#4 printf_padding::pad#6
Alias printf_padding::i#2 = printf_padding::i#4 printf_padding::i#3
@ -4153,7 +4155,7 @@ Simple Condition (bool~) cputc::$0 [280] if((byte) cputc::c#3==(byte) '
Simple Condition (bool~) cputc::$2 [286] if((byte) conio_cursor_x!=(byte) $28) goto cputc::@return
Simple Condition (bool~) cscroll::$1 [296] if((byte) conio_cursor_y!=(byte) $19) goto cscroll::@return
Simple Condition (bool~) cscroll::$7 [298] if((byte) 0!=(byte) conio_scroll_enable) goto cscroll::@3
Simple Condition (bool~) cputs::$1 [332] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) cputs::$2 [332] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) printf_padding::$0 [340] if((byte) printf_padding::i#2<(byte) printf_padding::length#4) goto printf_padding::@2
Simple Condition (bool~) printf_ulong::$5 [347] if((byte) 0!=(byte) printf_ulong::format_sign_always#2) goto printf_ulong::@1
Simple Condition (bool~) printf_uint::$5 [368] if((byte) 0!=(byte) printf_uint::format_sign_always#0) goto printf_uint::@1
@ -13320,11 +13322,10 @@ cputs: {
// [42] phi (to_nomodify byte*) cputs::s#11 = (to_nomodify byte*) cputs::s#12 [phi:cputs/cputs::@2->cputs::@1#0] -- register_copy
// cputs::@1
__b1:
// c=*s++
// while(c=*s++)
// [43] (byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#11) -- vbuaa=_deref_pbuz1
ldy #0
lda (s),y
// while(c=*s++)
// [44] (to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#11 -- pbuz1=_inc_pbuz1
inc.z s
bne !+

View File

@ -52,10 +52,9 @@ cputs: {
lda #>main.s
sta.z s+1
__b1:
// c=*s++
// while(c=*s++)
ldy #0
lda (s),y
// while(c=*s++)
inc.z s
bne !+
inc.z s+1

View File

@ -237,9 +237,10 @@ cputs: scope:[cputs] from main
cputs::@1: scope:[cputs] from cputs cputs::@3
(to_nomodify byte*) cputs::s#2 ← phi( cputs/(to_nomodify byte*) cputs::s#3 cputs::@3/(to_nomodify byte*) cputs::s#4 )
(byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#2)
(byte~) cputs::$0 ← (byte) cputs::c#1
(to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#2
(bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
if((bool~) cputs::$1) goto cputs::@2
(bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
if((bool~) cputs::$2) goto cputs::@2
to:cputs::@return
cputs::@2: scope:[cputs] from cputs::@1
(to_nomodify byte*) cputs::s#5 ← phi( cputs::@1/(to_nomodify byte*) cputs::s#0 )
@ -409,7 +410,8 @@ SYMBOL TABLE SSA
(label) cputln::@1
(label) cputln::@return
(void()) cputs((to_nomodify byte*) cputs::s)
(bool~) cputs::$1
(byte~) cputs::$0
(bool~) cputs::$2
(label) cputs::@1
(label) cputs::@2
(label) cputs::@3
@ -600,7 +602,7 @@ Adding number conversion cast (unumber) $28 in (byte*) conio_line_text ← (byte
Adding number conversion cast (unumber) $28 in (byte*) conio_line_color ← (byte*) conio_line_color - (number) $28
Adding number conversion cast (unumber) 0 in (byte) gotoxy::x#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) gotoxy::y#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
Adding number conversion cast (unumber) 0 in (bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) memcpy::src#0 ← (byte*)(void*) memcpy::source#2
Inlining cast (byte*) memcpy::dst#0 ← (byte*)(void*) memcpy::destination#2
@ -692,7 +694,7 @@ Alias gotoxy::x#4 = gotoxy::x#5
Alias gotoxy::line_offset#0 = gotoxy::$4
Alias gotoxy::y#4 = gotoxy::y#5
Alias cputc::c#1 = cputc::c#2
Alias cputs::c#1 = cputs::c#2
Alias cputs::c#1 = cputs::$0 cputs::c#2
Alias cputs::s#0 = cputs::s#5 cputs::s#4
Successful SSA optimization Pass2AliasElimination
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
@ -724,7 +726,7 @@ Simple Condition (bool~) cputc::$0 [45] if((byte) cputc::c#0==(byte) '
Simple Condition (bool~) cputc::$2 [51] if((byte) conio_cursor_x!=(byte) $28) goto cputc::@return
Simple Condition (bool~) cscroll::$1 [61] if((byte) conio_cursor_y!=(byte) $19) goto cscroll::@return
Simple Condition (bool~) cscroll::$7 [63] if((byte) 0!=(byte) conio_scroll_enable) goto cscroll::@3
Simple Condition (bool~) cputs::$1 [97] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) cputs::$2 [97] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [66] (word) memcpy::num#0 ← (unumber)(number) $19*(number) $28-(number) $28
Constant right-side identified [71] (word) memcpy::num#1 ← (unumber)(number) $19*(number) $28-(number) $28
@ -2525,11 +2527,10 @@ cputs: {
sta.z s+1
// cputs::@1
__b1:
// c=*s++
// while(c=*s++)
// [13] (byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#2) -- vbuaa=_deref_pbuz1
ldy #0
lda (s),y
// while(c=*s++)
// [14] (to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#2 -- pbuz1=_inc_pbuz1
inc.z s
bne !+

View File

@ -714,10 +714,9 @@ cputs: {
lda #>num_buffer
sta.z s+1
__b1:
// c=*s++
// while(c=*s++)
ldy #0
lda (s),y
// while(c=*s++)
inc.z s
bne !+
inc.z s+1

View File

@ -466,9 +466,10 @@ cputs: scope:[cputs] from cputsxy::@1
cputs::@1: scope:[cputs] from cputs cputs::@3
(to_nomodify byte*) cputs::s#2 ← phi( cputs/(to_nomodify byte*) cputs::s#3 cputs::@3/(to_nomodify byte*) cputs::s#4 )
(byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#2)
(byte~) cputs::$0 ← (byte) cputs::c#1
(to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#2
(bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
if((bool~) cputs::$1) goto cputs::@2
(bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
if((bool~) cputs::$2) goto cputs::@2
to:cputs::@return
cputs::@2: scope:[cputs] from cputs::@1
(to_nomodify byte*) cputs::s#5 ← phi( cputs::@1/(to_nomodify byte*) cputs::s#0 )
@ -748,8 +749,9 @@ main::initNES1_@1: scope:[main] from main::initNES1_@1 main::initNES1_@6
*((const nomodify byte*) MEMORY+(number) $600 + (byte) main::initNES1_i#2) ← (number) 0
*((const nomodify byte*) MEMORY+(number) $700 + (byte) main::initNES1_i#2) ← (number) 0
(byte) main::initNES1_i#1 ← ++ (byte) main::initNES1_i#2
(bool~) main::initNES1_$5 ← (number) 0 != (byte) main::initNES1_i#1
if((bool~) main::initNES1_$5) goto main::initNES1_@1
(byte~) main::initNES1_$5 ← (byte) main::initNES1_i#1
(bool~) main::initNES1_$6 ← (number) 0 != (byte~) main::initNES1_$5
if((bool~) main::initNES1_$6) goto main::initNES1_@1
to:main::initNES1_waitForVBlank2
main::initNES1_waitForVBlank2: scope:[main] from main::initNES1_@1
to:main::initNES1_waitForVBlank2_@1
@ -1186,7 +1188,8 @@ SYMBOL TABLE SSA
(label) cputln::@1
(label) cputln::@return
(void()) cputs((to_nomodify byte*) cputs::s)
(bool~) cputs::$1
(byte~) cputs::$0
(bool~) cputs::$2
(label) cputs::@1
(label) cputs::@2
(label) cputs::@3
@ -1341,7 +1344,8 @@ SYMBOL TABLE SSA
(byte) main::i#6
(byte) main::i#7
(label) main::initNES1
(bool~) main::initNES1_$5
(byte~) main::initNES1_$5
(bool~) main::initNES1_$6
(label) main::initNES1_@1
(label) main::initNES1_@6
(label) main::initNES1_@7
@ -1906,7 +1910,7 @@ Adding number conversion cast (unumber) $20 in (nomodify void*) ppuDataFill::ppu
Adding number conversion cast (unumber) $1e*$20 in (nomodify void*) ppuDataFill::ppuData#1 ← (void*)(const nomodify byte*) CONIO_SCREEN_TEXT+(number) $1e*(number) $20-(unumber)(number) $20
Adding number conversion cast (unumber) $20 in (word) ppuDataFill::size#1 ← (number) $20
Adding number conversion cast (unumber) $20 in (byte*) conio_line_text ← (byte*) conio_line_text - (number) $20
Adding number conversion cast (unumber) 0 in (bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
Adding number conversion cast (unumber) 0 in (bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
Adding number conversion cast (unumber) 3 in (byte) uctoa::max_digits#1 ← (number) 3
Adding number conversion cast (unumber) 2 in (byte) uctoa::max_digits#2 ← (number) 2
Adding number conversion cast (unumber) 3 in (byte) uctoa::max_digits#3 ← (number) 3
@ -1939,7 +1943,7 @@ Adding number conversion cast (unumber) 0 in *((const nomodify byte*) MEMORY+(nu
Adding number conversion cast (unumber) $600 in *((const nomodify byte*) MEMORY+(number) $600 + (byte) main::initNES1_i#2) ← ((unumber)) (number) 0
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) MEMORY+(number) $700 + (byte) main::initNES1_i#2) ← (number) 0
Adding number conversion cast (unumber) $700 in *((const nomodify byte*) MEMORY+(number) $700 + (byte) main::initNES1_i#2) ← ((unumber)) (number) 0
Adding number conversion cast (unumber) 0 in (bool~) main::initNES1_$5 ← (number) 0 != (byte) main::initNES1_i#1
Adding number conversion cast (unumber) 0 in (bool~) main::initNES1_$6 ← (number) 0 != (byte~) main::initNES1_$5
Adding number conversion cast (unumber) $80 in (number~) main::initNES1_waitForVBlank2_$0 ← *((byte*~) main::initNES1_waitForVBlank2_$2) & (number) $80
Adding number conversion cast (unumber) main::initNES1_waitForVBlank2_$0 in (number~) main::initNES1_waitForVBlank2_$0 ← *((byte*~) main::initNES1_waitForVBlank2_$2) & (unumber)(number) $80
Adding number conversion cast (unumber) 0 in (bool~) main::initNES1_waitForVBlank2_$4 ← (number) 0 != (unumber~) main::initNES1_waitForVBlank2_$0
@ -2236,14 +2240,14 @@ Inversing boolean not [134] (bool~) gotoxy::$1 ← (byte) gotoxy::y#4 <= (byte)
Inversing boolean not [138] (bool~) gotoxy::$3 ← (byte) gotoxy::x#4 < (byte) $20 from [137] (bool~) gotoxy::$2 ← (byte) gotoxy::x#4 >= (byte) $20
Inversing boolean not [164] (bool~) cputc::$4 ← (byte) conio_cursor_x != (byte) $20 from [163] (bool~) cputc::$3 ← (byte) conio_cursor_x == (byte) $20
Inversing boolean not [174] (bool~) cscroll::$1 ← (byte) conio_cursor_y != (byte) $1e from [173] (bool~) cscroll::$0 ← (byte) conio_cursor_y == (byte) $1e
Inversing boolean not [332] (bool~) main::initNES1_waitForVBlank1_$1 ← (byte) 0 == (byte~) main::initNES1_waitForVBlank1_$0 from [331] (bool~) main::initNES1_waitForVBlank1_$4 ← (byte) 0 != (byte~) main::initNES1_waitForVBlank1_$0
Inversing boolean not [351] (bool~) main::initNES1_waitForVBlank2_$1 ← (byte) 0 == (byte~) main::initNES1_waitForVBlank2_$0 from [350] (bool~) main::initNES1_waitForVBlank2_$4 ← (byte) 0 != (byte~) main::initNES1_waitForVBlank2_$0
Inversing boolean not [466] (bool~) vblank::$2 ← (byte) 0 == (byte~) vblank::$1 from [465] (bool~) vblank::$17 ← (byte) 0 != (byte~) vblank::$1
Inversing boolean not [471] (bool~) vblank::$4 ← (byte) 0 == (byte~) vblank::$3 from [470] (bool~) vblank::$18 ← (byte) 0 != (byte~) vblank::$3
Inversing boolean not [476] (bool~) vblank::$10 ← (volatile byte) y_scroll != (byte) $f0 from [475] (bool~) vblank::$9 ← (volatile byte) y_scroll == (byte) $f0
Inversing boolean not [483] (bool~) vblank::$6 ← (byte) 0 == (byte~) vblank::$5 from [482] (bool~) vblank::$19 ← (byte) 0 != (byte~) vblank::$5
Inversing boolean not [488] (bool~) vblank::$12 ← (volatile byte) y_scroll != (byte) $ff from [487] (bool~) vblank::$11 ← (volatile byte) y_scroll == (byte) $ff
Inversing boolean not [495] (bool~) vblank::$8 ← (byte) 0 == (byte~) vblank::$7 from [494] (bool~) vblank::$20 ← (byte) 0 != (byte~) vblank::$7
Inversing boolean not [333] (bool~) main::initNES1_waitForVBlank1_$1 ← (byte) 0 == (byte~) main::initNES1_waitForVBlank1_$0 from [332] (bool~) main::initNES1_waitForVBlank1_$4 ← (byte) 0 != (byte~) main::initNES1_waitForVBlank1_$0
Inversing boolean not [353] (bool~) main::initNES1_waitForVBlank2_$1 ← (byte) 0 == (byte~) main::initNES1_waitForVBlank2_$0 from [352] (bool~) main::initNES1_waitForVBlank2_$4 ← (byte) 0 != (byte~) main::initNES1_waitForVBlank2_$0
Inversing boolean not [468] (bool~) vblank::$2 ← (byte) 0 == (byte~) vblank::$1 from [467] (bool~) vblank::$17 ← (byte) 0 != (byte~) vblank::$1
Inversing boolean not [473] (bool~) vblank::$4 ← (byte) 0 == (byte~) vblank::$3 from [472] (bool~) vblank::$18 ← (byte) 0 != (byte~) vblank::$3
Inversing boolean not [478] (bool~) vblank::$10 ← (volatile byte) y_scroll != (byte) $f0 from [477] (bool~) vblank::$9 ← (volatile byte) y_scroll == (byte) $f0
Inversing boolean not [485] (bool~) vblank::$6 ← (byte) 0 == (byte~) vblank::$5 from [484] (bool~) vblank::$19 ← (byte) 0 != (byte~) vblank::$5
Inversing boolean not [490] (bool~) vblank::$12 ← (volatile byte) y_scroll != (byte) $ff from [489] (bool~) vblank::$11 ← (volatile byte) y_scroll == (byte) $ff
Inversing boolean not [497] (bool~) vblank::$8 ← (byte) 0 == (byte~) vblank::$7 from [496] (bool~) vblank::$20 ← (byte) 0 != (byte~) vblank::$7
Successful SSA optimization Pass2UnaryNotSimplification
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias readJoy1::joy#2 = readJoy1::joy#4 readJoy1::joy#3 readJoy1::return#0 readJoy1::return#3 readJoy1::return#1
@ -2278,7 +2282,7 @@ Alias cputc::c#2 = cputc::c#3
Alias cscroll::line2#2 = cscroll::line2#4 cscroll::line2#5 cscroll::line2#3
Alias cscroll::line1#2 = cscroll::line1#4 cscroll::line1#5 cscroll::line1#3
Alias cscroll::y#2 = cscroll::y#5 cscroll::y#4 cscroll::y#3
Alias cputs::c#1 = cputs::c#2
Alias cputs::c#1 = cputs::$0 cputs::c#2
Alias cputs::s#0 = cputs::s#5 cputs::s#4
Alias cputcxy::c#4 = cputcxy::c#5
Alias cputsxy::s#1 = cputsxy::s#2
@ -2298,6 +2302,7 @@ Alias uctoa_append::digit#2 = uctoa_append::digit#4 uctoa_append::digit#3
Alias uctoa_append::value#2 = uctoa_append::value#3 uctoa_append::value#4 uctoa_append::return#1 uctoa_append::return#4 uctoa_append::return#2
Alias uctoa_append::sub#1 = uctoa_append::sub#2
Alias uctoa_append::buffer#1 = uctoa_append::buffer#4 uctoa_append::buffer#2
Alias main::initNES1_i#1 = main::initNES1_$5
Alias ppuDataTransfer::size#1 = main::$1
Alias main::screensizex1_return#0 = main::screensizex1_return#2 main::screensizex1_return#1 main::screensizex1_return#3 main::$7
Alias main::x#10 = main::x#6 main::x#8 main::x#2 main::x#3 main::x#9 main::x#7 main::x#4 main::x#5
@ -2362,7 +2367,7 @@ Simple Condition (bool~) cputc::$4 [126] if((byte) conio_cursor_x!=(byte) $20) g
Simple Condition (bool~) cscroll::$1 [135] if((byte) conio_cursor_y!=(byte) $1e) goto cscroll::@return
Simple Condition (bool~) cscroll::$7 [137] if((byte) 0!=(byte) conio_scroll_enable) goto cscroll::@3
Simple Condition (bool~) cscroll::$3 [146] if((byte) cscroll::y#2<(byte)(number) $1e-(number) 1) goto cscroll::@5
Simple Condition (bool~) cputs::$1 [171] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) cputs::$2 [171] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) uctoa::$0 [193] if((byte) uctoa::radix#0==(const byte) DECIMAL) goto uctoa::@1
Simple Condition (bool~) uctoa::$1 [197] if((byte) uctoa::radix#0==(const byte) HEXADECIMAL) goto uctoa::@2
Simple Condition (bool~) uctoa::$2 [201] if((byte) uctoa::radix#0==(const byte) OCTAL) goto uctoa::@3
@ -2370,7 +2375,7 @@ Simple Condition (bool~) uctoa::$3 [205] if((byte) uctoa::radix#0==(const byte)
Simple Condition (bool~) uctoa::$5 [222] if((byte) uctoa::digit#2<(byte~) uctoa::$4) goto uctoa::@11
Simple Condition (bool~) uctoa_append::$0 [245] if((byte) uctoa_append::value#2>=(byte) uctoa_append::sub#0) goto uctoa_append::@2
Simple Condition (bool~) main::initNES1_waitForVBlank1_$1 [266] if((byte) 0==(byte~) main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1
Simple Condition (bool~) main::initNES1_$5 [279] if((byte) 0!=(byte) main::initNES1_i#1) goto main::initNES1_@1
Simple Condition (bool~) main::initNES1_$6 [279] if((byte) 0!=(byte) main::initNES1_i#1) goto main::initNES1_@1
Simple Condition (bool~) main::initNES1_waitForVBlank2_$1 [284] if((byte) 0==(byte~) main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1
Simple Condition (bool~) main::$9 [304] if((byte) main::x#10<(byte~) main::$8) goto main::@1
Simple Condition (bool~) main::$16 [320] if((byte) main::y#10<(byte~) main::$15) goto main::@3
@ -9536,11 +9541,10 @@ cputs: {
sta.z s+1
// cputs::@1
__b1:
// c=*s++
// while(c=*s++)
// [187] (byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#2) -- vbuaa=_deref_pbuz1
ldy #0
lda (s),y
// while(c=*s++)
// [188] (to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#2 -- pbuz1=_inc_pbuz1
inc.z s
bne !+

View File

@ -410,8 +410,9 @@ main::initNES1_@1: scope:[main] from main::initNES1_@1 main::initNES1_@6
*((const nomodify byte*) MEMORY+(number) $600 + (byte) main::initNES1_i#2) ← (number) 0
*((const nomodify byte*) MEMORY+(number) $700 + (byte) main::initNES1_i#2) ← (number) 0
(byte) main::initNES1_i#1 ← ++ (byte) main::initNES1_i#2
(bool~) main::initNES1_$5 ← (number) 0 != (byte) main::initNES1_i#1
if((bool~) main::initNES1_$5) goto main::initNES1_@1
(byte~) main::initNES1_$5 ← (byte) main::initNES1_i#1
(bool~) main::initNES1_$6 ← (number) 0 != (byte~) main::initNES1_$5
if((bool~) main::initNES1_$6) goto main::initNES1_@1
to:main::initNES1_waitForVBlank2
main::initNES1_waitForVBlank2: scope:[main] from main::initNES1_@1
to:main::initNES1_waitForVBlank2_@1
@ -711,7 +712,8 @@ SYMBOL TABLE SSA
(byte*~) main::enableVideoOutput1_$2
(byte*~) main::enableVideoOutput1_$3
(label) main::initNES1
(bool~) main::initNES1_$5
(byte~) main::initNES1_$5
(bool~) main::initNES1_$6
(label) main::initNES1_@1
(label) main::initNES1_@6
(label) main::initNES1_@7
@ -1102,7 +1104,7 @@ Adding number conversion cast (unumber) 0 in *((const nomodify byte*) MEMORY+(nu
Adding number conversion cast (unumber) $600 in *((const nomodify byte*) MEMORY+(number) $600 + (byte) main::initNES1_i#2) ← ((unumber)) (number) 0
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) MEMORY+(number) $700 + (byte) main::initNES1_i#2) ← (number) 0
Adding number conversion cast (unumber) $700 in *((const nomodify byte*) MEMORY+(number) $700 + (byte) main::initNES1_i#2) ← ((unumber)) (number) 0
Adding number conversion cast (unumber) 0 in (bool~) main::initNES1_$5 ← (number) 0 != (byte) main::initNES1_i#1
Adding number conversion cast (unumber) 0 in (bool~) main::initNES1_$6 ← (number) 0 != (byte~) main::initNES1_$5
Adding number conversion cast (unumber) $80 in (number~) main::initNES1_waitForVBlank2_$0 ← *((byte*~) main::initNES1_waitForVBlank2_$2) & (number) $80
Adding number conversion cast (unumber) main::initNES1_waitForVBlank2_$0 in (number~) main::initNES1_waitForVBlank2_$0 ← *((byte*~) main::initNES1_waitForVBlank2_$2) & (unumber)(number) $80
Adding number conversion cast (unumber) 0 in (bool~) main::initNES1_waitForVBlank2_$4 ← (number) 0 != (unumber~) main::initNES1_waitForVBlank2_$0
@ -1349,11 +1351,11 @@ Inferred type updated to byte in (unumber~) vblank::$53 ← (byte) 1 * (const by
Inferred type updated to byte in (unumber~) vblank::$55 ← (byte) 2 * (const byte) SIZEOF_STRUCT_SPRITEDATA
Inferred type updated to byte in (unumber~) vblank::$57 ← (byte) 3 * (const byte) SIZEOF_STRUCT_SPRITEDATA
Inversing boolean not [159] (bool~) main::initNES1_waitForVBlank1_$1 ← (byte) 0 == (byte~) main::initNES1_waitForVBlank1_$0 from [158] (bool~) main::initNES1_waitForVBlank1_$4 ← (byte) 0 != (byte~) main::initNES1_waitForVBlank1_$0
Inversing boolean not [178] (bool~) main::initNES1_waitForVBlank2_$1 ← (byte) 0 == (byte~) main::initNES1_waitForVBlank2_$0 from [177] (bool~) main::initNES1_waitForVBlank2_$4 ← (byte) 0 != (byte~) main::initNES1_waitForVBlank2_$0
Inversing boolean not [230] (bool~) vblank::$2 ← (byte) 0 == (byte~) vblank::$1 from [229] (bool~) vblank::$62 ← (byte) 0 != (byte~) vblank::$1
Inversing boolean not [235] (bool~) vblank::$4 ← (byte) 0 == (byte~) vblank::$3 from [234] (bool~) vblank::$63 ← (byte) 0 != (byte~) vblank::$3
Inversing boolean not [249] (bool~) vblank::$6 ← (byte) 0 == (byte~) vblank::$5 from [248] (bool~) vblank::$64 ← (byte) 0 != (byte~) vblank::$5
Inversing boolean not [263] (bool~) vblank::$8 ← (byte) 0 == (byte~) vblank::$7 from [262] (bool~) vblank::$65 ← (byte) 0 != (byte~) vblank::$7
Inversing boolean not [179] (bool~) main::initNES1_waitForVBlank2_$1 ← (byte) 0 == (byte~) main::initNES1_waitForVBlank2_$0 from [178] (bool~) main::initNES1_waitForVBlank2_$4 ← (byte) 0 != (byte~) main::initNES1_waitForVBlank2_$0
Inversing boolean not [231] (bool~) vblank::$2 ← (byte) 0 == (byte~) vblank::$1 from [230] (bool~) vblank::$62 ← (byte) 0 != (byte~) vblank::$1
Inversing boolean not [236] (bool~) vblank::$4 ← (byte) 0 == (byte~) vblank::$3 from [235] (bool~) vblank::$63 ← (byte) 0 != (byte~) vblank::$3
Inversing boolean not [250] (bool~) vblank::$6 ← (byte) 0 == (byte~) vblank::$5 from [249] (bool~) vblank::$64 ← (byte) 0 != (byte~) vblank::$5
Inversing boolean not [264] (bool~) vblank::$8 ← (byte) 0 == (byte~) vblank::$7 from [263] (bool~) vblank::$65 ← (byte) 0 != (byte~) vblank::$7
Successful SSA optimization Pass2UnaryNotSimplification
Alias readJoy1::joy#2 = readJoy1::joy#4 readJoy1::joy#3 readJoy1::return#0 readJoy1::return#3 readJoy1::return#1
Alias readJoy1::i#2 = readJoy1::i#3
@ -1383,6 +1385,7 @@ Alias memcpy::src#2 = memcpy::src#3
Alias memcpy::dst#2 = memcpy::dst#3
Alias memcpy::src_end#1 = memcpy::src_end#2
Alias memcpy::destination#2 = memcpy::destination#4 memcpy::destination#3 memcpy::return#0 memcpy::return#3 memcpy::return#1
Alias main::initNES1_i#1 = main::initNES1_$5
Alias ppuDataTransfer::size#0 = main::$1
Alias main::x#2 = main::x#3 main::x#4
Alias memcpy::num#0 = main::$6
@ -1411,7 +1414,7 @@ Simple Condition (bool~) ppuDataFill::$1 [30] if((word) ppuDataFill::i#2<(word)
Simple Condition (bool~) ppuDataTransfer::$1 [49] if((word) ppuDataTransfer::i#2<(word) ppuDataTransfer::size#0) goto ppuDataTransfer::@2
Simple Condition (bool~) memcpy::$1 [101] if((byte*) memcpy::src#2!=(byte*) memcpy::src_end#0) goto memcpy::@2
Simple Condition (bool~) main::initNES1_waitForVBlank1_$1 [122] if((byte) 0==(byte~) main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1
Simple Condition (bool~) main::initNES1_$5 [135] if((byte) 0!=(byte) main::initNES1_i#1) goto main::initNES1_@1
Simple Condition (bool~) main::initNES1_$6 [135] if((byte) 0!=(byte) main::initNES1_i#1) goto main::initNES1_@1
Simple Condition (bool~) main::initNES1_waitForVBlank2_$1 [140] if((byte) 0==(byte~) main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1
Simple Condition (bool~) main::$9 [157] if((byte) main::x#2<(byte) $20) goto main::@2
Simple Condition (bool~) main::$12 [178] if((number) 0!=(number) 1) goto main::@4

View File

@ -238,8 +238,9 @@ main::initNES1_@1: scope:[main] from main::initNES1_@1 main::initNES1_@6
*((const nomodify byte*) MEMORY+(number) $600 + (byte) main::initNES1_i#2) ← (number) 0
*((const nomodify byte*) MEMORY+(number) $700 + (byte) main::initNES1_i#2) ← (number) 0
(byte) main::initNES1_i#1 ← ++ (byte) main::initNES1_i#2
(bool~) main::initNES1_$5 ← (number) 0 != (byte) main::initNES1_i#1
if((bool~) main::initNES1_$5) goto main::initNES1_@1
(byte~) main::initNES1_$5 ← (byte) main::initNES1_i#1
(bool~) main::initNES1_$6 ← (number) 0 != (byte~) main::initNES1_$5
if((bool~) main::initNES1_$6) goto main::initNES1_@1
to:main::initNES1_waitForVBlank2
main::initNES1_waitForVBlank2: scope:[main] from main::initNES1_@1
to:main::initNES1_waitForVBlank2_@1
@ -574,7 +575,8 @@ SYMBOL TABLE SSA
(byte*~) main::enableVideoOutput1_$2
(byte*~) main::enableVideoOutput1_$3
(label) main::initNES1
(bool~) main::initNES1_$5
(byte~) main::initNES1_$5
(bool~) main::initNES1_$6
(label) main::initNES1_@1
(label) main::initNES1_@6
(label) main::initNES1_@7
@ -898,7 +900,7 @@ Adding number conversion cast (unumber) 0 in *((const nomodify byte*) MEMORY+(nu
Adding number conversion cast (unumber) $600 in *((const nomodify byte*) MEMORY+(number) $600 + (byte) main::initNES1_i#2) ← ((unumber)) (number) 0
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) MEMORY+(number) $700 + (byte) main::initNES1_i#2) ← (number) 0
Adding number conversion cast (unumber) $700 in *((const nomodify byte*) MEMORY+(number) $700 + (byte) main::initNES1_i#2) ← ((unumber)) (number) 0
Adding number conversion cast (unumber) 0 in (bool~) main::initNES1_$5 ← (number) 0 != (byte) main::initNES1_i#1
Adding number conversion cast (unumber) 0 in (bool~) main::initNES1_$6 ← (number) 0 != (byte~) main::initNES1_$5
Adding number conversion cast (unumber) $80 in (number~) main::initNES1_waitForVBlank2_$0 ← *((byte*~) main::initNES1_waitForVBlank2_$2) & (number) $80
Adding number conversion cast (unumber) main::initNES1_waitForVBlank2_$0 in (number~) main::initNES1_waitForVBlank2_$0 ← *((byte*~) main::initNES1_waitForVBlank2_$2) & (unumber)(number) $80
Adding number conversion cast (unumber) 0 in (bool~) main::initNES1_waitForVBlank2_$4 ← (number) 0 != (unumber~) main::initNES1_waitForVBlank2_$0
@ -1124,8 +1126,8 @@ Inferred type updated to byte in (unumber~) vblank::$22 ← (byte) vblank::x_idx
Inferred type updated to byte in (unumber~) vblank::$23 ← (byte~) vblank::$22
Inferred type updated to byte for (unumber~) vblank::$26
Inversing boolean not [92] (bool~) main::initNES1_waitForVBlank1_$1 ← (byte) 0 == (byte~) main::initNES1_waitForVBlank1_$0 from [91] (bool~) main::initNES1_waitForVBlank1_$4 ← (byte) 0 != (byte~) main::initNES1_waitForVBlank1_$0
Inversing boolean not [111] (bool~) main::initNES1_waitForVBlank2_$1 ← (byte) 0 == (byte~) main::initNES1_waitForVBlank2_$0 from [110] (bool~) main::initNES1_waitForVBlank2_$4 ← (byte) 0 != (byte~) main::initNES1_waitForVBlank2_$0
Inversing boolean not [168] (bool~) vblank::$2 ← (byte) 0 == (byte) vblank::joy#0 from [167] (bool~) vblank::$33 ← (byte) 0 != (byte) vblank::joy#0
Inversing boolean not [112] (bool~) main::initNES1_waitForVBlank2_$1 ← (byte) 0 == (byte~) main::initNES1_waitForVBlank2_$0 from [111] (bool~) main::initNES1_waitForVBlank2_$4 ← (byte) 0 != (byte~) main::initNES1_waitForVBlank2_$0
Inversing boolean not [169] (bool~) vblank::$2 ← (byte) 0 == (byte) vblank::joy#0 from [168] (bool~) vblank::$33 ← (byte) 0 != (byte) vblank::joy#0
Successful SSA optimization Pass2UnaryNotSimplification
Alias candidate removed (volatile)x_sin_idx = vblank::$7
Alias candidate removed (volatile)x_sin_idx_2 = vblank::$12
@ -1145,6 +1147,7 @@ Alias ppuDataTransfer::cpuSrc#2 = ppuDataTransfer::cpuSrc#4 ppuDataTransfer::cpu
Alias ppuDataTransfer::i#2 = ppuDataTransfer::i#5 ppuDataTransfer::i#4 ppuDataTransfer::i#3
Alias ppuDataTransfer::size#1 = ppuDataTransfer::size#7 ppuDataTransfer::size#5 ppuDataTransfer::size#3
Alias ppuDataTransfer::ppuDataPut1_val#0 = ppuDataTransfer::ppuDataPut1_val#1
Alias main::initNES1_i#1 = main::initNES1_$5
Alias ppuDataTransfer::size#0 = main::$1
Alias main::s#2 = main::s#3
Alias vblank::ppuSpriteBufferDmaTransfer1_spriteBuffer#0 = vblank::ppuSpriteBufferDmaTransfer1_spriteBuffer#1
@ -1188,13 +1191,13 @@ Identical Phi Values (nomodify void*) ppuDataTransfer::cpuData#1 (nomodify void*
Identical Phi Values (word) ppuDataTransfer::size#2 (word) ppuDataTransfer::size#0
Identical Phi Values (word) ppuDataTransfer::size#1 (word) ppuDataTransfer::size#2
Successful SSA optimization Pass2IdenticalPhiElimination
Identified duplicate assignment right side [202] (byte~) vblank::$28 ← (byte) vblank::s#2 * (const byte) SIZEOF_STRUCT_SPRITEDATA
Identified duplicate assignment right side [203] (byte~) vblank::$28 ← (byte) vblank::s#2 * (const byte) SIZEOF_STRUCT_SPRITEDATA
Successful SSA optimization Pass2DuplicateRValueIdentification
Simple Condition (bool~) readJoy1::$0 [10] if((byte) readJoy1::i#2<(byte) 8) goto readJoy1::@2
Simple Condition (bool~) ppuDataFill::$1 [30] if((word) ppuDataFill::i#2<(word) ppuDataFill::size#3) goto ppuDataFill::@2
Simple Condition (bool~) ppuDataTransfer::$1 [49] if((word) ppuDataTransfer::i#2<(word) ppuDataTransfer::size#0) goto ppuDataTransfer::@2
Simple Condition (bool~) main::initNES1_waitForVBlank1_$1 [73] if((byte) 0==(byte~) main::initNES1_waitForVBlank1_$0) goto main::initNES1_waitForVBlank1_@1
Simple Condition (bool~) main::initNES1_$5 [86] if((byte) 0!=(byte) main::initNES1_i#1) goto main::initNES1_@1
Simple Condition (bool~) main::initNES1_$6 [86] if((byte) 0!=(byte) main::initNES1_i#1) goto main::initNES1_@1
Simple Condition (bool~) main::initNES1_waitForVBlank2_$1 [91] if((byte) 0==(byte~) main::initNES1_waitForVBlank2_$0) goto main::initNES1_waitForVBlank2_@1
Simple Condition (bool~) main::$6 [108] if((byte) main::s#2<(byte) $40) goto main::@2
Simple Condition (bool~) main::$8 [122] if((number) 0!=(number) 1) goto main::@3

View File

@ -0,0 +1,23 @@
// Illustrates a problem with post-incrementing inside the while loop condition
// https://gitlab.com/camelot/kickc/-/issues/486
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
main: {
// n = *(ptr++)
lda mmap
__b1:
// while (n--)
tax
dex
cmp #0
bne __b2
// }
rts
__b2:
// *((unsigned char *)0x400) = n
stx $400
txa
jmp __b1
}
mmap: .byte 2, $5c, $1a, 3, $60, $1a, 7

View File

@ -0,0 +1,17 @@
(void()) main()
main: scope:[main] from
[0] (byte) main::n#0 ← *((const to_nomodify byte*) mmap)
to:main::@1
main::@1: scope:[main] from main main::@2
[1] (byte) main::n#2 ← phi( main/(byte) main::n#0 main::@2/(byte) main::n#5 )
[2] (byte) main::n#1 ← -- (byte) main::n#2
[3] if((byte) 0!=(byte) main::n#2) goto main::@2
to:main::@return
main::@return: scope:[main] from main::@1
[4] return
to:@return
main::@2: scope:[main] from main::@1
[5] *((byte*) 1024) ← (byte) main::n#1
[6] (byte) main::n#5 ← (byte) main::n#1
to:main::@1

View File

@ -0,0 +1,296 @@
CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from __start
(byte*) main::ptr#0 ← (const to_nomodify byte*) mmap
(byte) main::n#0 ← *((byte*) main::ptr#0)
(byte*) main::ptr#1 ← ++ (byte*) main::ptr#0
to:main::@1
main::@1: scope:[main] from main main::@2
(byte) main::n#2 ← phi( main/(byte) main::n#0 main::@2/(byte) main::n#3 )
(byte~) main::$0 ← (byte) main::n#2
(byte) main::n#1 ← -- (byte) main::n#2
(bool~) main::$1 ← (number) 0 != (byte~) main::$0
if((bool~) main::$1) goto main::@2
to:main::@return
main::@2: scope:[main] from main::@1
(byte) main::n#3 ← phi( main::@1/(byte) main::n#1 )
*((byte*)(number) $400) ← (byte) main::n#3
to:main::@1
main::@return: scope:[main] from main::@1
return
to:@return
(void()) __start()
__start: scope:[__start] from
call main
to:__start::@1
__start::@1: scope:[__start] from __start
to:__start::@return
__start::@return: scope:[__start] from __start::@1
return
to:@return
SYMBOL TABLE SSA
(void()) __start()
(label) __start::@1
(label) __start::@return
(void()) main()
(byte~) main::$0
(bool~) main::$1
(label) main::@1
(label) main::@2
(label) main::@return
(byte) main::n
(byte) main::n#0
(byte) main::n#1
(byte) main::n#2
(byte) main::n#3
(byte*) main::ptr
(byte*) main::ptr#0
(byte*) main::ptr#1
(const to_nomodify byte*) mmap[] = { (byte) 2, (byte) $5c, (byte) $1a, (byte) 3, (byte) $60, (byte) $1a, (byte) 7 }
Adding number conversion cast (unumber) 0 in (bool~) main::$1 ← (number) 0 != (byte~) main::$0
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast 0
Simplifying constant pointer cast (byte*) 1024
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias main::n#2 = main::$0
Alias main::n#1 = main::n#3
Successful SSA optimization Pass2AliasElimination
Simple Condition (bool~) main::$1 [6] if((byte) 0!=(byte) main::n#2) goto main::@2
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) main::ptr#0 = mmap
Successful SSA optimization Pass2ConstantIdentification
Eliminating unused variable (byte*) main::ptr#1 and assignment [1] (byte*) main::ptr#1 ← ++ (const byte*) main::ptr#0
Successful SSA optimization PassNEliminateUnusedVars
Removing unused procedure __start
Removing unused procedure block __start
Removing unused procedure block __start::@1
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Constant inlined main::ptr#0 = (const to_nomodify byte*) mmap
Successful SSA optimization Pass2ConstantInlining
CALL GRAPH
Created 1 initial phi equivalence classes
Coalesced [1] main::n#4 ← main::n#0
Not coalescing [7] main::n#5 ← main::n#1
Coalesced down to 2 phi equivalence classes
FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from
[0] (byte) main::n#0 ← *((const to_nomodify byte*) mmap)
to:main::@1
main::@1: scope:[main] from main main::@2
[1] (byte) main::n#2 ← phi( main/(byte) main::n#0 main::@2/(byte) main::n#5 )
[2] (byte) main::n#1 ← -- (byte) main::n#2
[3] if((byte) 0!=(byte) main::n#2) goto main::@2
to:main::@return
main::@return: scope:[main] from main::@1
[4] return
to:@return
main::@2: scope:[main] from main::@1
[5] *((byte*) 1024) ← (byte) main::n#1
[6] (byte) main::n#5 ← (byte) main::n#1
to:main::@1
VARIABLE REGISTER WEIGHTS
(void()) main()
(byte) main::n
(byte) main::n#0 4.0
(byte) main::n#1 11.0
(byte) main::n#2 17.5
(byte) main::n#5 22.0
(byte*) main::ptr
Initial phi equivalence classes
[ main::n#2 main::n#0 main::n#5 ]
Added variable main::n#1 to live range equivalence class [ main::n#1 ]
Complete equivalence classes
[ main::n#2 main::n#0 main::n#5 ]
[ main::n#1 ]
Allocated zp[1]:2 [ main::n#2 main::n#0 main::n#5 ]
Allocated zp[1]:3 [ main::n#1 ]
INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Illustrates a problem with post-incrementing inside the while loop condition
// https://gitlab.com/camelot/kickc/-/issues/486
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// main
main: {
.label n = 2
.label n_1 = 3
// [0] (byte) main::n#0 ← *((const to_nomodify byte*) mmap) -- vbuz1=_deref_pbuc1
lda mmap
sta.z n
// [1] phi from main main::@2 to main::@1 [phi:main/main::@2->main::@1]
__b1_from_main:
__b1_from___b2:
// [1] phi (byte) main::n#2 = (byte) main::n#0 [phi:main/main::@2->main::@1#0] -- register_copy
jmp __b1
// main::@1
__b1:
// [2] (byte) main::n#1 ← -- (byte) main::n#2 -- vbuz1=_dec_vbuz2
ldy.z n
dey
sty.z n_1
// [3] if((byte) 0!=(byte) main::n#2) goto main::@2 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z n
bne __b2
jmp __breturn
// main::@return
__breturn:
// [4] return
rts
// main::@2
__b2:
// [5] *((byte*) 1024) ← (byte) main::n#1 -- _deref_pbuc1=vbuz1
lda.z n_1
sta $400
// [6] (byte) main::n#5 ← (byte) main::n#1 -- vbuz1=vbuz2
lda.z n_1
sta.z n
jmp __b1_from___b2
}
// File Data
mmap: .byte 2, $5c, $1a, 3, $60, $1a, 7
REGISTER UPLIFT POTENTIAL REGISTERS
Potential registers zp[1]:2 [ main::n#2 main::n#0 main::n#5 ] : zp[1]:2 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:3 [ main::n#1 ] : zp[1]:3 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 43.5: zp[1]:2 [ main::n#2 main::n#0 main::n#5 ] 11: zp[1]:3 [ main::n#1 ]
Uplift Scope []
Uplifting [main] best 245 combination reg byte a [ main::n#2 main::n#0 main::n#5 ] reg byte x [ main::n#1 ]
Uplifting [] best 245 combination
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Illustrates a problem with post-incrementing inside the while loop condition
// https://gitlab.com/camelot/kickc/-/issues/486
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// main
main: {
// [0] (byte) main::n#0 ← *((const to_nomodify byte*) mmap) -- vbuaa=_deref_pbuc1
lda mmap
// [1] phi from main main::@2 to main::@1 [phi:main/main::@2->main::@1]
__b1_from_main:
__b1_from___b2:
// [1] phi (byte) main::n#2 = (byte) main::n#0 [phi:main/main::@2->main::@1#0] -- register_copy
jmp __b1
// main::@1
__b1:
// [2] (byte) main::n#1 ← -- (byte) main::n#2 -- vbuxx=_dec_vbuaa
tax
dex
// [3] if((byte) 0!=(byte) main::n#2) goto main::@2 -- vbuc1_neq_vbuaa_then_la1
cmp #0
bne __b2
jmp __breturn
// main::@return
__breturn:
// [4] return
rts
// main::@2
__b2:
// [5] *((byte*) 1024) ← (byte) main::n#1 -- _deref_pbuc1=vbuxx
stx $400
// [6] (byte) main::n#5 ← (byte) main::n#1 -- vbuaa=vbuxx
txa
jmp __b1_from___b2
}
// File Data
mmap: .byte 2, $5c, $1a, 3, $60, $1a, 7
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label __b1_from___b2 with __b1
Removing instruction __b1_from_main:
Removing instruction __b1_from___b2:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@return
(byte) main::n
(byte) main::n#0 reg byte a 4.0
(byte) main::n#1 reg byte x 11.0
(byte) main::n#2 reg byte a 17.5
(byte) main::n#5 reg byte a 22.0
(byte*) main::ptr
(const to_nomodify byte*) mmap[] = { (byte) 2, (byte) $5c, (byte) $1a, (byte) 3, (byte) $60, (byte) $1a, (byte) 7 }
reg byte a [ main::n#2 main::n#0 main::n#5 ]
reg byte x [ main::n#1 ]
FINAL ASSEMBLER
Score: 185
// File Comments
// Illustrates a problem with post-incrementing inside the while loop condition
// https://gitlab.com/camelot/kickc/-/issues/486
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// main
main: {
// n = *(ptr++)
// [0] (byte) main::n#0 ← *((const to_nomodify byte*) mmap) -- vbuaa=_deref_pbuc1
lda mmap
// [1] phi from main main::@2 to main::@1 [phi:main/main::@2->main::@1]
// [1] phi (byte) main::n#2 = (byte) main::n#0 [phi:main/main::@2->main::@1#0] -- register_copy
// main::@1
__b1:
// while (n--)
// [2] (byte) main::n#1 ← -- (byte) main::n#2 -- vbuxx=_dec_vbuaa
tax
dex
// [3] if((byte) 0!=(byte) main::n#2) goto main::@2 -- vbuc1_neq_vbuaa_then_la1
cmp #0
bne __b2
// main::@return
// }
// [4] return
rts
// main::@2
__b2:
// *((unsigned char *)0x400) = n
// [5] *((byte*) 1024) ← (byte) main::n#1 -- _deref_pbuc1=vbuxx
stx $400
// [6] (byte) main::n#5 ← (byte) main::n#1 -- vbuaa=vbuxx
txa
jmp __b1
}
// File Data
mmap: .byte 2, $5c, $1a, 3, $60, $1a, 7

View File

@ -0,0 +1,14 @@
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@return
(byte) main::n
(byte) main::n#0 reg byte a 4.0
(byte) main::n#1 reg byte x 11.0
(byte) main::n#2 reg byte a 17.5
(byte) main::n#5 reg byte a 22.0
(byte*) main::ptr
(const to_nomodify byte*) mmap[] = { (byte) 2, (byte) $5c, (byte) $1a, (byte) 3, (byte) $60, (byte) $1a, (byte) 7 }
reg byte a [ main::n#2 main::n#0 main::n#5 ]
reg byte x [ main::n#1 ]

View File

@ -0,0 +1,34 @@
// Illustrates a problem with post-incrementing inside the while loop condition
// https://gitlab.com/camelot/kickc/-/issues/486
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.label SCREEN = $400
main: {
.label s = 2
ldx #0
lda #<MESSAGE
sta.z s
lda #>MESSAGE
sta.z s+1
__b1:
// while(c=*s++)
ldy #0
lda (s),y
inc.z s
bne !+
inc.z s+1
!:
cmp #0
bne __b2
// }
rts
__b2:
// SCREEN[i++] = c
sta SCREEN,x
// SCREEN[i++] = c;
inx
jmp __b1
}
MESSAGE: .text "hello world!"
.byte 0

View File

@ -0,0 +1,19 @@
(void()) main()
main: scope:[main] from
[0] phi()
to:main::@1
main::@1: scope:[main] from main main::@2
[1] (byte) main::i#2 ← phi( main/(byte) 0 main::@2/(byte) main::i#1 )
[1] (byte*) main::s#2 ← phi( main/(const byte*) MESSAGE main::@2/(byte*) main::s#1 )
[2] (byte) main::c#1 ← *((byte*) main::s#2)
[3] (byte*) main::s#1 ← ++ (byte*) main::s#2
[4] if((byte) 0!=(byte) main::c#1) goto main::@2
to:main::@return
main::@return: scope:[main] from main::@1
[5] return
to:@return
main::@2: scope:[main] from main::@1
[6] *((const nomodify byte*) SCREEN + (byte) main::i#2) ← (byte) main::c#1
[7] (byte) main::i#1 ← ++ (byte) main::i#2
to:main::@1

View File

@ -0,0 +1,375 @@
CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from __start
(byte*) main::s#0 ← (const byte*) MESSAGE
(byte) main::c#0 ← (byte) 0
(byte) main::i#0 ← (byte) 0
to:main::@1
main::@1: scope:[main] from main main::@2
(byte) main::i#3 ← phi( main/(byte) main::i#0 main::@2/(byte) main::i#1 )
(byte*) main::s#2 ← phi( main/(byte*) main::s#0 main::@2/(byte*) main::s#3 )
(byte) main::c#1 ← *((byte*) main::s#2)
(byte~) main::$0 ← (byte) main::c#1
(byte*) main::s#1 ← ++ (byte*) main::s#2
(bool~) main::$1 ← (number) 0 != (byte~) main::$0
if((bool~) main::$1) goto main::@2
to:main::@return
main::@2: scope:[main] from main::@1
(byte*) main::s#3 ← phi( main::@1/(byte*) main::s#1 )
(byte) main::i#2 ← phi( main::@1/(byte) main::i#3 )
(byte) main::c#2 ← phi( main::@1/(byte) main::c#1 )
*((const nomodify byte*) SCREEN + (byte) main::i#2) ← (byte) main::c#2
(byte) main::i#1 ← ++ (byte) main::i#2
to:main::@1
main::@return: scope:[main] from main::@1
return
to:@return
(void()) __start()
__start: scope:[__start] from
call main
to:__start::@1
__start::@1: scope:[__start] from __start
to:__start::@return
__start::@return: scope:[__start] from __start::@1
return
to:@return
SYMBOL TABLE SSA
(const byte*) MESSAGE[] = (byte*) "hello world!"
(const nomodify byte*) SCREEN = (byte*)(number) $400
(void()) __start()
(label) __start::@1
(label) __start::@return
(void()) main()
(byte~) main::$0
(bool~) main::$1
(label) main::@1
(label) main::@2
(label) main::@return
(byte) main::c
(byte) main::c#0
(byte) main::c#1
(byte) main::c#2
(byte) main::i
(byte) main::i#0
(byte) main::i#1
(byte) main::i#2
(byte) main::i#3
(byte*) main::s
(byte*) main::s#0
(byte*) main::s#1
(byte*) main::s#2
(byte*) main::s#3
Adding number conversion cast (unumber) 0 in (bool~) main::$1 ← (number) 0 != (byte~) main::$0
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias main::c#1 = main::$0 main::c#2
Alias main::i#2 = main::i#3
Alias main::s#1 = main::s#3
Successful SSA optimization Pass2AliasElimination
Simple Condition (bool~) main::$1 [7] if((byte) 0!=(byte) main::c#1) goto main::@2
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) main::s#0 = MESSAGE
Constant (const byte) main::c#0 = 0
Constant (const byte) main::i#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Eliminating unused constant (const byte) main::c#0
Successful SSA optimization PassNEliminateUnusedVars
Removing unused procedure __start
Removing unused procedure block __start
Removing unused procedure block __start::@1
Removing unused procedure block __start::@return
Successful SSA optimization PassNEliminateEmptyStart
Inlining constant with var siblings (const byte*) main::s#0
Inlining constant with var siblings (const byte) main::i#0
Constant inlined main::i#0 = (byte) 0
Constant inlined main::s#0 = (const byte*) MESSAGE
Successful SSA optimization Pass2ConstantInlining
Adding NOP phi() at start of main
CALL GRAPH
Created 2 initial phi equivalence classes
Coalesced [8] main::s#4 ← main::s#1
Coalesced [9] main::i#4 ← main::i#1
Coalesced down to 2 phi equivalence classes
Adding NOP phi() at start of main
FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from
[0] phi()
to:main::@1
main::@1: scope:[main] from main main::@2
[1] (byte) main::i#2 ← phi( main/(byte) 0 main::@2/(byte) main::i#1 )
[1] (byte*) main::s#2 ← phi( main/(const byte*) MESSAGE main::@2/(byte*) main::s#1 )
[2] (byte) main::c#1 ← *((byte*) main::s#2)
[3] (byte*) main::s#1 ← ++ (byte*) main::s#2
[4] if((byte) 0!=(byte) main::c#1) goto main::@2
to:main::@return
main::@return: scope:[main] from main::@1
[5] return
to:@return
main::@2: scope:[main] from main::@1
[6] *((const nomodify byte*) SCREEN + (byte) main::i#2) ← (byte) main::c#1
[7] (byte) main::i#1 ← ++ (byte) main::i#2
to:main::@1
VARIABLE REGISTER WEIGHTS
(void()) main()
(byte) main::c
(byte) main::c#1 11.0
(byte) main::i
(byte) main::i#1 22.0
(byte) main::i#2 6.6000000000000005
(byte*) main::s
(byte*) main::s#1 5.5
(byte*) main::s#2 16.5
Initial phi equivalence classes
[ main::s#2 main::s#1 ]
[ main::i#2 main::i#1 ]
Added variable main::c#1 to live range equivalence class [ main::c#1 ]
Complete equivalence classes
[ main::s#2 main::s#1 ]
[ main::i#2 main::i#1 ]
[ main::c#1 ]
Allocated zp[2]:2 [ main::s#2 main::s#1 ]
Allocated zp[1]:4 [ main::i#2 main::i#1 ]
Allocated zp[1]:5 [ main::c#1 ]
INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Illustrates a problem with post-incrementing inside the while loop condition
// https://gitlab.com/camelot/kickc/-/issues/486
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
// main
main: {
.label c = 5
.label s = 2
.label i = 4
// [1] phi from main to main::@1 [phi:main->main::@1]
__b1_from_main:
// [1] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
lda #0
sta.z i
// [1] phi (byte*) main::s#2 = (const byte*) MESSAGE [phi:main->main::@1#1] -- pbuz1=pbuc1
lda #<MESSAGE
sta.z s
lda #>MESSAGE
sta.z s+1
jmp __b1
// main::@1
__b1:
// [2] (byte) main::c#1 ← *((byte*) main::s#2) -- vbuz1=_deref_pbuz2
ldy #0
lda (s),y
sta.z c
// [3] (byte*) main::s#1 ← ++ (byte*) main::s#2 -- pbuz1=_inc_pbuz1
inc.z s
bne !+
inc.z s+1
!:
// [4] if((byte) 0!=(byte) main::c#1) goto main::@2 -- vbuc1_neq_vbuz1_then_la1
lda #0
cmp.z c
bne __b2
jmp __breturn
// main::@return
__breturn:
// [5] return
rts
// main::@2
__b2:
// [6] *((const nomodify byte*) SCREEN + (byte) main::i#2) ← (byte) main::c#1 -- pbuc1_derefidx_vbuz1=vbuz2
lda.z c
ldy.z i
sta SCREEN,y
// [7] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuz1=_inc_vbuz1
inc.z i
// [1] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
__b1_from___b2:
// [1] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#0] -- register_copy
// [1] phi (byte*) main::s#2 = (byte*) main::s#1 [phi:main::@2->main::@1#1] -- register_copy
jmp __b1
}
// File Data
MESSAGE: .text "hello world!"
.byte 0
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [2] (byte) main::c#1 ← *((byte*) main::s#2) [ main::s#2 main::i#2 main::c#1 ] ( [ main::s#2 main::i#2 main::c#1 ] { } ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte a as potential for zp[1]:4 [ main::i#2 main::i#1 ]
Removing always clobbered register reg byte y as potential for zp[1]:4 [ main::i#2 main::i#1 ]
Statement [2] (byte) main::c#1 ← *((byte*) main::s#2) [ main::s#2 main::i#2 main::c#1 ] ( [ main::s#2 main::i#2 main::c#1 ] { } ) always clobbers reg byte a reg byte y
Potential registers zp[2]:2 [ main::s#2 main::s#1 ] : zp[2]:2 ,
Potential registers zp[1]:4 [ main::i#2 main::i#1 ] : zp[1]:4 , reg byte x ,
Potential registers zp[1]:5 [ main::c#1 ] : zp[1]:5 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 28.6: zp[1]:4 [ main::i#2 main::i#1 ] 22: zp[2]:2 [ main::s#2 main::s#1 ] 11: zp[1]:5 [ main::c#1 ]
Uplift Scope []
Uplifting [main] best 531 combination reg byte x [ main::i#2 main::i#1 ] zp[2]:2 [ main::s#2 main::s#1 ] reg byte a [ main::c#1 ]
Uplifting [] best 531 combination
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Illustrates a problem with post-incrementing inside the while loop condition
// https://gitlab.com/camelot/kickc/-/issues/486
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
// main
main: {
.label s = 2
// [1] phi from main to main::@1 [phi:main->main::@1]
__b1_from_main:
// [1] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
ldx #0
// [1] phi (byte*) main::s#2 = (const byte*) MESSAGE [phi:main->main::@1#1] -- pbuz1=pbuc1
lda #<MESSAGE
sta.z s
lda #>MESSAGE
sta.z s+1
jmp __b1
// main::@1
__b1:
// [2] (byte) main::c#1 ← *((byte*) main::s#2) -- vbuaa=_deref_pbuz1
ldy #0
lda (s),y
// [3] (byte*) main::s#1 ← ++ (byte*) main::s#2 -- pbuz1=_inc_pbuz1
inc.z s
bne !+
inc.z s+1
!:
// [4] if((byte) 0!=(byte) main::c#1) goto main::@2 -- vbuc1_neq_vbuaa_then_la1
cmp #0
bne __b2
jmp __breturn
// main::@return
__breturn:
// [5] return
rts
// main::@2
__b2:
// [6] *((const nomodify byte*) SCREEN + (byte) main::i#2) ← (byte) main::c#1 -- pbuc1_derefidx_vbuxx=vbuaa
sta SCREEN,x
// [7] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
inx
// [1] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
__b1_from___b2:
// [1] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#0] -- register_copy
// [1] phi (byte*) main::s#2 = (byte*) main::s#1 [phi:main::@2->main::@1#1] -- register_copy
jmp __b1
}
// File Data
MESSAGE: .text "hello world!"
.byte 0
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __b1_from_main:
Removing instruction __breturn:
Removing instruction __b1_from___b2:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(const byte*) MESSAGE[] = (byte*) "hello world!"
(const nomodify byte*) SCREEN = (byte*) 1024
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@return
(byte) main::c
(byte) main::c#1 reg byte a 11.0
(byte) main::i
(byte) main::i#1 reg byte x 22.0
(byte) main::i#2 reg byte x 6.6000000000000005
(byte*) main::s
(byte*) main::s#1 s zp[2]:2 5.5
(byte*) main::s#2 s zp[2]:2 16.5
zp[2]:2 [ main::s#2 main::s#1 ]
reg byte x [ main::i#2 main::i#1 ]
reg byte a [ main::c#1 ]
FINAL ASSEMBLER
Score: 471
// File Comments
// Illustrates a problem with post-incrementing inside the while loop condition
// https://gitlab.com/camelot/kickc/-/issues/486
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
// main
main: {
.label s = 2
// [1] phi from main to main::@1 [phi:main->main::@1]
// [1] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1
ldx #0
// [1] phi (byte*) main::s#2 = (const byte*) MESSAGE [phi:main->main::@1#1] -- pbuz1=pbuc1
lda #<MESSAGE
sta.z s
lda #>MESSAGE
sta.z s+1
// main::@1
__b1:
// while(c=*s++)
// [2] (byte) main::c#1 ← *((byte*) main::s#2) -- vbuaa=_deref_pbuz1
ldy #0
lda (s),y
// [3] (byte*) main::s#1 ← ++ (byte*) main::s#2 -- pbuz1=_inc_pbuz1
inc.z s
bne !+
inc.z s+1
!:
// [4] if((byte) 0!=(byte) main::c#1) goto main::@2 -- vbuc1_neq_vbuaa_then_la1
cmp #0
bne __b2
// main::@return
// }
// [5] return
rts
// main::@2
__b2:
// SCREEN[i++] = c
// [6] *((const nomodify byte*) SCREEN + (byte) main::i#2) ← (byte) main::c#1 -- pbuc1_derefidx_vbuxx=vbuaa
sta SCREEN,x
// SCREEN[i++] = c;
// [7] (byte) main::i#1 ← ++ (byte) main::i#2 -- vbuxx=_inc_vbuxx
inx
// [1] phi from main::@2 to main::@1 [phi:main::@2->main::@1]
// [1] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@2->main::@1#0] -- register_copy
// [1] phi (byte*) main::s#2 = (byte*) main::s#1 [phi:main::@2->main::@1#1] -- register_copy
jmp __b1
}
// File Data
MESSAGE: .text "hello world!"
.byte 0

View File

@ -0,0 +1,18 @@
(const byte*) MESSAGE[] = (byte*) "hello world!"
(const nomodify byte*) SCREEN = (byte*) 1024
(void()) main()
(label) main::@1
(label) main::@2
(label) main::@return
(byte) main::c
(byte) main::c#1 reg byte a 11.0
(byte) main::i
(byte) main::i#1 reg byte x 22.0
(byte) main::i#2 reg byte x 6.6000000000000005
(byte*) main::s
(byte*) main::s#1 s zp[2]:2 5.5
(byte*) main::s#2 s zp[2]:2 16.5
zp[2]:2 [ main::s#2 main::s#1 ]
reg byte x [ main::i#2 main::i#1 ]
reg byte a [ main::c#1 ]

View File

@ -303,10 +303,9 @@ printf_padding: {
cputs: {
.label s = 3
__b1:
// c=*s++
// while(c=*s++)
ldy #0
lda (s),y
// while(c=*s++)
inc.z s
bne !+
inc.z s+1

View File

@ -321,9 +321,10 @@ cputs: scope:[cputs] from printf_string::@2
cputs::@1: scope:[cputs] from cputs cputs::@3
(to_nomodify byte*) cputs::s#2 ← phi( cputs/(to_nomodify byte*) cputs::s#3 cputs::@3/(to_nomodify byte*) cputs::s#4 )
(byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#2)
(byte~) cputs::$0 ← (byte) cputs::c#1
(to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#2
(bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
if((bool~) cputs::$1) goto cputs::@2
(bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
if((bool~) cputs::$2) goto cputs::@2
to:cputs::@return
cputs::@2: scope:[cputs] from cputs::@1
(to_nomodify byte*) cputs::s#5 ← phi( cputs::@1/(to_nomodify byte*) cputs::s#0 )
@ -681,7 +682,8 @@ SYMBOL TABLE SSA
(label) cputln::@1
(label) cputln::@return
(void()) cputs((to_nomodify byte*) cputs::s)
(bool~) cputs::$1
(byte~) cputs::$0
(bool~) cputs::$2
(label) cputs::@1
(label) cputs::@2
(label) cputs::@3
@ -1011,7 +1013,7 @@ Adding number conversion cast (unumber) $28 in (byte*) conio_line_text ← (byte
Adding number conversion cast (unumber) $28 in (byte*) conio_line_color ← (byte*) conio_line_color - (number) $28
Adding number conversion cast (unumber) 0 in (byte) gotoxy::x#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) gotoxy::y#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
Adding number conversion cast (unumber) 0 in (bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
Adding number conversion cast (unumber) 0 in (bool~) printf_string::$14 ← (number) 0 != (byte) printf_string::format_min_length#4
Adding number conversion cast (unumber) 0 in (bool~) printf_string::$15 ← (number) 0 != (byte) printf_string::format_justify_left#4
Adding number conversion cast (snumber) 0 in (bool~) printf_string::$11 ← (signed byte) printf_string::padding#1 < (number) 0
@ -1143,9 +1145,9 @@ Inversing boolean not [77] (bool~) gotoxy::$1 ← (byte) gotoxy::y#2 <= (byte) $
Inversing boolean not [81] (bool~) gotoxy::$3 ← (byte) gotoxy::x#2 < (byte) $28 from [80] (bool~) gotoxy::$2 ← (byte) gotoxy::x#2 >= (byte) $28
Inversing boolean not [107] (bool~) cputc::$2 ← (byte) conio_cursor_x != (byte) $28 from [106] (bool~) cputc::$1 ← (byte) conio_cursor_x == (byte) $28
Inversing boolean not [118] (bool~) cscroll::$1 ← (byte) conio_cursor_y != (byte) $19 from [117] (bool~) cscroll::$0 ← (byte) conio_cursor_y == (byte) $19
Inversing boolean not [175] (bool~) printf_string::$0 ← (byte) 0 == (byte) printf_string::format_min_length#4 from [174] (bool~) printf_string::$14 ← (byte) 0 != (byte) printf_string::format_min_length#4
Inversing boolean not [179] (bool~) printf_string::$1 ← (byte) 0 == (byte) printf_string::format_justify_left#4 from [178] (bool~) printf_string::$15 ← (byte) 0 != (byte) printf_string::format_justify_left#4
Inversing boolean not [194] (bool~) printf_string::$12 ← (signed byte) printf_string::padding#1 >= (signed byte) 0 from [193] (bool~) printf_string::$11 ← (signed byte) printf_string::padding#1 < (signed byte) 0
Inversing boolean not [176] (bool~) printf_string::$0 ← (byte) 0 == (byte) printf_string::format_min_length#4 from [175] (bool~) printf_string::$14 ← (byte) 0 != (byte) printf_string::format_min_length#4
Inversing boolean not [180] (bool~) printf_string::$1 ← (byte) 0 == (byte) printf_string::format_justify_left#4 from [179] (bool~) printf_string::$15 ← (byte) 0 != (byte) printf_string::format_justify_left#4
Inversing boolean not [195] (bool~) printf_string::$12 ← (signed byte) printf_string::padding#1 >= (signed byte) 0 from [194] (bool~) printf_string::$11 ← (signed byte) printf_string::padding#1 < (signed byte) 0
Successful SSA optimization Pass2UnaryNotSimplification
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
@ -1176,7 +1178,7 @@ Alias gotoxy::x#4 = gotoxy::x#5
Alias gotoxy::line_offset#0 = gotoxy::$4
Alias gotoxy::y#4 = gotoxy::y#5
Alias cputc::c#2 = cputc::c#3
Alias cputs::c#1 = cputs::c#2
Alias cputs::c#1 = cputs::$0 cputs::c#2
Alias cputs::s#0 = cputs::s#5 cputs::s#4
Alias printf_padding::pad#2 = printf_padding::pad#3 printf_padding::pad#5
Alias printf_padding::i#2 = printf_padding::i#4 printf_padding::i#3
@ -1232,7 +1234,7 @@ Simple Condition (bool~) cputc::$0 [74] if((byte) cputc::c#2==(byte) '
Simple Condition (bool~) cputc::$2 [80] if((byte) conio_cursor_x!=(byte) $28) goto cputc::@return
Simple Condition (bool~) cscroll::$1 [90] if((byte) conio_cursor_y!=(byte) $19) goto cscroll::@return
Simple Condition (bool~) cscroll::$7 [92] if((byte) 0!=(byte) conio_scroll_enable) goto cscroll::@3
Simple Condition (bool~) cputs::$1 [126] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) cputs::$2 [126] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) printf_padding::$0 [134] if((byte) printf_padding::i#2<(byte) printf_padding::length#3) goto printf_padding::@2
Simple Condition (bool~) printf_string::$0 [142] if((byte) 0==(byte) printf_string::format_min_length#4) goto printf_string::@1
Simple Condition (bool~) printf_string::$12 [156] if((signed byte) printf_string::padding#1>=(signed byte) 0) goto printf_string::@1
@ -4923,11 +4925,10 @@ cputs: {
// [82] phi (to_nomodify byte*) cputs::s#2 = (to_nomodify byte*) cputs::s#1 [phi:cputs/cputs::@2->cputs::@1#0] -- register_copy
// cputs::@1
__b1:
// c=*s++
// while(c=*s++)
// [83] (byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#2) -- vbuaa=_deref_pbuz1
ldy #0
lda (s),y
// while(c=*s++)
// [84] (to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#2 -- pbuz1=_inc_pbuz1
inc.z s
bne !+

View File

@ -291,10 +291,9 @@ clrscr: {
cputs: {
.label s = 8
__b1:
// c=*s++
// while(c=*s++)
ldy #0
lda (s),y
// while(c=*s++)
inc.z s
bne !+
inc.z s+1

View File

@ -928,9 +928,10 @@ cputs: scope:[cputs] from main::@1 main::@10 main::@12 main::@13 main::@15 main
cputs::@1: scope:[cputs] from cputs cputs::@3
(to_nomodify byte*) cputs::s#20 ← phi( cputs/(to_nomodify byte*) cputs::s#21 cputs::@3/(to_nomodify byte*) cputs::s#22 )
(byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#20)
(byte~) cputs::$0 ← (byte) cputs::c#1
(to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#20
(bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
if((bool~) cputs::$1) goto cputs::@2
(bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
if((bool~) cputs::$2) goto cputs::@2
to:cputs::@return
cputs::@2: scope:[cputs] from cputs::@1
(to_nomodify byte*) cputs::s#23 ← phi( cputs::@1/(to_nomodify byte*) cputs::s#0 )
@ -2023,7 +2024,8 @@ SYMBOL TABLE SSA
(label) cputln::@1
(label) cputln::@return
(void()) cputs((to_nomodify byte*) cputs::s)
(bool~) cputs::$1
(byte~) cputs::$0
(bool~) cputs::$2
(label) cputs::@1
(label) cputs::@2
(label) cputs::@3
@ -3512,7 +3514,7 @@ Adding number conversion cast (unumber) $28 in (byte*) conio_line_text ← (byte
Adding number conversion cast (unumber) $28 in (byte*) conio_line_color ← (byte*) conio_line_color - (number) $28
Adding number conversion cast (unumber) 0 in (byte) gotoxy::x#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) gotoxy::y#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
Adding number conversion cast (unumber) 0 in (bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
Adding number conversion cast (unumber) 0 in *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) ← (number) 0
Adding number conversion cast (snumber) 0 in (bool~) printf_slong::$0 ← (signed dword) printf_slong::value#2 < (number) 0
Adding number conversion cast (unumber) 0 in (bool~) printf_slong::$5 ← (number) 0 != (byte) printf_slong::format_sign_always#1
@ -3808,17 +3810,17 @@ Inversing boolean not [350] (bool~) gotoxy::$1 ← (byte) gotoxy::y#2 <= (byte)
Inversing boolean not [354] (bool~) gotoxy::$3 ← (byte) gotoxy::x#2 < (byte) $28 from [353] (bool~) gotoxy::$2 ← (byte) gotoxy::x#2 >= (byte) $28
Inversing boolean not [380] (bool~) cputc::$2 ← (byte) conio_cursor_x != (byte) $28 from [379] (bool~) cputc::$1 ← (byte) conio_cursor_x == (byte) $28
Inversing boolean not [391] (bool~) cscroll::$1 ← (byte) conio_cursor_y != (byte) $19 from [390] (bool~) cscroll::$0 ← (byte) conio_cursor_y == (byte) $19
Inversing boolean not [455] (bool~) printf_slong::$3 ← (byte) 0 == (byte) printf_slong::format_sign_always#1 from [454] (bool~) printf_slong::$5 ← (byte) 0 != (byte) printf_slong::format_sign_always#1
Inversing boolean not [510] (bool~) printf_sint::$3 ← (byte) 0 == (byte) printf_sint::format_sign_always#1 from [509] (bool~) printf_sint::$5 ← (byte) 0 != (byte) printf_sint::format_sign_always#1
Inversing boolean not [565] (bool~) printf_schar::$3 ← (byte) 0 == (byte) printf_schar::format_sign_always#1 from [564] (bool~) printf_schar::$5 ← (byte) 0 != (byte) printf_schar::format_sign_always#1
Inversing boolean not [613] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#6 from [612] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#6
Inversing boolean not [617] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#6 from [616] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#6
Inversing boolean not [619] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#6 from [618] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#6
Inversing boolean not [632] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#6 from [631] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#6
Inversing boolean not [639] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [638] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [647] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#7 from [646] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#7
Inversing boolean not [664] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#6 from [663] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#6
Inversing boolean not [676] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#8 from [675] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#8
Inversing boolean not [456] (bool~) printf_slong::$3 ← (byte) 0 == (byte) printf_slong::format_sign_always#1 from [455] (bool~) printf_slong::$5 ← (byte) 0 != (byte) printf_slong::format_sign_always#1
Inversing boolean not [511] (bool~) printf_sint::$3 ← (byte) 0 == (byte) printf_sint::format_sign_always#1 from [510] (bool~) printf_sint::$5 ← (byte) 0 != (byte) printf_sint::format_sign_always#1
Inversing boolean not [566] (bool~) printf_schar::$3 ← (byte) 0 == (byte) printf_schar::format_sign_always#1 from [565] (bool~) printf_schar::$5 ← (byte) 0 != (byte) printf_schar::format_sign_always#1
Inversing boolean not [614] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#6 from [613] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#6
Inversing boolean not [618] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#6 from [617] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#6
Inversing boolean not [620] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#6 from [619] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#6
Inversing boolean not [633] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#6 from [632] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#6
Inversing boolean not [640] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [639] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [648] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#7 from [647] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#7
Inversing boolean not [665] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#6 from [664] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#6
Inversing boolean not [677] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#8 from [676] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#8
Successful SSA optimization Pass2UnaryNotSimplification
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
@ -3904,7 +3906,7 @@ Alias gotoxy::x#4 = gotoxy::x#5
Alias gotoxy::line_offset#0 = gotoxy::$4
Alias gotoxy::y#4 = gotoxy::y#5
Alias cputc::c#5 = cputc::c#6
Alias cputs::c#1 = cputs::c#2
Alias cputs::c#1 = cputs::$0 cputs::c#2
Alias cputs::s#0 = cputs::s#23 cputs::s#22
Alias printf_padding::pad#3 = printf_padding::pad#4 printf_padding::pad#6
Alias printf_padding::i#2 = printf_padding::i#4 printf_padding::i#3
@ -4217,7 +4219,7 @@ Simple Condition (bool~) cputc::$0 [280] if((byte) cputc::c#5==(byte) '
Simple Condition (bool~) cputc::$2 [286] if((byte) conio_cursor_x!=(byte) $28) goto cputc::@return
Simple Condition (bool~) cscroll::$1 [296] if((byte) conio_cursor_y!=(byte) $19) goto cscroll::@return
Simple Condition (bool~) cscroll::$7 [298] if((byte) 0!=(byte) conio_scroll_enable) goto cscroll::@3
Simple Condition (bool~) cputs::$1 [332] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) cputs::$2 [332] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) printf_padding::$0 [340] if((byte) printf_padding::i#2<(byte) printf_padding::length#4) goto printf_padding::@2
Simple Condition (bool~) printf_slong::$0 [348] if((signed dword) printf_slong::value#1<(signed byte) 0) goto printf_slong::@1
Simple Condition (bool~) printf_slong::$3 [352] if((byte) 0==(byte) printf_slong::format_sign_always#0) goto printf_slong::@2
@ -13730,11 +13732,10 @@ cputs: {
// [82] phi (to_nomodify byte*) cputs::s#20 = (to_nomodify byte*) cputs::s#21 [phi:cputs/cputs::@2->cputs::@1#0] -- register_copy
// cputs::@1
__b1:
// c=*s++
// while(c=*s++)
// [83] (byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#20) -- vbuaa=_deref_pbuz1
ldy #0
lda (s),y
// while(c=*s++)
// [84] (to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#20 -- pbuz1=_inc_pbuz1
inc.z s
bne !+

View File

@ -816,10 +816,9 @@ cputc: {
cputs: {
.label s = 2
__b1:
// c=*s++
// while(c=*s++)
ldy #0
lda (s),y
// while(c=*s++)
inc.z s
bne !+
inc.z s+1

View File

@ -599,9 +599,10 @@ cputs: scope:[cputs] from main::@10 main::@12 main::@14 main::@16 main::@18 mai
cputs::@1: scope:[cputs] from cputs cputs::@3
(to_nomodify byte*) cputs::s#48 ← phi( cputs/(to_nomodify byte*) cputs::s#49 cputs::@3/(to_nomodify byte*) cputs::s#50 )
(byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#48)
(byte~) cputs::$0 ← (byte) cputs::c#1
(to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#48
(bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
if((bool~) cputs::$1) goto cputs::@2
(bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
if((bool~) cputs::$2) goto cputs::@2
to:cputs::@return
cputs::@2: scope:[cputs] from cputs::@1
(to_nomodify byte*) cputs::s#51 ← phi( cputs::@1/(to_nomodify byte*) cputs::s#0 )
@ -1863,7 +1864,8 @@ SYMBOL TABLE SSA
(label) cputln::@1
(label) cputln::@return
(void()) cputs((to_nomodify byte*) cputs::s)
(bool~) cputs::$1
(byte~) cputs::$0
(bool~) cputs::$2
(label) cputs::@1
(label) cputs::@2
(label) cputs::@3
@ -3117,7 +3119,7 @@ Adding number conversion cast (unumber) $28 in (byte*) conio_line_text ← (byte
Adding number conversion cast (unumber) $28 in (byte*) conio_line_color ← (byte*) conio_line_color - (number) $28
Adding number conversion cast (unumber) 0 in (byte) gotoxy::x#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) gotoxy::y#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
Adding number conversion cast (unumber) 0 in (bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
Adding number conversion cast (unumber) 0 in *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) ← (number) 0
Adding number conversion cast (snumber) 0 in (bool~) printf_sint::$0 ← (signed word) printf_sint::value#17 < (number) 0
Adding number conversion cast (unumber) 0 in (bool~) printf_sint::$5 ← (number) 0 != (byte) printf_sint::format_sign_always#16
@ -3419,18 +3421,18 @@ Inversing boolean not [189] (bool~) gotoxy::$1 ← (byte) gotoxy::y#2 <= (byte)
Inversing boolean not [193] (bool~) gotoxy::$3 ← (byte) gotoxy::x#2 < (byte) $28 from [192] (bool~) gotoxy::$2 ← (byte) gotoxy::x#2 >= (byte) $28
Inversing boolean not [219] (bool~) cputc::$2 ← (byte) conio_cursor_x != (byte) $28 from [218] (bool~) cputc::$1 ← (byte) conio_cursor_x == (byte) $28
Inversing boolean not [230] (bool~) cscroll::$1 ← (byte) conio_cursor_y != (byte) $19 from [229] (bool~) cscroll::$0 ← (byte) conio_cursor_y == (byte) $19
Inversing boolean not [294] (bool~) printf_sint::$3 ← (byte) 0 == (byte) printf_sint::format_sign_always#16 from [293] (bool~) printf_sint::$5 ← (byte) 0 != (byte) printf_sint::format_sign_always#16
Inversing boolean not [342] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#2 from [341] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#2
Inversing boolean not [346] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#2 from [345] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#2
Inversing boolean not [348] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#2 from [347] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#2
Inversing boolean not [361] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [360] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2
Inversing boolean not [368] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [367] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [376] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#3 from [375] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#3
Inversing boolean not [393] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#2 from [392] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#2
Inversing boolean not [405] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#4 from [404] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#4
Inversing boolean not [423] (bool~) printf_string::$0 ← (byte) 0 == (byte) printf_string::format_min_length#8 from [422] (bool~) printf_string::$14 ← (byte) 0 != (byte) printf_string::format_min_length#8
Inversing boolean not [427] (bool~) printf_string::$1 ← (byte) 0 == (byte) printf_string::format_justify_left#8 from [426] (bool~) printf_string::$15 ← (byte) 0 != (byte) printf_string::format_justify_left#8
Inversing boolean not [442] (bool~) printf_string::$12 ← (signed byte) printf_string::padding#1 >= (signed byte) 0 from [441] (bool~) printf_string::$11 ← (signed byte) printf_string::padding#1 < (signed byte) 0
Inversing boolean not [295] (bool~) printf_sint::$3 ← (byte) 0 == (byte) printf_sint::format_sign_always#16 from [294] (bool~) printf_sint::$5 ← (byte) 0 != (byte) printf_sint::format_sign_always#16
Inversing boolean not [343] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#2 from [342] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#2
Inversing boolean not [347] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#2 from [346] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#2
Inversing boolean not [349] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#2 from [348] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#2
Inversing boolean not [362] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [361] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2
Inversing boolean not [369] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [368] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [377] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#3 from [376] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#3
Inversing boolean not [394] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#2 from [393] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#2
Inversing boolean not [406] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#4 from [405] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#4
Inversing boolean not [424] (bool~) printf_string::$0 ← (byte) 0 == (byte) printf_string::format_min_length#8 from [423] (bool~) printf_string::$14 ← (byte) 0 != (byte) printf_string::format_min_length#8
Inversing boolean not [428] (bool~) printf_string::$1 ← (byte) 0 == (byte) printf_string::format_justify_left#8 from [427] (bool~) printf_string::$15 ← (byte) 0 != (byte) printf_string::format_justify_left#8
Inversing boolean not [443] (bool~) printf_string::$12 ← (signed byte) printf_string::padding#1 >= (signed byte) 0 from [442] (bool~) printf_string::$11 ← (signed byte) printf_string::padding#1 < (signed byte) 0
Successful SSA optimization Pass2UnaryNotSimplification
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
@ -3484,7 +3486,7 @@ Alias gotoxy::x#4 = gotoxy::x#5
Alias gotoxy::line_offset#0 = gotoxy::$4
Alias gotoxy::y#4 = gotoxy::y#5
Alias cputc::c#12 = cputc::c#13
Alias cputs::c#1 = cputs::c#2
Alias cputs::c#1 = cputs::$0 cputs::c#2
Alias cputs::s#0 = cputs::s#51 cputs::s#50
Alias printf_padding::pad#5 = printf_padding::pad#6 printf_padding::pad#8
Alias printf_padding::i#2 = printf_padding::i#4 printf_padding::i#3
@ -3658,7 +3660,7 @@ Simple Condition (bool~) cputc::$0 [156] if((byte) cputc::c#12==(byte) '
Simple Condition (bool~) cputc::$2 [162] if((byte) conio_cursor_x!=(byte) $28) goto cputc::@return
Simple Condition (bool~) cscroll::$1 [172] if((byte) conio_cursor_y!=(byte) $19) goto cscroll::@return
Simple Condition (bool~) cscroll::$7 [174] if((byte) 0!=(byte) conio_scroll_enable) goto cscroll::@3
Simple Condition (bool~) cputs::$1 [208] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) cputs::$2 [208] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) printf_padding::$0 [216] if((byte) printf_padding::i#2<(byte) printf_padding::length#6) goto printf_padding::@2
Simple Condition (bool~) printf_sint::$0 [224] if((signed word) printf_sint::value#17<(signed byte) 0) goto printf_sint::@1
Simple Condition (bool~) printf_sint::$3 [228] if((byte) 0==(byte) printf_sint::format_sign_always#16) goto printf_sint::@2
@ -15849,11 +15851,10 @@ cputs: {
// [219] phi (to_nomodify byte*) cputs::s#48 = (to_nomodify byte*) cputs::s#49 [phi:cputs/cputs::@2->cputs::@1#0] -- register_copy
// cputs::@1
__b1:
// c=*s++
// while(c=*s++)
// [220] (byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#48) -- vbuaa=_deref_pbuz1
ldy #0
lda (s),y
// while(c=*s++)
// [221] (to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#48 -- pbuz1=_inc_pbuz1
inc.z s
bne !+

View File

@ -288,10 +288,9 @@ cputs: {
lda #>printf_number_buffer.buffer_digits
sta.z s+1
__b1:
// c=*s++
// while(c=*s++)
ldy #0
lda (s),y
// while(c=*s++)
inc.z s
bne !+
inc.z s+1

View File

@ -555,9 +555,10 @@ cputs: scope:[cputs] from printf_number_buffer::@5
cputs::@1: scope:[cputs] from cputs cputs::@3
(to_nomodify byte*) cputs::s#2 ← phi( cputs/(to_nomodify byte*) cputs::s#3 cputs::@3/(to_nomodify byte*) cputs::s#4 )
(byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#2)
(byte~) cputs::$0 ← (byte) cputs::c#1
(to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#2
(bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
if((bool~) cputs::$1) goto cputs::@2
(bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
if((bool~) cputs::$2) goto cputs::@2
to:cputs::@return
cputs::@2: scope:[cputs] from cputs::@1
(to_nomodify byte*) cputs::s#5 ← phi( cputs::@1/(to_nomodify byte*) cputs::s#0 )
@ -1105,7 +1106,8 @@ SYMBOL TABLE SSA
(label) cputln::@1
(label) cputln::@return
(void()) cputs((to_nomodify byte*) cputs::s)
(bool~) cputs::$1
(byte~) cputs::$0
(bool~) cputs::$2
(label) cputs::@1
(label) cputs::@2
(label) cputs::@3
@ -1806,7 +1808,7 @@ Adding number conversion cast (unumber) $28 in (byte*) conio_line_text ← (byte
Adding number conversion cast (unumber) $28 in (byte*) conio_line_color ← (byte*) conio_line_color - (number) $28
Adding number conversion cast (unumber) 0 in (byte) gotoxy::x#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) gotoxy::y#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
Adding number conversion cast (unumber) 0 in (bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
Adding number conversion cast (unumber) 0 in (bool~) printf_uchar::$5 ← (number) 0 != (byte) printf_uchar::format_sign_always#1
Adding number conversion cast (unumber) printf_uchar::$2 in (byte) printf_uchar::format_upper_case#2 ← phi( printf_uchar::@1/(byte) printf_uchar::format_upper_case#3 printf_uchar::@2/(byte) printf_uchar::format_upper_case#4 )
(byte) printf_uchar::format_zero_padding#2 ← phi( printf_uchar::@1/(byte) printf_uchar::format_zero_padding#3 printf_uchar::@2/(byte) printf_uchar::format_zero_padding#4 )
@ -1974,14 +1976,14 @@ Inversing boolean not [188] (bool~) gotoxy::$1 ← (byte) gotoxy::y#2 <= (byte)
Inversing boolean not [192] (bool~) gotoxy::$3 ← (byte) gotoxy::x#2 < (byte) $28 from [191] (bool~) gotoxy::$2 ← (byte) gotoxy::x#2 >= (byte) $28
Inversing boolean not [218] (bool~) cputc::$2 ← (byte) conio_cursor_x != (byte) $28 from [217] (bool~) cputc::$1 ← (byte) conio_cursor_x == (byte) $28
Inversing boolean not [229] (bool~) cscroll::$1 ← (byte) conio_cursor_y != (byte) $19 from [228] (bool~) cscroll::$0 ← (byte) conio_cursor_y == (byte) $19
Inversing boolean not [310] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#1 from [309] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#1
Inversing boolean not [314] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#1 from [313] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#1
Inversing boolean not [316] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#1 from [315] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#1
Inversing boolean not [329] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#1 from [328] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#1
Inversing boolean not [336] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [335] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [344] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [343] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2
Inversing boolean not [361] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#1 from [360] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#1
Inversing boolean not [373] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#3 from [372] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#3
Inversing boolean not [311] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#1 from [310] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#1
Inversing boolean not [315] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#1 from [314] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#1
Inversing boolean not [317] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#1 from [316] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#1
Inversing boolean not [330] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#1 from [329] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#1
Inversing boolean not [337] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [336] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [345] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [344] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2
Inversing boolean not [362] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#1 from [361] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#1
Inversing boolean not [374] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#3 from [373] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#3
Successful SSA optimization Pass2UnaryNotSimplification
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
@ -2035,7 +2037,7 @@ Alias gotoxy::x#4 = gotoxy::x#5
Alias gotoxy::line_offset#0 = gotoxy::$4
Alias gotoxy::y#4 = gotoxy::y#5
Alias cputc::c#3 = cputc::c#4
Alias cputs::c#1 = cputs::c#2
Alias cputs::c#1 = cputs::$0 cputs::c#2
Alias cputs::s#0 = cputs::s#5 cputs::s#4
Alias printf_padding::pad#3 = printf_padding::pad#4 printf_padding::pad#6
Alias printf_padding::i#2 = printf_padding::i#4 printf_padding::i#3
@ -2194,7 +2196,7 @@ Simple Condition (bool~) cputc::$0 [154] if((byte) cputc::c#3==(byte) '
Simple Condition (bool~) cputc::$2 [160] if((byte) conio_cursor_x!=(byte) $28) goto cputc::@return
Simple Condition (bool~) cscroll::$1 [170] if((byte) conio_cursor_y!=(byte) $19) goto cscroll::@return
Simple Condition (bool~) cscroll::$7 [172] if((byte) 0!=(byte) conio_scroll_enable) goto cscroll::@3
Simple Condition (bool~) cputs::$1 [206] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) cputs::$2 [206] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) printf_padding::$0 [214] if((byte) printf_padding::i#2<(byte) printf_padding::length#4) goto printf_padding::@2
Simple Condition (bool~) printf_uchar::$5 [221] if((byte) 0!=(byte) printf_uchar::format_sign_always#0) goto printf_uchar::@1
Simple Condition (bool~) printf_number_buffer::$0 [243] if((byte) 0==(byte) printf_number_buffer::format_min_length#0) goto printf_number_buffer::@1
@ -6032,11 +6034,10 @@ cputs: {
sta.z s+1
// cputs::@1
__b1:
// c=*s++
// while(c=*s++)
// [81] (byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#2) -- vbuaa=_deref_pbuz1
ldy #0
lda (s),y
// while(c=*s++)
// [82] (to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#2 -- pbuz1=_inc_pbuz1
inc.z s
bne !+

View File

@ -133,10 +133,9 @@ clrscr: {
cputs: {
.label s = 2
__b1:
// c=*s++
// while(c=*s++)
ldy #0
lda (s),y
// while(c=*s++)
inc.z s
bne !+
inc.z s+1

View File

@ -292,9 +292,10 @@ cputs: scope:[cputs] from main::@1 main::@2
cputs::@1: scope:[cputs] from cputs cputs::@3
(to_nomodify byte*) cputs::s#3 ← phi( cputs/(to_nomodify byte*) cputs::s#4 cputs::@3/(to_nomodify byte*) cputs::s#5 )
(byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#3)
(byte~) cputs::$0 ← (byte) cputs::c#1
(to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#3
(bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
if((bool~) cputs::$1) goto cputs::@2
(bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
if((bool~) cputs::$2) goto cputs::@2
to:cputs::@return
cputs::@2: scope:[cputs] from cputs::@1
(to_nomodify byte*) cputs::s#6 ← phi( cputs::@1/(to_nomodify byte*) cputs::s#0 )
@ -510,7 +511,8 @@ SYMBOL TABLE SSA
(label) cputln::@1
(label) cputln::@return
(void()) cputs((to_nomodify byte*) cputs::s)
(bool~) cputs::$1
(byte~) cputs::$0
(bool~) cputs::$2
(label) cputs::@1
(label) cputs::@2
(label) cputs::@3
@ -712,7 +714,7 @@ Adding number conversion cast (unumber) $28 in (byte*) conio_line_text ← (byte
Adding number conversion cast (unumber) $28 in (byte*) conio_line_color ← (byte*) conio_line_color - (number) $28
Adding number conversion cast (unumber) 0 in (byte) gotoxy::x#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) gotoxy::y#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
Adding number conversion cast (unumber) 0 in (bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) memcpy::src#0 ← (byte*)(void*) memcpy::source#2
Inlining cast (byte*) memcpy::dst#0 ← (byte*)(void*) memcpy::destination#2
@ -825,7 +827,7 @@ Alias gotoxy::x#4 = gotoxy::x#5
Alias gotoxy::line_offset#0 = gotoxy::$4
Alias gotoxy::y#4 = gotoxy::y#5
Alias cputc::c#1 = cputc::c#2
Alias cputs::c#1 = cputs::c#2
Alias cputs::c#1 = cputs::$0 cputs::c#2
Alias cputs::s#0 = cputs::s#6 cputs::s#5
Successful SSA optimization Pass2AliasElimination
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
@ -861,7 +863,7 @@ Simple Condition (bool~) cputc::$0 [66] if((byte) cputc::c#0==(byte) '
Simple Condition (bool~) cputc::$2 [72] if((byte) conio_cursor_x!=(byte) $28) goto cputc::@return
Simple Condition (bool~) cscroll::$1 [82] if((byte) conio_cursor_y!=(byte) $19) goto cscroll::@return
Simple Condition (bool~) cscroll::$7 [84] if((byte) 0!=(byte) conio_scroll_enable) goto cscroll::@3
Simple Condition (bool~) cputs::$1 [118] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) cputs::$2 [118] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [87] (word) memcpy::num#0 ← (unumber)(number) $19*(number) $28-(number) $28
Constant right-side identified [92] (word) memcpy::num#1 ← (unumber)(number) $19*(number) $28-(number) $28
@ -3219,11 +3221,10 @@ cputs: {
// [32] phi (to_nomodify byte*) cputs::s#3 = (to_nomodify byte*) cputs::s#4 [phi:cputs/cputs::@2->cputs::@1#0] -- register_copy
// cputs::@1
__b1:
// c=*s++
// while(c=*s++)
// [33] (byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#3) -- vbuaa=_deref_pbuz1
ldy #0
lda (s),y
// while(c=*s++)
// [34] (to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#3 -- pbuz1=_inc_pbuz1
inc.z s
bne !+

View File

@ -373,10 +373,9 @@ cputc: {
cputs: {
.label s = 2
__b1:
// c=*s++
// while(c=*s++)
ldy #0
lda (s),y
// while(c=*s++)
inc.z s
bne !+
inc.z s+1

View File

@ -569,9 +569,10 @@ cputs: scope:[cputs] from main::@10 main::@12 main::@14 main::@16 main::@18 mai
cputs::@1: scope:[cputs] from cputs cputs::@3
(to_nomodify byte*) cputs::s#22 ← phi( cputs/(to_nomodify byte*) cputs::s#23 cputs::@3/(to_nomodify byte*) cputs::s#24 )
(byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#22)
(byte~) cputs::$0 ← (byte) cputs::c#1
(to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#22
(bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
if((bool~) cputs::$1) goto cputs::@2
(bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
if((bool~) cputs::$2) goto cputs::@2
to:cputs::@return
cputs::@2: scope:[cputs] from cputs::@1
(to_nomodify byte*) cputs::s#25 ← phi( cputs::@1/(to_nomodify byte*) cputs::s#0 )
@ -1354,7 +1355,8 @@ SYMBOL TABLE SSA
(label) cputln::@1
(label) cputln::@return
(void()) cputs((to_nomodify byte*) cputs::s)
(bool~) cputs::$1
(byte~) cputs::$0
(bool~) cputs::$2
(label) cputs::@1
(label) cputs::@2
(label) cputs::@3
@ -2213,7 +2215,7 @@ Adding number conversion cast (unumber) $28 in (byte*) conio_line_text ← (byte
Adding number conversion cast (unumber) $28 in (byte*) conio_line_color ← (byte*) conio_line_color - (number) $28
Adding number conversion cast (unumber) 0 in (byte) gotoxy::x#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) gotoxy::y#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
Adding number conversion cast (unumber) 0 in (bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
Adding number conversion cast (unumber) 0 in *((byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_SIGN) ← (number) 0
Adding number conversion cast (snumber) 0 in (bool~) printf_sint::$0 ← (signed word) printf_sint::value#11 < (number) 0
Adding number conversion cast (unumber) 0 in (bool~) printf_sint::$5 ← (number) 0 != (byte) printf_sint::format_sign_always#10
@ -2404,15 +2406,15 @@ Inversing boolean not [189] (bool~) gotoxy::$1 ← (byte) gotoxy::y#2 <= (byte)
Inversing boolean not [193] (bool~) gotoxy::$3 ← (byte) gotoxy::x#2 < (byte) $28 from [192] (bool~) gotoxy::$2 ← (byte) gotoxy::x#2 >= (byte) $28
Inversing boolean not [219] (bool~) cputc::$2 ← (byte) conio_cursor_x != (byte) $28 from [218] (bool~) cputc::$1 ← (byte) conio_cursor_x == (byte) $28
Inversing boolean not [230] (bool~) cscroll::$1 ← (byte) conio_cursor_y != (byte) $19 from [229] (bool~) cscroll::$0 ← (byte) conio_cursor_y == (byte) $19
Inversing boolean not [294] (bool~) printf_sint::$3 ← (byte) 0 == (byte) printf_sint::format_sign_always#10 from [293] (bool~) printf_sint::$5 ← (byte) 0 != (byte) printf_sint::format_sign_always#10
Inversing boolean not [318] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#1 from [317] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#1
Inversing boolean not [322] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#1 from [321] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#1
Inversing boolean not [324] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#1 from [323] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#1
Inversing boolean not [337] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#1 from [336] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#1
Inversing boolean not [344] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [343] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [352] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [351] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2
Inversing boolean not [369] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#1 from [368] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#1
Inversing boolean not [381] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#3 from [380] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#3
Inversing boolean not [295] (bool~) printf_sint::$3 ← (byte) 0 == (byte) printf_sint::format_sign_always#10 from [294] (bool~) printf_sint::$5 ← (byte) 0 != (byte) printf_sint::format_sign_always#10
Inversing boolean not [319] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#1 from [318] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#1
Inversing boolean not [323] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#1 from [322] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#1
Inversing boolean not [325] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#1 from [324] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#1
Inversing boolean not [338] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#1 from [337] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#1
Inversing boolean not [345] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [344] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [353] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [352] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2
Inversing boolean not [370] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#1 from [369] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#1
Inversing boolean not [382] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#3 from [381] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#3
Successful SSA optimization Pass2UnaryNotSimplification
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
@ -2466,7 +2468,7 @@ Alias gotoxy::x#4 = gotoxy::x#5
Alias gotoxy::line_offset#0 = gotoxy::$4
Alias gotoxy::y#4 = gotoxy::y#5
Alias cputc::c#13 = cputc::c#14
Alias cputs::c#1 = cputs::c#2
Alias cputs::c#1 = cputs::$0 cputs::c#2
Alias cputs::s#0 = cputs::s#25 cputs::s#24
Alias printf_padding::pad#3 = printf_padding::pad#4 printf_padding::pad#6
Alias printf_padding::i#2 = printf_padding::i#4 printf_padding::i#3
@ -2617,7 +2619,7 @@ Simple Condition (bool~) cputc::$0 [156] if((byte) cputc::c#13==(byte) '
Simple Condition (bool~) cputc::$2 [162] if((byte) conio_cursor_x!=(byte) $28) goto cputc::@return
Simple Condition (bool~) cscroll::$1 [172] if((byte) conio_cursor_y!=(byte) $19) goto cscroll::@return
Simple Condition (bool~) cscroll::$7 [174] if((byte) 0!=(byte) conio_scroll_enable) goto cscroll::@3
Simple Condition (bool~) cputs::$1 [208] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) cputs::$2 [208] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) printf_padding::$0 [216] if((byte) printf_padding::i#2<(byte) printf_padding::length#4) goto printf_padding::@2
Simple Condition (bool~) printf_sint::$0 [224] if((signed word) printf_sint::value#11<(signed byte) 0) goto printf_sint::@1
Simple Condition (bool~) printf_sint::$3 [228] if((byte) 0==(byte) printf_sint::format_sign_always#10) goto printf_sint::@2
@ -8700,11 +8702,10 @@ cputs: {
// [119] phi (to_nomodify byte*) cputs::s#22 = (to_nomodify byte*) cputs::s#23 [phi:cputs/cputs::@2->cputs::@1#0] -- register_copy
// cputs::@1
__b1:
// c=*s++
// while(c=*s++)
// [120] (byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#22) -- vbuaa=_deref_pbuz1
ldy #0
lda (s),y
// while(c=*s++)
// [121] (to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#22 -- pbuz1=_inc_pbuz1
inc.z s
bne !+

View File

@ -785,10 +785,9 @@ cputs: {
lda #>printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z s+1
__b1:
// c=*s++
// while(c=*s++)
ldy #0
lda (s),y
// while(c=*s++)
inc.z s
bne !+
inc.z s+1

View File

@ -735,9 +735,10 @@ cputs: scope:[cputs] from printf_number_buffer::@5
cputs::@1: scope:[cputs] from cputs cputs::@3
(to_nomodify byte*) cputs::s#2 ← phi( cputs/(to_nomodify byte*) cputs::s#3 cputs::@3/(to_nomodify byte*) cputs::s#4 )
(byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#2)
(byte~) cputs::$0 ← (byte) cputs::c#1
(to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#2
(bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
if((bool~) cputs::$1) goto cputs::@2
(bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
if((bool~) cputs::$2) goto cputs::@2
to:cputs::@return
cputs::@2: scope:[cputs] from cputs::@1
(to_nomodify byte*) cputs::s#5 ← phi( cputs::@1/(to_nomodify byte*) cputs::s#0 )
@ -1403,7 +1404,8 @@ SYMBOL TABLE SSA
(label) cputln::@1
(label) cputln::@return
(void()) cputs((to_nomodify byte*) cputs::s)
(bool~) cputs::$1
(byte~) cputs::$0
(bool~) cputs::$2
(label) cputs::@1
(label) cputs::@2
(label) cputs::@3
@ -2355,7 +2357,7 @@ Adding number conversion cast (unumber) $28 in (byte*) conio_line_text ← (byte
Adding number conversion cast (unumber) $28 in (byte*) conio_line_color ← (byte*) conio_line_color - (number) $28
Adding number conversion cast (unumber) 0 in (byte) gotoxy::x#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) gotoxy::y#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
Adding number conversion cast (unumber) 0 in (bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
Adding number conversion cast (unumber) 0 in (bool~) printf_uint::$5 ← (number) 0 != (byte) printf_uint::format_sign_always#1
Adding number conversion cast (unumber) printf_uint::$2 in (byte) printf_uint::format_upper_case#2 ← phi( printf_uint::@1/(byte) printf_uint::format_upper_case#3 printf_uint::@2/(byte) printf_uint::format_upper_case#4 )
(byte) printf_uint::format_zero_padding#2 ← phi( printf_uint::@1/(byte) printf_uint::format_zero_padding#3 printf_uint::@2/(byte) printf_uint::format_zero_padding#4 )
@ -2629,15 +2631,15 @@ Inversing boolean not [269] (bool~) gotoxy::$1 ← (byte) gotoxy::y#2 <= (byte)
Inversing boolean not [273] (bool~) gotoxy::$3 ← (byte) gotoxy::x#2 < (byte) $28 from [272] (bool~) gotoxy::$2 ← (byte) gotoxy::x#2 >= (byte) $28
Inversing boolean not [299] (bool~) cputc::$2 ← (byte) conio_cursor_x != (byte) $28 from [298] (bool~) cputc::$1 ← (byte) conio_cursor_x == (byte) $28
Inversing boolean not [310] (bool~) cscroll::$1 ← (byte) conio_cursor_y != (byte) $19 from [309] (bool~) cscroll::$0 ← (byte) conio_cursor_y == (byte) $19
Inversing boolean not [398] (bool~) printf_schar::$3 ← (byte) 0 == (byte) printf_schar::format_sign_always#2 from [397] (bool~) printf_schar::$5 ← (byte) 0 != (byte) printf_schar::format_sign_always#2
Inversing boolean not [422] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#2 from [421] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#2
Inversing boolean not [426] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#2 from [425] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#2
Inversing boolean not [428] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#2 from [427] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#2
Inversing boolean not [441] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [440] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2
Inversing boolean not [448] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [447] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [456] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#3 from [455] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#3
Inversing boolean not [473] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#2 from [472] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#2
Inversing boolean not [485] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#4 from [484] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#4
Inversing boolean not [399] (bool~) printf_schar::$3 ← (byte) 0 == (byte) printf_schar::format_sign_always#2 from [398] (bool~) printf_schar::$5 ← (byte) 0 != (byte) printf_schar::format_sign_always#2
Inversing boolean not [423] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#2 from [422] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#2
Inversing boolean not [427] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#2 from [426] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#2
Inversing boolean not [429] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#2 from [428] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#2
Inversing boolean not [442] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [441] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2
Inversing boolean not [449] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [448] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [457] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#3 from [456] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#3
Inversing boolean not [474] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#2 from [473] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#2
Inversing boolean not [486] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#4 from [485] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#4
Successful SSA optimization Pass2UnaryNotSimplification
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
@ -2707,7 +2709,7 @@ Alias gotoxy::x#4 = gotoxy::x#5
Alias gotoxy::line_offset#0 = gotoxy::$4
Alias gotoxy::y#4 = gotoxy::y#5
Alias cputc::c#3 = cputc::c#4
Alias cputs::c#1 = cputs::c#2
Alias cputs::c#1 = cputs::$0 cputs::c#2
Alias cputs::s#0 = cputs::s#5 cputs::s#4
Alias printf_padding::pad#3 = printf_padding::pad#4 printf_padding::pad#6
Alias printf_padding::i#2 = printf_padding::i#4 printf_padding::i#3
@ -2901,7 +2903,7 @@ Simple Condition (bool~) cputc::$0 [217] if((byte) cputc::c#3==(byte) '
Simple Condition (bool~) cputc::$2 [223] if((byte) conio_cursor_x!=(byte) $28) goto cputc::@return
Simple Condition (bool~) cscroll::$1 [233] if((byte) conio_cursor_y!=(byte) $19) goto cscroll::@return
Simple Condition (bool~) cscroll::$7 [235] if((byte) 0!=(byte) conio_scroll_enable) goto cscroll::@3
Simple Condition (bool~) cputs::$1 [269] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) cputs::$2 [269] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) printf_padding::$0 [277] if((byte) printf_padding::i#2<(byte) printf_padding::length#4) goto printf_padding::@2
Simple Condition (bool~) printf_uint::$5 [284] if((byte) 0!=(byte) printf_uint::format_sign_always#0) goto printf_uint::@1
Simple Condition (bool~) printf_schar::$0 [306] if((signed byte) printf_schar::value#3<(signed byte) 0) goto printf_schar::@1
@ -10501,11 +10503,10 @@ cputs: {
sta.z s+1
// cputs::@1
__b1:
// c=*s++
// while(c=*s++)
// [208] (byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#2) -- vbuaa=_deref_pbuz1
ldy #0
lda (s),y
// while(c=*s++)
// [209] (to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#2 -- pbuz1=_inc_pbuz1
inc.z s
bne !+

View File

@ -332,10 +332,9 @@ tod_str: {
cputs: {
.label s = 4
__b1:
// c=*s++
// while(c=*s++)
ldy #0
lda (s),y
// while(c=*s++)
inc.z s
bne !+
inc.z s+1

View File

@ -508,9 +508,10 @@ cputs: scope:[cputs] from main::@4 main::@9 printf_number_buffer::@5 printf_str
cputs::@1: scope:[cputs] from cputs cputs::@3
(to_nomodify byte*) cputs::s#5 ← phi( cputs/(to_nomodify byte*) cputs::s#6 cputs::@3/(to_nomodify byte*) cputs::s#7 )
(byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#5)
(byte~) cputs::$0 ← (byte) cputs::c#1
(to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#5
(bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
if((bool~) cputs::$1) goto cputs::@2
(bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
if((bool~) cputs::$2) goto cputs::@2
to:cputs::@return
cputs::@2: scope:[cputs] from cputs::@1
(to_nomodify byte*) cputs::s#8 ← phi( cputs::@1/(to_nomodify byte*) cputs::s#0 )
@ -1290,7 +1291,8 @@ SYMBOL TABLE SSA
(label) cputln::@1
(label) cputln::@return
(void()) cputs((to_nomodify byte*) cputs::s)
(bool~) cputs::$1
(byte~) cputs::$0
(bool~) cputs::$2
(label) cputs::@1
(label) cputs::@2
(label) cputs::@3
@ -2198,7 +2200,7 @@ Adding number conversion cast (unumber) $28 in (byte*) conio_line_text ← (byte
Adding number conversion cast (unumber) $28 in (byte*) conio_line_color ← (byte*) conio_line_color - (number) $28
Adding number conversion cast (unumber) 0 in (byte) gotoxy::x#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) gotoxy::y#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
Adding number conversion cast (unumber) 0 in (bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
Adding number conversion cast (unumber) 0 in (bool~) printf_uint::$5 ← (number) 0 != (byte) printf_uint::format_sign_always#1
Adding number conversion cast (unumber) printf_uint::$2 in (byte) printf_uint::format_upper_case#2 ← phi( printf_uint::@1/(byte) printf_uint::format_upper_case#3 printf_uint::@2/(byte) printf_uint::format_upper_case#4 )
(byte) printf_uint::format_zero_padding#2 ← phi( printf_uint::@1/(byte) printf_uint::format_zero_padding#3 printf_uint::@2/(byte) printf_uint::format_zero_padding#4 )
@ -2470,18 +2472,18 @@ Inversing boolean not [165] (bool~) gotoxy::$1 ← (byte) gotoxy::y#5 <= (byte)
Inversing boolean not [169] (bool~) gotoxy::$3 ← (byte) gotoxy::x#5 < (byte) $28 from [168] (bool~) gotoxy::$2 ← (byte) gotoxy::x#5 >= (byte) $28
Inversing boolean not [195] (bool~) cputc::$2 ← (byte) conio_cursor_x != (byte) $28 from [194] (bool~) cputc::$1 ← (byte) conio_cursor_x == (byte) $28
Inversing boolean not [206] (bool~) cscroll::$1 ← (byte) conio_cursor_y != (byte) $19 from [205] (bool~) cscroll::$0 ← (byte) conio_cursor_y == (byte) $19
Inversing boolean not [287] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#1 from [286] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#1
Inversing boolean not [291] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#1 from [290] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#1
Inversing boolean not [293] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#1 from [292] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#1
Inversing boolean not [306] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#1 from [305] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#1
Inversing boolean not [313] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [312] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [321] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [320] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2
Inversing boolean not [338] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#1 from [337] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#1
Inversing boolean not [350] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#3 from [349] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#3
Inversing boolean not [368] (bool~) printf_string::$0 ← (byte) 0 == (byte) printf_string::format_min_length#1 from [367] (bool~) printf_string::$14 ← (byte) 0 != (byte) printf_string::format_min_length#1
Inversing boolean not [372] (bool~) printf_string::$1 ← (byte) 0 == (byte) printf_string::format_justify_left#1 from [371] (bool~) printf_string::$15 ← (byte) 0 != (byte) printf_string::format_justify_left#1
Inversing boolean not [387] (bool~) printf_string::$12 ← (signed byte) printf_string::padding#1 >= (signed byte) 0 from [386] (bool~) printf_string::$11 ← (signed byte) printf_string::padding#1 < (signed byte) 0
Inversing boolean not [477] (bool~) main::$8 ← (byte~) main::$6 != (byte) 0 from [476] (bool~) main::$7 ← (byte~) main::$6 == (byte) 0
Inversing boolean not [288] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#1 from [287] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#1
Inversing boolean not [292] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#1 from [291] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#1
Inversing boolean not [294] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#1 from [293] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#1
Inversing boolean not [307] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#1 from [306] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#1
Inversing boolean not [314] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [313] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [322] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [321] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2
Inversing boolean not [339] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#1 from [338] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#1
Inversing boolean not [351] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#3 from [350] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#3
Inversing boolean not [369] (bool~) printf_string::$0 ← (byte) 0 == (byte) printf_string::format_min_length#1 from [368] (bool~) printf_string::$14 ← (byte) 0 != (byte) printf_string::format_min_length#1
Inversing boolean not [373] (bool~) printf_string::$1 ← (byte) 0 == (byte) printf_string::format_justify_left#1 from [372] (bool~) printf_string::$15 ← (byte) 0 != (byte) printf_string::format_justify_left#1
Inversing boolean not [388] (bool~) printf_string::$12 ← (signed byte) printf_string::padding#1 >= (signed byte) 0 from [387] (bool~) printf_string::$11 ← (signed byte) printf_string::padding#1 < (signed byte) 0
Inversing boolean not [478] (bool~) main::$8 ← (byte~) main::$6 != (byte) 0 from [477] (bool~) main::$7 ← (byte~) main::$6 == (byte) 0
Successful SSA optimization Pass2UnaryNotSimplification
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
@ -2528,7 +2530,7 @@ Alias gotoxy::x#7 = gotoxy::x#8
Alias gotoxy::line_offset#0 = gotoxy::$4
Alias gotoxy::y#7 = gotoxy::y#8
Alias cputc::c#3 = cputc::c#4
Alias cputs::c#1 = cputs::c#2
Alias cputs::c#1 = cputs::$0 cputs::c#2
Alias cputs::s#0 = cputs::s#8 cputs::s#7
Alias printf_padding::pad#5 = printf_padding::pad#6 printf_padding::pad#8
Alias printf_padding::i#2 = printf_padding::i#4 printf_padding::i#3
@ -2720,7 +2722,7 @@ Simple Condition (bool~) cputc::$0 [135] if((byte) cputc::c#3==(byte) '
Simple Condition (bool~) cputc::$2 [141] if((byte) conio_cursor_x!=(byte) $28) goto cputc::@return
Simple Condition (bool~) cscroll::$1 [151] if((byte) conio_cursor_y!=(byte) $19) goto cscroll::@return
Simple Condition (bool~) cscroll::$7 [153] if((byte) 0!=(byte) conio_scroll_enable) goto cscroll::@3
Simple Condition (bool~) cputs::$1 [187] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) cputs::$2 [187] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) printf_padding::$0 [195] if((byte) printf_padding::i#2<(byte) printf_padding::length#6) goto printf_padding::@2
Simple Condition (bool~) printf_uint::$5 [202] if((byte) 0!=(byte) printf_uint::format_sign_always#0) goto printf_uint::@1
Simple Condition (bool~) printf_number_buffer::$0 [224] if((byte) 0==(byte) printf_number_buffer::format_min_length#0) goto printf_number_buffer::@1
@ -8183,11 +8185,10 @@ cputs: {
// [97] phi (to_nomodify byte*) cputs::s#5 = (to_nomodify byte*) cputs::s#6 [phi:cputs/cputs::@2->cputs::@1#0] -- register_copy
// cputs::@1
__b1:
// c=*s++
// while(c=*s++)
// [98] (byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#5) -- vbuaa=_deref_pbuz1
ldy #0
lda (s),y
// while(c=*s++)
// [99] (to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#5 -- pbuz1=_inc_pbuz1
inc.z s
bne !+

View File

@ -250,10 +250,9 @@ textcolor: {
cputs: {
.label s = $11
__b1:
// c=*s++
// while(c=*s++)
ldy #0
lda (s),y
// while(c=*s++)
inc.z s
bne !+
inc.z s+1

View File

@ -738,9 +738,10 @@ cputs: scope:[cputs] from main::@15 main::@8 printf_number_buffer::@5
cputs::@1: scope:[cputs] from cputs cputs::@3
(to_nomodify byte*) cputs::s#4 ← phi( cputs/(to_nomodify byte*) cputs::s#5 cputs::@3/(to_nomodify byte*) cputs::s#6 )
(byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#4)
(byte~) cputs::$0 ← (byte) cputs::c#1
(to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#4
(bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
if((bool~) cputs::$1) goto cputs::@2
(bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
if((bool~) cputs::$2) goto cputs::@2
to:cputs::@return
cputs::@2: scope:[cputs] from cputs::@1
(to_nomodify byte*) cputs::s#7 ← phi( cputs::@1/(to_nomodify byte*) cputs::s#0 )
@ -1596,7 +1597,8 @@ SYMBOL TABLE SSA
(label) cputln::@1
(label) cputln::@return
(void()) cputs((to_nomodify byte*) cputs::s)
(bool~) cputs::$1
(byte~) cputs::$0
(bool~) cputs::$2
(label) cputs::@1
(label) cputs::@2
(label) cputs::@3
@ -2627,7 +2629,7 @@ Adding number conversion cast (unumber) $28 in (byte*) conio_line_text ← (byte
Adding number conversion cast (unumber) $28 in (byte*) conio_line_color ← (byte*) conio_line_color - (number) $28
Adding number conversion cast (unumber) 0 in (byte) gotoxy::x#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) gotoxy::y#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
Adding number conversion cast (unumber) 0 in (bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
Adding number conversion cast (unumber) 0 in (bool~) printf_ulong::$5 ← (number) 0 != (byte) printf_ulong::format_sign_always#1
Adding number conversion cast (unumber) printf_ulong::$2 in (byte) printf_ulong::format_upper_case#2 ← phi( printf_ulong::@1/(byte) printf_ulong::format_upper_case#3 printf_ulong::@2/(byte) printf_ulong::format_upper_case#4 )
(byte) printf_ulong::format_zero_padding#2 ← phi( printf_ulong::@1/(byte) printf_ulong::format_zero_padding#3 printf_ulong::@2/(byte) printf_ulong::format_zero_padding#4 )
@ -2878,17 +2880,17 @@ Inversing boolean not [270] (bool~) gotoxy::$1 ← (byte) gotoxy::y#4 <= (byte)
Inversing boolean not [274] (bool~) gotoxy::$3 ← (byte) gotoxy::x#4 < (byte) $28 from [273] (bool~) gotoxy::$2 ← (byte) gotoxy::x#4 >= (byte) $28
Inversing boolean not [300] (bool~) cputc::$2 ← (byte) conio_cursor_x != (byte) $28 from [299] (bool~) cputc::$1 ← (byte) conio_cursor_x == (byte) $28
Inversing boolean not [311] (bool~) cscroll::$1 ← (byte) conio_cursor_y != (byte) $19 from [310] (bool~) cscroll::$0 ← (byte) conio_cursor_y == (byte) $19
Inversing boolean not [423] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#2 from [422] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#2
Inversing boolean not [427] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#2 from [426] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#2
Inversing boolean not [429] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#2 from [428] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#2
Inversing boolean not [442] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [441] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2
Inversing boolean not [449] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [448] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [457] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#3 from [456] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#3
Inversing boolean not [474] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#2 from [473] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#2
Inversing boolean not [486] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#4 from [485] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#4
Inversing boolean not [529] (bool~) main::$8 ← (byte~) main::$17 != (byte) 0 from [528] (bool~) main::$7 ← (byte~) main::$17 == (byte) 0
Inversing boolean not [556] (bool~) main::$12 ← (byte) main::row#1 != (byte) $19 from [555] (bool~) main::$11 ← (byte) main::row#1 == (byte) $19
Inversing boolean not [562] (bool~) main::$14 ← (byte) main::col#1 <= (byte)(number) $28-(number) 5 from [561] (bool~) main::$13 ← (byte) main::col#1 > (byte)(number) $28-(number) 5
Inversing boolean not [424] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#2 from [423] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#2
Inversing boolean not [428] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#2 from [427] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#2
Inversing boolean not [430] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#2 from [429] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#2
Inversing boolean not [443] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [442] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2
Inversing boolean not [450] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [449] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [458] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#3 from [457] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#3
Inversing boolean not [475] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#2 from [474] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#2
Inversing boolean not [487] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#4 from [486] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#4
Inversing boolean not [530] (bool~) main::$8 ← (byte~) main::$17 != (byte) 0 from [529] (bool~) main::$7 ← (byte~) main::$17 == (byte) 0
Inversing boolean not [557] (bool~) main::$12 ← (byte) main::row#1 != (byte) $19 from [556] (bool~) main::$11 ← (byte) main::row#1 == (byte) $19
Inversing boolean not [563] (bool~) main::$14 ← (byte) main::col#1 <= (byte)(number) $28-(number) 5 from [562] (bool~) main::$13 ← (byte) main::col#1 > (byte)(number) $28-(number) 5
Successful SSA optimization Pass2UnaryNotSimplification
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
@ -2958,7 +2960,7 @@ Alias gotoxy::x#6 = gotoxy::x#7
Alias gotoxy::line_offset#0 = gotoxy::$4
Alias gotoxy::y#6 = gotoxy::y#7
Alias cputc::c#3 = cputc::c#4
Alias cputs::c#1 = cputs::c#2
Alias cputs::c#1 = cputs::$0 cputs::c#2
Alias cputs::s#0 = cputs::s#7 cputs::s#6
Alias textcolor::return#0 = textcolor::old#0 textcolor::return#4 textcolor::return#1
Alias printf_padding::pad#3 = printf_padding::pad#4 printf_padding::pad#6
@ -3189,7 +3191,7 @@ Simple Condition (bool~) cputc::$0 [219] if((byte) cputc::c#3==(byte) '
Simple Condition (bool~) cputc::$2 [225] if((byte) conio_cursor_x!=(byte) $28) goto cputc::@return
Simple Condition (bool~) cscroll::$1 [235] if((byte) conio_cursor_y!=(byte) $19) goto cscroll::@return
Simple Condition (bool~) cscroll::$7 [237] if((byte) 0!=(byte) conio_scroll_enable) goto cscroll::@3
Simple Condition (bool~) cputs::$1 [271] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) cputs::$2 [271] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) printf_padding::$0 [283] if((byte) printf_padding::i#2<(byte) printf_padding::length#4) goto printf_padding::@2
Simple Condition (bool~) printf_ulong::$5 [290] if((byte) 0!=(byte) printf_ulong::format_sign_always#0) goto printf_ulong::@1
Simple Condition (bool~) printf_uint::$5 [311] if((byte) 0!=(byte) printf_uint::format_sign_always#0) goto printf_uint::@1
@ -10934,11 +10936,10 @@ cputs: {
// [67] phi (to_nomodify byte*) cputs::s#4 = (to_nomodify byte*) cputs::s#5 [phi:cputs/cputs::@2->cputs::@1#0] -- register_copy
// cputs::@1
__b1:
// c=*s++
// while(c=*s++)
// [68] (byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#4) -- vbuaa=_deref_pbuz1
ldy #0
lda (s),y
// while(c=*s++)
// [69] (to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#4 -- pbuz1=_inc_pbuz1
inc.z s
bne !+

View File

@ -252,10 +252,9 @@ textcolor: {
cputs: {
.label s = $11
__b1:
// c=*s++
// while(c=*s++)
ldy #0
lda (s),y
// while(c=*s++)
inc.z s
bne !+
inc.z s+1

View File

@ -757,9 +757,10 @@ cputs: scope:[cputs] from main::@16 main::@8 printf_number_buffer::@5
cputs::@1: scope:[cputs] from cputs cputs::@3
(to_nomodify byte*) cputs::s#4 ← phi( cputs/(to_nomodify byte*) cputs::s#5 cputs::@3/(to_nomodify byte*) cputs::s#6 )
(byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#4)
(byte~) cputs::$0 ← (byte) cputs::c#1
(to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#4
(bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
if((bool~) cputs::$1) goto cputs::@2
(bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
if((bool~) cputs::$2) goto cputs::@2
to:cputs::@return
cputs::@2: scope:[cputs] from cputs::@1
(to_nomodify byte*) cputs::s#7 ← phi( cputs::@1/(to_nomodify byte*) cputs::s#0 )
@ -1555,7 +1556,8 @@ SYMBOL TABLE SSA
(label) cputln::@1
(label) cputln::@return
(void()) cputs((to_nomodify byte*) cputs::s)
(bool~) cputs::$1
(byte~) cputs::$0
(bool~) cputs::$2
(label) cputs::@1
(label) cputs::@2
(label) cputs::@3
@ -2642,7 +2644,7 @@ Adding number conversion cast (unumber) $28 in (byte*) conio_line_text ← (byte
Adding number conversion cast (unumber) $28 in (byte*) conio_line_color ← (byte*) conio_line_color - (number) $28
Adding number conversion cast (unumber) 0 in (byte) gotoxy::x#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) gotoxy::y#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
Adding number conversion cast (unumber) 0 in (bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
Adding number conversion cast (unumber) 0 in (bool~) printf_ulong::$5 ← (number) 0 != (byte) printf_ulong::format_sign_always#1
Adding number conversion cast (unumber) printf_ulong::$2 in (byte) printf_ulong::format_upper_case#2 ← phi( printf_ulong::@1/(byte) printf_ulong::format_upper_case#3 printf_ulong::@2/(byte) printf_ulong::format_upper_case#4 )
(byte) printf_ulong::format_zero_padding#2 ← phi( printf_ulong::@1/(byte) printf_ulong::format_zero_padding#3 printf_ulong::@2/(byte) printf_ulong::format_zero_padding#4 )
@ -2890,17 +2892,17 @@ Inversing boolean not [282] (bool~) gotoxy::$1 ← (byte) gotoxy::y#4 <= (byte)
Inversing boolean not [286] (bool~) gotoxy::$3 ← (byte) gotoxy::x#4 < (byte) $28 from [285] (bool~) gotoxy::$2 ← (byte) gotoxy::x#4 >= (byte) $28
Inversing boolean not [312] (bool~) cputc::$2 ← (byte) conio_cursor_x != (byte) $28 from [311] (bool~) cputc::$1 ← (byte) conio_cursor_x == (byte) $28
Inversing boolean not [323] (bool~) cscroll::$1 ← (byte) conio_cursor_y != (byte) $19 from [322] (bool~) cscroll::$0 ← (byte) conio_cursor_y == (byte) $19
Inversing boolean not [435] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#2 from [434] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#2
Inversing boolean not [439] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#2 from [438] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#2
Inversing boolean not [441] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#2 from [440] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#2
Inversing boolean not [454] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [453] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2
Inversing boolean not [461] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [460] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [469] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#3 from [468] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#3
Inversing boolean not [486] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#2 from [485] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#2
Inversing boolean not [498] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#4 from [497] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#4
Inversing boolean not [541] (bool~) main::$9 ← (byte~) main::$18 != (byte) 0 from [540] (bool~) main::$8 ← (byte~) main::$18 == (byte) 0
Inversing boolean not [568] (bool~) main::$13 ← (byte) main::row#1 != (byte) $19 from [567] (bool~) main::$12 ← (byte) main::row#1 == (byte) $19
Inversing boolean not [574] (bool~) main::$15 ← (byte) main::col#1 <= (byte)(number) $28-(number) 5 from [573] (bool~) main::$14 ← (byte) main::col#1 > (byte)(number) $28-(number) 5
Inversing boolean not [436] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#2 from [435] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#2
Inversing boolean not [440] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#2 from [439] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#2
Inversing boolean not [442] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#2 from [441] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#2
Inversing boolean not [455] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [454] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2
Inversing boolean not [462] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [461] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [470] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#3 from [469] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#3
Inversing boolean not [487] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#2 from [486] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#2
Inversing boolean not [499] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#4 from [498] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#4
Inversing boolean not [542] (bool~) main::$9 ← (byte~) main::$18 != (byte) 0 from [541] (bool~) main::$8 ← (byte~) main::$18 == (byte) 0
Inversing boolean not [569] (bool~) main::$13 ← (byte) main::row#1 != (byte) $19 from [568] (bool~) main::$12 ← (byte) main::row#1 == (byte) $19
Inversing boolean not [575] (bool~) main::$15 ← (byte) main::col#1 <= (byte)(number) $28-(number) 5 from [574] (bool~) main::$14 ← (byte) main::col#1 > (byte)(number) $28-(number) 5
Successful SSA optimization Pass2UnaryNotSimplification
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
@ -2972,7 +2974,7 @@ Alias gotoxy::x#6 = gotoxy::x#7
Alias gotoxy::line_offset#0 = gotoxy::$4
Alias gotoxy::y#6 = gotoxy::y#7
Alias cputc::c#3 = cputc::c#4
Alias cputs::c#1 = cputs::c#2
Alias cputs::c#1 = cputs::$0 cputs::c#2
Alias cputs::s#0 = cputs::s#7 cputs::s#6
Alias textcolor::return#0 = textcolor::old#0 textcolor::return#5 textcolor::return#1
Alias printf_padding::pad#3 = printf_padding::pad#4 printf_padding::pad#6
@ -3201,7 +3203,7 @@ Simple Condition (bool~) cputc::$0 [228] if((byte) cputc::c#3==(byte) '
Simple Condition (bool~) cputc::$2 [234] if((byte) conio_cursor_x!=(byte) $28) goto cputc::@return
Simple Condition (bool~) cscroll::$1 [244] if((byte) conio_cursor_y!=(byte) $19) goto cscroll::@return
Simple Condition (bool~) cscroll::$7 [246] if((byte) 0!=(byte) conio_scroll_enable) goto cscroll::@3
Simple Condition (bool~) cputs::$1 [280] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) cputs::$2 [280] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) printf_padding::$0 [292] if((byte) printf_padding::i#2<(byte) printf_padding::length#4) goto printf_padding::@2
Simple Condition (bool~) printf_ulong::$5 [299] if((byte) 0!=(byte) printf_ulong::format_sign_always#0) goto printf_ulong::@1
Simple Condition (bool~) printf_uint::$5 [320] if((byte) 0!=(byte) printf_uint::format_sign_always#0) goto printf_uint::@1
@ -10994,11 +10996,10 @@ cputs: {
// [69] phi (to_nomodify byte*) cputs::s#4 = (to_nomodify byte*) cputs::s#5 [phi:cputs/cputs::@2->cputs::@1#0] -- register_copy
// cputs::@1
__b1:
// c=*s++
// while(c=*s++)
// [70] (byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#4) -- vbuaa=_deref_pbuz1
ldy #0
lda (s),y
// while(c=*s++)
// [71] (to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#4 -- pbuz1=_inc_pbuz1
inc.z s
bne !+

View File

@ -11,12 +11,12 @@
.label TIMELO = $a2
.label VICBANK = $d018
main: {
.label __4 = 6
.label __13 = 6
.label __18 = 6
.label __19 = $11
.label __20 = 6
.label __21 = $f
.label __3 = 6
.label __10 = 6
.label __14 = 6
.label __15 = $11
.label __16 = 6
.label __17 = $f
.label v = 4
// test performance of 'div16u(10)'
// test performance of 'div10'
@ -67,25 +67,25 @@ main: {
bcc __b10
// (word)*TIMEHI << 8
lda TIMEHI
sta.z __20
sta.z __16
lda #0
sta.z __20+1
lda.z __13
sta.z __13+1
sta.z __16+1
lda.z __10
sta.z __10+1
lda #0
sta.z __13
sta.z __10
// ((word)*TIMEHI << 8) + (word)*TIMELO
lda TIMELO
sta.z __21
sta.z __17
lda #0
sta.z __21+1
sta.z __17+1
// myprintf(strTemp, "200 DIV10 : %5d,%4d IN %04d FRAMESm", u, v, ((word)*TIMEHI << 8) + (word)*TIMELO)
lda.z myprintf.w3
clc
adc.z __21
adc.z __17
sta.z myprintf.w3
lda.z myprintf.w3+1
adc.z __21+1
adc.z __17+1
sta.z myprintf.w3+1
lda #<str1
sta.z myprintf.str
@ -127,25 +127,25 @@ main: {
bcc __b5
// (word)*TIMEHI << 8
lda TIMEHI
sta.z __18
sta.z __14
lda #0
sta.z __18+1
lda.z __4
sta.z __4+1
sta.z __14+1
lda.z __3
sta.z __3+1
lda #0
sta.z __4
sta.z __3
// ((word)*TIMEHI << 8) + (word)*TIMELO
lda TIMELO
sta.z __19
sta.z __15
lda #0
sta.z __19+1
sta.z __15+1
// myprintf(strTemp, "200 DIV16U: %5d,%4d IN %04d FRAMESm", u, v, ((word)*TIMEHI << 8) + (word)*TIMELO)
lda.z myprintf.w3
clc
adc.z __19
adc.z __15
sta.z myprintf.w3
lda.z myprintf.w3+1
adc.z __19+1
adc.z __15+1
sta.z myprintf.w3+1
// lower case letters in string literal are placed in string as 0x01-0x1A, should be 0x61-0x7A
// -- as a side-effect of above issue, we can use "m" for carriage return. The normal way is the escape code "\r" but that is not supported --

View File

@ -30,10 +30,10 @@ main::@9: scope:[main] from main::@15 main::@8
[12] if(*((const nomodify byte*) zp2)<(byte) $c8) goto main::@10
to:main::@11
main::@11: scope:[main] from main::@9
[13] (word~) main::$20 ← (word)*((const nomodify byte*) TIMEHI)
[14] (word~) main::$13 ← (word~) main::$20 << (byte) 8
[15] (word~) main::$21 ← (word)*((const nomodify byte*) TIMELO)
[16] (word) myprintf::w3#1 ← (word~) main::$13 + (word~) main::$21
[13] (word~) main::$16 ← (word)*((const nomodify byte*) TIMEHI)
[14] (word~) main::$10 ← (word~) main::$16 << (byte) 8
[15] (word~) main::$17 ← (word)*((const nomodify byte*) TIMELO)
[16] (word) myprintf::w3#1 ← (word~) main::$10 + (word~) main::$17
[17] (word) myprintf::w1#1 ← (word) main::u#18
[18] (word) myprintf::w2#1 ← (word) main::v#12
[19] call myprintf
@ -65,10 +65,10 @@ main::@4: scope:[main] from main::@12 main::@2
[33] if(*((const nomodify byte*) zp2)<(byte) $c8) goto main::@5
to:main::@6
main::@6: scope:[main] from main::@4
[34] (word~) main::$18 ← (word)*((const nomodify byte*) TIMEHI)
[35] (word~) main::$4 ← (word~) main::$18 << (byte) 8
[36] (word~) main::$19 ← (word)*((const nomodify byte*) TIMELO)
[37] (word) myprintf::w3#0 ← (word~) main::$4 + (word~) main::$19
[34] (word~) main::$14 ← (word)*((const nomodify byte*) TIMEHI)
[35] (word~) main::$3 ← (word~) main::$14 << (byte) 8
[36] (word~) main::$15 ← (word)*((const nomodify byte*) TIMELO)
[37] (word) myprintf::w3#0 ← (word~) main::$3 + (word~) main::$15
[38] (word) myprintf::w1#0 ← (word) main::u#16
[39] (word) myprintf::w2#0 ← (word) main::v#11
[40] call myprintf

View File

@ -1127,15 +1127,15 @@ main::@13: scope:[main] from main::@5
main::@6: scope:[main] from main::@4
(word) main::v#3 ← phi( main::@4/(word) main::v#5 )
(word) main::u#6 ← phi( main::@4/(word) main::u#11 )
(word~) main::$18 ← (word)*((const nomodify byte*) TIMEHI)
(word~) main::$4 ← (word~) main::$18 << (number) 8
(word~) main::$19 ← (word)*((const nomodify byte*) TIMELO)
(word~) main::$5 ← (word~) main::$4 + (word~) main::$19
(word~) main::$14 ← (word)*((const nomodify byte*) TIMEHI)
(word~) main::$3 ← (word~) main::$14 << (number) 8
(word~) main::$15 ← (word)*((const nomodify byte*) TIMELO)
(word~) main::$4 ← (word~) main::$3 + (word~) main::$15
(byte*) myprintf::dst#0 ← (const byte*) strTemp
(byte*) myprintf::str#1 ← (const byte*) main::str
(word) myprintf::w1#0 ← (word) main::u#6
(word) myprintf::w2#0 ← (word) main::v#3
(word) myprintf::w3#0 ← (word~) main::$5
(word) myprintf::w3#0 ← (word~) main::$4
call myprintf
(byte) myprintf::return#2 ← (byte) myprintf::return#1
to:main::@14
@ -1153,8 +1153,8 @@ main::@15: scope:[main] from main::@14
main::@7: scope:[main] from main::@18 main::@3
(word) main::v#10 ← phi( main::@18/(word) main::v#12 main::@3/(word) main::v#13 )
(word) main::u#20 ← phi( main::@18/(word) main::u#4 main::@3/(word) main::u#2 )
(bool~) main::$9 ← *((const nomodify byte*) zp1) < (number) $a
if((bool~) main::$9) goto main::@8
(bool~) main::$7 ← *((const nomodify byte*) zp1) < (number) $a
if((bool~) main::$7) goto main::@8
to:main::@9
main::@8: scope:[main] from main::@7
(word) main::v#8 ← phi( main::@7/(word) main::v#10 )
@ -1169,8 +1169,8 @@ main::@9: scope:[main] from main::@7
main::@10: scope:[main] from main::@16 main::@8
(word) main::v#6 ← phi( main::@16/(word) main::v#2 main::@8/(word) main::v#8 )
(word) main::u#13 ← phi( main::@16/(word) main::u#17 main::@8/(word) main::u#18 )
(bool~) main::$10 ← *((const nomodify byte*) zp2) < (number) $c8
if((bool~) main::$10) goto main::@11
(bool~) main::$8 ← *((const nomodify byte*) zp2) < (number) $c8
if((bool~) main::$8) goto main::@11
to:main::@12
main::@11: scope:[main] from main::@10
(word) main::u#8 ← phi( main::@10/(word) main::u#13 )
@ -1181,22 +1181,22 @@ main::@11: scope:[main] from main::@10
main::@16: scope:[main] from main::@11
(word) main::u#17 ← phi( main::@11/(word) main::u#8 )
(word) div10::return#4 ← phi( main::@11/(word) div10::return#2 )
(word~) main::$11 ← (word) div10::return#4
(word) main::v#2 ← (word~) main::$11
(word~) main::$9 ← (word) div10::return#4
(word) main::v#2 ← (word~) main::$9
*((const nomodify byte*) zp2) ← ++ *((const nomodify byte*) zp2)
to:main::@10
main::@12: scope:[main] from main::@10
(word) main::v#4 ← phi( main::@10/(word) main::v#6 )
(word) main::u#9 ← phi( main::@10/(word) main::u#13 )
(word~) main::$20 ← (word)*((const nomodify byte*) TIMEHI)
(word~) main::$13 ← (word~) main::$20 << (number) 8
(word~) main::$21 ← (word)*((const nomodify byte*) TIMELO)
(word~) main::$14 ← (word~) main::$13 + (word~) main::$21
(word~) main::$16 ← (word)*((const nomodify byte*) TIMEHI)
(word~) main::$10 ← (word~) main::$16 << (number) 8
(word~) main::$17 ← (word)*((const nomodify byte*) TIMELO)
(word~) main::$11 ← (word~) main::$10 + (word~) main::$17
(byte*) myprintf::dst#1 ← (const byte*) strTemp
(byte*) myprintf::str#2 ← (const byte*) main::str1
(word) myprintf::w1#1 ← (word) main::u#9
(word) myprintf::w2#1 ← (word) main::v#4
(word) myprintf::w3#1 ← (word~) main::$14
(word) myprintf::w3#1 ← (word~) main::$11
call myprintf
(byte) myprintf::return#3 ← (byte) myprintf::return#1
to:main::@17
@ -1399,18 +1399,18 @@ SYMBOL TABLE SSA
(signed word()) main()
(bool~) main::$0
(bool~) main::$1
(bool~) main::$10
(word~) main::$10
(word~) main::$11
(word~) main::$13
(word~) main::$14
(word~) main::$18
(word~) main::$19
(word~) main::$15
(word~) main::$16
(word~) main::$17
(word~) main::$2
(word~) main::$20
(word~) main::$21
(word~) main::$3
(word~) main::$4
(word~) main::$5
(bool~) main::$9
(bool~) main::$7
(bool~) main::$8
(word~) main::$9
(label) main::@1
(label) main::@10
(label) main::@11
@ -2427,15 +2427,15 @@ Adding number conversion cast (unumber) $6e85 in (word) main::u#2 ← (number) $
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) zp1) ← (number) 0
Adding number conversion cast (unumber) $c8 in (bool~) main::$1 ← *((const nomodify byte*) zp2) < (number) $c8
Adding number conversion cast (unumber) $a in (word) div16u::divisor#0 ← (number) $a
Adding number conversion cast (unumber) 8 in (word~) main::$4 ← (word~) main::$18 << (number) 8
Adding number conversion cast (unumber) 8 in (word~) main::$3 ← (word~) main::$14 << (number) 8
Adding number conversion cast (unumber) $4d2 in (word) main::u#3 ← (word) main::u#7 - (number) $4d2
Adding number conversion cast (unumber) $a in (bool~) main::$9 ← *((const nomodify byte*) zp1) < (number) $a
Adding number conversion cast (unumber) $a in (bool~) main::$7 ← *((const nomodify byte*) zp1) < (number) $a
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) TIMEHI) ← (number) 0
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) TIMELO) ← (number) 0
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) zp2) ← (number) 0
Adding number conversion cast (snumber) 0 in (signed word) main::return#0 ← (number) 0
Adding number conversion cast (unumber) $c8 in (bool~) main::$10 ← *((const nomodify byte*) zp2) < (number) $c8
Adding number conversion cast (unumber) 8 in (word~) main::$13 ← (word~) main::$20 << (number) 8
Adding number conversion cast (unumber) $c8 in (bool~) main::$8 ← *((const nomodify byte*) zp2) < (number) $c8
Adding number conversion cast (unumber) 8 in (word~) main::$10 ← (word~) main::$16 << (number) 8
Adding number conversion cast (unumber) $4d2 in (word) main::u#4 ← (word) main::u#10 - (number) $4d2
Successful SSA optimization PassNAddNumberTypeConversions
Adding number conversion cast (unumber) $57 in (unumber~) myprintf::$21 ← (number) $57
@ -2782,14 +2782,14 @@ Alias main::u#11 = main::u#5 main::u#15 main::u#6 main::u#12 main::u#7
Alias div16u::return#2 = div16u::return#4
Alias main::v#1 = main::$2
Alias main::v#11 = main::v#3 main::v#5 main::v#14
Alias myprintf::w3#0 = main::$5
Alias myprintf::w3#0 = main::$4
Alias main::u#18 = main::u#20
Alias main::v#10 = main::v#8
Alias main::u#10 = main::u#8 main::u#13 main::u#17 main::u#9 main::u#14
Alias div10::return#2 = div10::return#4
Alias main::v#2 = main::$11
Alias main::v#2 = main::$9
Alias main::v#12 = main::v#4 main::v#6 main::v#15
Alias myprintf::w3#1 = main::$14
Alias myprintf::w3#1 = main::$11
Alias main::return#0 = main::return#3 main::return#1
Successful SSA optimization Pass2AliasElimination
Alias candidate removed (phi-usage) myprintf::w1#10 = myprintf::w1#29 myprintf::w1#18 myprintf::w1#12 myprintf::w1#13
@ -2954,8 +2954,8 @@ Simple Condition (bool~) myprintf::$50 [222] if((byte) myprintf::bArg#10==(byte)
Simple Condition (bool~) myprintf::$51 [224] if((byte) myprintf::bArg#10==(byte) 1) goto myprintf::@39
Simple Condition (bool~) main::$0 [252] if(*((const nomodify byte*) zp1)<(byte) $a) goto main::@2
Simple Condition (bool~) main::$1 [260] if(*((const nomodify byte*) zp2)<(byte) $c8) goto main::@5
Simple Condition (bool~) main::$9 [282] if(*((const nomodify byte*) zp1)<(byte) $a) goto main::@8
Simple Condition (bool~) main::$10 [289] if(*((const nomodify byte*) zp2)<(byte) $c8) goto main::@11
Simple Condition (bool~) main::$7 [282] if(*((const nomodify byte*) zp1)<(byte) $a) goto main::@8
Simple Condition (bool~) main::$8 [289] if(*((const nomodify byte*) zp2)<(byte) $c8) goto main::@11
Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting ! if()-condition to reversed if() [43] (bool~) utoa::$3 ← ! (bool~) utoa::$2
Rewriting || if()-condition to two if()s [42] (bool~) utoa::$2 ← (bool~) utoa::$0 || (bool~) utoa::$1
@ -3454,10 +3454,10 @@ main::@9: scope:[main] from main::@15 main::@8
[12] if(*((const nomodify byte*) zp2)<(byte) $c8) goto main::@10
to:main::@11
main::@11: scope:[main] from main::@9
[13] (word~) main::$20 ← (word)*((const nomodify byte*) TIMEHI)
[14] (word~) main::$13 ← (word~) main::$20 << (byte) 8
[15] (word~) main::$21 ← (word)*((const nomodify byte*) TIMELO)
[16] (word) myprintf::w3#1 ← (word~) main::$13 + (word~) main::$21
[13] (word~) main::$16 ← (word)*((const nomodify byte*) TIMEHI)
[14] (word~) main::$10 ← (word~) main::$16 << (byte) 8
[15] (word~) main::$17 ← (word)*((const nomodify byte*) TIMELO)
[16] (word) myprintf::w3#1 ← (word~) main::$10 + (word~) main::$17
[17] (word) myprintf::w1#1 ← (word) main::u#18
[18] (word) myprintf::w2#1 ← (word) main::v#12
[19] call myprintf
@ -3489,10 +3489,10 @@ main::@4: scope:[main] from main::@12 main::@2
[33] if(*((const nomodify byte*) zp2)<(byte) $c8) goto main::@5
to:main::@6
main::@6: scope:[main] from main::@4
[34] (word~) main::$18 ← (word)*((const nomodify byte*) TIMEHI)
[35] (word~) main::$4 ← (word~) main::$18 << (byte) 8
[36] (word~) main::$19 ← (word)*((const nomodify byte*) TIMELO)
[37] (word) myprintf::w3#0 ← (word~) main::$4 + (word~) main::$19
[34] (word~) main::$14 ← (word)*((const nomodify byte*) TIMEHI)
[35] (word~) main::$3 ← (word~) main::$14 << (byte) 8
[36] (word~) main::$15 ← (word)*((const nomodify byte*) TIMELO)
[37] (word) myprintf::w3#0 ← (word~) main::$3 + (word~) main::$15
[38] (word) myprintf::w1#0 ← (word) main::u#16
[39] (word) myprintf::w2#0 ← (word) main::v#11
[40] call myprintf
@ -3965,12 +3965,12 @@ VARIABLE REGISTER WEIGHTS
(word) divr16u::return#0 6000200.8
(word) divr16u::return#2 2002.0
(signed word()) main()
(word~) main::$13 11.0
(word~) main::$18 22.0
(word~) main::$19 22.0
(word~) main::$20 22.0
(word~) main::$21 22.0
(word~) main::$4 11.0
(word~) main::$10 11.0
(word~) main::$14 22.0
(word~) main::$15 22.0
(word~) main::$16 22.0
(word~) main::$17 22.0
(word~) main::$3 11.0
(signed word) main::return
(word) main::u
(word) main::u#16 6.380952380952381
@ -4125,14 +4125,14 @@ Initial phi equivalence classes
[ append::dst#4 append::dst#1 append::dst#2 append::dst#3 ]
[ append::sub#6 ]
[ append::value#5 append::value#8 append::value#1 append::value#2 append::value#3 append::value#4 append::value#0 ]
Added variable main::$20 to live range equivalence class [ main::$20 ]
Added variable main::$13 to live range equivalence class [ main::$13 ]
Added variable main::$21 to live range equivalence class [ main::$21 ]
Added variable main::$16 to live range equivalence class [ main::$16 ]
Added variable main::$10 to live range equivalence class [ main::$10 ]
Added variable main::$17 to live range equivalence class [ main::$17 ]
Added variable div10::val#4 to live range equivalence class [ div10::val#4 ]
Added variable div10::return#2 to live range equivalence class [ div10::return#2 ]
Added variable main::$18 to live range equivalence class [ main::$18 ]
Added variable main::$4 to live range equivalence class [ main::$4 ]
Added variable main::$19 to live range equivalence class [ main::$19 ]
Added variable main::$14 to live range equivalence class [ main::$14 ]
Added variable main::$3 to live range equivalence class [ main::$3 ]
Added variable main::$15 to live range equivalence class [ main::$15 ]
Added variable div16u::dividend#0 to live range equivalence class [ div16u::dividend#0 ]
Added variable div16u::return#2 to live range equivalence class [ div16u::return#2 ]
Added variable myprintf::$56 to live range equivalence class [ myprintf::$56 ]
@ -4194,14 +4194,14 @@ Complete equivalence classes
[ append::dst#4 append::dst#1 append::dst#2 append::dst#3 ]
[ append::sub#6 ]
[ append::value#5 append::value#8 append::value#1 append::value#2 append::value#3 append::value#4 append::value#0 ]
[ main::$20 ]
[ main::$13 ]
[ main::$21 ]
[ main::$16 ]
[ main::$10 ]
[ main::$17 ]
[ div10::val#4 ]
[ div10::return#2 ]
[ main::$18 ]
[ main::$4 ]
[ main::$19 ]
[ main::$14 ]
[ main::$3 ]
[ main::$15 ]
[ div16u::dividend#0 ]
[ div16u::return#2 ]
[ myprintf::$56 ]
@ -4262,14 +4262,14 @@ Allocated zp[1]:41 [ divr16u::i#2 divr16u::i#1 ]
Allocated zp[2]:42 [ append::dst#4 append::dst#1 append::dst#2 append::dst#3 ]
Allocated zp[2]:44 [ append::sub#6 ]
Allocated zp[2]:46 [ append::value#5 append::value#8 append::value#1 append::value#2 append::value#3 append::value#4 append::value#0 ]
Allocated zp[2]:48 [ main::$20 ]
Allocated zp[2]:50 [ main::$13 ]
Allocated zp[2]:52 [ main::$21 ]
Allocated zp[2]:48 [ main::$16 ]
Allocated zp[2]:50 [ main::$10 ]
Allocated zp[2]:52 [ main::$17 ]
Allocated zp[2]:54 [ div10::val#4 ]
Allocated zp[2]:56 [ div10::return#2 ]
Allocated zp[2]:58 [ main::$18 ]
Allocated zp[2]:60 [ main::$4 ]
Allocated zp[2]:62 [ main::$19 ]
Allocated zp[2]:58 [ main::$14 ]
Allocated zp[2]:60 [ main::$3 ]
Allocated zp[2]:62 [ main::$15 ]
Allocated zp[2]:64 [ div16u::dividend#0 ]
Allocated zp[2]:66 [ div16u::return#2 ]
Allocated zp[1]:68 [ myprintf::$56 ]
@ -4320,12 +4320,12 @@ Target platform is c64basic / MOS6502X
.label VICBANK = $d018
// main
main: {
.label __4 = $3c
.label __13 = $32
.label __18 = $3a
.label __19 = $3e
.label __20 = $30
.label __21 = $34
.label __3 = $3c
.label __10 = $32
.label __14 = $3a
.label __15 = $3e
.label __16 = $30
.label __17 = $34
.label v = 6
// test performance of 'div16u(10)'
// test performance of 'div10'
@ -4409,28 +4409,28 @@ main: {
jmp __b11
// main::@11
__b11:
// [13] (word~) main::$20 ← (word)*((const nomodify byte*) TIMEHI) -- vwuz1=_word__deref_pbuc1
// [13] (word~) main::$16 ← (word)*((const nomodify byte*) TIMEHI) -- vwuz1=_word__deref_pbuc1
lda TIMEHI
sta.z __20
sta.z __16
lda #0
sta.z __20+1
// [14] (word~) main::$13 ← (word~) main::$20 << (byte) 8 -- vwuz1=vwuz2_rol_8
lda.z __20
sta.z __13+1
sta.z __16+1
// [14] (word~) main::$10 ← (word~) main::$16 << (byte) 8 -- vwuz1=vwuz2_rol_8
lda.z __16
sta.z __10+1
lda #0
sta.z __13
// [15] (word~) main::$21 ← (word)*((const nomodify byte*) TIMELO) -- vwuz1=_word__deref_pbuc1
sta.z __10
// [15] (word~) main::$17 ← (word)*((const nomodify byte*) TIMELO) -- vwuz1=_word__deref_pbuc1
lda TIMELO
sta.z __21
sta.z __17
lda #0
sta.z __21+1
// [16] (word) myprintf::w3#1 ← (word~) main::$13 + (word~) main::$21 -- vwuz1=vwuz2_plus_vwuz3
lda.z __13
sta.z __17+1
// [16] (word) myprintf::w3#1 ← (word~) main::$10 + (word~) main::$17 -- vwuz1=vwuz2_plus_vwuz3
lda.z __10
clc
adc.z __21
adc.z __17
sta.z myprintf.w3
lda.z __13+1
adc.z __21+1
lda.z __10+1
adc.z __17+1
sta.z myprintf.w3+1
// [17] (word) myprintf::w1#1 ← (word) main::u#18 -- vwuz1=vwuz2
lda.z u_1
@ -4529,28 +4529,28 @@ main: {
jmp __b6
// main::@6
__b6:
// [34] (word~) main::$18 ← (word)*((const nomodify byte*) TIMEHI) -- vwuz1=_word__deref_pbuc1
// [34] (word~) main::$14 ← (word)*((const nomodify byte*) TIMEHI) -- vwuz1=_word__deref_pbuc1
lda TIMEHI
sta.z __18
sta.z __14
lda #0
sta.z __18+1
// [35] (word~) main::$4 ← (word~) main::$18 << (byte) 8 -- vwuz1=vwuz2_rol_8
lda.z __18
sta.z __4+1
sta.z __14+1
// [35] (word~) main::$3 ← (word~) main::$14 << (byte) 8 -- vwuz1=vwuz2_rol_8
lda.z __14
sta.z __3+1
lda #0
sta.z __4
// [36] (word~) main::$19 ← (word)*((const nomodify byte*) TIMELO) -- vwuz1=_word__deref_pbuc1
sta.z __3
// [36] (word~) main::$15 ← (word)*((const nomodify byte*) TIMELO) -- vwuz1=_word__deref_pbuc1
lda TIMELO
sta.z __19
sta.z __15
lda #0
sta.z __19+1
// [37] (word) myprintf::w3#0 ← (word~) main::$4 + (word~) main::$19 -- vwuz1=vwuz2_plus_vwuz3
lda.z __4
sta.z __15+1
// [37] (word) myprintf::w3#0 ← (word~) main::$3 + (word~) main::$15 -- vwuz1=vwuz2_plus_vwuz3
lda.z __3
clc
adc.z __19
adc.z __15
sta.z myprintf.w3
lda.z __4+1
adc.z __19+1
lda.z __3+1
adc.z __15+1
sta.z myprintf.w3+1
// [38] (word) myprintf::w1#0 ← (word) main::u#16 -- vwuz1=vwuz2
lda.z u
@ -5910,10 +5910,10 @@ Statement [8] *((const nomodify byte*) TIMEHI) ← (byte) 0 [ main::u#18 main::v
Statement [9] *((const nomodify byte*) TIMELO) ← (byte) 0 [ main::u#18 main::v#10 ] ( [ main::u#18 main::v#10 ] { } ) always clobbers reg byte a
Statement [10] *((const nomodify byte*) zp2) ← (byte) 0 [ main::u#18 main::v#10 ] ( [ main::u#18 main::v#10 ] { } ) always clobbers reg byte a
Statement [12] if(*((const nomodify byte*) zp2)<(byte) $c8) goto main::@10 [ main::u#18 main::v#12 ] ( [ main::u#18 main::v#12 ] { } ) always clobbers reg byte a
Statement [13] (word~) main::$20 ← (word)*((const nomodify byte*) TIMEHI) [ main::u#18 main::v#12 main::$20 ] ( [ main::u#18 main::v#12 main::$20 ] { { myprintf::w1#1 = myprintf::w1#7 main::u#18 } { myprintf::w2#1 = myprintf::w2#8 main::v#12 } { myprintf::w3#1 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [14] (word~) main::$13 ← (word~) main::$20 << (byte) 8 [ main::u#18 main::v#12 main::$13 ] ( [ main::u#18 main::v#12 main::$13 ] { { myprintf::w1#1 = myprintf::w1#7 main::u#18 } { myprintf::w2#1 = myprintf::w2#8 main::v#12 } { myprintf::w3#1 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [15] (word~) main::$21 ← (word)*((const nomodify byte*) TIMELO) [ main::u#18 main::v#12 main::$13 main::$21 ] ( [ main::u#18 main::v#12 main::$13 main::$21 ] { { myprintf::w1#1 = myprintf::w1#7 main::u#18 } { myprintf::w2#1 = myprintf::w2#8 main::v#12 } { myprintf::w3#1 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [16] (word) myprintf::w3#1 ← (word~) main::$13 + (word~) main::$21 [ main::u#18 main::v#12 myprintf::w3#1 ] ( [ main::u#18 main::v#12 myprintf::w3#1 ] { { myprintf::w1#1 = myprintf::w1#7 main::u#18 } { myprintf::w2#1 = myprintf::w2#8 main::v#12 } { myprintf::w3#1 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [13] (word~) main::$16 ← (word)*((const nomodify byte*) TIMEHI) [ main::u#18 main::v#12 main::$16 ] ( [ main::u#18 main::v#12 main::$16 ] { { myprintf::w1#1 = myprintf::w1#7 main::u#18 } { myprintf::w2#1 = myprintf::w2#8 main::v#12 } { myprintf::w3#1 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [14] (word~) main::$10 ← (word~) main::$16 << (byte) 8 [ main::u#18 main::v#12 main::$10 ] ( [ main::u#18 main::v#12 main::$10 ] { { myprintf::w1#1 = myprintf::w1#7 main::u#18 } { myprintf::w2#1 = myprintf::w2#8 main::v#12 } { myprintf::w3#1 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [15] (word~) main::$17 ← (word)*((const nomodify byte*) TIMELO) [ main::u#18 main::v#12 main::$10 main::$17 ] ( [ main::u#18 main::v#12 main::$10 main::$17 ] { { myprintf::w1#1 = myprintf::w1#7 main::u#18 } { myprintf::w2#1 = myprintf::w2#8 main::v#12 } { myprintf::w3#1 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [16] (word) myprintf::w3#1 ← (word~) main::$10 + (word~) main::$17 [ main::u#18 main::v#12 myprintf::w3#1 ] ( [ main::u#18 main::v#12 myprintf::w3#1 ] { { myprintf::w1#1 = myprintf::w1#7 main::u#18 } { myprintf::w2#1 = myprintf::w2#8 main::v#12 } { myprintf::w3#1 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [17] (word) myprintf::w1#1 ← (word) main::u#18 [ main::u#18 main::v#12 myprintf::w3#1 myprintf::w1#1 ] ( [ main::u#18 main::v#12 myprintf::w3#1 myprintf::w1#1 ] { { myprintf::w1#1 = myprintf::w1#7 main::u#18 } { myprintf::w2#1 = myprintf::w2#8 main::v#12 } { myprintf::w3#1 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [18] (word) myprintf::w2#1 ← (word) main::v#12 [ main::u#18 main::v#12 myprintf::w3#1 myprintf::w1#1 myprintf::w2#1 ] ( [ main::u#18 main::v#12 myprintf::w3#1 myprintf::w1#1 myprintf::w2#1 ] { { myprintf::w1#1 = myprintf::w1#7 main::u#18 } { myprintf::w2#1 = myprintf::w2#8 main::v#12 } { myprintf::w3#1 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [22] (word) main::u#4 ← (word) main::u#18 - (word) $4d2 [ main::u#4 main::v#12 ] ( [ main::u#4 main::v#12 ] { } ) always clobbers reg byte a
@ -5924,10 +5924,10 @@ Statement [29] *((const nomodify byte*) TIMEHI) ← (byte) 0 [ main::u#16 main::
Statement [30] *((const nomodify byte*) TIMELO) ← (byte) 0 [ main::u#16 main::v#13 ] ( [ main::u#16 main::v#13 ] { } ) always clobbers reg byte a
Statement [31] *((const nomodify byte*) zp2) ← (byte) 0 [ main::u#16 main::v#13 ] ( [ main::u#16 main::v#13 ] { } ) always clobbers reg byte a
Statement [33] if(*((const nomodify byte*) zp2)<(byte) $c8) goto main::@5 [ main::u#16 main::v#11 ] ( [ main::u#16 main::v#11 ] { } ) always clobbers reg byte a
Statement [34] (word~) main::$18 ← (word)*((const nomodify byte*) TIMEHI) [ main::u#16 main::v#11 main::$18 ] ( [ main::u#16 main::v#11 main::$18 ] { { myprintf::w1#0 = myprintf::w1#7 main::u#16 } { myprintf::w2#0 = myprintf::w2#8 main::v#11 } { myprintf::w3#0 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [35] (word~) main::$4 ← (word~) main::$18 << (byte) 8 [ main::u#16 main::v#11 main::$4 ] ( [ main::u#16 main::v#11 main::$4 ] { { myprintf::w1#0 = myprintf::w1#7 main::u#16 } { myprintf::w2#0 = myprintf::w2#8 main::v#11 } { myprintf::w3#0 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [36] (word~) main::$19 ← (word)*((const nomodify byte*) TIMELO) [ main::u#16 main::v#11 main::$4 main::$19 ] ( [ main::u#16 main::v#11 main::$4 main::$19 ] { { myprintf::w1#0 = myprintf::w1#7 main::u#16 } { myprintf::w2#0 = myprintf::w2#8 main::v#11 } { myprintf::w3#0 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [37] (word) myprintf::w3#0 ← (word~) main::$4 + (word~) main::$19 [ main::u#16 main::v#11 myprintf::w3#0 ] ( [ main::u#16 main::v#11 myprintf::w3#0 ] { { myprintf::w1#0 = myprintf::w1#7 main::u#16 } { myprintf::w2#0 = myprintf::w2#8 main::v#11 } { myprintf::w3#0 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [34] (word~) main::$14 ← (word)*((const nomodify byte*) TIMEHI) [ main::u#16 main::v#11 main::$14 ] ( [ main::u#16 main::v#11 main::$14 ] { { myprintf::w1#0 = myprintf::w1#7 main::u#16 } { myprintf::w2#0 = myprintf::w2#8 main::v#11 } { myprintf::w3#0 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [35] (word~) main::$3 ← (word~) main::$14 << (byte) 8 [ main::u#16 main::v#11 main::$3 ] ( [ main::u#16 main::v#11 main::$3 ] { { myprintf::w1#0 = myprintf::w1#7 main::u#16 } { myprintf::w2#0 = myprintf::w2#8 main::v#11 } { myprintf::w3#0 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [36] (word~) main::$15 ← (word)*((const nomodify byte*) TIMELO) [ main::u#16 main::v#11 main::$3 main::$15 ] ( [ main::u#16 main::v#11 main::$3 main::$15 ] { { myprintf::w1#0 = myprintf::w1#7 main::u#16 } { myprintf::w2#0 = myprintf::w2#8 main::v#11 } { myprintf::w3#0 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [37] (word) myprintf::w3#0 ← (word~) main::$3 + (word~) main::$15 [ main::u#16 main::v#11 myprintf::w3#0 ] ( [ main::u#16 main::v#11 myprintf::w3#0 ] { { myprintf::w1#0 = myprintf::w1#7 main::u#16 } { myprintf::w2#0 = myprintf::w2#8 main::v#11 } { myprintf::w3#0 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [38] (word) myprintf::w1#0 ← (word) main::u#16 [ main::u#16 main::v#11 myprintf::w3#0 myprintf::w1#0 ] ( [ main::u#16 main::v#11 myprintf::w3#0 myprintf::w1#0 ] { { myprintf::w1#0 = myprintf::w1#7 main::u#16 } { myprintf::w2#0 = myprintf::w2#8 main::v#11 } { myprintf::w3#0 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [39] (word) myprintf::w2#0 ← (word) main::v#11 [ main::u#16 main::v#11 myprintf::w3#0 myprintf::w1#0 myprintf::w2#0 ] ( [ main::u#16 main::v#11 myprintf::w3#0 myprintf::w1#0 myprintf::w2#0 ] { { myprintf::w1#0 = myprintf::w1#7 main::u#16 } { myprintf::w2#0 = myprintf::w2#8 main::v#11 } { myprintf::w3#0 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [43] (word) main::u#3 ← (word) main::u#16 - (word) $4d2 [ main::u#3 main::v#11 ] ( [ main::u#3 main::v#11 ] { } ) always clobbers reg byte a
@ -6020,10 +6020,10 @@ Statement [8] *((const nomodify byte*) TIMEHI) ← (byte) 0 [ main::u#18 main::v
Statement [9] *((const nomodify byte*) TIMELO) ← (byte) 0 [ main::u#18 main::v#10 ] ( [ main::u#18 main::v#10 ] { } ) always clobbers reg byte a
Statement [10] *((const nomodify byte*) zp2) ← (byte) 0 [ main::u#18 main::v#10 ] ( [ main::u#18 main::v#10 ] { } ) always clobbers reg byte a
Statement [12] if(*((const nomodify byte*) zp2)<(byte) $c8) goto main::@10 [ main::u#18 main::v#12 ] ( [ main::u#18 main::v#12 ] { } ) always clobbers reg byte a
Statement [13] (word~) main::$20 ← (word)*((const nomodify byte*) TIMEHI) [ main::u#18 main::v#12 main::$20 ] ( [ main::u#18 main::v#12 main::$20 ] { { myprintf::w1#1 = myprintf::w1#7 main::u#18 } { myprintf::w2#1 = myprintf::w2#8 main::v#12 } { myprintf::w3#1 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [14] (word~) main::$13 ← (word~) main::$20 << (byte) 8 [ main::u#18 main::v#12 main::$13 ] ( [ main::u#18 main::v#12 main::$13 ] { { myprintf::w1#1 = myprintf::w1#7 main::u#18 } { myprintf::w2#1 = myprintf::w2#8 main::v#12 } { myprintf::w3#1 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [15] (word~) main::$21 ← (word)*((const nomodify byte*) TIMELO) [ main::u#18 main::v#12 main::$13 main::$21 ] ( [ main::u#18 main::v#12 main::$13 main::$21 ] { { myprintf::w1#1 = myprintf::w1#7 main::u#18 } { myprintf::w2#1 = myprintf::w2#8 main::v#12 } { myprintf::w3#1 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [16] (word) myprintf::w3#1 ← (word~) main::$13 + (word~) main::$21 [ main::u#18 main::v#12 myprintf::w3#1 ] ( [ main::u#18 main::v#12 myprintf::w3#1 ] { { myprintf::w1#1 = myprintf::w1#7 main::u#18 } { myprintf::w2#1 = myprintf::w2#8 main::v#12 } { myprintf::w3#1 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [13] (word~) main::$16 ← (word)*((const nomodify byte*) TIMEHI) [ main::u#18 main::v#12 main::$16 ] ( [ main::u#18 main::v#12 main::$16 ] { { myprintf::w1#1 = myprintf::w1#7 main::u#18 } { myprintf::w2#1 = myprintf::w2#8 main::v#12 } { myprintf::w3#1 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [14] (word~) main::$10 ← (word~) main::$16 << (byte) 8 [ main::u#18 main::v#12 main::$10 ] ( [ main::u#18 main::v#12 main::$10 ] { { myprintf::w1#1 = myprintf::w1#7 main::u#18 } { myprintf::w2#1 = myprintf::w2#8 main::v#12 } { myprintf::w3#1 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [15] (word~) main::$17 ← (word)*((const nomodify byte*) TIMELO) [ main::u#18 main::v#12 main::$10 main::$17 ] ( [ main::u#18 main::v#12 main::$10 main::$17 ] { { myprintf::w1#1 = myprintf::w1#7 main::u#18 } { myprintf::w2#1 = myprintf::w2#8 main::v#12 } { myprintf::w3#1 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [16] (word) myprintf::w3#1 ← (word~) main::$10 + (word~) main::$17 [ main::u#18 main::v#12 myprintf::w3#1 ] ( [ main::u#18 main::v#12 myprintf::w3#1 ] { { myprintf::w1#1 = myprintf::w1#7 main::u#18 } { myprintf::w2#1 = myprintf::w2#8 main::v#12 } { myprintf::w3#1 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [17] (word) myprintf::w1#1 ← (word) main::u#18 [ main::u#18 main::v#12 myprintf::w3#1 myprintf::w1#1 ] ( [ main::u#18 main::v#12 myprintf::w3#1 myprintf::w1#1 ] { { myprintf::w1#1 = myprintf::w1#7 main::u#18 } { myprintf::w2#1 = myprintf::w2#8 main::v#12 } { myprintf::w3#1 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [18] (word) myprintf::w2#1 ← (word) main::v#12 [ main::u#18 main::v#12 myprintf::w3#1 myprintf::w1#1 myprintf::w2#1 ] ( [ main::u#18 main::v#12 myprintf::w3#1 myprintf::w1#1 myprintf::w2#1 ] { { myprintf::w1#1 = myprintf::w1#7 main::u#18 } { myprintf::w2#1 = myprintf::w2#8 main::v#12 } { myprintf::w3#1 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [22] (word) main::u#4 ← (word) main::u#18 - (word) $4d2 [ main::u#4 main::v#12 ] ( [ main::u#4 main::v#12 ] { } ) always clobbers reg byte a
@ -6034,10 +6034,10 @@ Statement [29] *((const nomodify byte*) TIMEHI) ← (byte) 0 [ main::u#16 main::
Statement [30] *((const nomodify byte*) TIMELO) ← (byte) 0 [ main::u#16 main::v#13 ] ( [ main::u#16 main::v#13 ] { } ) always clobbers reg byte a
Statement [31] *((const nomodify byte*) zp2) ← (byte) 0 [ main::u#16 main::v#13 ] ( [ main::u#16 main::v#13 ] { } ) always clobbers reg byte a
Statement [33] if(*((const nomodify byte*) zp2)<(byte) $c8) goto main::@5 [ main::u#16 main::v#11 ] ( [ main::u#16 main::v#11 ] { } ) always clobbers reg byte a
Statement [34] (word~) main::$18 ← (word)*((const nomodify byte*) TIMEHI) [ main::u#16 main::v#11 main::$18 ] ( [ main::u#16 main::v#11 main::$18 ] { { myprintf::w1#0 = myprintf::w1#7 main::u#16 } { myprintf::w2#0 = myprintf::w2#8 main::v#11 } { myprintf::w3#0 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [35] (word~) main::$4 ← (word~) main::$18 << (byte) 8 [ main::u#16 main::v#11 main::$4 ] ( [ main::u#16 main::v#11 main::$4 ] { { myprintf::w1#0 = myprintf::w1#7 main::u#16 } { myprintf::w2#0 = myprintf::w2#8 main::v#11 } { myprintf::w3#0 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [36] (word~) main::$19 ← (word)*((const nomodify byte*) TIMELO) [ main::u#16 main::v#11 main::$4 main::$19 ] ( [ main::u#16 main::v#11 main::$4 main::$19 ] { { myprintf::w1#0 = myprintf::w1#7 main::u#16 } { myprintf::w2#0 = myprintf::w2#8 main::v#11 } { myprintf::w3#0 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [37] (word) myprintf::w3#0 ← (word~) main::$4 + (word~) main::$19 [ main::u#16 main::v#11 myprintf::w3#0 ] ( [ main::u#16 main::v#11 myprintf::w3#0 ] { { myprintf::w1#0 = myprintf::w1#7 main::u#16 } { myprintf::w2#0 = myprintf::w2#8 main::v#11 } { myprintf::w3#0 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [34] (word~) main::$14 ← (word)*((const nomodify byte*) TIMEHI) [ main::u#16 main::v#11 main::$14 ] ( [ main::u#16 main::v#11 main::$14 ] { { myprintf::w1#0 = myprintf::w1#7 main::u#16 } { myprintf::w2#0 = myprintf::w2#8 main::v#11 } { myprintf::w3#0 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [35] (word~) main::$3 ← (word~) main::$14 << (byte) 8 [ main::u#16 main::v#11 main::$3 ] ( [ main::u#16 main::v#11 main::$3 ] { { myprintf::w1#0 = myprintf::w1#7 main::u#16 } { myprintf::w2#0 = myprintf::w2#8 main::v#11 } { myprintf::w3#0 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [36] (word~) main::$15 ← (word)*((const nomodify byte*) TIMELO) [ main::u#16 main::v#11 main::$3 main::$15 ] ( [ main::u#16 main::v#11 main::$3 main::$15 ] { { myprintf::w1#0 = myprintf::w1#7 main::u#16 } { myprintf::w2#0 = myprintf::w2#8 main::v#11 } { myprintf::w3#0 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [37] (word) myprintf::w3#0 ← (word~) main::$3 + (word~) main::$15 [ main::u#16 main::v#11 myprintf::w3#0 ] ( [ main::u#16 main::v#11 myprintf::w3#0 ] { { myprintf::w1#0 = myprintf::w1#7 main::u#16 } { myprintf::w2#0 = myprintf::w2#8 main::v#11 } { myprintf::w3#0 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [38] (word) myprintf::w1#0 ← (word) main::u#16 [ main::u#16 main::v#11 myprintf::w3#0 myprintf::w1#0 ] ( [ main::u#16 main::v#11 myprintf::w3#0 myprintf::w1#0 ] { { myprintf::w1#0 = myprintf::w1#7 main::u#16 } { myprintf::w2#0 = myprintf::w2#8 main::v#11 } { myprintf::w3#0 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [39] (word) myprintf::w2#0 ← (word) main::v#11 [ main::u#16 main::v#11 myprintf::w3#0 myprintf::w1#0 myprintf::w2#0 ] ( [ main::u#16 main::v#11 myprintf::w3#0 myprintf::w1#0 myprintf::w2#0 ] { { myprintf::w1#0 = myprintf::w1#7 main::u#16 } { myprintf::w2#0 = myprintf::w2#8 main::v#11 } { myprintf::w3#0 = myprintf::w3#8 } } ) always clobbers reg byte a
Statement [43] (word) main::u#3 ← (word) main::u#16 - (word) $4d2 [ main::u#3 main::v#11 ] ( [ main::u#3 main::v#11 ] { } ) always clobbers reg byte a
@ -6134,14 +6134,14 @@ Potential registers zp[1]:41 [ divr16u::i#2 divr16u::i#1 ] : zp[1]:41 , reg byte
Potential registers zp[2]:42 [ append::dst#4 append::dst#1 append::dst#2 append::dst#3 ] : zp[2]:42 ,
Potential registers zp[2]:44 [ append::sub#6 ] : zp[2]:44 ,
Potential registers zp[2]:46 [ append::value#5 append::value#8 append::value#1 append::value#2 append::value#3 append::value#4 append::value#0 ] : zp[2]:46 ,
Potential registers zp[2]:48 [ main::$20 ] : zp[2]:48 ,
Potential registers zp[2]:50 [ main::$13 ] : zp[2]:50 ,
Potential registers zp[2]:52 [ main::$21 ] : zp[2]:52 ,
Potential registers zp[2]:48 [ main::$16 ] : zp[2]:48 ,
Potential registers zp[2]:50 [ main::$10 ] : zp[2]:50 ,
Potential registers zp[2]:52 [ main::$17 ] : zp[2]:52 ,
Potential registers zp[2]:54 [ div10::val#4 ] : zp[2]:54 ,
Potential registers zp[2]:56 [ div10::return#2 ] : zp[2]:56 ,
Potential registers zp[2]:58 [ main::$18 ] : zp[2]:58 ,
Potential registers zp[2]:60 [ main::$4 ] : zp[2]:60 ,
Potential registers zp[2]:62 [ main::$19 ] : zp[2]:62 ,
Potential registers zp[2]:58 [ main::$14 ] : zp[2]:58 ,
Potential registers zp[2]:60 [ main::$3 ] : zp[2]:60 ,
Potential registers zp[2]:62 [ main::$15 ] : zp[2]:62 ,
Potential registers zp[2]:64 [ div16u::dividend#0 ] : zp[2]:64 ,
Potential registers zp[2]:66 [ div16u::return#2 ] : zp[2]:66 ,
Potential registers zp[1]:68 [ myprintf::$56 ] : zp[1]:68 , reg byte a , reg byte x , reg byte y ,
@ -6180,7 +6180,7 @@ Uplift Scope [utoa] 1,178,345.42: zp[2]:31 [ utoa::value#12 utoa::value#3 utoa::
Uplift Scope [myprintf] 939,361.27: zp[1]:26 [ myprintf::bLen#32 myprintf::bLen#12 myprintf::bLen#10 myprintf::bLen#28 myprintf::bLen#36 myprintf::bLen#7 myprintf::bLen#3 myprintf::bLen#13 myprintf::bLen#14 myprintf::bLen#1 myprintf::bLen#4 myprintf::bLen#5 myprintf::bLen#6 ] 780,811.46: zp[1]:25 [ myprintf::bDigits#12 myprintf::bDigits#16 myprintf::bDigits#28 myprintf::bDigits#29 myprintf::bDigits#1 myprintf::bDigits#18 myprintf::bDigits#10 myprintf::bDigits#2 myprintf::bDigits#3 ] 300,003: zp[1]:27 [ myprintf::digit#3 myprintf::digit#2 ] 224,802.32: zp[1]:24 [ myprintf::b#17 myprintf::b#5 ] 116,041.01: zp[2]:18 [ myprintf::w#10 myprintf::w#18 myprintf::w#22 myprintf::w#53 myprintf::w#54 myprintf::w#55 ] 100,001: zp[1]:28 [ myprintf::$41 ] 62,506.25: zp[1]:29 [ myprintf::b#25 myprintf::b#1 myprintf::b#6 ] 56,221.84: zp[1]:17 [ myprintf::bArg#10 myprintf::bArg#11 myprintf::bArg#1 ] 28,752.88: zp[1]:16 [ myprintf::bFormat#10 myprintf::bFormat#5 ] 27,208.47: zp[1]:21 [ myprintf::bLeadZero#11 myprintf::bLeadZero#20 ] 26,032.01: zp[1]:20 [ myprintf::bTrailing#11 myprintf::bTrailing#24 ] 20,630.7: zp[2]:14 [ myprintf::str#10 myprintf::str#6 myprintf::str#0 ] 20,002: zp[1]:68 [ myprintf::$56 ] 20,002: zp[1]:69 [ myprintf::$18 ] 20,002: zp[1]:71 [ myprintf::$24 ] 20,002: zp[1]:73 [ myprintf::$57 ] 20,002: zp[1]:75 [ myprintf::$30 ] 10,001: zp[1]:22 [ myprintf::$23 ] 10,001: zp[1]:23 [ myprintf::$29 ] 7,500.75: zp[1]:70 [ myprintf::b#15 ] 7,500.75: zp[1]:74 [ myprintf::b#16 ] 3,750.38: zp[1]:72 [ myprintf::bLen#11 ] 172.5: zp[2]:10 [ myprintf::w2#8 myprintf::w2#1 myprintf::w2#0 ] 150.5: zp[2]:8 [ myprintf::w1#7 myprintf::w1#1 myprintf::w1#0 ] 143.17: zp[2]:12 [ myprintf::w3#8 myprintf::w3#1 myprintf::w3#0 ]
Uplift Scope [div10] 2,002: zp[2]:76 [ div10::$0 ] 2,002: zp[2]:80 [ div10::$2 ] 2,002: zp[2]:84 [ div10::$3 ] 2,002: zp[2]:88 [ div10::$4 ] 2,002: zp[2]:90 [ div10::val#3 ] 1,501.5: zp[2]:78 [ div10::val#0 ] 1,501.5: zp[2]:82 [ div10::val#1 ] 1,501.5: zp[2]:86 [ div10::val#2 ] 1,102: zp[2]:54 [ div10::val#4 ] 367.33: zp[2]:92 [ div10::return#0 ] 202: zp[2]:56 [ div10::return#2 ]
Uplift Scope [div16u] 1,102: zp[2]:64 [ div16u::dividend#0 ] 367.33: zp[2]:96 [ div16u::return#0 ] 202: zp[2]:66 [ div16u::return#2 ]
Uplift Scope [main] 231.42: zp[2]:6 [ main::v#10 main::v#12 main::v#13 main::v#11 main::v#2 main::v#1 ] 22: zp[2]:48 [ main::$20 ] 22: zp[2]:52 [ main::$21 ] 22: zp[2]:58 [ main::$18 ] 22: zp[2]:62 [ main::$19 ] 17.38: zp[2]:2 [ main::u#16 main::u#3 ] 17.38: zp[2]:4 [ main::u#18 main::u#4 ] 11: zp[2]:50 [ main::$13 ] 11: zp[2]:60 [ main::$4 ]
Uplift Scope [main] 231.42: zp[2]:6 [ main::v#10 main::v#12 main::v#13 main::v#11 main::v#2 main::v#1 ] 22: zp[2]:48 [ main::$16 ] 22: zp[2]:52 [ main::$17 ] 22: zp[2]:58 [ main::$14 ] 22: zp[2]:62 [ main::$15 ] 17.38: zp[2]:2 [ main::u#16 main::u#3 ] 17.38: zp[2]:4 [ main::u#18 main::u#4 ] 11: zp[2]:50 [ main::$10 ] 11: zp[2]:60 [ main::$3 ]
Uplift Scope [Print]
Uplift Scope []
@ -6189,7 +6189,7 @@ Uplifting [divr16u] best 469666 combination zp[2]:35 [ divr16u::rem#4 divr16u::r
Uplifting [utoa] best 469635 combination zp[2]:31 [ utoa::value#12 utoa::value#3 utoa::value#10 utoa::value#2 utoa::value#11 utoa::value#6 utoa::value#4 utoa::value#0 utoa::value#1 ] zp[2]:33 [ utoa::dst#12 utoa::dst#4 utoa::dst#13 utoa::dst#2 utoa::dst#10 utoa::dst#16 utoa::dst#1 ] reg byte x [ utoa::bStarted#7 utoa::bStarted#6 utoa::bStarted#5 ] reg byte a [ utoa::$21 ] reg byte a [ utoa::$16 ] zp[2]:100 [ utoa::dst#3 ]
Uplifting [div10] best 469635 combination zp[2]:76 [ div10::$0 ] zp[2]:80 [ div10::$2 ] zp[2]:84 [ div10::$3 ] zp[2]:88 [ div10::$4 ] zp[2]:90 [ div10::val#3 ] zp[2]:78 [ div10::val#0 ] zp[2]:82 [ div10::val#1 ] zp[2]:86 [ div10::val#2 ] zp[2]:54 [ div10::val#4 ] zp[2]:92 [ div10::return#0 ] zp[2]:56 [ div10::return#2 ]
Uplifting [div16u] best 469635 combination zp[2]:64 [ div16u::dividend#0 ] zp[2]:96 [ div16u::return#0 ] zp[2]:66 [ div16u::return#2 ]
Uplifting [main] best 469635 combination zp[2]:6 [ main::v#10 main::v#12 main::v#13 main::v#11 main::v#2 main::v#1 ] zp[2]:48 [ main::$20 ] zp[2]:52 [ main::$21 ] zp[2]:58 [ main::$18 ] zp[2]:62 [ main::$19 ] zp[2]:2 [ main::u#16 main::u#3 ] zp[2]:4 [ main::u#18 main::u#4 ] zp[2]:50 [ main::$13 ] zp[2]:60 [ main::$4 ]
Uplifting [main] best 469635 combination zp[2]:6 [ main::v#10 main::v#12 main::v#13 main::v#11 main::v#2 main::v#1 ] zp[2]:48 [ main::$16 ] zp[2]:52 [ main::$17 ] zp[2]:58 [ main::$14 ] zp[2]:62 [ main::$15 ] zp[2]:2 [ main::u#16 main::u#3 ] zp[2]:4 [ main::u#18 main::u#4 ] zp[2]:50 [ main::$10 ] zp[2]:60 [ main::$3 ]
Uplifting [Print] best 469635 combination
Uplifting [] best 469635 combination
Attempting to uplift remaining variables inzp[1]:26 [ myprintf::bLen#32 myprintf::bLen#12 myprintf::bLen#10 myprintf::bLen#28 myprintf::bLen#36 myprintf::bLen#7 myprintf::bLen#3 myprintf::bLen#13 myprintf::bLen#14 myprintf::bLen#1 myprintf::bLen#4 myprintf::bLen#5 myprintf::bLen#6 ]
@ -6240,8 +6240,8 @@ Coalescing zero page register [ zp[2]:2 [ main::u#16 main::u#3 myprintf::w1#7 my
Coalescing zero page register [ zp[2]:4 [ main::u#18 main::u#4 ] ] with [ zp[2]:54 [ div10::val#4 ] ] - score: 1
Coalescing zero page register [ zp[2]:6 [ main::v#10 main::v#12 main::v#13 main::v#11 main::v#2 main::v#1 myprintf::w2#8 myprintf::w2#1 myprintf::w2#0 ] ] with [ zp[2]:56 [ div10::return#2 ] ] - score: 1
Coalescing zero page register [ zp[2]:6 [ main::v#10 main::v#12 main::v#13 main::v#11 main::v#2 main::v#1 myprintf::w2#8 myprintf::w2#1 myprintf::w2#0 div10::return#2 ] ] with [ zp[2]:66 [ div16u::return#2 ] ] - score: 1
Coalescing zero page register [ zp[2]:12 [ myprintf::w3#8 myprintf::w3#1 myprintf::w3#0 ] ] with [ zp[2]:50 [ main::$13 ] ] - score: 1
Coalescing zero page register [ zp[2]:12 [ myprintf::w3#8 myprintf::w3#1 myprintf::w3#0 main::$13 ] ] with [ zp[2]:60 [ main::$4 ] ] - score: 1
Coalescing zero page register [ zp[2]:12 [ myprintf::w3#8 myprintf::w3#1 myprintf::w3#0 ] ] with [ zp[2]:50 [ main::$10 ] ] - score: 1
Coalescing zero page register [ zp[2]:12 [ myprintf::w3#8 myprintf::w3#1 myprintf::w3#0 main::$10 ] ] with [ zp[2]:60 [ main::$3 ] ] - score: 1
Coalescing zero page register [ zp[2]:31 [ utoa::value#12 utoa::value#3 utoa::value#10 utoa::value#2 utoa::value#11 utoa::value#6 utoa::value#4 utoa::value#0 utoa::value#1 append::value#5 append::value#8 append::value#1 append::value#2 append::value#3 append::value#4 append::value#0 ] ] with [ zp[2]:102 [ append::return#10 ] ] - score: 1
Coalescing zero page register [ zp[2]:31 [ utoa::value#12 utoa::value#3 utoa::value#10 utoa::value#2 utoa::value#11 utoa::value#6 utoa::value#4 utoa::value#0 utoa::value#1 append::value#5 append::value#8 append::value#1 append::value#2 append::value#3 append::value#4 append::value#0 append::return#10 ] ] with [ zp[2]:104 [ append::return#4 ] ] - score: 1
Coalescing zero page register [ zp[2]:31 [ utoa::value#12 utoa::value#3 utoa::value#10 utoa::value#2 utoa::value#11 utoa::value#6 utoa::value#4 utoa::value#0 utoa::value#1 append::value#5 append::value#8 append::value#1 append::value#2 append::value#3 append::value#4 append::value#0 append::return#10 append::return#4 ] ] with [ zp[2]:106 [ append::return#3 ] ] - score: 1
@ -6255,19 +6255,19 @@ Coalescing zero page register [ zp[2]:88 [ div10::$4 ] ] with [ zp[2]:90 [ div10
Coalescing zero page register [ zp[2]:2 [ main::u#16 main::u#3 myprintf::w1#7 myprintf::w1#1 myprintf::w1#0 div16u::dividend#0 ] ] with [ zp[2]:4 [ main::u#18 main::u#4 div10::val#4 ] ] - score: 1
Coalescing zero page register [ zp[2]:6 [ main::v#10 main::v#12 main::v#13 main::v#11 main::v#2 main::v#1 myprintf::w2#8 myprintf::w2#1 myprintf::w2#0 div10::return#2 div16u::return#2 ] ] with [ zp[2]:92 [ div10::return#0 ] ] - score: 1
Coalescing zero page register [ zp[2]:6 [ main::v#10 main::v#12 main::v#13 main::v#11 main::v#2 main::v#1 myprintf::w2#8 myprintf::w2#1 myprintf::w2#0 div10::return#2 div16u::return#2 div10::return#0 ] ] with [ zp[2]:96 [ div16u::return#0 ] ] - score: 1
Coalescing zero page register [ zp[2]:12 [ myprintf::w3#8 myprintf::w3#1 myprintf::w3#0 main::$13 main::$4 ] ] with [ zp[2]:48 [ main::$20 ] ] - score: 1
Coalescing zero page register [ zp[2]:12 [ myprintf::w3#8 myprintf::w3#1 myprintf::w3#0 main::$13 main::$4 main::$20 ] ] with [ zp[2]:58 [ main::$18 ] ] - score: 1
Coalescing zero page register [ zp[2]:12 [ myprintf::w3#8 myprintf::w3#1 myprintf::w3#0 main::$10 main::$3 ] ] with [ zp[2]:48 [ main::$16 ] ] - score: 1
Coalescing zero page register [ zp[2]:12 [ myprintf::w3#8 myprintf::w3#1 myprintf::w3#0 main::$10 main::$3 main::$16 ] ] with [ zp[2]:58 [ main::$14 ] ] - score: 1
Coalescing zero page register [ zp[2]:6 [ main::v#10 main::v#12 main::v#13 main::v#11 main::v#2 main::v#1 myprintf::w2#8 myprintf::w2#1 myprintf::w2#0 div10::return#2 div16u::return#2 div10::return#0 div16u::return#0 ] ] with [ zp[2]:39 [ divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 ] ] - score: 1
Coalescing zero page register [ zp[2]:6 [ main::v#10 main::v#12 main::v#13 main::v#11 main::v#2 main::v#1 myprintf::w2#8 myprintf::w2#1 myprintf::w2#0 div10::return#2 div16u::return#2 div10::return#0 div16u::return#0 divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 ] ] with [ zp[2]:88 [ div10::$4 div10::val#3 ] ] - score: 1
Coalescing zero page register [ zp[2]:35 [ divr16u::rem#4 divr16u::rem#9 divr16u::rem#5 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 ] ] with [ zp[2]:14 [ myprintf::str#10 myprintf::str#6 myprintf::str#0 ] ]
Coalescing zero page register [ zp[2]:37 [ divr16u::dividend#2 divr16u::dividend#1 divr16u::dividend#0 ] ] with [ zp[2]:18 [ myprintf::w#10 myprintf::w#18 myprintf::w#22 myprintf::w#53 myprintf::w#54 myprintf::w#55 ] ]
Coalescing zero page register [ zp[2]:52 [ main::$21 ] ] with [ zp[2]:31 [ utoa::value#12 utoa::value#3 utoa::value#10 utoa::value#2 utoa::value#11 utoa::value#6 utoa::value#4 utoa::value#0 utoa::value#1 append::value#5 append::value#8 append::value#1 append::value#2 append::value#3 append::value#4 append::value#0 append::return#10 append::return#4 append::return#3 append::return#2 ] ]
Coalescing zero page register [ zp[2]:62 [ main::$19 ] ] with [ zp[2]:33 [ utoa::dst#12 utoa::dst#4 utoa::dst#13 utoa::dst#2 utoa::dst#10 utoa::dst#16 utoa::dst#1 append::dst#4 append::dst#1 append::dst#2 append::dst#3 utoa::dst#3 ] ]
Coalescing zero page register [ zp[2]:52 [ main::$17 ] ] with [ zp[2]:31 [ utoa::value#12 utoa::value#3 utoa::value#10 utoa::value#2 utoa::value#11 utoa::value#6 utoa::value#4 utoa::value#0 utoa::value#1 append::value#5 append::value#8 append::value#1 append::value#2 append::value#3 append::value#4 append::value#0 append::return#10 append::return#4 append::return#3 append::return#2 ] ]
Coalescing zero page register [ zp[2]:62 [ main::$15 ] ] with [ zp[2]:33 [ utoa::dst#12 utoa::dst#4 utoa::dst#13 utoa::dst#2 utoa::dst#10 utoa::dst#16 utoa::dst#1 append::dst#4 append::dst#1 append::dst#2 append::dst#3 utoa::dst#3 ] ]
Coalescing zero page register [ zp[2]:76 [ div10::$0 div10::val#0 ] ] with [ zp[2]:44 [ append::sub#6 ] ]
Coalescing zero page register [ zp[2]:80 [ div10::$2 div10::val#1 ] ] with [ zp[2]:35 [ divr16u::rem#4 divr16u::rem#9 divr16u::rem#5 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 myprintf::str#10 myprintf::str#6 myprintf::str#0 ] ]
Coalescing zero page register [ zp[2]:84 [ div10::$3 div10::val#2 ] ] with [ zp[2]:37 [ divr16u::dividend#2 divr16u::dividend#1 divr16u::dividend#0 myprintf::w#10 myprintf::w#18 myprintf::w#22 myprintf::w#53 myprintf::w#54 myprintf::w#55 ] ]
Allocated (was zp[2]:6) zp[2]:4 [ main::v#10 main::v#12 main::v#13 main::v#11 main::v#2 main::v#1 myprintf::w2#8 myprintf::w2#1 myprintf::w2#0 div10::return#2 div16u::return#2 div10::return#0 div16u::return#0 divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 div10::$4 div10::val#3 ]
Allocated (was zp[2]:12) zp[2]:6 [ myprintf::w3#8 myprintf::w3#1 myprintf::w3#0 main::$13 main::$4 main::$20 main::$18 ]
Allocated (was zp[2]:12) zp[2]:6 [ myprintf::w3#8 myprintf::w3#1 myprintf::w3#0 main::$10 main::$3 main::$16 main::$14 ]
Allocated (was zp[1]:16) zp[1]:8 [ myprintf::bFormat#10 myprintf::bFormat#5 ]
Allocated (was zp[1]:17) zp[1]:9 [ myprintf::bArg#10 myprintf::bArg#11 myprintf::bArg#1 ]
Allocated (was zp[1]:20) zp[1]:10 [ myprintf::bTrailing#11 myprintf::bTrailing#24 ]
@ -6275,8 +6275,8 @@ Allocated (was zp[1]:21) zp[1]:11 [ myprintf::bLeadZero#11 myprintf::bLeadZero#2
Allocated (was zp[1]:24) zp[1]:12 [ myprintf::b#17 myprintf::b#5 ]
Allocated (was zp[1]:25) zp[1]:13 [ myprintf::bDigits#12 myprintf::bDigits#16 myprintf::bDigits#28 myprintf::bDigits#29 myprintf::bDigits#1 myprintf::bDigits#18 myprintf::bDigits#10 myprintf::bDigits#2 myprintf::bDigits#3 ]
Allocated (was zp[1]:26) zp[1]:14 [ myprintf::bLen#32 myprintf::bLen#12 myprintf::bLen#10 myprintf::bLen#28 myprintf::bLen#36 myprintf::bLen#7 myprintf::bLen#3 myprintf::bLen#13 myprintf::bLen#14 myprintf::bLen#1 myprintf::bLen#4 myprintf::bLen#5 myprintf::bLen#6 ]
Allocated (was zp[2]:52) zp[2]:15 [ main::$21 utoa::value#12 utoa::value#3 utoa::value#10 utoa::value#2 utoa::value#11 utoa::value#6 utoa::value#4 utoa::value#0 utoa::value#1 append::value#5 append::value#8 append::value#1 append::value#2 append::value#3 append::value#4 append::value#0 append::return#10 append::return#4 append::return#3 append::return#2 ]
Allocated (was zp[2]:62) zp[2]:17 [ main::$19 utoa::dst#12 utoa::dst#4 utoa::dst#13 utoa::dst#2 utoa::dst#10 utoa::dst#16 utoa::dst#1 append::dst#4 append::dst#1 append::dst#2 append::dst#3 utoa::dst#3 ]
Allocated (was zp[2]:52) zp[2]:15 [ main::$17 utoa::value#12 utoa::value#3 utoa::value#10 utoa::value#2 utoa::value#11 utoa::value#6 utoa::value#4 utoa::value#0 utoa::value#1 append::value#5 append::value#8 append::value#1 append::value#2 append::value#3 append::value#4 append::value#0 append::return#10 append::return#4 append::return#3 append::return#2 ]
Allocated (was zp[2]:62) zp[2]:17 [ main::$15 utoa::dst#12 utoa::dst#4 utoa::dst#13 utoa::dst#2 utoa::dst#10 utoa::dst#16 utoa::dst#1 append::dst#4 append::dst#1 append::dst#2 append::dst#3 utoa::dst#3 ]
Allocated (was zp[2]:76) zp[2]:19 [ div10::$0 div10::val#0 append::sub#6 ]
Allocated (was zp[2]:80) zp[2]:21 [ div10::$2 div10::val#1 divr16u::rem#4 divr16u::rem#9 divr16u::rem#5 divr16u::rem#0 divr16u::rem#1 divr16u::rem#2 myprintf::str#10 myprintf::str#6 myprintf::str#0 ]
Allocated (was zp[2]:84) zp[2]:23 [ div10::$3 div10::val#2 divr16u::dividend#2 divr16u::dividend#1 divr16u::dividend#0 myprintf::w#10 myprintf::w#18 myprintf::w#22 myprintf::w#53 myprintf::w#54 myprintf::w#55 ]
@ -6299,12 +6299,12 @@ ASSEMBLER BEFORE OPTIMIZATION
.label VICBANK = $d018
// main
main: {
.label __4 = 6
.label __13 = 6
.label __18 = 6
.label __19 = $11
.label __20 = 6
.label __21 = $f
.label __3 = 6
.label __10 = 6
.label __14 = 6
.label __15 = $11
.label __16 = 6
.label __17 = $f
.label v = 4
// test performance of 'div16u(10)'
// test performance of 'div10'
@ -6385,28 +6385,28 @@ main: {
jmp __b11
// main::@11
__b11:
// [13] (word~) main::$20 ← (word)*((const nomodify byte*) TIMEHI) -- vwuz1=_word__deref_pbuc1
// [13] (word~) main::$16 ← (word)*((const nomodify byte*) TIMEHI) -- vwuz1=_word__deref_pbuc1
lda TIMEHI
sta.z __20
sta.z __16
lda #0
sta.z __20+1
// [14] (word~) main::$13 ← (word~) main::$20 << (byte) 8 -- vwuz1=vwuz1_rol_8
lda.z __13
sta.z __13+1
sta.z __16+1
// [14] (word~) main::$10 ← (word~) main::$16 << (byte) 8 -- vwuz1=vwuz1_rol_8
lda.z __10
sta.z __10+1
lda #0
sta.z __13
// [15] (word~) main::$21 ← (word)*((const nomodify byte*) TIMELO) -- vwuz1=_word__deref_pbuc1
sta.z __10
// [15] (word~) main::$17 ← (word)*((const nomodify byte*) TIMELO) -- vwuz1=_word__deref_pbuc1
lda TIMELO
sta.z __21
sta.z __17
lda #0
sta.z __21+1
// [16] (word) myprintf::w3#1 ← (word~) main::$13 + (word~) main::$21 -- vwuz1=vwuz1_plus_vwuz2
sta.z __17+1
// [16] (word) myprintf::w3#1 ← (word~) main::$10 + (word~) main::$17 -- vwuz1=vwuz1_plus_vwuz2
lda.z myprintf.w3
clc
adc.z __21
adc.z __17
sta.z myprintf.w3
lda.z myprintf.w3+1
adc.z __21+1
adc.z __17+1
sta.z myprintf.w3+1
// [17] (word) myprintf::w1#1 ← (word) main::u#18
// [18] (word) myprintf::w2#1 ← (word) main::v#12
@ -6485,28 +6485,28 @@ main: {
jmp __b6
// main::@6
__b6:
// [34] (word~) main::$18 ← (word)*((const nomodify byte*) TIMEHI) -- vwuz1=_word__deref_pbuc1
// [34] (word~) main::$14 ← (word)*((const nomodify byte*) TIMEHI) -- vwuz1=_word__deref_pbuc1
lda TIMEHI
sta.z __18
sta.z __14
lda #0
sta.z __18+1
// [35] (word~) main::$4 ← (word~) main::$18 << (byte) 8 -- vwuz1=vwuz1_rol_8
lda.z __4
sta.z __4+1
sta.z __14+1
// [35] (word~) main::$3 ← (word~) main::$14 << (byte) 8 -- vwuz1=vwuz1_rol_8
lda.z __3
sta.z __3+1
lda #0
sta.z __4
// [36] (word~) main::$19 ← (word)*((const nomodify byte*) TIMELO) -- vwuz1=_word__deref_pbuc1
sta.z __3
// [36] (word~) main::$15 ← (word)*((const nomodify byte*) TIMELO) -- vwuz1=_word__deref_pbuc1
lda TIMELO
sta.z __19
sta.z __15
lda #0
sta.z __19+1
// [37] (word) myprintf::w3#0 ← (word~) main::$4 + (word~) main::$19 -- vwuz1=vwuz1_plus_vwuz2
sta.z __15+1
// [37] (word) myprintf::w3#0 ← (word~) main::$3 + (word~) main::$15 -- vwuz1=vwuz1_plus_vwuz2
lda.z myprintf.w3
clc
adc.z __19
adc.z __15
sta.z myprintf.w3
lda.z myprintf.w3+1
adc.z __19+1
adc.z __15+1
sta.z myprintf.w3+1
// [38] (word) myprintf::w1#0 ← (word) main::u#16
// [39] (word) myprintf::w2#0 ← (word) main::v#11
@ -8039,12 +8039,12 @@ FINAL SYMBOL TABLE
(word) divr16u::return#0 return zp[2]:4 6000200.8
(word) divr16u::return#2 return zp[2]:4 2002.0
(signed word()) main()
(word~) main::$13 zp[2]:6 11.0
(word~) main::$18 zp[2]:6 22.0
(word~) main::$19 zp[2]:17 22.0
(word~) main::$20 zp[2]:6 22.0
(word~) main::$21 zp[2]:15 22.0
(word~) main::$4 zp[2]:6 11.0
(word~) main::$10 zp[2]:6 11.0
(word~) main::$14 zp[2]:6 22.0
(word~) main::$15 zp[2]:17 22.0
(word~) main::$16 zp[2]:6 22.0
(word~) main::$17 zp[2]:15 22.0
(word~) main::$3 zp[2]:6 11.0
(label) main::@1
(label) main::@10
(label) main::@11
@ -8259,7 +8259,7 @@ FINAL SYMBOL TABLE
zp[2]:2 [ main::u#16 main::u#3 myprintf::w1#7 myprintf::w1#1 myprintf::w1#0 div16u::dividend#0 main::u#18 main::u#4 div10::val#4 ]
zp[2]:4 [ main::v#10 main::v#12 main::v#13 main::v#11 main::v#2 main::v#1 myprintf::w2#8 myprintf::w2#1 myprintf::w2#0 div10::return#2 div16u::return#2 div10::return#0 div16u::return#0 divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 div10::$4 div10::val#3 ]
zp[2]:6 [ myprintf::w3#8 myprintf::w3#1 myprintf::w3#0 main::$13 main::$4 main::$20 main::$18 ]
zp[2]:6 [ myprintf::w3#8 myprintf::w3#1 myprintf::w3#0 main::$10 main::$3 main::$16 main::$14 ]
zp[1]:8 [ myprintf::bFormat#10 myprintf::bFormat#5 ]
zp[1]:9 [ myprintf::bArg#10 myprintf::bArg#11 myprintf::bArg#1 ]
zp[1]:10 [ myprintf::bTrailing#11 myprintf::bTrailing#24 ]
@ -8274,8 +8274,8 @@ reg byte a [ myprintf::$41 ]
reg byte x [ myprintf::b#25 myprintf::b#1 myprintf::b#6 ]
reg byte x [ utoa::bStarted#7 utoa::bStarted#6 utoa::bStarted#5 ]
reg byte x [ divr16u::i#2 divr16u::i#1 ]
zp[2]:15 [ main::$21 utoa::value#12 utoa::value#3 utoa::value#10 utoa::value#2 utoa::value#11 utoa::value#6 utoa::value#4 utoa::value#0 utoa::value#1 append::value#5 append::value#8 append::value#1 append::value#2 append::value#3 append::value#4 append::value#0 append::return#10 append::return#4 append::return#3 append::return#2 ]
zp[2]:17 [ main::$19 utoa::dst#12 utoa::dst#4 utoa::dst#13 utoa::dst#2 utoa::dst#10 utoa::dst#16 utoa::dst#1 append::dst#4 append::dst#1 append::dst#2 append::dst#3 utoa::dst#3 ]
zp[2]:15 [ main::$17 utoa::value#12 utoa::value#3 utoa::value#10 utoa::value#2 utoa::value#11 utoa::value#6 utoa::value#4 utoa::value#0 utoa::value#1 append::value#5 append::value#8 append::value#1 append::value#2 append::value#3 append::value#4 append::value#0 append::return#10 append::return#4 append::return#3 append::return#2 ]
zp[2]:17 [ main::$15 utoa::dst#12 utoa::dst#4 utoa::dst#13 utoa::dst#2 utoa::dst#10 utoa::dst#16 utoa::dst#1 append::dst#4 append::dst#1 append::dst#2 append::dst#3 utoa::dst#3 ]
reg byte a [ myprintf::$56 ]
reg byte a [ myprintf::$18 ]
reg byte x [ myprintf::b#15 ]
@ -8313,12 +8313,12 @@ Score: 361442
.label VICBANK = $d018
// main
main: {
.label __4 = 6
.label __13 = 6
.label __18 = 6
.label __19 = $11
.label __20 = 6
.label __21 = $f
.label __3 = 6
.label __10 = 6
.label __14 = 6
.label __15 = $11
.label __16 = 6
.label __17 = $f
.label v = 4
// test performance of 'div16u(10)'
// test performance of 'div10'
@ -8393,30 +8393,30 @@ main: {
bcc __b10
// main::@11
// (word)*TIMEHI << 8
// [13] (word~) main::$20 ← (word)*((const nomodify byte*) TIMEHI) -- vwuz1=_word__deref_pbuc1
// [13] (word~) main::$16 ← (word)*((const nomodify byte*) TIMEHI) -- vwuz1=_word__deref_pbuc1
lda TIMEHI
sta.z __20
sta.z __16
lda #0
sta.z __20+1
// [14] (word~) main::$13 ← (word~) main::$20 << (byte) 8 -- vwuz1=vwuz1_rol_8
lda.z __13
sta.z __13+1
sta.z __16+1
// [14] (word~) main::$10 ← (word~) main::$16 << (byte) 8 -- vwuz1=vwuz1_rol_8
lda.z __10
sta.z __10+1
lda #0
sta.z __13
sta.z __10
// ((word)*TIMEHI << 8) + (word)*TIMELO
// [15] (word~) main::$21 ← (word)*((const nomodify byte*) TIMELO) -- vwuz1=_word__deref_pbuc1
// [15] (word~) main::$17 ← (word)*((const nomodify byte*) TIMELO) -- vwuz1=_word__deref_pbuc1
lda TIMELO
sta.z __21
sta.z __17
lda #0
sta.z __21+1
sta.z __17+1
// myprintf(strTemp, "200 DIV10 : %5d,%4d IN %04d FRAMESm", u, v, ((word)*TIMEHI << 8) + (word)*TIMELO)
// [16] (word) myprintf::w3#1 ← (word~) main::$13 + (word~) main::$21 -- vwuz1=vwuz1_plus_vwuz2
// [16] (word) myprintf::w3#1 ← (word~) main::$10 + (word~) main::$17 -- vwuz1=vwuz1_plus_vwuz2
lda.z myprintf.w3
clc
adc.z __21
adc.z __17
sta.z myprintf.w3
lda.z myprintf.w3+1
adc.z __21+1
adc.z __17+1
sta.z myprintf.w3+1
// [17] (word) myprintf::w1#1 ← (word) main::u#18
// [18] (word) myprintf::w2#1 ← (word) main::v#12
@ -8490,30 +8490,30 @@ main: {
bcc __b5
// main::@6
// (word)*TIMEHI << 8
// [34] (word~) main::$18 ← (word)*((const nomodify byte*) TIMEHI) -- vwuz1=_word__deref_pbuc1
// [34] (word~) main::$14 ← (word)*((const nomodify byte*) TIMEHI) -- vwuz1=_word__deref_pbuc1
lda TIMEHI
sta.z __18
sta.z __14
lda #0
sta.z __18+1
// [35] (word~) main::$4 ← (word~) main::$18 << (byte) 8 -- vwuz1=vwuz1_rol_8
lda.z __4
sta.z __4+1
sta.z __14+1
// [35] (word~) main::$3 ← (word~) main::$14 << (byte) 8 -- vwuz1=vwuz1_rol_8
lda.z __3
sta.z __3+1
lda #0
sta.z __4
sta.z __3
// ((word)*TIMEHI << 8) + (word)*TIMELO
// [36] (word~) main::$19 ← (word)*((const nomodify byte*) TIMELO) -- vwuz1=_word__deref_pbuc1
// [36] (word~) main::$15 ← (word)*((const nomodify byte*) TIMELO) -- vwuz1=_word__deref_pbuc1
lda TIMELO
sta.z __19
sta.z __15
lda #0
sta.z __19+1
sta.z __15+1
// myprintf(strTemp, "200 DIV16U: %5d,%4d IN %04d FRAMESm", u, v, ((word)*TIMEHI << 8) + (word)*TIMELO)
// [37] (word) myprintf::w3#0 ← (word~) main::$4 + (word~) main::$19 -- vwuz1=vwuz1_plus_vwuz2
// [37] (word) myprintf::w3#0 ← (word~) main::$3 + (word~) main::$15 -- vwuz1=vwuz1_plus_vwuz2
lda.z myprintf.w3
clc
adc.z __19
adc.z __15
sta.z myprintf.w3
lda.z myprintf.w3+1
adc.z __19+1
adc.z __15+1
sta.z myprintf.w3+1
// [38] (word) myprintf::w1#0 ← (word) main::u#16
// [39] (word) myprintf::w2#0 ← (word) main::v#11

View File

@ -84,12 +84,12 @@
(word) divr16u::return#0 return zp[2]:4 6000200.8
(word) divr16u::return#2 return zp[2]:4 2002.0
(signed word()) main()
(word~) main::$13 zp[2]:6 11.0
(word~) main::$18 zp[2]:6 22.0
(word~) main::$19 zp[2]:17 22.0
(word~) main::$20 zp[2]:6 22.0
(word~) main::$21 zp[2]:15 22.0
(word~) main::$4 zp[2]:6 11.0
(word~) main::$10 zp[2]:6 11.0
(word~) main::$14 zp[2]:6 22.0
(word~) main::$15 zp[2]:17 22.0
(word~) main::$16 zp[2]:6 22.0
(word~) main::$17 zp[2]:15 22.0
(word~) main::$3 zp[2]:6 11.0
(label) main::@1
(label) main::@10
(label) main::@11
@ -304,7 +304,7 @@
zp[2]:2 [ main::u#16 main::u#3 myprintf::w1#7 myprintf::w1#1 myprintf::w1#0 div16u::dividend#0 main::u#18 main::u#4 div10::val#4 ]
zp[2]:4 [ main::v#10 main::v#12 main::v#13 main::v#11 main::v#2 main::v#1 myprintf::w2#8 myprintf::w2#1 myprintf::w2#0 div10::return#2 div16u::return#2 div10::return#0 div16u::return#0 divr16u::quotient#3 divr16u::return#0 divr16u::quotient#1 divr16u::quotient#2 divr16u::return#2 div10::$4 div10::val#3 ]
zp[2]:6 [ myprintf::w3#8 myprintf::w3#1 myprintf::w3#0 main::$13 main::$4 main::$20 main::$18 ]
zp[2]:6 [ myprintf::w3#8 myprintf::w3#1 myprintf::w3#0 main::$10 main::$3 main::$16 main::$14 ]
zp[1]:8 [ myprintf::bFormat#10 myprintf::bFormat#5 ]
zp[1]:9 [ myprintf::bArg#10 myprintf::bArg#11 myprintf::bArg#1 ]
zp[1]:10 [ myprintf::bTrailing#11 myprintf::bTrailing#24 ]
@ -319,8 +319,8 @@ reg byte a [ myprintf::$41 ]
reg byte x [ myprintf::b#25 myprintf::b#1 myprintf::b#6 ]
reg byte x [ utoa::bStarted#7 utoa::bStarted#6 utoa::bStarted#5 ]
reg byte x [ divr16u::i#2 divr16u::i#1 ]
zp[2]:15 [ main::$21 utoa::value#12 utoa::value#3 utoa::value#10 utoa::value#2 utoa::value#11 utoa::value#6 utoa::value#4 utoa::value#0 utoa::value#1 append::value#5 append::value#8 append::value#1 append::value#2 append::value#3 append::value#4 append::value#0 append::return#10 append::return#4 append::return#3 append::return#2 ]
zp[2]:17 [ main::$19 utoa::dst#12 utoa::dst#4 utoa::dst#13 utoa::dst#2 utoa::dst#10 utoa::dst#16 utoa::dst#1 append::dst#4 append::dst#1 append::dst#2 append::dst#3 utoa::dst#3 ]
zp[2]:15 [ main::$17 utoa::value#12 utoa::value#3 utoa::value#10 utoa::value#2 utoa::value#11 utoa::value#6 utoa::value#4 utoa::value#0 utoa::value#1 append::value#5 append::value#8 append::value#1 append::value#2 append::value#3 append::value#4 append::value#0 append::return#10 append::return#4 append::return#3 append::return#2 ]
zp[2]:17 [ main::$15 utoa::dst#12 utoa::dst#4 utoa::dst#13 utoa::dst#2 utoa::dst#10 utoa::dst#16 utoa::dst#1 append::dst#4 append::dst#1 append::dst#2 append::dst#3 utoa::dst#3 ]
reg byte a [ myprintf::$56 ]
reg byte a [ myprintf::$18 ]
reg byte x [ myprintf::b#15 ]

View File

@ -212,10 +212,9 @@ printf_uint: {
cputs: {
.label s = $b
__b1:
// c=*s++
// while(c=*s++)
ldy #0
lda (s),y
// while(c=*s++)
inc.z s
bne !+
inc.z s+1

View File

@ -736,9 +736,10 @@ cputs: scope:[cputs] from main::@4 main::@6 main::@8 printf_number_buffer::@5
cputs::@1: scope:[cputs] from cputs cputs::@3
(to_nomodify byte*) cputs::s#5 ← phi( cputs/(to_nomodify byte*) cputs::s#6 cputs::@3/(to_nomodify byte*) cputs::s#7 )
(byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#5)
(byte~) cputs::$0 ← (byte) cputs::c#1
(to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#5
(bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
if((bool~) cputs::$1) goto cputs::@2
(bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
if((bool~) cputs::$2) goto cputs::@2
to:cputs::@return
cputs::@2: scope:[cputs] from cputs::@1
(to_nomodify byte*) cputs::s#8 ← phi( cputs::@1/(to_nomodify byte*) cputs::s#0 )
@ -1430,7 +1431,8 @@ SYMBOL TABLE SSA
(label) cputln::@1
(label) cputln::@return
(void()) cputs((to_nomodify byte*) cputs::s)
(bool~) cputs::$1
(byte~) cputs::$0
(bool~) cputs::$2
(label) cputs::@1
(label) cputs::@2
(label) cputs::@3
@ -2408,7 +2410,7 @@ Adding number conversion cast (unumber) $28 in (byte*) conio_line_text ← (byte
Adding number conversion cast (unumber) $28 in (byte*) conio_line_color ← (byte*) conio_line_color - (number) $28
Adding number conversion cast (unumber) 0 in (byte) gotoxy::x#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) gotoxy::y#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
Adding number conversion cast (unumber) 0 in (bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
Adding number conversion cast (unumber) 0 in (bool~) printf_uint::$5 ← (number) 0 != (byte) printf_uint::format_sign_always#1
Adding number conversion cast (unumber) printf_uint::$2 in (byte) printf_uint::format_upper_case#2 ← phi( printf_uint::@1/(byte) printf_uint::format_upper_case#3 printf_uint::@2/(byte) printf_uint::format_upper_case#4 )
(byte) printf_uint::format_zero_padding#2 ← phi( printf_uint::@1/(byte) printf_uint::format_zero_padding#3 printf_uint::@2/(byte) printf_uint::format_zero_padding#4 )
@ -2628,14 +2630,14 @@ Inversing boolean not [269] (bool~) gotoxy::$1 ← (byte) gotoxy::y#2 <= (byte)
Inversing boolean not [273] (bool~) gotoxy::$3 ← (byte) gotoxy::x#2 < (byte) $28 from [272] (bool~) gotoxy::$2 ← (byte) gotoxy::x#2 >= (byte) $28
Inversing boolean not [299] (bool~) cputc::$2 ← (byte) conio_cursor_x != (byte) $28 from [298] (bool~) cputc::$1 ← (byte) conio_cursor_x == (byte) $28
Inversing boolean not [310] (bool~) cscroll::$1 ← (byte) conio_cursor_y != (byte) $19 from [309] (bool~) cscroll::$0 ← (byte) conio_cursor_y == (byte) $19
Inversing boolean not [415] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#2 from [414] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#2
Inversing boolean not [419] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#2 from [418] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#2
Inversing boolean not [421] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#2 from [420] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#2
Inversing boolean not [434] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [433] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2
Inversing boolean not [441] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [440] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [449] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#3 from [448] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#3
Inversing boolean not [466] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#2 from [465] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#2
Inversing boolean not [478] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#4 from [477] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#4
Inversing boolean not [416] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#2 from [415] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#2
Inversing boolean not [420] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#2 from [419] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#2
Inversing boolean not [422] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#2 from [421] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#2
Inversing boolean not [435] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [434] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2
Inversing boolean not [442] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [441] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [450] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#3 from [449] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#3
Inversing boolean not [467] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#2 from [466] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#2
Inversing boolean not [479] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#4 from [478] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#4
Successful SSA optimization Pass2UnaryNotSimplification
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
@ -2705,7 +2707,7 @@ Alias gotoxy::x#4 = gotoxy::x#5
Alias gotoxy::line_offset#0 = gotoxy::$4
Alias gotoxy::y#4 = gotoxy::y#5
Alias cputc::c#3 = cputc::c#4
Alias cputs::c#1 = cputs::c#2
Alias cputs::c#1 = cputs::$0 cputs::c#2
Alias cputs::s#0 = cputs::s#8 cputs::s#7
Alias printf_padding::pad#3 = printf_padding::pad#4 printf_padding::pad#6
Alias printf_padding::i#2 = printf_padding::i#4 printf_padding::i#3
@ -2900,7 +2902,7 @@ Simple Condition (bool~) cputc::$0 [217] if((byte) cputc::c#3==(byte) '
Simple Condition (bool~) cputc::$2 [223] if((byte) conio_cursor_x!=(byte) $28) goto cputc::@return
Simple Condition (bool~) cscroll::$1 [233] if((byte) conio_cursor_y!=(byte) $19) goto cscroll::@return
Simple Condition (bool~) cscroll::$7 [235] if((byte) 0!=(byte) conio_scroll_enable) goto cscroll::@3
Simple Condition (bool~) cputs::$1 [269] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) cputs::$2 [269] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) printf_padding::$0 [277] if((byte) printf_padding::i#2<(byte) printf_padding::length#4) goto printf_padding::@2
Simple Condition (bool~) printf_uint::$5 [284] if((byte) 0!=(byte) printf_uint::format_sign_always#0) goto printf_uint::@1
Simple Condition (bool~) printf_uchar::$5 [305] if((byte) 0!=(byte) printf_uchar::format_sign_always#2) goto printf_uchar::@1
@ -9322,11 +9324,10 @@ cputs: {
// [51] phi (to_nomodify byte*) cputs::s#5 = (to_nomodify byte*) cputs::s#6 [phi:cputs/cputs::@2->cputs::@1#0] -- register_copy
// cputs::@1
__b1:
// c=*s++
// while(c=*s++)
// [52] (byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#5) -- vbuaa=_deref_pbuz1
ldy #0
lda (s),y
// while(c=*s++)
// [53] (to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#5 -- pbuz1=_inc_pbuz1
inc.z s
bne !+

View File

@ -172,10 +172,9 @@ printf_uchar: {
cputs: {
.label s = 3
__b1:
// c=*s++
// while(c=*s++)
ldy #0
lda (s),y
// while(c=*s++)
inc.z s
bne !+
inc.z s+1

View File

@ -556,9 +556,10 @@ cputs: scope:[cputs] from main::@4 main::@6 printf_number_buffer::@5
cputs::@1: scope:[cputs] from cputs cputs::@3
(to_nomodify byte*) cputs::s#4 ← phi( cputs/(to_nomodify byte*) cputs::s#5 cputs::@3/(to_nomodify byte*) cputs::s#6 )
(byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#4)
(byte~) cputs::$0 ← (byte) cputs::c#1
(to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#4
(bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
if((bool~) cputs::$1) goto cputs::@2
(bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
if((bool~) cputs::$2) goto cputs::@2
to:cputs::@return
cputs::@2: scope:[cputs] from cputs::@1
(to_nomodify byte*) cputs::s#7 ← phi( cputs::@1/(to_nomodify byte*) cputs::s#0 )
@ -1144,7 +1145,8 @@ SYMBOL TABLE SSA
(label) cputln::@1
(label) cputln::@return
(void()) cputs((to_nomodify byte*) cputs::s)
(bool~) cputs::$1
(byte~) cputs::$0
(bool~) cputs::$2
(label) cputs::@1
(label) cputs::@2
(label) cputs::@3
@ -1872,7 +1874,7 @@ Adding number conversion cast (unumber) $28 in (byte*) conio_line_text ← (byte
Adding number conversion cast (unumber) $28 in (byte*) conio_line_color ← (byte*) conio_line_color - (number) $28
Adding number conversion cast (unumber) 0 in (byte) gotoxy::x#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) gotoxy::y#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
Adding number conversion cast (unumber) 0 in (bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
Adding number conversion cast (unumber) 0 in (bool~) printf_uchar::$5 ← (number) 0 != (byte) printf_uchar::format_sign_always#2
Adding number conversion cast (unumber) printf_uchar::$2 in (byte) printf_uchar::format_upper_case#3 ← phi( printf_uchar::@1/(byte) printf_uchar::format_upper_case#4 printf_uchar::@2/(byte) printf_uchar::format_upper_case#5 )
(byte) printf_uchar::format_zero_padding#3 ← phi( printf_uchar::@1/(byte) printf_uchar::format_zero_padding#4 printf_uchar::@2/(byte) printf_uchar::format_zero_padding#5 )
@ -2043,14 +2045,14 @@ Inversing boolean not [188] (bool~) gotoxy::$1 ← (byte) gotoxy::y#2 <= (byte)
Inversing boolean not [192] (bool~) gotoxy::$3 ← (byte) gotoxy::x#2 < (byte) $28 from [191] (bool~) gotoxy::$2 ← (byte) gotoxy::x#2 >= (byte) $28
Inversing boolean not [218] (bool~) cputc::$2 ← (byte) conio_cursor_x != (byte) $28 from [217] (bool~) cputc::$1 ← (byte) conio_cursor_x == (byte) $28
Inversing boolean not [229] (bool~) cscroll::$1 ← (byte) conio_cursor_y != (byte) $19 from [228] (bool~) cscroll::$0 ← (byte) conio_cursor_y == (byte) $19
Inversing boolean not [310] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#1 from [309] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#1
Inversing boolean not [314] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#1 from [313] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#1
Inversing boolean not [316] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#1 from [315] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#1
Inversing boolean not [329] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#1 from [328] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#1
Inversing boolean not [336] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [335] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [344] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [343] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2
Inversing boolean not [361] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#1 from [360] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#1
Inversing boolean not [373] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#3 from [372] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#3
Inversing boolean not [311] (bool~) printf_number_buffer::$0 ← (byte) 0 == (byte) printf_number_buffer::format_min_length#1 from [310] (bool~) printf_number_buffer::$26 ← (byte) 0 != (byte) printf_number_buffer::format_min_length#1
Inversing boolean not [315] (bool~) printf_number_buffer::$1 ← (byte) 0 == (byte) printf_number_buffer::format_justify_left#1 from [314] (bool~) printf_number_buffer::$27 ← (byte) 0 != (byte) printf_number_buffer::format_justify_left#1
Inversing boolean not [317] (bool~) printf_number_buffer::$2 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#1 from [316] (bool~) printf_number_buffer::$28 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#1
Inversing boolean not [330] (bool~) printf_number_buffer::$20 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#1 from [329] (bool~) printf_number_buffer::$29 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#1
Inversing boolean not [337] (bool~) printf_number_buffer::$23 ← (signed byte) printf_number_buffer::padding#1 >= (signed byte) 0 from [336] (bool~) printf_number_buffer::$22 ← (signed byte) printf_number_buffer::padding#1 < (signed byte) 0
Inversing boolean not [345] (bool~) printf_number_buffer::$7 ← (byte) 0 == (byte) printf_number_buffer::buffer_sign#2 from [344] (bool~) printf_number_buffer::$30 ← (byte) 0 != (byte) printf_number_buffer::buffer_sign#2
Inversing boolean not [362] (bool~) printf_number_buffer::$12 ← (byte) 0 == (byte) printf_number_buffer::format_upper_case#1 from [361] (bool~) printf_number_buffer::$31 ← (byte) 0 != (byte) printf_number_buffer::format_upper_case#1
Inversing boolean not [374] (bool~) printf_number_buffer::$14 ← (byte) 0 == (byte) printf_number_buffer::format_zero_padding#3 from [373] (bool~) printf_number_buffer::$32 ← (byte) 0 != (byte) printf_number_buffer::format_zero_padding#3
Successful SSA optimization Pass2UnaryNotSimplification
Alias candidate removed (volatile)conio_line_text = gotoxy::$5
Alias candidate removed (volatile)conio_line_color = gotoxy::$6
@ -2104,7 +2106,7 @@ Alias gotoxy::x#4 = gotoxy::x#5
Alias gotoxy::line_offset#0 = gotoxy::$4
Alias gotoxy::y#4 = gotoxy::y#5
Alias cputc::c#3 = cputc::c#4
Alias cputs::c#1 = cputs::c#2
Alias cputs::c#1 = cputs::$0 cputs::c#2
Alias cputs::s#0 = cputs::s#7 cputs::s#6
Alias printf_padding::pad#3 = printf_padding::pad#4 printf_padding::pad#6
Alias printf_padding::i#2 = printf_padding::i#4 printf_padding::i#3
@ -2256,7 +2258,7 @@ Simple Condition (bool~) cputc::$0 [154] if((byte) cputc::c#3==(byte) '
Simple Condition (bool~) cputc::$2 [160] if((byte) conio_cursor_x!=(byte) $28) goto cputc::@return
Simple Condition (bool~) cscroll::$1 [170] if((byte) conio_cursor_y!=(byte) $19) goto cscroll::@return
Simple Condition (bool~) cscroll::$7 [172] if((byte) 0!=(byte) conio_scroll_enable) goto cscroll::@3
Simple Condition (bool~) cputs::$1 [206] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) cputs::$2 [206] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) printf_padding::$0 [214] if((byte) printf_padding::i#2<(byte) printf_padding::length#4) goto printf_padding::@2
Simple Condition (bool~) printf_uchar::$5 [221] if((byte) 0!=(byte) printf_uchar::format_sign_always#2) goto printf_uchar::@1
Simple Condition (bool~) printf_number_buffer::$0 [243] if((byte) 0==(byte) printf_number_buffer::format_min_length#0) goto printf_number_buffer::@1
@ -6238,11 +6240,10 @@ cputs: {
// [46] phi (to_nomodify byte*) cputs::s#4 = (to_nomodify byte*) cputs::s#5 [phi:cputs/cputs::@2->cputs::@1#0] -- register_copy
// cputs::@1
__b1:
// c=*s++
// while(c=*s++)
// [47] (byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#4) -- vbuaa=_deref_pbuz1
ldy #0
lda (s),y
// while(c=*s++)
// [48] (to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#4 -- pbuz1=_inc_pbuz1
inc.z s
bne !+

View File

@ -241,10 +241,9 @@ cputs: {
lda #>tod_buffer
sta.z s+1
__b1:
// c=*s++
// while(c=*s++)
ldy #0
lda (s),y
// while(c=*s++)
inc.z s
bne !+
inc.z s+1

View File

@ -234,9 +234,10 @@ cputs: scope:[cputs] from main::@6
cputs::@1: scope:[cputs] from cputs cputs::@3
(to_nomodify byte*) cputs::s#2 ← phi( cputs/(to_nomodify byte*) cputs::s#3 cputs::@3/(to_nomodify byte*) cputs::s#4 )
(byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#2)
(byte~) cputs::$0 ← (byte) cputs::c#1
(to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#2
(bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
if((bool~) cputs::$1) goto cputs::@2
(bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
if((bool~) cputs::$2) goto cputs::@2
to:cputs::@return
cputs::@2: scope:[cputs] from cputs::@1
(to_nomodify byte*) cputs::s#5 ← phi( cputs::@1/(to_nomodify byte*) cputs::s#0 )
@ -545,7 +546,8 @@ SYMBOL TABLE SSA
(label) cputln::@1
(label) cputln::@return
(void()) cputs((to_nomodify byte*) cputs::s)
(bool~) cputs::$1
(byte~) cputs::$0
(bool~) cputs::$2
(label) cputs::@1
(label) cputs::@2
(label) cputs::@3
@ -836,7 +838,7 @@ Adding number conversion cast (unumber) $28 in (byte*) conio_line_text ← (byte
Adding number conversion cast (unumber) $28 in (byte*) conio_line_color ← (byte*) conio_line_color - (number) $28
Adding number conversion cast (unumber) 0 in (byte) gotoxy::x#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) gotoxy::y#1 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) cputs::$1 ← (number) 0 != (byte) cputs::c#1
Adding number conversion cast (unumber) 0 in (bool~) cputs::$2 ← (number) 0 != (byte~) cputs::$0
Adding number conversion cast (unumber) $80 in *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) | (number) $80
Adding number conversion cast (unumber) $7f in *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) & (number) $7f
Adding number conversion cast (unumber) 4 in (byte~) tod_str::$0 ← (byte) tod_str::tod_HOURS#1 >> (number) 4
@ -1007,7 +1009,7 @@ Alias gotoxy::x#5 = gotoxy::x#6
Alias gotoxy::line_offset#0 = gotoxy::$4
Alias gotoxy::y#5 = gotoxy::y#6
Alias cputc::c#1 = cputc::c#2
Alias cputs::c#1 = cputs::c#2
Alias cputs::c#1 = cputs::$0 cputs::c#2
Alias cputs::s#0 = cputs::s#5 cputs::s#4
Alias tod_read::return_TENTHS#0 = tod_read::tod_TENTHS#0 tod_read::tenths#0 tod_read::return_TENTHS#3 tod_read::return_TENTHS#1
Alias tod_read::return_SEC#0 = tod_read::tod_SEC#0 tod_read::secs#0 tod_read::return_SEC#3 tod_read::return_SEC#1
@ -1060,7 +1062,7 @@ Simple Condition (bool~) cputc::$0 [45] if((byte) cputc::c#0==(byte) '
Simple Condition (bool~) cputc::$2 [51] if((byte) conio_cursor_x!=(byte) $28) goto cputc::@return
Simple Condition (bool~) cscroll::$1 [61] if((byte) conio_cursor_y!=(byte) $19) goto cscroll::@return
Simple Condition (bool~) cscroll::$7 [63] if((byte) 0!=(byte) conio_scroll_enable) goto cscroll::@3
Simple Condition (bool~) cputs::$1 [97] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) cputs::$2 [97] if((byte) 0!=(byte) cputs::c#1) goto cputs::@2
Simple Condition (bool~) main::$5 [149] if((number) 0!=(number) 1) goto main::@2
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [66] (word) memcpy::num#0 ← (unumber)(number) $19*(number) $28-(number) $28
@ -4259,11 +4261,10 @@ cputs: {
sta.z s+1
// cputs::@1
__b1:
// c=*s++
// while(c=*s++)
// [73] (byte) cputs::c#1 ← *((to_nomodify byte*) cputs::s#2) -- vbuaa=_deref_pbuz1
ldy #0
lda (s),y
// while(c=*s++)
// [74] (to_nomodify byte*) cputs::s#0 ← ++ (to_nomodify byte*) cputs::s#2 -- pbuz1=_inc_pbuz1
inc.z s
bne !+