From 01248f1b6d35087f1497f0d2e3725eee298c41ea Mon Sep 17 00:00:00 2001 From: Kray-G Date: Tue, 5 Nov 2019 14:27:25 +0900 Subject: [PATCH] issue #7: updated README. --- README.md | 80 ++++++++++++++++++++++++++++++++++++++++----- doc/images/fib.png | Bin 6058 -> 5994 bytes samples/fib.dot | 12 +++++++ 3 files changed, 84 insertions(+), 8 deletions(-) create mode 100644 samples/fib.dot diff --git a/README.md b/README.md index 2b4f28a..61fbe40 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,41 @@ Here is the basic block diagram of KCCI. ## Usage -### Run on the x64 JIT +### Command Line Interface + +#### Run Options + +The option `-x` will be used by default when no option specified. + +``` +-x Run by VM code. (use this when no options specified) +-j Run by x64 JIT code. +``` + +#### Input Options + +``` +-I Add directory to search for included files. +-D X[=] Define macro, optionally with a value. +``` + +#### Output Options + +The program will be not run when using one of output options. + +``` +-E Output preprocessed code to stdout. +-J Output x64 code assembled by JIT to stdout. +-X Output VM code to stdout. +-s Output GNU style textual x64 assembly to `.s` file. +-dot Output IR call flow graph in dot format to `.dot` file. +``` + +## Examples + +### How to Run + +#### Run on the x64 JIT For JIT use the option `-j`. Use the option `-J` if you want to see the x64 assembly code. @@ -141,7 +175,7 @@ $ kcc -j program.c $ kcc -J program.c ``` -### Run on the VM +#### Run on the VM No options or use the option `-x` to run on the VM. Use the option `-X` if you want to see the VM instructions. @@ -154,7 +188,13 @@ $ kcc -x program.c $ kcc -X program.c ``` -## Examples +### Output Call Flow Graph + +This is `lacc`'s functionality, but `kcc` can do it also. +Here is the output of call flow graph for switch-case assembled as a jump table. +Please see [here](doc/technical.md) for the detail of a jump table. + +![JumpTable](doc/images/switch-case3.png) ### Fibonacci @@ -175,6 +215,30 @@ int main() } ``` +#### Dot Output + +Although the labels, variable names, and line breaks have been changed for easy to understand, +the output is like below. + +```c +digraph { + node [fontname="Courier_New",fontsize=10,style="setlinewidth(0.1)",shape=record]; + edge [fontname="Courier_New",fontsize=10,style="setlinewidth(0.1)"]; + label="fib" + labelloc="t" + L1 [label="{ \.L1 | if 3 \> n goto \.L2 }"]; + L3 [label="{ \.L3 | .t1 = n - 2 | param .t1 | .t2 = call &fib | + .t3 = n - 1 | param .t3 | .t4 = call &fib | return .t2 + .t4 }"]; + L2 [label="{ \.L2 | return n }"]; + L1:s -> L3:n; + L1:s -> L2:n; +} +``` + +The image is like this. + +![fib.c](doc/images/fib.png) + #### Execution Sample The results are below. @@ -195,9 +259,11 @@ For the reference, it shows a result of Ruby and Python. | | KCCI VM(64bit) | KCCI JIT(x64) | Ruby 2.4.0 | Ruby 2.6.3 | Python 2.7.13 | | --------- | :------------: | :-----------: | :--------: | :--------: | :-----------: | -| `fib(34)` | 0.718 | **0.062** | 1.171 | 0.734 | 1.578 | +| `fib(34)` | 0.453 | **0.062** | 1.171 | 0.734 | 1.578 | -Ruby 2.6.3 is very fast against my expectations. +I was able to make my VM faster than Ruby this time, +but Ruby 2.6.3 is very fast against my expectations in spite of no type information. +Of course x64 JIT code is 7x or 8x faster than that VM code. #### Compiled Code @@ -303,9 +369,7 @@ I have a plan to do the followings when I have a time. * [ ] Adding a library of JSON Parser. * [ ] Adding a library with libCurl. * [ ] Supporting encryption of Zip/Unzip. -* [ ] One instruction for increment and decrement. -* [ ] Combining VM instructions to improve the performance. - +S ## License This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details. diff --git a/doc/images/fib.png b/doc/images/fib.png index c1a45bea5a9b6212c161eb18f572d460c50c46bd..8b574e6505359809ce0ccca5d349f80b58886bfa 100644 GIT binary patch literal 5994 zcmaJ_XIK=?mPQ?LW)R6BO3p}90VN37NRC4gBxf9wfJhE%s~{kfL59>IQ6Z)_jdqUNT!04(`p)aDz$jGQP)Rhh3_Y@h~ zDG}sp`0EaxU^o0ao=Mphm}d1y-x(9d@i3zTN>MeT&R4YZ4QVmhdW0&x891N`m@*PY)^nrx=_c#Pev2-!FsO&y;< zlD*m0)w8D1+qJykwURKp^08Sdw?pydkOxqyQ^&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Db|^9VpUnC9 zni{o2=Ehx59~lstH=CG;{H7_5k)6xtVrxB)XnPavW6NTJJy(nB8UHj4yPwm5ri9ky zoWZzN5wm^C%bmIpp9#8h3fBM~2W0?n$;;ozW^rLFMun+%xokjy&V7Bd7KMNRo@$r2 z!Eddy(J5xc*1Id1+y3aDsi(d2(bP~K72tZd$G~JSH02>6#|uab3Sd161F)N&M0Br0 zV_-#>%19a4;o;+-IMh@pXBUc%L|6e4QFzIVj93=uFSNTN*mGDDUZB533Xt1|*)x#d zA@ix)&haf_Fz>SXShl77$)nf?4bb3HT;J=ybZ}?I80KFYfe2%IX5V;lgk8Jft f?CI|>XC#9U*#z$&51v8!bs`-NgPT=qwvYb@5QeEX diff --git a/samples/fib.dot b/samples/fib.dot new file mode 100644 index 0000000..84ba4d3 --- /dev/null +++ b/samples/fib.dot @@ -0,0 +1,12 @@ +digraph { + node [fontname="Courier_New",fontsize=10,style="setlinewidth(0.1)",shape=record]; + edge [fontname="Courier_New",fontsize=10,style="setlinewidth(0.1)"]; + label="fib" + labelloc="t" + L1 [label="{ \.L1 | if 3 \> n goto \.L2 }"]; + L3 [label="{ \.L3 | .t1 = n - 2 | param .t1 | .t2 = call &fib | + .t3 = n - 1 | param .t3 | .t4 = call &fib | return .t2 + .t4 }"]; + L2 [label="{ \.L2 | return n }"]; + L1:s -> L3:n; + L1:s -> L2:n; +} \ No newline at end of file