mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-04-11 04:37:29 +00:00
Implemented function pointer types in standard C syntax. #121
This commit is contained in:
parent
9c006cf015
commit
d1b7d45372
@ -19787,3 +19787,56 @@ sta {z1}
|
||||
lda #>{c1}
|
||||
adc #0
|
||||
sta {z1}+1
|
||||
//FRAGMENT vbuz1=vbuz2_band_pbuz3_derefidx_vbuc1
|
||||
lda {z2}
|
||||
ldy #{c1}
|
||||
and ({z3}),y
|
||||
sta {z1}
|
||||
//FRAGMENT vbuz1=vbuaa_band_pbuz2_derefidx_vbuc1
|
||||
ldy #{c1}
|
||||
and ({z2}),y
|
||||
sta {z1}
|
||||
//FRAGMENT vbuz1=vbuyy_band_pbuz2_derefidx_vbuc1
|
||||
tya
|
||||
ldy #{c1}
|
||||
and ({z2}),y
|
||||
sta {z1}
|
||||
//FRAGMENT vbuaa=vbuz1_band_pbuz2_derefidx_vbuc1
|
||||
lda {z1}
|
||||
ldy #{c1}
|
||||
and ({z2}),y
|
||||
//FRAGMENT vbuaa=vbuaa_band_pbuz1_derefidx_vbuc1
|
||||
ldy #{c1}
|
||||
and ({z1}),y
|
||||
//FRAGMENT vbuaa=vbuyy_band_pbuz1_derefidx_vbuc1
|
||||
tya
|
||||
ldy #{c1}
|
||||
and ({z1}),y
|
||||
//FRAGMENT vbuxx=vbuz1_band_pbuz2_derefidx_vbuc1
|
||||
lda {z1}
|
||||
ldy #{c1}
|
||||
and ({z2}),y
|
||||
tax
|
||||
//FRAGMENT vbuxx=vbuaa_band_pbuz1_derefidx_vbuc1
|
||||
ldy #{c1}
|
||||
and ({z1}),y
|
||||
tax
|
||||
//FRAGMENT vbuxx=vbuyy_band_pbuz1_derefidx_vbuc1
|
||||
tya
|
||||
ldy #{c1}
|
||||
and ({z1}),y
|
||||
tax
|
||||
//FRAGMENT vbuyy=vbuz1_band_pbuz2_derefidx_vbuc1
|
||||
lda {z1}
|
||||
ldy #{c1}
|
||||
and ({z2}),y
|
||||
tay
|
||||
//FRAGMENT vbuyy=vbuaa_band_pbuz1_derefidx_vbuc1
|
||||
ldy #{c1}
|
||||
and ({z1}),y
|
||||
tay
|
||||
//FRAGMENT vbuyy=vbuyy_band_pbuz1_derefidx_vbuc1
|
||||
tya
|
||||
ldy #{c1}
|
||||
and ({z1}),y
|
||||
tay
|
||||
|
@ -144,23 +144,15 @@ public class StatementSource implements Serializable {
|
||||
}
|
||||
|
||||
public static StatementSource procedureDecl(KickCParser.DeclFunctionContext ctx) {
|
||||
ParseTree nodeStart = ctx;
|
||||
ParseTree nodeStop = ctx.getChild(ctx.getChildCount() - 2);
|
||||
return new StatementSource(nodeStart, nodeStop);
|
||||
return new StatementSource(ctx.getChild(0), ctx.getChild(1));
|
||||
}
|
||||
|
||||
public static StatementSource procedureBegin(KickCParser.DeclFunctionContext ctx) {
|
||||
final KickCParser.DeclFunctionBodyContext bodyCtx = ctx.declFunctionBody();
|
||||
ParseTree nodeStart = bodyCtx;
|
||||
ParseTree nodeStop = bodyCtx.getChild(bodyCtx.getChildCount() - 4);
|
||||
return new StatementSource(nodeStart, nodeStop);
|
||||
return new StatementSource(ctx.getChild(0), ctx.getChild(2));
|
||||
}
|
||||
|
||||
public static StatementSource procedureEnd(KickCParser.DeclFunctionContext ctx) {
|
||||
final KickCParser.DeclFunctionBodyContext bodyCtx = ctx.declFunctionBody();
|
||||
ParseTree nodeStart = bodyCtx.getChild(bodyCtx.getChildCount() - 1);
|
||||
ParseTree nodeStop = bodyCtx;
|
||||
return new StatementSource(nodeStart, nodeStop);
|
||||
return new StatementSource(ctx.getChild(4), ctx.getChild(4));
|
||||
}
|
||||
|
||||
public static StatementSource asm(KickCParser.StmtAsmContext ctx) {
|
||||
|
@ -8,13 +8,16 @@ import dk.camelot64.kickc.model.values.ProcedureRef;
|
||||
import dk.camelot64.kickc.passes.Pass1ByteXIntrinsicRewrite;
|
||||
import dk.camelot64.kickc.passes.Pass1PrintfIntrinsicRewrite;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Symbol describing a procedure/function */
|
||||
public class Procedure extends Scope {
|
||||
|
||||
/** The return type. {@link SymbolType#VOID} if the procedure does not return a value. */
|
||||
private final SymbolType returnType;
|
||||
private final SymbolTypeProcedure procedureType;
|
||||
/** The names of the parameters of the procedure. */
|
||||
private List<String> parameterNames;
|
||||
/** True if the parameter list ends with a variable length parameter list "..." */
|
||||
@ -78,9 +81,9 @@ public class Procedure extends Scope {
|
||||
/** The calling convention used for this procedure. */
|
||||
private CallingConvention callingConvention;
|
||||
|
||||
public Procedure(String name, SymbolType returnType, Scope parentScope, String codeSegment, String dataSegment, CallingConvention callingConvention) {
|
||||
public Procedure(String name, SymbolTypeProcedure procedureType, Scope parentScope, String codeSegment, String dataSegment, CallingConvention callingConvention) {
|
||||
super(name, parentScope, dataSegment);
|
||||
this.returnType = returnType;
|
||||
this.procedureType = procedureType;
|
||||
this.declaredInline = false;
|
||||
this.interruptType = null;
|
||||
this.comments = new ArrayList<>();
|
||||
@ -127,7 +130,7 @@ public class Procedure extends Scope {
|
||||
}
|
||||
|
||||
public SymbolType getReturnType() {
|
||||
return returnType;
|
||||
return procedureType.getReturnType();
|
||||
}
|
||||
|
||||
public List<Variable> getParameters() {
|
||||
@ -172,7 +175,7 @@ public class Procedure extends Scope {
|
||||
|
||||
@Override
|
||||
public SymbolType getType() {
|
||||
return new SymbolTypeProcedure(returnType);
|
||||
return procedureType;
|
||||
}
|
||||
|
||||
public boolean isDeclaredInline() {
|
||||
@ -245,7 +248,7 @@ public class Procedure extends Scope {
|
||||
if(interruptType != null) {
|
||||
res.append("__interrupt(").append(interruptType).append(") ");
|
||||
}
|
||||
res.append(returnType.getTypeName()).append(" ").append(getFullName()).append("(");
|
||||
res.append(getReturnType().getTypeName()).append(" ").append(getFullName()).append("(");
|
||||
boolean first = true;
|
||||
if(parameterNames != null) {
|
||||
for(Variable parameter : getParameters()) {
|
||||
@ -271,18 +274,22 @@ public class Procedure extends Scope {
|
||||
if(o == null || getClass() != o.getClass()) return false;
|
||||
if(!super.equals(o)) return false;
|
||||
Procedure procedure = (Procedure) o;
|
||||
return declaredInline == procedure.declaredInline &&
|
||||
Objects.equals(returnType, procedure.returnType) &&
|
||||
return variableLengthParameterList == procedure.variableLengthParameterList &&
|
||||
declaredInline == procedure.declaredInline &&
|
||||
declaredIntrinsic == procedure.declaredIntrinsic &&
|
||||
isConstructor == procedure.isConstructor &&
|
||||
Objects.equals(procedureType, procedure.procedureType) &&
|
||||
Objects.equals(parameterNames, procedure.parameterNames) &&
|
||||
Objects.equals(interruptType, procedure.interruptType) &&
|
||||
Objects.equals(comments, procedure.comments) &&
|
||||
Objects.equals(reservedZps, procedure.reservedZps) &&
|
||||
Objects.equals(codeSegment, procedure.codeSegment) &&
|
||||
Objects.equals(constructorRefs, procedure.constructorRefs) &&
|
||||
callingConvention == procedure.callingConvention;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(super.hashCode(), returnType, parameterNames, declaredInline, interruptType, comments, reservedZps, codeSegment, callingConvention);
|
||||
return Objects.hash(super.hashCode(), procedureType, parameterNames, variableLengthParameterList, declaredInline, declaredIntrinsic, interruptType, comments, reservedZps, codeSegment, constructorRefs, isConstructor, callingConvention);
|
||||
}
|
||||
}
|
||||
|
@ -45,6 +45,8 @@ public interface SymbolType extends Serializable {
|
||||
SymbolTypeNamed LABEL = new SymbolTypeNamed("label", 1, false, false);
|
||||
/** Void type representing no value. */
|
||||
SymbolTypeNamed VOID = new SymbolTypeNamed("void", 0, false, false);
|
||||
/** Value List type representing a "..." parameter list. */
|
||||
SymbolTypeNamed PARAM_LIST = new SymbolTypeNamed("param_list", 0, false, false);
|
||||
/** An unresolved type. Will be infered later. */
|
||||
SymbolTypeNamed VAR = new SymbolTypeNamed("var", -1, false, false);
|
||||
|
||||
|
@ -259,9 +259,7 @@ public class SymbolTypeConversion {
|
||||
public static boolean procedureDeclarationMatch(Procedure first, Procedure second) {
|
||||
if(!first.getFullName().equals(second.getFullName()))
|
||||
return false;
|
||||
if(!first.getReturnType().equals(second.getReturnType()))
|
||||
return false;
|
||||
if(!first.getParameters().equals(second.getParameters()))
|
||||
if(!first.getType().equals(second.getType()))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
@ -1,14 +1,17 @@
|
||||
package dk.camelot64.kickc.model.types;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/** A function returning another type */
|
||||
public class SymbolTypeProcedure implements SymbolType {
|
||||
|
||||
private SymbolType returnType;
|
||||
private List<SymbolType> paramTypes;
|
||||
|
||||
public SymbolTypeProcedure(SymbolType returnType) {
|
||||
public SymbolTypeProcedure(SymbolType returnType, List<SymbolType> paramTypes) {
|
||||
this.returnType = returnType;
|
||||
this.paramTypes = paramTypes;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -35,9 +38,28 @@ public class SymbolTypeProcedure implements SymbolType {
|
||||
return returnType;
|
||||
}
|
||||
|
||||
public List<SymbolType> getParamTypes() {
|
||||
return paramTypes;
|
||||
}
|
||||
|
||||
public void setParamTypes(List<SymbolType> paramTypes) {
|
||||
this.paramTypes = paramTypes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTypeBaseName() {
|
||||
return returnType.getTypeName() + "()";
|
||||
final StringBuilder typeBaseName = new StringBuilder();
|
||||
typeBaseName.append(returnType.getTypeBaseName());
|
||||
typeBaseName.append("(");
|
||||
boolean first = true;
|
||||
for(SymbolType paramType : paramTypes) {
|
||||
if(!first)
|
||||
typeBaseName.append(",");
|
||||
first = false;
|
||||
typeBaseName.append(paramType.getTypeBaseName());
|
||||
}
|
||||
typeBaseName.append(")");
|
||||
return typeBaseName.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -50,11 +72,13 @@ public class SymbolTypeProcedure implements SymbolType {
|
||||
if(this == o) return true;
|
||||
if(o == null || getClass() != o.getClass()) return false;
|
||||
SymbolTypeProcedure that = (SymbolTypeProcedure) o;
|
||||
return Objects.equals(returnType, that.returnType);
|
||||
return Objects.equals(returnType, that.returnType) &&
|
||||
Objects.equals(paramTypes, that.paramTypes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(returnType);
|
||||
return Objects.hash(returnType, paramTypes);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package dk.camelot64.kickc.parser;
|
||||
|
||||
import dk.camelot64.kickc.Compiler;
|
||||
import dk.camelot64.kickc.SourceLoader;
|
||||
import dk.camelot64.kickc.model.Comment;
|
||||
import dk.camelot64.kickc.model.CompileError;
|
||||
import dk.camelot64.kickc.model.Program;
|
||||
import dk.camelot64.kickc.model.TargetPlatform;
|
||||
@ -97,7 +98,8 @@ public class CParser {
|
||||
int charPositionInLine,
|
||||
String msg,
|
||||
RecognitionException e) {
|
||||
StatementSource source = new StatementSource(recognizer.getInputStream().getSourceName(), line, charPositionInLine, null, -1, -1);
|
||||
final CommonToken offendingToken = (CommonToken) offendingSymbol;
|
||||
StatementSource source = new StatementSource(offendingToken.getInputStream().getSourceName(), line, charPositionInLine, null, -1, -1);
|
||||
throw new CompileError("Error parsing file: " + msg, source);
|
||||
}
|
||||
});
|
||||
|
@ -72,6 +72,7 @@ typeSpecifier
|
||||
|
||||
declarator
|
||||
: NAME {if(isTypedef) { cParser.addTypedef($NAME.text); isTypedef=false; } } #declaratorName
|
||||
| declarator PAR_BEGIN parameterListDecl? PAR_END #declaratorProcedure
|
||||
| declarator BRACKET_BEGIN (expr)? BRACKET_END #declaratorArray
|
||||
| ASTERISK directive* declarator #declaratorPointer
|
||||
| PAR_BEGIN declarator PAR_END #declaratorPar
|
||||
@ -80,7 +81,6 @@ declarator
|
||||
type
|
||||
: SIMPLETYPE #typeSimple
|
||||
| SIGNEDNESS SIMPLETYPE? #typeSignedSimple
|
||||
| type PAR_BEGIN PAR_END #typeProcedure // TODO: Move to declarator
|
||||
| structDef #typeStructDef
|
||||
| structRef #typeStructRef
|
||||
| enumDef #typeEnumDef
|
||||
@ -118,11 +118,7 @@ enumMember
|
||||
;
|
||||
|
||||
declFunction
|
||||
: declType declarator PAR_BEGIN parameterListDecl? PAR_END (declFunctionBody | ';' )
|
||||
;
|
||||
|
||||
declFunctionBody
|
||||
: CURLY_BEGIN stmtSeq? CURLY_END
|
||||
: declType declarator CURLY_BEGIN stmtSeq? CURLY_END
|
||||
;
|
||||
|
||||
parameterListDecl
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -222,25 +222,13 @@ public class KickCParserBaseListener implements KickCParserListener {
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterTypeProcedure(KickCParser.TypeProcedureContext ctx) { }
|
||||
@Override public void enterDeclaratorProcedure(KickCParser.DeclaratorProcedureContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitTypeProcedure(KickCParser.TypeProcedureContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterTypeStructRef(KickCParser.TypeStructRefContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitTypeStructRef(KickCParser.TypeStructRefContext ctx) { }
|
||||
@Override public void exitDeclaratorProcedure(KickCParser.DeclaratorProcedureContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
@ -253,6 +241,18 @@ public class KickCParserBaseListener implements KickCParserListener {
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitTypeSimple(KickCParser.TypeSimpleContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterTypeSignedSimple(KickCParser.TypeSignedSimpleContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitTypeSignedSimple(KickCParser.TypeSignedSimpleContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
@ -270,25 +270,25 @@ public class KickCParserBaseListener implements KickCParserListener {
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterTypeNamedRef(KickCParser.TypeNamedRefContext ctx) { }
|
||||
@Override public void enterTypeStructRef(KickCParser.TypeStructRefContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitTypeNamedRef(KickCParser.TypeNamedRefContext ctx) { }
|
||||
@Override public void exitTypeStructRef(KickCParser.TypeStructRefContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterTypeSignedSimple(KickCParser.TypeSignedSimpleContext ctx) { }
|
||||
@Override public void enterTypeEnumDef(KickCParser.TypeEnumDefContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitTypeSignedSimple(KickCParser.TypeSignedSimpleContext ctx) { }
|
||||
@Override public void exitTypeEnumDef(KickCParser.TypeEnumDefContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
@ -306,13 +306,13 @@ public class KickCParserBaseListener implements KickCParserListener {
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterTypeEnumDef(KickCParser.TypeEnumDefContext ctx) { }
|
||||
@Override public void enterTypeNamedRef(KickCParser.TypeNamedRefContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitTypeEnumDef(KickCParser.TypeEnumDefContext ctx) { }
|
||||
@Override public void exitTypeNamedRef(KickCParser.TypeNamedRefContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
@ -409,18 +409,6 @@ public class KickCParserBaseListener implements KickCParserListener {
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitDeclFunction(KickCParser.DeclFunctionContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void enterDeclFunctionBody(KickCParser.DeclFunctionBodyContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation does nothing.</p>
|
||||
*/
|
||||
@Override public void exitDeclFunctionBody(KickCParser.DeclFunctionBodyContext ctx) { }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
|
@ -138,14 +138,7 @@ public class KickCParserBaseVisitor<T> extends AbstractParseTreeVisitor<T> imple
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitTypeProcedure(KickCParser.TypeProcedureContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitTypeStructRef(KickCParser.TypeStructRefContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitDeclaratorProcedure(KickCParser.DeclaratorProcedureContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
@ -153,6 +146,13 @@ public class KickCParserBaseVisitor<T> extends AbstractParseTreeVisitor<T> imple
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitTypeSimple(KickCParser.TypeSimpleContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitTypeSignedSimple(KickCParser.TypeSignedSimpleContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
@ -166,14 +166,14 @@ public class KickCParserBaseVisitor<T> extends AbstractParseTreeVisitor<T> imple
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitTypeNamedRef(KickCParser.TypeNamedRefContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitTypeStructRef(KickCParser.TypeStructRefContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitTypeSignedSimple(KickCParser.TypeSignedSimpleContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitTypeEnumDef(KickCParser.TypeEnumDefContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
@ -187,7 +187,7 @@ public class KickCParserBaseVisitor<T> extends AbstractParseTreeVisitor<T> imple
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitTypeEnumDef(KickCParser.TypeEnumDefContext ctx) { return visitChildren(ctx); }
|
||||
@Override public T visitTypeNamedRef(KickCParser.TypeNamedRefContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
@ -244,13 +244,6 @@ public class KickCParserBaseVisitor<T> extends AbstractParseTreeVisitor<T> imple
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitDeclFunction(KickCParser.DeclFunctionContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* <p>The default implementation returns the result of calling
|
||||
* {@link #visitChildren} on {@code ctx}.</p>
|
||||
*/
|
||||
@Override public T visitDeclFunctionBody(KickCParser.DeclFunctionBodyContext ctx) { return visitChildren(ctx); }
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
|
@ -198,29 +198,17 @@ public interface KickCParserListener extends ParseTreeListener {
|
||||
*/
|
||||
void exitDeclaratorName(KickCParser.DeclaratorNameContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by the {@code typeProcedure}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
* Enter a parse tree produced by the {@code declaratorProcedure}
|
||||
* labeled alternative in {@link KickCParser#declarator}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterTypeProcedure(KickCParser.TypeProcedureContext ctx);
|
||||
void enterDeclaratorProcedure(KickCParser.DeclaratorProcedureContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by the {@code typeProcedure}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
* Exit a parse tree produced by the {@code declaratorProcedure}
|
||||
* labeled alternative in {@link KickCParser#declarator}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitTypeProcedure(KickCParser.TypeProcedureContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by the {@code typeStructRef}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterTypeStructRef(KickCParser.TypeStructRefContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by the {@code typeStructRef}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitTypeStructRef(KickCParser.TypeStructRefContext ctx);
|
||||
void exitDeclaratorProcedure(KickCParser.DeclaratorProcedureContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by the {@code typeSimple}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
@ -233,6 +221,18 @@ public interface KickCParserListener extends ParseTreeListener {
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitTypeSimple(KickCParser.TypeSimpleContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by the {@code typeSignedSimple}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterTypeSignedSimple(KickCParser.TypeSignedSimpleContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by the {@code typeSignedSimple}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitTypeSignedSimple(KickCParser.TypeSignedSimpleContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by the {@code typeStructDef}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
@ -246,29 +246,29 @@ public interface KickCParserListener extends ParseTreeListener {
|
||||
*/
|
||||
void exitTypeStructDef(KickCParser.TypeStructDefContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by the {@code typeNamedRef}
|
||||
* Enter a parse tree produced by the {@code typeStructRef}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterTypeNamedRef(KickCParser.TypeNamedRefContext ctx);
|
||||
void enterTypeStructRef(KickCParser.TypeStructRefContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by the {@code typeNamedRef}
|
||||
* Exit a parse tree produced by the {@code typeStructRef}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitTypeNamedRef(KickCParser.TypeNamedRefContext ctx);
|
||||
void exitTypeStructRef(KickCParser.TypeStructRefContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by the {@code typeSignedSimple}
|
||||
* Enter a parse tree produced by the {@code typeEnumDef}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterTypeSignedSimple(KickCParser.TypeSignedSimpleContext ctx);
|
||||
void enterTypeEnumDef(KickCParser.TypeEnumDefContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by the {@code typeSignedSimple}
|
||||
* Exit a parse tree produced by the {@code typeEnumDef}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitTypeSignedSimple(KickCParser.TypeSignedSimpleContext ctx);
|
||||
void exitTypeEnumDef(KickCParser.TypeEnumDefContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by the {@code typeEnumRef}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
@ -282,17 +282,17 @@ public interface KickCParserListener extends ParseTreeListener {
|
||||
*/
|
||||
void exitTypeEnumRef(KickCParser.TypeEnumRefContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by the {@code typeEnumDef}
|
||||
* Enter a parse tree produced by the {@code typeNamedRef}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterTypeEnumDef(KickCParser.TypeEnumDefContext ctx);
|
||||
void enterTypeNamedRef(KickCParser.TypeNamedRefContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by the {@code typeEnumDef}
|
||||
* Exit a parse tree produced by the {@code typeNamedRef}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitTypeEnumDef(KickCParser.TypeEnumDefContext ctx);
|
||||
void exitTypeNamedRef(KickCParser.TypeNamedRefContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link KickCParser#structRef}.
|
||||
* @param ctx the parse tree
|
||||
@ -373,16 +373,6 @@ public interface KickCParserListener extends ParseTreeListener {
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitDeclFunction(KickCParser.DeclFunctionContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link KickCParser#declFunctionBody}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void enterDeclFunctionBody(KickCParser.DeclFunctionBodyContext ctx);
|
||||
/**
|
||||
* Exit a parse tree produced by {@link KickCParser#declFunctionBody}.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
void exitDeclFunctionBody(KickCParser.DeclFunctionBodyContext ctx);
|
||||
/**
|
||||
* Enter a parse tree produced by {@link KickCParser#parameterListDecl}.
|
||||
* @param ctx the parse tree
|
||||
|
@ -124,19 +124,12 @@ public interface KickCParserVisitor<T> extends ParseTreeVisitor<T> {
|
||||
*/
|
||||
T visitDeclaratorName(KickCParser.DeclaratorNameContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code typeProcedure}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
* Visit a parse tree produced by the {@code declaratorProcedure}
|
||||
* labeled alternative in {@link KickCParser#declarator}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitTypeProcedure(KickCParser.TypeProcedureContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code typeStructRef}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitTypeStructRef(KickCParser.TypeStructRefContext ctx);
|
||||
T visitDeclaratorProcedure(KickCParser.DeclaratorProcedureContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code typeSimple}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
@ -144,6 +137,13 @@ public interface KickCParserVisitor<T> extends ParseTreeVisitor<T> {
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitTypeSimple(KickCParser.TypeSimpleContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code typeSignedSimple}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitTypeSignedSimple(KickCParser.TypeSignedSimpleContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code typeStructDef}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
@ -152,19 +152,19 @@ public interface KickCParserVisitor<T> extends ParseTreeVisitor<T> {
|
||||
*/
|
||||
T visitTypeStructDef(KickCParser.TypeStructDefContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code typeNamedRef}
|
||||
* Visit a parse tree produced by the {@code typeStructRef}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitTypeNamedRef(KickCParser.TypeNamedRefContext ctx);
|
||||
T visitTypeStructRef(KickCParser.TypeStructRefContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code typeSignedSimple}
|
||||
* Visit a parse tree produced by the {@code typeEnumDef}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitTypeSignedSimple(KickCParser.TypeSignedSimpleContext ctx);
|
||||
T visitTypeEnumDef(KickCParser.TypeEnumDefContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code typeEnumRef}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
@ -173,12 +173,12 @@ public interface KickCParserVisitor<T> extends ParseTreeVisitor<T> {
|
||||
*/
|
||||
T visitTypeEnumRef(KickCParser.TypeEnumRefContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by the {@code typeEnumDef}
|
||||
* Visit a parse tree produced by the {@code typeNamedRef}
|
||||
* labeled alternative in {@link KickCParser#type}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitTypeEnumDef(KickCParser.TypeEnumDefContext ctx);
|
||||
T visitTypeNamedRef(KickCParser.TypeNamedRefContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link KickCParser#structRef}.
|
||||
* @param ctx the parse tree
|
||||
@ -227,12 +227,6 @@ public interface KickCParserVisitor<T> extends ParseTreeVisitor<T> {
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitDeclFunction(KickCParser.DeclFunctionContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link KickCParser#declFunctionBody}.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
T visitDeclFunctionBody(KickCParser.DeclFunctionBodyContext ctx);
|
||||
/**
|
||||
* Visit a parse tree produced by {@link KickCParser#parameterListDecl}.
|
||||
* @param ctx the parse tree
|
||||
|
@ -116,7 +116,7 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
|
||||
Procedure initProc = program.getScope().getLocalProcedure(SymbolRef.INIT_PROC_NAME);
|
||||
if(initProc == null) {
|
||||
// Create the _init() procedure
|
||||
initProc = new Procedure(SymbolRef.INIT_PROC_NAME, SymbolType.VOID, program.getScope(), Scope.SEGMENT_CODE_DEFAULT, Scope.SEGMENT_DATA_DEFAULT, Procedure.CallingConvention.PHI_CALL);
|
||||
initProc = new Procedure(SymbolRef.INIT_PROC_NAME, new SymbolTypeProcedure(SymbolType.VOID, new ArrayList<>()), program.getScope(), Scope.SEGMENT_CODE_DEFAULT, Scope.SEGMENT_DATA_DEFAULT, Procedure.CallingConvention.PHI_CALL);
|
||||
initProc.setDeclaredInline(true);
|
||||
initProc.setParameters(new ArrayList<>());
|
||||
program.getScope().add(initProc);
|
||||
@ -173,7 +173,7 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
|
||||
// Add the _start() procedure to the program
|
||||
{
|
||||
program.setStartProcedure(new ProcedureRef(SymbolRef.START_PROC_NAME));
|
||||
final Procedure startProcedure = new Procedure(SymbolRef.START_PROC_NAME, SymbolType.VOID, program.getScope(), Scope.SEGMENT_CODE_DEFAULT, Scope.SEGMENT_DATA_DEFAULT, Procedure.CallingConvention.PHI_CALL);
|
||||
final Procedure startProcedure = new Procedure(SymbolRef.START_PROC_NAME, new SymbolTypeProcedure(SymbolType.VOID, new ArrayList<>()), program.getScope(), Scope.SEGMENT_CODE_DEFAULT, Scope.SEGMENT_DATA_DEFAULT, Procedure.CallingConvention.PHI_CALL);
|
||||
startProcedure.setParameters(new ArrayList<>());
|
||||
program.getScope().add(startProcedure);
|
||||
final ProcedureCompilation startProcedureCompilation = program.createProcedureCompilation(startProcedure.getRef());
|
||||
@ -391,120 +391,100 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
|
||||
public Object visitDeclFunction(KickCParser.DeclFunctionContext ctx) {
|
||||
this.visit(ctx.declType());
|
||||
this.visit(ctx.declarator());
|
||||
SymbolType type = varDecl.getEffectiveType();
|
||||
List<Directive> directives = varDecl.getDeclDirectives();
|
||||
String name = varDecl.getVarName();
|
||||
Procedure procedure = new Procedure(name, type, program.getScope(), currentCodeSegment, currentDataSegment, currentCallingConvention);
|
||||
addDirectives(procedure, directives, StatementSource.procedureDecl(ctx));
|
||||
|
||||
// Declare the procedure
|
||||
Procedure procedure = declareProcedure(ctx, StatementSource.procedureDecl(ctx));
|
||||
|
||||
// Make sure comments and directives are from the definition
|
||||
addDirectives(procedure, varDecl.getDeclDirectives(), StatementSource.procedureDecl(ctx));
|
||||
procedure.setComments(ensureUnusedComments(getCommentsSymbol(ctx)));
|
||||
|
||||
// enter the procedure
|
||||
scopeStack.push(procedure);
|
||||
|
||||
// Add return variable
|
||||
Variable returnVar = null;
|
||||
if(!SymbolType.VOID.equals(type)) {
|
||||
final VariableBuilder builder = new VariableBuilder("return", procedure, false, varDecl.getEffectiveType(), varDecl.getDeclDirectives(), currentDataSegment, program.getTargetPlatform().getVariableBuilderConfig());
|
||||
if(!SymbolType.VOID.equals(procedure.getReturnType())) {
|
||||
final VariableBuilder builder = new VariableBuilder("return", procedure, false, procedure.getReturnType(), varDecl.getDeclDirectives(), currentDataSegment, program.getTargetPlatform().getVariableBuilderConfig());
|
||||
returnVar = builder.build();
|
||||
}
|
||||
varDecl.exitType();
|
||||
|
||||
// Add parameter variables...
|
||||
List<Variable> parameterList = new ArrayList<>();
|
||||
if(ctx.parameterListDecl() != null) {
|
||||
parameterList = (List<Variable>) this.visit(ctx.parameterListDecl());
|
||||
for(ParameterDecl parameter : varDecl.parameters) {
|
||||
VariableBuilder varBuilder = new VariableBuilder(parameter.name, getCurrentScope(), true, parameter.type, null, currentDataSegment, program.getTargetPlatform().getVariableBuilderConfig());
|
||||
final Variable paramVar = varBuilder.build();
|
||||
parameterList.add(paramVar);
|
||||
}
|
||||
procedure.setParameters(parameterList);
|
||||
|
||||
varDecl.exitType();
|
||||
|
||||
// Check that the body has not already been added
|
||||
final StatementSequence statementSequence = getCurrentProcedureCompilation().getStatementSequence();
|
||||
if(statementSequence != null && statementSequence.getStatements().size() > 0)
|
||||
throw new CompileError("Redefinition of function: " + procedure.getFullName(), StatementSource.procedureBegin(ctx));
|
||||
|
||||
// Add the body
|
||||
addStatement(new StatementProcedureBegin(procedure.getRef(), StatementSource.procedureBegin(ctx), Comment.NO_COMMENTS));
|
||||
// Add parameter assignments
|
||||
if(Procedure.CallingConvention.STACK_CALL.equals(procedure.getCallingConvention())) {
|
||||
for(Variable param : parameterList) {
|
||||
addStatement(new StatementAssignment((LValue) param.getRef(), new ParamValue((VariableRef) param.getRef()), true, StatementSource.procedureEnd(ctx), Comment.NO_COMMENTS));
|
||||
}
|
||||
}
|
||||
Label procExit = procedure.addLabel(SymbolRef.PROCEXIT_BLOCK_NAME);
|
||||
if(ctx.stmtSeq() != null) {
|
||||
this.visit(ctx.stmtSeq());
|
||||
}
|
||||
addStatement(new StatementLabel(procExit.getRef(), StatementSource.procedureEnd(ctx), Comment.NO_COMMENTS));
|
||||
if(Procedure.CallingConvention.PHI_CALL.equals(procedure.getCallingConvention()) && returnVar != null) {
|
||||
addStatement(new StatementAssignment(returnVar.getVariableRef(), returnVar.getRef(), false, StatementSource.procedureEnd(ctx), Comment.NO_COMMENTS));
|
||||
}
|
||||
SymbolVariableRef returnVarRef = null;
|
||||
if(returnVar != null) {
|
||||
returnVarRef = returnVar.getRef();
|
||||
}
|
||||
addStatement(new StatementReturn(returnVarRef, StatementSource.procedureEnd(ctx), Comment.NO_COMMENTS));
|
||||
addStatement(new StatementProcedureEnd(procedure.getRef(), StatementSource.procedureEnd(ctx), Comment.NO_COMMENTS));
|
||||
scopeStack.pop();
|
||||
|
||||
// Check that the declaration matches any existing declaration!
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/** Declare a procedure (either as part of a forward declaration or as part of a definition.)
|
||||
* Finds the name, type and parameters in the varDecl.
|
||||
* If the procedure is already declared then it is checked that the current declaration matches the existing one - and the existing one is returned.
|
||||
*
|
||||
* @param ctx The parser context (used to find any comments.)
|
||||
* @param statementSource The statements source (used when producing errors.
|
||||
* @return The declared procedure.
|
||||
*/
|
||||
private Procedure declareProcedure(ParserRuleContext ctx, StatementSource statementSource) {
|
||||
Procedure procedure = new Procedure(varDecl.getVarName(), (SymbolTypeProcedure) varDecl.getEffectiveType(), program.getScope(), currentCodeSegment, currentDataSegment, currentCallingConvention);
|
||||
addDirectives(procedure, varDecl.getDeclDirectives(), statementSource);
|
||||
// Check if the declaration matches any existing declaration!
|
||||
final Symbol existingSymbol = program.getScope().getSymbol(procedure.getRef());
|
||||
if(existingSymbol != null) {
|
||||
// Already declared - check equality
|
||||
if(!(existingSymbol instanceof Procedure) || !SymbolTypeConversion.procedureDeclarationMatch((Procedure) existingSymbol, procedure))
|
||||
throw new CompileError("Conflicting declarations for: " + procedure.getFullName(), new StatementSource(ctx));
|
||||
throw new CompileError("Conflicting declarations for procedure: " + procedure.getFullName(), new StatementSource(ctx));
|
||||
procedure = (Procedure) existingSymbol;
|
||||
} else {
|
||||
// Not declared before - add it
|
||||
program.getScope().add(procedure);
|
||||
program.createProcedureCompilation(procedure.getRef());
|
||||
}
|
||||
|
||||
if(ctx.declFunctionBody() != null || VariableBuilder.hasDirective(Directive.Intrinsic.class, directives)) {
|
||||
// Make sure directives and more are taken from the procedure with the body / intrinsic declaration!
|
||||
if(existingSymbol != null) {
|
||||
program.getScope().remove(existingSymbol);
|
||||
program.getScope().add(procedure);
|
||||
}
|
||||
}
|
||||
|
||||
if(ctx.declFunctionBody() != null) {
|
||||
scopeStack.push(procedure);
|
||||
// Check that the body has not already been added
|
||||
final StatementSequence statementSequence = getCurrentProcedureCompilation().getStatementSequence();
|
||||
if(statementSequence != null && statementSequence.getStatements().size() > 0)
|
||||
throw new CompileError("Redefinition of function: " + procedure.getFullName(), StatementSource.procedureBegin(ctx));
|
||||
// Add the body
|
||||
addStatement(new StatementProcedureBegin(procedure.getRef(), StatementSource.procedureBegin(ctx), Comment.NO_COMMENTS));
|
||||
// Add parameter assignments
|
||||
if(Procedure.CallingConvention.STACK_CALL.equals(procedure.getCallingConvention())) {
|
||||
for(Variable param : parameterList) {
|
||||
addStatement(new StatementAssignment((LValue) param.getRef(), new ParamValue((VariableRef) param.getRef()), true, StatementSource.procedureEnd(ctx), Comment.NO_COMMENTS));
|
||||
}
|
||||
}
|
||||
Label procExit = procedure.addLabel(SymbolRef.PROCEXIT_BLOCK_NAME);
|
||||
if(ctx.declFunctionBody().stmtSeq() != null) {
|
||||
this.visit(ctx.declFunctionBody().stmtSeq());
|
||||
}
|
||||
addStatement(new StatementLabel(procExit.getRef(), StatementSource.procedureEnd(ctx), Comment.NO_COMMENTS));
|
||||
if(Procedure.CallingConvention.PHI_CALL.equals(procedure.getCallingConvention()) && returnVar != null) {
|
||||
addStatement(new StatementAssignment(returnVar.getVariableRef(), returnVar.getRef(), false, StatementSource.procedureEnd(ctx), Comment.NO_COMMENTS));
|
||||
}
|
||||
SymbolVariableRef returnVarRef = null;
|
||||
if(returnVar != null) {
|
||||
returnVarRef = returnVar.getRef();
|
||||
}
|
||||
addStatement(new StatementReturn(returnVarRef, StatementSource.procedureEnd(ctx), Comment.NO_COMMENTS));
|
||||
addStatement(new StatementProcedureEnd(procedure.getRef(), StatementSource.procedureEnd(ctx), Comment.NO_COMMENTS));
|
||||
scopeStack.pop();
|
||||
}
|
||||
return null;
|
||||
return procedure;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Variable> visitParameterListDecl(KickCParser.ParameterListDeclContext ctx) {
|
||||
ArrayList<Variable> parameterDecls = new ArrayList<>();
|
||||
boolean encounteredVariableLengthParamList = false;
|
||||
for(KickCParser.ParameterDeclContext parameterDeclCtx : ctx.parameterDecl()) {
|
||||
if(encounteredVariableLengthParamList) {
|
||||
throw new CompileError("Variable length parameter list is only legal as the last parameter.", new StatementSource(ctx));
|
||||
}
|
||||
Object parameterDecl = this.visit(parameterDeclCtx);
|
||||
if(parameterDecl.equals(SymbolType.VOID)) {
|
||||
if(ctx.parameterDecl().size() == 1) {
|
||||
// A single void parameter decl - equals zero parameters
|
||||
return new ArrayList<>();
|
||||
} else {
|
||||
throw new CompileError("Illegal void parameter.", new StatementSource(ctx));
|
||||
}
|
||||
} else if(parameterDecl == PARAM_LIST) {
|
||||
// A "..." parameter list. Update the procedure.
|
||||
final Procedure procedure = (Procedure) getCurrentScope();
|
||||
procedure.setVariableLengthParameterList(true);
|
||||
encounteredVariableLengthParamList = true;
|
||||
} else if(parameterDecl instanceof Variable) {
|
||||
parameterDecls.add((Variable) parameterDecl);
|
||||
} else {
|
||||
throw new CompileError("Unknown parameter " + ctx.getText(), new StatementSource(ctx));
|
||||
}
|
||||
}
|
||||
return parameterDecls;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object visitParameterDeclType(KickCParser.ParameterDeclTypeContext ctx) {
|
||||
this.visit(ctx.declType());
|
||||
this.visit(ctx.declarator());
|
||||
String varName = varDecl.getVarName();
|
||||
VariableBuilder varBuilder = new VariableBuilder(varName, getCurrentScope(), true, varDecl.getEffectiveType(), varDecl.getDeclDirectives(), currentDataSegment, program.getTargetPlatform().getVariableBuilderConfig());
|
||||
Variable param = varBuilder.build();
|
||||
ParameterDecl paramDecl = new ParameterDecl(varDecl.getVarName(), varDecl.getEffectiveType());
|
||||
varDecl.exitType();
|
||||
return param;
|
||||
return paramDecl;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -512,15 +492,12 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
|
||||
if(!SymbolType.VOID.getTypeName().equals(ctx.SIMPLETYPE().getText())) {
|
||||
throw new CompileError("Illegal unnamed parameter " + ctx.SIMPLETYPE().getText(), new StatementSource(ctx));
|
||||
}
|
||||
return SymbolType.VOID;
|
||||
return new ParameterDecl(null, SymbolType.VOID);
|
||||
}
|
||||
|
||||
/** Singleton signalling a "..." parameter list. */
|
||||
public static Object PARAM_LIST = new Object();
|
||||
|
||||
@Override
|
||||
public Object visitParameterDeclList(KickCParser.ParameterDeclListContext ctx) {
|
||||
return PARAM_LIST;
|
||||
return new ParameterDecl(null, SymbolType.PARAM_LIST);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -740,13 +717,26 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
|
||||
return new AsmDirectiveClobber(clobber);
|
||||
}
|
||||
|
||||
|
||||
/** Information about a declared parameter. */
|
||||
static class ParameterDecl {
|
||||
final public String name;
|
||||
final public SymbolType type;
|
||||
|
||||
public ParameterDecl(String name, SymbolType type) {
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Holds type, arrayness, directives, comments etc. while parsing a variable declaration.
|
||||
* Holds type directives, comments etc. while parsing a variable or procedure declaration.
|
||||
* Has three levels of information pushed on top of each other:
|
||||
* <ol>
|
||||
* <li>Struct Member Declaration (true while inside inside a struct declaration)</li>
|
||||
* <li>Type information and directives (the type)</li>
|
||||
* <li>Variable information and declarations (arrayness, pointerness, variable level directives)</li>
|
||||
* <li>Information about parameters (for procedures)</li>
|
||||
* </ol>
|
||||
* <p>
|
||||
* When parsing a declaration such as <code>volatile char a, * const b, c[]</code> the type level holds <code>volatile char</code>
|
||||
@ -766,6 +756,8 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
|
||||
private SymbolType varDeclType;
|
||||
/** The variable name (variable level) */
|
||||
private String varName;
|
||||
/** The declared parameters (if this is a procedure). */
|
||||
private List<ParameterDecl> parameters;
|
||||
|
||||
/**
|
||||
* Exits the type layer (clears everything except struct information)
|
||||
@ -776,6 +768,7 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
|
||||
this.declType = null;
|
||||
this.varDeclType = null;
|
||||
this.varName = null;
|
||||
this.parameters = new ArrayList<>();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -784,6 +777,7 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
|
||||
void exitVar() {
|
||||
this.varDeclType = null;
|
||||
this.varName = null;
|
||||
this.parameters = new ArrayList<>();
|
||||
}
|
||||
|
||||
SymbolType getEffectiveType() {
|
||||
@ -862,6 +856,14 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
|
||||
this.structMember = structMember;
|
||||
}
|
||||
|
||||
public void setParameters(List<ParameterDecl> parameters) {
|
||||
this.parameters = parameters;
|
||||
}
|
||||
|
||||
public List<ParameterDecl> getParameters() {
|
||||
return parameters;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** The current variable declaration. This is not on the stack. */
|
||||
@ -923,48 +925,53 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
|
||||
String varName = varDecl.getVarName();
|
||||
KickCParser.ExprContext initializer = ctx.expr();
|
||||
StatementSource declSource = new StatementSource((ParserRuleContext) ctx.parent.parent);
|
||||
StatementSource statementSource = declSource;
|
||||
try {
|
||||
final boolean isStructMember = varDecl.isStructMember();
|
||||
final SymbolType effectiveType = varDecl.getEffectiveType();
|
||||
final List<Directive> effectiveDirectives = varDecl.getDeclDirectives();
|
||||
final List<Comment> declComments = varDecl.getDeclComments();
|
||||
varDecl.exitVar();
|
||||
VariableBuilder varBuilder = new VariableBuilder(varName, getCurrentScope(), false, effectiveType, effectiveDirectives, currentDataSegment, program.getTargetPlatform().getVariableBuilderConfig());
|
||||
Variable variable = varBuilder.build();
|
||||
if(isStructMember && (initializer != null))
|
||||
throw new CompileError("Initializer not supported inside structs " + effectiveType.getTypeName(), statementSource);
|
||||
if(variable.isDeclarationOnly()) {
|
||||
if(initializer != null) {
|
||||
throw new CompileError("Initializer not allowed for extern variables " + varName, statementSource);
|
||||
}
|
||||
} else {
|
||||
// Create a proper initializer
|
||||
if(initializer != null)
|
||||
PrePostModifierHandler.addPreModifiers(this, initializer, statementSource);
|
||||
RValue initValue = (initializer == null) ? null : (RValue) visit(initializer);
|
||||
initValue = Initializers.constantify(initValue, new Initializers.ValueTypeSpec(effectiveType), program, statementSource);
|
||||
boolean isPermanent = ScopeRef.ROOT.equals(variable.getScope().getRef()) || variable.isPermanent();
|
||||
if(variable.isKindConstant() || (isPermanent && variable.isKindLoadStore() && Variable.MemoryArea.MAIN_MEMORY.equals(variable.getMemoryArea()) && initValue instanceof ConstantValue && !isStructMember && variable.getRegister() == null)) {
|
||||
// Set initial value
|
||||
ConstantValue constInitValue = getConstInitValue(initValue, initializer, statementSource);
|
||||
variable.setInitValue(constInitValue);
|
||||
// Add comments to constant
|
||||
variable.setComments(ensureUnusedComments(declComments));
|
||||
} else if(!variable.isKindConstant() && !isStructMember) {
|
||||
Statement initStmt = new StatementAssignment(variable.getVariableRef(), initValue, true, statementSource, Comment.NO_COMMENTS);
|
||||
addStatement(initStmt);
|
||||
if(variable.getScope().getRef().equals(ScopeRef.ROOT)) {
|
||||
// Add comments to variable for global vars
|
||||
variable.setComments(ensureUnusedComments(declComments));
|
||||
} else {
|
||||
// Add comments to statement for local vars
|
||||
initStmt.setComments(ensureUnusedComments(declComments));
|
||||
}
|
||||
|
||||
if(effectiveType instanceof SymbolTypeProcedure) {
|
||||
declareProcedure(ctx, declSource);
|
||||
varDecl.exitVar();
|
||||
} else {
|
||||
final boolean isStructMember = varDecl.isStructMember();
|
||||
final List<Directive> effectiveDirectives = varDecl.getDeclDirectives();
|
||||
final List<Comment> declComments = varDecl.getDeclComments();
|
||||
varDecl.exitVar();
|
||||
VariableBuilder varBuilder = new VariableBuilder(varName, getCurrentScope(), false, effectiveType, effectiveDirectives, currentDataSegment, program.getTargetPlatform().getVariableBuilderConfig());
|
||||
Variable variable = varBuilder.build();
|
||||
if(isStructMember && (initializer != null))
|
||||
throw new CompileError("Initializer not supported inside structs " + effectiveType.getTypeName(), declSource);
|
||||
if(variable.isDeclarationOnly()) {
|
||||
if(initializer != null) {
|
||||
throw new CompileError("Initializer not allowed for extern variables " + varName, declSource);
|
||||
}
|
||||
} else {
|
||||
// Create a proper initializer
|
||||
if(initializer != null)
|
||||
PrePostModifierHandler.addPreModifiers(this, initializer, declSource);
|
||||
RValue initValue = (initializer == null) ? null : (RValue) visit(initializer);
|
||||
initValue = Initializers.constantify(initValue, new Initializers.ValueTypeSpec(effectiveType), program, declSource);
|
||||
boolean isPermanent = ScopeRef.ROOT.equals(variable.getScope().getRef()) || variable.isPermanent();
|
||||
if(variable.isKindConstant() || (isPermanent && variable.isKindLoadStore() && Variable.MemoryArea.MAIN_MEMORY.equals(variable.getMemoryArea()) && initValue instanceof ConstantValue && !isStructMember && variable.getRegister() == null)) {
|
||||
// Set initial value
|
||||
ConstantValue constInitValue = getConstInitValue(initValue, initializer, declSource);
|
||||
variable.setInitValue(constInitValue);
|
||||
// Add comments to constant
|
||||
variable.setComments(ensureUnusedComments(declComments));
|
||||
} else if(!variable.isKindConstant() && !isStructMember) {
|
||||
Statement initStmt = new StatementAssignment(variable.getVariableRef(), initValue, true, declSource, Comment.NO_COMMENTS);
|
||||
addStatement(initStmt);
|
||||
if(variable.getScope().getRef().equals(ScopeRef.ROOT)) {
|
||||
// Add comments to variable for global vars
|
||||
variable.setComments(ensureUnusedComments(declComments));
|
||||
} else {
|
||||
// Add comments to statement for local vars
|
||||
initStmt.setComments(ensureUnusedComments(declComments));
|
||||
}
|
||||
|
||||
}
|
||||
if(initializer != null)
|
||||
PrePostModifierHandler.addPostModifiers(this, initializer, declSource);
|
||||
}
|
||||
if(initializer != null)
|
||||
PrePostModifierHandler.addPostModifiers(this, initializer, statementSource);
|
||||
}
|
||||
} catch(CompileError e) {
|
||||
throw new CompileError(e.getMessage(), declSource);
|
||||
@ -1950,16 +1957,29 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public Object visitDeclaratorProcedure(KickCParser.DeclaratorProcedureContext ctx) {
|
||||
visit(ctx.declarator());
|
||||
// TODO: Handle parameters!
|
||||
List<ParameterDecl> parameters = new ArrayList<>();
|
||||
List<SymbolType> paramTypes = new ArrayList<>();
|
||||
if(ctx.parameterListDecl() != null)
|
||||
for(KickCParser.ParameterDeclContext parameterDeclContext : ctx.parameterListDecl().parameterDecl()) {
|
||||
varDeclPush();
|
||||
ParameterDecl paramDecl = (ParameterDecl) this.visit(parameterDeclContext);
|
||||
// Handle parameter list with "VOID"
|
||||
if(SymbolType.VOID.equals(paramDecl.type) && ctx.parameterListDecl().parameterDecl().size()==1)
|
||||
; // Ignore the void parameter
|
||||
else {
|
||||
paramTypes.add(paramDecl.type);
|
||||
parameters.add(paramDecl);
|
||||
}
|
||||
varDeclPop();
|
||||
}
|
||||
SymbolType returnType = varDecl.getEffectiveType();
|
||||
varDecl.setDeclType(new SymbolTypeProcedure(returnType));
|
||||
varDecl.setVarDeclType(new SymbolTypeProcedure(returnType, paramTypes));
|
||||
varDecl.setParameters(parameters);
|
||||
visit(ctx.declarator());
|
||||
return null;
|
||||
}
|
||||
*/
|
||||
|
||||
@Override
|
||||
public Object visitTypeNamedRef(KickCParser.TypeNamedRefContext ctx) {
|
||||
@ -2004,14 +2024,6 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object visitTypeProcedure(KickCParser.TypeProcedureContext ctx) {
|
||||
visit(ctx.type());
|
||||
SymbolType returnType = varDecl.getEffectiveType();
|
||||
varDecl.setDeclType(new SymbolTypeProcedure(returnType));
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* RValues that have not yet been output as part of a statement.
|
||||
* The expression visitor methods updates this so that the surrounding
|
||||
|
@ -53,12 +53,15 @@ unsigned long* const CIA2_TIMER_AB = (unsigned long*)0xdd04;
|
||||
// CIA#2 Interrupt for reading in ASM
|
||||
char * const CIA2_INTERRUPT = (char*)0xdd0d;
|
||||
|
||||
// Pointer to interrupt function
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
|
||||
// The vector used when the KERNAL serves IRQ interrupts
|
||||
void()** const KERNEL_IRQ = (void()**)0x0314;
|
||||
IRQ_TYPE * const KERNEL_IRQ = (IRQ_TYPE*)0x0314;
|
||||
// The vector used when the KERNAL serves NMI interrupts
|
||||
void()** const KERNEL_NMI = (void()**)0x0318;
|
||||
IRQ_TYPE * const KERNEL_NMI = (IRQ_TYPE*)0x0318;
|
||||
// The vector used when the HARDWARE serves IRQ interrupts
|
||||
void()** const HARDWARE_IRQ = (void()**)0xfffe;
|
||||
IRQ_TYPE * const HARDWARE_IRQ = (IRQ_TYPE*)0xfffe;
|
||||
|
||||
// The colors of the C64
|
||||
const char BLACK = 0x0;
|
||||
|
@ -30,12 +30,15 @@ struct MOS6522_VIA * const VIA2 = (struct MOS6522_VIA *)0x9f70;
|
||||
// Interrupt Vectors
|
||||
// https://github.com/commanderx16/x16-emulator/wiki/(ASM-Programming)-Interrupts-and-interrupt-handling
|
||||
|
||||
// Pointer to interrupt function
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
|
||||
// $FFFE (ROM) Universal interrupt vector - The vector used when the HARDWARE serves IRQ interrupts
|
||||
void()** const HARDWARE_IRQ = (void()**)0xfffe;
|
||||
IRQ_TYPE* const HARDWARE_IRQ = (IRQ_TYPE*)0xfffe;
|
||||
// $0314 (RAM) IRQ vector - The vector used when the KERNAL serves IRQ interrupts
|
||||
void()** const KERNEL_IRQ = (void()**)0x0314;
|
||||
IRQ_TYPE* const KERNEL_IRQ = (IRQ_TYPE*)0x0314;
|
||||
// $0316 (RAM) BRK vector - The vector used when the KERNAL serves IRQ caused by a BRK
|
||||
void()** const KERNEL_BRK = (void()**)0x0316;
|
||||
IRQ_TYPE* const KERNEL_BRK = (IRQ_TYPE*)0x0316;
|
||||
|
||||
|
||||
// VRAM Address of the default screen
|
||||
|
@ -74,12 +74,15 @@ unsigned long* const CIA2_TIMER_AB = (unsigned long*)0xdd04;
|
||||
// CIA#2 Interrupt for reading in ASM
|
||||
char * const CIA2_INTERRUPT = (char*)0xdd0d;
|
||||
|
||||
// Pointer to interrupt function
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
|
||||
// The vector used when the KERNAL serves IRQ interrupts
|
||||
void()** const KERNEL_IRQ = (void()**)0x0314;
|
||||
IRQ_TYPE * const KERNEL_IRQ = (IRQ_TYPE*)0x0314;
|
||||
// The vector used when the KERNAL serves NMI interrupts
|
||||
void()** const KERNEL_NMI = (void()**)0x0318;
|
||||
IRQ_TYPE * const KERNEL_NMI = (IRQ_TYPE*)0x0318;
|
||||
// The vector used when the HARDWARE serves IRQ interrupts
|
||||
void()** const HARDWARE_IRQ = (void()**)0xfffe;
|
||||
IRQ_TYPE * const HARDWARE_IRQ = (IRQ_TYPE*)0xfffe;
|
||||
|
||||
// The colors of the C64
|
||||
const char BLACK = 0x0;
|
||||
|
@ -10,8 +10,53 @@ import java.io.IOException;
|
||||
public class TestProgramsFast extends TestPrograms {
|
||||
|
||||
@Test
|
||||
public void testSizeOfProblem() throws IOException {
|
||||
compileAndCompare("sizeof-problem.c");
|
||||
public void testProcedureDeclare10() throws IOException {
|
||||
compileAndCompare("procedure-declare-10.c", log());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProcedureDeclare9() throws IOException {
|
||||
compileAndCompare("procedure-declare-9.c");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProcedureDeclare8() throws IOException {
|
||||
compileAndCompare("procedure-declare-8.c");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProcedureDeclare7() throws IOException {
|
||||
assertError("procedure-declare-7.c", "Conflicting declarations for procedure: f");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProcedureDeclare6() throws IOException {
|
||||
assertError("procedure-declare-6.c", "Conflicting declarations for procedure: f");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProcedureDeclare5() throws IOException {
|
||||
compileAndCompare("procedure-declare-5.c");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProcedureDeclare4() throws IOException {
|
||||
compileAndCompare("procedure-declare-4.c");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProcedureDeclare3() throws IOException {
|
||||
compileAndCompare("procedure-declare-3.c");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProcedureDeclare2() throws IOException {
|
||||
compileAndCompare("procedure-declare-2.c");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testProcedureDeclare1() throws IOException {
|
||||
compileAndCompare("procedure-declare-1.c");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -19,6 +64,11 @@ public class TestProgramsFast extends TestPrograms {
|
||||
compileAndCompare("procedure-declare-0.c");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSizeOfProblem() throws IOException {
|
||||
compileAndCompare("sizeof-problem.c");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStructPointerTyping() throws IOException {
|
||||
compileAndCompare("struct-pointer-typing.c");
|
||||
@ -792,7 +842,7 @@ public class TestProgramsFast extends TestPrograms {
|
||||
|
||||
@Test
|
||||
public void testCStyleDeclFunctionMismatch() throws IOException {
|
||||
assertError("cstyle-decl-function-mismatch.c", "Conflicting declarations for: sum");
|
||||
assertError("cstyle-decl-function-mismatch.c", "Conflicting declarations for procedure: sum");
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -1363,7 +1413,7 @@ public class TestProgramsFast extends TestPrograms {
|
||||
|
||||
@Test
|
||||
public void testFunctionAsArray() throws IOException {
|
||||
assertError("function-as-array.c", "Dereferencing a non-pointer type void()");
|
||||
assertError("function-as-array.c", "Dereferencing a non-pointer type void(byte) ");
|
||||
}
|
||||
|
||||
//@Test
|
||||
|
@ -3,8 +3,9 @@ byte* BORDER_COLOR = (byte*)$d020;
|
||||
byte* RASTER = (byte*)$d012;
|
||||
byte DARK_GREY = $b;
|
||||
byte BLACK = 0;
|
||||
void()** const KERNEL_IRQ = (void()**)$0314;
|
||||
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
IRQ_TYPE* const KERNEL_IRQ = (IRQ_TYPE*)0x0314;
|
||||
|
||||
void main() {
|
||||
*KERNEL_IRQ = &irq;
|
||||
|
@ -27,4 +27,5 @@ void main() {
|
||||
}
|
||||
|
||||
#pragma data_seg(Vectors)
|
||||
export void()* const VECTORS[] = { &nmiHandler, &entryPoint };
|
||||
|
||||
export void (*VECTORS[])() = { &nmiHandler, &entryPoint };
|
||||
|
@ -52,7 +52,7 @@ void syscall2() {
|
||||
|
||||
struct SysCall {
|
||||
char xjmp;
|
||||
void()* syscall;
|
||||
void(*syscall)();
|
||||
char xnop;
|
||||
};
|
||||
|
||||
|
@ -9,7 +9,8 @@ char* PLEX_SCREEN_PTR1 = (char*)0x400;
|
||||
char* PLEX_SCREEN_PTR2 = (char*)0x500;
|
||||
volatile char idx = 0;
|
||||
|
||||
void()** const IRQ = (void()**)0x314;
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
IRQ_TYPE* const IRQ = (IRQ_TYPE*)0x314;
|
||||
|
||||
void main() {
|
||||
PLEX_SCREEN_PTR1 = (char*)0x400;
|
||||
|
@ -6,10 +6,13 @@ __address(0x1000) char MUSIC[] = kickasm(resource "toiletrensdyr.sid") {{
|
||||
.const music = LoadSid("toiletrensdyr.sid")
|
||||
.fill music.size, music.getData(i)
|
||||
}};
|
||||
|
||||
typedef void(*PROC_PTR)();
|
||||
|
||||
// Pointer to the music init routine
|
||||
void()* musicInit = (void()*) MUSIC;
|
||||
PROC_PTR musicInit = (PROC_PTR) MUSIC;
|
||||
// Pointer to the music play routine
|
||||
void()* musicPlay = (void()*) MUSIC+3;
|
||||
PROC_PTR musicPlay = (PROC_PTR) MUSIC+3;
|
||||
|
||||
// Play the music
|
||||
void main() {
|
||||
|
@ -6,10 +6,12 @@ __address(0x1000) char MUSIC[] = kickasm(resource "toiletrensdyr.sid") {{
|
||||
.const music = LoadSid("toiletrensdyr.sid")
|
||||
.fill music.size, music.getData(i)
|
||||
}};
|
||||
|
||||
typedef void (*PROC_PTR)();
|
||||
// Pointer to the music init routine
|
||||
void()* musicInit = (void()*) MUSIC;
|
||||
PROC_PTR musicInit = (PROC_PTR) MUSIC;
|
||||
// Pointer to the music play routine
|
||||
void()* musicPlay = (void()*) MUSIC+3;
|
||||
PROC_PTR musicPlay = (PROC_PTR) MUSIC+3;
|
||||
|
||||
// Setup Raster IRQ and initialize SID player
|
||||
void main() {
|
||||
|
@ -95,7 +95,10 @@ __address(0x4000) char MUSIC[] = kickasm(resource "Cybernoid_II_4000.sid") {{
|
||||
}};
|
||||
// Address after the end of the music
|
||||
char * const MUSIC_END = (char*)0x5200;
|
||||
|
||||
typedef void(*PROC_PTR)();
|
||||
|
||||
// Pointer to the music init routine
|
||||
void()* musicInit = (void()*) MUSIC;
|
||||
PROC_PTR musicInit = (PROC_PTR) MUSIC;
|
||||
// Pointer to the music play routine
|
||||
void()* musicPlay = (void()*) MUSIC+3;
|
||||
PROC_PTR musicPlay = (PROC_PTR) MUSIC+3;
|
@ -37,10 +37,12 @@ __address(0x2c00) char SINE[256] = kickasm {{
|
||||
// Moving Raster Bars
|
||||
__address(0x3000) char rasters[RASTER_LINES];
|
||||
|
||||
typedef void (*PROC_PTR)();
|
||||
|
||||
// Pointer to the song init routine
|
||||
void()* songInit = (void()*) SONG;
|
||||
PROC_PTR songInit = (PROC_PTR) SONG;
|
||||
// Pointer to the song play routine
|
||||
void()* songPlay = (void()*) SONG+3;
|
||||
PROC_PTR songPlay = (PROC_PTR) SONG+3;
|
||||
|
||||
void main() {
|
||||
// Enable MEGA65 features
|
||||
|
@ -101,7 +101,7 @@ export char TILES[] = kickasm(resource "characters.901225-01.bin") {{
|
||||
|
||||
// Interrupt Vectors (in PRG ROM)
|
||||
#pragma data_seg(Vectors)
|
||||
export void()* const VECTORS[] = {
|
||||
export void (*VECTORS[])( = {
|
||||
// NMI Called when the PPU refreshes the screen (also known as the V-Blank period)
|
||||
&vblank,
|
||||
// RESET Called when the NES is reset, including when it is turned on.
|
||||
|
@ -119,7 +119,7 @@ struct SpriteData __align(0x100) SPRITE_BUFFER[0x40];
|
||||
|
||||
// Interrupt Vectors (in PRG ROM)
|
||||
#pragma data_seg(Vectors)
|
||||
export void()* const VECTORS[] = {
|
||||
export void (*VECTORS[])( = {
|
||||
// NMI Called when the PPU refreshes the screen (also known as the V-Blank period)
|
||||
&vblank,
|
||||
// RESET Called when the NES is reset, including when it is turned on.
|
||||
|
@ -114,7 +114,7 @@ struct SpriteData __align(0x100) SPRITE_BUFFER[0x100];
|
||||
|
||||
// Interrupt Vectors (in PRG ROM)
|
||||
#pragma data_seg(Vectors)
|
||||
export void()* const VECTORS[] = {
|
||||
export void (*VECTORS[])() = {
|
||||
// NMI Called when the PPU refreshes the screen (also known as the V-Blank period)
|
||||
&vblank,
|
||||
// RESET Called when the NES is reset, including when it is turned on.
|
||||
|
@ -3,7 +3,7 @@
|
||||
void main() {
|
||||
byte* const SCREEN = (char*)$400;
|
||||
|
||||
void()* f;
|
||||
void (*f) ();
|
||||
|
||||
for ( byte i: 0..100) {
|
||||
if((i&1)==0) {
|
||||
|
@ -3,7 +3,7 @@
|
||||
void main() {
|
||||
byte* const SCREEN = (char*)$400;
|
||||
|
||||
void()* f;
|
||||
void (*f)();
|
||||
|
||||
byte i = 0;
|
||||
while(true) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Tests calling into different function pointers which call a common sub-method
|
||||
|
||||
void do10(void()* fn) {
|
||||
void do10(void(*fn)()) {
|
||||
for( byte i: 0..9)
|
||||
(*fn)();
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ void myFunc2(){
|
||||
byte* const BG_COLOR = (char*)$d021;
|
||||
(*BG_COLOR)++;
|
||||
}
|
||||
void () *funcPointer;
|
||||
void(*funcPointer)();
|
||||
void main() {
|
||||
funcPointer=&myFunc;
|
||||
(*funcPointer)();
|
||||
|
@ -9,12 +9,12 @@ void myFunc2(){
|
||||
(*BG_COLOR)++;
|
||||
}
|
||||
|
||||
void()* addrtable[256];
|
||||
void(*addrtable[256])();
|
||||
|
||||
void main() {
|
||||
addrtable[0] = &myFunc;
|
||||
addrtable[1] = &myFunc2;
|
||||
void()* fn = addrtable[0];
|
||||
void(*fn)() = addrtable[0];
|
||||
(*fn)();
|
||||
fn = addrtable[1];
|
||||
(*fn)();
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <printf.h>
|
||||
#include <conio.h>
|
||||
|
||||
void f1(void()* fn) {
|
||||
void f1(void(*fn)()) {
|
||||
(*fn)();
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
void main() {
|
||||
byte* const SCREEN = (char*)$400;
|
||||
|
||||
void()* f;
|
||||
void (*f)();
|
||||
|
||||
byte i = 0;
|
||||
while(true) {
|
||||
|
@ -7,7 +7,8 @@ void main() {
|
||||
}
|
||||
}
|
||||
|
||||
void()* getfn(byte b) {
|
||||
// declare getfn as function (char b) returning pointer to function (void) returning void
|
||||
void (*getfn(char b))(void) {
|
||||
if((b&1)==0) {
|
||||
return &fn1;
|
||||
} else {
|
||||
|
@ -7,7 +7,8 @@ void main() {
|
||||
}
|
||||
}
|
||||
|
||||
void()* getfn(byte b) {
|
||||
// declare getfn as function (char b) returning pointer to function (void) returning void
|
||||
void (*getfn(char b))(void) {
|
||||
return &fn1;
|
||||
}
|
||||
|
||||
|
@ -10,12 +10,13 @@ void fn2() {
|
||||
(*BG_COLOR)++;
|
||||
}
|
||||
|
||||
void()* fns[2] = { &fn1, &fn2 };
|
||||
// declare fns as array 2 of pointer to function (void) returning void
|
||||
void (*fns[2])(void) = { &fn1, &fn2 };
|
||||
|
||||
void main() {
|
||||
byte i = 0;
|
||||
while(true) {
|
||||
void()* f = fns[++i&1];
|
||||
void (*f)() = fns[++i&1];
|
||||
(*f)();
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ void fn1() {
|
||||
}
|
||||
|
||||
void main() {
|
||||
void()* cls = &fn1;
|
||||
void(*cls)() = &fn1;
|
||||
for(byte* cols = (char*)$d800; cols<$d800+1000;cols++) {
|
||||
(*cls)();
|
||||
(*cols)++;
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Tests calling into a function pointer with local variables
|
||||
|
||||
void do10(void()* fn) {
|
||||
void do10( void (*fn)(void)) {
|
||||
for( byte i: 0..9)
|
||||
(*fn)();
|
||||
}
|
||||
@ -19,7 +19,7 @@ void hello() {
|
||||
|
||||
|
||||
void main() {
|
||||
void()* f = &hello;
|
||||
void (*f)() = &hello;
|
||||
do10(f);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Tests calling into a function pointer with local variables
|
||||
|
||||
void do10(void()* fn) {
|
||||
void do10(void(*fn)(void)) {
|
||||
for( byte i: 0..9)
|
||||
(*fn)();
|
||||
}
|
||||
@ -20,7 +20,7 @@ void hello() {
|
||||
}
|
||||
|
||||
void main() {
|
||||
void()* f = &hello;
|
||||
void(*f)(void) = &hello;
|
||||
msg = msg1;
|
||||
do10(f);
|
||||
msg = msg2;
|
||||
|
@ -9,7 +9,7 @@ void fn1() {
|
||||
}
|
||||
|
||||
void main() {
|
||||
void()* f = &fn1;
|
||||
void(*f)() = &fn1;
|
||||
(*f)();
|
||||
SCREEN[idx] = 'a';
|
||||
(*f)();
|
||||
|
@ -6,7 +6,7 @@ void fn1() {
|
||||
}
|
||||
|
||||
void main() {
|
||||
void()* f = &fn1;
|
||||
void (*f)() = &fn1;
|
||||
(*f)();
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
void main() {
|
||||
byte* const SCREEN = (char*)$400;
|
||||
|
||||
void()* f;
|
||||
void (*f)();
|
||||
f = &fn1;
|
||||
SCREEN[0] = <(word)f;
|
||||
SCREEN[1] = >(word)f;
|
||||
|
@ -44,14 +44,14 @@ void fn2() {
|
||||
|
||||
void main() {
|
||||
|
||||
void()* fns[2] = { &fn1, &fn2 };
|
||||
void (*fns[2])() = { &fn1, &fn2 };
|
||||
|
||||
for(char i='a';i<='p';i++)
|
||||
for(char j=0;j<2;j++) {
|
||||
CALL_BEGIN;
|
||||
CALL_CHAR(i);
|
||||
CALL_CHAR(j);
|
||||
void()* f = fns[j];
|
||||
void(*f)() = fns[j];
|
||||
(*f)();
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
void main() {
|
||||
byte* const SCREEN = (char*)$400;
|
||||
|
||||
byte()* f;
|
||||
byte(*f)();
|
||||
|
||||
byte i = 0;
|
||||
while(true) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
// Illustrates problem where volatiles reuse the same ZP addresses for multiple overlapping volatiles
|
||||
void()** const KERNEL_IRQ = (void()**)$0314;
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
IRQ_TYPE* const KERNEL_IRQ = (IRQ_TYPE*)0x0314;
|
||||
byte* const SCREEN = (byte*)$400;
|
||||
volatile byte col1 = 0;
|
||||
volatile byte col2 = 8;
|
||||
|
@ -1,5 +1,6 @@
|
||||
// Illustrates problem where volatiles reuse ZP addresses of other variables
|
||||
void()** const KERNEL_IRQ = (void()**)$0314;
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
IRQ_TYPE* const KERNEL_IRQ = (IRQ_TYPE*)0x0314;
|
||||
byte* const IRQ_STATUS = (byte*)$d019;
|
||||
byte* const CIA1_INTERRUPT = (byte*)$dc0d;
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
// A minimal working raster hardware IRQ with clobber-based register savings
|
||||
|
||||
void()** const KERNEL_IRQ = (void()**)$0314;
|
||||
void()** const HARDWARE_IRQ = (void()**)$fffe;
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
IRQ_TYPE* const KERNEL_IRQ = (IRQ_TYPE*)$0314;
|
||||
IRQ_TYPE* const HARDWARE_IRQ = (IRQ_TYPE*)$fffe;
|
||||
byte* const RASTER = (byte*)$d012;
|
||||
byte* const VICII_CONTROL1 = (byte*)$d011;
|
||||
byte* const IRQ_STATUS = (byte*)$d019;
|
||||
|
@ -2,8 +2,9 @@
|
||||
|
||||
#pragma cpu(rom6502x)
|
||||
|
||||
void()** const KERNEL_IRQ = (void()**)$0314;
|
||||
void()** const HARDWARE_IRQ = (void()**)$fffe;
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
IRQ_TYPE* const KERNEL_IRQ = (IRQ_TYPE*)$0314;
|
||||
IRQ_TYPE* const HARDWARE_IRQ = (IRQ_TYPE*)$fffe;
|
||||
byte* const RASTER = (byte*)$d012;
|
||||
byte* const VICII_CONTROL1 = (byte*)$d011;
|
||||
byte* const IRQ_STATUS = (byte*)$d019;
|
||||
|
@ -1,7 +1,8 @@
|
||||
// A minimal working raster IRQ
|
||||
|
||||
void()** const KERNEL_IRQ = (void()**)$0314;
|
||||
void()** const HARDWARE_IRQ = (void()**)$fffe;
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
IRQ_TYPE* const KERNEL_IRQ = (IRQ_TYPE*)$0314;
|
||||
IRQ_TYPE* const HARDWARE_IRQ = (IRQ_TYPE*)$fffe;
|
||||
byte* const RASTER = (byte*)$d012;
|
||||
byte* const VICII_CONTROL1 = (byte*)$d011;
|
||||
byte* const IRQ_STATUS = (byte*)$d019;
|
||||
|
@ -1,6 +1,7 @@
|
||||
// A minimal working raster IRQ
|
||||
|
||||
void()** const KERNEL_IRQ = (void()**)$0314;
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
IRQ_TYPE* const KERNEL_IRQ = (IRQ_TYPE*)$0314;
|
||||
byte* const RASTER = (byte*)$d012;
|
||||
byte* const VICII_CONTROL1 = (byte*)$d011;
|
||||
byte* const IRQ_STATUS = (byte*)$d019;
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Illustrates a problem where local variables inside an IRQ are assigned the same zeropage as a variable outside the IRQ
|
||||
|
||||
void()** const KERNEL_IRQ = (void()**)$0314;
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
IRQ_TYPE* const KERNEL_IRQ = (IRQ_TYPE*)$0314;
|
||||
byte* const RASTER = (byte*)$d012;
|
||||
byte* const VICII_CONTROL1 = (byte*)$d011;
|
||||
byte* const IRQ_STATUS = (byte*)$d019;
|
||||
|
@ -3,7 +3,9 @@
|
||||
#pragma interrupt(rom_sys_c64)
|
||||
|
||||
// The vector used when the KERNAL serves IRQ interrupts
|
||||
void()** const KERNEL_IRQ = (void()**)0x0314;
|
||||
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
IRQ_TYPE* const KERNEL_IRQ = (IRQ_TYPE*)0x0314;
|
||||
char* const BG_COLOR = (char*)0xd021;
|
||||
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
// A minimal working raster IRQ
|
||||
|
||||
void()** const KERNEL_IRQ = (void()**)$0314;
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
IRQ_TYPE* const KERNEL_IRQ = (IRQ_TYPE*)$0314;
|
||||
IRQ_TYPE* const HARDWARE_IRQ = (IRQ_TYPE*)$fffe;
|
||||
byte* const RASTER = (byte*)$d012;
|
||||
byte* const VICII_CONTROL1 = (byte*)$d011;
|
||||
byte* const IRQ_STATUS = (byte*)$d019;
|
||||
|
@ -1,7 +1,8 @@
|
||||
// Unknown interrupt type
|
||||
|
||||
// The vector used when the KERNAL serves IRQ interrupts
|
||||
void()** const KERNEL_IRQ = (void()**)0x0314;
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
IRQ_TYPE* const KERNEL_IRQ = (IRQ_TYPE*)0x0314;
|
||||
char* const BG_COLOR = (char*)0xd021;
|
||||
|
||||
// Setup the IRQ routine
|
||||
|
@ -1,7 +1,8 @@
|
||||
// Illustrates a problem where a volatile bool modified at the end of an IRQ is not stored properly
|
||||
// because it is assigned to the A register
|
||||
|
||||
void()** const KERNEL_IRQ = (void()**)$0314;
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
IRQ_TYPE* const KERNEL_IRQ = (IRQ_TYPE*)$0314;
|
||||
byte* const RASTER = (byte*)$d012;
|
||||
byte* const VICII_CONTROL1 = (byte*)$d011;
|
||||
byte* const IRQ_STATUS = (byte*)$d019;
|
||||
|
@ -1,7 +1,9 @@
|
||||
// Ensure that an inline kickasm uses-clause is anough to prevent a function from being deleted
|
||||
|
||||
// The vector used when the KERNAL serves IRQ interrupts
|
||||
void()** const KERNEL_IRQ = (void()**)$0314;
|
||||
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
IRQ_TYPE* const KERNEL_IRQ = (IRQ_TYPE*)0x0314;
|
||||
byte* const BG_COLOR = (byte*)$d021;
|
||||
const byte BLACK = $0;
|
||||
const byte WHITE = $1;
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Tests that long branch fixing works with interrupt exits (to $ea81)
|
||||
|
||||
void()** const KERNEL_IRQ = (void()**)$0314;
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
IRQ_TYPE* KERNEL_IRQ = (IRQ_TYPE*)$0314;
|
||||
byte* const BG_COLOR = (byte*)$d020;
|
||||
volatile byte col = 0;
|
||||
|
||||
|
@ -1,13 +1,6 @@
|
||||
// Procedure Declaration
|
||||
|
||||
char f(char a);
|
||||
// Procedure Declaration - a single procedure without parameters declared and defined at once
|
||||
|
||||
void main() {
|
||||
char * const SCREEN = (char*)0x0400;
|
||||
SCREEN[0] = f('a');
|
||||
SCREEN[1] = f('b');
|
||||
}
|
||||
|
||||
char f(char a) {
|
||||
return a+1;
|
||||
SCREEN[0] = 'a';
|
||||
}
|
||||
|
9
src/test/kc/procedure-declare-1.c
Normal file
9
src/test/kc/procedure-declare-1.c
Normal file
@ -0,0 +1,9 @@
|
||||
// Procedure Declaration - A single procedure without parameters or return declared and then defined
|
||||
|
||||
void main();
|
||||
|
||||
void main() {
|
||||
char * const SCREEN = (char*)0x0400;
|
||||
SCREEN[0] = 'a';
|
||||
}
|
||||
|
23
src/test/kc/procedure-declare-10.c
Normal file
23
src/test/kc/procedure-declare-10.c
Normal file
@ -0,0 +1,23 @@
|
||||
// Complex procedure declaration and definition.
|
||||
|
||||
// Copy block of memory (forwards)
|
||||
// Copies the values of num chars from the location pointed to by source directly to the memory block pointed to by destination.
|
||||
void* memcpy( void* destination, void* source, unsigned int num );
|
||||
|
||||
// Copy block of memory (forwards)
|
||||
// Copies the values of num bytes from the location pointed to by source directly to the memory block pointed to by destination.
|
||||
void* memcpy( void* destination, void* source, unsigned int num ) {
|
||||
char* src = source;
|
||||
char* dst = destination;
|
||||
char* src_end = (char*)source+num;
|
||||
while(src!=src_end) *dst++ = *src++;
|
||||
return destination;
|
||||
}
|
||||
|
||||
char * const SCREEN = (char*)0x0400;
|
||||
|
||||
char STRING[] = "hello world";
|
||||
|
||||
void main() {
|
||||
memcpy(SCREEN, STRING, sizeof(STRING));
|
||||
}
|
11
src/test/kc/procedure-declare-2.c
Normal file
11
src/test/kc/procedure-declare-2.c
Normal file
@ -0,0 +1,11 @@
|
||||
// Procedure Declaration - a procedure with paramters&return defined without declaration
|
||||
|
||||
char sum(char a, char b) {
|
||||
return a+b+1;
|
||||
}
|
||||
|
||||
void main() {
|
||||
char * const SCREEN = (char*)0x0400;
|
||||
SCREEN[0] = sum('a', 1);
|
||||
SCREEN[1] = sum('b', 2);
|
||||
}
|
14
src/test/kc/procedure-declare-3.c
Normal file
14
src/test/kc/procedure-declare-3.c
Normal file
@ -0,0 +1,14 @@
|
||||
// Procedure Declaration - a procedure with paramters&return declared & defined
|
||||
|
||||
char sum(char a, char b);
|
||||
|
||||
void main() {
|
||||
char * const SCREEN = (char*)0x0400;
|
||||
SCREEN[0] = sum('a', 1);
|
||||
SCREEN[1] = sum('b', 2);
|
||||
}
|
||||
|
||||
char sum(char a, char b) {
|
||||
return a+b+1;
|
||||
}
|
||||
|
20
src/test/kc/procedure-declare-4.c
Normal file
20
src/test/kc/procedure-declare-4.c
Normal file
@ -0,0 +1,20 @@
|
||||
// Procedure Declaration - a procedure with paramters&return declared multiple times & defined
|
||||
|
||||
char sum(char a, char b);
|
||||
|
||||
void main() {
|
||||
char * const SCREEN = (char*)0x0400;
|
||||
SCREEN[0] = sum('a', 1);
|
||||
SCREEN[1] = sum('b', 2);
|
||||
}
|
||||
|
||||
char sum(char x, char y);
|
||||
|
||||
// Calculate sum of two integers plus 1
|
||||
char sum(char q, char w) {
|
||||
return q+w+1;
|
||||
}
|
||||
|
||||
char sum(char z, char r);
|
||||
|
||||
|
13
src/test/kc/procedure-declare-5.c
Normal file
13
src/test/kc/procedure-declare-5.c
Normal file
@ -0,0 +1,13 @@
|
||||
// Procedure Declaration - a void procedure declared with empty parenthesis
|
||||
|
||||
char f(void);
|
||||
|
||||
char f() {
|
||||
return 7;
|
||||
}
|
||||
|
||||
void main() {
|
||||
char * const SCREEN = (char*)0x0400;
|
||||
SCREEN[0] = f();
|
||||
}
|
||||
|
14
src/test/kc/procedure-declare-6.c
Normal file
14
src/test/kc/procedure-declare-6.c
Normal file
@ -0,0 +1,14 @@
|
||||
// Procedure Declaration - declaration and definition mismatch of a procedure
|
||||
|
||||
char f(char a);
|
||||
|
||||
int f(char a) {
|
||||
return a+1;
|
||||
}
|
||||
|
||||
void main() {
|
||||
int * const SCREEN = (char*)0x0400;
|
||||
SCREEN[0] = f('a');
|
||||
SCREEN[1] = f('b');
|
||||
}
|
||||
|
17
src/test/kc/procedure-declare-7.c
Normal file
17
src/test/kc/procedure-declare-7.c
Normal file
@ -0,0 +1,17 @@
|
||||
// Procedure Declaration - two declarations mismatch of a procedure
|
||||
|
||||
char f(char a);
|
||||
|
||||
int f(char a);
|
||||
|
||||
void main() {
|
||||
char * const SCREEN = (char*)0x0400;
|
||||
SCREEN[0] = f('a');
|
||||
SCREEN[1] = f('b');
|
||||
}
|
||||
|
||||
char f(char a) {
|
||||
return a+1;
|
||||
}
|
||||
|
||||
|
21
src/test/kc/procedure-declare-8.c
Normal file
21
src/test/kc/procedure-declare-8.c
Normal file
@ -0,0 +1,21 @@
|
||||
// Pointer to procedure
|
||||
|
||||
char * const SCREEN = (char*)0x0400;
|
||||
|
||||
void proc1() {
|
||||
SCREEN[0] = 'a';
|
||||
}
|
||||
|
||||
void proc2() {
|
||||
SCREEN[1] = 'b';
|
||||
}
|
||||
|
||||
void (*proc_ptr)(void);
|
||||
|
||||
void main() {
|
||||
proc_ptr = &proc1;
|
||||
(*proc_ptr)();
|
||||
proc_ptr = &proc2;
|
||||
(*proc_ptr)();
|
||||
}
|
||||
|
17
src/test/kc/procedure-declare-9.c
Normal file
17
src/test/kc/procedure-declare-9.c
Normal file
@ -0,0 +1,17 @@
|
||||
// Pointer to pointer to procedure - using typedef
|
||||
|
||||
// Typedef a pointer to a procedure returning void, taking no parameters
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
|
||||
// Use typedef to define const pointer to pointer to no-arg-noreturn procedure
|
||||
IRQ_TYPE * const IRQ = (IRQ_TYPE*)0x314;
|
||||
|
||||
char * const SCREEN = (char*)0x0400;
|
||||
|
||||
__interrupt void irq() {
|
||||
SCREEN[0]++;
|
||||
}
|
||||
|
||||
void main() {
|
||||
*IRQ = &irq;
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
void()** const KERNEL_IRQ = (void()**)$0314;
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
IRQ_TYPE* const KERNEL_IRQ = (IRQ_TYPE*)$0314;
|
||||
byte* const BG_COLOR = (byte*)$d020;
|
||||
byte* const FGCOL = (byte*)$d021;
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
// Tests that volatile variables can be both read & written inside & outside interrupts
|
||||
// Currently fails because the modification is optimized away
|
||||
|
||||
void()** const KERNEL_IRQ = (void()**)$0314;
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
IRQ_TYPE * const KERNEL_IRQ = (IRQ_TYPE*)$0314;
|
||||
|
||||
byte* const BG_COLOR = (byte*)$d020;
|
||||
volatile byte col = 0;
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
void()** const KERNEL_IRQ = (void()**)$0314;
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
|
||||
IRQ_TYPE* const KERNEL_IRQ = (IRQ_TYPE*)$0314;
|
||||
byte* const BG_COLOR = (byte*)$d020;
|
||||
volatile byte col = 0;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
void()** const KERNEL_IRQ = (void()**)$0314;
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
IRQ_TYPE* const KERNEL_IRQ = (IRQ_TYPE*)$0314;
|
||||
byte* const BG_COLOR = (byte*)$d020;
|
||||
byte* const FGCOL = (byte*)$d021;
|
||||
|
||||
|
@ -1,4 +1,7 @@
|
||||
// Test typeid() of the different types
|
||||
|
||||
typedef byte (*PROC_PTR)();
|
||||
|
||||
void main() {
|
||||
byte* const SCREEN = (char*)$400;
|
||||
byte idx = 0;
|
||||
@ -20,7 +23,7 @@ void main() {
|
||||
SCREEN[idx++] = typeid(signed dword*);
|
||||
SCREEN[idx++] = typeid(bool*);
|
||||
// Pointer to procedure
|
||||
SCREEN[idx++] = typeid(byte()*);
|
||||
SCREEN[idx++] = typeid(PROC_PTR);
|
||||
// Pointer to pointer
|
||||
SCREEN[idx++] = typeid(byte**);
|
||||
|
||||
|
@ -6,7 +6,8 @@ void main() {
|
||||
*SCREEN = 'x';
|
||||
}
|
||||
|
||||
void()** const HARDWARE_IRQ = (void()**)$fffe;
|
||||
typedef void (*IRQ_TYPE)(void);
|
||||
IRQ_TYPE * const HARDWARE_IRQ = (IRQ_TYPE*)$fffe;
|
||||
|
||||
// Unused Interrupt Routine
|
||||
__interrupt void irq1() {
|
||||
|
@ -51,7 +51,7 @@ void __start()
|
||||
volatile byte idx loadstore !zp[-1]:3
|
||||
void main()
|
||||
void print(volatile byte print::ch)
|
||||
volatile byte print::ch loadstore !zp[-1]:2
|
||||
volatile byte print::ch loadstore
|
||||
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
@ -118,7 +118,7 @@ void __start()
|
||||
volatile byte idx loadstore !zp[-1]:3 0.2222222222222222
|
||||
void main()
|
||||
void print(volatile byte print::ch)
|
||||
volatile byte print::ch loadstore !zp[-1]:2 11.0
|
||||
volatile byte print::ch loadstore 11.0
|
||||
|
||||
Initial phi equivalence classes
|
||||
Added variable idx to live range equivalence class [ idx ]
|
||||
@ -126,6 +126,7 @@ Added variable print::ch to live range equivalence class [ print::ch ]
|
||||
Complete equivalence classes
|
||||
[ idx ]
|
||||
[ print::ch ]
|
||||
Allocated zp[1]:2 [ print::ch ]
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [1] idx = 0 [ idx ] ( [ idx ] { } ) always clobbers reg byte a
|
||||
Statement [5] print::ch = 'c' [ idx print::ch ] ( main:3 [ idx print::ch ] { } ) always clobbers reg byte a
|
||||
@ -260,7 +261,7 @@ void __start()
|
||||
volatile byte idx loadstore !zp[-1]:3 zp[1]:3 0.2222222222222222
|
||||
void main()
|
||||
void print(volatile byte print::ch)
|
||||
volatile byte print::ch loadstore !zp[-1]:2 zp[1]:2 11.0
|
||||
volatile byte print::ch loadstore zp[1]:2 11.0
|
||||
|
||||
zp[1]:3 [ idx ]
|
||||
zp[1]:2 [ print::ch ]
|
||||
|
@ -3,7 +3,7 @@ void __start()
|
||||
volatile byte idx loadstore !zp[-1]:3 zp[1]:3 0.2222222222222222
|
||||
void main()
|
||||
void print(volatile byte print::ch)
|
||||
volatile byte print::ch loadstore !zp[-1]:2 zp[1]:2 11.0
|
||||
volatile byte print::ch loadstore zp[1]:2 11.0
|
||||
|
||||
zp[1]:3 [ idx ]
|
||||
zp[1]:2 [ print::ch ]
|
||||
|
@ -21,22 +21,22 @@ __start: {
|
||||
main: {
|
||||
// print('c')
|
||||
lda #'c'
|
||||
sta print.ch
|
||||
sta.z print.ch
|
||||
jsr print
|
||||
// print('m')
|
||||
lda #'m'
|
||||
sta print.ch
|
||||
sta.z print.ch
|
||||
jsr print
|
||||
// print('l')
|
||||
lda #'l'
|
||||
sta print.ch
|
||||
sta.z print.ch
|
||||
jsr print
|
||||
// }
|
||||
rts
|
||||
}
|
||||
// print(byte mem($3001) ch)
|
||||
// print(byte zp(2) ch)
|
||||
print: {
|
||||
.label ch = $3001
|
||||
.label ch = 2
|
||||
// asm
|
||||
ldx idx
|
||||
lda ch
|
||||
|
@ -51,7 +51,7 @@ void __start()
|
||||
volatile byte idx loadstore !mem[-1]:12288
|
||||
void main()
|
||||
void print(volatile byte print::ch)
|
||||
volatile byte print::ch loadstore !mem[-1]:12289
|
||||
volatile byte print::ch loadstore
|
||||
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
@ -118,7 +118,7 @@ void __start()
|
||||
volatile byte idx loadstore !mem[-1]:12288 0.2222222222222222
|
||||
void main()
|
||||
void print(volatile byte print::ch)
|
||||
volatile byte print::ch loadstore !mem[-1]:12289 11.0
|
||||
volatile byte print::ch loadstore 11.0
|
||||
|
||||
Initial phi equivalence classes
|
||||
Added variable idx to live range equivalence class [ idx ]
|
||||
@ -126,6 +126,7 @@ Added variable print::ch to live range equivalence class [ print::ch ]
|
||||
Complete equivalence classes
|
||||
[ idx ]
|
||||
[ print::ch ]
|
||||
Allocated zp[1]:2 [ print::ch ]
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [1] idx = 0 [ idx ] ( [ idx ] { } ) always clobbers reg byte a
|
||||
Statement [5] print::ch = 'c' [ idx print::ch ] ( main:3 [ idx print::ch ] { } ) always clobbers reg byte a
|
||||
@ -133,22 +134,22 @@ Statement [7] print::ch = 'm' [ idx print::ch ] ( main:3 [ idx print::ch ] { }
|
||||
Statement [9] print::ch = 'l' [ idx print::ch ] ( main:3 [ idx print::ch ] { } ) always clobbers reg byte a
|
||||
Statement asm { ldxidx ldach staSCREEN,x incidx } always clobbers reg byte a reg byte x
|
||||
Potential registers mem[1]:12288 [ idx ] : mem[1]:12288 ,
|
||||
Potential registers mem[1]:12289 [ print::ch ] : mem[1]:12289 ,
|
||||
Potential registers zp[1]:2 [ print::ch ] : zp[1]:2 ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [print] 11: mem[1]:12289 [ print::ch ]
|
||||
Uplift Scope [print] 11: zp[1]:2 [ print::ch ]
|
||||
Uplift Scope [] 0.22: mem[1]:12288 [ idx ]
|
||||
Uplift Scope [main]
|
||||
Uplift Scope [__start]
|
||||
|
||||
Uplifting [print] best 133 combination mem[1]:12289 [ print::ch ]
|
||||
Uplifting [] best 133 combination mem[1]:12288 [ idx ]
|
||||
Uplifting [main] best 133 combination
|
||||
Uplifting [__start] best 133 combination
|
||||
Attempting to uplift remaining variables inmem[1]:12289 [ print::ch ]
|
||||
Uplifting [print] best 133 combination mem[1]:12289 [ print::ch ]
|
||||
Uplifting [print] best 130 combination zp[1]:2 [ print::ch ]
|
||||
Uplifting [] best 130 combination mem[1]:12288 [ idx ]
|
||||
Uplifting [main] best 130 combination
|
||||
Uplifting [__start] best 130 combination
|
||||
Attempting to uplift remaining variables inzp[1]:2 [ print::ch ]
|
||||
Uplifting [print] best 130 combination zp[1]:2 [ print::ch ]
|
||||
Attempting to uplift remaining variables inmem[1]:12288 [ idx ]
|
||||
Uplifting [] best 133 combination mem[1]:12288 [ idx ]
|
||||
Uplifting [] best 130 combination mem[1]:12288 [ idx ]
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
@ -190,25 +191,25 @@ __start: {
|
||||
}
|
||||
// main
|
||||
main: {
|
||||
// [5] print::ch = 'c' -- vbum1=vbuc1
|
||||
// [5] print::ch = 'c' -- vbuz1=vbuc1
|
||||
lda #'c'
|
||||
sta print.ch
|
||||
sta.z print.ch
|
||||
// [6] call print
|
||||
jsr print
|
||||
jmp __b1
|
||||
// main::@1
|
||||
__b1:
|
||||
// [7] print::ch = 'm' -- vbum1=vbuc1
|
||||
// [7] print::ch = 'm' -- vbuz1=vbuc1
|
||||
lda #'m'
|
||||
sta print.ch
|
||||
sta.z print.ch
|
||||
// [8] call print
|
||||
jsr print
|
||||
jmp __b2
|
||||
// main::@2
|
||||
__b2:
|
||||
// [9] print::ch = 'l' -- vbum1=vbuc1
|
||||
// [9] print::ch = 'l' -- vbuz1=vbuc1
|
||||
lda #'l'
|
||||
sta print.ch
|
||||
sta.z print.ch
|
||||
// [10] call print
|
||||
jsr print
|
||||
jmp __breturn
|
||||
@ -218,9 +219,9 @@ main: {
|
||||
rts
|
||||
}
|
||||
// print
|
||||
// print(byte mem($3001) ch)
|
||||
// print(byte zp(2) ch)
|
||||
print: {
|
||||
.label ch = $3001
|
||||
.label ch = 2
|
||||
// asm { ldxidx ldach staSCREEN,x incidx }
|
||||
ldx idx
|
||||
lda ch
|
||||
@ -260,14 +261,14 @@ void __start()
|
||||
volatile byte idx loadstore !mem[-1]:12288 mem[1]:12288 0.2222222222222222
|
||||
void main()
|
||||
void print(volatile byte print::ch)
|
||||
volatile byte print::ch loadstore !mem[-1]:12289 mem[1]:12289 11.0
|
||||
volatile byte print::ch loadstore zp[1]:2 11.0
|
||||
|
||||
mem[1]:12288 [ idx ]
|
||||
mem[1]:12289 [ print::ch ]
|
||||
zp[1]:2 [ print::ch ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 85
|
||||
Score: 82
|
||||
|
||||
// File Comments
|
||||
// Test declaring a variable as at a hard-coded address
|
||||
@ -303,23 +304,23 @@ __start: {
|
||||
// main
|
||||
main: {
|
||||
// print('c')
|
||||
// [5] print::ch = 'c' -- vbum1=vbuc1
|
||||
// [5] print::ch = 'c' -- vbuz1=vbuc1
|
||||
lda #'c'
|
||||
sta print.ch
|
||||
sta.z print.ch
|
||||
// [6] call print
|
||||
jsr print
|
||||
// main::@1
|
||||
// print('m')
|
||||
// [7] print::ch = 'm' -- vbum1=vbuc1
|
||||
// [7] print::ch = 'm' -- vbuz1=vbuc1
|
||||
lda #'m'
|
||||
sta print.ch
|
||||
sta.z print.ch
|
||||
// [8] call print
|
||||
jsr print
|
||||
// main::@2
|
||||
// print('l')
|
||||
// [9] print::ch = 'l' -- vbum1=vbuc1
|
||||
// [9] print::ch = 'l' -- vbuz1=vbuc1
|
||||
lda #'l'
|
||||
sta print.ch
|
||||
sta.z print.ch
|
||||
// [10] call print
|
||||
jsr print
|
||||
// main::@return
|
||||
@ -328,9 +329,9 @@ main: {
|
||||
rts
|
||||
}
|
||||
// print
|
||||
// print(byte mem($3001) ch)
|
||||
// print(byte zp(2) ch)
|
||||
print: {
|
||||
.label ch = $3001
|
||||
.label ch = 2
|
||||
// asm
|
||||
// asm { ldxidx ldach staSCREEN,x incidx }
|
||||
ldx idx
|
||||
|
@ -3,7 +3,7 @@ void __start()
|
||||
volatile byte idx loadstore !mem[-1]:12288 mem[1]:12288 0.2222222222222222
|
||||
void main()
|
||||
void print(volatile byte print::ch)
|
||||
volatile byte print::ch loadstore !mem[-1]:12289 mem[1]:12289 11.0
|
||||
volatile byte print::ch loadstore zp[1]:2 11.0
|
||||
|
||||
mem[1]:12288 [ idx ]
|
||||
mem[1]:12289 [ print::ch ]
|
||||
zp[1]:2 [ print::ch ]
|
||||
|
@ -3,50 +3,6 @@ Inlined call call __init
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
|
||||
void* memset(void* memset::str , byte memset::c , word memset::num)
|
||||
memset: scope:[memset] from bitmap_clear bitmap_clear::@1
|
||||
memset::c#5 = phi( bitmap_clear/memset::c#0, bitmap_clear::@1/memset::c#1 )
|
||||
memset::str#4 = phi( bitmap_clear/memset::str#0, bitmap_clear::@1/memset::str#1 )
|
||||
memset::num#2 = phi( bitmap_clear/memset::num#0, bitmap_clear::@1/memset::num#1 )
|
||||
memset::$0 = memset::num#2 > 0
|
||||
memset::$1 = ! memset::$0
|
||||
if(memset::$1) goto memset::@1
|
||||
to:memset::@2
|
||||
memset::@1: scope:[memset] from memset memset::@3
|
||||
memset::str#2 = phi( memset/memset::str#4, memset::@3/memset::str#5 )
|
||||
memset::return#0 = memset::str#2
|
||||
to:memset::@return
|
||||
memset::@2: scope:[memset] from memset
|
||||
memset::c#4 = phi( memset/memset::c#5 )
|
||||
memset::num#3 = phi( memset/memset::num#2 )
|
||||
memset::str#3 = phi( memset/memset::str#4 )
|
||||
memset::$4 = (byte*)memset::str#3
|
||||
memset::$2 = memset::$4 + memset::num#3
|
||||
memset::end#0 = memset::$2
|
||||
memset::dst#0 = ((byte*)) memset::str#3
|
||||
to:memset::@3
|
||||
memset::@3: scope:[memset] from memset::@2 memset::@4
|
||||
memset::c#3 = phi( memset::@2/memset::c#4, memset::@4/memset::c#2 )
|
||||
memset::str#5 = phi( memset::@2/memset::str#3, memset::@4/memset::str#6 )
|
||||
memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 )
|
||||
memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 )
|
||||
memset::$3 = memset::dst#2 != memset::end#1
|
||||
if(memset::$3) goto memset::@4
|
||||
to:memset::@1
|
||||
memset::@4: scope:[memset] from memset::@3
|
||||
memset::str#6 = phi( memset::@3/memset::str#5 )
|
||||
memset::end#2 = phi( memset::@3/memset::end#1 )
|
||||
memset::dst#3 = phi( memset::@3/memset::dst#2 )
|
||||
memset::c#2 = phi( memset::@3/memset::c#3 )
|
||||
*memset::dst#3 = memset::c#2
|
||||
memset::dst#1 = ++ memset::dst#3
|
||||
to:memset::@3
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
memset::return#4 = phi( memset::@1/memset::return#0 )
|
||||
memset::return#1 = memset::return#4
|
||||
return
|
||||
to:@return
|
||||
|
||||
void bitmap_init(byte* bitmap_init::gfx , byte* bitmap_init::screen)
|
||||
bitmap_init: scope:[bitmap_init] from main
|
||||
bitmap_init::screen#1 = phi( main/bitmap_init::screen#0 )
|
||||
@ -146,7 +102,7 @@ bitmap_clear: scope:[bitmap_clear] from main::@2
|
||||
memset::c#0 = bitmap_clear::col#0
|
||||
memset::num#0 = $3e8
|
||||
call memset
|
||||
memset::return#2 = memset::return#1
|
||||
memset::return#0 = memset::return#3
|
||||
to:bitmap_clear::@1
|
||||
bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear
|
||||
bitmap_gfx#8 = phi( bitmap_clear/bitmap_gfx#14 )
|
||||
@ -154,7 +110,7 @@ bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear
|
||||
memset::c#1 = 0
|
||||
memset::num#1 = $1f40
|
||||
call memset
|
||||
memset::return#3 = memset::return#1
|
||||
memset::return#1 = memset::return#3
|
||||
to:bitmap_clear::@2
|
||||
bitmap_clear::@2: scope:[bitmap_clear] from bitmap_clear::@1
|
||||
to:bitmap_clear::@return
|
||||
@ -413,6 +369,50 @@ bitmap_line::@11: scope:[bitmap_line] from bitmap_line::@19
|
||||
bitmap_line::e1#2 = bitmap_line::e1#4 - bitmap_line::dx#6
|
||||
to:bitmap_line::@10
|
||||
|
||||
void* memset(void* memset::str , byte memset::c , word memset::num)
|
||||
memset: scope:[memset] from bitmap_clear bitmap_clear::@1
|
||||
memset::c#5 = phi( bitmap_clear/memset::c#0, bitmap_clear::@1/memset::c#1 )
|
||||
memset::str#4 = phi( bitmap_clear/memset::str#0, bitmap_clear::@1/memset::str#1 )
|
||||
memset::num#2 = phi( bitmap_clear/memset::num#0, bitmap_clear::@1/memset::num#1 )
|
||||
memset::$0 = memset::num#2 > 0
|
||||
memset::$1 = ! memset::$0
|
||||
if(memset::$1) goto memset::@1
|
||||
to:memset::@2
|
||||
memset::@1: scope:[memset] from memset memset::@3
|
||||
memset::str#2 = phi( memset/memset::str#4, memset::@3/memset::str#5 )
|
||||
memset::return#2 = memset::str#2
|
||||
to:memset::@return
|
||||
memset::@2: scope:[memset] from memset
|
||||
memset::c#4 = phi( memset/memset::c#5 )
|
||||
memset::num#3 = phi( memset/memset::num#2 )
|
||||
memset::str#3 = phi( memset/memset::str#4 )
|
||||
memset::$4 = (byte*)memset::str#3
|
||||
memset::$2 = memset::$4 + memset::num#3
|
||||
memset::end#0 = memset::$2
|
||||
memset::dst#0 = ((byte*)) memset::str#3
|
||||
to:memset::@3
|
||||
memset::@3: scope:[memset] from memset::@2 memset::@4
|
||||
memset::c#3 = phi( memset::@2/memset::c#4, memset::@4/memset::c#2 )
|
||||
memset::str#5 = phi( memset::@2/memset::str#3, memset::@4/memset::str#6 )
|
||||
memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 )
|
||||
memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 )
|
||||
memset::$3 = memset::dst#2 != memset::end#1
|
||||
if(memset::$3) goto memset::@4
|
||||
to:memset::@1
|
||||
memset::@4: scope:[memset] from memset::@3
|
||||
memset::str#6 = phi( memset::@3/memset::str#5 )
|
||||
memset::end#2 = phi( memset::@3/memset::end#1 )
|
||||
memset::dst#3 = phi( memset::@3/memset::dst#2 )
|
||||
memset::c#2 = phi( memset::@3/memset::c#3 )
|
||||
*memset::dst#3 = memset::c#2
|
||||
memset::dst#1 = ++ memset::dst#3
|
||||
to:memset::@3
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
memset::return#4 = phi( memset::@1/memset::return#2 )
|
||||
memset::return#3 = memset::return#4
|
||||
return
|
||||
to:@return
|
||||
|
||||
word abs_u16(word abs_u16::w)
|
||||
abs_u16: scope:[abs_u16] from bitmap_line bitmap_line::@12
|
||||
abs_u16::w#2 = phi( bitmap_line/abs_u16::w#0, bitmap_line::@12/abs_u16::w#1 )
|
||||
@ -994,7 +994,6 @@ word sgn_u16::w#2
|
||||
|
||||
Fixing inline constructor with bitmap_plot::$2 = (byte)bitmap_plot_yhi[bitmap_plot::y#4] w= (byte)bitmap_plot_ylo[bitmap_plot::y#4]
|
||||
Successful SSA optimization Pass2FixInlineConstructors
|
||||
Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#2 > 0
|
||||
Adding number conversion cast (unumber) 1 in bitmap_init::bits#1 = bitmap_init::bits#3 >> 1
|
||||
Adding number conversion cast (unumber) 0 in bitmap_init::$0 = bitmap_init::bits#1 == 0
|
||||
Adding number conversion cast (unumber) $80 in bitmap_init::bits#2 = $80
|
||||
@ -1017,6 +1016,7 @@ Adding number conversion cast (unumber) 2 in bitmap_line::$20 = bitmap_line::dy#
|
||||
Adding number conversion cast (unumber) bitmap_line::$20 in bitmap_line::$20 = bitmap_line::dy#2 / (unumber)2
|
||||
Adding number conversion cast (unumber) 2 in bitmap_line::$15 = bitmap_line::dx#3 / 2
|
||||
Adding number conversion cast (unumber) bitmap_line::$15 in bitmap_line::$15 = bitmap_line::dx#3 / (unumber)2
|
||||
Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#2 > 0
|
||||
Adding number conversion cast (unumber) $80 in abs_u16::$1 = abs_u16::$0 & $80
|
||||
Adding number conversion cast (unumber) abs_u16::$1 in abs_u16::$1 = abs_u16::$0 & (unumber)$80
|
||||
Adding number conversion cast (unumber) 0 in abs_u16::$3 = 0 != abs_u16::$1
|
||||
@ -1040,9 +1040,9 @@ Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Adding number conversion cast (unumber) $40 in *VICII_MEMORY = (byte)(word)SCREEN&(unumber)$3fff/$40|(word)BITMAP&(unumber)$3fff/$400
|
||||
Adding number conversion cast (unumber) $400 in *VICII_MEMORY = (byte)(word)SCREEN&(unumber)$3fff/(unumber)$40|(word)BITMAP&(unumber)$3fff/$400
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Inlining cast memset::dst#0 = (byte*)memset::str#3
|
||||
Inlining cast bitmap_init::bits#2 = (unumber)$80
|
||||
Inlining cast memset::c#1 = (unumber)0
|
||||
Inlining cast memset::dst#0 = (byte*)memset::str#3
|
||||
Inlining cast sgn_u16::return#2 = (unumber)-1
|
||||
Inlining cast sgn_u16::return#3 = (unumber)1
|
||||
Inlining cast *BORDER_COLOR = (unumber)0
|
||||
@ -1059,7 +1059,6 @@ Simplifying constant pointer cast (byte*) 53265
|
||||
Simplifying constant pointer cast (byte*) 53272
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Simplifying constant pointer cast (byte*) 8192
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 1
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast $80
|
||||
@ -1075,6 +1074,7 @@ Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 2
|
||||
Simplifying constant integer cast 2
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast $80
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast $80
|
||||
@ -1095,7 +1095,6 @@ Simplifying constant integer cast $64
|
||||
Simplifying constant integer cast $400
|
||||
Simplifying constant integer cast $14
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 1
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) $80
|
||||
@ -1109,6 +1108,7 @@ Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 2
|
||||
Finalized unsigned number type (byte) 2
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) $80
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) $80
|
||||
@ -1138,21 +1138,12 @@ Inferred type updated to word in bitmap_line::$20 = bitmap_line::dy#2 / 2
|
||||
Inferred type updated to word in bitmap_line::$15 = bitmap_line::dx#3 / 2
|
||||
Inferred type updated to byte in abs_u16::$1 = abs_u16::$0 & $80
|
||||
Inferred type updated to byte in sgn_u16::$1 = sgn_u16::$0 & $80
|
||||
Inversing boolean not [2] memset::$1 = memset::num#2 <= 0 from [1] memset::$0 = memset::num#2 > 0
|
||||
Inversing boolean not [29] bitmap_init::$1 = bitmap_init::bits#1 != 0 from [28] bitmap_init::$0 = bitmap_init::bits#1 == 0
|
||||
Inversing boolean not [49] bitmap_init::$9 = bitmap_init::$7 != 7 from [48] bitmap_init::$8 = bitmap_init::$7 == 7
|
||||
Inversing boolean not [144] bitmap_line::$18 = bitmap_line::dy#3 >= bitmap_line::e#1 from [143] bitmap_line::$17 = bitmap_line::dy#3 < bitmap_line::e#1
|
||||
Inversing boolean not [164] bitmap_line::$23 = bitmap_line::dx#5 >= bitmap_line::e1#1 from [163] bitmap_line::$22 = bitmap_line::dx#5 < bitmap_line::e1#1
|
||||
Inversing boolean not [9] bitmap_init::$1 = bitmap_init::bits#1 != 0 from [8] bitmap_init::$0 = bitmap_init::bits#1 == 0
|
||||
Inversing boolean not [29] bitmap_init::$9 = bitmap_init::$7 != 7 from [28] bitmap_init::$8 = bitmap_init::$7 == 7
|
||||
Inversing boolean not [124] bitmap_line::$18 = bitmap_line::dy#3 >= bitmap_line::e#1 from [123] bitmap_line::$17 = bitmap_line::dy#3 < bitmap_line::e#1
|
||||
Inversing boolean not [144] bitmap_line::$23 = bitmap_line::dx#5 >= bitmap_line::e1#1 from [143] bitmap_line::$22 = bitmap_line::dx#5 < bitmap_line::e1#1
|
||||
Inversing boolean not [154] memset::$1 = memset::num#2 <= 0 from [153] memset::$0 = memset::num#2 > 0
|
||||
Successful SSA optimization Pass2UnaryNotSimplification
|
||||
Alias memset::return#0 = memset::str#2 memset::return#4 memset::return#1
|
||||
Alias memset::str#3 = memset::str#4
|
||||
Alias memset::num#2 = memset::num#3
|
||||
Alias memset::c#4 = memset::c#5
|
||||
Alias memset::end#0 = memset::$2
|
||||
Alias memset::c#2 = memset::c#3
|
||||
Alias memset::dst#2 = memset::dst#3
|
||||
Alias memset::end#1 = memset::end#2
|
||||
Alias memset::str#5 = memset::str#6
|
||||
Alias bitmap_init::x#2 = bitmap_init::x#4
|
||||
Alias bitmap_init::gfx#4 = bitmap_init::gfx#5
|
||||
Alias bitmap_gfx#25 = bitmap_gfx#26
|
||||
@ -1207,6 +1198,15 @@ Alias bitmap_line::y#15 = bitmap_line::y#8 bitmap_line::y#9
|
||||
Alias bitmap_line::sy#2 = bitmap_line::sy#4 bitmap_line::sy#7
|
||||
Alias bitmap_line::e1#1 = bitmap_line::e1#4
|
||||
Alias bitmap_line::x#15 = bitmap_line::x#2
|
||||
Alias memset::return#2 = memset::str#2 memset::return#4 memset::return#3
|
||||
Alias memset::str#3 = memset::str#4
|
||||
Alias memset::num#2 = memset::num#3
|
||||
Alias memset::c#4 = memset::c#5
|
||||
Alias memset::end#0 = memset::$2
|
||||
Alias memset::c#2 = memset::c#3
|
||||
Alias memset::dst#2 = memset::dst#3
|
||||
Alias memset::end#1 = memset::end#2
|
||||
Alias memset::str#5 = memset::str#6
|
||||
Alias abs_u16::w#2 = abs_u16::w#3 abs_u16::w#4 abs_u16::return#3
|
||||
Alias abs_u16::return#2 = abs_u16::$2
|
||||
Alias abs_u16::return#4 = abs_u16::return#7
|
||||
@ -1246,9 +1246,6 @@ Alias bitmap_line::dy#12 = bitmap_line::dy#13
|
||||
Alias bitmap_line::dx#12 = bitmap_line::dx#5
|
||||
Alias bitmap_line::sy#2 = bitmap_line::sy#9
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values memset::end#1 memset::end#0
|
||||
Identical Phi Values memset::str#5 memset::str#3
|
||||
Identical Phi Values memset::c#2 memset::c#4
|
||||
Identical Phi Values bitmap_init::gfx#1 bitmap_init::gfx#0
|
||||
Identical Phi Values bitmap_init::screen#1 bitmap_init::screen#0
|
||||
Identical Phi Values bitmap_init::gfx#2 bitmap_init::gfx#1
|
||||
@ -1274,6 +1271,9 @@ Identical Phi Values bitmap_line::dy#12 bitmap_line::dy#0
|
||||
Identical Phi Values bitmap_line::dx#12 bitmap_line::dx#0
|
||||
Identical Phi Values bitmap_line::x2#3 bitmap_line::x2#1
|
||||
Identical Phi Values bitmap_line::sy#2 bitmap_line::sy#0
|
||||
Identical Phi Values memset::end#1 memset::end#0
|
||||
Identical Phi Values memset::str#5 memset::str#3
|
||||
Identical Phi Values memset::c#2 memset::c#4
|
||||
Identical Phi Values bitmap_gfx#15 bitmap_gfx#17
|
||||
Identical Phi Values bitmap_screen#14 bitmap_screen#16
|
||||
Identical Phi Values next#10 next#11
|
||||
@ -1285,27 +1285,27 @@ Identical Phi Values bitmap_gfx#11 bitmap_gfx#10
|
||||
Identical Phi Values bitmap_screen#11 bitmap_screen#10
|
||||
Identical Phi Values next#3 next#0
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Identical Phi Values memset::return#0 memset::str#3
|
||||
Identical Phi Values memset::return#2 memset::str#3
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Identified duplicate assignment right side [47] bitmap_init::$7 = bitmap_init::y#2 & 7
|
||||
Identified duplicate assignment right side [27] bitmap_init::$7 = bitmap_init::y#2 & 7
|
||||
Successful SSA optimization Pass2DuplicateRValueIdentification
|
||||
Simple Condition memset::$1 [2] if(memset::num#2<=0) goto memset::@1
|
||||
Simple Condition memset::$3 [9] if(memset::dst#2!=memset::end#0) goto memset::@4
|
||||
Simple Condition bitmap_init::$1 [22] if(bitmap_init::bits#1!=0) goto bitmap_init::@2
|
||||
Simple Condition bitmap_init::$2 [26] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1
|
||||
Simple Condition bitmap_init::$9 [38] if(bitmap_init::$7!=7) goto bitmap_init::@6
|
||||
Simple Condition bitmap_init::$11 [42] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5
|
||||
Simple Condition bitmap_line::$12 [90] if(bitmap_line::dx#0>bitmap_line::dy#0) goto bitmap_line::@2
|
||||
Simple Condition bitmap_line::$18 [104] if(bitmap_line::dy#0>=bitmap_line::e#1) goto bitmap_line::@7
|
||||
Simple Condition bitmap_line::$19 [107] if(bitmap_line::y#1!=bitmap_line::y2#0) goto bitmap_line::@6
|
||||
Simple Condition bitmap_line::$23 [121] if(bitmap_line::dx#0>=bitmap_line::e1#1) goto bitmap_line::@10
|
||||
Simple Condition bitmap_line::$24 [124] if(bitmap_line::x#15!=bitmap_line::x2#0) goto bitmap_line::@9
|
||||
Simple Condition bitmap_init::$1 [9] if(bitmap_init::bits#1!=0) goto bitmap_init::@2
|
||||
Simple Condition bitmap_init::$2 [13] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1
|
||||
Simple Condition bitmap_init::$9 [25] if(bitmap_init::$7!=7) goto bitmap_init::@6
|
||||
Simple Condition bitmap_init::$11 [29] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5
|
||||
Simple Condition bitmap_line::$12 [77] if(bitmap_line::dx#0>bitmap_line::dy#0) goto bitmap_line::@2
|
||||
Simple Condition bitmap_line::$18 [91] if(bitmap_line::dy#0>=bitmap_line::e#1) goto bitmap_line::@7
|
||||
Simple Condition bitmap_line::$19 [94] if(bitmap_line::y#1!=bitmap_line::y2#0) goto bitmap_line::@6
|
||||
Simple Condition bitmap_line::$23 [108] if(bitmap_line::dx#0>=bitmap_line::e1#1) goto bitmap_line::@10
|
||||
Simple Condition bitmap_line::$24 [111] if(bitmap_line::x#15!=bitmap_line::x2#0) goto bitmap_line::@9
|
||||
Simple Condition memset::$1 [116] if(memset::num#2<=0) goto memset::@1
|
||||
Simple Condition memset::$3 [123] if(memset::dst#2!=memset::end#0) goto memset::@4
|
||||
Simple Condition abs_u16::$3 [131] if(0!=abs_u16::$1) goto abs_u16::@1
|
||||
Simple Condition sgn_u16::$2 [139] if(0!=sgn_u16::$1) goto sgn_u16::@1
|
||||
Simple Condition init_screen::$0 [169] if(init_screen::c#2!=SCREEN+$400) goto init_screen::@2
|
||||
Successful SSA optimization Pass2ConditionalJumpSimplification
|
||||
Rewriting ! if()-condition to reversed if() [79] bitmap_line::$7 = ! bitmap_line::$6
|
||||
Rewriting && if()-condition to two if()s [78] bitmap_line::$6 = bitmap_line::$4 && bitmap_line::$5
|
||||
Rewriting ! if()-condition to reversed if() [66] bitmap_line::$7 = ! bitmap_line::$6
|
||||
Rewriting && if()-condition to two if()s [65] bitmap_line::$6 = bitmap_line::$4 && bitmap_line::$5
|
||||
Successful SSA optimization Pass2ConditionalAndOrRewriting
|
||||
Constant bitmap_init::bits#0 = $80
|
||||
Constant bitmap_init::x#0 = 0
|
||||
@ -1338,22 +1338,22 @@ Constant memset::str#1 = (void*)bitmap_gfx#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
if() condition always true - replacing block destination [164] if(true) goto main::@1
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Resolved ranged next value [24] bitmap_init::x#1 = ++ bitmap_init::x#2 to ++
|
||||
Resolved ranged comparison value [26] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1 to 0
|
||||
Resolved ranged next value [40] bitmap_init::y#1 = ++ bitmap_init::y#2 to ++
|
||||
Resolved ranged comparison value [42] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5 to 0
|
||||
Resolved ranged next value [11] bitmap_init::x#1 = ++ bitmap_init::x#2 to ++
|
||||
Resolved ranged comparison value [13] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1 to 0
|
||||
Resolved ranged next value [27] bitmap_init::y#1 = ++ bitmap_init::y#2 to ++
|
||||
Resolved ranged comparison value [29] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5 to 0
|
||||
Simplifying constant evaluating to zero (byte)bitmap_line::y1#0 in
|
||||
Successful SSA optimization PassNSimplifyConstantZero
|
||||
Simplifying expression containing zero bitmap_clear::$0 in [47] bitmap_clear::col#0 = bitmap_clear::$0 + bitmap_clear::bgcol#0
|
||||
Simplifying expression containing zero bitmap_line::x2#0 in [68] abs_u16::w#0 = bitmap_line::x2#0 - bitmap_line::x1#0
|
||||
Simplifying expression containing zero bitmap_line::y2#0 in [72] abs_u16::w#1 = bitmap_line::y2#0 - bitmap_line::y1#0
|
||||
Simplifying expression containing zero bitmap_line::x2#0 in [81] sgn_u16::w#0 = bitmap_line::x2#0 - bitmap_line::x1#0
|
||||
Simplifying expression containing zero bitmap_line::y2#0 in [85] sgn_u16::w#1 = bitmap_line::y2#0 - bitmap_line::y1#0
|
||||
Simplifying expression containing zero bitmap_clear::$0 in [34] bitmap_clear::col#0 = bitmap_clear::$0 + bitmap_clear::bgcol#0
|
||||
Simplifying expression containing zero bitmap_line::x2#0 in [55] abs_u16::w#0 = bitmap_line::x2#0 - bitmap_line::x1#0
|
||||
Simplifying expression containing zero bitmap_line::y2#0 in [59] abs_u16::w#1 = bitmap_line::y2#0 - bitmap_line::y1#0
|
||||
Simplifying expression containing zero bitmap_line::x2#0 in [68] sgn_u16::w#0 = bitmap_line::x2#0 - bitmap_line::x1#0
|
||||
Simplifying expression containing zero bitmap_line::y2#0 in [72] sgn_u16::w#1 = bitmap_line::y2#0 - bitmap_line::y1#0
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Removing unused block main::@return
|
||||
Successful SSA optimization Pass2EliminateUnusedBlocks
|
||||
Eliminating unused variable memset::return#2 and assignment [35] memset::return#2 = memset::str#3
|
||||
Eliminating unused variable memset::return#3 and assignment [37] memset::return#3 = memset::str#3
|
||||
Eliminating unused variable memset::return#0 and assignment [25] memset::return#0 = memset::str#3
|
||||
Eliminating unused variable memset::return#1 and assignment [27] memset::return#1 = memset::str#3
|
||||
Eliminating unused constant bitmap_clear::bgcol#0
|
||||
Eliminating unused constant bitmap_screen#16
|
||||
Eliminating unused constant bitmap_gfx#17
|
||||
@ -1367,8 +1367,8 @@ Removing unused procedure block __start::@1
|
||||
Removing unused procedure block __start::@2
|
||||
Removing unused procedure block __start::@return
|
||||
Successful SSA optimization PassNEliminateEmptyStart
|
||||
Adding number conversion cast (unumber) 0 in [16] if(bitmap_init::x#1!=0) goto bitmap_init::@1
|
||||
Adding number conversion cast (unumber) 0 in [28] if(bitmap_init::y#1!=0) goto bitmap_init::@5
|
||||
Adding number conversion cast (unumber) 0 in [6] if(bitmap_init::x#1!=0) goto bitmap_init::@1
|
||||
Adding number conversion cast (unumber) 0 in [18] if(bitmap_init::y#1!=0) goto bitmap_init::@5
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 0
|
||||
@ -1379,12 +1379,12 @@ Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Alias bitmap_init::$7 = bitmap_init::$3
|
||||
Alias bitmap_clear::col#0 = bitmap_clear::$0
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Simple Condition bitmap_line::$4 [53] if(bitmap_line::dx#0==0) goto bitmap_line::@20
|
||||
Simple Condition bitmap_line::$4 [43] if(bitmap_line::dx#0==0) goto bitmap_line::@20
|
||||
Simple Condition bitmap_line::$5 [122] if(bitmap_line::dy#0==0) goto bitmap_line::@4
|
||||
Successful SSA optimization Pass2ConditionalJumpSimplification
|
||||
Negating conditional jump and destination [53] if(bitmap_line::dx#0!=0) goto bitmap_line::@1
|
||||
Negating conditional jump and destination [43] if(bitmap_line::dx#0!=0) goto bitmap_line::@1
|
||||
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
|
||||
Constant right-side identified [30] bitmap_clear::col#0 = bitmap_clear::fgcol#0 * $10
|
||||
Constant right-side identified [20] bitmap_clear::col#0 = bitmap_clear::fgcol#0 * $10
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant bitmap_clear::col#0 = bitmap_clear::fgcol#0*$10
|
||||
Constant abs_u16::w#1 = bitmap_line::y2#0
|
||||
@ -1392,26 +1392,26 @@ Constant sgn_u16::w#1 = bitmap_line::y2#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant memset::c#0 = bitmap_clear::col#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Inlining Noop Cast [2] memset::$4 = (byte*)memset::str#3 keeping memset::str#3
|
||||
Inlining Noop Cast [4] memset::dst#0 = (byte*)memset::str#3 keeping memset::str#3
|
||||
Inlining Noop Cast [25] bitmap_plot::plotter#0 = (byte*)bitmap_plot::$2 keeping bitmap_plot::plotter#0
|
||||
Successful SSA optimization Pass2NopCastInlining
|
||||
Inlining Noop Cast [35] bitmap_plot::plotter#0 = (byte*)bitmap_plot::$2 keeping bitmap_plot::plotter#0
|
||||
Inlining Noop Cast [79] memset::$4 = (byte*)memset::str#3 keeping memset::str#3
|
||||
Inlining Noop Cast [81] memset::dst#0 = (byte*)memset::str#3 keeping memset::str#3
|
||||
Successful SSA optimization Pass2NopCastInlining
|
||||
Rewriting division to use shift [59] bitmap_line::e1#0 = bitmap_line::dy#0 / 2
|
||||
Rewriting division to use shift [60] bitmap_line::e#0 = bitmap_line::dx#0 / 2
|
||||
Rewriting division to use shift [49] bitmap_line::e1#0 = bitmap_line::dy#0 / 2
|
||||
Rewriting division to use shift [50] bitmap_line::e#0 = bitmap_line::dx#0 / 2
|
||||
Successful SSA optimization Pass2MultiplyToShiftRewriting
|
||||
Inlining constant with var siblings memset::num#0
|
||||
Inlining constant with var siblings memset::c#1
|
||||
Inlining constant with var siblings memset::num#1
|
||||
Inlining constant with var siblings memset::str#0
|
||||
Inlining constant with var siblings memset::str#1
|
||||
Inlining constant with var siblings memset::c#0
|
||||
Inlining constant with var siblings bitmap_init::bits#0
|
||||
Inlining constant with var siblings bitmap_init::x#0
|
||||
Inlining constant with var siblings bitmap_init::bits#2
|
||||
Inlining constant with var siblings bitmap_init::y#0
|
||||
Inlining constant with var siblings bitmap_plot::x#0
|
||||
Inlining constant with var siblings bitmap_plot::y#0
|
||||
Inlining constant with var siblings memset::num#0
|
||||
Inlining constant with var siblings memset::c#1
|
||||
Inlining constant with var siblings memset::num#1
|
||||
Inlining constant with var siblings memset::str#0
|
||||
Inlining constant with var siblings memset::str#1
|
||||
Inlining constant with var siblings memset::c#0
|
||||
Inlining constant with var siblings abs_u16::w#1
|
||||
Inlining constant with var siblings sgn_u16::return#2
|
||||
Inlining constant with var siblings sgn_u16::return#3
|
||||
@ -1427,8 +1427,8 @@ Constant inlined next#11 = 0
|
||||
Constant inlined memset::num#1 = $1f40
|
||||
Constant inlined bitmap_clear::fgcol#0 = WHITE
|
||||
Constant inlined bitmap_gfx#0 = BITMAP
|
||||
Constant inlined memset::num#0 = $3e8
|
||||
Constant inlined bitmap_init::bits#0 = $80
|
||||
Constant inlined memset::num#0 = $3e8
|
||||
Constant inlined bitmap_init::bits#2 = $80
|
||||
Constant inlined bitmap_plot::x#0 = bitmap_line::x1#0
|
||||
Constant inlined abs_u16::w#1 = bitmap_line::y2#0
|
||||
@ -1542,9 +1542,6 @@ Culled Empty Block label bitmap_line::@16
|
||||
Culled Empty Block label memset::@1
|
||||
Culled Empty Block label abs_u16::@2
|
||||
Culled Empty Block label sgn_u16::@2
|
||||
Renumbering block memset::@2 to memset::@1
|
||||
Renumbering block memset::@3 to memset::@2
|
||||
Renumbering block memset::@4 to memset::@3
|
||||
Renumbering block bitmap_init::@5 to bitmap_init::@3
|
||||
Renumbering block bitmap_init::@6 to bitmap_init::@4
|
||||
Renumbering block bitmap_init::@7 to bitmap_init::@5
|
||||
@ -1552,6 +1549,9 @@ Renumbering block bitmap_init::@9 to bitmap_init::@6
|
||||
Renumbering block bitmap_line::@17 to bitmap_line::@16
|
||||
Renumbering block bitmap_line::@19 to bitmap_line::@17
|
||||
Renumbering block bitmap_line::@20 to bitmap_line::@18
|
||||
Renumbering block memset::@2 to memset::@1
|
||||
Renumbering block memset::@3 to memset::@2
|
||||
Renumbering block memset::@4 to memset::@3
|
||||
Renumbering block main::@5 to main::@4
|
||||
Adding NOP phi() at start of main::@2
|
||||
Adding NOP phi() at start of main::@3
|
||||
|
@ -3,50 +3,6 @@ Inlined call call __init
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
|
||||
void* memset(void* memset::str , byte memset::c , word memset::num)
|
||||
memset: scope:[memset] from bitmap_clear bitmap_clear::@1
|
||||
memset::c#5 = phi( bitmap_clear/memset::c#0, bitmap_clear::@1/memset::c#1 )
|
||||
memset::str#4 = phi( bitmap_clear/memset::str#0, bitmap_clear::@1/memset::str#1 )
|
||||
memset::num#2 = phi( bitmap_clear/memset::num#0, bitmap_clear::@1/memset::num#1 )
|
||||
memset::$0 = memset::num#2 > 0
|
||||
memset::$1 = ! memset::$0
|
||||
if(memset::$1) goto memset::@1
|
||||
to:memset::@2
|
||||
memset::@1: scope:[memset] from memset memset::@3
|
||||
memset::str#2 = phi( memset/memset::str#4, memset::@3/memset::str#5 )
|
||||
memset::return#0 = memset::str#2
|
||||
to:memset::@return
|
||||
memset::@2: scope:[memset] from memset
|
||||
memset::c#4 = phi( memset/memset::c#5 )
|
||||
memset::num#3 = phi( memset/memset::num#2 )
|
||||
memset::str#3 = phi( memset/memset::str#4 )
|
||||
memset::$4 = (byte*)memset::str#3
|
||||
memset::$2 = memset::$4 + memset::num#3
|
||||
memset::end#0 = memset::$2
|
||||
memset::dst#0 = ((byte*)) memset::str#3
|
||||
to:memset::@3
|
||||
memset::@3: scope:[memset] from memset::@2 memset::@4
|
||||
memset::c#3 = phi( memset::@2/memset::c#4, memset::@4/memset::c#2 )
|
||||
memset::str#5 = phi( memset::@2/memset::str#3, memset::@4/memset::str#6 )
|
||||
memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 )
|
||||
memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 )
|
||||
memset::$3 = memset::dst#2 != memset::end#1
|
||||
if(memset::$3) goto memset::@4
|
||||
to:memset::@1
|
||||
memset::@4: scope:[memset] from memset::@3
|
||||
memset::str#6 = phi( memset::@3/memset::str#5 )
|
||||
memset::end#2 = phi( memset::@3/memset::end#1 )
|
||||
memset::dst#3 = phi( memset::@3/memset::dst#2 )
|
||||
memset::c#2 = phi( memset::@3/memset::c#3 )
|
||||
*memset::dst#3 = memset::c#2
|
||||
memset::dst#1 = ++ memset::dst#3
|
||||
to:memset::@3
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
memset::return#4 = phi( memset::@1/memset::return#0 )
|
||||
memset::return#1 = memset::return#4
|
||||
return
|
||||
to:@return
|
||||
|
||||
void bitmap_init(byte* bitmap_init::gfx , byte* bitmap_init::screen)
|
||||
bitmap_init: scope:[bitmap_init] from main
|
||||
bitmap_init::screen#1 = phi( main/bitmap_init::screen#0 )
|
||||
@ -146,7 +102,7 @@ bitmap_clear: scope:[bitmap_clear] from main::@4
|
||||
memset::c#0 = bitmap_clear::col#0
|
||||
memset::num#0 = $3e8
|
||||
call memset
|
||||
memset::return#2 = memset::return#1
|
||||
memset::return#0 = memset::return#3
|
||||
to:bitmap_clear::@1
|
||||
bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear
|
||||
bitmap_gfx#8 = phi( bitmap_clear/bitmap_gfx#14 )
|
||||
@ -154,7 +110,7 @@ bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear
|
||||
memset::c#1 = 0
|
||||
memset::num#1 = $1f40
|
||||
call memset
|
||||
memset::return#3 = memset::return#1
|
||||
memset::return#1 = memset::return#3
|
||||
to:bitmap_clear::@2
|
||||
bitmap_clear::@2: scope:[bitmap_clear] from bitmap_clear::@1
|
||||
to:bitmap_clear::@return
|
||||
@ -413,6 +369,50 @@ bitmap_line::@11: scope:[bitmap_line] from bitmap_line::@19
|
||||
bitmap_line::e1#2 = bitmap_line::e1#4 - bitmap_line::dx#6
|
||||
to:bitmap_line::@10
|
||||
|
||||
void* memset(void* memset::str , byte memset::c , word memset::num)
|
||||
memset: scope:[memset] from bitmap_clear bitmap_clear::@1
|
||||
memset::c#5 = phi( bitmap_clear/memset::c#0, bitmap_clear::@1/memset::c#1 )
|
||||
memset::str#4 = phi( bitmap_clear/memset::str#0, bitmap_clear::@1/memset::str#1 )
|
||||
memset::num#2 = phi( bitmap_clear/memset::num#0, bitmap_clear::@1/memset::num#1 )
|
||||
memset::$0 = memset::num#2 > 0
|
||||
memset::$1 = ! memset::$0
|
||||
if(memset::$1) goto memset::@1
|
||||
to:memset::@2
|
||||
memset::@1: scope:[memset] from memset memset::@3
|
||||
memset::str#2 = phi( memset/memset::str#4, memset::@3/memset::str#5 )
|
||||
memset::return#2 = memset::str#2
|
||||
to:memset::@return
|
||||
memset::@2: scope:[memset] from memset
|
||||
memset::c#4 = phi( memset/memset::c#5 )
|
||||
memset::num#3 = phi( memset/memset::num#2 )
|
||||
memset::str#3 = phi( memset/memset::str#4 )
|
||||
memset::$4 = (byte*)memset::str#3
|
||||
memset::$2 = memset::$4 + memset::num#3
|
||||
memset::end#0 = memset::$2
|
||||
memset::dst#0 = ((byte*)) memset::str#3
|
||||
to:memset::@3
|
||||
memset::@3: scope:[memset] from memset::@2 memset::@4
|
||||
memset::c#3 = phi( memset::@2/memset::c#4, memset::@4/memset::c#2 )
|
||||
memset::str#5 = phi( memset::@2/memset::str#3, memset::@4/memset::str#6 )
|
||||
memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 )
|
||||
memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 )
|
||||
memset::$3 = memset::dst#2 != memset::end#1
|
||||
if(memset::$3) goto memset::@4
|
||||
to:memset::@1
|
||||
memset::@4: scope:[memset] from memset::@3
|
||||
memset::str#6 = phi( memset::@3/memset::str#5 )
|
||||
memset::end#2 = phi( memset::@3/memset::end#1 )
|
||||
memset::dst#3 = phi( memset::@3/memset::dst#2 )
|
||||
memset::c#2 = phi( memset::@3/memset::c#3 )
|
||||
*memset::dst#3 = memset::c#2
|
||||
memset::dst#1 = ++ memset::dst#3
|
||||
to:memset::@3
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
memset::return#4 = phi( memset::@1/memset::return#2 )
|
||||
memset::return#3 = memset::return#4
|
||||
return
|
||||
to:@return
|
||||
|
||||
word abs_u16(word abs_u16::w)
|
||||
abs_u16: scope:[abs_u16] from bitmap_line bitmap_line::@12
|
||||
abs_u16::w#2 = phi( bitmap_line/abs_u16::w#0, bitmap_line::@12/abs_u16::w#1 )
|
||||
@ -981,7 +981,6 @@ word sgn_u16::w#2
|
||||
|
||||
Fixing inline constructor with bitmap_plot::$2 = (byte)bitmap_plot_yhi[bitmap_plot::y#4] w= (byte)bitmap_plot_ylo[bitmap_plot::y#4]
|
||||
Successful SSA optimization Pass2FixInlineConstructors
|
||||
Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#2 > 0
|
||||
Adding number conversion cast (unumber) 1 in bitmap_init::bits#1 = bitmap_init::bits#3 >> 1
|
||||
Adding number conversion cast (unumber) 0 in bitmap_init::$0 = bitmap_init::bits#1 == 0
|
||||
Adding number conversion cast (unumber) $80 in bitmap_init::bits#2 = $80
|
||||
@ -1004,6 +1003,7 @@ Adding number conversion cast (unumber) 2 in bitmap_line::$20 = bitmap_line::dy#
|
||||
Adding number conversion cast (unumber) bitmap_line::$20 in bitmap_line::$20 = bitmap_line::dy#2 / (unumber)2
|
||||
Adding number conversion cast (unumber) 2 in bitmap_line::$15 = bitmap_line::dx#3 / 2
|
||||
Adding number conversion cast (unumber) bitmap_line::$15 in bitmap_line::$15 = bitmap_line::dx#3 / (unumber)2
|
||||
Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#2 > 0
|
||||
Adding number conversion cast (unumber) $80 in abs_u16::$1 = abs_u16::$0 & $80
|
||||
Adding number conversion cast (unumber) abs_u16::$1 in abs_u16::$1 = abs_u16::$0 & (unumber)$80
|
||||
Adding number conversion cast (unumber) 0 in abs_u16::$3 = 0 != abs_u16::$1
|
||||
@ -1027,9 +1027,9 @@ Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Adding number conversion cast (unumber) $40 in *VICII_MEMORY = (byte)(word)SCREEN&(unumber)$3fff/$40|(word)BITMAP&(unumber)$3fff/$400
|
||||
Adding number conversion cast (unumber) $400 in *VICII_MEMORY = (byte)(word)SCREEN&(unumber)$3fff/(unumber)$40|(word)BITMAP&(unumber)$3fff/$400
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Inlining cast memset::dst#0 = (byte*)memset::str#3
|
||||
Inlining cast bitmap_init::bits#2 = (unumber)$80
|
||||
Inlining cast memset::c#1 = (unumber)0
|
||||
Inlining cast memset::dst#0 = (byte*)memset::str#3
|
||||
Inlining cast sgn_u16::return#2 = (unumber)-1
|
||||
Inlining cast sgn_u16::return#3 = (unumber)1
|
||||
Inlining cast *BORDER_COLOR = (unumber)0
|
||||
@ -1046,7 +1046,6 @@ Simplifying constant pointer cast (byte*) 53265
|
||||
Simplifying constant pointer cast (byte*) 53272
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Simplifying constant pointer cast (byte*) 8192
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 1
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast $80
|
||||
@ -1062,6 +1061,7 @@ Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 2
|
||||
Simplifying constant integer cast 2
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast $80
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast $80
|
||||
@ -1082,7 +1082,6 @@ Simplifying constant integer cast $64
|
||||
Simplifying constant integer cast $140
|
||||
Simplifying constant integer cast 0
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 1
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) $80
|
||||
@ -1096,6 +1095,7 @@ Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 2
|
||||
Finalized unsigned number type (byte) 2
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) $80
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) $80
|
||||
@ -1125,22 +1125,13 @@ Inferred type updated to word in bitmap_line::$20 = bitmap_line::dy#2 / 2
|
||||
Inferred type updated to word in bitmap_line::$15 = bitmap_line::dx#3 / 2
|
||||
Inferred type updated to byte in abs_u16::$1 = abs_u16::$0 & $80
|
||||
Inferred type updated to byte in sgn_u16::$1 = sgn_u16::$0 & $80
|
||||
Inversing boolean not [2] memset::$1 = memset::num#2 <= 0 from [1] memset::$0 = memset::num#2 > 0
|
||||
Inversing boolean not [29] bitmap_init::$1 = bitmap_init::bits#1 != 0 from [28] bitmap_init::$0 = bitmap_init::bits#1 == 0
|
||||
Inversing boolean not [49] bitmap_init::$9 = bitmap_init::$7 != 7 from [48] bitmap_init::$8 = bitmap_init::$7 == 7
|
||||
Inversing boolean not [144] bitmap_line::$18 = bitmap_line::dy#3 >= bitmap_line::e#1 from [143] bitmap_line::$17 = bitmap_line::dy#3 < bitmap_line::e#1
|
||||
Inversing boolean not [164] bitmap_line::$23 = bitmap_line::dx#5 >= bitmap_line::e1#1 from [163] bitmap_line::$22 = bitmap_line::dx#5 < bitmap_line::e1#1
|
||||
Inversing boolean not [9] bitmap_init::$1 = bitmap_init::bits#1 != 0 from [8] bitmap_init::$0 = bitmap_init::bits#1 == 0
|
||||
Inversing boolean not [29] bitmap_init::$9 = bitmap_init::$7 != 7 from [28] bitmap_init::$8 = bitmap_init::$7 == 7
|
||||
Inversing boolean not [124] bitmap_line::$18 = bitmap_line::dy#3 >= bitmap_line::e#1 from [123] bitmap_line::$17 = bitmap_line::dy#3 < bitmap_line::e#1
|
||||
Inversing boolean not [144] bitmap_line::$23 = bitmap_line::dx#5 >= bitmap_line::e1#1 from [143] bitmap_line::$22 = bitmap_line::dx#5 < bitmap_line::e1#1
|
||||
Inversing boolean not [154] memset::$1 = memset::num#2 <= 0 from [153] memset::$0 = memset::num#2 > 0
|
||||
Inversing boolean not [219] main::$4 = next#0 != $140 from [218] main::$3 = next#0 == $140
|
||||
Successful SSA optimization Pass2UnaryNotSimplification
|
||||
Alias memset::return#0 = memset::str#2 memset::return#4 memset::return#1
|
||||
Alias memset::str#3 = memset::str#4
|
||||
Alias memset::num#2 = memset::num#3
|
||||
Alias memset::c#4 = memset::c#5
|
||||
Alias memset::end#0 = memset::$2
|
||||
Alias memset::c#2 = memset::c#3
|
||||
Alias memset::dst#2 = memset::dst#3
|
||||
Alias memset::end#1 = memset::end#2
|
||||
Alias memset::str#5 = memset::str#6
|
||||
Alias bitmap_init::x#2 = bitmap_init::x#4
|
||||
Alias bitmap_init::gfx#4 = bitmap_init::gfx#5
|
||||
Alias bitmap_gfx#26 = bitmap_gfx#27
|
||||
@ -1195,6 +1186,15 @@ Alias bitmap_line::y#15 = bitmap_line::y#8 bitmap_line::y#9
|
||||
Alias bitmap_line::sy#2 = bitmap_line::sy#4 bitmap_line::sy#7
|
||||
Alias bitmap_line::e1#1 = bitmap_line::e1#4
|
||||
Alias bitmap_line::x#15 = bitmap_line::x#2
|
||||
Alias memset::return#2 = memset::str#2 memset::return#4 memset::return#3
|
||||
Alias memset::str#3 = memset::str#4
|
||||
Alias memset::num#2 = memset::num#3
|
||||
Alias memset::c#4 = memset::c#5
|
||||
Alias memset::end#0 = memset::$2
|
||||
Alias memset::c#2 = memset::c#3
|
||||
Alias memset::dst#2 = memset::dst#3
|
||||
Alias memset::end#1 = memset::end#2
|
||||
Alias memset::str#5 = memset::str#6
|
||||
Alias abs_u16::w#2 = abs_u16::w#3 abs_u16::w#4 abs_u16::return#3
|
||||
Alias abs_u16::return#2 = abs_u16::$2
|
||||
Alias abs_u16::return#4 = abs_u16::return#7
|
||||
@ -1237,9 +1237,6 @@ Alias bitmap_line::sy#2 = bitmap_line::sy#9
|
||||
Alias bitmap_gfx#10 = bitmap_gfx#20
|
||||
Alias bitmap_screen#10 = bitmap_screen#19
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values memset::end#1 memset::end#0
|
||||
Identical Phi Values memset::str#5 memset::str#3
|
||||
Identical Phi Values memset::c#2 memset::c#4
|
||||
Identical Phi Values bitmap_init::gfx#1 bitmap_init::gfx#0
|
||||
Identical Phi Values bitmap_init::screen#1 bitmap_init::screen#0
|
||||
Identical Phi Values bitmap_init::gfx#2 bitmap_init::gfx#1
|
||||
@ -1265,6 +1262,9 @@ Identical Phi Values bitmap_line::dy#12 bitmap_line::dy#0
|
||||
Identical Phi Values bitmap_line::dx#12 bitmap_line::dx#0
|
||||
Identical Phi Values bitmap_line::x2#3 bitmap_line::x2#1
|
||||
Identical Phi Values bitmap_line::sy#2 bitmap_line::sy#0
|
||||
Identical Phi Values memset::end#1 memset::end#0
|
||||
Identical Phi Values memset::str#5 memset::str#3
|
||||
Identical Phi Values memset::c#2 memset::c#4
|
||||
Identical Phi Values bitmap_gfx#15 bitmap_gfx#17
|
||||
Identical Phi Values bitmap_screen#14 bitmap_screen#16
|
||||
Identical Phi Values next#12 next#13
|
||||
@ -1276,27 +1276,27 @@ Identical Phi Values bitmap_gfx#11 bitmap_gfx#10
|
||||
Identical Phi Values bitmap_screen#11 bitmap_screen#10
|
||||
Identical Phi Values next#10 next#11
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Identical Phi Values memset::return#0 memset::str#3
|
||||
Identical Phi Values memset::return#2 memset::str#3
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Identified duplicate assignment right side [47] bitmap_init::$7 = bitmap_init::y#2 & 7
|
||||
Identified duplicate assignment right side [27] bitmap_init::$7 = bitmap_init::y#2 & 7
|
||||
Successful SSA optimization Pass2DuplicateRValueIdentification
|
||||
Simple Condition memset::$1 [2] if(memset::num#2<=0) goto memset::@1
|
||||
Simple Condition memset::$3 [9] if(memset::dst#2!=memset::end#0) goto memset::@4
|
||||
Simple Condition bitmap_init::$1 [22] if(bitmap_init::bits#1!=0) goto bitmap_init::@2
|
||||
Simple Condition bitmap_init::$2 [26] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1
|
||||
Simple Condition bitmap_init::$9 [38] if(bitmap_init::$7!=7) goto bitmap_init::@6
|
||||
Simple Condition bitmap_init::$11 [42] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5
|
||||
Simple Condition bitmap_line::$12 [90] if(bitmap_line::dx#0>bitmap_line::dy#0) goto bitmap_line::@2
|
||||
Simple Condition bitmap_line::$18 [104] if(bitmap_line::dy#0>=bitmap_line::e#1) goto bitmap_line::@7
|
||||
Simple Condition bitmap_line::$19 [107] if(bitmap_line::y#1!=bitmap_line::y2#0) goto bitmap_line::@6
|
||||
Simple Condition bitmap_line::$23 [121] if(bitmap_line::dx#0>=bitmap_line::e1#1) goto bitmap_line::@10
|
||||
Simple Condition bitmap_line::$24 [124] if(bitmap_line::x#15!=bitmap_line::x2#0) goto bitmap_line::@9
|
||||
Simple Condition bitmap_init::$1 [9] if(bitmap_init::bits#1!=0) goto bitmap_init::@2
|
||||
Simple Condition bitmap_init::$2 [13] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1
|
||||
Simple Condition bitmap_init::$9 [25] if(bitmap_init::$7!=7) goto bitmap_init::@6
|
||||
Simple Condition bitmap_init::$11 [29] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5
|
||||
Simple Condition bitmap_line::$12 [77] if(bitmap_line::dx#0>bitmap_line::dy#0) goto bitmap_line::@2
|
||||
Simple Condition bitmap_line::$18 [91] if(bitmap_line::dy#0>=bitmap_line::e#1) goto bitmap_line::@7
|
||||
Simple Condition bitmap_line::$19 [94] if(bitmap_line::y#1!=bitmap_line::y2#0) goto bitmap_line::@6
|
||||
Simple Condition bitmap_line::$23 [108] if(bitmap_line::dx#0>=bitmap_line::e1#1) goto bitmap_line::@10
|
||||
Simple Condition bitmap_line::$24 [111] if(bitmap_line::x#15!=bitmap_line::x2#0) goto bitmap_line::@9
|
||||
Simple Condition memset::$1 [116] if(memset::num#2<=0) goto memset::@1
|
||||
Simple Condition memset::$3 [123] if(memset::dst#2!=memset::end#0) goto memset::@4
|
||||
Simple Condition abs_u16::$3 [131] if(0!=abs_u16::$1) goto abs_u16::@1
|
||||
Simple Condition sgn_u16::$2 [139] if(0!=sgn_u16::$1) goto sgn_u16::@1
|
||||
Simple Condition main::$4 [164] if(next#0!=$140) goto main::@2
|
||||
Successful SSA optimization Pass2ConditionalJumpSimplification
|
||||
Rewriting ! if()-condition to reversed if() [79] bitmap_line::$7 = ! bitmap_line::$6
|
||||
Rewriting && if()-condition to two if()s [78] bitmap_line::$6 = bitmap_line::$4 && bitmap_line::$5
|
||||
Rewriting ! if()-condition to reversed if() [66] bitmap_line::$7 = ! bitmap_line::$6
|
||||
Rewriting && if()-condition to two if()s [65] bitmap_line::$6 = bitmap_line::$4 && bitmap_line::$5
|
||||
Successful SSA optimization Pass2ConditionalAndOrRewriting
|
||||
Constant bitmap_init::bits#0 = $80
|
||||
Constant bitmap_init::x#0 = 0
|
||||
@ -1329,21 +1329,21 @@ Constant memset::str#1 = (void*)bitmap_gfx#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
if() condition always true - replacing block destination [166] if(true) goto main::@1
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Resolved ranged next value [24] bitmap_init::x#1 = ++ bitmap_init::x#2 to ++
|
||||
Resolved ranged comparison value [26] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1 to 0
|
||||
Resolved ranged next value [40] bitmap_init::y#1 = ++ bitmap_init::y#2 to ++
|
||||
Resolved ranged comparison value [42] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5 to 0
|
||||
Resolved ranged next value [11] bitmap_init::x#1 = ++ bitmap_init::x#2 to ++
|
||||
Resolved ranged comparison value [13] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1 to 0
|
||||
Resolved ranged next value [27] bitmap_init::y#1 = ++ bitmap_init::y#2 to ++
|
||||
Resolved ranged comparison value [29] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5 to 0
|
||||
Simplifying constant evaluating to zero (byte)bitmap_line::y1#0 in
|
||||
Successful SSA optimization PassNSimplifyConstantZero
|
||||
Simplifying expression containing zero bitmap_line::x2#0 in [68] abs_u16::w#0 = bitmap_line::x2#0 - bitmap_line::x1#0
|
||||
Simplifying expression containing zero bitmap_line::y2#0 in [72] abs_u16::w#1 = bitmap_line::y2#0 - bitmap_line::y1#0
|
||||
Simplifying expression containing zero bitmap_line::x2#0 in [81] sgn_u16::w#0 = bitmap_line::x2#0 - bitmap_line::x1#0
|
||||
Simplifying expression containing zero bitmap_line::y2#0 in [85] sgn_u16::w#1 = bitmap_line::y2#0 - bitmap_line::y1#0
|
||||
Simplifying expression containing zero bitmap_line::x2#0 in [55] abs_u16::w#0 = bitmap_line::x2#0 - bitmap_line::x1#0
|
||||
Simplifying expression containing zero bitmap_line::y2#0 in [59] abs_u16::w#1 = bitmap_line::y2#0 - bitmap_line::y1#0
|
||||
Simplifying expression containing zero bitmap_line::x2#0 in [68] sgn_u16::w#0 = bitmap_line::x2#0 - bitmap_line::x1#0
|
||||
Simplifying expression containing zero bitmap_line::y2#0 in [72] sgn_u16::w#1 = bitmap_line::y2#0 - bitmap_line::y1#0
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Removing unused block main::@return
|
||||
Successful SSA optimization Pass2EliminateUnusedBlocks
|
||||
Eliminating unused variable memset::return#2 and assignment [35] memset::return#2 = memset::str#3
|
||||
Eliminating unused variable memset::return#3 and assignment [37] memset::return#3 = memset::str#3
|
||||
Eliminating unused variable memset::return#0 and assignment [25] memset::return#0 = memset::str#3
|
||||
Eliminating unused variable memset::return#1 and assignment [27] memset::return#1 = memset::str#3
|
||||
Eliminating unused constant bitmap_screen#16
|
||||
Eliminating unused constant bitmap_gfx#17
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
@ -1354,8 +1354,8 @@ Removing unused procedure block __start::@1
|
||||
Removing unused procedure block __start::@2
|
||||
Removing unused procedure block __start::@return
|
||||
Successful SSA optimization PassNEliminateEmptyStart
|
||||
Adding number conversion cast (unumber) 0 in [16] if(bitmap_init::x#1!=0) goto bitmap_init::@1
|
||||
Adding number conversion cast (unumber) 0 in [28] if(bitmap_init::y#1!=0) goto bitmap_init::@5
|
||||
Adding number conversion cast (unumber) 0 in [6] if(bitmap_init::x#1!=0) goto bitmap_init::@1
|
||||
Adding number conversion cast (unumber) 0 in [18] if(bitmap_init::y#1!=0) goto bitmap_init::@5
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 0
|
||||
@ -1365,43 +1365,43 @@ Finalized unsigned number type (byte) 0
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Alias bitmap_init::$7 = bitmap_init::$3
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Simple Condition bitmap_line::$4 [54] if(bitmap_line::dx#0==0) goto bitmap_line::@20
|
||||
Simple Condition bitmap_line::$4 [44] if(bitmap_line::dx#0==0) goto bitmap_line::@20
|
||||
Simple Condition bitmap_line::$5 [119] if(bitmap_line::dy#0==0) goto bitmap_line::@4
|
||||
Successful SSA optimization Pass2ConditionalJumpSimplification
|
||||
Negating conditional jump and destination [54] if(bitmap_line::dx#0!=0) goto bitmap_line::@1
|
||||
Negating conditional jump and destination [44] if(bitmap_line::dx#0!=0) goto bitmap_line::@1
|
||||
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
|
||||
Constant right-side identified [30] bitmap_clear::$0 = bitmap_clear::fgcol#0 * $10
|
||||
Constant right-side identified [20] bitmap_clear::$0 = bitmap_clear::fgcol#0 * $10
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant bitmap_clear::$0 = bitmap_clear::fgcol#0*$10
|
||||
Constant abs_u16::w#1 = bitmap_line::y2#0
|
||||
Constant sgn_u16::w#1 = bitmap_line::y2#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant right-side identified [30] bitmap_clear::col#0 = bitmap_clear::$0 + bitmap_clear::bgcol#0
|
||||
Constant right-side identified [20] bitmap_clear::col#0 = bitmap_clear::$0 + bitmap_clear::bgcol#0
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant bitmap_clear::col#0 = bitmap_clear::$0+bitmap_clear::bgcol#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant memset::c#0 = bitmap_clear::col#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Inlining Noop Cast [2] memset::$4 = (byte*)memset::str#3 keeping memset::str#3
|
||||
Inlining Noop Cast [4] memset::dst#0 = (byte*)memset::str#3 keeping memset::str#3
|
||||
Inlining Noop Cast [25] bitmap_plot::plotter#0 = (byte*)bitmap_plot::$2 keeping bitmap_plot::plotter#0
|
||||
Successful SSA optimization Pass2NopCastInlining
|
||||
Inlining Noop Cast [35] bitmap_plot::plotter#0 = (byte*)bitmap_plot::$2 keeping bitmap_plot::plotter#0
|
||||
Inlining Noop Cast [79] memset::$4 = (byte*)memset::str#3 keeping memset::str#3
|
||||
Inlining Noop Cast [81] memset::dst#0 = (byte*)memset::str#3 keeping memset::str#3
|
||||
Successful SSA optimization Pass2NopCastInlining
|
||||
Rewriting division to use shift [59] bitmap_line::e1#0 = bitmap_line::dy#0 / 2
|
||||
Rewriting division to use shift [60] bitmap_line::e#0 = bitmap_line::dx#0 / 2
|
||||
Rewriting division to use shift [49] bitmap_line::e1#0 = bitmap_line::dy#0 / 2
|
||||
Rewriting division to use shift [50] bitmap_line::e#0 = bitmap_line::dx#0 / 2
|
||||
Successful SSA optimization Pass2MultiplyToShiftRewriting
|
||||
Inlining constant with var siblings memset::num#0
|
||||
Inlining constant with var siblings memset::c#1
|
||||
Inlining constant with var siblings memset::num#1
|
||||
Inlining constant with var siblings memset::str#0
|
||||
Inlining constant with var siblings memset::str#1
|
||||
Inlining constant with var siblings memset::c#0
|
||||
Inlining constant with var siblings bitmap_init::bits#0
|
||||
Inlining constant with var siblings bitmap_init::x#0
|
||||
Inlining constant with var siblings bitmap_init::bits#2
|
||||
Inlining constant with var siblings bitmap_init::y#0
|
||||
Inlining constant with var siblings bitmap_plot::x#0
|
||||
Inlining constant with var siblings bitmap_plot::y#0
|
||||
Inlining constant with var siblings memset::num#0
|
||||
Inlining constant with var siblings memset::c#1
|
||||
Inlining constant with var siblings memset::num#1
|
||||
Inlining constant with var siblings memset::str#0
|
||||
Inlining constant with var siblings memset::str#1
|
||||
Inlining constant with var siblings memset::c#0
|
||||
Inlining constant with var siblings abs_u16::w#1
|
||||
Inlining constant with var siblings sgn_u16::return#2
|
||||
Inlining constant with var siblings sgn_u16::return#3
|
||||
@ -1412,8 +1412,8 @@ Constant inlined bitmap_init::screen#0 = SCREEN
|
||||
Constant inlined bitmap_clear::bgcol#0 = PURPLE
|
||||
Constant inlined bitmap_init::gfx#0 = BITMAP
|
||||
Constant inlined memset::num#1 = $1f40
|
||||
Constant inlined memset::num#0 = $3e8
|
||||
Constant inlined bitmap_init::bits#0 = $80
|
||||
Constant inlined memset::num#0 = $3e8
|
||||
Constant inlined bitmap_init::bits#2 = $80
|
||||
Constant inlined bitmap_plot::x#0 = bitmap_line::x1#0
|
||||
Constant inlined abs_u16::w#1 = bitmap_line::y2#0
|
||||
@ -1535,9 +1535,6 @@ Culled Empty Block label bitmap_line::@16
|
||||
Culled Empty Block label memset::@1
|
||||
Culled Empty Block label abs_u16::@2
|
||||
Culled Empty Block label sgn_u16::@2
|
||||
Renumbering block memset::@2 to memset::@1
|
||||
Renumbering block memset::@3 to memset::@2
|
||||
Renumbering block memset::@4 to memset::@3
|
||||
Renumbering block bitmap_init::@5 to bitmap_init::@3
|
||||
Renumbering block bitmap_init::@6 to bitmap_init::@4
|
||||
Renumbering block bitmap_init::@7 to bitmap_init::@5
|
||||
@ -1545,6 +1542,9 @@ Renumbering block bitmap_init::@9 to bitmap_init::@6
|
||||
Renumbering block bitmap_line::@17 to bitmap_line::@16
|
||||
Renumbering block bitmap_line::@19 to bitmap_line::@17
|
||||
Renumbering block bitmap_line::@20 to bitmap_line::@18
|
||||
Renumbering block memset::@2 to memset::@1
|
||||
Renumbering block memset::@3 to memset::@2
|
||||
Renumbering block memset::@4 to memset::@3
|
||||
Renumbering block main::@4 to main::@3
|
||||
Renumbering block main::@6 to main::@4
|
||||
Renumbering block main::@7 to main::@5
|
||||
|
@ -8,50 +8,6 @@ Inlined call call __init
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
|
||||
void* memset(void* memset::str , byte memset::c , word memset::num)
|
||||
memset: scope:[memset] from bitmap_clear bitmap_clear::@1
|
||||
memset::c#5 = phi( bitmap_clear/memset::c#0, bitmap_clear::@1/memset::c#1 )
|
||||
memset::str#4 = phi( bitmap_clear/memset::str#0, bitmap_clear::@1/memset::str#1 )
|
||||
memset::num#2 = phi( bitmap_clear/memset::num#0, bitmap_clear::@1/memset::num#1 )
|
||||
memset::$0 = memset::num#2 > 0
|
||||
memset::$1 = ! memset::$0
|
||||
if(memset::$1) goto memset::@1
|
||||
to:memset::@2
|
||||
memset::@1: scope:[memset] from memset memset::@3
|
||||
memset::str#2 = phi( memset/memset::str#4, memset::@3/memset::str#5 )
|
||||
memset::return#0 = memset::str#2
|
||||
to:memset::@return
|
||||
memset::@2: scope:[memset] from memset
|
||||
memset::c#4 = phi( memset/memset::c#5 )
|
||||
memset::num#3 = phi( memset/memset::num#2 )
|
||||
memset::str#3 = phi( memset/memset::str#4 )
|
||||
memset::$4 = (byte*)memset::str#3
|
||||
memset::$2 = memset::$4 + memset::num#3
|
||||
memset::end#0 = memset::$2
|
||||
memset::dst#0 = ((byte*)) memset::str#3
|
||||
to:memset::@3
|
||||
memset::@3: scope:[memset] from memset::@2 memset::@4
|
||||
memset::c#3 = phi( memset::@2/memset::c#4, memset::@4/memset::c#2 )
|
||||
memset::str#5 = phi( memset::@2/memset::str#3, memset::@4/memset::str#6 )
|
||||
memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 )
|
||||
memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 )
|
||||
memset::$3 = memset::dst#2 != memset::end#1
|
||||
if(memset::$3) goto memset::@4
|
||||
to:memset::@1
|
||||
memset::@4: scope:[memset] from memset::@3
|
||||
memset::str#6 = phi( memset::@3/memset::str#5 )
|
||||
memset::end#2 = phi( memset::@3/memset::end#1 )
|
||||
memset::dst#3 = phi( memset::@3/memset::dst#2 )
|
||||
memset::c#2 = phi( memset::@3/memset::c#3 )
|
||||
*memset::dst#3 = memset::c#2
|
||||
memset::dst#1 = ++ memset::dst#3
|
||||
to:memset::@3
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
memset::return#4 = phi( memset::@1/memset::return#0 )
|
||||
memset::return#1 = memset::return#4
|
||||
return
|
||||
to:@return
|
||||
|
||||
void bitmap_init(byte* bitmap_init::gfx , byte* bitmap_init::screen)
|
||||
bitmap_init: scope:[bitmap_init] from main
|
||||
bitmap_init::screen#1 = phi( main/bitmap_init::screen#0 )
|
||||
@ -151,7 +107,7 @@ bitmap_clear: scope:[bitmap_clear] from main::@8
|
||||
memset::c#0 = bitmap_clear::col#0
|
||||
memset::num#0 = $3e8
|
||||
call memset
|
||||
memset::return#2 = memset::return#1
|
||||
memset::return#0 = memset::return#3
|
||||
to:bitmap_clear::@1
|
||||
bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear
|
||||
bitmap_gfx#8 = phi( bitmap_clear/bitmap_gfx#14 )
|
||||
@ -159,7 +115,7 @@ bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear
|
||||
memset::c#1 = 0
|
||||
memset::num#1 = $1f40
|
||||
call memset
|
||||
memset::return#3 = memset::return#1
|
||||
memset::return#1 = memset::return#3
|
||||
to:bitmap_clear::@2
|
||||
bitmap_clear::@2: scope:[bitmap_clear] from bitmap_clear::@1
|
||||
to:bitmap_clear::@return
|
||||
@ -181,6 +137,50 @@ bitmap_plot::@return: scope:[bitmap_plot] from bitmap_plot
|
||||
return
|
||||
to:@return
|
||||
|
||||
void* memset(void* memset::str , byte memset::c , word memset::num)
|
||||
memset: scope:[memset] from bitmap_clear bitmap_clear::@1
|
||||
memset::c#5 = phi( bitmap_clear/memset::c#0, bitmap_clear::@1/memset::c#1 )
|
||||
memset::str#4 = phi( bitmap_clear/memset::str#0, bitmap_clear::@1/memset::str#1 )
|
||||
memset::num#2 = phi( bitmap_clear/memset::num#0, bitmap_clear::@1/memset::num#1 )
|
||||
memset::$0 = memset::num#2 > 0
|
||||
memset::$1 = ! memset::$0
|
||||
if(memset::$1) goto memset::@1
|
||||
to:memset::@2
|
||||
memset::@1: scope:[memset] from memset memset::@3
|
||||
memset::str#2 = phi( memset/memset::str#4, memset::@3/memset::str#5 )
|
||||
memset::return#2 = memset::str#2
|
||||
to:memset::@return
|
||||
memset::@2: scope:[memset] from memset
|
||||
memset::c#4 = phi( memset/memset::c#5 )
|
||||
memset::num#3 = phi( memset/memset::num#2 )
|
||||
memset::str#3 = phi( memset/memset::str#4 )
|
||||
memset::$4 = (byte*)memset::str#3
|
||||
memset::$2 = memset::$4 + memset::num#3
|
||||
memset::end#0 = memset::$2
|
||||
memset::dst#0 = ((byte*)) memset::str#3
|
||||
to:memset::@3
|
||||
memset::@3: scope:[memset] from memset::@2 memset::@4
|
||||
memset::c#3 = phi( memset::@2/memset::c#4, memset::@4/memset::c#2 )
|
||||
memset::str#5 = phi( memset::@2/memset::str#3, memset::@4/memset::str#6 )
|
||||
memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 )
|
||||
memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 )
|
||||
memset::$3 = memset::dst#2 != memset::end#1
|
||||
if(memset::$3) goto memset::@4
|
||||
to:memset::@1
|
||||
memset::@4: scope:[memset] from memset::@3
|
||||
memset::str#6 = phi( memset::@3/memset::str#5 )
|
||||
memset::end#2 = phi( memset::@3/memset::end#1 )
|
||||
memset::dst#3 = phi( memset::@3/memset::dst#2 )
|
||||
memset::c#2 = phi( memset::@3/memset::c#3 )
|
||||
*memset::dst#3 = memset::c#2
|
||||
memset::dst#1 = ++ memset::dst#3
|
||||
to:memset::@3
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
memset::return#4 = phi( memset::@1/memset::return#2 )
|
||||
memset::return#3 = memset::return#4
|
||||
return
|
||||
to:@return
|
||||
|
||||
void main()
|
||||
main: scope:[main] from __start::@1
|
||||
bitmap_screen#14 = phi( __start::@1/bitmap_screen#16 )
|
||||
@ -678,7 +678,6 @@ constant byte* plots_per_frame[$100] = { fill( $100, 0) }
|
||||
|
||||
Fixing inline constructor with bitmap_plot::$2 = (byte)bitmap_plot_yhi[bitmap_plot::y#1] w= (byte)bitmap_plot_ylo[bitmap_plot::y#1]
|
||||
Successful SSA optimization Pass2FixInlineConstructors
|
||||
Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#2 > 0
|
||||
Adding number conversion cast (unumber) 1 in bitmap_init::bits#1 = bitmap_init::bits#3 >> 1
|
||||
Adding number conversion cast (unumber) 0 in bitmap_init::$0 = bitmap_init::bits#1 == 0
|
||||
Adding number conversion cast (unumber) $80 in bitmap_init::bits#2 = $80
|
||||
@ -695,6 +694,7 @@ Adding number conversion cast (unumber) bitmap_clear::$1 in bitmap_clear::$1 = b
|
||||
Adding number conversion cast (unumber) 0 in memset::c#1 = 0
|
||||
Adding number conversion cast (unumber) $fff8 in bitmap_plot::$0 = bitmap_plot::x#1 & $fff8
|
||||
Adding number conversion cast (unumber) bitmap_plot::$0 in bitmap_plot::$0 = bitmap_plot::x#1 & (unumber)$fff8
|
||||
Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#2 > 0
|
||||
Adding number conversion cast (unumber) VICII_BMM|VICII_DEN|VICII_RSEL|3 in *D011 = VICII_BMM|VICII_DEN|VICII_RSEL|3
|
||||
Adding number conversion cast (unumber) 3 in *D011 = ((unumber)) VICII_BMM|VICII_DEN|VICII_RSEL|3
|
||||
Adding number conversion cast (unumber) $3fff in main::toD0181_$0 = main::toD0181_$7 & $3fff
|
||||
@ -715,9 +715,9 @@ Adding number conversion cast (unumber) $80 in *VICII_CONTROL1 = *VICII_CONTROL1
|
||||
Adding number conversion cast (unumber) 0 in *RASTER = 0
|
||||
Adding number conversion cast (unumber) 0 in irq::$1 = 0 != frame_cnt
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Inlining cast memset::dst#0 = (byte*)memset::str#3
|
||||
Inlining cast bitmap_init::bits#2 = (unumber)$80
|
||||
Inlining cast memset::c#1 = (unumber)0
|
||||
Inlining cast memset::dst#0 = (byte*)memset::str#3
|
||||
Inlining cast *D011 = (unumber)VICII_BMM|VICII_DEN|VICII_RSEL|(unumber)3
|
||||
Inlining cast *RASTER = (unumber)0
|
||||
Successful SSA optimization Pass2InlineCast
|
||||
@ -734,7 +734,6 @@ Simplifying constant pointer cast (struct MOS6526_CIA*) 56320
|
||||
Simplifying constant pointer cast (void()**) 65534
|
||||
Simplifying constant pointer cast (byte*) 8192
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 1
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast $80
|
||||
@ -746,6 +745,7 @@ Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast bitmap_plot_yhi[bitmap_plot::y#1]
|
||||
Simplifying constant integer cast bitmap_plot_ylo[bitmap_plot::y#1]
|
||||
Simplifying constant integer cast $fff8
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast VICII_BMM|VICII_DEN|VICII_RSEL|(unumber)3
|
||||
Simplifying constant integer cast 3
|
||||
Simplifying constant integer cast $3fff
|
||||
@ -760,7 +760,6 @@ Simplifying constant integer cast $80
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 0
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 1
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) $80
|
||||
@ -770,6 +769,7 @@ Finalized unsigned number type (byte) 7
|
||||
Finalized unsigned number type (byte) $10
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (word) $fff8
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 3
|
||||
Finalized unsigned number type (word) $3fff
|
||||
Finalized unsigned number type (byte) 4
|
||||
@ -795,20 +795,11 @@ Inferred type updated to byte in main::toD0181_$2 = > main::toD0181_$1
|
||||
Inferred type updated to byte in main::toD0181_$4 = main::toD0181_$3 / 4
|
||||
Inferred type updated to byte in main::toD0181_$5 = main::toD0181_$4 & $f
|
||||
Inferred type updated to byte in main::toD0181_$6 = main::toD0181_$2 | main::toD0181_$5
|
||||
Inversing boolean not [2] memset::$1 = memset::num#2 <= 0 from [1] memset::$0 = memset::num#2 > 0
|
||||
Inversing boolean not [29] bitmap_init::$1 = bitmap_init::bits#1 != 0 from [28] bitmap_init::$0 = bitmap_init::bits#1 == 0
|
||||
Inversing boolean not [49] bitmap_init::$9 = bitmap_init::$7 != 7 from [48] bitmap_init::$8 = bitmap_init::$7 == 7
|
||||
Inversing boolean not [9] bitmap_init::$1 = bitmap_init::bits#1 != 0 from [8] bitmap_init::$0 = bitmap_init::bits#1 == 0
|
||||
Inversing boolean not [29] bitmap_init::$9 = bitmap_init::$7 != 7 from [28] bitmap_init::$8 = bitmap_init::$7 == 7
|
||||
Inversing boolean not [68] memset::$1 = memset::num#2 <= 0 from [67] memset::$0 = memset::num#2 > 0
|
||||
Inversing boolean not [165] irq::$0 = 0 == frame_cnt from [164] irq::$1 = 0 != frame_cnt
|
||||
Successful SSA optimization Pass2UnaryNotSimplification
|
||||
Alias memset::return#0 = memset::str#2 memset::return#4 memset::return#1
|
||||
Alias memset::str#3 = memset::str#4
|
||||
Alias memset::num#2 = memset::num#3
|
||||
Alias memset::c#4 = memset::c#5
|
||||
Alias memset::end#0 = memset::$2
|
||||
Alias memset::c#2 = memset::c#3
|
||||
Alias memset::dst#2 = memset::dst#3
|
||||
Alias memset::end#1 = memset::end#2
|
||||
Alias memset::str#5 = memset::str#6
|
||||
Alias bitmap_init::x#2 = bitmap_init::x#4
|
||||
Alias bitmap_init::gfx#4 = bitmap_init::gfx#5
|
||||
Alias bitmap_gfx#30 = bitmap_gfx#31
|
||||
@ -825,6 +816,15 @@ Alias bitmap_gfx#1 = bitmap_gfx#7 bitmap_gfx#13
|
||||
Alias bitmap_screen#1 = bitmap_screen#7 bitmap_screen#13
|
||||
Alias bitmap_clear::col#0 = bitmap_clear::$1
|
||||
Alias bitmap_gfx#14 = bitmap_gfx#8
|
||||
Alias memset::return#2 = memset::str#2 memset::return#4 memset::return#3
|
||||
Alias memset::str#3 = memset::str#4
|
||||
Alias memset::num#2 = memset::num#3
|
||||
Alias memset::c#4 = memset::c#5
|
||||
Alias memset::end#0 = memset::$2
|
||||
Alias memset::c#2 = memset::c#3
|
||||
Alias memset::dst#2 = memset::dst#3
|
||||
Alias memset::end#1 = memset::end#2
|
||||
Alias memset::str#5 = memset::str#6
|
||||
Alias bitmap_gfx#2 = bitmap_gfx#9 bitmap_gfx#34 bitmap_gfx#32 bitmap_gfx#27 bitmap_gfx#23 bitmap_gfx#20
|
||||
Alias bitmap_screen#19 = bitmap_screen#2 bitmap_screen#9 bitmap_screen#33 bitmap_screen#31 bitmap_screen#26 bitmap_screen#22
|
||||
Alias main::toD0181_screen#0 = main::toD0181_screen#1
|
||||
@ -865,9 +865,6 @@ Alias bitmap_gfx#10 = bitmap_gfx#24 bitmap_gfx#21
|
||||
Alias bitmap_screen#10 = bitmap_screen#23 bitmap_screen#20
|
||||
Alias main::vx#6 = main::vx#7
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values memset::end#1 memset::end#0
|
||||
Identical Phi Values memset::str#5 memset::str#3
|
||||
Identical Phi Values memset::c#2 memset::c#4
|
||||
Identical Phi Values bitmap_init::gfx#1 bitmap_init::gfx#0
|
||||
Identical Phi Values bitmap_init::screen#1 bitmap_init::screen#0
|
||||
Identical Phi Values bitmap_init::gfx#2 bitmap_init::gfx#1
|
||||
@ -881,6 +878,9 @@ Identical Phi Values bitmap_screen#8 bitmap_screen#19
|
||||
Identical Phi Values bitmap_gfx#14 bitmap_gfx#2
|
||||
Identical Phi Values bitmap_plot::y#1 bitmap_plot::y#0
|
||||
Identical Phi Values bitmap_plot::x#1 bitmap_plot::x#0
|
||||
Identical Phi Values memset::end#1 memset::end#0
|
||||
Identical Phi Values memset::str#5 memset::str#3
|
||||
Identical Phi Values memset::c#2 memset::c#4
|
||||
Identical Phi Values bitmap_gfx#15 bitmap_gfx#17
|
||||
Identical Phi Values bitmap_screen#14 bitmap_screen#16
|
||||
Identical Phi Values bitmap_gfx#2 bitmap_gfx#1
|
||||
@ -890,16 +890,16 @@ Identical Phi Values bitmap_screen#10 bitmap_screen#19
|
||||
Identical Phi Values bitmap_gfx#11 bitmap_gfx#10
|
||||
Identical Phi Values bitmap_screen#11 bitmap_screen#10
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Identical Phi Values memset::return#0 memset::str#3
|
||||
Identical Phi Values memset::return#2 memset::str#3
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Identified duplicate assignment right side [47] bitmap_init::$7 = bitmap_init::y#2 & 7
|
||||
Identified duplicate assignment right side [27] bitmap_init::$7 = bitmap_init::y#2 & 7
|
||||
Successful SSA optimization Pass2DuplicateRValueIdentification
|
||||
Simple Condition memset::$1 [2] if(memset::num#2<=0) goto memset::@1
|
||||
Simple Condition memset::$3 [9] if(memset::dst#2!=memset::end#0) goto memset::@4
|
||||
Simple Condition bitmap_init::$1 [22] if(bitmap_init::bits#1!=0) goto bitmap_init::@2
|
||||
Simple Condition bitmap_init::$2 [26] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1
|
||||
Simple Condition bitmap_init::$9 [38] if(bitmap_init::$7!=7) goto bitmap_init::@6
|
||||
Simple Condition bitmap_init::$11 [42] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5
|
||||
Simple Condition bitmap_init::$1 [9] if(bitmap_init::bits#1!=0) goto bitmap_init::@2
|
||||
Simple Condition bitmap_init::$2 [13] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1
|
||||
Simple Condition bitmap_init::$9 [25] if(bitmap_init::$7!=7) goto bitmap_init::@6
|
||||
Simple Condition bitmap_init::$11 [29] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5
|
||||
Simple Condition memset::$1 [56] if(memset::num#2<=0) goto memset::@1
|
||||
Simple Condition memset::$3 [63] if(memset::dst#2!=memset::end#0) goto memset::@4
|
||||
Simple Condition irq::$0 [127] if(0==frame_cnt) goto irq::@1
|
||||
Successful SSA optimization Pass2ConditionalJumpSimplification
|
||||
Rewriting ! if()-condition to reversed if() [102] main::$8 = ! main::$7
|
||||
@ -938,16 +938,16 @@ Constant value identified (word)main::toD0181_gfx#0 in [82] main::toD0181_$3 = >
|
||||
Successful SSA optimization Pass2ConstantValues
|
||||
if() condition always true - replacing block destination [93] if(true) goto main::@2
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Resolved ranged next value [24] bitmap_init::x#1 = ++ bitmap_init::x#2 to ++
|
||||
Resolved ranged comparison value [26] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1 to 0
|
||||
Resolved ranged next value [40] bitmap_init::y#1 = ++ bitmap_init::y#2 to ++
|
||||
Resolved ranged comparison value [42] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5 to 0
|
||||
Simplifying expression containing zero bitmap_clear::$0 in [47] bitmap_clear::col#0 = bitmap_clear::$0 + bitmap_clear::bgcol#0
|
||||
Resolved ranged next value [11] bitmap_init::x#1 = ++ bitmap_init::x#2 to ++
|
||||
Resolved ranged comparison value [13] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1 to 0
|
||||
Resolved ranged next value [27] bitmap_init::y#1 = ++ bitmap_init::y#2 to ++
|
||||
Resolved ranged comparison value [29] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5 to 0
|
||||
Simplifying expression containing zero bitmap_clear::$0 in [34] bitmap_clear::col#0 = bitmap_clear::$0 + bitmap_clear::bgcol#0
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Removing unused block main::@return
|
||||
Successful SSA optimization Pass2EliminateUnusedBlocks
|
||||
Eliminating unused variable memset::return#2 and assignment [35] memset::return#2 = memset::str#3
|
||||
Eliminating unused variable memset::return#3 and assignment [37] memset::return#3 = memset::str#3
|
||||
Eliminating unused variable memset::return#0 and assignment [25] memset::return#0 = memset::str#3
|
||||
Eliminating unused variable memset::return#1 and assignment [27] memset::return#1 = memset::str#3
|
||||
Eliminating unused constant bitmap_clear::bgcol#0
|
||||
Eliminating unused constant bitmap_screen#16
|
||||
Eliminating unused constant bitmap_gfx#17
|
||||
@ -972,7 +972,7 @@ Successful SSA optimization Pass2ConditionalJumpSimplification
|
||||
Negating conditional jump and destination [90] if(main::x#1!=0) goto main::@3
|
||||
Negating conditional jump and destination [91] if(main::y#1!=0) goto main::@4
|
||||
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
|
||||
Constant right-side identified [30] bitmap_clear::col#0 = bitmap_clear::fgcol#0 * $10
|
||||
Constant right-side identified [20] bitmap_clear::col#0 = bitmap_clear::fgcol#0 * $10
|
||||
Constant right-side identified [45] main::toD0181_$0 = main::toD0181_$7 & $3fff
|
||||
Constant right-side identified [48] main::toD0181_$3 = > (word)main::toD0181_gfx#0
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
@ -998,21 +998,21 @@ Constant right-side identified [43] main::toD0181_return#0 = main::toD0181_$2 |
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant main::toD0181_return#0 = main::toD0181_$2|main::toD0181_$5
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Inlining Noop Cast [2] memset::$4 = (byte*)memset::str#3 keeping memset::str#3
|
||||
Inlining Noop Cast [4] memset::dst#0 = (byte*)memset::str#3 keeping memset::str#3
|
||||
Inlining Noop Cast [24] bitmap_plot::plotter#0 = (byte*)bitmap_plot::$2 keeping bitmap_plot::plotter#0
|
||||
Successful SSA optimization Pass2NopCastInlining
|
||||
Inlining Noop Cast [34] bitmap_plot::plotter#0 = (byte*)bitmap_plot::$2 keeping bitmap_plot::plotter#0
|
||||
Inlining Noop Cast [32] memset::$4 = (byte*)memset::str#3 keeping memset::str#3
|
||||
Inlining Noop Cast [34] memset::dst#0 = (byte*)memset::str#3 keeping memset::str#3
|
||||
Successful SSA optimization Pass2NopCastInlining
|
||||
Inlining constant with var siblings bitmap_init::bits#0
|
||||
Inlining constant with var siblings bitmap_init::x#0
|
||||
Inlining constant with var siblings bitmap_init::bits#2
|
||||
Inlining constant with var siblings bitmap_init::y#0
|
||||
Inlining constant with var siblings memset::num#0
|
||||
Inlining constant with var siblings memset::c#1
|
||||
Inlining constant with var siblings memset::num#1
|
||||
Inlining constant with var siblings memset::str#0
|
||||
Inlining constant with var siblings memset::str#1
|
||||
Inlining constant with var siblings memset::c#0
|
||||
Inlining constant with var siblings bitmap_init::bits#0
|
||||
Inlining constant with var siblings bitmap_init::x#0
|
||||
Inlining constant with var siblings bitmap_init::bits#2
|
||||
Inlining constant with var siblings bitmap_init::y#0
|
||||
Inlining constant with var siblings main::x#0
|
||||
Inlining constant with var siblings main::y#0
|
||||
Inlining constant with var siblings main::vx#0
|
||||
@ -1022,8 +1022,8 @@ Constant inlined main::toD0181_screen#0 = SCREEN
|
||||
Constant inlined main::toD0181_gfx#0 = BITMAP
|
||||
Constant inlined bitmap_init::gfx#0 = BITMAP
|
||||
Constant inlined memset::num#1 = $1f40
|
||||
Constant inlined memset::num#0 = $3e8
|
||||
Constant inlined bitmap_init::bits#0 = $80
|
||||
Constant inlined memset::num#0 = $3e8
|
||||
Constant inlined bitmap_init::bits#2 = $80
|
||||
Constant inlined memset::str#1 = (void*)BITMAP
|
||||
Constant inlined memset::str#0 = (void*)SCREEN
|
||||
@ -1113,13 +1113,13 @@ Culled Empty Block label bitmap_init::@11
|
||||
Culled Empty Block label bitmap_init::@8
|
||||
Culled Empty Block label bitmap_clear::@2
|
||||
Culled Empty Block label memset::@1
|
||||
Renumbering block memset::@2 to memset::@1
|
||||
Renumbering block memset::@3 to memset::@2
|
||||
Renumbering block memset::@4 to memset::@3
|
||||
Renumbering block bitmap_init::@5 to bitmap_init::@3
|
||||
Renumbering block bitmap_init::@6 to bitmap_init::@4
|
||||
Renumbering block bitmap_init::@7 to bitmap_init::@5
|
||||
Renumbering block bitmap_init::@9 to bitmap_init::@6
|
||||
Renumbering block memset::@2 to memset::@1
|
||||
Renumbering block memset::@3 to memset::@2
|
||||
Renumbering block memset::@4 to memset::@3
|
||||
Renumbering block main::@11 to main::@10
|
||||
Renumbering block main::@12 to main::@11
|
||||
Renumbering block main::@13 to main::@12
|
||||
|
@ -4,50 +4,6 @@ Inlined call call __init
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
|
||||
void* memset(void* memset::str , byte memset::c , word memset::num)
|
||||
memset: scope:[memset] from bitmap_clear bitmap_clear::@1
|
||||
memset::c#5 = phi( bitmap_clear/memset::c#0, bitmap_clear::@1/memset::c#1 )
|
||||
memset::str#4 = phi( bitmap_clear/memset::str#0, bitmap_clear::@1/memset::str#1 )
|
||||
memset::num#2 = phi( bitmap_clear/memset::num#0, bitmap_clear::@1/memset::num#1 )
|
||||
memset::$0 = memset::num#2 > 0
|
||||
memset::$1 = ! memset::$0
|
||||
if(memset::$1) goto memset::@1
|
||||
to:memset::@2
|
||||
memset::@1: scope:[memset] from memset memset::@3
|
||||
memset::str#2 = phi( memset/memset::str#4, memset::@3/memset::str#5 )
|
||||
memset::return#0 = memset::str#2
|
||||
to:memset::@return
|
||||
memset::@2: scope:[memset] from memset
|
||||
memset::c#4 = phi( memset/memset::c#5 )
|
||||
memset::num#3 = phi( memset/memset::num#2 )
|
||||
memset::str#3 = phi( memset/memset::str#4 )
|
||||
memset::$4 = (byte*)memset::str#3
|
||||
memset::$2 = memset::$4 + memset::num#3
|
||||
memset::end#0 = memset::$2
|
||||
memset::dst#0 = ((byte*)) memset::str#3
|
||||
to:memset::@3
|
||||
memset::@3: scope:[memset] from memset::@2 memset::@4
|
||||
memset::c#3 = phi( memset::@2/memset::c#4, memset::@4/memset::c#2 )
|
||||
memset::str#5 = phi( memset::@2/memset::str#3, memset::@4/memset::str#6 )
|
||||
memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 )
|
||||
memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 )
|
||||
memset::$3 = memset::dst#2 != memset::end#1
|
||||
if(memset::$3) goto memset::@4
|
||||
to:memset::@1
|
||||
memset::@4: scope:[memset] from memset::@3
|
||||
memset::str#6 = phi( memset::@3/memset::str#5 )
|
||||
memset::end#2 = phi( memset::@3/memset::end#1 )
|
||||
memset::dst#3 = phi( memset::@3/memset::dst#2 )
|
||||
memset::c#2 = phi( memset::@3/memset::c#3 )
|
||||
*memset::dst#3 = memset::c#2
|
||||
memset::dst#1 = ++ memset::dst#3
|
||||
to:memset::@3
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
memset::return#4 = phi( memset::@1/memset::return#0 )
|
||||
memset::return#1 = memset::return#4
|
||||
return
|
||||
to:@return
|
||||
|
||||
void bitmap_init(byte* bitmap_init::gfx , byte* bitmap_init::screen)
|
||||
bitmap_init: scope:[bitmap_init] from main
|
||||
bitmap_init::screen#1 = phi( main/bitmap_init::screen#0 )
|
||||
@ -147,7 +103,7 @@ bitmap_clear: scope:[bitmap_clear] from main::@6
|
||||
memset::c#0 = bitmap_clear::col#0
|
||||
memset::num#0 = $3e8
|
||||
call memset
|
||||
memset::return#2 = memset::return#1
|
||||
memset::return#0 = memset::return#3
|
||||
to:bitmap_clear::@1
|
||||
bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear
|
||||
bitmap_gfx#8 = phi( bitmap_clear/bitmap_gfx#14 )
|
||||
@ -155,7 +111,7 @@ bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear
|
||||
memset::c#1 = 0
|
||||
memset::num#1 = $1f40
|
||||
call memset
|
||||
memset::return#3 = memset::return#1
|
||||
memset::return#1 = memset::return#3
|
||||
to:bitmap_clear::@2
|
||||
bitmap_clear::@2: scope:[bitmap_clear] from bitmap_clear::@1
|
||||
to:bitmap_clear::@return
|
||||
@ -414,6 +370,50 @@ bitmap_line::@11: scope:[bitmap_line] from bitmap_line::@19
|
||||
bitmap_line::e1#2 = bitmap_line::e1#4 - bitmap_line::dx#6
|
||||
to:bitmap_line::@10
|
||||
|
||||
void* memset(void* memset::str , byte memset::c , word memset::num)
|
||||
memset: scope:[memset] from bitmap_clear bitmap_clear::@1
|
||||
memset::c#5 = phi( bitmap_clear/memset::c#0, bitmap_clear::@1/memset::c#1 )
|
||||
memset::str#4 = phi( bitmap_clear/memset::str#0, bitmap_clear::@1/memset::str#1 )
|
||||
memset::num#2 = phi( bitmap_clear/memset::num#0, bitmap_clear::@1/memset::num#1 )
|
||||
memset::$0 = memset::num#2 > 0
|
||||
memset::$1 = ! memset::$0
|
||||
if(memset::$1) goto memset::@1
|
||||
to:memset::@2
|
||||
memset::@1: scope:[memset] from memset memset::@3
|
||||
memset::str#2 = phi( memset/memset::str#4, memset::@3/memset::str#5 )
|
||||
memset::return#2 = memset::str#2
|
||||
to:memset::@return
|
||||
memset::@2: scope:[memset] from memset
|
||||
memset::c#4 = phi( memset/memset::c#5 )
|
||||
memset::num#3 = phi( memset/memset::num#2 )
|
||||
memset::str#3 = phi( memset/memset::str#4 )
|
||||
memset::$4 = (byte*)memset::str#3
|
||||
memset::$2 = memset::$4 + memset::num#3
|
||||
memset::end#0 = memset::$2
|
||||
memset::dst#0 = ((byte*)) memset::str#3
|
||||
to:memset::@3
|
||||
memset::@3: scope:[memset] from memset::@2 memset::@4
|
||||
memset::c#3 = phi( memset::@2/memset::c#4, memset::@4/memset::c#2 )
|
||||
memset::str#5 = phi( memset::@2/memset::str#3, memset::@4/memset::str#6 )
|
||||
memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 )
|
||||
memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 )
|
||||
memset::$3 = memset::dst#2 != memset::end#1
|
||||
if(memset::$3) goto memset::@4
|
||||
to:memset::@1
|
||||
memset::@4: scope:[memset] from memset::@3
|
||||
memset::str#6 = phi( memset::@3/memset::str#5 )
|
||||
memset::end#2 = phi( memset::@3/memset::end#1 )
|
||||
memset::dst#3 = phi( memset::@3/memset::dst#2 )
|
||||
memset::c#2 = phi( memset::@3/memset::c#3 )
|
||||
*memset::dst#3 = memset::c#2
|
||||
memset::dst#1 = ++ memset::dst#3
|
||||
to:memset::@3
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
memset::return#4 = phi( memset::@1/memset::return#2 )
|
||||
memset::return#3 = memset::return#4
|
||||
return
|
||||
to:@return
|
||||
|
||||
word abs_u16(word abs_u16::w)
|
||||
abs_u16: scope:[abs_u16] from bitmap_line bitmap_line::@12
|
||||
abs_u16::w#2 = phi( bitmap_line/abs_u16::w#0, bitmap_line::@12/abs_u16::w#1 )
|
||||
@ -1048,7 +1048,6 @@ word sgn_u16::w#2
|
||||
Fixing inline constructor with bitmap_plot::$2 = (byte)bitmap_plot_yhi[bitmap_plot::y#4] w= (byte)bitmap_plot_ylo[bitmap_plot::y#4]
|
||||
Successful SSA optimization Pass2FixInlineConstructors
|
||||
Adding number conversion cast (unumber) $40 in
|
||||
Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#2 > 0
|
||||
Adding number conversion cast (unumber) 1 in bitmap_init::bits#1 = bitmap_init::bits#3 >> 1
|
||||
Adding number conversion cast (unumber) 0 in bitmap_init::$0 = bitmap_init::bits#1 == 0
|
||||
Adding number conversion cast (unumber) $80 in bitmap_init::bits#2 = $80
|
||||
@ -1071,6 +1070,7 @@ Adding number conversion cast (unumber) 2 in bitmap_line::$20 = bitmap_line::dy#
|
||||
Adding number conversion cast (unumber) bitmap_line::$20 in bitmap_line::$20 = bitmap_line::dy#2 / (unumber)2
|
||||
Adding number conversion cast (unumber) 2 in bitmap_line::$15 = bitmap_line::dx#3 / 2
|
||||
Adding number conversion cast (unumber) bitmap_line::$15 in bitmap_line::$15 = bitmap_line::dx#3 / (unumber)2
|
||||
Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#2 > 0
|
||||
Adding number conversion cast (unumber) $80 in abs_u16::$1 = abs_u16::$0 & $80
|
||||
Adding number conversion cast (unumber) abs_u16::$1 in abs_u16::$1 = abs_u16::$0 & (unumber)$80
|
||||
Adding number conversion cast (unumber) 0 in abs_u16::$3 = 0 != abs_u16::$1
|
||||
@ -1103,9 +1103,9 @@ Adding number conversion cast (unumber) main::$7 in main::$7 = main::a#2 + (unum
|
||||
Adding number conversion cast (unumber) $20 in main::a#1 = main::a#3 + $20
|
||||
Adding number conversion cast (unumber) $3e7 in main::$12 = SCREEN + $3e7
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Inlining cast memset::dst#0 = (byte*)memset::str#3
|
||||
Inlining cast bitmap_init::bits#2 = (unumber)$80
|
||||
Inlining cast memset::c#1 = (unumber)0
|
||||
Inlining cast memset::dst#0 = (byte*)memset::str#3
|
||||
Inlining cast sgn_u16::return#2 = (unumber)-1
|
||||
Inlining cast sgn_u16::return#3 = (unumber)1
|
||||
Inlining cast *D011 = (unumber)VICII_BMM|VICII_DEN|VICII_RSEL|(unumber)3
|
||||
@ -1115,7 +1115,6 @@ Simplifying constant pointer cast (byte*) 53272
|
||||
Simplifying constant pointer cast (byte*) 8192
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Simplifying constant integer cast $40
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 1
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast $80
|
||||
@ -1131,6 +1130,7 @@ Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 2
|
||||
Simplifying constant integer cast 2
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast $80
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast $80
|
||||
@ -1152,7 +1152,6 @@ Simplifying constant integer cast $20
|
||||
Simplifying constant integer cast $3e7
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (byte) $40
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 1
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) $80
|
||||
@ -1166,6 +1165,7 @@ Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 2
|
||||
Finalized unsigned number type (byte) 2
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) $80
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) $80
|
||||
@ -1205,21 +1205,12 @@ Inferred type updated to word in main::$4 = main::$13 + $78
|
||||
Inferred type updated to byte in main::$5 = main::a#2 + $20
|
||||
Inferred type updated to word in main::$6 = main::$14 + $78
|
||||
Inferred type updated to byte in main::$7 = main::a#2 + $20
|
||||
Inversing boolean not [2] memset::$1 = memset::num#2 <= 0 from [1] memset::$0 = memset::num#2 > 0
|
||||
Inversing boolean not [29] bitmap_init::$1 = bitmap_init::bits#1 != 0 from [28] bitmap_init::$0 = bitmap_init::bits#1 == 0
|
||||
Inversing boolean not [49] bitmap_init::$9 = bitmap_init::$7 != 7 from [48] bitmap_init::$8 = bitmap_init::$7 == 7
|
||||
Inversing boolean not [144] bitmap_line::$18 = bitmap_line::dy#3 >= bitmap_line::e#1 from [143] bitmap_line::$17 = bitmap_line::dy#3 < bitmap_line::e#1
|
||||
Inversing boolean not [164] bitmap_line::$23 = bitmap_line::dx#5 >= bitmap_line::e1#1 from [163] bitmap_line::$22 = bitmap_line::dx#5 < bitmap_line::e1#1
|
||||
Inversing boolean not [9] bitmap_init::$1 = bitmap_init::bits#1 != 0 from [8] bitmap_init::$0 = bitmap_init::bits#1 == 0
|
||||
Inversing boolean not [29] bitmap_init::$9 = bitmap_init::$7 != 7 from [28] bitmap_init::$8 = bitmap_init::$7 == 7
|
||||
Inversing boolean not [124] bitmap_line::$18 = bitmap_line::dy#3 >= bitmap_line::e#1 from [123] bitmap_line::$17 = bitmap_line::dy#3 < bitmap_line::e#1
|
||||
Inversing boolean not [144] bitmap_line::$23 = bitmap_line::dx#5 >= bitmap_line::e1#1 from [143] bitmap_line::$22 = bitmap_line::dx#5 < bitmap_line::e1#1
|
||||
Inversing boolean not [154] memset::$1 = memset::num#2 <= 0 from [153] memset::$0 = memset::num#2 > 0
|
||||
Successful SSA optimization Pass2UnaryNotSimplification
|
||||
Alias memset::return#0 = memset::str#2 memset::return#4 memset::return#1
|
||||
Alias memset::str#3 = memset::str#4
|
||||
Alias memset::num#2 = memset::num#3
|
||||
Alias memset::c#4 = memset::c#5
|
||||
Alias memset::end#0 = memset::$2
|
||||
Alias memset::c#2 = memset::c#3
|
||||
Alias memset::dst#2 = memset::dst#3
|
||||
Alias memset::end#1 = memset::end#2
|
||||
Alias memset::str#5 = memset::str#6
|
||||
Alias bitmap_init::x#2 = bitmap_init::x#4
|
||||
Alias bitmap_init::gfx#4 = bitmap_init::gfx#5
|
||||
Alias bitmap_gfx#28 = bitmap_gfx#29
|
||||
@ -1274,6 +1265,15 @@ Alias bitmap_line::y#15 = bitmap_line::y#8 bitmap_line::y#9
|
||||
Alias bitmap_line::sy#2 = bitmap_line::sy#4 bitmap_line::sy#7
|
||||
Alias bitmap_line::e1#1 = bitmap_line::e1#4
|
||||
Alias bitmap_line::x#15 = bitmap_line::x#2
|
||||
Alias memset::return#2 = memset::str#2 memset::return#4 memset::return#3
|
||||
Alias memset::str#3 = memset::str#4
|
||||
Alias memset::num#2 = memset::num#3
|
||||
Alias memset::c#4 = memset::c#5
|
||||
Alias memset::end#0 = memset::$2
|
||||
Alias memset::c#2 = memset::c#3
|
||||
Alias memset::dst#2 = memset::dst#3
|
||||
Alias memset::end#1 = memset::end#2
|
||||
Alias memset::str#5 = memset::str#6
|
||||
Alias abs_u16::w#2 = abs_u16::w#3 abs_u16::w#4 abs_u16::return#3
|
||||
Alias abs_u16::return#2 = abs_u16::$2
|
||||
Alias abs_u16::return#4 = abs_u16::return#7
|
||||
@ -1316,9 +1316,6 @@ Alias bitmap_line::dy#12 = bitmap_line::dy#13
|
||||
Alias bitmap_line::dx#12 = bitmap_line::dx#5
|
||||
Alias bitmap_line::sy#2 = bitmap_line::sy#9
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values memset::end#1 memset::end#0
|
||||
Identical Phi Values memset::str#5 memset::str#3
|
||||
Identical Phi Values memset::c#2 memset::c#4
|
||||
Identical Phi Values bitmap_init::gfx#1 bitmap_init::gfx#0
|
||||
Identical Phi Values bitmap_init::screen#1 bitmap_init::screen#0
|
||||
Identical Phi Values bitmap_init::gfx#2 bitmap_init::gfx#1
|
||||
@ -1344,6 +1341,9 @@ Identical Phi Values bitmap_line::dy#12 bitmap_line::dy#0
|
||||
Identical Phi Values bitmap_line::dx#12 bitmap_line::dx#0
|
||||
Identical Phi Values bitmap_line::x2#3 bitmap_line::x2#1
|
||||
Identical Phi Values bitmap_line::sy#2 bitmap_line::sy#0
|
||||
Identical Phi Values memset::end#1 memset::end#0
|
||||
Identical Phi Values memset::str#5 memset::str#3
|
||||
Identical Phi Values memset::c#2 memset::c#4
|
||||
Identical Phi Values bitmap_gfx#15 bitmap_gfx#17
|
||||
Identical Phi Values bitmap_screen#14 bitmap_screen#16
|
||||
Identical Phi Values bitmap_gfx#2 bitmap_gfx#1
|
||||
@ -1355,27 +1355,27 @@ Identical Phi Values bitmap_screen#10 bitmap_screen#19
|
||||
Identical Phi Values bitmap_gfx#11 bitmap_gfx#10
|
||||
Identical Phi Values bitmap_screen#11 bitmap_screen#10
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Identical Phi Values memset::return#0 memset::str#3
|
||||
Identical Phi Values memset::return#2 memset::str#3
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Identified duplicate assignment right side [47] bitmap_init::$7 = bitmap_init::y#2 & 7
|
||||
Identified duplicate assignment right side [27] bitmap_init::$7 = bitmap_init::y#2 & 7
|
||||
Successful SSA optimization Pass2DuplicateRValueIdentification
|
||||
Simple Condition memset::$1 [2] if(memset::num#2<=0) goto memset::@1
|
||||
Simple Condition memset::$3 [9] if(memset::dst#2!=memset::end#0) goto memset::@4
|
||||
Simple Condition bitmap_init::$1 [22] if(bitmap_init::bits#1!=0) goto bitmap_init::@2
|
||||
Simple Condition bitmap_init::$2 [26] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1
|
||||
Simple Condition bitmap_init::$9 [38] if(bitmap_init::$7!=7) goto bitmap_init::@6
|
||||
Simple Condition bitmap_init::$11 [42] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5
|
||||
Simple Condition bitmap_line::$12 [90] if(bitmap_line::dx#0>bitmap_line::dy#0) goto bitmap_line::@2
|
||||
Simple Condition bitmap_line::$18 [104] if(bitmap_line::dy#0>=bitmap_line::e#1) goto bitmap_line::@7
|
||||
Simple Condition bitmap_line::$19 [107] if(bitmap_line::y#1!=bitmap_line::y2#0) goto bitmap_line::@6
|
||||
Simple Condition bitmap_line::$23 [121] if(bitmap_line::dx#0>=bitmap_line::e1#1) goto bitmap_line::@10
|
||||
Simple Condition bitmap_line::$24 [124] if(bitmap_line::x#15!=bitmap_line::x2#0) goto bitmap_line::@9
|
||||
Simple Condition bitmap_init::$1 [9] if(bitmap_init::bits#1!=0) goto bitmap_init::@2
|
||||
Simple Condition bitmap_init::$2 [13] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1
|
||||
Simple Condition bitmap_init::$9 [25] if(bitmap_init::$7!=7) goto bitmap_init::@6
|
||||
Simple Condition bitmap_init::$11 [29] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5
|
||||
Simple Condition bitmap_line::$12 [77] if(bitmap_line::dx#0>bitmap_line::dy#0) goto bitmap_line::@2
|
||||
Simple Condition bitmap_line::$18 [91] if(bitmap_line::dy#0>=bitmap_line::e#1) goto bitmap_line::@7
|
||||
Simple Condition bitmap_line::$19 [94] if(bitmap_line::y#1!=bitmap_line::y2#0) goto bitmap_line::@6
|
||||
Simple Condition bitmap_line::$23 [108] if(bitmap_line::dx#0>=bitmap_line::e1#1) goto bitmap_line::@10
|
||||
Simple Condition bitmap_line::$24 [111] if(bitmap_line::x#15!=bitmap_line::x2#0) goto bitmap_line::@9
|
||||
Simple Condition memset::$1 [116] if(memset::num#2<=0) goto memset::@1
|
||||
Simple Condition memset::$3 [123] if(memset::dst#2!=memset::end#0) goto memset::@4
|
||||
Simple Condition abs_u16::$3 [131] if(0!=abs_u16::$1) goto abs_u16::@1
|
||||
Simple Condition sgn_u16::$2 [139] if(0!=sgn_u16::$1) goto sgn_u16::@1
|
||||
Simple Condition main::$3 [168] if(main::i#2!=8) goto main::@2
|
||||
Successful SSA optimization Pass2ConditionalJumpSimplification
|
||||
Rewriting ! if()-condition to reversed if() [79] bitmap_line::$7 = ! bitmap_line::$6
|
||||
Rewriting && if()-condition to two if()s [78] bitmap_line::$6 = bitmap_line::$4 && bitmap_line::$5
|
||||
Rewriting ! if()-condition to reversed if() [66] bitmap_line::$7 = ! bitmap_line::$6
|
||||
Rewriting && if()-condition to two if()s [65] bitmap_line::$6 = bitmap_line::$4 && bitmap_line::$5
|
||||
Successful SSA optimization Pass2ConditionalAndOrRewriting
|
||||
Constant right-side identified [182] main::$12 = SCREEN + $3e7
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
@ -1411,16 +1411,16 @@ Constant value identified (word)main::toD0181_gfx#0 in [159] main::toD0181_$3 =
|
||||
Successful SSA optimization Pass2ConstantValues
|
||||
if() condition always true - replacing block destination [181] if(true) goto main::@4
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Resolved ranged next value [24] bitmap_init::x#1 = ++ bitmap_init::x#2 to ++
|
||||
Resolved ranged comparison value [26] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1 to 0
|
||||
Resolved ranged next value [40] bitmap_init::y#1 = ++ bitmap_init::y#2 to ++
|
||||
Resolved ranged comparison value [42] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5 to 0
|
||||
Simplifying expression containing zero bitmap_clear::$0 in [47] bitmap_clear::col#0 = bitmap_clear::$0 + bitmap_clear::bgcol#0
|
||||
Resolved ranged next value [11] bitmap_init::x#1 = ++ bitmap_init::x#2 to ++
|
||||
Resolved ranged comparison value [13] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1 to 0
|
||||
Resolved ranged next value [27] bitmap_init::y#1 = ++ bitmap_init::y#2 to ++
|
||||
Resolved ranged comparison value [29] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5 to 0
|
||||
Simplifying expression containing zero bitmap_clear::$0 in [34] bitmap_clear::col#0 = bitmap_clear::$0 + bitmap_clear::bgcol#0
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Removing unused block main::@return
|
||||
Successful SSA optimization Pass2EliminateUnusedBlocks
|
||||
Eliminating unused variable memset::return#2 and assignment [35] memset::return#2 = memset::str#3
|
||||
Eliminating unused variable memset::return#3 and assignment [37] memset::return#3 = memset::str#3
|
||||
Eliminating unused variable memset::return#0 and assignment [25] memset::return#0 = memset::str#3
|
||||
Eliminating unused variable memset::return#1 and assignment [27] memset::return#1 = memset::str#3
|
||||
Eliminating unused constant bitmap_clear::bgcol#0
|
||||
Eliminating unused constant bitmap_screen#16
|
||||
Eliminating unused constant bitmap_gfx#17
|
||||
@ -1434,8 +1434,8 @@ Removing unused procedure block __start::@1
|
||||
Removing unused procedure block __start::@2
|
||||
Removing unused procedure block __start::@return
|
||||
Successful SSA optimization PassNEliminateEmptyStart
|
||||
Adding number conversion cast (unumber) 0 in [16] if(bitmap_init::x#1!=0) goto bitmap_init::@1
|
||||
Adding number conversion cast (unumber) 0 in [28] if(bitmap_init::y#1!=0) goto bitmap_init::@5
|
||||
Adding number conversion cast (unumber) 0 in [6] if(bitmap_init::x#1!=0) goto bitmap_init::@1
|
||||
Adding number conversion cast (unumber) 0 in [18] if(bitmap_init::y#1!=0) goto bitmap_init::@5
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 0
|
||||
@ -1446,12 +1446,12 @@ Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Alias bitmap_init::$7 = bitmap_init::$3
|
||||
Alias bitmap_clear::col#0 = bitmap_clear::$0
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Simple Condition bitmap_line::$4 [53] if(bitmap_line::dx#0==0) goto bitmap_line::@20
|
||||
Simple Condition bitmap_line::$4 [43] if(bitmap_line::dx#0==0) goto bitmap_line::@20
|
||||
Simple Condition bitmap_line::$5 [133] if(bitmap_line::dy#0==0) goto bitmap_line::@4
|
||||
Successful SSA optimization Pass2ConditionalJumpSimplification
|
||||
Negating conditional jump and destination [53] if(bitmap_line::dx#0!=0) goto bitmap_line::@1
|
||||
Negating conditional jump and destination [43] if(bitmap_line::dx#0!=0) goto bitmap_line::@1
|
||||
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
|
||||
Constant right-side identified [30] bitmap_clear::col#0 = bitmap_clear::fgcol#0 * $10
|
||||
Constant right-side identified [20] bitmap_clear::col#0 = bitmap_clear::fgcol#0 * $10
|
||||
Constant right-side identified [111] main::toD0181_$0 = main::toD0181_$7 & $3fff
|
||||
Constant right-side identified [114] main::toD0181_$3 = > (word)main::toD0181_gfx#0
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
@ -1477,24 +1477,24 @@ Constant right-side identified [107] main::toD0181_return#0 = main::toD0181_$2 |
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant main::toD0181_return#0 = main::toD0181_$2|main::toD0181_$5
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Inlining Noop Cast [2] memset::$4 = (byte*)memset::str#3 keeping memset::str#3
|
||||
Inlining Noop Cast [4] memset::dst#0 = (byte*)memset::str#3 keeping memset::str#3
|
||||
Inlining Noop Cast [25] bitmap_plot::plotter#0 = (byte*)bitmap_plot::$2 keeping bitmap_plot::plotter#0
|
||||
Successful SSA optimization Pass2NopCastInlining
|
||||
Inlining Noop Cast [35] bitmap_plot::plotter#0 = (byte*)bitmap_plot::$2 keeping bitmap_plot::plotter#0
|
||||
Inlining Noop Cast [83] memset::$4 = (byte*)memset::str#3 keeping memset::str#3
|
||||
Inlining Noop Cast [85] memset::dst#0 = (byte*)memset::str#3 keeping memset::str#3
|
||||
Successful SSA optimization Pass2NopCastInlining
|
||||
Rewriting division to use shift [63] bitmap_line::e1#0 = bitmap_line::dy#0 / 2
|
||||
Rewriting division to use shift [64] bitmap_line::e#0 = bitmap_line::dx#0 / 2
|
||||
Rewriting division to use shift [53] bitmap_line::e1#0 = bitmap_line::dy#0 / 2
|
||||
Rewriting division to use shift [54] bitmap_line::e#0 = bitmap_line::dx#0 / 2
|
||||
Successful SSA optimization Pass2MultiplyToShiftRewriting
|
||||
Inlining constant with var siblings bitmap_init::bits#0
|
||||
Inlining constant with var siblings bitmap_init::x#0
|
||||
Inlining constant with var siblings bitmap_init::bits#2
|
||||
Inlining constant with var siblings bitmap_init::y#0
|
||||
Inlining constant with var siblings memset::num#0
|
||||
Inlining constant with var siblings memset::c#1
|
||||
Inlining constant with var siblings memset::num#1
|
||||
Inlining constant with var siblings memset::str#0
|
||||
Inlining constant with var siblings memset::str#1
|
||||
Inlining constant with var siblings memset::c#0
|
||||
Inlining constant with var siblings bitmap_init::bits#0
|
||||
Inlining constant with var siblings bitmap_init::x#0
|
||||
Inlining constant with var siblings bitmap_init::bits#2
|
||||
Inlining constant with var siblings bitmap_init::y#0
|
||||
Inlining constant with var siblings sgn_u16::return#2
|
||||
Inlining constant with var siblings sgn_u16::return#3
|
||||
Inlining constant with var siblings main::i#0
|
||||
@ -1505,8 +1505,8 @@ Constant inlined main::toD0181_gfx#0 = BITMAP
|
||||
Constant inlined bitmap_init::gfx#0 = BITMAP
|
||||
Constant inlined main::$12 = SCREEN+$3e7
|
||||
Constant inlined memset::num#1 = $1f40
|
||||
Constant inlined memset::num#0 = $3e8
|
||||
Constant inlined bitmap_init::bits#0 = $80
|
||||
Constant inlined memset::num#0 = $3e8
|
||||
Constant inlined bitmap_init::bits#2 = $80
|
||||
Constant inlined main::a#0 = 0
|
||||
Constant inlined sgn_u16::return#3 = 1
|
||||
@ -1648,9 +1648,6 @@ Culled Empty Block label bitmap_line::@16
|
||||
Culled Empty Block label memset::@1
|
||||
Culled Empty Block label abs_u16::@2
|
||||
Culled Empty Block label sgn_u16::@2
|
||||
Renumbering block memset::@2 to memset::@1
|
||||
Renumbering block memset::@3 to memset::@2
|
||||
Renumbering block memset::@4 to memset::@3
|
||||
Renumbering block bitmap_init::@5 to bitmap_init::@3
|
||||
Renumbering block bitmap_init::@6 to bitmap_init::@4
|
||||
Renumbering block bitmap_init::@7 to bitmap_init::@5
|
||||
@ -1658,6 +1655,9 @@ Renumbering block bitmap_init::@9 to bitmap_init::@6
|
||||
Renumbering block bitmap_line::@17 to bitmap_line::@16
|
||||
Renumbering block bitmap_line::@19 to bitmap_line::@17
|
||||
Renumbering block bitmap_line::@20 to bitmap_line::@18
|
||||
Renumbering block memset::@2 to memset::@1
|
||||
Renumbering block memset::@3 to memset::@2
|
||||
Renumbering block memset::@4 to memset::@3
|
||||
Renumbering block main::@4 to main::@3
|
||||
Renumbering block main::@5 to main::@4
|
||||
Renumbering block main::@6 to main::@5
|
||||
|
@ -2,50 +2,6 @@ Inlined call call __init
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
|
||||
void* memset(void* memset::str , byte memset::c , word memset::num)
|
||||
memset: scope:[memset] from print_cls
|
||||
memset::c#4 = phi( print_cls/memset::c#0 )
|
||||
memset::str#3 = phi( print_cls/memset::str#0 )
|
||||
memset::num#1 = phi( print_cls/memset::num#0 )
|
||||
memset::$0 = memset::num#1 > 0
|
||||
memset::$1 = ! memset::$0
|
||||
if(memset::$1) goto memset::@1
|
||||
to:memset::@2
|
||||
memset::@1: scope:[memset] from memset memset::@3
|
||||
memset::str#1 = phi( memset/memset::str#3, memset::@3/memset::str#4 )
|
||||
memset::return#0 = memset::str#1
|
||||
to:memset::@return
|
||||
memset::@2: scope:[memset] from memset
|
||||
memset::c#3 = phi( memset/memset::c#4 )
|
||||
memset::num#2 = phi( memset/memset::num#1 )
|
||||
memset::str#2 = phi( memset/memset::str#3 )
|
||||
memset::$4 = (byte*)memset::str#2
|
||||
memset::$2 = memset::$4 + memset::num#2
|
||||
memset::end#0 = memset::$2
|
||||
memset::dst#0 = ((byte*)) memset::str#2
|
||||
to:memset::@3
|
||||
memset::@3: scope:[memset] from memset::@2 memset::@4
|
||||
memset::c#2 = phi( memset::@2/memset::c#3, memset::@4/memset::c#1 )
|
||||
memset::str#4 = phi( memset::@2/memset::str#2, memset::@4/memset::str#5 )
|
||||
memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 )
|
||||
memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 )
|
||||
memset::$3 = memset::dst#2 != memset::end#1
|
||||
if(memset::$3) goto memset::@4
|
||||
to:memset::@1
|
||||
memset::@4: scope:[memset] from memset::@3
|
||||
memset::str#5 = phi( memset::@3/memset::str#4 )
|
||||
memset::end#2 = phi( memset::@3/memset::end#1 )
|
||||
memset::dst#3 = phi( memset::@3/memset::dst#2 )
|
||||
memset::c#1 = phi( memset::@3/memset::c#2 )
|
||||
*memset::dst#3 = memset::c#1
|
||||
memset::dst#1 = ++ memset::dst#3
|
||||
to:memset::@3
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
memset::return#3 = phi( memset::@1/memset::return#0 )
|
||||
memset::return#1 = memset::return#3
|
||||
return
|
||||
to:@return
|
||||
|
||||
void print_str(byte* print_str::str)
|
||||
print_str: scope:[print_str] from testChar testInt testLong testShort
|
||||
print_char_cursor#159 = phi( testChar/print_char_cursor#154, testInt/print_char_cursor#156, testLong/print_char_cursor#157, testShort/print_char_cursor#155 )
|
||||
@ -339,7 +295,7 @@ print_cls: scope:[print_cls] from main
|
||||
memset::c#0 = ' '
|
||||
memset::num#0 = $3e8
|
||||
call memset
|
||||
memset::return#2 = memset::return#1
|
||||
memset::return#0 = memset::return#2
|
||||
to:print_cls::@1
|
||||
print_cls::@1: scope:[print_cls] from print_cls
|
||||
print_screen#3 = phi( print_cls/print_screen#2 )
|
||||
@ -354,6 +310,50 @@ print_cls::@return: scope:[print_cls] from print_cls::@1
|
||||
return
|
||||
to:@return
|
||||
|
||||
void* memset(void* memset::str , byte memset::c , word memset::num)
|
||||
memset: scope:[memset] from print_cls
|
||||
memset::c#4 = phi( print_cls/memset::c#0 )
|
||||
memset::str#3 = phi( print_cls/memset::str#0 )
|
||||
memset::num#1 = phi( print_cls/memset::num#0 )
|
||||
memset::$0 = memset::num#1 > 0
|
||||
memset::$1 = ! memset::$0
|
||||
if(memset::$1) goto memset::@1
|
||||
to:memset::@2
|
||||
memset::@1: scope:[memset] from memset memset::@3
|
||||
memset::str#1 = phi( memset/memset::str#3, memset::@3/memset::str#4 )
|
||||
memset::return#1 = memset::str#1
|
||||
to:memset::@return
|
||||
memset::@2: scope:[memset] from memset
|
||||
memset::c#3 = phi( memset/memset::c#4 )
|
||||
memset::num#2 = phi( memset/memset::num#1 )
|
||||
memset::str#2 = phi( memset/memset::str#3 )
|
||||
memset::$4 = (byte*)memset::str#2
|
||||
memset::$2 = memset::$4 + memset::num#2
|
||||
memset::end#0 = memset::$2
|
||||
memset::dst#0 = ((byte*)) memset::str#2
|
||||
to:memset::@3
|
||||
memset::@3: scope:[memset] from memset::@2 memset::@4
|
||||
memset::c#2 = phi( memset::@2/memset::c#3, memset::@4/memset::c#1 )
|
||||
memset::str#4 = phi( memset::@2/memset::str#2, memset::@4/memset::str#5 )
|
||||
memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 )
|
||||
memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 )
|
||||
memset::$3 = memset::dst#2 != memset::end#1
|
||||
if(memset::$3) goto memset::@4
|
||||
to:memset::@1
|
||||
memset::@4: scope:[memset] from memset::@3
|
||||
memset::str#5 = phi( memset::@3/memset::str#4 )
|
||||
memset::end#2 = phi( memset::@3/memset::end#1 )
|
||||
memset::dst#3 = phi( memset::@3/memset::dst#2 )
|
||||
memset::c#1 = phi( memset::@3/memset::c#2 )
|
||||
*memset::dst#3 = memset::c#1
|
||||
memset::dst#1 = ++ memset::dst#3
|
||||
to:memset::@3
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
memset::return#3 = phi( memset::@1/memset::return#1 )
|
||||
memset::return#2 = memset::return#3
|
||||
return
|
||||
to:@return
|
||||
|
||||
void main()
|
||||
main: scope:[main] from __start::@1
|
||||
print_char_cursor#153 = phi( __start::@1/print_char_cursor#158 )
|
||||
@ -1100,7 +1100,6 @@ constant signed word testShort::s = -$578
|
||||
constant byte* testShort::str[8] = "short: "
|
||||
constant word testShort::u = $578
|
||||
|
||||
Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#1 > 0
|
||||
Adding number conversion cast (unumber) 0 in print_str::$1 = 0 != *print_str::str#5
|
||||
Adding number conversion cast (unumber) $28 in print_ln::$0 = print_line_cursor#21 + $28
|
||||
Adding number conversion cast (snumber) 0 in print_sint::$0 = print_sint::w#5 < 0
|
||||
@ -1110,12 +1109,12 @@ Adding number conversion cast (unumber) 4 in print_uchar::$0 = print_uchar::b#5
|
||||
Adding number conversion cast (unumber) $f in print_uchar::$2 = print_uchar::b#6 & $f
|
||||
Adding number conversion cast (unumber) print_uchar::$2 in print_uchar::$2 = print_uchar::b#6 & (unumber)$f
|
||||
Adding number conversion cast (unumber) $3e8 in memset::num#0 = $3e8
|
||||
Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#1 > 0
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Inlining cast memset::dst#0 = (byte*)memset::str#2
|
||||
Inlining cast memset::num#0 = (unumber)$3e8
|
||||
Inlining cast memset::dst#0 = (byte*)memset::str#2
|
||||
Successful SSA optimization Pass2InlineCast
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast $28
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 0
|
||||
@ -1123,10 +1122,10 @@ Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 4
|
||||
Simplifying constant integer cast $f
|
||||
Simplifying constant integer cast $3e8
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) $28
|
||||
Finalized signed number type (signed byte) 0
|
||||
Finalized signed number type (signed byte) 0
|
||||
@ -1134,19 +1133,11 @@ Finalized signed number type (signed byte) 0
|
||||
Finalized unsigned number type (byte) 4
|
||||
Finalized unsigned number type (byte) $f
|
||||
Finalized unsigned number type (word) $3e8
|
||||
Finalized unsigned number type (byte) 0
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Inferred type updated to byte in print_uchar::$2 = print_uchar::b#6 & $f
|
||||
Inversing boolean not [2] memset::$1 = memset::num#1 <= 0 from [1] memset::$0 = memset::num#1 > 0
|
||||
Inversing boolean not [157] memset::$1 = memset::num#1 <= 0 from [156] memset::$0 = memset::num#1 > 0
|
||||
Successful SSA optimization Pass2UnaryNotSimplification
|
||||
Alias memset::return#0 = memset::str#1 memset::return#3 memset::return#1
|
||||
Alias memset::str#2 = memset::str#3
|
||||
Alias memset::num#1 = memset::num#2
|
||||
Alias memset::c#3 = memset::c#4
|
||||
Alias memset::end#0 = memset::$2
|
||||
Alias memset::c#1 = memset::c#2
|
||||
Alias memset::dst#2 = memset::dst#3
|
||||
Alias memset::end#1 = memset::end#2
|
||||
Alias memset::str#4 = memset::str#5
|
||||
Alias print_str::str#5 = print_str::str#6 print_str::str#7
|
||||
Alias print_char_cursor#1 = print_char_cursor#138 print_char_cursor#139 print_char_cursor#71
|
||||
Alias print_char_cursor#0 = print_char_cursor#70
|
||||
@ -1184,6 +1175,15 @@ Alias print_char_cursor#22 = print_char_cursor#92
|
||||
Alias print_char_cursor#23 = print_char_cursor#93 print_char_cursor#94 print_char_cursor#24
|
||||
Alias print_char_cursor#25 = print_char_cursor#96 print_char_cursor#26
|
||||
Alias print_line_cursor#2 = print_screen#3 print_screen#2 print_char_cursor#27 print_line_cursor#24 print_char_cursor#97 print_line_cursor#3 print_char_cursor#28
|
||||
Alias memset::return#1 = memset::str#1 memset::return#3 memset::return#2
|
||||
Alias memset::str#2 = memset::str#3
|
||||
Alias memset::num#1 = memset::num#2
|
||||
Alias memset::c#3 = memset::c#4
|
||||
Alias memset::end#0 = memset::$2
|
||||
Alias memset::c#1 = memset::c#2
|
||||
Alias memset::dst#2 = memset::dst#3
|
||||
Alias memset::end#1 = memset::end#2
|
||||
Alias memset::str#4 = memset::str#5
|
||||
Alias print_line_cursor#25 = print_line_cursor#4
|
||||
Alias print_char_cursor#29 = print_char_cursor#98
|
||||
Alias print_char_cursor#30 = print_char_cursor#99
|
||||
@ -1234,12 +1234,6 @@ Alias print_screen#0 = print_line_cursor#18 print_char_cursor#67 print_line_curs
|
||||
Alias print_line_cursor#19 = print_line_cursor#39 print_line_cursor#40 print_line_cursor#20
|
||||
Alias print_char_cursor#136 = print_char_cursor#68 print_char_cursor#137 print_char_cursor#69
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values memset::num#1 memset::num#0
|
||||
Identical Phi Values memset::str#2 memset::str#0
|
||||
Identical Phi Values memset::c#3 memset::c#0
|
||||
Identical Phi Values memset::end#1 memset::end#0
|
||||
Identical Phi Values memset::str#4 memset::str#2
|
||||
Identical Phi Values memset::c#1 memset::c#3
|
||||
Identical Phi Values print_char_cursor#0 print_char_cursor#25
|
||||
Identical Phi Values print_char_cursor#72 print_char_cursor#140
|
||||
Identical Phi Values print_char_cursor#4 print_char_cursor#25
|
||||
@ -1260,6 +1254,12 @@ Identical Phi Values print_char_cursor#20 print_char_cursor#16
|
||||
Identical Phi Values print_char_cursor#22 print_char_cursor#25
|
||||
Identical Phi Values print_char_cursor#23 print_char_cursor#25
|
||||
Identical Phi Values print_line_cursor#2 print_screen#5
|
||||
Identical Phi Values memset::num#1 memset::num#0
|
||||
Identical Phi Values memset::str#2 memset::str#0
|
||||
Identical Phi Values memset::c#3 memset::c#0
|
||||
Identical Phi Values memset::end#1 memset::end#0
|
||||
Identical Phi Values memset::str#4 memset::str#2
|
||||
Identical Phi Values memset::c#1 memset::c#3
|
||||
Identical Phi Values print_screen#5 print_screen#0
|
||||
Identical Phi Values print_line_cursor#42 print_screen#0
|
||||
Identical Phi Values print_char_cursor#153 print_screen#0
|
||||
@ -1316,21 +1316,21 @@ Identical Phi Values print_char_cursor#134 print_line_cursor#0
|
||||
Identical Phi Values print_line_cursor#19 print_line_cursor#29
|
||||
Identical Phi Values print_char_cursor#136 print_char_cursor#102
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Identical Phi Values memset::return#0 memset::str#0
|
||||
Identical Phi Values print_char_cursor#140 print_char_cursor#25
|
||||
Identical Phi Values print_char_cursor#141 print_char_cursor#25
|
||||
Identical Phi Values print_char_cursor#143 print_char_cursor#25
|
||||
Identical Phi Values print_char_cursor#146 print_char_cursor#25
|
||||
Identical Phi Values print_char_cursor#149 print_char_cursor#25
|
||||
Identical Phi Values print_char_cursor#151 print_char_cursor#25
|
||||
Identical Phi Values memset::return#1 memset::str#0
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Simple Condition memset::$1 [2] if(memset::num#0<=0) goto memset::@1
|
||||
Simple Condition memset::$3 [9] if(memset::dst#2!=memset::end#0) goto memset::@4
|
||||
Simple Condition print_str::$1 [16] if(0!=*print_str::str#5) goto print_str::@2
|
||||
Simple Condition print_ln::$1 [26] if(print_line_cursor#0<print_char_cursor#25) goto print_ln::@1
|
||||
Simple Condition print_sint::$0 [30] if(print_sint::w#10<0) goto print_sint::@1
|
||||
Simple Condition print_schar::$0 [45] if(print_schar::b#1<0) goto print_schar::@1
|
||||
Simple Condition print_slong::$0 [76] if(print_slong::dw#3<0) goto print_slong::@1
|
||||
Simple Condition print_str::$1 [3] if(0!=*print_str::str#5) goto print_str::@2
|
||||
Simple Condition print_ln::$1 [13] if(print_line_cursor#0<print_char_cursor#25) goto print_ln::@1
|
||||
Simple Condition print_sint::$0 [17] if(print_sint::w#10<0) goto print_sint::@1
|
||||
Simple Condition print_schar::$0 [32] if(print_schar::b#1<0) goto print_schar::@1
|
||||
Simple Condition print_slong::$0 [63] if(print_slong::dw#3<0) goto print_slong::@1
|
||||
Simple Condition memset::$1 [99] if(memset::num#0<=0) goto memset::@1
|
||||
Simple Condition memset::$3 [106] if(memset::dst#2!=memset::end#0) goto memset::@4
|
||||
Successful SSA optimization Pass2ConditionalJumpSimplification
|
||||
Constant print_char::ch#1 = '-'
|
||||
Constant print_char::ch#2 = ' '
|
||||
@ -1368,12 +1368,12 @@ Constant print_screen#0 = (byte*) 1024
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant memset::str#0 = (void*)print_screen#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant memset::return#0 = memset::str#0
|
||||
Constant memset::$4 = (byte*)memset::str#0
|
||||
Constant memset::dst#0 = (byte*)memset::str#0
|
||||
Constant memset::return#2 = memset::str#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
if() condition always false - eliminating [2] if(memset::num#0<=0) goto memset::@1
|
||||
if() condition always true - replacing block destination [45] if(print_schar::b#1<0) goto print_schar::@1
|
||||
if() condition always true - replacing block destination [32] if(print_schar::b#1<0) goto print_schar::@1
|
||||
if() condition always false - eliminating [99] if(memset::num#0<=0) goto memset::@1
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Removing PHI-reference to removed block (print_schar::@3) in block print_char
|
||||
Removing PHI-reference to removed block (print_schar::@3) in block print_char
|
||||
@ -1381,8 +1381,8 @@ Removing unused block print_schar::@3
|
||||
Removing PHI-reference to removed block (print_schar::@5) in block print_schar::@2
|
||||
Removing unused block print_schar::@5
|
||||
Successful SSA optimization Pass2EliminateUnusedBlocks
|
||||
Eliminating unused constant memset::return#2
|
||||
Eliminating unused constant print_char::ch#4
|
||||
Eliminating unused constant memset::return#0
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Removing unused procedure __start
|
||||
Removing unused procedure block __start
|
||||
@ -1393,15 +1393,14 @@ Removing unused procedure block __start::@return
|
||||
Successful SSA optimization PassNEliminateEmptyStart
|
||||
Alias print_schar::b#0 = print_schar::b#4
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Constant right-side identified [0] memset::end#0 = memset::$4 + memset::num#0
|
||||
Constant right-side identified [28] print_schar::b#0 = - print_schar::b#1
|
||||
Constant right-side identified [22] print_schar::b#0 = - print_schar::b#1
|
||||
Constant right-side identified [61] memset::end#0 = memset::$4 + memset::num#0
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant memset::end#0 = memset::$4+memset::num#0
|
||||
Constant print_schar::b#0 = -print_schar::b#1
|
||||
Constant memset::end#0 = memset::$4+memset::num#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant print_uchar::b#0 = (byte)print_schar::b#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Inlining constant with var siblings memset::dst#0
|
||||
Inlining constant with var siblings print_str::str#1
|
||||
Inlining constant with var siblings print_str::str#2
|
||||
Inlining constant with var siblings print_str::str#3
|
||||
@ -1432,6 +1431,7 @@ Inlining constant with var siblings print_char::ch#13
|
||||
Inlining constant with var siblings print_char::ch#14
|
||||
Inlining constant with var siblings print_char::ch#15
|
||||
Inlining constant with var siblings print_char::ch#16
|
||||
Inlining constant with var siblings memset::dst#0
|
||||
Constant inlined print_sint::w#3 = testInt::n
|
||||
Constant inlined print_char::ch#13 = ' '
|
||||
Constant inlined print_sint::w#2 = testShort::s
|
||||
@ -2157,10 +2157,10 @@ Uplift Scope [print_str] 3,129.25: zp[2]:4 [ print_str::str#5 print_str::str#8 p
|
||||
Uplift Scope [print_ulong] 903: zp[4]:16 [ print_ulong::dw#2 print_ulong::dw#0 ]
|
||||
Uplift Scope [print_sint] 454.5: zp[2]:14 [ print_sint::w#7 print_sint::w#0 print_sint::w#10 ]
|
||||
Uplift Scope [print_slong] 454.5: zp[4]:20 [ print_slong::dw#5 print_slong::dw#0 print_slong::dw#3 ]
|
||||
Uplift Scope [RADIX]
|
||||
Uplift Scope [print_ln]
|
||||
Uplift Scope [print_schar]
|
||||
Uplift Scope [print_cls]
|
||||
Uplift Scope [RADIX]
|
||||
Uplift Scope [main]
|
||||
Uplift Scope [testChar]
|
||||
Uplift Scope [testShort]
|
||||
@ -2176,10 +2176,10 @@ Uplifting [print_str] best 2394 combination zp[2]:4 [ print_str::str#5 print_str
|
||||
Uplifting [print_ulong] best 2394 combination zp[4]:16 [ print_ulong::dw#2 print_ulong::dw#0 ]
|
||||
Uplifting [print_sint] best 2394 combination zp[2]:14 [ print_sint::w#7 print_sint::w#0 print_sint::w#10 ]
|
||||
Uplifting [print_slong] best 2394 combination zp[4]:20 [ print_slong::dw#5 print_slong::dw#0 print_slong::dw#3 ]
|
||||
Uplifting [RADIX] best 2394 combination
|
||||
Uplifting [print_ln] best 2394 combination
|
||||
Uplifting [print_schar] best 2394 combination
|
||||
Uplifting [print_cls] best 2394 combination
|
||||
Uplifting [RADIX] best 2394 combination
|
||||
Uplifting [main] best 2394 combination
|
||||
Uplifting [testChar] best 2394 combination
|
||||
Uplifting [testShort] best 2394 combination
|
||||
|
@ -47,7 +47,7 @@ SYMBOL TABLE SSA
|
||||
constant byte* const BG_COLOR = (byte*)$c01a
|
||||
constant byte* MESSAGE[] = "hello world"
|
||||
constant byte* SCREEN[$32] = { fill( $32, 0) }
|
||||
constant void()* const* VECTORS[] = { &nmiHandler, &entryPoint }
|
||||
constant void()** VECTORS[] = { &nmiHandler, &entryPoint }
|
||||
void __start()
|
||||
void entryPoint()
|
||||
bool~ entryPoint::$0
|
||||
@ -256,7 +256,7 @@ FINAL SYMBOL TABLE
|
||||
constant byte* const BG_COLOR = (byte*) 49178
|
||||
constant byte* MESSAGE[] = "hello world"
|
||||
constant byte* SCREEN[$32] = { fill( $32, 0) }
|
||||
constant void()* const* VECTORS[] = { &nmiHandler, &entryPoint }
|
||||
constant void()** VECTORS[] = { &nmiHandler, &entryPoint }
|
||||
void entryPoint()
|
||||
byte entryPoint::i
|
||||
byte entryPoint::i#1 reg byte x 16.5
|
||||
|
@ -1,7 +1,7 @@
|
||||
constant byte* const BG_COLOR = (byte*) 49178
|
||||
constant byte* MESSAGE[] = "hello world"
|
||||
constant byte* SCREEN[$32] = { fill( $32, 0) }
|
||||
constant void()* const* VECTORS[] = { &nmiHandler, &entryPoint }
|
||||
constant void()** VECTORS[] = { &nmiHandler, &entryPoint }
|
||||
void entryPoint()
|
||||
byte entryPoint::i
|
||||
byte entryPoint::i#1 reg byte x 16.5
|
||||
|
@ -2,50 +2,6 @@ Inlined call call __init
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
|
||||
void* memset(void* memset::str , byte memset::c , word memset::num)
|
||||
memset: scope:[memset] from print_cls
|
||||
memset::c#4 = phi( print_cls/memset::c#0 )
|
||||
memset::str#3 = phi( print_cls/memset::str#0 )
|
||||
memset::num#1 = phi( print_cls/memset::num#0 )
|
||||
memset::$0 = memset::num#1 > 0
|
||||
memset::$1 = ! memset::$0
|
||||
if(memset::$1) goto memset::@1
|
||||
to:memset::@2
|
||||
memset::@1: scope:[memset] from memset memset::@3
|
||||
memset::str#1 = phi( memset/memset::str#3, memset::@3/memset::str#4 )
|
||||
memset::return#0 = memset::str#1
|
||||
to:memset::@return
|
||||
memset::@2: scope:[memset] from memset
|
||||
memset::c#3 = phi( memset/memset::c#4 )
|
||||
memset::num#2 = phi( memset/memset::num#1 )
|
||||
memset::str#2 = phi( memset/memset::str#3 )
|
||||
memset::$4 = (byte*)memset::str#2
|
||||
memset::$2 = memset::$4 + memset::num#2
|
||||
memset::end#0 = memset::$2
|
||||
memset::dst#0 = ((byte*)) memset::str#2
|
||||
to:memset::@3
|
||||
memset::@3: scope:[memset] from memset::@2 memset::@4
|
||||
memset::c#2 = phi( memset::@2/memset::c#3, memset::@4/memset::c#1 )
|
||||
memset::str#4 = phi( memset::@2/memset::str#2, memset::@4/memset::str#5 )
|
||||
memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 )
|
||||
memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 )
|
||||
memset::$3 = memset::dst#2 != memset::end#1
|
||||
if(memset::$3) goto memset::@4
|
||||
to:memset::@1
|
||||
memset::@4: scope:[memset] from memset::@3
|
||||
memset::str#5 = phi( memset::@3/memset::str#4 )
|
||||
memset::end#2 = phi( memset::@3/memset::end#1 )
|
||||
memset::dst#3 = phi( memset::@3/memset::dst#2 )
|
||||
memset::c#1 = phi( memset::@3/memset::c#2 )
|
||||
*memset::dst#3 = memset::c#1
|
||||
memset::dst#1 = ++ memset::dst#3
|
||||
to:memset::@3
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
memset::return#3 = phi( memset::@1/memset::return#0 )
|
||||
memset::return#1 = memset::return#3
|
||||
return
|
||||
to:@return
|
||||
|
||||
void print_str(byte* print_str::str)
|
||||
print_str: scope:[print_str] from assert_byte assert_byte::@1 assert_byte::@3 assert_byte::@4 assert_sbyte assert_sbyte::@1 assert_sbyte::@3 assert_sbyte::@4
|
||||
print_char_cursor#87 = phi( assert_byte/print_char_cursor#77, assert_byte::@1/print_char_cursor#78, assert_byte::@3/print_char_cursor#79, assert_byte::@4/print_char_cursor#16, assert_sbyte/print_char_cursor#82, assert_sbyte::@1/print_char_cursor#83, assert_sbyte::@3/print_char_cursor#84, assert_sbyte::@4/print_char_cursor#28 )
|
||||
@ -120,7 +76,7 @@ print_cls: scope:[print_cls] from main
|
||||
memset::c#0 = ' '
|
||||
memset::num#0 = $3e8
|
||||
call memset
|
||||
memset::return#2 = memset::return#1
|
||||
memset::return#0 = memset::return#2
|
||||
to:print_cls::@1
|
||||
print_cls::@1: scope:[print_cls] from print_cls
|
||||
print_screen#3 = phi( print_cls/print_screen#2 )
|
||||
@ -135,6 +91,50 @@ print_cls::@return: scope:[print_cls] from print_cls::@1
|
||||
return
|
||||
to:@return
|
||||
|
||||
void* memset(void* memset::str , byte memset::c , word memset::num)
|
||||
memset: scope:[memset] from print_cls
|
||||
memset::c#4 = phi( print_cls/memset::c#0 )
|
||||
memset::str#3 = phi( print_cls/memset::str#0 )
|
||||
memset::num#1 = phi( print_cls/memset::num#0 )
|
||||
memset::$0 = memset::num#1 > 0
|
||||
memset::$1 = ! memset::$0
|
||||
if(memset::$1) goto memset::@1
|
||||
to:memset::@2
|
||||
memset::@1: scope:[memset] from memset memset::@3
|
||||
memset::str#1 = phi( memset/memset::str#3, memset::@3/memset::str#4 )
|
||||
memset::return#1 = memset::str#1
|
||||
to:memset::@return
|
||||
memset::@2: scope:[memset] from memset
|
||||
memset::c#3 = phi( memset/memset::c#4 )
|
||||
memset::num#2 = phi( memset/memset::num#1 )
|
||||
memset::str#2 = phi( memset/memset::str#3 )
|
||||
memset::$4 = (byte*)memset::str#2
|
||||
memset::$2 = memset::$4 + memset::num#2
|
||||
memset::end#0 = memset::$2
|
||||
memset::dst#0 = ((byte*)) memset::str#2
|
||||
to:memset::@3
|
||||
memset::@3: scope:[memset] from memset::@2 memset::@4
|
||||
memset::c#2 = phi( memset::@2/memset::c#3, memset::@4/memset::c#1 )
|
||||
memset::str#4 = phi( memset::@2/memset::str#2, memset::@4/memset::str#5 )
|
||||
memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 )
|
||||
memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 )
|
||||
memset::$3 = memset::dst#2 != memset::end#1
|
||||
if(memset::$3) goto memset::@4
|
||||
to:memset::@1
|
||||
memset::@4: scope:[memset] from memset::@3
|
||||
memset::str#5 = phi( memset::@3/memset::str#4 )
|
||||
memset::end#2 = phi( memset::@3/memset::end#1 )
|
||||
memset::dst#3 = phi( memset::@3/memset::dst#2 )
|
||||
memset::c#1 = phi( memset::@3/memset::c#2 )
|
||||
*memset::dst#3 = memset::c#1
|
||||
memset::dst#1 = ++ memset::dst#3
|
||||
to:memset::@3
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
memset::return#3 = phi( memset::@1/memset::return#1 )
|
||||
memset::return#2 = memset::return#3
|
||||
return
|
||||
to:@return
|
||||
|
||||
void main()
|
||||
main: scope:[main] from __start::@1
|
||||
print_char_cursor#75 = phi( __start::@1/print_char_cursor#86 )
|
||||
@ -789,10 +789,10 @@ constant byte* test_sbytes::msg2[9] = "0+2-4=-2"
|
||||
constant byte* test_sbytes::msg3[$b] = "-(0+2-4)=2"
|
||||
constant byte* test_sbytes::msg4[$b] = "-127-127=2"
|
||||
|
||||
Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#1 > 0
|
||||
Adding number conversion cast (unumber) 0 in print_str::$1 = 0 != *print_str::str#9
|
||||
Adding number conversion cast (unumber) $28 in print_ln::$0 = print_line_cursor#25 + $28
|
||||
Adding number conversion cast (unumber) $3e8 in memset::num#0 = $3e8
|
||||
Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#1 > 0
|
||||
Adding number conversion cast (unumber) 0 in assert_byte::c#0 = 0
|
||||
Adding number conversion cast (unumber) 2 in test_bytes::$1 = test_bytes::bb + 2
|
||||
Adding number conversion cast (unumber) test_bytes::$1 in test_bytes::$1 = test_bytes::bb + (unumber)2
|
||||
@ -810,8 +810,8 @@ Adding number conversion cast (snumber) -2 in assert_sbyte::c#2 = -2
|
||||
Adding number conversion cast (snumber) 2 in assert_sbyte::c#3 = 2
|
||||
Adding number conversion cast (snumber) 2 in assert_sbyte::c#4 = 2
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Inlining cast memset::dst#0 = (byte*)memset::str#2
|
||||
Inlining cast memset::num#0 = (unumber)$3e8
|
||||
Inlining cast memset::dst#0 = (byte*)memset::str#2
|
||||
Inlining cast assert_byte::c#0 = (unumber)0
|
||||
Inlining cast assert_byte::c#1 = (unumber)2
|
||||
Inlining cast assert_byte::c#2 = (unumber)$fe
|
||||
@ -823,10 +823,10 @@ Inlining cast assert_sbyte::c#4 = (snumber)2
|
||||
Successful SSA optimization Pass2InlineCast
|
||||
Simplifying constant pointer cast (byte*) 53281
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast $28
|
||||
Simplifying constant integer cast $3e8
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 2
|
||||
Simplifying constant integer cast 2
|
||||
Simplifying constant integer cast 4
|
||||
@ -841,10 +841,10 @@ Simplifying constant integer cast 2
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) $28
|
||||
Finalized unsigned number type (word) $3e8
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 2
|
||||
Finalized unsigned number type (byte) 2
|
||||
Finalized signed number type (signed byte) 4
|
||||
@ -861,9 +861,15 @@ Inferred type updated to byte in test_bytes::$1 = test_bytes::bb + 2
|
||||
Inferred type updated to signed byte in test_bytes::$3 = test_bytes::$5 - 4
|
||||
Inferred type updated to signed byte in test_sbytes::$1 = test_sbytes::bb + 2
|
||||
Inferred type updated to signed byte in test_sbytes::$3 = test_sbytes::bc#1 - 4
|
||||
Inversing boolean not [2] memset::$1 = memset::num#1 <= 0 from [1] memset::$0 = memset::num#1 > 0
|
||||
Inversing boolean not [46] memset::$1 = memset::num#1 <= 0 from [45] memset::$0 = memset::num#1 > 0
|
||||
Successful SSA optimization Pass2UnaryNotSimplification
|
||||
Alias memset::return#0 = memset::str#1 memset::return#3 memset::return#1
|
||||
Alias print_str::str#10 = print_str::str#9 print_str::str#11
|
||||
Alias print_char_cursor#1 = print_char_cursor#72 print_char_cursor#73 print_char_cursor#38
|
||||
Alias print_char_cursor#0 = print_char_cursor#37
|
||||
Alias print_line_cursor#0 = print_ln::$0 print_line_cursor#26 print_char_cursor#2 print_line_cursor#27 print_char_cursor#40 print_line_cursor#1 print_char_cursor#3
|
||||
Alias print_char_cursor#4 = print_char_cursor#42 print_char_cursor#5
|
||||
Alias print_line_cursor#2 = print_screen#3 print_screen#2 print_char_cursor#6 print_line_cursor#28 print_char_cursor#43 print_line_cursor#3 print_char_cursor#7
|
||||
Alias memset::return#1 = memset::str#1 memset::return#3 memset::return#2
|
||||
Alias memset::str#2 = memset::str#3
|
||||
Alias memset::num#1 = memset::num#2
|
||||
Alias memset::c#3 = memset::c#4
|
||||
@ -872,12 +878,6 @@ Alias memset::c#1 = memset::c#2
|
||||
Alias memset::dst#2 = memset::dst#3
|
||||
Alias memset::end#1 = memset::end#2
|
||||
Alias memset::str#4 = memset::str#5
|
||||
Alias print_str::str#10 = print_str::str#9 print_str::str#11
|
||||
Alias print_char_cursor#1 = print_char_cursor#72 print_char_cursor#73 print_char_cursor#38
|
||||
Alias print_char_cursor#0 = print_char_cursor#37
|
||||
Alias print_line_cursor#0 = print_ln::$0 print_line_cursor#26 print_char_cursor#2 print_line_cursor#27 print_char_cursor#40 print_line_cursor#1 print_char_cursor#3
|
||||
Alias print_char_cursor#4 = print_char_cursor#42 print_char_cursor#5
|
||||
Alias print_line_cursor#2 = print_screen#3 print_screen#2 print_char_cursor#6 print_line_cursor#28 print_char_cursor#43 print_line_cursor#3 print_char_cursor#7
|
||||
Alias print_line_cursor#29 = print_line_cursor#4
|
||||
Alias print_char_cursor#44 = print_char_cursor#8
|
||||
Alias print_char_cursor#45 = print_char_cursor#9
|
||||
@ -929,17 +929,17 @@ Successful SSA optimization Pass2AliasElimination
|
||||
Alias print_line_cursor#52 = print_line_cursor#56
|
||||
Alias print_line_cursor#54 = print_line_cursor#58
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values print_char_cursor#0 print_char_cursor#4
|
||||
Identical Phi Values print_char_cursor#39 print_char_cursor#74
|
||||
Identical Phi Values print_char::ch#1 print_char::ch#0
|
||||
Identical Phi Values print_char_cursor#41 print_char_cursor#1
|
||||
Identical Phi Values print_line_cursor#2 print_screen#5
|
||||
Identical Phi Values memset::num#1 memset::num#0
|
||||
Identical Phi Values memset::str#2 memset::str#0
|
||||
Identical Phi Values memset::c#3 memset::c#0
|
||||
Identical Phi Values memset::end#1 memset::end#0
|
||||
Identical Phi Values memset::str#4 memset::str#2
|
||||
Identical Phi Values memset::c#1 memset::c#3
|
||||
Identical Phi Values print_char_cursor#0 print_char_cursor#4
|
||||
Identical Phi Values print_char_cursor#39 print_char_cursor#74
|
||||
Identical Phi Values print_char::ch#1 print_char::ch#0
|
||||
Identical Phi Values print_char_cursor#41 print_char_cursor#1
|
||||
Identical Phi Values print_line_cursor#2 print_screen#5
|
||||
Identical Phi Values print_screen#5 print_screen#0
|
||||
Identical Phi Values print_line_cursor#50 print_screen#0
|
||||
Identical Phi Values print_char_cursor#75 print_screen#0
|
||||
@ -984,7 +984,7 @@ Identical Phi Values print_char_cursor#32 print_line_cursor#0
|
||||
Identical Phi Values print_line_cursor#23 print_line_cursor#31
|
||||
Identical Phi Values print_char_cursor#35 print_char_cursor#10
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Identical Phi Values memset::return#0 memset::str#0
|
||||
Identical Phi Values memset::return#1 memset::str#0
|
||||
Identical Phi Values print_char_cursor#80 print_char_cursor#1
|
||||
Identical Phi Values print_char_cursor#82 print_line_cursor#0
|
||||
Identical Phi Values print_line_cursor#54 print_line_cursor#0
|
||||
@ -992,10 +992,10 @@ Identical Phi Values print_char_cursor#85 print_char_cursor#1
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Identical Phi Values print_char_cursor#74 print_char_cursor#1
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Simple Condition memset::$1 [2] if(memset::num#0<=0) goto memset::@1
|
||||
Simple Condition memset::$3 [9] if(memset::dst#2!=memset::end#0) goto memset::@4
|
||||
Simple Condition print_str::$1 [16] if(0!=*print_str::str#10) goto print_str::@2
|
||||
Simple Condition print_ln::$1 [26] if(print_line_cursor#0<print_char_cursor#1) goto print_ln::@1
|
||||
Simple Condition print_str::$1 [3] if(0!=*print_str::str#10) goto print_str::@2
|
||||
Simple Condition print_ln::$1 [13] if(print_line_cursor#0<print_char_cursor#1) goto print_ln::@1
|
||||
Simple Condition memset::$1 [28] if(memset::num#0<=0) goto memset::@1
|
||||
Simple Condition memset::$3 [35] if(memset::dst#2!=memset::end#0) goto memset::@4
|
||||
Simple Condition assert_byte::$2 [77] if(assert_byte::b#3!=assert_byte::c#3) goto assert_byte::@1
|
||||
Simple Condition assert_sbyte::$2 [127] if(assert_sbyte::b#5!=assert_sbyte::c#5) goto assert_sbyte::@1
|
||||
Successful SSA optimization Pass2ConditionalJumpSimplification
|
||||
@ -1038,11 +1038,11 @@ Constant assert_byte::b#1 = test_bytes::bc#0
|
||||
Constant test_bytes::$5 = (signed byte)test_bytes::bc#0
|
||||
Constant assert_sbyte::b#1 = test_sbytes::bc#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant memset::return#0 = memset::str#0
|
||||
Constant memset::$4 = (byte*)memset::str#0
|
||||
Constant memset::dst#0 = (byte*)memset::str#0
|
||||
Constant memset::return#2 = memset::str#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
if() condition always false - eliminating [2] if(memset::num#0<=0) goto memset::@1
|
||||
if() condition always false - eliminating [28] if(memset::num#0<=0) goto memset::@1
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Consolidated constant strings into msg
|
||||
Consolidated constant strings into msg1
|
||||
@ -1053,7 +1053,7 @@ Successful SSA optimization Pass2ConstantStringConsolidation
|
||||
Simplifying expression containing zero 2 in
|
||||
Simplifying expression containing zero 2 in
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused constant memset::return#2
|
||||
Eliminating unused constant memset::return#0
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Removing unused procedure __start
|
||||
Removing unused procedure block __start
|
||||
@ -1062,7 +1062,7 @@ Removing unused procedure block __start::@1
|
||||
Removing unused procedure block __start::@2
|
||||
Removing unused procedure block __start::@return
|
||||
Successful SSA optimization PassNEliminateEmptyStart
|
||||
Constant right-side identified [0] memset::end#0 = memset::$4 + memset::num#0
|
||||
Constant right-side identified [17] memset::end#0 = memset::$4 + memset::num#0
|
||||
Constant right-side identified [30] test_bytes::$3 = test_bytes::$5 - 4
|
||||
Constant right-side identified [47] test_sbytes::bd#0 = test_sbytes::bc#0 - 4
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
@ -1081,13 +1081,13 @@ Constant test_sbytes::be#0 = -test_sbytes::bd#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant assert_sbyte::b#3 = test_sbytes::be#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Inlining constant with var siblings memset::dst#0
|
||||
Inlining constant with var siblings print_str::str#2
|
||||
Inlining constant with var siblings print_str::str#3
|
||||
Inlining constant with var siblings print_str::str#4
|
||||
Inlining constant with var siblings print_str::str#6
|
||||
Inlining constant with var siblings print_str::str#7
|
||||
Inlining constant with var siblings print_str::str#8
|
||||
Inlining constant with var siblings memset::dst#0
|
||||
Inlining constant with var siblings assert_byte::msg#0
|
||||
Inlining constant with var siblings assert_byte::b#0
|
||||
Inlining constant with var siblings assert_byte::c#0
|
||||
@ -1602,9 +1602,9 @@ Uplift Scope [print_str] 31,759.25: zp[2]:14 [ print_str::str#10 print_str::str#
|
||||
Uplift Scope [memset] 3,336.67: zp[2]:2 [ memset::dst#2 memset::dst#1 ]
|
||||
Uplift Scope [assert_byte] 101: zp[2]:4 [ assert_byte::msg#3 ] 20.2: zp[1]:6 [ assert_byte::b#3 ] 20.2: zp[1]:7 [ assert_byte::c#3 ]
|
||||
Uplift Scope [assert_sbyte] 101: zp[2]:8 [ assert_sbyte::msg#5 ] 16.83: zp[1]:10 [ assert_sbyte::b#5 ] 16.83: zp[1]:11 [ assert_sbyte::c#5 ]
|
||||
Uplift Scope [RADIX]
|
||||
Uplift Scope [print_ln]
|
||||
Uplift Scope [print_cls]
|
||||
Uplift Scope [RADIX]
|
||||
Uplift Scope [main]
|
||||
Uplift Scope [test_bytes]
|
||||
Uplift Scope [test_sbytes]
|
||||
@ -1615,9 +1615,9 @@ Uplifting [print_str] best 2116 combination zp[2]:14 [ print_str::str#10 print_s
|
||||
Uplifting [memset] best 2116 combination zp[2]:2 [ memset::dst#2 memset::dst#1 ]
|
||||
Uplifting [assert_byte] best 2104 combination zp[2]:4 [ assert_byte::msg#3 ] reg byte x [ assert_byte::b#3 ] zp[1]:7 [ assert_byte::c#3 ]
|
||||
Uplifting [assert_sbyte] best 2086 combination zp[2]:8 [ assert_sbyte::msg#5 ] reg byte x [ assert_sbyte::b#5 ] zp[1]:11 [ assert_sbyte::c#5 ]
|
||||
Uplifting [RADIX] best 2086 combination
|
||||
Uplifting [print_ln] best 2086 combination
|
||||
Uplifting [print_cls] best 2086 combination
|
||||
Uplifting [RADIX] best 2086 combination
|
||||
Uplifting [main] best 2086 combination
|
||||
Uplifting [test_bytes] best 2086 combination
|
||||
Uplifting [test_sbytes] best 2086 combination
|
||||
|
@ -2,50 +2,6 @@ Inlined call call __init
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
|
||||
void* memset(void* memset::str , byte memset::c , word memset::num)
|
||||
memset: scope:[memset] from print_cls
|
||||
memset::c#4 = phi( print_cls/memset::c#0 )
|
||||
memset::str#3 = phi( print_cls/memset::str#0 )
|
||||
memset::num#1 = phi( print_cls/memset::num#0 )
|
||||
memset::$0 = memset::num#1 > 0
|
||||
memset::$1 = ! memset::$0
|
||||
if(memset::$1) goto memset::@1
|
||||
to:memset::@2
|
||||
memset::@1: scope:[memset] from memset memset::@3
|
||||
memset::str#1 = phi( memset/memset::str#3, memset::@3/memset::str#4 )
|
||||
memset::return#0 = memset::str#1
|
||||
to:memset::@return
|
||||
memset::@2: scope:[memset] from memset
|
||||
memset::c#3 = phi( memset/memset::c#4 )
|
||||
memset::num#2 = phi( memset/memset::num#1 )
|
||||
memset::str#2 = phi( memset/memset::str#3 )
|
||||
memset::$4 = (byte*)memset::str#2
|
||||
memset::$2 = memset::$4 + memset::num#2
|
||||
memset::end#0 = memset::$2
|
||||
memset::dst#0 = ((byte*)) memset::str#2
|
||||
to:memset::@3
|
||||
memset::@3: scope:[memset] from memset::@2 memset::@4
|
||||
memset::c#2 = phi( memset::@2/memset::c#3, memset::@4/memset::c#1 )
|
||||
memset::str#4 = phi( memset::@2/memset::str#2, memset::@4/memset::str#5 )
|
||||
memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 )
|
||||
memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 )
|
||||
memset::$3 = memset::dst#2 != memset::end#1
|
||||
if(memset::$3) goto memset::@4
|
||||
to:memset::@1
|
||||
memset::@4: scope:[memset] from memset::@3
|
||||
memset::str#5 = phi( memset::@3/memset::str#4 )
|
||||
memset::end#2 = phi( memset::@3/memset::end#1 )
|
||||
memset::dst#3 = phi( memset::@3/memset::dst#2 )
|
||||
memset::c#1 = phi( memset::@3/memset::c#2 )
|
||||
*memset::dst#3 = memset::c#1
|
||||
memset::dst#1 = ++ memset::dst#3
|
||||
to:memset::@3
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
memset::return#3 = phi( memset::@1/memset::return#0 )
|
||||
memset::return#1 = memset::return#3
|
||||
return
|
||||
to:@return
|
||||
|
||||
void print_ln()
|
||||
print_ln: scope:[print_ln] from print_euclid::@6
|
||||
print_char_cursor#52 = phi( print_euclid::@6/print_char_cursor#21 )
|
||||
@ -117,7 +73,7 @@ print_cls: scope:[print_cls] from main
|
||||
memset::c#0 = ' '
|
||||
memset::num#0 = $3e8
|
||||
call memset
|
||||
memset::return#2 = memset::return#1
|
||||
memset::return#0 = memset::return#2
|
||||
to:print_cls::@1
|
||||
print_cls::@1: scope:[print_cls] from print_cls
|
||||
print_screen#3 = phi( print_cls/print_screen#2 )
|
||||
@ -132,6 +88,50 @@ print_cls::@return: scope:[print_cls] from print_cls::@1
|
||||
return
|
||||
to:@return
|
||||
|
||||
void* memset(void* memset::str , byte memset::c , word memset::num)
|
||||
memset: scope:[memset] from print_cls
|
||||
memset::c#4 = phi( print_cls/memset::c#0 )
|
||||
memset::str#3 = phi( print_cls/memset::str#0 )
|
||||
memset::num#1 = phi( print_cls/memset::num#0 )
|
||||
memset::$0 = memset::num#1 > 0
|
||||
memset::$1 = ! memset::$0
|
||||
if(memset::$1) goto memset::@1
|
||||
to:memset::@2
|
||||
memset::@1: scope:[memset] from memset memset::@3
|
||||
memset::str#1 = phi( memset/memset::str#3, memset::@3/memset::str#4 )
|
||||
memset::return#1 = memset::str#1
|
||||
to:memset::@return
|
||||
memset::@2: scope:[memset] from memset
|
||||
memset::c#3 = phi( memset/memset::c#4 )
|
||||
memset::num#2 = phi( memset/memset::num#1 )
|
||||
memset::str#2 = phi( memset/memset::str#3 )
|
||||
memset::$4 = (byte*)memset::str#2
|
||||
memset::$2 = memset::$4 + memset::num#2
|
||||
memset::end#0 = memset::$2
|
||||
memset::dst#0 = ((byte*)) memset::str#2
|
||||
to:memset::@3
|
||||
memset::@3: scope:[memset] from memset::@2 memset::@4
|
||||
memset::c#2 = phi( memset::@2/memset::c#3, memset::@4/memset::c#1 )
|
||||
memset::str#4 = phi( memset::@2/memset::str#2, memset::@4/memset::str#5 )
|
||||
memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 )
|
||||
memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 )
|
||||
memset::$3 = memset::dst#2 != memset::end#1
|
||||
if(memset::$3) goto memset::@4
|
||||
to:memset::@1
|
||||
memset::@4: scope:[memset] from memset::@3
|
||||
memset::str#5 = phi( memset::@3/memset::str#4 )
|
||||
memset::end#2 = phi( memset::@3/memset::end#1 )
|
||||
memset::dst#3 = phi( memset::@3/memset::dst#2 )
|
||||
memset::c#1 = phi( memset::@3/memset::c#2 )
|
||||
*memset::dst#3 = memset::c#1
|
||||
memset::dst#1 = ++ memset::dst#3
|
||||
to:memset::@3
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
memset::return#3 = phi( memset::@1/memset::return#1 )
|
||||
memset::return#2 = memset::return#3
|
||||
return
|
||||
to:@return
|
||||
|
||||
void main()
|
||||
main: scope:[main] from __start::@1
|
||||
print_char_cursor#54 = phi( __start::@1/print_char_cursor#57 )
|
||||
@ -584,12 +584,12 @@ byte print_uchar::b#2
|
||||
byte print_uchar::b#3
|
||||
byte print_uchar::b#4
|
||||
|
||||
Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#1 > 0
|
||||
Adding number conversion cast (unumber) $28 in print_ln::$0 = print_line_cursor#17 + $28
|
||||
Adding number conversion cast (unumber) 4 in print_uchar::$0 = print_uchar::b#3 >> 4
|
||||
Adding number conversion cast (unumber) $f in print_uchar::$2 = print_uchar::b#4 & $f
|
||||
Adding number conversion cast (unumber) print_uchar::$2 in print_uchar::$2 = print_uchar::b#4 & (unumber)$f
|
||||
Adding number conversion cast (unumber) $3e8 in memset::num#0 = $3e8
|
||||
Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#1 > 0
|
||||
Adding number conversion cast (unumber) $80 in print_euclid::a#0 = $80
|
||||
Adding number conversion cast (unumber) 2 in print_euclid::b#0 = 2
|
||||
Adding number conversion cast (unumber) $a9 in print_euclid::a#1 = $a9
|
||||
@ -603,8 +603,8 @@ Adding number conversion cast (unumber) $1a in print_euclid::b#4 = $1a
|
||||
Adding number conversion cast (unumber) $77 in print_euclid::a#5 = $77
|
||||
Adding number conversion cast (unumber) $bb in print_euclid::b#5 = $bb
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Inlining cast memset::dst#0 = (byte*)memset::str#2
|
||||
Inlining cast memset::num#0 = (unumber)$3e8
|
||||
Inlining cast memset::dst#0 = (byte*)memset::str#2
|
||||
Inlining cast print_euclid::a#0 = (unumber)$80
|
||||
Inlining cast print_euclid::b#0 = (unumber)2
|
||||
Inlining cast print_euclid::a#1 = (unumber)$a9
|
||||
@ -618,11 +618,11 @@ Inlining cast print_euclid::b#4 = (unumber)$1a
|
||||
Inlining cast print_euclid::a#5 = (unumber)$77
|
||||
Inlining cast print_euclid::b#5 = (unumber)$bb
|
||||
Successful SSA optimization Pass2InlineCast
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast $28
|
||||
Simplifying constant integer cast 4
|
||||
Simplifying constant integer cast $f
|
||||
Simplifying constant integer cast $3e8
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast $80
|
||||
Simplifying constant integer cast 2
|
||||
Simplifying constant integer cast $a9
|
||||
@ -637,11 +637,11 @@ Simplifying constant integer cast $77
|
||||
Simplifying constant integer cast $bb
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) $28
|
||||
Finalized unsigned number type (byte) 4
|
||||
Finalized unsigned number type (byte) $f
|
||||
Finalized unsigned number type (word) $3e8
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) $80
|
||||
Finalized unsigned number type (byte) 2
|
||||
Finalized unsigned number type (byte) $a9
|
||||
@ -656,9 +656,15 @@ Finalized unsigned number type (byte) $77
|
||||
Finalized unsigned number type (byte) $bb
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Inferred type updated to byte in print_uchar::$2 = print_uchar::b#4 & $f
|
||||
Inversing boolean not [2] memset::$1 = memset::num#1 <= 0 from [1] memset::$0 = memset::num#1 > 0
|
||||
Inversing boolean not [47] memset::$1 = memset::num#1 <= 0 from [46] memset::$0 = memset::num#1 > 0
|
||||
Successful SSA optimization Pass2UnaryNotSimplification
|
||||
Alias memset::return#0 = memset::str#1 memset::return#3 memset::return#1
|
||||
Alias print_line_cursor#0 = print_ln::$0 print_line_cursor#18 print_char_cursor#0 print_line_cursor#19 print_char_cursor#28 print_line_cursor#1 print_char_cursor#1
|
||||
Alias print_uchar::b#3 = print_uchar::b#4
|
||||
Alias print_char_cursor#2 = print_char_cursor#29
|
||||
Alias print_char_cursor#3 = print_char_cursor#30 print_char_cursor#31 print_char_cursor#4
|
||||
Alias print_char_cursor#33 = print_char_cursor#5 print_char_cursor#6
|
||||
Alias print_line_cursor#2 = print_screen#3 print_screen#2 print_char_cursor#7 print_line_cursor#20 print_char_cursor#34 print_line_cursor#3 print_char_cursor#8
|
||||
Alias memset::return#1 = memset::str#1 memset::return#3 memset::return#2
|
||||
Alias memset::str#2 = memset::str#3
|
||||
Alias memset::num#1 = memset::num#2
|
||||
Alias memset::c#3 = memset::c#4
|
||||
@ -667,12 +673,6 @@ Alias memset::c#1 = memset::c#2
|
||||
Alias memset::dst#2 = memset::dst#3
|
||||
Alias memset::end#1 = memset::end#2
|
||||
Alias memset::str#4 = memset::str#5
|
||||
Alias print_line_cursor#0 = print_ln::$0 print_line_cursor#18 print_char_cursor#0 print_line_cursor#19 print_char_cursor#28 print_line_cursor#1 print_char_cursor#1
|
||||
Alias print_uchar::b#3 = print_uchar::b#4
|
||||
Alias print_char_cursor#2 = print_char_cursor#29
|
||||
Alias print_char_cursor#3 = print_char_cursor#30 print_char_cursor#31 print_char_cursor#4
|
||||
Alias print_char_cursor#33 = print_char_cursor#5 print_char_cursor#6
|
||||
Alias print_line_cursor#2 = print_screen#3 print_screen#2 print_char_cursor#7 print_line_cursor#20 print_char_cursor#34 print_line_cursor#3 print_char_cursor#8
|
||||
Alias print_line_cursor#21 = print_line_cursor#4
|
||||
Alias print_char_cursor#35 = print_char_cursor#9
|
||||
Alias print_char_cursor#10 = print_char_cursor#36
|
||||
@ -707,18 +707,18 @@ Alias print_screen#0 = print_line_cursor#14 print_char_cursor#24 print_line_curs
|
||||
Alias print_line_cursor#15 = print_line_cursor#31 print_line_cursor#32 print_line_cursor#16
|
||||
Alias print_char_cursor#25 = print_char_cursor#50 print_char_cursor#51 print_char_cursor#26
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values memset::num#1 memset::num#0
|
||||
Identical Phi Values memset::str#2 memset::str#0
|
||||
Identical Phi Values memset::c#3 memset::c#0
|
||||
Identical Phi Values memset::end#1 memset::end#0
|
||||
Identical Phi Values memset::str#4 memset::str#2
|
||||
Identical Phi Values memset::c#1 memset::c#3
|
||||
Identical Phi Values print_line_cursor#33 print_line_cursor#35
|
||||
Identical Phi Values print_char_cursor#52 print_char_cursor#21
|
||||
Identical Phi Values print_char_cursor#27 print_char_cursor#52
|
||||
Identical Phi Values print_char_cursor#2 print_char_cursor#33
|
||||
Identical Phi Values print_char_cursor#3 print_char_cursor#33
|
||||
Identical Phi Values print_line_cursor#2 print_screen#5
|
||||
Identical Phi Values memset::num#1 memset::num#0
|
||||
Identical Phi Values memset::str#2 memset::str#0
|
||||
Identical Phi Values memset::c#3 memset::c#0
|
||||
Identical Phi Values memset::end#1 memset::end#0
|
||||
Identical Phi Values memset::str#4 memset::str#2
|
||||
Identical Phi Values memset::c#1 memset::c#3
|
||||
Identical Phi Values print_screen#5 print_screen#0
|
||||
Identical Phi Values print_line_cursor#34 print_screen#0
|
||||
Identical Phi Values print_char_cursor#54 print_screen#0
|
||||
@ -748,11 +748,11 @@ Identical Phi Values euclid::b#6 euclid::b#0
|
||||
Identical Phi Values print_line_cursor#15 print_line_cursor#10
|
||||
Identical Phi Values print_char_cursor#25 print_char_cursor#15
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Identical Phi Values memset::return#0 memset::str#0
|
||||
Identical Phi Values memset::return#1 memset::str#0
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Simple Condition memset::$1 [2] if(memset::num#0<=0) goto memset::@1
|
||||
Simple Condition memset::$3 [9] if(memset::dst#2!=memset::end#0) goto memset::@4
|
||||
Simple Condition print_ln::$1 [17] if(print_line_cursor#0<print_char_cursor#33) goto print_ln::@1
|
||||
Simple Condition print_ln::$1 [4] if(print_line_cursor#0<print_char_cursor#33) goto print_ln::@1
|
||||
Simple Condition memset::$1 [29] if(memset::num#0<=0) goto memset::@1
|
||||
Simple Condition memset::$3 [36] if(memset::dst#2!=memset::end#0) goto memset::@4
|
||||
Simple Condition euclid::$0 [94] if(euclid::a#2!=euclid::b#2) goto euclid::@2
|
||||
Simple Condition euclid::$1 [96] if(euclid::a#2>euclid::b#2) goto euclid::@4
|
||||
Successful SSA optimization Pass2ConditionalJumpSimplification
|
||||
@ -776,13 +776,13 @@ Constant print_screen#0 = (byte*) 1024
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant memset::str#0 = (void*)print_screen#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant memset::return#0 = memset::str#0
|
||||
Constant memset::$4 = (byte*)memset::str#0
|
||||
Constant memset::dst#0 = (byte*)memset::str#0
|
||||
Constant memset::return#2 = memset::str#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
if() condition always false - eliminating [2] if(memset::num#0<=0) goto memset::@1
|
||||
if() condition always false - eliminating [29] if(memset::num#0<=0) goto memset::@1
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Eliminating unused constant memset::return#2
|
||||
Eliminating unused constant memset::return#0
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Removing unused procedure __start
|
||||
Removing unused procedure block __start
|
||||
@ -791,13 +791,13 @@ Removing unused procedure block __start::@1
|
||||
Removing unused procedure block __start::@2
|
||||
Removing unused procedure block __start::@return
|
||||
Successful SSA optimization PassNEliminateEmptyStart
|
||||
Constant right-side identified [0] memset::end#0 = memset::$4 + memset::num#0
|
||||
Constant right-side identified [18] memset::end#0 = memset::$4 + memset::num#0
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant memset::end#0 = memset::$4+memset::num#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Inlining constant with var siblings memset::dst#0
|
||||
Inlining constant with var siblings print_char::ch#2
|
||||
Inlining constant with var siblings print_char::ch#3
|
||||
Inlining constant with var siblings memset::dst#0
|
||||
Inlining constant with var siblings print_euclid::a#0
|
||||
Inlining constant with var siblings print_euclid::b#0
|
||||
Inlining constant with var siblings print_euclid::a#1
|
||||
@ -1224,9 +1224,9 @@ Uplift Scope [memset] 3,336.67: zp[2]:4 [ memset::dst#2 memset::dst#1 ]
|
||||
Uplift Scope [print_char] 1,607: zp[1]:7 [ print_char::ch#4 print_char::ch#0 print_char::ch#1 ]
|
||||
Uplift Scope [print_uchar] 202: zp[1]:15 [ print_uchar::$0 ] 202: zp[1]:16 [ print_uchar::$2 ] 124.75: zp[1]:6 [ print_uchar::b#3 print_uchar::b#0 print_uchar::b#1 print_uchar::b#2 ]
|
||||
Uplift Scope [print_euclid] 2.44: zp[1]:2 [ print_euclid::a#10 ] 2.2: zp[1]:3 [ print_euclid::b#10 ]
|
||||
Uplift Scope [RADIX]
|
||||
Uplift Scope [print_ln]
|
||||
Uplift Scope [print_cls]
|
||||
Uplift Scope [RADIX]
|
||||
Uplift Scope [main]
|
||||
|
||||
Uplifting [euclid] best 1911 combination reg byte x [ euclid::b#2 euclid::b#0 euclid::b#1 ] zp[1]:10 [ euclid::a#2 euclid::a#0 euclid::a#1 ] reg byte a [ euclid::return#0 ]
|
||||
@ -1235,9 +1235,9 @@ Uplifting [memset] best 1911 combination zp[2]:4 [ memset::dst#2 memset::dst#1 ]
|
||||
Uplifting [print_char] best 1896 combination reg byte a [ print_char::ch#4 print_char::ch#0 print_char::ch#1 ]
|
||||
Uplifting [print_uchar] best 1877 combination reg byte a [ print_uchar::$0 ] reg byte x [ print_uchar::$2 ] reg byte x [ print_uchar::b#3 print_uchar::b#0 print_uchar::b#1 print_uchar::b#2 ]
|
||||
Uplifting [print_euclid] best 1877 combination zp[1]:2 [ print_euclid::a#10 ] zp[1]:3 [ print_euclid::b#10 ]
|
||||
Uplifting [RADIX] best 1877 combination
|
||||
Uplifting [print_ln] best 1877 combination
|
||||
Uplifting [print_cls] best 1877 combination
|
||||
Uplifting [RADIX] best 1877 combination
|
||||
Uplifting [main] best 1877 combination
|
||||
Attempting to uplift remaining variables inzp[1]:10 [ euclid::a#2 euclid::a#0 euclid::a#1 ]
|
||||
Uplifting [euclid] best 1877 combination zp[1]:10 [ euclid::a#2 euclid::a#0 euclid::a#1 ]
|
||||
|
@ -11,50 +11,6 @@ Inlined call call __init
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
|
||||
void* memset(void* memset::str , byte memset::c , word memset::num)
|
||||
memset: scope:[memset] from print_cls
|
||||
memset::c#4 = phi( print_cls/memset::c#0 )
|
||||
memset::str#3 = phi( print_cls/memset::str#0 )
|
||||
memset::num#1 = phi( print_cls/memset::num#0 )
|
||||
memset::$0 = memset::num#1 > 0
|
||||
memset::$1 = ! memset::$0
|
||||
if(memset::$1) goto memset::@1
|
||||
to:memset::@2
|
||||
memset::@1: scope:[memset] from memset memset::@3
|
||||
memset::str#1 = phi( memset/memset::str#3, memset::@3/memset::str#4 )
|
||||
memset::return#0 = memset::str#1
|
||||
to:memset::@return
|
||||
memset::@2: scope:[memset] from memset
|
||||
memset::c#3 = phi( memset/memset::c#4 )
|
||||
memset::num#2 = phi( memset/memset::num#1 )
|
||||
memset::str#2 = phi( memset/memset::str#3 )
|
||||
memset::$4 = (byte*)memset::str#2
|
||||
memset::$2 = memset::$4 + memset::num#2
|
||||
memset::end#0 = memset::$2
|
||||
memset::dst#0 = ((byte*)) memset::str#2
|
||||
to:memset::@3
|
||||
memset::@3: scope:[memset] from memset::@2 memset::@4
|
||||
memset::c#2 = phi( memset::@2/memset::c#3, memset::@4/memset::c#1 )
|
||||
memset::str#4 = phi( memset::@2/memset::str#2, memset::@4/memset::str#5 )
|
||||
memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 )
|
||||
memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 )
|
||||
memset::$3 = memset::dst#2 != memset::end#1
|
||||
if(memset::$3) goto memset::@4
|
||||
to:memset::@1
|
||||
memset::@4: scope:[memset] from memset::@3
|
||||
memset::str#5 = phi( memset::@3/memset::str#4 )
|
||||
memset::end#2 = phi( memset::@3/memset::end#1 )
|
||||
memset::dst#3 = phi( memset::@3/memset::dst#2 )
|
||||
memset::c#1 = phi( memset::@3/memset::c#2 )
|
||||
*memset::dst#3 = memset::c#1
|
||||
memset::dst#1 = ++ memset::dst#3
|
||||
to:memset::@3
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
memset::return#3 = phi( memset::@1/memset::return#0 )
|
||||
memset::return#1 = memset::return#3
|
||||
return
|
||||
to:@return
|
||||
|
||||
void print_str(byte* print_str::str)
|
||||
print_str: scope:[print_str] from do_perspective do_perspective::@11 do_perspective::@2 do_perspective::@4 do_perspective::@6 do_perspective::@9
|
||||
print_char_cursor#77 = phi( do_perspective/print_char_cursor#74, do_perspective::@11/print_char_cursor#27, do_perspective::@2/print_char_cursor#19, do_perspective::@4/print_char_cursor#21, do_perspective::@6/print_char_cursor#23, do_perspective::@9/print_char_cursor#25 )
|
||||
@ -202,7 +158,7 @@ print_cls: scope:[print_cls] from main::@1
|
||||
memset::c#0 = ' '
|
||||
memset::num#0 = $3e8
|
||||
call memset
|
||||
memset::return#2 = memset::return#1
|
||||
memset::return#0 = memset::return#2
|
||||
to:print_cls::@1
|
||||
print_cls::@1: scope:[print_cls] from print_cls
|
||||
print_screen#3 = phi( print_cls/print_screen#2 )
|
||||
@ -217,6 +173,50 @@ print_cls::@return: scope:[print_cls] from print_cls::@1
|
||||
return
|
||||
to:@return
|
||||
|
||||
void* memset(void* memset::str , byte memset::c , word memset::num)
|
||||
memset: scope:[memset] from print_cls
|
||||
memset::c#4 = phi( print_cls/memset::c#0 )
|
||||
memset::str#3 = phi( print_cls/memset::str#0 )
|
||||
memset::num#1 = phi( print_cls/memset::num#0 )
|
||||
memset::$0 = memset::num#1 > 0
|
||||
memset::$1 = ! memset::$0
|
||||
if(memset::$1) goto memset::@1
|
||||
to:memset::@2
|
||||
memset::@1: scope:[memset] from memset memset::@3
|
||||
memset::str#1 = phi( memset/memset::str#3, memset::@3/memset::str#4 )
|
||||
memset::return#1 = memset::str#1
|
||||
to:memset::@return
|
||||
memset::@2: scope:[memset] from memset
|
||||
memset::c#3 = phi( memset/memset::c#4 )
|
||||
memset::num#2 = phi( memset/memset::num#1 )
|
||||
memset::str#2 = phi( memset/memset::str#3 )
|
||||
memset::$4 = (byte*)memset::str#2
|
||||
memset::$2 = memset::$4 + memset::num#2
|
||||
memset::end#0 = memset::$2
|
||||
memset::dst#0 = ((byte*)) memset::str#2
|
||||
to:memset::@3
|
||||
memset::@3: scope:[memset] from memset::@2 memset::@4
|
||||
memset::c#2 = phi( memset::@2/memset::c#3, memset::@4/memset::c#1 )
|
||||
memset::str#4 = phi( memset::@2/memset::str#2, memset::@4/memset::str#5 )
|
||||
memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 )
|
||||
memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 )
|
||||
memset::$3 = memset::dst#2 != memset::end#1
|
||||
if(memset::$3) goto memset::@4
|
||||
to:memset::@1
|
||||
memset::@4: scope:[memset] from memset::@3
|
||||
memset::str#5 = phi( memset::@3/memset::str#4 )
|
||||
memset::end#2 = phi( memset::@3/memset::end#1 )
|
||||
memset::dst#3 = phi( memset::@3/memset::dst#2 )
|
||||
memset::c#1 = phi( memset::@3/memset::c#2 )
|
||||
*memset::dst#3 = memset::c#1
|
||||
memset::dst#1 = ++ memset::dst#3
|
||||
to:memset::@3
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
memset::return#3 = phi( memset::@1/memset::return#1 )
|
||||
memset::return#2 = memset::return#3
|
||||
return
|
||||
to:@return
|
||||
|
||||
void main()
|
||||
main: scope:[main] from __start::@1
|
||||
print_char_cursor#79 = phi( __start::@1/print_char_cursor#76 )
|
||||
@ -788,7 +788,6 @@ volatile signed byte xr loadstore
|
||||
volatile signed byte yr loadstore
|
||||
volatile signed byte zr loadstore
|
||||
|
||||
Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#1 > 0
|
||||
Adding number conversion cast (unumber) 0 in print_str::$1 = 0 != *print_str::str#7
|
||||
Adding number conversion cast (unumber) $28 in print_ln::$0 = print_line_cursor#12 + $28
|
||||
Adding number conversion cast (snumber) 0 in print_schar::$0 = print_schar::b#4 < 0
|
||||
@ -796,6 +795,7 @@ Adding number conversion cast (unumber) 4 in print_uchar::$0 = print_uchar::b#3
|
||||
Adding number conversion cast (unumber) $f in print_uchar::$2 = print_uchar::b#4 & $f
|
||||
Adding number conversion cast (unumber) print_uchar::$2 in print_uchar::$2 = print_uchar::b#4 & (unumber)$f
|
||||
Adding number conversion cast (unumber) $3e8 in memset::num#0 = $3e8
|
||||
Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#1 > 0
|
||||
Adding number conversion cast (snumber) $39 in do_perspective::x#0 = $39
|
||||
Adding number conversion cast (snumber) -$47 in do_perspective::y#0 = -$47
|
||||
Adding number conversion cast (snumber) $36 in do_perspective::z#0 = $36
|
||||
@ -813,19 +813,19 @@ Adding number conversion cast (unumber) mulf_init::$6 in mulf_init::$6 = (unumbe
|
||||
Adding number conversion cast (unumber) $100 in (mulf_sqr2+$100)[mulf_init::$6] = mulf_init::val#0
|
||||
Adding number conversion cast (snumber) 2 in mulf_init::add#1 = mulf_init::add#2 + 2
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Inlining cast memset::dst#0 = (byte*)memset::str#2
|
||||
Inlining cast memset::num#0 = (unumber)$3e8
|
||||
Inlining cast memset::dst#0 = (byte*)memset::str#2
|
||||
Inlining cast do_perspective::x#0 = (snumber)$39
|
||||
Inlining cast do_perspective::y#0 = (snumber)-$47
|
||||
Inlining cast do_perspective::z#0 = (snumber)$36
|
||||
Successful SSA optimization Pass2InlineCast
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast $28
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 4
|
||||
Simplifying constant integer cast $f
|
||||
Simplifying constant integer cast $3e8
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast $39
|
||||
Simplifying constant integer cast -$47
|
||||
Simplifying constant integer cast $36
|
||||
@ -841,12 +841,12 @@ Simplifying constant integer cast 2
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) $28
|
||||
Finalized signed number type (signed byte) 0
|
||||
Finalized unsigned number type (byte) 4
|
||||
Finalized unsigned number type (byte) $f
|
||||
Finalized unsigned number type (word) $3e8
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized signed number type (signed byte) $39
|
||||
Finalized signed number type (signed byte) -$47
|
||||
Finalized signed number type (signed byte) $36
|
||||
@ -865,17 +865,8 @@ Inferred type updated to byte in mulf_init::$3 = mulf_init::i#2 + 1
|
||||
Inferred type updated to byte in mulf_init::$4 = mulf_init::i#2 + 1
|
||||
Inferred type updated to byte in mulf_init::$5 = 1 - mulf_init::i#2
|
||||
Inferred type updated to byte in mulf_init::$6 = 1 - mulf_init::i#2
|
||||
Inversing boolean not [2] memset::$1 = memset::num#1 <= 0 from [1] memset::$0 = memset::num#1 > 0
|
||||
Inversing boolean not [83] memset::$1 = memset::num#1 <= 0 from [82] memset::$0 = memset::num#1 > 0
|
||||
Successful SSA optimization Pass2UnaryNotSimplification
|
||||
Alias memset::return#0 = memset::str#1 memset::return#3 memset::return#1
|
||||
Alias memset::str#2 = memset::str#3
|
||||
Alias memset::num#1 = memset::num#2
|
||||
Alias memset::c#3 = memset::c#4
|
||||
Alias memset::end#0 = memset::$2
|
||||
Alias memset::c#1 = memset::c#2
|
||||
Alias memset::dst#2 = memset::dst#3
|
||||
Alias memset::end#1 = memset::end#2
|
||||
Alias memset::str#4 = memset::str#5
|
||||
Alias print_str::str#7 = print_str::str#8 print_str::str#9
|
||||
Alias print_char_cursor#1 = print_char_cursor#66 print_char_cursor#67 print_char_cursor#35
|
||||
Alias print_char_cursor#0 = print_char_cursor#34
|
||||
@ -891,6 +882,15 @@ Alias print_char_cursor#42 = print_char_cursor#8
|
||||
Alias print_char_cursor#10 = print_char_cursor#9 print_char_cursor#43 print_char_cursor#44
|
||||
Alias print_char_cursor#11 = print_char_cursor#46 print_char_cursor#12
|
||||
Alias print_line_cursor#15 = print_screen#3 print_screen#2 print_line_cursor#2 print_char_cursor#13 print_char_cursor#47 print_line_cursor#3 print_char_cursor#14
|
||||
Alias memset::return#1 = memset::str#1 memset::return#3 memset::return#2
|
||||
Alias memset::str#2 = memset::str#3
|
||||
Alias memset::num#1 = memset::num#2
|
||||
Alias memset::c#3 = memset::c#4
|
||||
Alias memset::end#0 = memset::$2
|
||||
Alias memset::c#1 = memset::c#2
|
||||
Alias memset::dst#2 = memset::dst#3
|
||||
Alias memset::end#1 = memset::end#2
|
||||
Alias memset::str#4 = memset::str#5
|
||||
Alias print_screen#5 = print_screen#7
|
||||
Alias print_line_cursor#24 = print_line_cursor#27
|
||||
Alias print_char_cursor#73 = print_char_cursor#79
|
||||
@ -920,12 +920,6 @@ Alias print_screen#0 = print_line_cursor#9 print_char_cursor#31 print_line_curso
|
||||
Alias print_line_cursor#10 = print_line_cursor#21 print_line_cursor#22 print_line_cursor#11
|
||||
Alias print_char_cursor#32 = print_char_cursor#64 print_char_cursor#65 print_char_cursor#33
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values memset::num#1 memset::num#0
|
||||
Identical Phi Values memset::str#2 memset::str#0
|
||||
Identical Phi Values memset::c#3 memset::c#0
|
||||
Identical Phi Values memset::end#1 memset::end#0
|
||||
Identical Phi Values memset::str#4 memset::str#2
|
||||
Identical Phi Values memset::c#1 memset::c#3
|
||||
Identical Phi Values print_char_cursor#0 print_char_cursor#11
|
||||
Identical Phi Values print_line_cursor#23 print_line_cursor#25
|
||||
Identical Phi Values print_char_cursor#68 print_char_cursor#28
|
||||
@ -936,6 +930,12 @@ Identical Phi Values print_char_cursor#40 print_char_cursor#10
|
||||
Identical Phi Values print_char_cursor#42 print_char_cursor#11
|
||||
Identical Phi Values print_char_cursor#10 print_char_cursor#11
|
||||
Identical Phi Values print_line_cursor#15 print_screen#5
|
||||
Identical Phi Values memset::num#1 memset::num#0
|
||||
Identical Phi Values memset::str#2 memset::str#0
|
||||
Identical Phi Values memset::c#3 memset::c#0
|
||||
Identical Phi Values memset::end#1 memset::end#0
|
||||
Identical Phi Values memset::str#4 memset::str#2
|
||||
Identical Phi Values memset::c#1 memset::c#3
|
||||
Identical Phi Values print_screen#5 print_screen#0
|
||||
Identical Phi Values print_line_cursor#24 print_screen#0
|
||||
Identical Phi Values print_char_cursor#73 print_screen#0
|
||||
@ -967,18 +967,18 @@ Identical Phi Values perspective::z#1 perspective::z#0
|
||||
Identical Phi Values print_line_cursor#10 print_line_cursor#17
|
||||
Identical Phi Values print_char_cursor#32 print_char_cursor#16
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Identical Phi Values memset::return#0 memset::str#0
|
||||
Identical Phi Values print_char_cursor#69 print_char_cursor#1
|
||||
Identical Phi Values print_char_cursor#71 print_char_cursor#11
|
||||
Identical Phi Values memset::return#1 memset::str#0
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Identified duplicate assignment right side [196] mulf_init::$2 = - mulf_init::i#2
|
||||
Identified duplicate assignment right side [204] mulf_init::$6 = 1 - mulf_init::i#2
|
||||
Successful SSA optimization Pass2DuplicateRValueIdentification
|
||||
Simple Condition memset::$1 [2] if(memset::num#0<=0) goto memset::@1
|
||||
Simple Condition memset::$3 [9] if(memset::dst#2!=memset::end#0) goto memset::@4
|
||||
Simple Condition print_str::$1 [16] if(0!=*print_str::str#7) goto print_str::@2
|
||||
Simple Condition print_ln::$1 [26] if(print_line_cursor#0<print_char_cursor#1) goto print_ln::@1
|
||||
Simple Condition print_schar::$0 [30] if(print_schar::b#4<0) goto print_schar::@1
|
||||
Simple Condition print_str::$1 [3] if(0!=*print_str::str#7) goto print_str::@2
|
||||
Simple Condition print_ln::$1 [13] if(print_line_cursor#0<print_char_cursor#1) goto print_ln::@1
|
||||
Simple Condition print_schar::$0 [17] if(print_schar::b#4<0) goto print_schar::@1
|
||||
Simple Condition memset::$1 [53] if(memset::num#0<=0) goto memset::@1
|
||||
Simple Condition memset::$3 [60] if(memset::dst#2!=memset::end#0) goto memset::@4
|
||||
Simple Condition mulf_init::$7 [147] if(mulf_init::i#1!=rangelast(0,$80)) goto mulf_init::@1
|
||||
Successful SSA optimization Pass2ConditionalJumpSimplification
|
||||
Constant right-side identified [67] psp1 = (word)mulf_sqr1
|
||||
@ -1010,17 +1010,17 @@ Constant perspective::x#0 = do_perspective::x#0
|
||||
Constant perspective::y#0 = do_perspective::y#0
|
||||
Constant perspective::z#0 = do_perspective::z#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant memset::return#0 = memset::str#0
|
||||
Constant memset::$4 = (byte*)memset::str#0
|
||||
Constant memset::dst#0 = (byte*)memset::str#0
|
||||
Constant memset::return#2 = memset::str#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
if() condition always false - eliminating [2] if(memset::num#0<=0) goto memset::@1
|
||||
if() condition always false - eliminating [53] if(memset::num#0<=0) goto memset::@1
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Consolidated constant strings into do_perspective::str1
|
||||
Successful SSA optimization Pass2ConstantStringConsolidation
|
||||
Resolved ranged next value [145] mulf_init::i#1 = ++ mulf_init::i#2 to ++
|
||||
Resolved ranged comparison value [147] if(mulf_init::i#1!=rangelast(0,$80)) goto mulf_init::@1 to $81
|
||||
Eliminating unused constant memset::return#2
|
||||
Eliminating unused constant memset::return#0
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Adding number conversion cast (unumber) $81 in if(mulf_init::i#1!=$81) goto mulf_init::@1
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
@ -1031,11 +1031,10 @@ Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Alias mulf_init::$2 = mulf_init::$1
|
||||
Alias mulf_init::$6 = mulf_init::$5
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Constant right-side identified [0] memset::end#0 = memset::$4 + memset::num#0
|
||||
Constant right-side identified [34] memset::end#0 = memset::$4 + memset::num#0
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant memset::end#0 = memset::$4+memset::num#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Inlining constant with var siblings memset::dst#0
|
||||
Inlining constant with var siblings print_str::str#1
|
||||
Inlining constant with var siblings print_str::str#2
|
||||
Inlining constant with var siblings print_str::str#3
|
||||
@ -1047,6 +1046,7 @@ Inlining constant with var siblings print_schar::b#2
|
||||
Inlining constant with var siblings print_schar::b#3
|
||||
Inlining constant with var siblings print_char::ch#1
|
||||
Inlining constant with var siblings print_char::ch#2
|
||||
Inlining constant with var siblings memset::dst#0
|
||||
Inlining constant with var siblings mulf_init::sqr#0
|
||||
Inlining constant with var siblings mulf_init::add#0
|
||||
Inlining constant with var siblings mulf_init::i#0
|
||||
@ -1677,9 +1677,9 @@ Uplift Scope [print_schar] 4,504.5: zp[1]:11 [ print_schar::b#6 print_schar::b#0
|
||||
Uplift Scope [MOS6526_CIA]
|
||||
Uplift Scope [MOS6569_VICII]
|
||||
Uplift Scope [MOS6581_SID]
|
||||
Uplift Scope [RADIX]
|
||||
Uplift Scope [print_ln]
|
||||
Uplift Scope [print_cls]
|
||||
Uplift Scope [RADIX]
|
||||
Uplift Scope [main]
|
||||
Uplift Scope [do_perspective]
|
||||
Uplift Scope [perspective]
|
||||
@ -1695,9 +1695,9 @@ Uplifting [print_schar] best 3770 combination reg byte x [ print_schar::b#6 prin
|
||||
Uplifting [MOS6526_CIA] best 3770 combination
|
||||
Uplifting [MOS6569_VICII] best 3770 combination
|
||||
Uplifting [MOS6581_SID] best 3770 combination
|
||||
Uplifting [RADIX] best 3770 combination
|
||||
Uplifting [print_ln] best 3770 combination
|
||||
Uplifting [print_cls] best 3770 combination
|
||||
Uplifting [RADIX] best 3770 combination
|
||||
Uplifting [main] best 3770 combination
|
||||
Uplifting [do_perspective] best 3770 combination
|
||||
Uplifting [perspective] best 3770 combination
|
||||
|
@ -3,50 +3,6 @@ Inlined call call __init
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
|
||||
void* memset(void* memset::str , byte memset::c , word memset::num)
|
||||
memset: scope:[memset] from bitmap_clear bitmap_clear::@1
|
||||
memset::c#5 = phi( bitmap_clear/memset::c#0, bitmap_clear::@1/memset::c#1 )
|
||||
memset::str#4 = phi( bitmap_clear/memset::str#0, bitmap_clear::@1/memset::str#1 )
|
||||
memset::num#2 = phi( bitmap_clear/memset::num#0, bitmap_clear::@1/memset::num#1 )
|
||||
memset::$0 = memset::num#2 > 0
|
||||
memset::$1 = ! memset::$0
|
||||
if(memset::$1) goto memset::@1
|
||||
to:memset::@2
|
||||
memset::@1: scope:[memset] from memset memset::@3
|
||||
memset::str#2 = phi( memset/memset::str#4, memset::@3/memset::str#5 )
|
||||
memset::return#0 = memset::str#2
|
||||
to:memset::@return
|
||||
memset::@2: scope:[memset] from memset
|
||||
memset::c#4 = phi( memset/memset::c#5 )
|
||||
memset::num#3 = phi( memset/memset::num#2 )
|
||||
memset::str#3 = phi( memset/memset::str#4 )
|
||||
memset::$4 = (byte*)memset::str#3
|
||||
memset::$2 = memset::$4 + memset::num#3
|
||||
memset::end#0 = memset::$2
|
||||
memset::dst#0 = ((byte*)) memset::str#3
|
||||
to:memset::@3
|
||||
memset::@3: scope:[memset] from memset::@2 memset::@4
|
||||
memset::c#3 = phi( memset::@2/memset::c#4, memset::@4/memset::c#2 )
|
||||
memset::str#5 = phi( memset::@2/memset::str#3, memset::@4/memset::str#6 )
|
||||
memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 )
|
||||
memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 )
|
||||
memset::$3 = memset::dst#2 != memset::end#1
|
||||
if(memset::$3) goto memset::@4
|
||||
to:memset::@1
|
||||
memset::@4: scope:[memset] from memset::@3
|
||||
memset::str#6 = phi( memset::@3/memset::str#5 )
|
||||
memset::end#2 = phi( memset::@3/memset::end#1 )
|
||||
memset::dst#3 = phi( memset::@3/memset::dst#2 )
|
||||
memset::c#2 = phi( memset::@3/memset::c#3 )
|
||||
*memset::dst#3 = memset::c#2
|
||||
memset::dst#1 = ++ memset::dst#3
|
||||
to:memset::@3
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
memset::return#4 = phi( memset::@1/memset::return#0 )
|
||||
memset::return#1 = memset::return#4
|
||||
return
|
||||
to:@return
|
||||
|
||||
void bitmap_init(byte* bitmap_init::gfx , byte* bitmap_init::screen)
|
||||
bitmap_init: scope:[bitmap_init] from main
|
||||
bitmap_init::screen#1 = phi( main/bitmap_init::screen#0 )
|
||||
@ -146,7 +102,7 @@ bitmap_clear: scope:[bitmap_clear] from main::@2
|
||||
memset::c#0 = bitmap_clear::col#0
|
||||
memset::num#0 = $3e8
|
||||
call memset
|
||||
memset::return#2 = memset::return#1
|
||||
memset::return#0 = memset::return#3
|
||||
to:bitmap_clear::@1
|
||||
bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear
|
||||
bitmap_gfx#8 = phi( bitmap_clear/bitmap_gfx#14 )
|
||||
@ -154,7 +110,7 @@ bitmap_clear::@1: scope:[bitmap_clear] from bitmap_clear
|
||||
memset::c#1 = 0
|
||||
memset::num#1 = $1f40
|
||||
call memset
|
||||
memset::return#3 = memset::return#1
|
||||
memset::return#1 = memset::return#3
|
||||
to:bitmap_clear::@2
|
||||
bitmap_clear::@2: scope:[bitmap_clear] from bitmap_clear::@1
|
||||
to:bitmap_clear::@return
|
||||
@ -413,6 +369,50 @@ bitmap_line::@11: scope:[bitmap_line] from bitmap_line::@19
|
||||
bitmap_line::e1#2 = bitmap_line::e1#4 - bitmap_line::dx#6
|
||||
to:bitmap_line::@10
|
||||
|
||||
void* memset(void* memset::str , byte memset::c , word memset::num)
|
||||
memset: scope:[memset] from bitmap_clear bitmap_clear::@1
|
||||
memset::c#5 = phi( bitmap_clear/memset::c#0, bitmap_clear::@1/memset::c#1 )
|
||||
memset::str#4 = phi( bitmap_clear/memset::str#0, bitmap_clear::@1/memset::str#1 )
|
||||
memset::num#2 = phi( bitmap_clear/memset::num#0, bitmap_clear::@1/memset::num#1 )
|
||||
memset::$0 = memset::num#2 > 0
|
||||
memset::$1 = ! memset::$0
|
||||
if(memset::$1) goto memset::@1
|
||||
to:memset::@2
|
||||
memset::@1: scope:[memset] from memset memset::@3
|
||||
memset::str#2 = phi( memset/memset::str#4, memset::@3/memset::str#5 )
|
||||
memset::return#2 = memset::str#2
|
||||
to:memset::@return
|
||||
memset::@2: scope:[memset] from memset
|
||||
memset::c#4 = phi( memset/memset::c#5 )
|
||||
memset::num#3 = phi( memset/memset::num#2 )
|
||||
memset::str#3 = phi( memset/memset::str#4 )
|
||||
memset::$4 = (byte*)memset::str#3
|
||||
memset::$2 = memset::$4 + memset::num#3
|
||||
memset::end#0 = memset::$2
|
||||
memset::dst#0 = ((byte*)) memset::str#3
|
||||
to:memset::@3
|
||||
memset::@3: scope:[memset] from memset::@2 memset::@4
|
||||
memset::c#3 = phi( memset::@2/memset::c#4, memset::@4/memset::c#2 )
|
||||
memset::str#5 = phi( memset::@2/memset::str#3, memset::@4/memset::str#6 )
|
||||
memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 )
|
||||
memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 )
|
||||
memset::$3 = memset::dst#2 != memset::end#1
|
||||
if(memset::$3) goto memset::@4
|
||||
to:memset::@1
|
||||
memset::@4: scope:[memset] from memset::@3
|
||||
memset::str#6 = phi( memset::@3/memset::str#5 )
|
||||
memset::end#2 = phi( memset::@3/memset::end#1 )
|
||||
memset::dst#3 = phi( memset::@3/memset::dst#2 )
|
||||
memset::c#2 = phi( memset::@3/memset::c#3 )
|
||||
*memset::dst#3 = memset::c#2
|
||||
memset::dst#1 = ++ memset::dst#3
|
||||
to:memset::@3
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
memset::return#4 = phi( memset::@1/memset::return#2 )
|
||||
memset::return#3 = memset::return#4
|
||||
return
|
||||
to:@return
|
||||
|
||||
word abs_u16(word abs_u16::w)
|
||||
abs_u16: scope:[abs_u16] from bitmap_line bitmap_line::@12
|
||||
abs_u16::w#2 = phi( bitmap_line/abs_u16::w#0, bitmap_line::@12/abs_u16::w#1 )
|
||||
@ -1002,7 +1002,6 @@ Fixing inline constructor with bitmap_plot::$2 = (byte)bitmap_plot_yhi[bitmap_pl
|
||||
Successful SSA optimization Pass2FixInlineConstructors
|
||||
Adding number conversion cast (unumber) 1 in
|
||||
Adding number conversion cast (unumber) 1 in
|
||||
Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#2 > 0
|
||||
Adding number conversion cast (unumber) 1 in bitmap_init::bits#1 = bitmap_init::bits#3 >> 1
|
||||
Adding number conversion cast (unumber) 0 in bitmap_init::$0 = bitmap_init::bits#1 == 0
|
||||
Adding number conversion cast (unumber) $80 in bitmap_init::bits#2 = $80
|
||||
@ -1025,6 +1024,7 @@ Adding number conversion cast (unumber) 2 in bitmap_line::$20 = bitmap_line::dy#
|
||||
Adding number conversion cast (unumber) bitmap_line::$20 in bitmap_line::$20 = bitmap_line::dy#2 / (unumber)2
|
||||
Adding number conversion cast (unumber) 2 in bitmap_line::$15 = bitmap_line::dx#3 / 2
|
||||
Adding number conversion cast (unumber) bitmap_line::$15 in bitmap_line::$15 = bitmap_line::dx#3 / (unumber)2
|
||||
Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#2 > 0
|
||||
Adding number conversion cast (unumber) $80 in abs_u16::$1 = abs_u16::$0 & $80
|
||||
Adding number conversion cast (unumber) abs_u16::$1 in abs_u16::$1 = abs_u16::$0 & (unumber)$80
|
||||
Adding number conversion cast (unumber) 0 in abs_u16::$3 = 0 != abs_u16::$1
|
||||
@ -1049,9 +1049,9 @@ Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Adding number conversion cast (unumber) $40 in *VICII_MEMORY = (byte)(word)SCREEN&(unumber)$3fff/$40|(word)BITMAP&(unumber)$3fff/$400
|
||||
Adding number conversion cast (unumber) $400 in *VICII_MEMORY = (byte)(word)SCREEN&(unumber)$3fff/(unumber)$40|(word)BITMAP&(unumber)$3fff/$400
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Inlining cast memset::dst#0 = (byte*)memset::str#3
|
||||
Inlining cast bitmap_init::bits#2 = (unumber)$80
|
||||
Inlining cast memset::c#1 = (unumber)0
|
||||
Inlining cast memset::dst#0 = (byte*)memset::str#3
|
||||
Inlining cast sgn_u16::return#2 = (unumber)-1
|
||||
Inlining cast sgn_u16::return#3 = (unumber)1
|
||||
Inlining cast *((byte*)VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) = (unumber)0
|
||||
@ -1066,7 +1066,6 @@ Simplifying constant pointer cast (byte*) 1024
|
||||
Simplifying constant pointer cast (byte*) 8192
|
||||
Simplifying constant integer cast 1
|
||||
Simplifying constant integer cast 1
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 1
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast $80
|
||||
@ -1082,6 +1081,7 @@ Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 2
|
||||
Simplifying constant integer cast 2
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast $80
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast $80
|
||||
@ -1103,7 +1103,6 @@ Simplifying constant integer cast $14
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (byte) 1
|
||||
Finalized unsigned number type (byte) 1
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 1
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) $80
|
||||
@ -1117,6 +1116,7 @@ Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 2
|
||||
Finalized unsigned number type (byte) 2
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) $80
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) $80
|
||||
@ -1147,21 +1147,12 @@ Inferred type updated to byte in abs_u16::$1 = abs_u16::$0 & $80
|
||||
Inferred type updated to byte in sgn_u16::$1 = sgn_u16::$0 & $80
|
||||
Inferred type updated to byte in lines::$1 = lines::l#3 + 1
|
||||
Inferred type updated to byte in lines::$2 = lines::l#3 + 1
|
||||
Inversing boolean not [2] memset::$1 = memset::num#2 <= 0 from [1] memset::$0 = memset::num#2 > 0
|
||||
Inversing boolean not [29] bitmap_init::$1 = bitmap_init::bits#1 != 0 from [28] bitmap_init::$0 = bitmap_init::bits#1 == 0
|
||||
Inversing boolean not [49] bitmap_init::$9 = bitmap_init::$7 != 7 from [48] bitmap_init::$8 = bitmap_init::$7 == 7
|
||||
Inversing boolean not [144] bitmap_line::$18 = bitmap_line::dy#3 >= bitmap_line::e#1 from [143] bitmap_line::$17 = bitmap_line::dy#3 < bitmap_line::e#1
|
||||
Inversing boolean not [164] bitmap_line::$23 = bitmap_line::dx#5 >= bitmap_line::e1#1 from [163] bitmap_line::$22 = bitmap_line::dx#5 < bitmap_line::e1#1
|
||||
Inversing boolean not [9] bitmap_init::$1 = bitmap_init::bits#1 != 0 from [8] bitmap_init::$0 = bitmap_init::bits#1 == 0
|
||||
Inversing boolean not [29] bitmap_init::$9 = bitmap_init::$7 != 7 from [28] bitmap_init::$8 = bitmap_init::$7 == 7
|
||||
Inversing boolean not [124] bitmap_line::$18 = bitmap_line::dy#3 >= bitmap_line::e#1 from [123] bitmap_line::$17 = bitmap_line::dy#3 < bitmap_line::e#1
|
||||
Inversing boolean not [144] bitmap_line::$23 = bitmap_line::dx#5 >= bitmap_line::e1#1 from [143] bitmap_line::$22 = bitmap_line::dx#5 < bitmap_line::e1#1
|
||||
Inversing boolean not [154] memset::$1 = memset::num#2 <= 0 from [153] memset::$0 = memset::num#2 > 0
|
||||
Successful SSA optimization Pass2UnaryNotSimplification
|
||||
Alias memset::return#0 = memset::str#2 memset::return#4 memset::return#1
|
||||
Alias memset::str#3 = memset::str#4
|
||||
Alias memset::num#2 = memset::num#3
|
||||
Alias memset::c#4 = memset::c#5
|
||||
Alias memset::end#0 = memset::$2
|
||||
Alias memset::c#2 = memset::c#3
|
||||
Alias memset::dst#2 = memset::dst#3
|
||||
Alias memset::end#1 = memset::end#2
|
||||
Alias memset::str#5 = memset::str#6
|
||||
Alias bitmap_init::x#2 = bitmap_init::x#4
|
||||
Alias bitmap_init::gfx#4 = bitmap_init::gfx#5
|
||||
Alias bitmap_gfx#25 = bitmap_gfx#26
|
||||
@ -1216,6 +1207,15 @@ Alias bitmap_line::y#15 = bitmap_line::y#8 bitmap_line::y#9
|
||||
Alias bitmap_line::sy#2 = bitmap_line::sy#4 bitmap_line::sy#7
|
||||
Alias bitmap_line::e1#1 = bitmap_line::e1#4
|
||||
Alias bitmap_line::x#15 = bitmap_line::x#2
|
||||
Alias memset::return#2 = memset::str#2 memset::return#4 memset::return#3
|
||||
Alias memset::str#3 = memset::str#4
|
||||
Alias memset::num#2 = memset::num#3
|
||||
Alias memset::c#4 = memset::c#5
|
||||
Alias memset::end#0 = memset::$2
|
||||
Alias memset::c#2 = memset::c#3
|
||||
Alias memset::dst#2 = memset::dst#3
|
||||
Alias memset::end#1 = memset::end#2
|
||||
Alias memset::str#5 = memset::str#6
|
||||
Alias abs_u16::w#2 = abs_u16::w#3 abs_u16::w#4 abs_u16::return#3
|
||||
Alias abs_u16::return#2 = abs_u16::$2
|
||||
Alias abs_u16::return#4 = abs_u16::return#7
|
||||
@ -1251,9 +1251,6 @@ Alias bitmap_line::dy#12 = bitmap_line::dy#13
|
||||
Alias bitmap_line::dx#12 = bitmap_line::dx#5
|
||||
Alias bitmap_line::sy#2 = bitmap_line::sy#9
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Identical Phi Values memset::end#1 memset::end#0
|
||||
Identical Phi Values memset::str#5 memset::str#3
|
||||
Identical Phi Values memset::c#2 memset::c#4
|
||||
Identical Phi Values bitmap_init::gfx#1 bitmap_init::gfx#0
|
||||
Identical Phi Values bitmap_init::screen#1 bitmap_init::screen#0
|
||||
Identical Phi Values bitmap_init::gfx#2 bitmap_init::gfx#1
|
||||
@ -1279,6 +1276,9 @@ Identical Phi Values bitmap_line::dy#12 bitmap_line::dy#0
|
||||
Identical Phi Values bitmap_line::dx#12 bitmap_line::dx#0
|
||||
Identical Phi Values bitmap_line::x2#3 bitmap_line::x2#1
|
||||
Identical Phi Values bitmap_line::sy#2 bitmap_line::sy#0
|
||||
Identical Phi Values memset::end#1 memset::end#0
|
||||
Identical Phi Values memset::str#5 memset::str#3
|
||||
Identical Phi Values memset::c#2 memset::c#4
|
||||
Identical Phi Values bitmap_gfx#15 bitmap_gfx#17
|
||||
Identical Phi Values bitmap_screen#14 bitmap_screen#16
|
||||
Identical Phi Values bitmap_gfx#2 bitmap_gfx#1
|
||||
@ -1288,28 +1288,28 @@ Identical Phi Values bitmap_screen#10 bitmap_screen#2
|
||||
Identical Phi Values bitmap_gfx#11 bitmap_gfx#10
|
||||
Identical Phi Values bitmap_screen#11 bitmap_screen#10
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Identical Phi Values memset::return#0 memset::str#3
|
||||
Identical Phi Values memset::return#2 memset::str#3
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Identified duplicate assignment right side [47] bitmap_init::$7 = bitmap_init::y#2 & 7
|
||||
Identified duplicate assignment right side [27] bitmap_init::$7 = bitmap_init::y#2 & 7
|
||||
Successful SSA optimization Pass2DuplicateRValueIdentification
|
||||
Simple Condition memset::$1 [2] if(memset::num#2<=0) goto memset::@1
|
||||
Simple Condition memset::$3 [9] if(memset::dst#2!=memset::end#0) goto memset::@4
|
||||
Simple Condition bitmap_init::$1 [22] if(bitmap_init::bits#1!=0) goto bitmap_init::@2
|
||||
Simple Condition bitmap_init::$2 [26] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1
|
||||
Simple Condition bitmap_init::$9 [38] if(bitmap_init::$7!=7) goto bitmap_init::@6
|
||||
Simple Condition bitmap_init::$11 [42] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5
|
||||
Simple Condition bitmap_line::$12 [90] if(bitmap_line::dx#0>bitmap_line::dy#0) goto bitmap_line::@2
|
||||
Simple Condition bitmap_line::$18 [104] if(bitmap_line::dy#0>=bitmap_line::e#1) goto bitmap_line::@7
|
||||
Simple Condition bitmap_line::$19 [107] if(bitmap_line::y#1!=bitmap_line::y2#0) goto bitmap_line::@6
|
||||
Simple Condition bitmap_line::$23 [121] if(bitmap_line::dx#0>=bitmap_line::e1#1) goto bitmap_line::@10
|
||||
Simple Condition bitmap_line::$24 [124] if(bitmap_line::x#15!=bitmap_line::x2#0) goto bitmap_line::@9
|
||||
Simple Condition bitmap_init::$1 [9] if(bitmap_init::bits#1!=0) goto bitmap_init::@2
|
||||
Simple Condition bitmap_init::$2 [13] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1
|
||||
Simple Condition bitmap_init::$9 [25] if(bitmap_init::$7!=7) goto bitmap_init::@6
|
||||
Simple Condition bitmap_init::$11 [29] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5
|
||||
Simple Condition bitmap_line::$12 [77] if(bitmap_line::dx#0>bitmap_line::dy#0) goto bitmap_line::@2
|
||||
Simple Condition bitmap_line::$18 [91] if(bitmap_line::dy#0>=bitmap_line::e#1) goto bitmap_line::@7
|
||||
Simple Condition bitmap_line::$19 [94] if(bitmap_line::y#1!=bitmap_line::y2#0) goto bitmap_line::@6
|
||||
Simple Condition bitmap_line::$23 [108] if(bitmap_line::dx#0>=bitmap_line::e1#1) goto bitmap_line::@10
|
||||
Simple Condition bitmap_line::$24 [111] if(bitmap_line::x#15!=bitmap_line::x2#0) goto bitmap_line::@9
|
||||
Simple Condition memset::$1 [116] if(memset::num#2<=0) goto memset::@1
|
||||
Simple Condition memset::$3 [123] if(memset::dst#2!=memset::end#0) goto memset::@4
|
||||
Simple Condition abs_u16::$3 [131] if(0!=abs_u16::$1) goto abs_u16::@1
|
||||
Simple Condition sgn_u16::$2 [139] if(0!=sgn_u16::$1) goto sgn_u16::@1
|
||||
Simple Condition lines::$0 [164] if(lines::l#2<LINES) goto lines::@2
|
||||
Simple Condition init_screen::$0 [177] if(init_screen::c#2!=SCREEN+$400) goto init_screen::@2
|
||||
Successful SSA optimization Pass2ConditionalJumpSimplification
|
||||
Rewriting ! if()-condition to reversed if() [79] bitmap_line::$7 = ! bitmap_line::$6
|
||||
Rewriting && if()-condition to two if()s [78] bitmap_line::$6 = bitmap_line::$4 && bitmap_line::$5
|
||||
Rewriting ! if()-condition to reversed if() [66] bitmap_line::$7 = ! bitmap_line::$6
|
||||
Rewriting && if()-condition to two if()s [65] bitmap_line::$6 = bitmap_line::$4 && bitmap_line::$5
|
||||
Successful SSA optimization Pass2ConditionalAndOrRewriting
|
||||
Constant bitmap_init::bits#0 = $80
|
||||
Constant bitmap_init::x#0 = 0
|
||||
@ -1337,16 +1337,16 @@ Constant memset::str#1 = (void*)bitmap_gfx#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
if() condition always true - replacing block destination [159] if(true) goto main::@1
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Resolved ranged next value [24] bitmap_init::x#1 = ++ bitmap_init::x#2 to ++
|
||||
Resolved ranged comparison value [26] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1 to 0
|
||||
Resolved ranged next value [40] bitmap_init::y#1 = ++ bitmap_init::y#2 to ++
|
||||
Resolved ranged comparison value [42] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5 to 0
|
||||
Simplifying expression containing zero bitmap_clear::$0 in [47] bitmap_clear::col#0 = bitmap_clear::$0 + bitmap_clear::bgcol#0
|
||||
Resolved ranged next value [11] bitmap_init::x#1 = ++ bitmap_init::x#2 to ++
|
||||
Resolved ranged comparison value [13] if(bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1 to 0
|
||||
Resolved ranged next value [27] bitmap_init::y#1 = ++ bitmap_init::y#2 to ++
|
||||
Resolved ranged comparison value [29] if(bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@5 to 0
|
||||
Simplifying expression containing zero bitmap_clear::$0 in [34] bitmap_clear::col#0 = bitmap_clear::$0 + bitmap_clear::bgcol#0
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Removing unused block main::@return
|
||||
Successful SSA optimization Pass2EliminateUnusedBlocks
|
||||
Eliminating unused variable memset::return#2 and assignment [35] memset::return#2 = memset::str#3
|
||||
Eliminating unused variable memset::return#3 and assignment [37] memset::return#3 = memset::str#3
|
||||
Eliminating unused variable memset::return#0 and assignment [25] memset::return#0 = memset::str#3
|
||||
Eliminating unused variable memset::return#1 and assignment [27] memset::return#1 = memset::str#3
|
||||
Eliminating unused constant bitmap_clear::bgcol#0
|
||||
Eliminating unused constant bitmap_screen#16
|
||||
Eliminating unused constant bitmap_gfx#17
|
||||
@ -1360,8 +1360,8 @@ Removing unused procedure block __start::@1
|
||||
Removing unused procedure block __start::@2
|
||||
Removing unused procedure block __start::@return
|
||||
Successful SSA optimization PassNEliminateEmptyStart
|
||||
Adding number conversion cast (unumber) 0 in [16] if(bitmap_init::x#1!=0) goto bitmap_init::@1
|
||||
Adding number conversion cast (unumber) 0 in [28] if(bitmap_init::y#1!=0) goto bitmap_init::@5
|
||||
Adding number conversion cast (unumber) 0 in [6] if(bitmap_init::x#1!=0) goto bitmap_init::@1
|
||||
Adding number conversion cast (unumber) 0 in [18] if(bitmap_init::y#1!=0) goto bitmap_init::@5
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 0
|
||||
@ -1372,35 +1372,35 @@ Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Alias bitmap_init::$7 = bitmap_init::$3
|
||||
Alias bitmap_clear::col#0 = bitmap_clear::$0
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Simple Condition bitmap_line::$4 [53] if(bitmap_line::dx#0==0) goto bitmap_line::@20
|
||||
Simple Condition bitmap_line::$4 [43] if(bitmap_line::dx#0==0) goto bitmap_line::@20
|
||||
Simple Condition bitmap_line::$5 [132] if(bitmap_line::dy#0==0) goto bitmap_line::@4
|
||||
Successful SSA optimization Pass2ConditionalJumpSimplification
|
||||
Negating conditional jump and destination [53] if(bitmap_line::dx#0!=0) goto bitmap_line::@1
|
||||
Negating conditional jump and destination [43] if(bitmap_line::dx#0!=0) goto bitmap_line::@1
|
||||
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
|
||||
Constant right-side identified [30] bitmap_clear::col#0 = bitmap_clear::fgcol#0 * $10
|
||||
Constant right-side identified [20] bitmap_clear::col#0 = bitmap_clear::fgcol#0 * $10
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant bitmap_clear::col#0 = bitmap_clear::fgcol#0*$10
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant memset::c#0 = bitmap_clear::col#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Inlining Noop Cast [2] memset::$4 = (byte*)memset::str#3 keeping memset::str#3
|
||||
Inlining Noop Cast [4] memset::dst#0 = (byte*)memset::str#3 keeping memset::str#3
|
||||
Inlining Noop Cast [25] bitmap_plot::plotter#0 = (byte*)bitmap_plot::$2 keeping bitmap_plot::plotter#0
|
||||
Successful SSA optimization Pass2NopCastInlining
|
||||
Inlining Noop Cast [35] bitmap_plot::plotter#0 = (byte*)bitmap_plot::$2 keeping bitmap_plot::plotter#0
|
||||
Inlining Noop Cast [83] memset::$4 = (byte*)memset::str#3 keeping memset::str#3
|
||||
Inlining Noop Cast [85] memset::dst#0 = (byte*)memset::str#3 keeping memset::str#3
|
||||
Successful SSA optimization Pass2NopCastInlining
|
||||
Rewriting division to use shift [63] bitmap_line::e1#0 = bitmap_line::dy#0 / 2
|
||||
Rewriting division to use shift [64] bitmap_line::e#0 = bitmap_line::dx#0 / 2
|
||||
Rewriting division to use shift [53] bitmap_line::e1#0 = bitmap_line::dy#0 / 2
|
||||
Rewriting division to use shift [54] bitmap_line::e#0 = bitmap_line::dx#0 / 2
|
||||
Successful SSA optimization Pass2MultiplyToShiftRewriting
|
||||
Inlining constant with var siblings bitmap_init::bits#0
|
||||
Inlining constant with var siblings bitmap_init::x#0
|
||||
Inlining constant with var siblings bitmap_init::bits#2
|
||||
Inlining constant with var siblings bitmap_init::y#0
|
||||
Inlining constant with var siblings memset::num#0
|
||||
Inlining constant with var siblings memset::c#1
|
||||
Inlining constant with var siblings memset::num#1
|
||||
Inlining constant with var siblings memset::str#0
|
||||
Inlining constant with var siblings memset::str#1
|
||||
Inlining constant with var siblings memset::c#0
|
||||
Inlining constant with var siblings bitmap_init::bits#0
|
||||
Inlining constant with var siblings bitmap_init::x#0
|
||||
Inlining constant with var siblings bitmap_init::bits#2
|
||||
Inlining constant with var siblings bitmap_init::y#0
|
||||
Inlining constant with var siblings sgn_u16::return#2
|
||||
Inlining constant with var siblings sgn_u16::return#3
|
||||
Inlining constant with var siblings lines::l#0
|
||||
@ -1412,8 +1412,8 @@ Constant inlined bitmap_init::gfx#0 = BITMAP
|
||||
Constant inlined memset::num#1 = $1f40
|
||||
Constant inlined bitmap_clear::fgcol#0 = WHITE
|
||||
Constant inlined bitmap_gfx#0 = BITMAP
|
||||
Constant inlined memset::num#0 = $3e8
|
||||
Constant inlined bitmap_init::bits#0 = $80
|
||||
Constant inlined memset::num#0 = $3e8
|
||||
Constant inlined bitmap_init::bits#2 = $80
|
||||
Constant inlined lines::l#0 = 0
|
||||
Constant inlined bitmap_screen#0 = SCREEN
|
||||
@ -1542,9 +1542,6 @@ Culled Empty Block label bitmap_line::@26
|
||||
Culled Empty Block label bitmap_line::@16
|
||||
Culled Empty Block label abs_u16::@2
|
||||
Culled Empty Block label sgn_u16::@2
|
||||
Renumbering block memset::@2 to memset::@1
|
||||
Renumbering block memset::@3 to memset::@2
|
||||
Renumbering block memset::@4 to memset::@3
|
||||
Renumbering block bitmap_init::@5 to bitmap_init::@3
|
||||
Renumbering block bitmap_init::@6 to bitmap_init::@4
|
||||
Renumbering block bitmap_init::@7 to bitmap_init::@5
|
||||
@ -1552,6 +1549,9 @@ Renumbering block bitmap_init::@9 to bitmap_init::@6
|
||||
Renumbering block bitmap_line::@17 to bitmap_line::@16
|
||||
Renumbering block bitmap_line::@19 to bitmap_line::@17
|
||||
Renumbering block bitmap_line::@20 to bitmap_line::@18
|
||||
Renumbering block memset::@2 to memset::@1
|
||||
Renumbering block memset::@3 to memset::@2
|
||||
Renumbering block memset::@4 to memset::@3
|
||||
Adding NOP phi() at start of main::@2
|
||||
Adding NOP phi() at start of main::@3
|
||||
Adding NOP phi() at start of main::@1
|
||||
|
@ -7,50 +7,6 @@ Inlined call call __init
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
|
||||
void* memset(void* memset::str , byte memset::c , word memset::num)
|
||||
memset: scope:[memset] from print_cls
|
||||
memset::c#4 = phi( print_cls/memset::c#0 )
|
||||
memset::str#3 = phi( print_cls/memset::str#0 )
|
||||
memset::num#1 = phi( print_cls/memset::num#0 )
|
||||
memset::$0 = memset::num#1 > 0
|
||||
memset::$1 = ! memset::$0
|
||||
if(memset::$1) goto memset::@1
|
||||
to:memset::@2
|
||||
memset::@1: scope:[memset] from memset memset::@3
|
||||
memset::str#1 = phi( memset/memset::str#3, memset::@3/memset::str#4 )
|
||||
memset::return#0 = memset::str#1
|
||||
to:memset::@return
|
||||
memset::@2: scope:[memset] from memset
|
||||
memset::c#3 = phi( memset/memset::c#4 )
|
||||
memset::num#2 = phi( memset/memset::num#1 )
|
||||
memset::str#2 = phi( memset/memset::str#3 )
|
||||
memset::$4 = (byte*)memset::str#2
|
||||
memset::$2 = memset::$4 + memset::num#2
|
||||
memset::end#0 = memset::$2
|
||||
memset::dst#0 = ((byte*)) memset::str#2
|
||||
to:memset::@3
|
||||
memset::@3: scope:[memset] from memset::@2 memset::@4
|
||||
memset::c#2 = phi( memset::@2/memset::c#3, memset::@4/memset::c#1 )
|
||||
memset::str#4 = phi( memset::@2/memset::str#2, memset::@4/memset::str#5 )
|
||||
memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 )
|
||||
memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 )
|
||||
memset::$3 = memset::dst#2 != memset::end#1
|
||||
if(memset::$3) goto memset::@4
|
||||
to:memset::@1
|
||||
memset::@4: scope:[memset] from memset::@3
|
||||
memset::str#5 = phi( memset::@3/memset::str#4 )
|
||||
memset::end#2 = phi( memset::@3/memset::end#1 )
|
||||
memset::dst#3 = phi( memset::@3/memset::dst#2 )
|
||||
memset::c#1 = phi( memset::@3/memset::c#2 )
|
||||
*memset::dst#3 = memset::c#1
|
||||
memset::dst#1 = ++ memset::dst#3
|
||||
to:memset::@3
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
memset::return#3 = phi( memset::@1/memset::return#0 )
|
||||
memset::return#1 = memset::return#3
|
||||
return
|
||||
to:@return
|
||||
|
||||
void print_schar_at(signed byte print_schar_at::b , byte* print_schar_at::at)
|
||||
print_schar_at: scope:[print_schar_at] from main::@1 main::@3 main::@9
|
||||
print_schar_at::at#6 = phi( main::@1/print_schar_at::at#0, main::@3/print_schar_at::at#1, main::@9/print_schar_at::at#2 )
|
||||
@ -137,7 +93,7 @@ print_cls: scope:[print_cls] from init_screen
|
||||
memset::c#0 = ' '
|
||||
memset::num#0 = $3e8
|
||||
call memset
|
||||
memset::return#2 = memset::return#1
|
||||
memset::return#0 = memset::return#2
|
||||
to:print_cls::@1
|
||||
print_cls::@1: scope:[print_cls] from print_cls
|
||||
to:print_cls::@return
|
||||
@ -145,6 +101,50 @@ print_cls::@return: scope:[print_cls] from print_cls::@1
|
||||
return
|
||||
to:@return
|
||||
|
||||
void* memset(void* memset::str , byte memset::c , word memset::num)
|
||||
memset: scope:[memset] from print_cls
|
||||
memset::c#4 = phi( print_cls/memset::c#0 )
|
||||
memset::str#3 = phi( print_cls/memset::str#0 )
|
||||
memset::num#1 = phi( print_cls/memset::num#0 )
|
||||
memset::$0 = memset::num#1 > 0
|
||||
memset::$1 = ! memset::$0
|
||||
if(memset::$1) goto memset::@1
|
||||
to:memset::@2
|
||||
memset::@1: scope:[memset] from memset memset::@3
|
||||
memset::str#1 = phi( memset/memset::str#3, memset::@3/memset::str#4 )
|
||||
memset::return#1 = memset::str#1
|
||||
to:memset::@return
|
||||
memset::@2: scope:[memset] from memset
|
||||
memset::c#3 = phi( memset/memset::c#4 )
|
||||
memset::num#2 = phi( memset/memset::num#1 )
|
||||
memset::str#2 = phi( memset/memset::str#3 )
|
||||
memset::$4 = (byte*)memset::str#2
|
||||
memset::$2 = memset::$4 + memset::num#2
|
||||
memset::end#0 = memset::$2
|
||||
memset::dst#0 = ((byte*)) memset::str#2
|
||||
to:memset::@3
|
||||
memset::@3: scope:[memset] from memset::@2 memset::@4
|
||||
memset::c#2 = phi( memset::@2/memset::c#3, memset::@4/memset::c#1 )
|
||||
memset::str#4 = phi( memset::@2/memset::str#2, memset::@4/memset::str#5 )
|
||||
memset::end#1 = phi( memset::@2/memset::end#0, memset::@4/memset::end#2 )
|
||||
memset::dst#2 = phi( memset::@2/memset::dst#0, memset::@4/memset::dst#1 )
|
||||
memset::$3 = memset::dst#2 != memset::end#1
|
||||
if(memset::$3) goto memset::@4
|
||||
to:memset::@1
|
||||
memset::@4: scope:[memset] from memset::@3
|
||||
memset::str#5 = phi( memset::@3/memset::str#4 )
|
||||
memset::end#2 = phi( memset::@3/memset::end#1 )
|
||||
memset::dst#3 = phi( memset::@3/memset::dst#2 )
|
||||
memset::c#1 = phi( memset::@3/memset::c#2 )
|
||||
*memset::dst#3 = memset::c#1
|
||||
memset::dst#1 = ++ memset::dst#3
|
||||
to:memset::@3
|
||||
memset::@return: scope:[memset] from memset::@1
|
||||
memset::return#3 = phi( memset::@1/memset::return#1 )
|
||||
memset::return#2 = memset::return#3
|
||||
return
|
||||
to:@return
|
||||
|
||||
void main()
|
||||
main: scope:[main] from __start::@1
|
||||
print_screen#6 = phi( __start::@1/print_screen#7 )
|
||||
@ -500,7 +500,6 @@ byte print_uchar_at::b#1
|
||||
byte print_uchar_at::b#2
|
||||
constant signed byte* vals[] = { -$5f, -$40, -$20, -$10, 0, $10, $20, $40, $5f }
|
||||
|
||||
Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#1 > 0
|
||||
Adding number conversion cast (snumber) 0 in print_schar_at::$0 = print_schar_at::b#4 < 0
|
||||
Adding number conversion cast (unumber) 1 in print_schar_at::$1 = print_schar_at::at#5 + 1
|
||||
Adding number conversion cast (unumber) 4 in print_uchar_at::$0 = print_uchar_at::b#1 >> 4
|
||||
@ -508,6 +507,7 @@ Adding number conversion cast (unumber) $f in print_uchar_at::$2 = print_uchar_a
|
||||
Adding number conversion cast (unumber) print_uchar_at::$2 in print_uchar_at::$2 = print_uchar_at::b#2 & (unumber)$f
|
||||
Adding number conversion cast (unumber) 1 in print_uchar_at::$3 = print_uchar_at::at#2 + 1
|
||||
Adding number conversion cast (unumber) $3e8 in memset::num#0 = $3e8
|
||||
Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#1 > 0
|
||||
Adding number conversion cast (unumber) 4 in main::$1 = main::at_line#0 + 4
|
||||
Adding number conversion cast (unumber) 4 in main::at#1 = main::at#5 + 4
|
||||
Adding number conversion cast (unumber) $28 in main::at_line#1 = main::at_line#2 + $28
|
||||
@ -518,16 +518,16 @@ Adding number conversion cast (unumber) 2 in init_screen::COLS#3[2] = init_scree
|
||||
Adding number conversion cast (unumber) 3 in init_screen::COLS#3[3] = init_screen::WHITE
|
||||
Adding number conversion cast (unumber) $28 in init_screen::COLS#1 = init_screen::COLS#3 + $28
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Inlining cast memset::dst#0 = (byte*)memset::str#2
|
||||
Inlining cast memset::num#0 = (unumber)$3e8
|
||||
Inlining cast memset::dst#0 = (byte*)memset::str#2
|
||||
Successful SSA optimization Pass2InlineCast
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 1
|
||||
Simplifying constant integer cast 4
|
||||
Simplifying constant integer cast $f
|
||||
Simplifying constant integer cast 1
|
||||
Simplifying constant integer cast $3e8
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Simplifying constant integer cast 4
|
||||
Simplifying constant integer cast 4
|
||||
@ -541,13 +541,13 @@ Simplifying constant integer cast 3
|
||||
Simplifying constant integer cast $28
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized signed number type (signed byte) 0
|
||||
Finalized unsigned number type (byte) 1
|
||||
Finalized unsigned number type (byte) 4
|
||||
Finalized unsigned number type (byte) $f
|
||||
Finalized unsigned number type (byte) 1
|
||||
Finalized unsigned number type (word) $3e8
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 4
|
||||
Finalized unsigned number type (byte) 4
|
||||
Finalized unsigned number type (byte) $28
|
||||
@ -559,10 +559,17 @@ Finalized unsigned number type (byte) 3
|
||||
Finalized unsigned number type (byte) $28
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Inferred type updated to byte in print_uchar_at::$2 = print_uchar_at::b#2 & $f
|
||||
Inversing boolean not [2] memset::$1 = memset::num#1 <= 0 from [1] memset::$0 = memset::num#1 > 0
|
||||
Inversing boolean not [45] memset::$1 = memset::num#1 <= 0 from [44] memset::$0 = memset::num#1 > 0
|
||||
Successful SSA optimization Pass2UnaryNotSimplification
|
||||
Alias candidate removed (volatile)fmul8::return#1 = fmul8::cc fmul8::return#4 fmul8::return#2
|
||||
Alias memset::return#0 = memset::str#1 memset::return#3 memset::return#1
|
||||
Alias print_schar_at::at#3 = print_schar_at::at#6 print_schar_at::at#7 print_schar_at::at#4 print_schar_at::at#8
|
||||
Alias print_schar_at::b#4 = print_schar_at::b#7 print_schar_at::b#5 print_schar_at::b#9 print_schar_at::b#8
|
||||
Alias print_schar_at::b#0 = print_schar_at::$5
|
||||
Alias print_uchar_at::at#0 = print_schar_at::$1
|
||||
Alias print_uchar_at::b#1 = print_uchar_at::b#2
|
||||
Alias print_uchar_at::at#1 = print_uchar_at::at#2
|
||||
Alias print_char_at::at#3 = print_uchar_at::$3
|
||||
Alias memset::return#1 = memset::str#1 memset::return#3 memset::return#2
|
||||
Alias memset::str#2 = memset::str#3
|
||||
Alias memset::num#1 = memset::num#2
|
||||
Alias memset::c#3 = memset::c#4
|
||||
@ -571,13 +578,6 @@ Alias memset::c#1 = memset::c#2
|
||||
Alias memset::dst#2 = memset::dst#3
|
||||
Alias memset::end#1 = memset::end#2
|
||||
Alias memset::str#4 = memset::str#5
|
||||
Alias print_schar_at::at#3 = print_schar_at::at#6 print_schar_at::at#7 print_schar_at::at#4 print_schar_at::at#8
|
||||
Alias print_schar_at::b#4 = print_schar_at::b#7 print_schar_at::b#5 print_schar_at::b#9 print_schar_at::b#8
|
||||
Alias print_schar_at::b#0 = print_schar_at::$5
|
||||
Alias print_uchar_at::at#0 = print_schar_at::$1
|
||||
Alias print_uchar_at::b#1 = print_uchar_at::b#2
|
||||
Alias print_uchar_at::at#1 = print_uchar_at::at#2
|
||||
Alias print_char_at::at#3 = print_uchar_at::$3
|
||||
Alias main::at#0 = main::$1
|
||||
Alias main::at#4 = main::at#5
|
||||
Alias main::k#2 = main::k#3
|
||||
@ -597,15 +597,15 @@ Alias candidate removed (volatile)fmul8::return#1 = fmul8::cc fmul8::return#4 fm
|
||||
Alias print_schar_at::at#3 = print_schar_at::at#5
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Alias candidate removed (volatile)fmul8::return#1 = fmul8::cc fmul8::return#4 fmul8::return#2
|
||||
Identical Phi Values print_uchar_at::b#1 print_uchar_at::b#0
|
||||
Identical Phi Values print_uchar_at::at#1 print_uchar_at::at#0
|
||||
Identical Phi Values print_screen#2 print_screen#4
|
||||
Identical Phi Values memset::num#1 memset::num#0
|
||||
Identical Phi Values memset::str#2 memset::str#0
|
||||
Identical Phi Values memset::c#3 memset::c#0
|
||||
Identical Phi Values memset::end#1 memset::end#0
|
||||
Identical Phi Values memset::str#4 memset::str#2
|
||||
Identical Phi Values memset::c#1 memset::c#3
|
||||
Identical Phi Values print_uchar_at::b#1 print_uchar_at::b#0
|
||||
Identical Phi Values print_uchar_at::at#1 print_uchar_at::at#0
|
||||
Identical Phi Values print_screen#2 print_screen#4
|
||||
Identical Phi Values print_screen#6 print_screen#0
|
||||
Identical Phi Values main::at_line#3 main::at_line#0
|
||||
Identical Phi Values main::i#3 main::i#2
|
||||
@ -614,11 +614,11 @@ Identical Phi Values print_screen#4 print_screen#6
|
||||
Identical Phi Values init_screen::COLS#2 init_screen::COLS#0
|
||||
Identical Phi Values fmul8::return#4 fmul8::return#1
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Identical Phi Values memset::return#0 memset::str#0
|
||||
Identical Phi Values memset::return#1 memset::str#0
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Simple Condition memset::$1 [2] if(memset::num#0<=0) goto memset::@1
|
||||
Simple Condition memset::$3 [9] if(memset::dst#2!=memset::end#0) goto memset::@4
|
||||
Simple Condition print_schar_at::$0 [15] if(print_schar_at::b#4<0) goto print_schar_at::@1
|
||||
Simple Condition print_schar_at::$0 [2] if(print_schar_at::b#4<0) goto print_schar_at::@1
|
||||
Simple Condition memset::$1 [37] if(memset::num#0<=0) goto memset::@1
|
||||
Simple Condition memset::$3 [44] if(memset::dst#2!=memset::end#0) goto memset::@4
|
||||
Simple Condition main::$3 [60] if(main::k#1!=rangelast(0,8)) goto main::@1
|
||||
Simple Condition main::$7 [80] if(main::j#1!=rangelast(0,8)) goto main::@4
|
||||
Simple Condition main::$8 [83] if(main::i#1!=rangelast(0,8)) goto main::@3
|
||||
@ -640,11 +640,11 @@ Constant print_screen#0 = (byte*) 1024
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant memset::str#0 = (void*)print_screen#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant memset::return#0 = memset::str#0
|
||||
Constant memset::$4 = (byte*)memset::str#0
|
||||
Constant memset::dst#0 = (byte*)memset::str#0
|
||||
Constant memset::return#2 = memset::str#0
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
if() condition always false - eliminating [2] if(memset::num#0<=0) goto memset::@1
|
||||
if() condition always false - eliminating [37] if(memset::num#0<=0) goto memset::@1
|
||||
Successful SSA optimization Pass2ConstantIfs
|
||||
Resolved ranged next value [58] main::k#1 = ++ main::k#2 to ++
|
||||
Resolved ranged comparison value [60] if(main::k#1!=rangelast(0,8)) goto main::@1 to 9
|
||||
@ -658,7 +658,7 @@ Resolved ranged next value [101] init_screen::m#1 = ++ init_screen::m#2 to ++
|
||||
Resolved ranged comparison value [103] if(init_screen::m#1!=rangelast(0,$18)) goto init_screen::@3 to $19
|
||||
Simplifying expression containing zero init_screen::COLS#3 in [96] init_screen::COLS#3[0] = init_screen::WHITE
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused constant memset::return#2
|
||||
Eliminating unused constant memset::return#0
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Removing unused procedure __start
|
||||
Removing unused procedure block __start
|
||||
@ -686,16 +686,16 @@ Finalized unsigned number type (byte) $28
|
||||
Finalized unsigned number type (byte) $19
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Alias candidate removed (volatile)fmul8::return#1 = fmul8::cc fmul8::return#2
|
||||
Constant right-side identified [0] memset::end#0 = memset::$4 + memset::num#0
|
||||
Constant right-side identified [26] memset::end#0 = memset::$4 + memset::num#0
|
||||
Constant right-side identified [33] main::at#0 = main::at_line#0 + 4
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant memset::end#0 = memset::$4+memset::num#0
|
||||
Constant main::at#0 = main::at_line#0+4
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Alias candidate removed (volatile)fmul8::return#1 = fmul8::cc fmul8::return#2
|
||||
Inlining constant with var siblings memset::dst#0
|
||||
Inlining constant with var siblings print_char_at::ch#0
|
||||
Inlining constant with var siblings print_char_at::ch#1
|
||||
Inlining constant with var siblings memset::dst#0
|
||||
Inlining constant with var siblings main::at_line#0
|
||||
Inlining constant with var siblings main::k#0
|
||||
Inlining constant with var siblings main::i#0
|
||||
@ -1255,8 +1255,8 @@ Uplift Scope [print_schar_at] 3,647: zp[1]:17 [ print_schar_at::b#6 print_schar_
|
||||
Uplift Scope [fmul8] 2,002: zp[1]:31 [ fmul8::return#1 ] 1,001: zp[1]:30 [ fmul8::cc ] 367.33: zp[1]:32 [ fmul8::return#2 ] 202: zp[1]:25 [ fmul8::return#0 ] 50.5: zp[1]:24 [ fmul8::bb ] 33.67: zp[1]:23 [ fmul8::aa ]
|
||||
Uplift Scope [main] 262.55: zp[2]:8 [ main::at#6 main::at#3 main::at#12 ] 202: zp[1]:26 [ main::r#0 ] 181.8: zp[1]:10 [ main::j#2 main::j#1 ] 24.32: zp[2]:5 [ main::at_line#2 main::at#2 ] 23.94: zp[1]:7 [ main::i#2 main::i#1 ] 23.1: zp[1]:2 [ main::k#2 main::k#1 ] 15.58: zp[2]:3 [ main::at#4 main::at#1 ]
|
||||
Uplift Scope [init_screen] 303: zp[1]:11 [ init_screen::l#2 init_screen::l#1 ] 188.53: zp[2]:12 [ init_screen::COLS#3 init_screen::COLS#1 ] 185.17: zp[1]:14 [ init_screen::m#2 init_screen::m#1 ]
|
||||
Uplift Scope [RADIX]
|
||||
Uplift Scope [print_cls]
|
||||
Uplift Scope [RADIX]
|
||||
Uplift Scope []
|
||||
|
||||
Uplifting [print_char_at] best 14208 combination zp[2]:19 [ print_char_at::at#4 print_char_at::at#0 print_char_at::at#1 print_char_at::at#2 print_char_at::at#3 ] reg byte x [ print_char_at::ch#4 print_char_at::ch#2 print_char_at::ch#3 ]
|
||||
@ -1266,8 +1266,8 @@ Uplifting [print_schar_at] best 14200 combination zp[1]:17 [ print_schar_at::b#6
|
||||
Uplifting [fmul8] best 13291 combination reg byte a [ fmul8::return#1 ] zp[1]:30 [ fmul8::cc ] reg byte a [ fmul8::return#2 ] reg byte a [ fmul8::return#0 ] zp[1]:24 [ fmul8::bb ] zp[1]:23 [ fmul8::aa ]
|
||||
Uplifting [main] best 12691 combination zp[2]:8 [ main::at#6 main::at#3 main::at#12 ] reg byte a [ main::r#0 ] zp[1]:10 [ main::j#2 main::j#1 ] zp[2]:5 [ main::at_line#2 main::at#2 ] zp[1]:7 [ main::i#2 main::i#1 ] zp[1]:2 [ main::k#2 main::k#1 ] zp[2]:3 [ main::at#4 main::at#1 ]
|
||||
Uplifting [init_screen] best 12481 combination reg byte x [ init_screen::l#2 init_screen::l#1 ] zp[2]:12 [ init_screen::COLS#3 init_screen::COLS#1 ] reg byte x [ init_screen::m#2 init_screen::m#1 ]
|
||||
Uplifting [RADIX] best 12481 combination
|
||||
Uplifting [print_cls] best 12481 combination
|
||||
Uplifting [RADIX] best 12481 combination
|
||||
Uplifting [] best 12481 combination
|
||||
Attempting to uplift remaining variables inzp[1]:29 [ print_uchar_at::b#0 ]
|
||||
Uplifting [print_uchar_at] best 12481 combination zp[1]:29 [ print_uchar_at::b#0 ]
|
||||
|
@ -879,11 +879,11 @@ Consolidated array index constant in *((byte**)memset_dma256::f018b#0+OFFSET_STR
|
||||
Successful SSA optimization Pass2ConstantAdditionElimination
|
||||
Finalized unsigned number type (byte) 8
|
||||
Finalized unsigned number type (byte) 8
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) $2d
|
||||
Finalized unsigned number type (byte) $19
|
||||
Finalized unsigned number type (byte) 2
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) $2d
|
||||
Finalized unsigned number type (byte) $19
|
||||
Finalized unsigned number type (byte) 8
|
||||
|
@ -39,11 +39,11 @@
|
||||
.const OFFSET_STRUCT_SPRITEDATA_TILE = 1
|
||||
.const OFFSET_STRUCT_SPRITEDATA_ATTRIBUTES = 2
|
||||
.const OFFSET_STRUCT_SPRITEDATA_X = 3
|
||||
.const OFFSET_STRUCT_RICOH_2C02_OAMADDR = 3
|
||||
.const OFFSET_STRUCT_RICOH_2A03_OAMDMA = $14
|
||||
.const OFFSET_STRUCT_RICOH_2A03_DMC_FREQ = $10
|
||||
.const OFFSET_STRUCT_RICOH_2C02_PPUMASK = 1
|
||||
.const OFFSET_STRUCT_RICOH_2C02_PPUSTATUS = 2
|
||||
.const OFFSET_STRUCT_RICOH_2C02_OAMADDR = 3
|
||||
.const OFFSET_STRUCT_RICOH_2A03_OAMDMA = $14
|
||||
.const OFFSET_STRUCT_RICOH_2A03_JOY1 = $16
|
||||
.const OFFSET_STRUCT_RICOH_2C02_PPUADDR = 6
|
||||
.const OFFSET_STRUCT_RICOH_2C02_PPUDATA = 7
|
||||
|
@ -513,7 +513,7 @@ constant byte* TILES[] = kickasm {{ .var filechargen = LoadBinary("characters.9
|
||||
.fill 8, 0
|
||||
}
|
||||
}}
|
||||
constant void()* const* VECTORS[] = { &vblank, &main, 0 }
|
||||
constant void()** VECTORS[] = { &vblank, &main, 0 }
|
||||
void __start()
|
||||
void main()
|
||||
word~ main::$1
|
||||
@ -2129,11 +2129,11 @@ ASSEMBLER BEFORE OPTIMIZATION
|
||||
.const OFFSET_STRUCT_SPRITEDATA_TILE = 1
|
||||
.const OFFSET_STRUCT_SPRITEDATA_ATTRIBUTES = 2
|
||||
.const OFFSET_STRUCT_SPRITEDATA_X = 3
|
||||
.const OFFSET_STRUCT_RICOH_2C02_OAMADDR = 3
|
||||
.const OFFSET_STRUCT_RICOH_2A03_OAMDMA = $14
|
||||
.const OFFSET_STRUCT_RICOH_2A03_DMC_FREQ = $10
|
||||
.const OFFSET_STRUCT_RICOH_2C02_PPUMASK = 1
|
||||
.const OFFSET_STRUCT_RICOH_2C02_PPUSTATUS = 2
|
||||
.const OFFSET_STRUCT_RICOH_2C02_OAMADDR = 3
|
||||
.const OFFSET_STRUCT_RICOH_2A03_OAMDMA = $14
|
||||
.const OFFSET_STRUCT_RICOH_2A03_JOY1 = $16
|
||||
.const OFFSET_STRUCT_RICOH_2C02_PPUADDR = 6
|
||||
.const OFFSET_STRUCT_RICOH_2C02_PPUDATA = 7
|
||||
@ -3043,7 +3043,7 @@ constant byte* TILES[] = kickasm {{ .var filechargen = LoadBinary("characters.9
|
||||
.fill 8, 0
|
||||
}
|
||||
}}
|
||||
constant void()* const* VECTORS[] = { &vblank, &main, 0 }
|
||||
constant void()** VECTORS[] = { &vblank, &main, 0 }
|
||||
void __start()
|
||||
void main()
|
||||
byte~ main::$7 reg byte y 126.25
|
||||
@ -3207,11 +3207,11 @@ Score: 4702
|
||||
.const OFFSET_STRUCT_SPRITEDATA_TILE = 1
|
||||
.const OFFSET_STRUCT_SPRITEDATA_ATTRIBUTES = 2
|
||||
.const OFFSET_STRUCT_SPRITEDATA_X = 3
|
||||
.const OFFSET_STRUCT_RICOH_2C02_OAMADDR = 3
|
||||
.const OFFSET_STRUCT_RICOH_2A03_OAMDMA = $14
|
||||
.const OFFSET_STRUCT_RICOH_2A03_DMC_FREQ = $10
|
||||
.const OFFSET_STRUCT_RICOH_2C02_PPUMASK = 1
|
||||
.const OFFSET_STRUCT_RICOH_2C02_PPUSTATUS = 2
|
||||
.const OFFSET_STRUCT_RICOH_2C02_OAMADDR = 3
|
||||
.const OFFSET_STRUCT_RICOH_2A03_OAMDMA = $14
|
||||
.const OFFSET_STRUCT_RICOH_2A03_JOY1 = $16
|
||||
.const OFFSET_STRUCT_RICOH_2C02_PPUADDR = 6
|
||||
.const OFFSET_STRUCT_RICOH_2C02_PPUDATA = 7
|
||||
|
@ -36,7 +36,7 @@ constant byte* TILES[] = kickasm {{ .var filechargen = LoadBinary("characters.9
|
||||
.fill 8, 0
|
||||
}
|
||||
}}
|
||||
constant void()* const* VECTORS[] = { &vblank, &main, 0 }
|
||||
constant void()** VECTORS[] = { &vblank, &main, 0 }
|
||||
void __start()
|
||||
void main()
|
||||
byte~ main::$7 reg byte y 126.25
|
||||
|
@ -32,20 +32,18 @@ main: {
|
||||
// *ptr = call1(3,4)
|
||||
sta ptr
|
||||
// call2(1,2)
|
||||
lda #1
|
||||
sta.z call2.param1
|
||||
lda #2
|
||||
sta.z call2.param2
|
||||
ldx #1
|
||||
jsr call2
|
||||
// call2(1,2)
|
||||
lda.z call2.return
|
||||
// *ptr = call2(1,2)
|
||||
sta ptr
|
||||
// call2(3,4)
|
||||
lda #3
|
||||
sta.z call2.param1
|
||||
lda #4
|
||||
sta.z call2.param2
|
||||
ldx #3
|
||||
jsr call2
|
||||
// call2(3,4)
|
||||
lda.z call2.return
|
||||
// *ptr = call2(3,4)
|
||||
sta ptr
|
||||
@ -68,12 +66,12 @@ main: {
|
||||
}
|
||||
.segment RomCode
|
||||
// A stack based ROM function that will transfer all parameters and return values through the stack.
|
||||
// call1(byte zp(4) param1, byte register(A) param2)
|
||||
// call1(byte zp(2) param1, byte register(A) param2)
|
||||
call1: {
|
||||
.const OFFSET_STACK_PARAM1 = 1
|
||||
.const OFFSET_STACK_PARAM2 = 0
|
||||
.const OFFSET_STACK_RETURN = 1
|
||||
.label param1 = 4
|
||||
.label param1 = 2
|
||||
tsx
|
||||
lda STACK_BASE+OFFSET_STACK_PARAM1,x
|
||||
sta.z param1
|
||||
@ -88,15 +86,13 @@ call1: {
|
||||
rts
|
||||
}
|
||||
// A memory based ROM function that will transfer all parameters and return values through zeropage.
|
||||
// call2(byte zp(4) param1, byte zp(2) param2)
|
||||
// call2(byte register(X) param1, byte register(A) param2)
|
||||
call2: {
|
||||
.label return = 3
|
||||
.label param1 = 4
|
||||
.label param2 = 2
|
||||
.label return = 2
|
||||
// param1+param2
|
||||
lda.z param1
|
||||
stx.z $ff
|
||||
clc
|
||||
adc.z param2
|
||||
adc.z $ff
|
||||
// return param1+param2;
|
||||
sta.z return
|
||||
// }
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user