-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
724 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,4 +58,6 @@ imgui.ini | |
|
||
.vscode/ | ||
dependencies/icu | ||
out.txt | ||
out.txt | ||
|
||
code/llvm/current/*.ll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; def fun() -> bool: | ||
; a: bool = True | ||
; return a | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define i1 @fun() { | ||
entry: | ||
ret i1 true | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; def fun() -> i32: | ||
; a: i32 = 1 | ||
; return a | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define i32 @fun() { | ||
entry: | ||
ret i32 1 | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; def fun(b: i32) -> i32: | ||
; a = b | ||
; return a | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define i32 @fun(i32 %b) { | ||
entry: | ||
ret i32 %b | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
; def fun(a: i32, b: i32) -> i32: | ||
; a += b | ||
; return a | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define i32 @fun(i32 %a, i32 %b) { | ||
entry: | ||
%addtmp = add i32 %b, %a | ||
ret i32 %addtmp | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
; def fun(a: i32, b: i32) -> i32: | ||
; a -= b | ||
; return a | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define i32 @fun(i32 %a, i32 %b) { | ||
entry: | ||
%subtmp = sub i32 %a, %b | ||
ret i32 %subtmp | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; def fun(a: f64, b: f64) -> f64: | ||
; return a + b | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define double @fun(double %a, double %b) { | ||
entry: | ||
%addtmp = fadd double %a, %b | ||
ret double %addtmp | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; def fun(a: f64, b: f64) -> f64: | ||
; return a - b | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define double @fun(double %a, double %b) { | ||
entry: | ||
%subtmp = fsub double %a, %b | ||
ret double %subtmp | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; def fun(a: f64, b: f64) -> f64: | ||
; return a * b | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define double @fun(double %a, double %b) { | ||
entry: | ||
%multtmp = fmul double %a, %b | ||
ret double %multtmp | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; def fun(a: i32, b: i32) -> i32: | ||
; return a << b | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define i32 @fun(i32 %a, i32 %b) { | ||
entry: | ||
%addtmp = lshr i32 %a, %b | ||
ret i32 %addtmp | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; def fun(a: i32, b: i32) -> i32: | ||
; return a ^ b | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define i32 @fun(i32 %a, i32 %b) { | ||
entry: | ||
%bitxortmp = xor i32 %b, %a | ||
ret i32 %bitxortmp | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; def fun(a: bool, b: bool) -> bool: | ||
; return a and b | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define i1 @fun(i1 %a, i1 %b) { | ||
entry: | ||
%andtmp = and i1 %a, %b | ||
ret i1 %andtmp | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; def fun(a: bool, b: bool) -> bool: | ||
; return a or b | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define i1 @fun(i1 %a, i1 %b) { | ||
entry: | ||
%ortmp = or i1 %a, %b | ||
ret i1 %ortmp | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
; def fun(a: bool, b: bool, c: bool) -> bool: | ||
; return a or b or c | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define i1 @fun(i1 %a, i1 %b, i1 %c) { | ||
entry: | ||
%ortmp = or i1 %a, %b | ||
%ortmp7 = or i1 %ortmp, %c | ||
ret i1 %ortmp7 | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
; def myfunction(a: f64, b: f64) -> f64: | ||
; return a + b | ||
; | ||
; def fun(): | ||
; return myfunction(1.0, 2.0) | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define double @myfunction(double %a, double %b) { | ||
entry: | ||
%addtmp = fadd double %a, %b | ||
ret double %addtmp | ||
ret void | ||
} | ||
|
||
define void @fun() { | ||
entry: | ||
%calltmp = call double @myfunction(double 1.000000e+00, double 2.000000e+00) | ||
ret double %calltmp | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
; def fun(a: i32, b: i32, c: i32, d: i32) -> bool: | ||
; return a < b > c != d | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define i1 @fun(i32 %a, i32 %b, i32 %c, i32 %d) { | ||
entry: | ||
%0 = icmp slt i32 %a, %b | ||
%1 = icmp sgt i32 %b, %c | ||
%2 = icmp ne i32 %c, %d | ||
%3 = and i1 %0, %1 | ||
%4 = and i1 %3, %2 | ||
ret i1 %4 | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
; def fun(): | ||
; return 1 | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define void @fun() { | ||
entry: | ||
ret i32 1 | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
; def fun(): | ||
; return 2.1 | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define void @fun() { | ||
entry: | ||
ret double 2.100000e+00 | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
; def fun(): | ||
; return None | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define void @fun() { | ||
entry: | ||
ret void | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
; def fun(): | ||
; return True | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define void @fun() { | ||
entry: | ||
ret i1 true | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
; def fun(): | ||
; return False | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define void @fun() { | ||
entry: | ||
ret i1 false | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
; def fun(a: i32, b: i32): | ||
; del a, b | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define void @fun(i32 %a, i32 %b) { | ||
entry: | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
; def fun(): | ||
; return {1: 2, 3: 4} | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define void @fun() { | ||
entry: | ||
ret void | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
; def fun(a: i32, b: i32) -> i32: | ||
; return a if True else b | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define i32 @fun(i32 %a, i32 %b) { | ||
entry: | ||
%a1 = alloca i32, align 4 | ||
store i32 %a, ptr %a1, align 4 | ||
ret i32 %a | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
; def fun(a: bool, b: bool) -> f64: | ||
; if a: | ||
; return 0.0 | ||
; elif b: | ||
; return 1.0 | ||
; else: | ||
; return 3.0 | ||
; return 2.0 | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define double @fun(i1 %a, i1 %b) { | ||
entry: | ||
%b2 = alloca i1, align 1 | ||
store i1 %b, ptr %b2, align 1 | ||
ret double 2.000000e+00 | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
; def fun(a: i32) -> i32: | ||
; return a | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define i32 @fun(i32 %a) { | ||
entry: | ||
ret i32 %a | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
; def fun(c: i32): | ||
; return a := c | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define void @fun(i32 %c) { | ||
entry: | ||
ret i32 %c | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
; def fun(): | ||
; pass | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define void @fun() { | ||
entry: | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
; def fun(a: i32) -> i32: | ||
; return a | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define i32 @fun(i32 %a) { | ||
entry: | ||
ret i32 %a | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
; def fun(): | ||
; return {1, 2} | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define void @fun() { | ||
entry: | ||
ret void | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
; def fun(a: i32) -> i32: | ||
; return + a | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define i32 @fun(i32 %a) { | ||
entry: | ||
ret i32 %a | ||
ret void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
; def fun(a: i32) -> i32: | ||
; return - a | ||
; ModuleID = 'KiwiJIT' | ||
source_filename = "KiwiJIT" | ||
|
||
define i32 @fun(i32 %a) { | ||
entry: | ||
%subtmp = sub i32 0, %a | ||
ret i32 %subtmp | ||
ret void | ||
} |
Oops, something went wrong.