mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-09-08 17:54:40 +00:00
Moved division into library
This commit is contained in:
parent
b502c26140
commit
7343a85b91
@ -44,10 +44,9 @@ public class TestPrograms {
|
||||
|
||||
@Test
|
||||
public void testDivision() throws IOException, URISyntaxException {
|
||||
compileAndCompare("division");
|
||||
compileAndCompare("test-division");
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testVarRegister() throws IOException, URISyntaxException {
|
||||
compileAndCompare("var-register");
|
||||
|
@ -1,51 +1,5 @@
|
||||
import "print.kc"
|
||||
// Binary division implementation
|
||||
|
||||
const byte* NULL = 0;
|
||||
|
||||
word rem16u = 0;
|
||||
|
||||
void main() {
|
||||
print_cls();
|
||||
test_8u();
|
||||
test_16u();
|
||||
}
|
||||
|
||||
void test_16u() {
|
||||
word[] dividends = { $ffff, $ffff, $ffff, $ffff, $ffff, $ffff};
|
||||
word[] divisors = { 5, 7, 11, 13, 17, 19 };
|
||||
for( byte i=0;i!=12;i=i+2) {
|
||||
word dividend = dividends[i];
|
||||
word divisor = divisors[i];
|
||||
word res = div16u(dividend, divisor);
|
||||
print_word(dividend);
|
||||
print_str(" / @");
|
||||
print_word(divisor);
|
||||
print_str(" = @");
|
||||
print_word(res);
|
||||
print_str(" @");
|
||||
print_word(rem16u);
|
||||
print_ln();
|
||||
}
|
||||
}
|
||||
|
||||
void test_8u() {
|
||||
byte* rem = $ff;
|
||||
byte[] dividends = { 255, 255, 255, 255, 255, 255};
|
||||
byte[] divisors = { 5, 7, 11, 13, 17, 19 };
|
||||
for( byte i: 0..5 ) {
|
||||
byte dividend = dividends[i];
|
||||
byte divisor = divisors[i];
|
||||
byte res = div8u(dividend, divisor, rem);
|
||||
print_byte(dividend);
|
||||
print_str(" / @");
|
||||
print_byte(divisor);
|
||||
print_str(" = @");
|
||||
print_byte(res);
|
||||
print_str(" @");
|
||||
print_byte(*rem);
|
||||
print_ln();
|
||||
}
|
||||
}
|
||||
|
||||
// Performs division on two 8 bit unsigned bytes
|
||||
// Returns dividend/divisor.
|
||||
@ -70,10 +24,11 @@ byte div8u(byte dividend, byte divisor, byte* remainder) {
|
||||
return quotient;
|
||||
}
|
||||
|
||||
word rem16u = 0;
|
||||
|
||||
// Performs division on two 16 bit unsigned bytes
|
||||
// Returns dividend/divisor.
|
||||
// If remainder is non-null it will be set to the remainder.
|
||||
// The remainder will be set into the global variable rem16u
|
||||
// Implemented using simple binary division
|
||||
word div16u(word dividend, word divisor) {
|
||||
word rem = 0;
|
||||
|
46
src/test/java/dk/camelot64/kickc/test/kc/test-division.kc
Normal file
46
src/test/java/dk/camelot64/kickc/test/kc/test-division.kc
Normal file
@ -0,0 +1,46 @@
|
||||
// Test the binary division library
|
||||
import "print.kc"
|
||||
import "division.kc"
|
||||
|
||||
void main() {
|
||||
print_cls();
|
||||
test_8u();
|
||||
test_16u();
|
||||
}
|
||||
|
||||
void test_16u() {
|
||||
word[] dividends = { $ffff, $ffff, $ffff, $ffff, $ffff, $ffff};
|
||||
word[] divisors = { 5, 7, 11, 13, 17, 19 };
|
||||
for( byte i=0;i!=12;i=i+2) {
|
||||
word dividend = dividends[i];
|
||||
word divisor = divisors[i];
|
||||
word res = div16u(dividend, divisor);
|
||||
print_word(dividend);
|
||||
print_str(" / @");
|
||||
print_word(divisor);
|
||||
print_str(" = @");
|
||||
print_word(res);
|
||||
print_str(" @");
|
||||
print_word(rem16u);
|
||||
print_ln();
|
||||
}
|
||||
}
|
||||
|
||||
void test_8u() {
|
||||
byte* rem = $ff;
|
||||
byte[] dividends = { 255, 255, 255, 255, 255, 255};
|
||||
byte[] divisors = { 5, 7, 11, 13, 17, 19 };
|
||||
for( byte i: 0..5 ) {
|
||||
byte dividend = dividends[i];
|
||||
byte divisor = divisors[i];
|
||||
byte res = div8u(dividend, divisor, rem);
|
||||
print_byte(dividend);
|
||||
print_str(" / @");
|
||||
print_byte(divisor);
|
||||
print_str(" = @");
|
||||
print_byte(res);
|
||||
print_str(" @");
|
||||
print_byte(*rem);
|
||||
print_ln();
|
||||
}
|
||||
}
|
@ -1,7 +1,4 @@
|
||||
// Implementation of the Seriously Fast Multiplication
|
||||
// See http://codebase64.org/doku.php?id=base:seriously_fast_multiplication
|
||||
// Utilizes the fact that a*b = ((a+b)/2)^2 - ((a-b)/2)^2
|
||||
|
||||
// Test the fast multiplication library
|
||||
import "print.kc"
|
||||
import "multiply.kc"
|
||||
|
||||
|
@ -162,11 +162,11 @@ print_str: {
|
||||
jmp b1
|
||||
}
|
||||
div16u: {
|
||||
.label dividend = $d
|
||||
.label divisor = $16
|
||||
.label return = $f
|
||||
.label rem = $b
|
||||
.label dividend = $d
|
||||
.label quotient = $f
|
||||
.label return = $f
|
||||
.label divisor = $16
|
||||
ldx #0
|
||||
txa
|
||||
sta quotient
|
||||
@ -284,9 +284,9 @@ test_8u: {
|
||||
}
|
||||
div8u: {
|
||||
.label dividend = $12
|
||||
.label divisor = $19
|
||||
.label quotient = $13
|
||||
.label return = $13
|
||||
.label divisor = $19
|
||||
ldx #0
|
||||
txa
|
||||
sta quotient
|
@ -30,13 +30,13 @@ test_16u::@1: scope:[test_16u] from test_16u test_16u::@11
|
||||
[12] (byte) test_16u::i#10 ← phi( test_16u/(byte/signed byte/word/signed word/dword/signed dword) 0 test_16u::@11/(byte) test_16u::i#1 ) [ test_16u::i#10 line_cursor#1 ] ( main:2::test_16u:9 [ test_16u::i#10 line_cursor#1 ] )
|
||||
[13] (word) test_16u::dividend#0 ← *((const word[]) test_16u::dividends#0 + (byte) test_16u::i#10) [ test_16u::i#10 test_16u::dividend#0 line_cursor#1 ] ( main:2::test_16u:9 [ test_16u::i#10 test_16u::dividend#0 line_cursor#1 ] )
|
||||
[14] (word) test_16u::divisor#0 ← *((const word[]) test_16u::divisors#0 + (byte) test_16u::i#10) [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 ] ( main:2::test_16u:9 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 ] )
|
||||
[15] (word) div16u::dividend#0 ← (word) test_16u::dividend#0 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 div16u::dividend#0 line_cursor#1 ] ( main:2::test_16u:9 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 div16u::dividend#0 line_cursor#1 ] )
|
||||
[16] (word) div16u::divisor#0 ← (word) test_16u::divisor#0 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 div16u::dividend#0 div16u::divisor#0 line_cursor#1 ] ( main:2::test_16u:9 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 div16u::dividend#0 div16u::divisor#0 line_cursor#1 ] )
|
||||
[17] call div16u param-assignment [ test_16u::i#10 div16u::rem#8 test_16u::dividend#0 test_16u::divisor#0 div16u::return#1 line_cursor#1 ] ( main:2::test_16u:9 [ test_16u::i#10 div16u::rem#8 test_16u::dividend#0 test_16u::divisor#0 div16u::return#1 line_cursor#1 ] )
|
||||
[18] (word) div16u::return#0 ← (word) div16u::return#1 [ test_16u::i#10 div16u::rem#8 test_16u::dividend#0 test_16u::divisor#0 div16u::return#0 line_cursor#1 ] ( main:2::test_16u:9 [ test_16u::i#10 div16u::rem#8 test_16u::dividend#0 test_16u::divisor#0 div16u::return#0 line_cursor#1 ] )
|
||||
[15] (word) div16u::dividend#1 ← (word) test_16u::dividend#0 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 div16u::dividend#1 line_cursor#1 ] ( main:2::test_16u:9 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 div16u::dividend#1 line_cursor#1 ] )
|
||||
[16] (word) div16u::divisor#0 ← (word) test_16u::divisor#0 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 div16u::dividend#1 div16u::divisor#0 line_cursor#1 ] ( main:2::test_16u:9 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 div16u::dividend#1 div16u::divisor#0 line_cursor#1 ] )
|
||||
[17] call div16u param-assignment [ test_16u::i#10 div16u::rem#8 test_16u::dividend#0 test_16u::divisor#0 div16u::return#0 line_cursor#1 ] ( main:2::test_16u:9 [ test_16u::i#10 div16u::rem#8 test_16u::dividend#0 test_16u::divisor#0 div16u::return#0 line_cursor#1 ] )
|
||||
[18] (word) div16u::return#2 ← (word) div16u::return#0 [ test_16u::i#10 div16u::rem#8 test_16u::dividend#0 test_16u::divisor#0 div16u::return#2 line_cursor#1 ] ( main:2::test_16u:9 [ test_16u::i#10 div16u::rem#8 test_16u::dividend#0 test_16u::divisor#0 div16u::return#2 line_cursor#1 ] )
|
||||
to:test_16u::@3
|
||||
test_16u::@3: scope:[test_16u] from test_16u::@1
|
||||
[19] (word) test_16u::res#0 ← (word) div16u::return#0 [ test_16u::i#10 div16u::rem#8 test_16u::dividend#0 test_16u::divisor#0 test_16u::res#0 line_cursor#1 ] ( main:2::test_16u:9 [ test_16u::i#10 div16u::rem#8 test_16u::dividend#0 test_16u::divisor#0 test_16u::res#0 line_cursor#1 ] )
|
||||
[19] (word) test_16u::res#0 ← (word) div16u::return#2 [ test_16u::i#10 div16u::rem#8 test_16u::dividend#0 test_16u::divisor#0 test_16u::res#0 line_cursor#1 ] ( main:2::test_16u:9 [ test_16u::i#10 div16u::rem#8 test_16u::dividend#0 test_16u::divisor#0 test_16u::res#0 line_cursor#1 ] )
|
||||
[20] (word) print_word::w#0 ← (word) test_16u::dividend#0 [ test_16u::i#10 div16u::rem#8 test_16u::divisor#0 test_16u::res#0 print_word::w#0 line_cursor#1 ] ( main:2::test_16u:9 [ test_16u::i#10 div16u::rem#8 test_16u::divisor#0 test_16u::res#0 print_word::w#0 line_cursor#1 ] )
|
||||
[21] (byte*~) char_cursor#84 ← (byte*) line_cursor#1 [ test_16u::i#10 div16u::rem#8 test_16u::divisor#0 test_16u::res#0 print_word::w#0 char_cursor#84 line_cursor#1 ] ( main:2::test_16u:9 [ test_16u::i#10 div16u::rem#8 test_16u::divisor#0 test_16u::res#0 print_word::w#0 char_cursor#84 line_cursor#1 ] )
|
||||
[22] call print_word param-assignment [ test_16u::i#10 div16u::rem#8 test_16u::divisor#0 test_16u::res#0 line_cursor#1 char_cursor#11 ] ( main:2::test_16u:9 [ test_16u::i#10 div16u::rem#8 test_16u::divisor#0 test_16u::res#0 line_cursor#1 char_cursor#11 ] )
|
||||
@ -141,12 +141,12 @@ print_str::@2: scope:[print_str] from print_str::@1
|
||||
[69] (byte*) print_str::str#0 ← ++ (byte*) print_str::str#7 [ print_str::str#0 char_cursor#1 ] ( main:2::test_16u:9::print_str:24 [ test_16u::i#10 div16u::rem#8 test_16u::divisor#0 test_16u::res#0 line_cursor#1 print_str::str#0 char_cursor#1 ] main:2::test_16u:9::print_str:28 [ test_16u::i#10 div16u::rem#8 test_16u::res#0 line_cursor#1 print_str::str#0 char_cursor#1 ] main:2::test_16u:9::print_str:32 [ test_16u::i#10 div16u::rem#8 line_cursor#1 print_str::str#0 char_cursor#1 ] main:2::test_8u:7::print_str:99 [ line_cursor#25 test_8u::i#10 test_8u::divisor#0 test_8u::res#0 print_str::str#0 char_cursor#1 ] main:2::test_8u:7::print_str:103 [ line_cursor#25 test_8u::i#10 test_8u::res#0 print_str::str#0 char_cursor#1 ] main:2::test_8u:7::print_str:107 [ line_cursor#25 test_8u::i#10 print_str::str#0 char_cursor#1 ] )
|
||||
to:print_str::@1
|
||||
div16u: scope:[div16u] from test_16u::@1
|
||||
[70] phi() [ div16u::dividend#0 div16u::divisor#0 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::dividend#0 div16u::divisor#0 ] )
|
||||
[70] phi() [ div16u::dividend#1 div16u::divisor#0 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::dividend#1 div16u::divisor#0 ] )
|
||||
to:div16u::@1
|
||||
div16u::@1: scope:[div16u] from div16u div16u::@3
|
||||
[71] (byte) div16u::i#2 ← phi( div16u/(byte/signed byte/word/signed word/dword/signed dword) 0 div16u::@3/(byte) div16u::i#1 ) [ div16u::divisor#0 div16u::rem#4 div16u::dividend#2 div16u::quotient#3 div16u::i#2 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::divisor#0 div16u::rem#4 div16u::dividend#2 div16u::quotient#3 div16u::i#2 ] )
|
||||
[71] (word) div16u::quotient#3 ← phi( div16u/(byte/signed byte/word/signed word/dword/signed dword) 0 div16u::@3/(word) div16u::return#1 ) [ div16u::divisor#0 div16u::rem#4 div16u::dividend#2 div16u::quotient#3 div16u::i#2 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::divisor#0 div16u::rem#4 div16u::dividend#2 div16u::quotient#3 div16u::i#2 ] )
|
||||
[71] (word) div16u::dividend#2 ← phi( div16u/(word) div16u::dividend#0 div16u::@3/(word) div16u::dividend#1 ) [ div16u::divisor#0 div16u::rem#4 div16u::dividend#2 div16u::quotient#3 div16u::i#2 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::divisor#0 div16u::rem#4 div16u::dividend#2 div16u::quotient#3 div16u::i#2 ] )
|
||||
[71] (word) div16u::quotient#3 ← phi( div16u/(byte/signed byte/word/signed word/dword/signed dword) 0 div16u::@3/(word) div16u::return#0 ) [ div16u::divisor#0 div16u::rem#4 div16u::dividend#2 div16u::quotient#3 div16u::i#2 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::divisor#0 div16u::rem#4 div16u::dividend#2 div16u::quotient#3 div16u::i#2 ] )
|
||||
[71] (word) div16u::dividend#2 ← phi( div16u/(word) div16u::dividend#1 div16u::@3/(word) div16u::dividend#0 ) [ div16u::divisor#0 div16u::rem#4 div16u::dividend#2 div16u::quotient#3 div16u::i#2 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::divisor#0 div16u::rem#4 div16u::dividend#2 div16u::quotient#3 div16u::i#2 ] )
|
||||
[71] (word) div16u::rem#4 ← phi( div16u/(byte/signed byte/word/signed word/dword/signed dword) 0 div16u::@3/(word) div16u::rem#8 ) [ div16u::divisor#0 div16u::rem#4 div16u::dividend#2 div16u::quotient#3 div16u::i#2 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::divisor#0 div16u::rem#4 div16u::dividend#2 div16u::quotient#3 div16u::i#2 ] )
|
||||
[72] (word) div16u::rem#1 ← (word) div16u::rem#4 << (byte/signed byte/word/signed word/dword/signed dword) 1 [ div16u::divisor#0 div16u::dividend#2 div16u::quotient#3 div16u::i#2 div16u::rem#1 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::divisor#0 div16u::dividend#2 div16u::quotient#3 div16u::i#2 div16u::rem#1 ] )
|
||||
[73] (byte~) div16u::$1 ← > (word) div16u::dividend#2 [ div16u::divisor#0 div16u::dividend#2 div16u::quotient#3 div16u::i#2 div16u::rem#1 div16u::$1 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::divisor#0 div16u::dividend#2 div16u::quotient#3 div16u::i#2 div16u::rem#1 div16u::$1 ] )
|
||||
@ -158,22 +158,22 @@ div16u::@4: scope:[div16u] from div16u::@1
|
||||
to:div16u::@2
|
||||
div16u::@2: scope:[div16u] from div16u::@1 div16u::@4
|
||||
[77] (word) div16u::rem#5 ← phi( div16u::@1/(word) div16u::rem#1 div16u::@4/(word) div16u::rem#2 ) [ div16u::divisor#0 div16u::dividend#2 div16u::quotient#3 div16u::i#2 div16u::rem#5 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::divisor#0 div16u::dividend#2 div16u::quotient#3 div16u::i#2 div16u::rem#5 ] )
|
||||
[78] (word) div16u::dividend#1 ← (word) div16u::dividend#2 << (byte/signed byte/word/signed word/dword/signed dword) 1 [ div16u::divisor#0 div16u::quotient#3 div16u::i#2 div16u::dividend#1 div16u::rem#5 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::divisor#0 div16u::quotient#3 div16u::i#2 div16u::dividend#1 div16u::rem#5 ] )
|
||||
[79] (word) div16u::quotient#1 ← (word) div16u::quotient#3 << (byte/signed byte/word/signed word/dword/signed dword) 1 [ div16u::divisor#0 div16u::i#2 div16u::dividend#1 div16u::rem#5 div16u::quotient#1 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::divisor#0 div16u::i#2 div16u::dividend#1 div16u::rem#5 div16u::quotient#1 ] )
|
||||
[80] if((word) div16u::rem#5<(word) div16u::divisor#0) goto div16u::@3 [ div16u::divisor#0 div16u::i#2 div16u::dividend#1 div16u::rem#5 div16u::quotient#1 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::divisor#0 div16u::i#2 div16u::dividend#1 div16u::rem#5 div16u::quotient#1 ] )
|
||||
[78] (word) div16u::dividend#0 ← (word) div16u::dividend#2 << (byte/signed byte/word/signed word/dword/signed dword) 1 [ div16u::divisor#0 div16u::quotient#3 div16u::i#2 div16u::dividend#0 div16u::rem#5 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::divisor#0 div16u::quotient#3 div16u::i#2 div16u::dividend#0 div16u::rem#5 ] )
|
||||
[79] (word) div16u::quotient#1 ← (word) div16u::quotient#3 << (byte/signed byte/word/signed word/dword/signed dword) 1 [ div16u::divisor#0 div16u::i#2 div16u::dividend#0 div16u::rem#5 div16u::quotient#1 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::divisor#0 div16u::i#2 div16u::dividend#0 div16u::rem#5 div16u::quotient#1 ] )
|
||||
[80] if((word) div16u::rem#5<(word) div16u::divisor#0) goto div16u::@3 [ div16u::divisor#0 div16u::i#2 div16u::dividend#0 div16u::rem#5 div16u::quotient#1 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::divisor#0 div16u::i#2 div16u::dividend#0 div16u::rem#5 div16u::quotient#1 ] )
|
||||
to:div16u::@5
|
||||
div16u::@5: scope:[div16u] from div16u::@2
|
||||
[81] (word) div16u::quotient#2 ← ++ (word) div16u::quotient#1 [ div16u::divisor#0 div16u::i#2 div16u::dividend#1 div16u::rem#5 div16u::quotient#2 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::divisor#0 div16u::i#2 div16u::dividend#1 div16u::rem#5 div16u::quotient#2 ] )
|
||||
[82] (word) div16u::rem#3 ← (word) div16u::rem#5 - (word) div16u::divisor#0 [ div16u::divisor#0 div16u::i#2 div16u::dividend#1 div16u::quotient#2 div16u::rem#3 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::divisor#0 div16u::i#2 div16u::dividend#1 div16u::quotient#2 div16u::rem#3 ] )
|
||||
[81] (word) div16u::quotient#2 ← ++ (word) div16u::quotient#1 [ div16u::divisor#0 div16u::i#2 div16u::dividend#0 div16u::rem#5 div16u::quotient#2 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::divisor#0 div16u::i#2 div16u::dividend#0 div16u::rem#5 div16u::quotient#2 ] )
|
||||
[82] (word) div16u::rem#3 ← (word) div16u::rem#5 - (word) div16u::divisor#0 [ div16u::divisor#0 div16u::i#2 div16u::dividend#0 div16u::quotient#2 div16u::rem#3 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::divisor#0 div16u::i#2 div16u::dividend#0 div16u::quotient#2 div16u::rem#3 ] )
|
||||
to:div16u::@3
|
||||
div16u::@3: scope:[div16u] from div16u::@2 div16u::@5
|
||||
[83] (word) div16u::return#1 ← phi( div16u::@2/(word) div16u::quotient#1 div16u::@5/(word) div16u::quotient#2 ) [ div16u::rem#8 div16u::divisor#0 div16u::return#1 div16u::i#2 div16u::dividend#1 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::rem#8 div16u::divisor#0 div16u::return#1 div16u::i#2 div16u::dividend#1 ] )
|
||||
[83] (word) div16u::rem#8 ← phi( div16u::@2/(word) div16u::rem#5 div16u::@5/(word) div16u::rem#3 ) [ div16u::rem#8 div16u::divisor#0 div16u::return#1 div16u::i#2 div16u::dividend#1 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::rem#8 div16u::divisor#0 div16u::return#1 div16u::i#2 div16u::dividend#1 ] )
|
||||
[84] (byte) div16u::i#1 ← ++ (byte) div16u::i#2 [ div16u::rem#8 div16u::divisor#0 div16u::return#1 div16u::dividend#1 div16u::i#1 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::rem#8 div16u::divisor#0 div16u::return#1 div16u::dividend#1 div16u::i#1 ] )
|
||||
[85] if((byte) div16u::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 16) goto div16u::@1 [ div16u::rem#8 div16u::divisor#0 div16u::return#1 div16u::dividend#1 div16u::i#1 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::rem#8 div16u::divisor#0 div16u::return#1 div16u::dividend#1 div16u::i#1 ] )
|
||||
[83] (word) div16u::return#0 ← phi( div16u::@2/(word) div16u::quotient#1 div16u::@5/(word) div16u::quotient#2 ) [ div16u::rem#8 div16u::divisor#0 div16u::return#0 div16u::i#2 div16u::dividend#0 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::rem#8 div16u::divisor#0 div16u::return#0 div16u::i#2 div16u::dividend#0 ] )
|
||||
[83] (word) div16u::rem#8 ← phi( div16u::@2/(word) div16u::rem#5 div16u::@5/(word) div16u::rem#3 ) [ div16u::rem#8 div16u::divisor#0 div16u::return#0 div16u::i#2 div16u::dividend#0 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::rem#8 div16u::divisor#0 div16u::return#0 div16u::i#2 div16u::dividend#0 ] )
|
||||
[84] (byte) div16u::i#1 ← ++ (byte) div16u::i#2 [ div16u::rem#8 div16u::divisor#0 div16u::return#0 div16u::dividend#0 div16u::i#1 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::rem#8 div16u::divisor#0 div16u::return#0 div16u::dividend#0 div16u::i#1 ] )
|
||||
[85] if((byte) div16u::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 16) goto div16u::@1 [ div16u::rem#8 div16u::divisor#0 div16u::return#0 div16u::dividend#0 div16u::i#1 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::rem#8 div16u::divisor#0 div16u::return#0 div16u::dividend#0 div16u::i#1 ] )
|
||||
to:div16u::@return
|
||||
div16u::@return: scope:[div16u] from div16u::@3
|
||||
[86] return [ div16u::rem#8 div16u::return#1 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::rem#8 div16u::return#1 ] )
|
||||
[86] return [ div16u::rem#8 div16u::return#0 ] ( main:2::test_16u:9::div16u:17 [ test_16u::i#10 test_16u::dividend#0 test_16u::divisor#0 line_cursor#1 div16u::rem#8 div16u::return#0 ] )
|
||||
to:@return
|
||||
test_8u: scope:[test_8u] from main::@1
|
||||
[87] phi() [ ] ( main:2::test_8u:7 [ ] )
|
||||
@ -184,13 +184,13 @@ test_8u::@1: scope:[test_8u] from test_8u test_8u::@12
|
||||
[88] (byte) test_8u::i#10 ← phi( test_8u/(byte/signed byte/word/signed word/dword/signed dword) 0 test_8u::@12/(byte) test_8u::i#1 ) [ line_cursor#25 char_cursor#75 test_8u::i#10 ] ( main:2::test_8u:7 [ line_cursor#25 char_cursor#75 test_8u::i#10 ] )
|
||||
[89] (byte) test_8u::dividend#0 ← *((const byte[]) test_8u::dividends#0 + (byte) test_8u::i#10) [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 ] ( main:2::test_8u:7 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 ] )
|
||||
[90] (byte) test_8u::divisor#0 ← *((const byte[]) test_8u::divisors#0 + (byte) test_8u::i#10) [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 ] ( main:2::test_8u:7 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 ] )
|
||||
[91] (byte) div8u::dividend#0 ← (byte) test_8u::dividend#0 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::dividend#0 ] ( main:2::test_8u:7 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::dividend#0 ] )
|
||||
[92] (byte) div8u::divisor#0 ← (byte) test_8u::divisor#0 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::dividend#0 div8u::divisor#0 ] ( main:2::test_8u:7 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::dividend#0 div8u::divisor#0 ] )
|
||||
[93] call div8u param-assignment [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::return#1 ] ( main:2::test_8u:7 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::return#1 ] )
|
||||
[94] (byte) div8u::return#0 ← (byte) div8u::return#1 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::return#0 ] ( main:2::test_8u:7 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::return#0 ] )
|
||||
[91] (byte) div8u::dividend#1 ← (byte) test_8u::dividend#0 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::dividend#1 ] ( main:2::test_8u:7 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::dividend#1 ] )
|
||||
[92] (byte) div8u::divisor#0 ← (byte) test_8u::divisor#0 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::dividend#1 div8u::divisor#0 ] ( main:2::test_8u:7 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::dividend#1 div8u::divisor#0 ] )
|
||||
[93] call div8u param-assignment [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::return#0 ] ( main:2::test_8u:7 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::return#0 ] )
|
||||
[94] (byte) div8u::return#2 ← (byte) div8u::return#0 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::return#2 ] ( main:2::test_8u:7 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::return#2 ] )
|
||||
to:test_8u::@3
|
||||
test_8u::@3: scope:[test_8u] from test_8u::@1
|
||||
[95] (byte) test_8u::res#0 ← (byte) div8u::return#0 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 test_8u::res#0 ] ( main:2::test_8u:7 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 test_8u::res#0 ] )
|
||||
[95] (byte) test_8u::res#0 ← (byte) div8u::return#2 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 test_8u::res#0 ] ( main:2::test_8u:7 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 test_8u::res#0 ] )
|
||||
[96] (byte) print_byte::b#2 ← (byte) test_8u::dividend#0 [ line_cursor#25 print_byte::b#2 char_cursor#75 test_8u::i#10 test_8u::divisor#0 test_8u::res#0 ] ( main:2::test_8u:7 [ line_cursor#25 print_byte::b#2 char_cursor#75 test_8u::i#10 test_8u::divisor#0 test_8u::res#0 ] )
|
||||
[97] call print_byte param-assignment [ line_cursor#25 char_cursor#11 test_8u::i#10 test_8u::divisor#0 test_8u::res#0 ] ( main:2::test_8u:7 [ line_cursor#25 char_cursor#11 test_8u::i#10 test_8u::divisor#0 test_8u::res#0 ] )
|
||||
to:test_8u::@4
|
||||
@ -233,12 +233,12 @@ test_8u::@12: scope:[test_8u] from test_8u::@11
|
||||
[115] (byte*~) char_cursor#98 ← (byte*) line_cursor#1 [ line_cursor#1 test_8u::i#1 char_cursor#98 ] ( main:2::test_8u:7 [ line_cursor#1 test_8u::i#1 char_cursor#98 ] )
|
||||
to:test_8u::@1
|
||||
div8u: scope:[div8u] from test_8u::@1
|
||||
[116] phi() [ div8u::dividend#0 div8u::divisor#0 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::dividend#0 div8u::divisor#0 ] )
|
||||
[116] phi() [ div8u::dividend#1 div8u::divisor#0 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::dividend#1 div8u::divisor#0 ] )
|
||||
to:div8u::@1
|
||||
div8u::@1: scope:[div8u] from div8u div8u::@3
|
||||
[117] (byte) div8u::i#2 ← phi( div8u/(byte/signed byte/word/signed word/dword/signed dword) 0 div8u::@3/(byte) div8u::i#1 ) [ div8u::divisor#0 div8u::rem#4 div8u::dividend#2 div8u::quotient#3 div8u::i#2 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::rem#4 div8u::dividend#2 div8u::quotient#3 div8u::i#2 ] )
|
||||
[117] (byte) div8u::quotient#3 ← phi( div8u/(byte/signed byte/word/signed word/dword/signed dword) 0 div8u::@3/(byte) div8u::return#1 ) [ div8u::divisor#0 div8u::rem#4 div8u::dividend#2 div8u::quotient#3 div8u::i#2 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::rem#4 div8u::dividend#2 div8u::quotient#3 div8u::i#2 ] )
|
||||
[117] (byte) div8u::dividend#2 ← phi( div8u/(byte) div8u::dividend#0 div8u::@3/(byte) div8u::dividend#1 ) [ div8u::divisor#0 div8u::rem#4 div8u::dividend#2 div8u::quotient#3 div8u::i#2 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::rem#4 div8u::dividend#2 div8u::quotient#3 div8u::i#2 ] )
|
||||
[117] (byte) div8u::quotient#3 ← phi( div8u/(byte/signed byte/word/signed word/dword/signed dword) 0 div8u::@3/(byte) div8u::return#0 ) [ div8u::divisor#0 div8u::rem#4 div8u::dividend#2 div8u::quotient#3 div8u::i#2 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::rem#4 div8u::dividend#2 div8u::quotient#3 div8u::i#2 ] )
|
||||
[117] (byte) div8u::dividend#2 ← phi( div8u/(byte) div8u::dividend#1 div8u::@3/(byte) div8u::dividend#0 ) [ div8u::divisor#0 div8u::rem#4 div8u::dividend#2 div8u::quotient#3 div8u::i#2 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::rem#4 div8u::dividend#2 div8u::quotient#3 div8u::i#2 ] )
|
||||
[117] (byte) div8u::rem#4 ← phi( div8u/(byte/signed byte/word/signed word/dword/signed dword) 0 div8u::@3/(byte) div8u::rem#8 ) [ div8u::divisor#0 div8u::rem#4 div8u::dividend#2 div8u::quotient#3 div8u::i#2 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::rem#4 div8u::dividend#2 div8u::quotient#3 div8u::i#2 ] )
|
||||
[118] (byte) div8u::rem#1 ← (byte) div8u::rem#4 << (byte/signed byte/word/signed word/dword/signed dword) 1 [ div8u::divisor#0 div8u::dividend#2 div8u::quotient#3 div8u::i#2 div8u::rem#1 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::dividend#2 div8u::quotient#3 div8u::i#2 div8u::rem#1 ] )
|
||||
[119] (byte~) div8u::$1 ← (byte) div8u::dividend#2 & (byte/word/signed word/dword/signed dword) 128 [ div8u::divisor#0 div8u::dividend#2 div8u::quotient#3 div8u::i#2 div8u::rem#1 div8u::$1 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::dividend#2 div8u::quotient#3 div8u::i#2 div8u::rem#1 div8u::$1 ] )
|
||||
@ -249,25 +249,25 @@ div8u::@4: scope:[div8u] from div8u::@1
|
||||
to:div8u::@2
|
||||
div8u::@2: scope:[div8u] from div8u::@1 div8u::@4
|
||||
[122] (byte) div8u::rem#5 ← phi( div8u::@1/(byte) div8u::rem#1 div8u::@4/(byte) div8u::rem#2 ) [ div8u::divisor#0 div8u::dividend#2 div8u::quotient#3 div8u::i#2 div8u::rem#5 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::dividend#2 div8u::quotient#3 div8u::i#2 div8u::rem#5 ] )
|
||||
[123] (byte) div8u::dividend#1 ← (byte) div8u::dividend#2 << (byte/signed byte/word/signed word/dword/signed dword) 1 [ div8u::divisor#0 div8u::quotient#3 div8u::i#2 div8u::dividend#1 div8u::rem#5 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::quotient#3 div8u::i#2 div8u::dividend#1 div8u::rem#5 ] )
|
||||
[124] (byte) div8u::quotient#1 ← (byte) div8u::quotient#3 << (byte/signed byte/word/signed word/dword/signed dword) 1 [ div8u::divisor#0 div8u::i#2 div8u::dividend#1 div8u::rem#5 div8u::quotient#1 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::i#2 div8u::dividend#1 div8u::rem#5 div8u::quotient#1 ] )
|
||||
[125] if((byte) div8u::rem#5<(byte) div8u::divisor#0) goto div8u::@3 [ div8u::divisor#0 div8u::i#2 div8u::dividend#1 div8u::rem#5 div8u::quotient#1 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::i#2 div8u::dividend#1 div8u::rem#5 div8u::quotient#1 ] )
|
||||
[123] (byte) div8u::dividend#0 ← (byte) div8u::dividend#2 << (byte/signed byte/word/signed word/dword/signed dword) 1 [ div8u::divisor#0 div8u::quotient#3 div8u::i#2 div8u::dividend#0 div8u::rem#5 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::quotient#3 div8u::i#2 div8u::dividend#0 div8u::rem#5 ] )
|
||||
[124] (byte) div8u::quotient#1 ← (byte) div8u::quotient#3 << (byte/signed byte/word/signed word/dword/signed dword) 1 [ div8u::divisor#0 div8u::i#2 div8u::dividend#0 div8u::rem#5 div8u::quotient#1 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::i#2 div8u::dividend#0 div8u::rem#5 div8u::quotient#1 ] )
|
||||
[125] if((byte) div8u::rem#5<(byte) div8u::divisor#0) goto div8u::@3 [ div8u::divisor#0 div8u::i#2 div8u::dividend#0 div8u::rem#5 div8u::quotient#1 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::i#2 div8u::dividend#0 div8u::rem#5 div8u::quotient#1 ] )
|
||||
to:div8u::@5
|
||||
div8u::@5: scope:[div8u] from div8u::@2
|
||||
[126] (byte) div8u::quotient#2 ← ++ (byte) div8u::quotient#1 [ div8u::divisor#0 div8u::i#2 div8u::dividend#1 div8u::rem#5 div8u::quotient#2 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::i#2 div8u::dividend#1 div8u::rem#5 div8u::quotient#2 ] )
|
||||
[127] (byte) div8u::rem#3 ← (byte) div8u::rem#5 - (byte) div8u::divisor#0 [ div8u::divisor#0 div8u::i#2 div8u::dividend#1 div8u::quotient#2 div8u::rem#3 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::i#2 div8u::dividend#1 div8u::quotient#2 div8u::rem#3 ] )
|
||||
[126] (byte) div8u::quotient#2 ← ++ (byte) div8u::quotient#1 [ div8u::divisor#0 div8u::i#2 div8u::dividend#0 div8u::rem#5 div8u::quotient#2 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::i#2 div8u::dividend#0 div8u::rem#5 div8u::quotient#2 ] )
|
||||
[127] (byte) div8u::rem#3 ← (byte) div8u::rem#5 - (byte) div8u::divisor#0 [ div8u::divisor#0 div8u::i#2 div8u::dividend#0 div8u::quotient#2 div8u::rem#3 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::i#2 div8u::dividend#0 div8u::quotient#2 div8u::rem#3 ] )
|
||||
to:div8u::@3
|
||||
div8u::@3: scope:[div8u] from div8u::@2 div8u::@5
|
||||
[128] (byte) div8u::return#1 ← phi( div8u::@2/(byte) div8u::quotient#1 div8u::@5/(byte) div8u::quotient#2 ) [ div8u::divisor#0 div8u::return#1 div8u::i#2 div8u::rem#8 div8u::dividend#1 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::return#1 div8u::i#2 div8u::rem#8 div8u::dividend#1 ] )
|
||||
[128] (byte) div8u::rem#8 ← phi( div8u::@2/(byte) div8u::rem#5 div8u::@5/(byte) div8u::rem#3 ) [ div8u::divisor#0 div8u::return#1 div8u::i#2 div8u::rem#8 div8u::dividend#1 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::return#1 div8u::i#2 div8u::rem#8 div8u::dividend#1 ] )
|
||||
[129] (byte) div8u::i#1 ← ++ (byte) div8u::i#2 [ div8u::divisor#0 div8u::return#1 div8u::rem#8 div8u::dividend#1 div8u::i#1 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::return#1 div8u::rem#8 div8u::dividend#1 div8u::i#1 ] )
|
||||
[130] if((byte) div8u::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto div8u::@1 [ div8u::divisor#0 div8u::return#1 div8u::rem#8 div8u::dividend#1 div8u::i#1 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::return#1 div8u::rem#8 div8u::dividend#1 div8u::i#1 ] )
|
||||
[128] (byte) div8u::return#0 ← phi( div8u::@2/(byte) div8u::quotient#1 div8u::@5/(byte) div8u::quotient#2 ) [ div8u::divisor#0 div8u::return#0 div8u::i#2 div8u::rem#8 div8u::dividend#0 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::return#0 div8u::i#2 div8u::rem#8 div8u::dividend#0 ] )
|
||||
[128] (byte) div8u::rem#8 ← phi( div8u::@2/(byte) div8u::rem#5 div8u::@5/(byte) div8u::rem#3 ) [ div8u::divisor#0 div8u::return#0 div8u::i#2 div8u::rem#8 div8u::dividend#0 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::return#0 div8u::i#2 div8u::rem#8 div8u::dividend#0 ] )
|
||||
[129] (byte) div8u::i#1 ← ++ (byte) div8u::i#2 [ div8u::divisor#0 div8u::return#0 div8u::rem#8 div8u::dividend#0 div8u::i#1 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::return#0 div8u::rem#8 div8u::dividend#0 div8u::i#1 ] )
|
||||
[130] if((byte) div8u::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto div8u::@1 [ div8u::divisor#0 div8u::return#0 div8u::rem#8 div8u::dividend#0 div8u::i#1 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::divisor#0 div8u::return#0 div8u::rem#8 div8u::dividend#0 div8u::i#1 ] )
|
||||
to:div8u::@6
|
||||
div8u::@6: scope:[div8u] from div8u::@3
|
||||
[131] *((const byte*) test_8u::rem#0) ← (byte) div8u::rem#8 [ div8u::return#1 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::return#1 ] )
|
||||
[131] *((const byte*) test_8u::rem#0) ← (byte) div8u::rem#8 [ div8u::return#0 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::return#0 ] )
|
||||
to:div8u::@return
|
||||
div8u::@return: scope:[div8u] from div8u::@6
|
||||
[132] return [ div8u::return#1 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::return#1 ] )
|
||||
[132] return [ div8u::return#0 ] ( main:2::test_8u:7::div8u:93 [ line_cursor#25 char_cursor#75 test_8u::i#10 test_8u::dividend#0 test_8u::divisor#0 div8u::return#0 ] )
|
||||
to:@return
|
||||
print_cls: scope:[print_cls] from main
|
||||
[133] phi() [ ] ( main:2::print_cls:5 [ ] )
|
File diff suppressed because it is too large
Load Diff
@ -21,8 +21,8 @@
|
||||
(label) div16u::@5
|
||||
(label) div16u::@return
|
||||
(word) div16u::dividend
|
||||
(word) div16u::dividend#0 dividend zp ZP_WORD:13 4.333333333333333
|
||||
(word) div16u::dividend#1 dividend zp ZP_WORD:13 25.25
|
||||
(word) div16u::dividend#0 dividend zp ZP_WORD:13 25.25
|
||||
(word) div16u::dividend#1 dividend zp ZP_WORD:13 4.333333333333333
|
||||
(word) div16u::dividend#2 dividend zp ZP_WORD:13 43.57142857142858
|
||||
(word) div16u::divisor
|
||||
(word) div16u::divisor#0 divisor zp ZP_WORD:22 12.529411764705884
|
||||
@ -41,8 +41,8 @@
|
||||
(word) div16u::rem#5 rem zp ZP_WORD:11 101.0
|
||||
(word) div16u::rem#8 rem zp ZP_WORD:11 12.5
|
||||
(word) div16u::return
|
||||
(word) div16u::return#0 return zp ZP_WORD:15 22.0
|
||||
(word) div16u::return#1 return zp ZP_WORD:15 62.8
|
||||
(word) div16u::return#0 return zp ZP_WORD:15 62.8
|
||||
(word) div16u::return#2 return zp ZP_WORD:15 22.0
|
||||
(byte()) div8u((byte) div8u::dividend , (byte) div8u::divisor , (byte*) div8u::remainder)
|
||||
(byte~) div8u::$1 reg byte a 202.0
|
||||
(label) div8u::@1
|
||||
@ -53,8 +53,8 @@
|
||||
(label) div8u::@6
|
||||
(label) div8u::@return
|
||||
(byte) div8u::dividend
|
||||
(byte) div8u::dividend#0 dividend zp ZP_BYTE:18 4.333333333333333
|
||||
(byte) div8u::dividend#1 dividend zp ZP_BYTE:18 25.25
|
||||
(byte) div8u::dividend#0 dividend zp ZP_BYTE:18 25.25
|
||||
(byte) div8u::dividend#1 dividend zp ZP_BYTE:18 4.333333333333333
|
||||
(byte) div8u::dividend#2 dividend zp ZP_BYTE:18 50.83333333333333
|
||||
(byte) div8u::divisor
|
||||
(byte) div8u::divisor#0 divisor zp ZP_BYTE:25 13.3125
|
||||
@ -74,8 +74,8 @@
|
||||
(byte) div8u::rem#8 reg byte y 101.66666666666667
|
||||
(byte*) div8u::remainder
|
||||
(byte) div8u::return
|
||||
(byte) div8u::return#0 reg byte a 22.0
|
||||
(byte) div8u::return#1 return zp ZP_BYTE:19 52.33333333333333
|
||||
(byte) div8u::return#0 return zp ZP_BYTE:19 52.33333333333333
|
||||
(byte) div8u::return#2 reg byte a 22.0
|
||||
(byte*) line_cursor
|
||||
(byte*) line_cursor#1 line_cursor zp ZP_WORD:3 9.131578947368421
|
||||
(byte*) line_cursor#11 line_cursor zp ZP_WORD:3 204.0
|
||||
@ -202,13 +202,13 @@ reg byte a [ print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
|
||||
zp ZP_WORD:7 [ char_cursor#45 char_cursor#72 char_cursor#71 char_cursor#84 char_cursor#2 char_cursor#11 char_cursor#75 char_cursor#1 char_cursor#98 ]
|
||||
zp ZP_WORD:9 [ print_str::str#7 print_str::str#9 print_str::str#0 ]
|
||||
zp ZP_WORD:11 [ div16u::rem#4 rem16u#16 div16u::rem#8 div16u::rem#5 div16u::rem#1 div16u::rem#2 div16u::rem#3 ]
|
||||
zp ZP_WORD:13 [ div16u::dividend#2 div16u::dividend#0 div16u::dividend#1 ]
|
||||
zp ZP_WORD:15 [ div16u::quotient#3 div16u::return#1 div16u::quotient#1 div16u::quotient#2 div16u::return#0 test_16u::res#0 ]
|
||||
zp ZP_WORD:13 [ div16u::dividend#2 div16u::dividend#1 div16u::dividend#0 ]
|
||||
zp ZP_WORD:15 [ div16u::quotient#3 div16u::return#0 div16u::quotient#1 div16u::quotient#2 div16u::return#2 test_16u::res#0 ]
|
||||
reg byte x [ div16u::i#2 div16u::i#1 ]
|
||||
zp ZP_BYTE:17 [ test_8u::i#10 test_8u::i#1 ]
|
||||
reg byte y [ div8u::rem#4 div8u::rem#8 div8u::rem#5 div8u::rem#1 div8u::rem#2 div8u::rem#3 ]
|
||||
zp ZP_BYTE:18 [ div8u::dividend#2 div8u::dividend#0 div8u::dividend#1 ]
|
||||
zp ZP_BYTE:19 [ div8u::quotient#3 div8u::return#1 div8u::quotient#1 div8u::quotient#2 ]
|
||||
zp ZP_BYTE:18 [ div8u::dividend#2 div8u::dividend#1 div8u::dividend#0 ]
|
||||
zp ZP_BYTE:19 [ div8u::quotient#3 div8u::return#0 div8u::quotient#1 div8u::quotient#2 ]
|
||||
reg byte x [ div8u::i#2 div8u::i#1 ]
|
||||
zp ZP_WORD:20 [ print_cls::sc#2 print_cls::sc#1 ]
|
||||
zp ZP_WORD:22 [ test_16u::divisor#0 div16u::divisor#0 ]
|
||||
@ -218,6 +218,6 @@ reg byte a [ div16u::$1 ]
|
||||
reg byte a [ div16u::$2 ]
|
||||
zp ZP_BYTE:24 [ test_8u::dividend#0 ]
|
||||
zp ZP_BYTE:25 [ test_8u::divisor#0 div8u::divisor#0 ]
|
||||
reg byte a [ div8u::return#0 ]
|
||||
reg byte a [ div8u::return#2 ]
|
||||
zp ZP_BYTE:26 [ test_8u::res#0 ]
|
||||
reg byte a [ div8u::$1 ]
|
@ -1,8 +1,5 @@
|
||||
PARSING src/test/java/dk/camelot64/kickc/test/kc/test-multiply.kc
|
||||
// Implementation of the Seriously Fast Multiplication
|
||||
// See http://codebase64.org/doku.php?id=base:seriously_fast_multiplication
|
||||
// Utilizes the fact that a*b = ((a+b)/2)^2 - ((a-b)/2)^2
|
||||
|
||||
// Test the fast multiplication library
|
||||
import "print.kc"
|
||||
import "multiply.kc"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user