mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-01-11 04:29:53 +00:00
This commit is contained in:
parent
78d961fd19
commit
df62ca5c9f
13
src/test/ref/bitwise-not-1.asm
Normal file
13
src/test/ref/bitwise-not-1.asm
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// Test that bitwise NOT (~) is handled correctly
|
||||||
|
.pc = $801 "Basic"
|
||||||
|
:BasicUpstart(main)
|
||||||
|
.pc = $80d "Program"
|
||||||
|
main: {
|
||||||
|
.const b = $10^$ff
|
||||||
|
.label screen = $400
|
||||||
|
// *screen = b
|
||||||
|
lda #b
|
||||||
|
sta screen
|
||||||
|
// }
|
||||||
|
rts
|
||||||
|
}
|
8
src/test/ref/bitwise-not-1.cfg
Normal file
8
src/test/ref/bitwise-not-1.cfg
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
void main()
|
||||||
|
main: scope:[main] from
|
||||||
|
[0] *main::screen = main::b
|
||||||
|
to:main::@return
|
||||||
|
main::@return: scope:[main] from main
|
||||||
|
[1] return
|
||||||
|
to:@return
|
130
src/test/ref/bitwise-not-1.log
Normal file
130
src/test/ref/bitwise-not-1.log
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
|
||||||
|
CONTROL FLOW GRAPH SSA
|
||||||
|
|
||||||
|
void main()
|
||||||
|
main: scope:[main] from __start
|
||||||
|
*main::screen = main::b
|
||||||
|
to:main::@return
|
||||||
|
main::@return: scope:[main] from main
|
||||||
|
return
|
||||||
|
to:@return
|
||||||
|
|
||||||
|
void __start()
|
||||||
|
__start: scope:[__start] from
|
||||||
|
call main
|
||||||
|
to:__start::@1
|
||||||
|
__start::@1: scope:[__start] from __start
|
||||||
|
to:__start::@return
|
||||||
|
__start::@return: scope:[__start] from __start::@1
|
||||||
|
return
|
||||||
|
to:@return
|
||||||
|
|
||||||
|
SYMBOL TABLE SSA
|
||||||
|
void __start()
|
||||||
|
void main()
|
||||||
|
const byte main::b = (byte)~$10
|
||||||
|
const nomodify byte* main::screen = (byte*)$400
|
||||||
|
|
||||||
|
Simplifying constant pointer cast (byte*) 1024
|
||||||
|
Successful SSA optimization PassNCastSimplification
|
||||||
|
Removing unused procedure __start
|
||||||
|
Removing unused procedure block __start
|
||||||
|
Removing unused procedure block __start::@1
|
||||||
|
Removing unused procedure block __start::@return
|
||||||
|
Successful SSA optimization PassNEliminateEmptyStart
|
||||||
|
Finalized unsigned number type (byte) $10
|
||||||
|
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||||
|
Simplifying constant integer cast ~$10
|
||||||
|
Successful SSA optimization PassNCastSimplification
|
||||||
|
CALL GRAPH
|
||||||
|
|
||||||
|
Created 0 initial phi equivalence classes
|
||||||
|
Coalesced down to 0 phi equivalence classes
|
||||||
|
|
||||||
|
FINAL CONTROL FLOW GRAPH
|
||||||
|
|
||||||
|
void main()
|
||||||
|
main: scope:[main] from
|
||||||
|
[0] *main::screen = main::b
|
||||||
|
to:main::@return
|
||||||
|
main::@return: scope:[main] from main
|
||||||
|
[1] return
|
||||||
|
to:@return
|
||||||
|
|
||||||
|
|
||||||
|
VARIABLE REGISTER WEIGHTS
|
||||||
|
void main()
|
||||||
|
|
||||||
|
Initial phi equivalence classes
|
||||||
|
Complete equivalence classes
|
||||||
|
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||||
|
Statement [0] *main::screen = main::b [ ] ( [ ] { } ) always clobbers reg byte a
|
||||||
|
|
||||||
|
REGISTER UPLIFT SCOPES
|
||||||
|
Uplift Scope [main]
|
||||||
|
Uplift Scope []
|
||||||
|
|
||||||
|
Uplifting [main] best 15 combination
|
||||||
|
Uplifting [] best 15 combination
|
||||||
|
|
||||||
|
ASSEMBLER BEFORE OPTIMIZATION
|
||||||
|
// File Comments
|
||||||
|
// Test that bitwise NOT (~) is handled correctly
|
||||||
|
// Upstart
|
||||||
|
.pc = $801 "Basic"
|
||||||
|
:BasicUpstart(main)
|
||||||
|
.pc = $80d "Program"
|
||||||
|
// Global Constants & labels
|
||||||
|
// main
|
||||||
|
main: {
|
||||||
|
.const b = $10^$ff
|
||||||
|
.label screen = $400
|
||||||
|
// [0] *main::screen = main::b -- _deref_pbuc1=vbuc2
|
||||||
|
lda #b
|
||||||
|
sta screen
|
||||||
|
jmp __breturn
|
||||||
|
// main::@return
|
||||||
|
__breturn:
|
||||||
|
// [1] return
|
||||||
|
rts
|
||||||
|
}
|
||||||
|
// File Data
|
||||||
|
|
||||||
|
ASSEMBLER OPTIMIZATIONS
|
||||||
|
Removing instruction jmp __breturn
|
||||||
|
Succesful ASM optimization Pass5NextJumpElimination
|
||||||
|
Removing instruction __breturn:
|
||||||
|
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||||
|
|
||||||
|
FINAL SYMBOL TABLE
|
||||||
|
void main()
|
||||||
|
const byte main::b = ~$10
|
||||||
|
const nomodify byte* main::screen = (byte*) 1024
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
FINAL ASSEMBLER
|
||||||
|
Score: 12
|
||||||
|
|
||||||
|
// File Comments
|
||||||
|
// Test that bitwise NOT (~) is handled correctly
|
||||||
|
// Upstart
|
||||||
|
.pc = $801 "Basic"
|
||||||
|
:BasicUpstart(main)
|
||||||
|
.pc = $80d "Program"
|
||||||
|
// Global Constants & labels
|
||||||
|
// main
|
||||||
|
main: {
|
||||||
|
.const b = $10^$ff
|
||||||
|
.label screen = $400
|
||||||
|
// *screen = b
|
||||||
|
// [0] *main::screen = main::b -- _deref_pbuc1=vbuc2
|
||||||
|
lda #b
|
||||||
|
sta screen
|
||||||
|
// main::@return
|
||||||
|
// }
|
||||||
|
// [1] return
|
||||||
|
rts
|
||||||
|
}
|
||||||
|
// File Data
|
||||||
|
|
4
src/test/ref/bitwise-not-1.sym
Normal file
4
src/test/ref/bitwise-not-1.sym
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
void main()
|
||||||
|
const byte main::b = ~$10
|
||||||
|
const nomodify byte* main::screen = (byte*) 1024
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user