mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-02-20 00:29:10 +00:00
Generating fast multiply table in both ASM and KC - now word-based generation.
This commit is contained in:
parent
389b6042ed
commit
8198b8f168
@ -20,7 +20,7 @@ import java.util.regex.Pattern;
|
||||
*/
|
||||
public class AsmFragmentManager {
|
||||
|
||||
static boolean verboseFragmentLog = true;
|
||||
static boolean verboseFragmentLog = false;
|
||||
|
||||
/**
|
||||
* Cache for fragment files. Maps signature to the parsed file.
|
||||
@ -165,10 +165,13 @@ public class AsmFragmentManager {
|
||||
synths.add(new FragmentSynthesis("(.*)=(.*)_derefidx_vbuz2(.*)", ".*=.*yy.*|.*z2.*z2.*", "ldy {z2}\n", "$1=$2_derefidx_vbuyy$3", null, mapZ3));
|
||||
synths.add(new FragmentSynthesis("(.*)=(.*)_derefidx_vbuz3(.*)", ".*=.*yy.*", "ldy {z3}\n", "$1=$2_derefidx_vbuyy$3", null, null));
|
||||
synths.add(new FragmentSynthesis("(.*)=(.*)_derefidx_vbuz3(.*)", ".*=.*xx.*", "ldx {z3}\n", "$1=$2_derefidx_vbuxx$3", null, null));
|
||||
synths.add(new FragmentSynthesis("(.*)_derefidx_vbuz1(.*)_derefidx_vbuz1(.*)", ".*z1.*z1.*z1.*|.*xx.*", null, "$1_derefidx_vbuxx$2_derefidx_vbuxx$3", "ldx {z1}\n", mapZ));
|
||||
synths.add(new FragmentSynthesis("(.*)_derefidx_vbuz1(.*)_derefidx_vbuz1(.*)", ".*z1.*z1.*z1.*|.*yy.*", null, "$1_derefidx_vbuyy$2_derefidx_vbuyy$3", "ldy {z1}\n", mapZ));
|
||||
synths.add(new FragmentSynthesis("(.*)_derefidx_vbuz2(.*)_derefidx_vbuz2(.*)", ".*z2.*z2.*z2.*|.*xx.*", null, "$1_derefidx_vbuxx$2_derefidx_vbuxx$3", "ldx {z2}\n", mapZ));
|
||||
synths.add(new FragmentSynthesis("(.*)_derefidx_vbuz2(.*)_derefidx_vbuz2(.*)", ".*z2.*z2.*z2.*|.*yy.*", null, "$1_derefidx_vbuyy$2_derefidx_vbuyy$3", "ldy {z2}\n", mapZ));
|
||||
// Convert array indexing twice with A/zp1/zp2 to X/Y register
|
||||
synths.add(new FragmentSynthesis("(.*)_derefidx_vbuaa(.*)_derefidx_vbuaa(.*)", ".*aa.*aa.*aa.*|.*xx.*|.*aa.*=.*", null, "$1_derefidx_vbuxx$2_derefidx_vbuxx$3", "tax\n", null));
|
||||
synths.add(new FragmentSynthesis("(.*)_derefidx_vbuaa(.*)_derefidx_vbuaa(.*)", ".*aa.*aa.*aa.*|.*yy.*|.*aa.*=.*", null, "$1_derefidx_vbuyy$2_derefidx_vbuyy$3", "tay\n", null));
|
||||
synths.add(new FragmentSynthesis("(.*)_derefidx_vbuz1(.*)_derefidx_vbuz1(.*)", ".*z1.*z1.*z1.*|.*xx.*|.*z1.*=.*", null, "$1_derefidx_vbuxx$2_derefidx_vbuxx$3", "ldx {z1}\n", mapZ));
|
||||
synths.add(new FragmentSynthesis("(.*)_derefidx_vbuz1(.*)_derefidx_vbuz1(.*)", ".*z1.*z1.*z1.*|.*yy.*|.*z1.*=.*", null, "$1_derefidx_vbuyy$2_derefidx_vbuyy$3", "ldy {z1}\n", mapZ));
|
||||
synths.add(new FragmentSynthesis("(.*)_derefidx_vbuz2(.*)_derefidx_vbuz2(.*)", ".*z2.*z2.*z2.*|.*xx.*|.*z2.*=.*", null, "$1_derefidx_vbuxx$2_derefidx_vbuxx$3", "ldx {z2}\n", mapZ));
|
||||
synths.add(new FragmentSynthesis("(.*)_derefidx_vbuz2(.*)_derefidx_vbuz2(.*)", ".*z2.*z2.*z2.*|.*yy.*|.*z2.*=.*", null, "$1_derefidx_vbuyy$2_derefidx_vbuyy$3", "ldy {z2}\n", mapZ));
|
||||
// Convert X/Y-based array indexing of a constant pointer into A-register by prefixing lda cn,x / lda cn,y ( ...pb.c1_derefidx_vbuxx... / ...pb.c1_derefidx_vbuyy... -> ...vb.aa... )
|
||||
synths.add(new FragmentSynthesis("(.*)=(.*)pb(.)c1_derefidx_vbuxx(.*)", ".*=.*aa.*|.*c1.*c1.*", "lda {c1},x\n", "$1=$2vb$3aa$4", null, mapC));
|
||||
synths.add(new FragmentSynthesis("(.*)=(.*c1.*)pb(.)c1_derefidx_vbuxx(.*)", ".*=.*aa.*", "lda {c1},x\n", "$1=$2vb$3aa$4", null, null));
|
||||
|
@ -0,0 +1,2 @@
|
||||
lda {z1}
|
||||
and #{c1}
|
@ -0,0 +1,2 @@
|
||||
cmp {c1},y
|
||||
beq {la1}
|
@ -0,0 +1,4 @@
|
||||
lda {z1}+1
|
||||
cmp #$80
|
||||
ror {z1}+1
|
||||
ror {z1}
|
@ -0,0 +1,7 @@
|
||||
lda {z2}+1
|
||||
cmp #$80
|
||||
ror
|
||||
sta {z1}+1
|
||||
lda {z2}
|
||||
ror
|
||||
sta {z1}
|
@ -0,0 +1,2 @@
|
||||
ror {z1}+1
|
||||
ror {z1}
|
@ -0,0 +1,6 @@
|
||||
lda {z2}+1
|
||||
ror
|
||||
sta {z1}+1
|
||||
lda {z2}
|
||||
ror
|
||||
sta {z1}
|
@ -0,0 +1,4 @@
|
||||
lda {z1}
|
||||
bne {la1}
|
||||
lda {z1}+1
|
||||
bne {la1}
|
@ -0,0 +1,6 @@
|
||||
lda {z1}
|
||||
cmp #<{c1}
|
||||
bne {la1}
|
||||
lda {z1}+1
|
||||
cmp #>{c1}
|
||||
bne {la1}
|
@ -98,6 +98,8 @@ public class SymbolTypeInference {
|
||||
return inferPlus(type1, type2);
|
||||
} else if(Operator.MINUS.equals(operator)) {
|
||||
return inferMinus(type1, type2);
|
||||
} else if(Operator.BOOL_AND.equals(operator)) {
|
||||
return inferBoolAnd(type1, type2);
|
||||
} else if(Operator.SET_HIBYTE.equals(operator)) {
|
||||
return type1;
|
||||
} else if(Operator.SET_LOWBYTE.equals(operator)) {
|
||||
@ -203,6 +205,19 @@ public class SymbolTypeInference {
|
||||
throw new RuntimeException("Type inference case not handled " + type1 + " " + "+" + " " + type2);
|
||||
}
|
||||
|
||||
private static SymbolType inferBoolAnd(SymbolType type1, SymbolType type2) {
|
||||
if(SymbolType.isSByte(type1) && SymbolType.isSByte(type2)) {
|
||||
return SymbolTypeInline.SBYTE;
|
||||
} else if(SymbolType.isByte(type1) || SymbolType.isByte(type2)) {
|
||||
return SymbolType.BYTE;
|
||||
} else if(SymbolType.isSWord(type1) && SymbolType.isSWord(type2)) {
|
||||
return SymbolType.SWORD;
|
||||
} else if(SymbolType.isWord(type1) || SymbolType.isWord(type2)) {
|
||||
return SymbolType.WORD;
|
||||
}
|
||||
throw new RuntimeException("Type inference case not handled " + type1 + " " + "+" + " " + type2);
|
||||
}
|
||||
|
||||
private static SymbolType inferMinus(SymbolType type1, SymbolType type2) {
|
||||
if(type1 instanceof SymbolTypePointer && isInteger(type2)) {
|
||||
return new SymbolTypePointer(((SymbolTypePointer) type1).getElementType());
|
||||
|
@ -16,25 +16,17 @@ byte[512] mul_sqr_hi;
|
||||
|
||||
void init_mul_tables() {
|
||||
// If f(x) = x*x/4 then f(x+1) = f(x) + x/2 + 1/4
|
||||
byte* sqr_lo = mul_sqr_lo+1;
|
||||
byte* sqr_hi = mul_sqr_hi+1;
|
||||
word sqr = 0;
|
||||
// First do bytes 1-255 - byte 0 is already zero
|
||||
for(byte i : 1..255) {
|
||||
for(word i : 1..511) {
|
||||
// sqr++ on even numbers because 1 = 2*1/4 (from the two previous numbers) + 1/2 (half of the previous uneven number)
|
||||
if((i&1)==0) sqr++;
|
||||
mul_sqr_lo[i] = <sqr;
|
||||
mul_sqr_hi[i] = >sqr;
|
||||
*sqr_lo++ = <sqr;
|
||||
*sqr_hi++ = >sqr;
|
||||
// sqr = sqr + i/2 (when uneven 1/2 is not added here)
|
||||
sqr = sqr + i>>1;
|
||||
}
|
||||
// Then do bytes 256-511
|
||||
for(i : 0..255) {
|
||||
// sqr++ on even numbers because 1 = 2*1/4 (from the two previous numbers) + 1/2 (half of the previous uneven number)
|
||||
if((i&1)==0) sqr++;
|
||||
(mul_sqr_lo+$100)[i] = <sqr;
|
||||
(mul_sqr_hi+$100)[i] = >sqr;
|
||||
// sqr = sqr + i/2 (when uneven 1/2 is not added here)
|
||||
sqr = sqr + 128 + i>>1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -75,14 +75,28 @@ init_mul_tables_asm: {
|
||||
rts
|
||||
}
|
||||
init_mul_tables: {
|
||||
.label _15 = 2
|
||||
.label sqr = 2
|
||||
.label _7 = $a
|
||||
.label sqr_lo = 4
|
||||
.label sqr_hi = 6
|
||||
.label sqr = 8
|
||||
.label i = 2
|
||||
lda #<mul_sqr_hi+1
|
||||
sta sqr_hi
|
||||
lda #>mul_sqr_hi+1
|
||||
sta sqr_hi+1
|
||||
lda #<mul_sqr_lo+1
|
||||
sta sqr_lo
|
||||
lda #>mul_sqr_lo+1
|
||||
sta sqr_lo+1
|
||||
lda #0
|
||||
sta sqr
|
||||
sta sqr+1
|
||||
ldx #1
|
||||
lda #1
|
||||
sta i
|
||||
lda #0
|
||||
sta i+1
|
||||
b1:
|
||||
txa
|
||||
lda i
|
||||
and #1
|
||||
cmp #0
|
||||
bne b2
|
||||
@ -92,52 +106,41 @@ init_mul_tables: {
|
||||
!:
|
||||
b2:
|
||||
lda sqr
|
||||
sta mul_sqr_lo,x
|
||||
lda sqr+1
|
||||
sta mul_sqr_hi,x
|
||||
txa
|
||||
lsr
|
||||
clc
|
||||
adc sqr
|
||||
sta sqr
|
||||
bcc !+
|
||||
inc sqr+1
|
||||
!:
|
||||
inx
|
||||
cpx #0
|
||||
bne b1
|
||||
ldx #0
|
||||
b3:
|
||||
txa
|
||||
and #1
|
||||
cmp #0
|
||||
bne b4
|
||||
inc sqr
|
||||
ldy #0
|
||||
sta (sqr_lo),y
|
||||
inc sqr_lo
|
||||
bne !+
|
||||
inc sqr+1
|
||||
inc sqr_lo+1
|
||||
!:
|
||||
b4:
|
||||
lda sqr
|
||||
sta mul_sqr_lo+$100,x
|
||||
lda sqr+1
|
||||
sta mul_sqr_hi+$100,x
|
||||
lda _15
|
||||
clc
|
||||
adc #<$80
|
||||
sta _15
|
||||
bcc !+
|
||||
inc _15+1
|
||||
ldy #0
|
||||
sta (sqr_hi),y
|
||||
inc sqr_hi
|
||||
bne !+
|
||||
inc sqr_hi+1
|
||||
!:
|
||||
txa
|
||||
lsr
|
||||
lda i+1
|
||||
ror
|
||||
sta _7+1
|
||||
lda i
|
||||
ror
|
||||
sta _7
|
||||
lda sqr
|
||||
clc
|
||||
adc sqr
|
||||
adc _7
|
||||
sta sqr
|
||||
bcc !+
|
||||
inc sqr+1
|
||||
lda sqr+1
|
||||
adc _7+1
|
||||
sta sqr+1
|
||||
inc i
|
||||
bne !+
|
||||
inc i+1
|
||||
!:
|
||||
inx
|
||||
cpx #0
|
||||
bne b3
|
||||
lda i
|
||||
cmp #<$200
|
||||
bne b1
|
||||
lda i+1
|
||||
cmp #>$200
|
||||
bne b1
|
||||
rts
|
||||
}
|
||||
|
@ -67,46 +67,29 @@ init_mul_tables: scope:[init_mul_tables] from main
|
||||
[26] phi() [ ] ( main:2::init_mul_tables:5 [ ] )
|
||||
to:init_mul_tables::@1
|
||||
init_mul_tables::@1: scope:[init_mul_tables] from init_mul_tables init_mul_tables::@2
|
||||
[27] (word) init_mul_tables::sqr#6 ← phi( init_mul_tables/(byte/signed byte/word/signed word) 0 init_mul_tables::@2/(word) init_mul_tables::sqr#1 ) [ init_mul_tables::i#4 init_mul_tables::sqr#6 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#4 init_mul_tables::sqr#6 ] )
|
||||
[27] (byte) init_mul_tables::i#4 ← phi( init_mul_tables/(byte/signed byte/word/signed word) 1 init_mul_tables::@2/(byte) init_mul_tables::i#1 ) [ init_mul_tables::i#4 init_mul_tables::sqr#6 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#4 init_mul_tables::sqr#6 ] )
|
||||
[28] (byte~) init_mul_tables::$0 ← (byte) init_mul_tables::i#4 & (byte/signed byte/word/signed word) 1 [ init_mul_tables::i#4 init_mul_tables::sqr#6 init_mul_tables::$0 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#4 init_mul_tables::sqr#6 init_mul_tables::$0 ] )
|
||||
[29] if((byte~) init_mul_tables::$0!=(byte/signed byte/word/signed word) 0) goto init_mul_tables::@2 [ init_mul_tables::i#4 init_mul_tables::sqr#6 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#4 init_mul_tables::sqr#6 ] )
|
||||
to:init_mul_tables::@5
|
||||
init_mul_tables::@5: scope:[init_mul_tables] from init_mul_tables::@1
|
||||
[30] (word) init_mul_tables::sqr#2 ← ++ (word) init_mul_tables::sqr#6 [ init_mul_tables::i#4 init_mul_tables::sqr#2 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#4 init_mul_tables::sqr#2 ] )
|
||||
to:init_mul_tables::@2
|
||||
init_mul_tables::@2: scope:[init_mul_tables] from init_mul_tables::@1 init_mul_tables::@5
|
||||
[31] (word) init_mul_tables::sqr#5 ← phi( init_mul_tables::@1/(word) init_mul_tables::sqr#6 init_mul_tables::@5/(word) init_mul_tables::sqr#2 ) [ init_mul_tables::i#4 init_mul_tables::sqr#5 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#4 init_mul_tables::sqr#5 ] )
|
||||
[32] (byte~) init_mul_tables::$3 ← < (word) init_mul_tables::sqr#5 [ init_mul_tables::i#4 init_mul_tables::sqr#5 init_mul_tables::$3 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#4 init_mul_tables::sqr#5 init_mul_tables::$3 ] )
|
||||
[33] *((const byte[512]) mul_sqr_lo#0 + (byte) init_mul_tables::i#4) ← (byte~) init_mul_tables::$3 [ init_mul_tables::i#4 init_mul_tables::sqr#5 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#4 init_mul_tables::sqr#5 ] )
|
||||
[34] (byte~) init_mul_tables::$4 ← > (word) init_mul_tables::sqr#5 [ init_mul_tables::i#4 init_mul_tables::sqr#5 init_mul_tables::$4 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#4 init_mul_tables::sqr#5 init_mul_tables::$4 ] )
|
||||
[35] *((const byte[512]) mul_sqr_hi#0 + (byte) init_mul_tables::i#4) ← (byte~) init_mul_tables::$4 [ init_mul_tables::i#4 init_mul_tables::sqr#5 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#4 init_mul_tables::sqr#5 ] )
|
||||
[36] (byte~) init_mul_tables::$5 ← (byte) init_mul_tables::i#4 >> (byte/signed byte/word/signed word) 1 [ init_mul_tables::i#4 init_mul_tables::sqr#5 init_mul_tables::$5 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#4 init_mul_tables::sqr#5 init_mul_tables::$5 ] )
|
||||
[37] (word) init_mul_tables::sqr#1 ← (word) init_mul_tables::sqr#5 + (byte~) init_mul_tables::$5 [ init_mul_tables::i#4 init_mul_tables::sqr#1 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#4 init_mul_tables::sqr#1 ] )
|
||||
[38] (byte) init_mul_tables::i#1 ← ++ (byte) init_mul_tables::i#4 [ init_mul_tables::i#1 init_mul_tables::sqr#1 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#1 init_mul_tables::sqr#1 ] )
|
||||
[39] if((byte) init_mul_tables::i#1!=(byte/signed byte/word/signed word) 0) goto init_mul_tables::@1 [ init_mul_tables::i#1 init_mul_tables::sqr#1 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#1 init_mul_tables::sqr#1 ] )
|
||||
[27] (byte*) init_mul_tables::sqr_hi#2 ← phi( init_mul_tables/(const byte[512]) mul_sqr_hi#0+(byte/signed byte/word/signed word) 1 init_mul_tables::@2/(byte*) init_mul_tables::sqr_hi#1 ) [ init_mul_tables::i#2 init_mul_tables::sqr#4 init_mul_tables::sqr_lo#2 init_mul_tables::sqr_hi#2 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#2 init_mul_tables::sqr#4 init_mul_tables::sqr_lo#2 init_mul_tables::sqr_hi#2 ] )
|
||||
[27] (byte*) init_mul_tables::sqr_lo#2 ← phi( init_mul_tables/(const byte[512]) mul_sqr_lo#0+(byte/signed byte/word/signed word) 1 init_mul_tables::@2/(byte*) init_mul_tables::sqr_lo#1 ) [ init_mul_tables::i#2 init_mul_tables::sqr#4 init_mul_tables::sqr_lo#2 init_mul_tables::sqr_hi#2 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#2 init_mul_tables::sqr#4 init_mul_tables::sqr_lo#2 init_mul_tables::sqr_hi#2 ] )
|
||||
[27] (word) init_mul_tables::sqr#4 ← phi( init_mul_tables/(byte/signed byte/word/signed word) 0 init_mul_tables::@2/(word) init_mul_tables::sqr#1 ) [ init_mul_tables::i#2 init_mul_tables::sqr#4 init_mul_tables::sqr_lo#2 init_mul_tables::sqr_hi#2 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#2 init_mul_tables::sqr#4 init_mul_tables::sqr_lo#2 init_mul_tables::sqr_hi#2 ] )
|
||||
[27] (word) init_mul_tables::i#2 ← phi( init_mul_tables/(byte/signed byte/word/signed word) 1 init_mul_tables::@2/(word) init_mul_tables::i#1 ) [ init_mul_tables::i#2 init_mul_tables::sqr#4 init_mul_tables::sqr_lo#2 init_mul_tables::sqr_hi#2 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#2 init_mul_tables::sqr#4 init_mul_tables::sqr_lo#2 init_mul_tables::sqr_hi#2 ] )
|
||||
[28] (byte~) init_mul_tables::$2 ← (word) init_mul_tables::i#2 & (byte/signed byte/word/signed word) 1 [ init_mul_tables::i#2 init_mul_tables::sqr#4 init_mul_tables::sqr_lo#2 init_mul_tables::sqr_hi#2 init_mul_tables::$2 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#2 init_mul_tables::sqr#4 init_mul_tables::sqr_lo#2 init_mul_tables::sqr_hi#2 init_mul_tables::$2 ] )
|
||||
[29] if((byte~) init_mul_tables::$2!=(byte/signed byte/word/signed word) 0) goto init_mul_tables::@2 [ init_mul_tables::i#2 init_mul_tables::sqr#4 init_mul_tables::sqr_lo#2 init_mul_tables::sqr_hi#2 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#2 init_mul_tables::sqr#4 init_mul_tables::sqr_lo#2 init_mul_tables::sqr_hi#2 ] )
|
||||
to:init_mul_tables::@3
|
||||
init_mul_tables::@3: scope:[init_mul_tables] from init_mul_tables::@2 init_mul_tables::@4
|
||||
[40] (word) init_mul_tables::sqr#10 ← phi( init_mul_tables::@4/(word) init_mul_tables::sqr#3 init_mul_tables::@2/(word) init_mul_tables::sqr#1 ) [ init_mul_tables::i#6 init_mul_tables::sqr#10 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#6 init_mul_tables::sqr#10 ] )
|
||||
[40] (byte) init_mul_tables::i#6 ← phi( init_mul_tables::@4/(byte) init_mul_tables::i#3 init_mul_tables::@2/(byte/signed byte/word/signed word) 0 ) [ init_mul_tables::i#6 init_mul_tables::sqr#10 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#6 init_mul_tables::sqr#10 ] )
|
||||
[41] (byte~) init_mul_tables::$8 ← (byte) init_mul_tables::i#6 & (byte/signed byte/word/signed word) 1 [ init_mul_tables::i#6 init_mul_tables::sqr#10 init_mul_tables::$8 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#6 init_mul_tables::sqr#10 init_mul_tables::$8 ] )
|
||||
[42] if((byte~) init_mul_tables::$8!=(byte/signed byte/word/signed word) 0) goto init_mul_tables::@4 [ init_mul_tables::i#6 init_mul_tables::sqr#10 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#6 init_mul_tables::sqr#10 ] )
|
||||
to:init_mul_tables::@7
|
||||
init_mul_tables::@7: scope:[init_mul_tables] from init_mul_tables::@3
|
||||
[43] (word) init_mul_tables::sqr#4 ← ++ (word) init_mul_tables::sqr#10 [ init_mul_tables::i#6 init_mul_tables::sqr#4 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#6 init_mul_tables::sqr#4 ] )
|
||||
to:init_mul_tables::@4
|
||||
init_mul_tables::@4: scope:[init_mul_tables] from init_mul_tables::@3 init_mul_tables::@7
|
||||
[44] (word) init_mul_tables::sqr#7 ← phi( init_mul_tables::@3/(word) init_mul_tables::sqr#10 init_mul_tables::@7/(word) init_mul_tables::sqr#4 ) [ init_mul_tables::i#6 init_mul_tables::sqr#7 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#6 init_mul_tables::sqr#7 ] )
|
||||
[45] (byte~) init_mul_tables::$12 ← < (word) init_mul_tables::sqr#7 [ init_mul_tables::i#6 init_mul_tables::sqr#7 init_mul_tables::$12 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#6 init_mul_tables::sqr#7 init_mul_tables::$12 ] )
|
||||
[46] *((const byte[512]) mul_sqr_lo#0+(word/signed word) 256 + (byte) init_mul_tables::i#6) ← (byte~) init_mul_tables::$12 [ init_mul_tables::i#6 init_mul_tables::sqr#7 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#6 init_mul_tables::sqr#7 ] )
|
||||
[47] (byte~) init_mul_tables::$14 ← > (word) init_mul_tables::sqr#7 [ init_mul_tables::i#6 init_mul_tables::sqr#7 init_mul_tables::$14 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#6 init_mul_tables::sqr#7 init_mul_tables::$14 ] )
|
||||
[48] *((const byte[512]) mul_sqr_hi#0+(word/signed word) 256 + (byte) init_mul_tables::i#6) ← (byte~) init_mul_tables::$14 [ init_mul_tables::i#6 init_mul_tables::sqr#7 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#6 init_mul_tables::sqr#7 ] )
|
||||
[49] (word~) init_mul_tables::$15 ← (word) init_mul_tables::sqr#7 + (byte/word/signed word) 128 [ init_mul_tables::i#6 init_mul_tables::$15 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#6 init_mul_tables::$15 ] )
|
||||
[50] (byte~) init_mul_tables::$16 ← (byte) init_mul_tables::i#6 >> (byte/signed byte/word/signed word) 1 [ init_mul_tables::i#6 init_mul_tables::$15 init_mul_tables::$16 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#6 init_mul_tables::$15 init_mul_tables::$16 ] )
|
||||
[51] (word) init_mul_tables::sqr#3 ← (word~) init_mul_tables::$15 + (byte~) init_mul_tables::$16 [ init_mul_tables::i#6 init_mul_tables::sqr#3 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#6 init_mul_tables::sqr#3 ] )
|
||||
[52] (byte) init_mul_tables::i#3 ← ++ (byte) init_mul_tables::i#6 [ init_mul_tables::i#3 init_mul_tables::sqr#3 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#3 init_mul_tables::sqr#3 ] )
|
||||
[53] if((byte) init_mul_tables::i#3!=(byte/signed byte/word/signed word) 0) goto init_mul_tables::@3 [ init_mul_tables::i#3 init_mul_tables::sqr#3 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#3 init_mul_tables::sqr#3 ] )
|
||||
init_mul_tables::@3: scope:[init_mul_tables] from init_mul_tables::@1
|
||||
[30] (word) init_mul_tables::sqr#2 ← ++ (word) init_mul_tables::sqr#4 [ init_mul_tables::i#2 init_mul_tables::sqr_lo#2 init_mul_tables::sqr_hi#2 init_mul_tables::sqr#2 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#2 init_mul_tables::sqr_lo#2 init_mul_tables::sqr_hi#2 init_mul_tables::sqr#2 ] )
|
||||
to:init_mul_tables::@2
|
||||
init_mul_tables::@2: scope:[init_mul_tables] from init_mul_tables::@1 init_mul_tables::@3
|
||||
[31] (word) init_mul_tables::sqr#3 ← phi( init_mul_tables::@1/(word) init_mul_tables::sqr#4 init_mul_tables::@3/(word) init_mul_tables::sqr#2 ) [ init_mul_tables::i#2 init_mul_tables::sqr_lo#2 init_mul_tables::sqr_hi#2 init_mul_tables::sqr#3 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#2 init_mul_tables::sqr_lo#2 init_mul_tables::sqr_hi#2 init_mul_tables::sqr#3 ] )
|
||||
[32] (byte~) init_mul_tables::$5 ← < (word) init_mul_tables::sqr#3 [ init_mul_tables::i#2 init_mul_tables::sqr_lo#2 init_mul_tables::sqr_hi#2 init_mul_tables::sqr#3 init_mul_tables::$5 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#2 init_mul_tables::sqr_lo#2 init_mul_tables::sqr_hi#2 init_mul_tables::sqr#3 init_mul_tables::$5 ] )
|
||||
[33] *((byte*) init_mul_tables::sqr_lo#2) ← (byte~) init_mul_tables::$5 [ init_mul_tables::i#2 init_mul_tables::sqr_lo#2 init_mul_tables::sqr_hi#2 init_mul_tables::sqr#3 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#2 init_mul_tables::sqr_lo#2 init_mul_tables::sqr_hi#2 init_mul_tables::sqr#3 ] )
|
||||
[34] (byte*) init_mul_tables::sqr_lo#1 ← ++ (byte*) init_mul_tables::sqr_lo#2 [ init_mul_tables::i#2 init_mul_tables::sqr_hi#2 init_mul_tables::sqr_lo#1 init_mul_tables::sqr#3 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#2 init_mul_tables::sqr_hi#2 init_mul_tables::sqr_lo#1 init_mul_tables::sqr#3 ] )
|
||||
[35] (byte~) init_mul_tables::$6 ← > (word) init_mul_tables::sqr#3 [ init_mul_tables::i#2 init_mul_tables::sqr_hi#2 init_mul_tables::sqr_lo#1 init_mul_tables::sqr#3 init_mul_tables::$6 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#2 init_mul_tables::sqr_hi#2 init_mul_tables::sqr_lo#1 init_mul_tables::sqr#3 init_mul_tables::$6 ] )
|
||||
[36] *((byte*) init_mul_tables::sqr_hi#2) ← (byte~) init_mul_tables::$6 [ init_mul_tables::i#2 init_mul_tables::sqr_hi#2 init_mul_tables::sqr_lo#1 init_mul_tables::sqr#3 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#2 init_mul_tables::sqr_hi#2 init_mul_tables::sqr_lo#1 init_mul_tables::sqr#3 ] )
|
||||
[37] (byte*) init_mul_tables::sqr_hi#1 ← ++ (byte*) init_mul_tables::sqr_hi#2 [ init_mul_tables::i#2 init_mul_tables::sqr_lo#1 init_mul_tables::sqr_hi#1 init_mul_tables::sqr#3 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#2 init_mul_tables::sqr_lo#1 init_mul_tables::sqr_hi#1 init_mul_tables::sqr#3 ] )
|
||||
[38] (word~) init_mul_tables::$7 ← (word) init_mul_tables::i#2 >> (byte/signed byte/word/signed word) 1 [ init_mul_tables::i#2 init_mul_tables::sqr_lo#1 init_mul_tables::sqr_hi#1 init_mul_tables::sqr#3 init_mul_tables::$7 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#2 init_mul_tables::sqr_lo#1 init_mul_tables::sqr_hi#1 init_mul_tables::sqr#3 init_mul_tables::$7 ] )
|
||||
[39] (word) init_mul_tables::sqr#1 ← (word) init_mul_tables::sqr#3 + (word~) init_mul_tables::$7 [ init_mul_tables::i#2 init_mul_tables::sqr#1 init_mul_tables::sqr_lo#1 init_mul_tables::sqr_hi#1 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#2 init_mul_tables::sqr#1 init_mul_tables::sqr_lo#1 init_mul_tables::sqr_hi#1 ] )
|
||||
[40] (word) init_mul_tables::i#1 ← ++ (word) init_mul_tables::i#2 [ init_mul_tables::i#1 init_mul_tables::sqr#1 init_mul_tables::sqr_lo#1 init_mul_tables::sqr_hi#1 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#1 init_mul_tables::sqr#1 init_mul_tables::sqr_lo#1 init_mul_tables::sqr_hi#1 ] )
|
||||
[41] if((word) init_mul_tables::i#1!=(word/signed word) 512) goto init_mul_tables::@1 [ init_mul_tables::i#1 init_mul_tables::sqr#1 init_mul_tables::sqr_lo#1 init_mul_tables::sqr_hi#1 ] ( main:2::init_mul_tables:5 [ init_mul_tables::i#1 init_mul_tables::sqr#1 init_mul_tables::sqr_lo#1 init_mul_tables::sqr_hi#1 ] )
|
||||
to:init_mul_tables::@return
|
||||
init_mul_tables::@return: scope:[init_mul_tables] from init_mul_tables::@4
|
||||
[54] return [ ] ( main:2::init_mul_tables:5 [ ] )
|
||||
init_mul_tables::@return: scope:[init_mul_tables] from init_mul_tables::@2
|
||||
[42] return [ ] ( main:2::init_mul_tables:5 [ ] )
|
||||
to:@return
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -8,36 +8,28 @@
|
||||
(byte[512]) asm_mul_sqr_lo
|
||||
(const byte[512]) asm_mul_sqr_lo#0 asm_mul_sqr_lo = { fill( 512, 0) }
|
||||
(void()) init_mul_tables()
|
||||
(byte~) init_mul_tables::$0 reg byte a 22.0
|
||||
(byte~) init_mul_tables::$12 reg byte a 22.0
|
||||
(byte~) init_mul_tables::$14 reg byte a 22.0
|
||||
(word~) init_mul_tables::$15 $15 zp ZP_WORD:2 11.0
|
||||
(byte~) init_mul_tables::$16 reg byte a 22.0
|
||||
(byte~) init_mul_tables::$3 reg byte a 22.0
|
||||
(byte~) init_mul_tables::$4 reg byte a 22.0
|
||||
(byte~) init_mul_tables::$2 reg byte a 22.0
|
||||
(byte~) init_mul_tables::$5 reg byte a 22.0
|
||||
(byte~) init_mul_tables::$8 reg byte a 22.0
|
||||
(byte~) init_mul_tables::$6 reg byte a 22.0
|
||||
(word~) init_mul_tables::$7 $7 zp ZP_WORD:10 22.0
|
||||
(label) init_mul_tables::@1
|
||||
(label) init_mul_tables::@2
|
||||
(label) init_mul_tables::@3
|
||||
(label) init_mul_tables::@4
|
||||
(label) init_mul_tables::@5
|
||||
(label) init_mul_tables::@7
|
||||
(label) init_mul_tables::@return
|
||||
(byte) init_mul_tables::i
|
||||
(byte) init_mul_tables::i#1 reg byte x 16.5
|
||||
(byte) init_mul_tables::i#3 reg byte x 16.5
|
||||
(byte) init_mul_tables::i#4 reg byte x 6.0
|
||||
(byte) init_mul_tables::i#6 reg byte x 5.5
|
||||
(word) init_mul_tables::i
|
||||
(word) init_mul_tables::i#1 i zp ZP_WORD:2 16.5
|
||||
(word) init_mul_tables::i#2 i zp ZP_WORD:2 3.3846153846153846
|
||||
(word) init_mul_tables::sqr
|
||||
(word) init_mul_tables::sqr#1 sqr zp ZP_WORD:2 11.0
|
||||
(word) init_mul_tables::sqr#10 sqr zp ZP_WORD:2 14.666666666666666
|
||||
(word) init_mul_tables::sqr#2 sqr zp ZP_WORD:2 22.0
|
||||
(word) init_mul_tables::sqr#3 sqr zp ZP_WORD:2 7.333333333333333
|
||||
(word) init_mul_tables::sqr#4 sqr zp ZP_WORD:2 22.0
|
||||
(word) init_mul_tables::sqr#5 sqr zp ZP_WORD:2 9.166666666666666
|
||||
(word) init_mul_tables::sqr#6 sqr zp ZP_WORD:2 11.0
|
||||
(word) init_mul_tables::sqr#7 sqr zp ZP_WORD:2 11.0
|
||||
(word) init_mul_tables::sqr#1 sqr zp ZP_WORD:8 7.333333333333333
|
||||
(word) init_mul_tables::sqr#2 sqr zp ZP_WORD:8 22.0
|
||||
(word) init_mul_tables::sqr#3 sqr zp ZP_WORD:8 6.875
|
||||
(word) init_mul_tables::sqr#4 sqr zp ZP_WORD:8 11.0
|
||||
(byte*) init_mul_tables::sqr_hi
|
||||
(byte*) init_mul_tables::sqr_hi#1 sqr_hi zp ZP_WORD:6 4.4
|
||||
(byte*) init_mul_tables::sqr_hi#2 sqr_hi zp ZP_WORD:6 3.3000000000000003
|
||||
(byte*) init_mul_tables::sqr_lo
|
||||
(byte*) init_mul_tables::sqr_lo#1 sqr_lo zp ZP_WORD:4 2.75
|
||||
(byte*) init_mul_tables::sqr_lo#2 sqr_lo zp ZP_WORD:4 4.714285714285714
|
||||
(void()) init_mul_tables_asm()
|
||||
(label) init_mul_tables_asm::@return
|
||||
(void()) main()
|
||||
@ -64,14 +56,11 @@
|
||||
(byte) mul_tables_compare::i#10 reg byte x 12.222222222222221
|
||||
|
||||
reg byte x [ mul_tables_compare::i#10 mul_tables_compare::i#1 ]
|
||||
reg byte x [ init_mul_tables::i#4 init_mul_tables::i#1 ]
|
||||
reg byte x [ init_mul_tables::i#6 init_mul_tables::i#3 ]
|
||||
zp ZP_WORD:2 [ init_mul_tables::sqr#7 init_mul_tables::sqr#10 init_mul_tables::sqr#3 init_mul_tables::sqr#5 init_mul_tables::sqr#6 init_mul_tables::sqr#1 init_mul_tables::sqr#2 init_mul_tables::sqr#4 init_mul_tables::$15 ]
|
||||
reg byte a [ init_mul_tables::$0 ]
|
||||
reg byte a [ init_mul_tables::$3 ]
|
||||
reg byte a [ init_mul_tables::$4 ]
|
||||
zp ZP_WORD:2 [ init_mul_tables::i#2 init_mul_tables::i#1 ]
|
||||
zp ZP_WORD:4 [ init_mul_tables::sqr_lo#2 init_mul_tables::sqr_lo#1 ]
|
||||
zp ZP_WORD:6 [ init_mul_tables::sqr_hi#2 init_mul_tables::sqr_hi#1 ]
|
||||
zp ZP_WORD:8 [ init_mul_tables::sqr#3 init_mul_tables::sqr#4 init_mul_tables::sqr#1 init_mul_tables::sqr#2 ]
|
||||
reg byte a [ init_mul_tables::$2 ]
|
||||
reg byte a [ init_mul_tables::$5 ]
|
||||
reg byte a [ init_mul_tables::$8 ]
|
||||
reg byte a [ init_mul_tables::$12 ]
|
||||
reg byte a [ init_mul_tables::$14 ]
|
||||
reg byte a [ init_mul_tables::$16 ]
|
||||
reg byte a [ init_mul_tables::$6 ]
|
||||
zp ZP_WORD:10 [ init_mul_tables::$7 ]
|
||||
|
Loading…
x
Reference in New Issue
Block a user