mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-11-23 08:32:39 +00:00
Rafactoring pass 2
This commit is contained in:
parent
27c6c3fb86
commit
2b26c813d9
@ -1,8 +1,8 @@
|
|||||||
lda #<{c1}
|
|
||||||
sta {z1}
|
|
||||||
lda #>{c1}
|
|
||||||
sta {z1}+1
|
|
||||||
lda {z2}
|
lda {z2}
|
||||||
sta {z1}+2
|
sta {z1}+2
|
||||||
lda {z2}+1
|
lda {z2}+1
|
||||||
sta {z1}+3
|
sta {z1}+3
|
||||||
|
lda #{c1}
|
||||||
|
sta {z1}
|
||||||
|
lda #0
|
||||||
|
sta {z1}+1
|
||||||
|
8
src/main/fragment/vduz1=vwuz2_dword_vwuc1.asm
Normal file
8
src/main/fragment/vduz1=vwuz2_dword_vwuc1.asm
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
lda #<{c1}
|
||||||
|
sta {z1}
|
||||||
|
lda #>{c1}
|
||||||
|
sta {z1}+1
|
||||||
|
lda {z2}
|
||||||
|
sta {z1}+2
|
||||||
|
lda {z2}+1
|
||||||
|
sta {z1}+3
|
@ -233,7 +233,7 @@ public class Compiler {
|
|||||||
List<Pass2SsaOptimization> optimizations = new ArrayList<>();
|
List<Pass2SsaOptimization> optimizations = new ArrayList<>();
|
||||||
optimizations.add(new PassNAddNumberTypeConversions(program));
|
optimizations.add(new PassNAddNumberTypeConversions(program));
|
||||||
optimizations.add(new PassNAddArrayNumberTypeConversions(program));
|
optimizations.add(new PassNAddArrayNumberTypeConversions(program));
|
||||||
optimizations.add(new PassNDowngradeBytePlusWord(program));
|
optimizations.add(new PassNDowngradeConstantTypeConversions(program));
|
||||||
optimizations.add(new PassNTypeInference(program));
|
optimizations.add(new PassNTypeInference(program));
|
||||||
optimizations.add(new PassNTypeIdSimplification(program));
|
optimizations.add(new PassNTypeIdSimplification(program));
|
||||||
optimizations.add(new Pass2SizeOfSimplification(program));
|
optimizations.add(new Pass2SizeOfSimplification(program));
|
||||||
|
@ -13,9 +13,9 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
/**
|
/**
|
||||||
* Downgrade any number expression cast that are part of a WORD+NUMBER expression to BYTE if the number is small enough to fit in the byte.
|
* Downgrade any number expression cast that are part of a WORD+NUMBER expression to BYTE if the number is small enough to fit in the byte.
|
||||||
*/
|
*/
|
||||||
public class PassNDowngradeBytePlusWord extends Pass2SsaOptimization {
|
public class PassNDowngradeConstantTypeConversions extends Pass2SsaOptimization {
|
||||||
|
|
||||||
public PassNDowngradeBytePlusWord(Program program) {
|
public PassNDowngradeConstantTypeConversions(Program program) {
|
||||||
super(program);
|
super(program);
|
||||||
}
|
}
|
||||||
|
|
@ -335,14 +335,13 @@ lin16u_gen: {
|
|||||||
sta step
|
sta step
|
||||||
lda stepf+1
|
lda stepf+1
|
||||||
sta step+1
|
sta step+1
|
||||||
lda #<0
|
|
||||||
sta val
|
|
||||||
sta val+1
|
|
||||||
lda min
|
lda min
|
||||||
sta val+2
|
sta val+2
|
||||||
lda min+1
|
lda min+1
|
||||||
sta val+3
|
sta val+3
|
||||||
lda #0
|
lda #0
|
||||||
|
sta val
|
||||||
|
sta val+1
|
||||||
sta i
|
sta i
|
||||||
sta i+1
|
sta i+1
|
||||||
b1:
|
b1:
|
||||||
|
Loading…
Reference in New Issue
Block a user