1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-12-26 03:32:23 +00:00

Working on deprecating lo/hi operators. Closes #667

This commit is contained in:
jespergravgaard 2021-06-13 07:57:15 +02:00
parent 0d2dfb87b3
commit 6850e4a3d9
5 changed files with 31 additions and 40 deletions

View File

@ -72,7 +72,7 @@ main: {
bcc !+
inc.z __4+1
!:
// byte ang_w = >(angle_w+0x0080)
// byte ang_w = BYTE1(angle_w+0x0080)
ldx.z __4+1
// diff(ang_w, *screen_ref)
ldy #0
@ -464,14 +464,14 @@ diff: {
// print_uint(word zp(4) w)
print_uint: {
.label w = 4
// print_uchar(>w)
// print_uchar(BYTE1(w))
ldx.z w+1
lda #<print_screen
sta.z print_char_cursor
lda #>print_screen
sta.z print_char_cursor+1
jsr print_uchar
// print_uchar(<w)
// print_uchar(BYTE0(w))
ldx.z w
jsr print_uchar
// }

View File

@ -816,7 +816,7 @@ void main()
byte~ main::$1
word~ main::$3
number~ main::$4
number~ main::$5
byte~ main::$5
byte~ main::$6
byte~ main::$7
bool~ main::$8
@ -854,7 +854,7 @@ byte* main::screen_ref#5
byte* main::screen_ref#6
number~ main::toD0181_$0
number~ main::toD0181_$1
number~ main::toD0181_$2
byte~ main::toD0181_$2
byte~ main::toD0181_$3
number~ main::toD0181_$4
number~ main::toD0181_$5
@ -1002,7 +1002,6 @@ Adding number conversion cast (unumber) $3fff in main::toD0181_$0 = main::toD018
Adding number conversion cast (unumber) main::toD0181_$0 in main::toD0181_$0 = main::toD0181_$7 & (unumber)$3fff
Adding number conversion cast (unumber) 4 in main::toD0181_$1 = main::toD0181_$0 * 4
Adding number conversion cast (unumber) main::toD0181_$1 in main::toD0181_$1 = main::toD0181_$0 * (unumber)4
Adding number conversion cast (unumber) main::toD0181_$2 in main::toD0181_$2 = > main::toD0181_$1
Adding number conversion cast (unumber) 4 in main::toD0181_$4 = main::toD0181_$3 / 4
Adding number conversion cast (unumber) main::toD0181_$4 in main::toD0181_$4 = main::toD0181_$3 / (unumber)4
Adding number conversion cast (unumber) $f in main::toD0181_$5 = main::toD0181_$4 & $f
@ -1010,7 +1009,6 @@ Adding number conversion cast (unumber) main::toD0181_$5 in main::toD0181_$5 = m
Adding number conversion cast (unumber) main::toD0181_$6 in main::toD0181_$6 = main::toD0181_$2 | main::toD0181_$5
Adding number conversion cast (unumber) $80 in main::$4 = main::angle_w#0 + $80
Adding number conversion cast (unumber) main::$4 in main::$4 = main::angle_w#0 + (unumber)$80
Adding number conversion cast (unumber) main::$5 in main::$5 = > main::$4
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast init_font_hex::charset#2[init_font_hex::idx#0] = (unumber)0
Inlining cast init_font_hex::charset#4[init_font_hex::idx#6] = (unumber)0
@ -1095,12 +1093,10 @@ Inferred type updated to word in atan2_16::$12 = $8000 - atan2_16::angle#9
Inferred type updated to byte in print_uchar::$2 = print_uchar::b#3 & $f
Inferred type updated to word in main::toD0181_$0 = main::toD0181_$7 & $3fff
Inferred type updated to word in main::toD0181_$1 = main::toD0181_$0 * 4
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
Inferred type updated to word in main::$4 = main::angle_w#0 + $80
Inferred type updated to byte in main::$5 = > main::$4
Inversing boolean not [59] atan2_16::$17 = atan2_16::yi#3 != 0 from [58] atan2_16::$16 = atan2_16::yi#3 == 0
Inversing boolean not [68] atan2_16::$11 = atan2_16::x#4 >= 0 from [67] atan2_16::$10 = atan2_16::x#4 < 0
Inversing boolean not [79] atan2_16::$19 = 0 == atan2_16::shift#4 from [78] atan2_16::$24 = 0 != atan2_16::shift#4
@ -2440,7 +2436,7 @@ main: {
bcc !+
inc.z __4+1
!:
// [14] main::ang_w#0 = > main::$4 -- vbuxx=_hi_vwuz1
// [14] main::ang_w#0 = > main::$4 -- vbuxx=_byte1_vwuz1
ldx.z __4+1
// [15] diff::bb1#0 = main::ang_w#0
// [16] diff::bb2#0 = *main::screen_ref#2 -- vbuaa=_deref_pbuz1
@ -3020,7 +3016,7 @@ diff: {
// print_uint(word zp(4) w)
print_uint: {
.label w = 4
// [103] print_uchar::b#0 = > print_uint::w#0 -- vbuxx=_hi_vwuz1
// [103] print_uchar::b#0 = > print_uint::w#0 -- vbuxx=_byte1_vwuz1
ldx.z w+1
// [104] call print_uchar
// [108] phi from print_uint to print_uchar [phi:print_uint->print_uchar]
@ -3035,7 +3031,7 @@ print_uint: {
jmp __b1
// print_uint::@1
__b1:
// [105] print_uchar::b#1 = < print_uint::w#0 -- vbuxx=_lo_vwuz1
// [105] print_uchar::b#1 = < print_uint::w#0 -- vbuxx=_byte0_vwuz1
ldx.z w
// [106] call print_uchar
// [108] phi from print_uint::@1 to print_uchar [phi:print_uint::@1->print_uchar]
@ -3588,8 +3584,8 @@ main: {
bcc !+
inc.z __4+1
!:
// byte ang_w = >(angle_w+0x0080)
// [14] main::ang_w#0 = > main::$4 -- vbuxx=_hi_vwuz1
// byte ang_w = BYTE1(angle_w+0x0080)
// [14] main::ang_w#0 = > main::$4 -- vbuxx=_byte1_vwuz1
ldx.z __4+1
// diff(ang_w, *screen_ref)
// [15] diff::bb1#0 = main::ang_w#0
@ -4150,8 +4146,8 @@ diff: {
// print_uint(word zp(4) w)
print_uint: {
.label w = 4
// print_uchar(>w)
// [103] print_uchar::b#0 = > print_uint::w#0 -- vbuxx=_hi_vwuz1
// print_uchar(BYTE1(w))
// [103] print_uchar::b#0 = > print_uint::w#0 -- vbuxx=_byte1_vwuz1
ldx.z w+1
// [104] call print_uchar
// [108] phi from print_uint to print_uchar [phi:print_uint->print_uchar]
@ -4163,8 +4159,8 @@ print_uint: {
// [108] phi print_uchar::b#2 = print_uchar::b#0 [phi:print_uint->print_uchar#1] -- register_copy
jsr print_uchar
// print_uint::@1
// print_uchar(<w)
// [105] print_uchar::b#1 = < print_uint::w#0 -- vbuxx=_lo_vwuz1
// print_uchar(BYTE0(w))
// [105] print_uchar::b#1 = < print_uint::w#0 -- vbuxx=_byte0_vwuz1
ldx.z w
// [106] call print_uchar
// [108] phi from print_uint::@1 to print_uchar [phi:print_uint::@1->print_uchar]

View File

@ -461,9 +461,8 @@ utoa: {
cpx #max_digits-1
bcc __b2
// *buffer++ = DIGITS[(char)value]
lda.z value
tay
lda DIGITS,y
ldx.z value
lda DIGITS,x
ldy #0
sta (buffer),y
// *buffer++ = DIGITS[(char)value];

File diff suppressed because one or more lines are too long

View File

@ -329,7 +329,7 @@ dword ultoa_append::value#1 value zp[4]:7 2.000000000002E12
dword ultoa_append::value#2 value zp[4]:7 5.0018333333416675E11
void utoa(word utoa::value , byte* utoa::buffer , byte utoa::radix)
byte~ utoa::$10 reg byte a 20002.0
byte~ utoa::$11 reg byte a 2002.0
byte~ utoa::$11 reg byte x 2002.0
byte* utoa::buffer
byte* utoa::buffer#11 buffer zp[2]:18 3000.4285714285716
byte* utoa::buffer#14 buffer zp[2]:18 15001.5
@ -414,7 +414,7 @@ reg byte a [ cputs::c#1 ]
zp[1]:34 [ legal::column#0 printf_number_buffer::buffer_sign#10 printf_number_buffer::buffer_sign#2 printf_number_buffer::buffer_sign#1 printf_number_buffer::buffer_sign#0 ]
reg byte a [ legal::return#0 ]
reg byte a [ queens::$2 ]
reg byte a [ utoa::$11 ]
reg byte x [ utoa::$11 ]
reg byte a [ utoa::$10 ]
zp[2]:35 [ utoa::digit_value#0 utoa_append::sub#0 memcpy::destination#2 memcpy::dst#2 memcpy::dst#4 memcpy::dst#1 ]
reg byte x [ legal::$0 ]