mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-04-09 21:37:31 +00:00
Implemented normal binary multiply for unsigned integers - mul8u().
This commit is contained in:
parent
a6f32bea13
commit
c936da289e
16
src/test/java/dk/camelot64/kickc/test/kc/multiply.kc
Normal file
16
src/test/java/dk/camelot64/kickc/test/kc/multiply.kc
Normal file
@ -0,0 +1,16 @@
|
||||
// Simple binary multiplication implementation
|
||||
|
||||
// Perform binary multiplication of two unsigned 8-bit bytes into a 16-bit unsigned word
|
||||
word mul8u(byte a, byte b) {
|
||||
word res = 0;
|
||||
word mb = b;
|
||||
while(a!=0) {
|
||||
if( (a&1) != 0) {
|
||||
res = res + mb;
|
||||
}
|
||||
a = a>>1;
|
||||
mb = mb<<1;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
// Test the fast multiplication library
|
||||
import "print.kc"
|
||||
import "multiply.kc"
|
||||
import "fastmultiply.kc"
|
||||
|
||||
byte* BGCOL = $d021;
|
||||
@ -9,9 +10,9 @@ void main() {
|
||||
print_cls();
|
||||
mulf_init();
|
||||
mulf_init_asm();
|
||||
multiply_tables_compare();
|
||||
multiply_results_compare();
|
||||
signed_multiply_results_compare();
|
||||
mulf_tables_cmp();
|
||||
mul8u_slowfast_compare();
|
||||
mul8s_slowfast_compare();
|
||||
}
|
||||
|
||||
// Slow multiplication of unsigned bytes
|
||||
@ -104,7 +105,7 @@ void mulf_init_asm() {
|
||||
|
||||
// Compare the ASM-based mul tables with the KC-based mul tables
|
||||
// Red screen on failure - green on success
|
||||
void multiply_tables_compare() {
|
||||
void mulf_tables_cmp() {
|
||||
byte* asm_sqr = mula_sqr1_lo;
|
||||
for( byte* kc_sqr=mulf_sqr1_lo; kc_sqr<mulf_sqr1_lo+512*4; kc_sqr++) {
|
||||
if(*kc_sqr != *asm_sqr) {
|
||||
@ -122,14 +123,22 @@ void multiply_tables_compare() {
|
||||
}
|
||||
|
||||
// Perform all possible byte multiplications (slow and fast) and compare the results
|
||||
void multiply_results_compare() {
|
||||
void mul8u_slowfast_compare() {
|
||||
for(byte a: 0..255) {
|
||||
for(byte b: 0..255) {
|
||||
word ms = muls8u(a, b);
|
||||
word ma = mulf8u(a,b);
|
||||
if(ms!=ma) {
|
||||
word mf = mulf8u(a,b);
|
||||
word mn = mul8u(a,b);
|
||||
byte ok = 1;
|
||||
if(ms!=mf) {
|
||||
ok = 0;
|
||||
}
|
||||
if(ms!=mn) {
|
||||
ok = 0;
|
||||
}
|
||||
if(ok==0) {
|
||||
*BGCOL = 2;
|
||||
multiply_error(a,b, ms, ma);
|
||||
multiply_error(a,b, ms, mn, mf);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -138,20 +147,22 @@ void multiply_results_compare() {
|
||||
print_ln();
|
||||
}
|
||||
|
||||
void multiply_error(byte a, byte b, word ms, word ma) {
|
||||
void multiply_error(byte a, byte b, word ms, word mn, word mf) {
|
||||
print_str("multiply mismatch @");
|
||||
print_byte(a);
|
||||
print_str("*@");
|
||||
print_byte(b);
|
||||
print_str(" slow:@");
|
||||
print_word(ms);
|
||||
print_str(" / fast asm:@");
|
||||
print_word(ma);
|
||||
print_str(" / normal:@");
|
||||
print_word(mn);
|
||||
print_str(" / fast:@");
|
||||
print_word(mf);
|
||||
print_ln();
|
||||
}
|
||||
|
||||
// Perform all possible signed byte multiplications (slow and fast) and compare the results
|
||||
void signed_multiply_results_compare() {
|
||||
void mul8s_slowfast_compare() {
|
||||
for(signed byte a = -128; a!=-128; a++) {
|
||||
for(signed byte b = -128; b!=-128; b++) {
|
||||
signed word ms = muls8s(a, b);
|
||||
|
@ -12,12 +12,12 @@ main: {
|
||||
jsr print_cls
|
||||
jsr mulf_init
|
||||
jsr mulf_init_asm
|
||||
jsr multiply_tables_compare
|
||||
jsr multiply_results_compare
|
||||
jsr signed_multiply_results_compare
|
||||
jsr mulf_tables_cmp
|
||||
jsr mul8u_slowfast_compare
|
||||
jsr mul8s_slowfast_compare
|
||||
rts
|
||||
}
|
||||
signed_multiply_results_compare: {
|
||||
mul8s_slowfast_compare: {
|
||||
.label ms = 8
|
||||
.label ma = $c
|
||||
.label b = 3
|
||||
@ -338,9 +338,10 @@ muls8s: {
|
||||
bne b5
|
||||
jmp b3
|
||||
}
|
||||
multiply_results_compare: {
|
||||
mul8u_slowfast_compare: {
|
||||
.label ms = 8
|
||||
.label ma = $c
|
||||
.label mf = $c
|
||||
.label mn = $e
|
||||
.label b = 3
|
||||
.label a = 2
|
||||
lda #0
|
||||
@ -354,20 +355,39 @@ multiply_results_compare: {
|
||||
lda a
|
||||
ldx b
|
||||
jsr mulf8u
|
||||
ldx a
|
||||
lda b
|
||||
jsr mul8u
|
||||
lda ms
|
||||
cmp ma
|
||||
cmp mf
|
||||
bne !+
|
||||
lda ms+1
|
||||
cmp ma+1
|
||||
beq b3
|
||||
cmp mf+1
|
||||
beq b6
|
||||
!:
|
||||
ldx #0
|
||||
jmp b3
|
||||
b6:
|
||||
ldx #1
|
||||
b3:
|
||||
lda ms
|
||||
cmp mn
|
||||
bne !+
|
||||
lda ms+1
|
||||
cmp mn+1
|
||||
beq b4
|
||||
!:
|
||||
ldx #0
|
||||
b4:
|
||||
cpx #0
|
||||
bne b5
|
||||
lda #2
|
||||
sta BGCOL
|
||||
ldx a
|
||||
jsr multiply_error
|
||||
breturn:
|
||||
rts
|
||||
b3:
|
||||
b5:
|
||||
inc b
|
||||
lda b
|
||||
bne b2
|
||||
@ -386,7 +406,8 @@ multiply_results_compare: {
|
||||
multiply_error: {
|
||||
.label b = 3
|
||||
.label ms = 8
|
||||
.label ma = $c
|
||||
.label mn = $e
|
||||
.label mf = $c
|
||||
lda #<str
|
||||
sta print_str.str
|
||||
lda #>str
|
||||
@ -411,9 +432,19 @@ multiply_error: {
|
||||
lda #>str3
|
||||
sta print_str.str+1
|
||||
jsr print_str
|
||||
lda ma
|
||||
lda mn
|
||||
sta print_word.w
|
||||
lda ma+1
|
||||
lda mn+1
|
||||
sta print_word.w+1
|
||||
jsr print_word
|
||||
lda #<str4
|
||||
sta print_str.str
|
||||
lda #>str4
|
||||
sta print_str.str+1
|
||||
jsr print_str
|
||||
lda mf
|
||||
sta print_word.w
|
||||
lda mf+1
|
||||
sta print_word.w+1
|
||||
jsr print_word
|
||||
jsr print_ln
|
||||
@ -421,7 +452,41 @@ multiply_error: {
|
||||
str: .text "multiply mismatch @"
|
||||
str1: .text "*@"
|
||||
str2: .text " slow:@"
|
||||
str3: .text " / fast asm:@"
|
||||
str3: .text " / normal:@"
|
||||
str4: .text " / fast:@"
|
||||
}
|
||||
mul8u: {
|
||||
.label mb = 6
|
||||
.label res = $e
|
||||
.label return = $e
|
||||
sta mb
|
||||
lda #0
|
||||
sta mb+1
|
||||
sta res
|
||||
sta res+1
|
||||
b1:
|
||||
cpx #0
|
||||
bne b2
|
||||
rts
|
||||
b2:
|
||||
txa
|
||||
and #1
|
||||
cmp #0
|
||||
beq b4
|
||||
lda res
|
||||
clc
|
||||
adc mb
|
||||
sta res
|
||||
lda res+1
|
||||
adc mb+1
|
||||
sta res+1
|
||||
b4:
|
||||
txa
|
||||
lsr
|
||||
tax
|
||||
asl mb
|
||||
rol mb+1
|
||||
jmp b1
|
||||
}
|
||||
muls8u: {
|
||||
.label return = 8
|
||||
@ -452,7 +517,7 @@ muls8u: {
|
||||
b1:
|
||||
rts
|
||||
}
|
||||
multiply_tables_compare: {
|
||||
mulf_tables_cmp: {
|
||||
.label asm_sqr = 8
|
||||
.label kc_sqr = 4
|
||||
lda #<mula_sqr1_lo
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
(label) @20
|
||||
(label) @21
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(byte*) BGCOL
|
||||
@ -7,22 +7,22 @@
|
||||
(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) 1024
|
||||
(byte*) char_cursor
|
||||
(byte*) char_cursor#1 char_cursor zp ZP_WORD:10 11.0
|
||||
(byte*) char_cursor#122 char_cursor zp ZP_WORD:10 1.6944444444444446
|
||||
(byte*) char_cursor#123 char_cursor zp ZP_WORD:10 5.25
|
||||
(byte*) char_cursor#124 char_cursor zp ZP_WORD:10 3.0
|
||||
(byte*) char_cursor#126 char_cursor zp ZP_WORD:10 3.0
|
||||
(byte*) char_cursor#128 char_cursor zp ZP_WORD:10 6.0
|
||||
(byte*) char_cursor#129 char_cursor zp ZP_WORD:10 3.9999999999999996
|
||||
(byte*) char_cursor#141 char_cursor zp ZP_WORD:10 24.0
|
||||
(byte*) char_cursor#17 char_cursor zp ZP_WORD:10 0.7894736842105261
|
||||
(byte*~) char_cursor#176 char_cursor zp ZP_WORD:10 4.0
|
||||
(byte*~) char_cursor#180 char_cursor zp ZP_WORD:10 4.0
|
||||
(byte*~) char_cursor#201 char_cursor zp ZP_WORD:10 4.0
|
||||
(byte*) char_cursor#30 char_cursor zp ZP_WORD:10 0.27586206896551724
|
||||
(byte*) char_cursor#78 char_cursor zp ZP_WORD:10 6.0
|
||||
(byte*) char_cursor#126 char_cursor zp ZP_WORD:10 1.6578947368421046
|
||||
(byte*) char_cursor#127 char_cursor zp ZP_WORD:10 5.25
|
||||
(byte*) char_cursor#128 char_cursor zp ZP_WORD:10 3.0
|
||||
(byte*) char_cursor#130 char_cursor zp ZP_WORD:10 3.0
|
||||
(byte*) char_cursor#132 char_cursor zp ZP_WORD:10 7.0
|
||||
(byte*) char_cursor#133 char_cursor zp ZP_WORD:10 3.9999999999999996
|
||||
(byte*) char_cursor#145 char_cursor zp ZP_WORD:10 26.0
|
||||
(byte*) char_cursor#17 char_cursor zp ZP_WORD:10 0.8000000000000002
|
||||
(byte*~) char_cursor#179 char_cursor zp ZP_WORD:10 4.0
|
||||
(byte*~) char_cursor#187 char_cursor zp ZP_WORD:10 4.0
|
||||
(byte*~) char_cursor#212 char_cursor zp ZP_WORD:10 4.0
|
||||
(byte*) char_cursor#30 char_cursor zp ZP_WORD:10 0.1951219512195122
|
||||
(byte*) char_cursor#80 char_cursor zp ZP_WORD:10 6.0
|
||||
(byte*) line_cursor
|
||||
(byte*) line_cursor#1 line_cursor zp ZP_WORD:4 0.8181818181818181
|
||||
(byte*) line_cursor#10 line_cursor zp ZP_WORD:4 0.1276595744680851
|
||||
(byte*) line_cursor#10 line_cursor zp ZP_WORD:4 0.09523809523809523
|
||||
(byte*) line_cursor#23 line_cursor zp ZP_WORD:4 24.0
|
||||
(byte*) line_cursor#45 line_cursor zp ZP_WORD:4 10.0
|
||||
(void()) main()
|
||||
@ -32,6 +32,83 @@
|
||||
(label) main::@4
|
||||
(label) main::@5
|
||||
(label) main::@return
|
||||
(void()) mul8s_slowfast_compare()
|
||||
(label) mul8s_slowfast_compare::@1
|
||||
(label) mul8s_slowfast_compare::@11
|
||||
(label) mul8s_slowfast_compare::@2
|
||||
(label) mul8s_slowfast_compare::@3
|
||||
(label) mul8s_slowfast_compare::@4
|
||||
(label) mul8s_slowfast_compare::@6
|
||||
(label) mul8s_slowfast_compare::@7
|
||||
(label) mul8s_slowfast_compare::@8
|
||||
(label) mul8s_slowfast_compare::@9
|
||||
(label) mul8s_slowfast_compare::@return
|
||||
(signed byte) mul8s_slowfast_compare::a
|
||||
(signed byte) mul8s_slowfast_compare::a#1 a zp ZP_BYTE:2 16.5
|
||||
(signed byte) mul8s_slowfast_compare::a#6 a zp ZP_BYTE:2 14.125
|
||||
(signed byte) mul8s_slowfast_compare::b
|
||||
(signed byte) mul8s_slowfast_compare::b#1 b zp ZP_BYTE:3 151.5
|
||||
(signed byte) mul8s_slowfast_compare::b#2 b zp ZP_BYTE:3 29.0
|
||||
(signed word) mul8s_slowfast_compare::ma
|
||||
(signed word) mul8s_slowfast_compare::ma#0 ma zp ZP_WORD:12 34.0
|
||||
(signed word) mul8s_slowfast_compare::ms
|
||||
(signed word) mul8s_slowfast_compare::ms#0 ms zp ZP_WORD:8 20.4
|
||||
(const string) mul8s_slowfast_compare::str str = (string) "signed multiply results match!@"
|
||||
(word()) mul8u((byte) mul8u::a , (byte) mul8u::b)
|
||||
(byte~) mul8u::$1 reg byte a 2002.0
|
||||
(label) mul8u::@1
|
||||
(label) mul8u::@2
|
||||
(label) mul8u::@4
|
||||
(label) mul8u::@7
|
||||
(label) mul8u::@return
|
||||
(byte) mul8u::a
|
||||
(byte) mul8u::a#0 reg byte x 1001.0
|
||||
(byte) mul8u::a#1 reg byte x 34.33333333333333
|
||||
(byte) mul8u::a#2 reg byte x 667.6666666666667
|
||||
(byte) mul8u::b
|
||||
(byte) mul8u::b#0 reg byte a 103.0
|
||||
(word) mul8u::mb
|
||||
(word) mul8u::mb#0 mb zp ZP_WORD:6 4.0
|
||||
(word) mul8u::mb#1 mb zp ZP_WORD:6 2002.0
|
||||
(word) mul8u::mb#2 mb zp ZP_WORD:6 429.2857142857143
|
||||
(word) mul8u::res
|
||||
(word) mul8u::res#1 res zp ZP_WORD:14 2002.0
|
||||
(word) mul8u::res#2 res zp ZP_WORD:14 517.3333333333334
|
||||
(word) mul8u::res#6 res zp ZP_WORD:14 1001.0
|
||||
(word) mul8u::return
|
||||
(word) mul8u::return#2 return zp ZP_WORD:14 202.0
|
||||
(void()) mul8u_slowfast_compare()
|
||||
(label) mul8u_slowfast_compare::@1
|
||||
(label) mul8u_slowfast_compare::@10
|
||||
(label) mul8u_slowfast_compare::@11
|
||||
(label) mul8u_slowfast_compare::@12
|
||||
(label) mul8u_slowfast_compare::@13
|
||||
(label) mul8u_slowfast_compare::@14
|
||||
(label) mul8u_slowfast_compare::@16
|
||||
(label) mul8u_slowfast_compare::@2
|
||||
(label) mul8u_slowfast_compare::@20
|
||||
(label) mul8u_slowfast_compare::@3
|
||||
(label) mul8u_slowfast_compare::@4
|
||||
(label) mul8u_slowfast_compare::@5
|
||||
(label) mul8u_slowfast_compare::@6
|
||||
(label) mul8u_slowfast_compare::@8
|
||||
(label) mul8u_slowfast_compare::@return
|
||||
(byte) mul8u_slowfast_compare::a
|
||||
(byte) mul8u_slowfast_compare::a#1 a zp ZP_BYTE:2 16.5
|
||||
(byte) mul8u_slowfast_compare::a#7 a zp ZP_BYTE:2 12.11111111111111
|
||||
(byte) mul8u_slowfast_compare::b
|
||||
(byte) mul8u_slowfast_compare::b#1 b zp ZP_BYTE:3 151.5
|
||||
(byte) mul8u_slowfast_compare::b#10 b zp ZP_BYTE:3 20.279999999999998
|
||||
(word) mul8u_slowfast_compare::mf
|
||||
(word) mul8u_slowfast_compare::mf#0 mf zp ZP_WORD:12 11.333333333333332
|
||||
(word) mul8u_slowfast_compare::mn
|
||||
(word) mul8u_slowfast_compare::mn#0 mn zp ZP_WORD:14 17.0
|
||||
(word) mul8u_slowfast_compare::ms
|
||||
(word) mul8u_slowfast_compare::ms#0 ms zp ZP_WORD:8 14.523809523809522
|
||||
(byte) mul8u_slowfast_compare::ok
|
||||
(byte) mul8u_slowfast_compare::ok#3 reg byte x 202.0
|
||||
(byte) mul8u_slowfast_compare::ok#4 reg byte x 33.666666666666664
|
||||
(const string) mul8u_slowfast_compare::str str = (string) "multiply results match!@"
|
||||
(byte[512]) mula_sqr1_hi
|
||||
(const byte[512]) mula_sqr1_hi#0 mula_sqr1_hi = { fill( 512, 0) }
|
||||
(byte[512]) mula_sqr1_lo
|
||||
@ -68,11 +145,11 @@
|
||||
(byte) mulf8u::a
|
||||
(byte) mulf8u::a#1 reg byte a 101.0
|
||||
(byte) mulf8u::a#2 reg byte a 105.0
|
||||
(byte~) mulf8u::a#3 reg byte a 2.0
|
||||
(byte~) mulf8u::a#4 reg byte a 2.0
|
||||
(byte) mulf8u::b
|
||||
(byte) mulf8u::b#1 reg byte x 202.0
|
||||
(byte) mulf8u::b#2 reg byte x 52.5
|
||||
(byte~) mulf8u::b#3 reg byte x 4.0
|
||||
(byte~) mulf8u::b#4 reg byte x 4.0
|
||||
(byte*) mulf8u::memA
|
||||
(const byte*) mulf8u::memA#0 memA = ((byte*))(byte/word/signed word/dword/signed dword) 254
|
||||
(byte*) mulf8u::memB
|
||||
@ -135,6 +212,25 @@
|
||||
(const byte[512]) mulf_sqr2_hi#0 mulf_sqr2_hi = { fill( 512, 0) }
|
||||
(byte[512]) mulf_sqr2_lo
|
||||
(const byte[512]) mulf_sqr2_lo#0 mulf_sqr2_lo = { fill( 512, 0) }
|
||||
(void()) mulf_tables_cmp()
|
||||
(label) mulf_tables_cmp::@1
|
||||
(label) mulf_tables_cmp::@10
|
||||
(label) mulf_tables_cmp::@2
|
||||
(label) mulf_tables_cmp::@3
|
||||
(label) mulf_tables_cmp::@5
|
||||
(label) mulf_tables_cmp::@6
|
||||
(label) mulf_tables_cmp::@7
|
||||
(label) mulf_tables_cmp::@8
|
||||
(label) mulf_tables_cmp::@return
|
||||
(byte*) mulf_tables_cmp::asm_sqr
|
||||
(byte*) mulf_tables_cmp::asm_sqr#1 asm_sqr zp ZP_WORD:8 7.333333333333333
|
||||
(byte*) mulf_tables_cmp::asm_sqr#2 asm_sqr zp ZP_WORD:8 8.25
|
||||
(byte*) mulf_tables_cmp::kc_sqr
|
||||
(byte*) mulf_tables_cmp::kc_sqr#1 kc_sqr zp ZP_WORD:4 16.5
|
||||
(byte*) mulf_tables_cmp::kc_sqr#2 kc_sqr zp ZP_WORD:4 3.666666666666667
|
||||
(const string) mulf_tables_cmp::str str = (string) "multiply table mismatch at @"
|
||||
(const string) mulf_tables_cmp::str1 str1 = (string) " / @"
|
||||
(const string) mulf_tables_cmp::str2 str2 = (string) "multiply tables match!@"
|
||||
(signed word()) muls8s((signed byte) muls8s::a , (signed byte) muls8s::b)
|
||||
(label) muls8s::@1
|
||||
(label) muls8s::@2
|
||||
@ -176,8 +272,9 @@
|
||||
(word) muls8u::return
|
||||
(word) muls8u::return#0 return zp ZP_WORD:8 367.33333333333337
|
||||
(word) muls8u::return#2 return zp ZP_WORD:8 202.0
|
||||
(void()) multiply_error((byte) multiply_error::a , (byte) multiply_error::b , (word) multiply_error::ms , (word) multiply_error::ma)
|
||||
(void()) multiply_error((byte) multiply_error::a , (byte) multiply_error::b , (word) multiply_error::ms , (word) multiply_error::mn , (word) multiply_error::mf)
|
||||
(label) multiply_error::@1
|
||||
(label) multiply_error::@10
|
||||
(label) multiply_error::@2
|
||||
(label) multiply_error::@3
|
||||
(label) multiply_error::@4
|
||||
@ -185,60 +282,23 @@
|
||||
(label) multiply_error::@6
|
||||
(label) multiply_error::@7
|
||||
(label) multiply_error::@8
|
||||
(label) multiply_error::@9
|
||||
(label) multiply_error::@return
|
||||
(byte) multiply_error::a
|
||||
(byte) multiply_error::a#0 reg byte x 0.6666666666666666
|
||||
(byte) multiply_error::a#0 reg byte x 0.5714285714285714
|
||||
(byte) multiply_error::b
|
||||
(byte) multiply_error::b#0 b zp ZP_BYTE:3 0.4444444444444444
|
||||
(word) multiply_error::ma
|
||||
(word) multiply_error::ma#0 ma zp ZP_WORD:12 0.26666666666666666
|
||||
(byte) multiply_error::b#0 b zp ZP_BYTE:3 0.4
|
||||
(word) multiply_error::mf
|
||||
(word) multiply_error::mf#0 mf zp ZP_WORD:12 0.21052631578947367
|
||||
(word) multiply_error::mn
|
||||
(word) multiply_error::mn#0 mn zp ZP_WORD:14 0.25
|
||||
(word) multiply_error::ms
|
||||
(word) multiply_error::ms#0 ms zp ZP_WORD:8 0.3333333333333333
|
||||
(word) multiply_error::ms#0 ms zp ZP_WORD:8 0.3076923076923077
|
||||
(const string) multiply_error::str str = (string) "multiply mismatch @"
|
||||
(const string) multiply_error::str1 str1 = (string) "*@"
|
||||
(const string) multiply_error::str2 str2 = (string) " slow:@"
|
||||
(const string) multiply_error::str3 str3 = (string) " / fast asm:@"
|
||||
(void()) multiply_results_compare()
|
||||
(label) multiply_results_compare::@1
|
||||
(label) multiply_results_compare::@11
|
||||
(label) multiply_results_compare::@2
|
||||
(label) multiply_results_compare::@3
|
||||
(label) multiply_results_compare::@4
|
||||
(label) multiply_results_compare::@6
|
||||
(label) multiply_results_compare::@7
|
||||
(label) multiply_results_compare::@8
|
||||
(label) multiply_results_compare::@9
|
||||
(label) multiply_results_compare::@return
|
||||
(byte) multiply_results_compare::a
|
||||
(byte) multiply_results_compare::a#1 a zp ZP_BYTE:2 16.5
|
||||
(byte) multiply_results_compare::a#6 a zp ZP_BYTE:2 14.125
|
||||
(byte) multiply_results_compare::b
|
||||
(byte) multiply_results_compare::b#1 b zp ZP_BYTE:3 151.5
|
||||
(byte) multiply_results_compare::b#2 b zp ZP_BYTE:3 29.0
|
||||
(word) multiply_results_compare::ma
|
||||
(word) multiply_results_compare::ma#0 ma zp ZP_WORD:12 34.0
|
||||
(word) multiply_results_compare::ms
|
||||
(word) multiply_results_compare::ms#0 ms zp ZP_WORD:8 20.4
|
||||
(const string) multiply_results_compare::str str = (string) "multiply results match!@"
|
||||
(void()) multiply_tables_compare()
|
||||
(label) multiply_tables_compare::@1
|
||||
(label) multiply_tables_compare::@10
|
||||
(label) multiply_tables_compare::@2
|
||||
(label) multiply_tables_compare::@3
|
||||
(label) multiply_tables_compare::@5
|
||||
(label) multiply_tables_compare::@6
|
||||
(label) multiply_tables_compare::@7
|
||||
(label) multiply_tables_compare::@8
|
||||
(label) multiply_tables_compare::@return
|
||||
(byte*) multiply_tables_compare::asm_sqr
|
||||
(byte*) multiply_tables_compare::asm_sqr#1 asm_sqr zp ZP_WORD:8 7.333333333333333
|
||||
(byte*) multiply_tables_compare::asm_sqr#2 asm_sqr zp ZP_WORD:8 8.25
|
||||
(byte*) multiply_tables_compare::kc_sqr
|
||||
(byte*) multiply_tables_compare::kc_sqr#1 kc_sqr zp ZP_WORD:4 16.5
|
||||
(byte*) multiply_tables_compare::kc_sqr#2 kc_sqr zp ZP_WORD:4 3.666666666666667
|
||||
(const string) multiply_tables_compare::str str = (string) "multiply table mismatch at @"
|
||||
(const string) multiply_tables_compare::str1 str1 = (string) " / @"
|
||||
(const string) multiply_tables_compare::str2 str2 = (string) "multiply tables match!@"
|
||||
(const string) multiply_error::str3 str3 = (string) " / normal:@"
|
||||
(const string) multiply_error::str4 str4 = (string) " / fast:@"
|
||||
(void()) print_byte((byte) print_byte::b)
|
||||
(byte~) print_byte::$0 reg byte a 4.0
|
||||
(byte~) print_byte::$2 reg byte a 4.0
|
||||
@ -285,8 +345,8 @@
|
||||
(label) print_str::@return
|
||||
(byte*) print_str::str
|
||||
(byte*) print_str::str#0 str zp ZP_WORD:6 22.0
|
||||
(byte*) print_str::str#14 str zp ZP_WORD:6 11.5
|
||||
(byte*) print_str::str#16 str zp ZP_WORD:6 2.0
|
||||
(byte*) print_str::str#15 str zp ZP_WORD:6 11.5
|
||||
(byte*) print_str::str#17 str zp ZP_WORD:6 2.0
|
||||
(void()) print_sword((signed word) print_sword::w)
|
||||
(label) print_sword::@1
|
||||
(label) print_sword::@2
|
||||
@ -302,11 +362,12 @@
|
||||
(label) print_word::@1
|
||||
(label) print_word::@return
|
||||
(word) print_word::w
|
||||
(word~) print_word::w#10 w zp ZP_WORD:8 4.0
|
||||
(word~) print_word::w#11 w zp ZP_WORD:8 4.0
|
||||
(word~) print_word::w#13 w zp ZP_WORD:8 4.0
|
||||
(word) print_word::w#3 w zp ZP_WORD:8 4.0
|
||||
(word) print_word::w#4 w zp ZP_WORD:8 4.0
|
||||
(word) print_word::w#5 w zp ZP_WORD:8 4.666666666666666
|
||||
(word) print_word::w#5 w zp ZP_WORD:8 4.0
|
||||
(word) print_word::w#6 w zp ZP_WORD:8 5.333333333333333
|
||||
(word~) print_word::w#8 w zp ZP_WORD:8 4.0
|
||||
(word~) print_word::w#9 w zp ZP_WORD:8 4.0
|
||||
(void()) signed_multiply_error((signed byte) signed_multiply_error::a , (signed byte) signed_multiply_error::b , (signed word) signed_multiply_error::ms , (signed word) signed_multiply_error::ma)
|
||||
(label) signed_multiply_error::@1
|
||||
@ -330,43 +391,24 @@
|
||||
(const string) signed_multiply_error::str1 str1 = (string) "*@"
|
||||
(const string) signed_multiply_error::str2 str2 = (string) " slow:@"
|
||||
(const string) signed_multiply_error::str3 str3 = (string) " / fast asm:@"
|
||||
(void()) signed_multiply_results_compare()
|
||||
(label) signed_multiply_results_compare::@1
|
||||
(label) signed_multiply_results_compare::@11
|
||||
(label) signed_multiply_results_compare::@2
|
||||
(label) signed_multiply_results_compare::@3
|
||||
(label) signed_multiply_results_compare::@4
|
||||
(label) signed_multiply_results_compare::@6
|
||||
(label) signed_multiply_results_compare::@7
|
||||
(label) signed_multiply_results_compare::@8
|
||||
(label) signed_multiply_results_compare::@9
|
||||
(label) signed_multiply_results_compare::@return
|
||||
(signed byte) signed_multiply_results_compare::a
|
||||
(signed byte) signed_multiply_results_compare::a#1 a zp ZP_BYTE:2 16.5
|
||||
(signed byte) signed_multiply_results_compare::a#6 a zp ZP_BYTE:2 14.125
|
||||
(signed byte) signed_multiply_results_compare::b
|
||||
(signed byte) signed_multiply_results_compare::b#1 b zp ZP_BYTE:3 151.5
|
||||
(signed byte) signed_multiply_results_compare::b#2 b zp ZP_BYTE:3 29.0
|
||||
(signed word) signed_multiply_results_compare::ma
|
||||
(signed word) signed_multiply_results_compare::ma#0 ma zp ZP_WORD:12 34.0
|
||||
(signed word) signed_multiply_results_compare::ms
|
||||
(signed word) signed_multiply_results_compare::ms#0 ms zp ZP_WORD:8 20.4
|
||||
(const string) signed_multiply_results_compare::str str = (string) "signed multiply results match!@"
|
||||
|
||||
zp ZP_BYTE:2 [ signed_multiply_results_compare::a#6 signed_multiply_results_compare::a#1 muls8s::a#0 multiply_results_compare::a#6 multiply_results_compare::a#1 muls8u::a#0 mulf_init::x_2#3 mulf_init::x_2#2 mulf_init::x_2#1 mulf_init::dir#2 mulf_init::dir#3 ]
|
||||
zp ZP_BYTE:3 [ signed_multiply_results_compare::b#2 signed_multiply_results_compare::b#1 mulf8s::b#0 signed_multiply_error::b#0 multiply_results_compare::b#2 multiply_results_compare::b#1 multiply_error::b#0 ]
|
||||
zp ZP_WORD:4 [ line_cursor#23 line_cursor#45 line_cursor#10 line_cursor#1 multiply_tables_compare::kc_sqr#2 multiply_tables_compare::kc_sqr#1 mulf_init::sqr1_lo#2 mulf_init::sqr1_lo#1 mulf_init::sqr2_lo#2 mulf_init::sqr2_lo#1 print_cls::sc#2 print_cls::sc#1 ]
|
||||
zp ZP_WORD:6 [ print_str::str#14 print_str::str#16 print_str::str#0 mulf_init::sqr1_hi#2 mulf_init::sqr1_hi#1 mulf_init::sqr2_hi#2 mulf_init::sqr2_hi#1 ]
|
||||
zp ZP_WORD:8 [ print_sword::w#4 print_sword::w#3 print_sword::w#1 print_sword::w#2 print_sword::w#0 print_word::w#5 print_word::w#3 print_word::w#4 print_word::w#9 print_word::w#10 print_word::w#11 multiply_tables_compare::asm_sqr#2 multiply_tables_compare::asm_sqr#1 signed_multiply_error::ms#0 signed_multiply_results_compare::ms#0 muls8s::return#2 muls8s::m#5 muls8s::return#0 muls8s::m#3 muls8s::m#1 muls8s::m#2 multiply_error::ms#0 multiply_results_compare::ms#0 muls8u::return#2 muls8u::return#0 muls8u::m#3 muls8u::m#1 mulf_init::sqr#3 mulf_init::sqr#4 mulf_init::sqr#1 mulf_init::sqr#2 ]
|
||||
zp ZP_BYTE:2 [ mul8s_slowfast_compare::a#6 mul8s_slowfast_compare::a#1 muls8s::a#0 mul8u_slowfast_compare::a#7 mul8u_slowfast_compare::a#1 muls8u::a#0 mulf_init::x_2#3 mulf_init::x_2#2 mulf_init::x_2#1 mulf_init::dir#2 mulf_init::dir#3 ]
|
||||
zp ZP_BYTE:3 [ mul8s_slowfast_compare::b#2 mul8s_slowfast_compare::b#1 mulf8s::b#0 signed_multiply_error::b#0 mul8u_slowfast_compare::b#10 mul8u_slowfast_compare::b#1 multiply_error::b#0 ]
|
||||
zp ZP_WORD:4 [ line_cursor#23 line_cursor#45 line_cursor#1 line_cursor#10 mulf_tables_cmp::kc_sqr#2 mulf_tables_cmp::kc_sqr#1 mulf_init::sqr1_lo#2 mulf_init::sqr1_lo#1 mulf_init::sqr2_lo#2 mulf_init::sqr2_lo#1 print_cls::sc#2 print_cls::sc#1 ]
|
||||
zp ZP_WORD:6 [ print_str::str#15 print_str::str#17 print_str::str#0 mul8u::mb#2 mul8u::mb#0 mul8u::mb#1 mulf_init::sqr1_hi#2 mulf_init::sqr1_hi#1 mulf_init::sqr2_hi#2 mulf_init::sqr2_hi#1 ]
|
||||
zp ZP_WORD:8 [ print_sword::w#4 print_sword::w#3 print_sword::w#1 print_sword::w#2 print_sword::w#0 print_word::w#6 print_word::w#8 print_word::w#9 print_word::w#3 print_word::w#4 print_word::w#5 print_word::w#13 mulf_tables_cmp::asm_sqr#2 mulf_tables_cmp::asm_sqr#1 signed_multiply_error::ms#0 mul8s_slowfast_compare::ms#0 muls8s::return#2 muls8s::m#5 muls8s::return#0 muls8s::m#3 muls8s::m#1 muls8s::m#2 multiply_error::ms#0 mul8u_slowfast_compare::ms#0 muls8u::return#2 muls8u::return#0 muls8u::m#3 muls8u::m#1 mulf_init::sqr#3 mulf_init::sqr#4 mulf_init::sqr#1 mulf_init::sqr#2 ]
|
||||
reg byte x [ print_byte::b#5 print_byte::b#3 print_byte::b#4 print_byte::b#9 print_byte::b#1 print_byte::b#2 ]
|
||||
reg byte a [ print_char::ch#4 print_char::ch#2 print_char::ch#3 ]
|
||||
zp ZP_WORD:10 [ char_cursor#78 char_cursor#129 char_cursor#128 char_cursor#124 char_cursor#141 char_cursor#30 char_cursor#123 char_cursor#17 char_cursor#122 char_cursor#176 char_cursor#180 char_cursor#1 char_cursor#126 char_cursor#201 ]
|
||||
zp ZP_WORD:10 [ char_cursor#80 char_cursor#133 char_cursor#132 char_cursor#128 char_cursor#145 char_cursor#179 char_cursor#30 char_cursor#127 char_cursor#126 char_cursor#17 char_cursor#187 char_cursor#1 char_cursor#130 char_cursor#212 ]
|
||||
reg byte x [ print_sbyte::b#4 print_sbyte::b#3 print_sbyte::b#1 print_sbyte::b#2 print_sbyte::b#0 ]
|
||||
zp ZP_WORD:12 [ mulf8s::m#4 mulf8s::m#5 mulf8s::m#1 mulf8s::m#0 mulf8s::m#2 mulf8s::return#2 signed_multiply_results_compare::ma#0 signed_multiply_error::ma#0 mulf8u::return#2 mulf8u::return#0 mulf8u::return#3 multiply_results_compare::ma#0 multiply_error::ma#0 ]
|
||||
reg byte a [ mulf8u::a#2 mulf8u::a#3 mulf8u::a#1 ]
|
||||
reg byte x [ mulf8u::b#2 mulf8u::b#3 mulf8u::b#1 ]
|
||||
zp ZP_WORD:12 [ mulf8s::m#4 mulf8s::m#5 mulf8s::m#1 mulf8s::m#0 mulf8s::m#2 mulf8s::return#2 mul8s_slowfast_compare::ma#0 signed_multiply_error::ma#0 mulf8u::return#2 mulf8u::return#0 mulf8u::return#3 mul8u_slowfast_compare::mf#0 multiply_error::mf#0 ]
|
||||
reg byte a [ mulf8u::a#2 mulf8u::a#1 mulf8u::a#4 ]
|
||||
reg byte x [ mulf8u::b#2 mulf8u::b#1 mulf8u::b#4 ]
|
||||
reg byte y [ muls8s::i#2 muls8s::i#1 ]
|
||||
reg byte y [ muls8s::j#2 muls8s::j#1 ]
|
||||
reg byte x [ mul8u_slowfast_compare::ok#3 mul8u_slowfast_compare::ok#4 ]
|
||||
reg byte x [ mul8u::a#2 mul8u::a#1 mul8u::a#0 ]
|
||||
zp ZP_WORD:14 [ mul8u::res#2 mul8u::res#6 mul8u::res#1 mul8u::return#2 mul8u_slowfast_compare::mn#0 multiply_error::mn#0 ]
|
||||
reg byte y [ muls8u::i#2 muls8u::i#1 ]
|
||||
reg byte x [ mulf_init::c#2 mulf_init::c#1 ]
|
||||
reg byte x [ mulf_init::x_255#2 mulf_init::x_255#1 ]
|
||||
@ -380,7 +422,9 @@ reg byte a [ mulf8s::$16 ]
|
||||
reg byte a [ mulf8s::$12 ]
|
||||
reg byte a [ mulf8s::$17 ]
|
||||
reg byte x [ muls8u::b#0 ]
|
||||
reg byte a [ mul8u::b#0 ]
|
||||
reg byte x [ multiply_error::a#0 ]
|
||||
reg byte a [ mul8u::$1 ]
|
||||
reg byte a [ mulf_init::$2 ]
|
||||
reg byte a [ mulf_init::$5 ]
|
||||
reg byte a [ mulf_init::$6 ]
|
||||
|
Loading…
x
Reference in New Issue
Block a user