-
Notifications
You must be signed in to change notification settings - Fork 1
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
alexander.nutz
committed
Feb 4, 2025
1 parent
9bf5a24
commit d0910f6
Showing
32 changed files
with
129 additions
and
13 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
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
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
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
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
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
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
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,4 @@ | ||
fn int addfirst4(int* z) @export | ||
{ | ||
return z[0] + z[1] + z[2] + z[3]; | ||
} |
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 @@ | ||
("amd64:cmov" (opt ((max_total_cmov_inline_cost 4) (consteval_iterations 6) (loop_simplify 1) (if_eval 1))) (type ("int" simple ((float 0) (size 4) (align 4)))) (type ("int*" simple ((float 0) (size 8) (align 64)))) (type ("long" simple ((float 0) (size 8) (align 8)))) (cu-block (((name "addfirst4") (export 1)) (block ((args (("int*" 1))) (ops (((outs (("int" 0))) (name "imm") (params (("val" (uninit)))) (args ())) ((outs (("long" 2))) (name "imm") (params (("val" (int 0)))) (args ())) ((outs (("int*" 3))) (name "mul") (params (("a" (var 2)) ("b" (int 4)))) (args ())) ((outs (("int*" 4))) (name "add") (params (("a" (var 1)) ("b" (var 3)))) (args ())) ((outs (("int" 5))) (name "load") (params (("addr" (var 4)))) (args ())) ((outs (("long" 6))) (name "imm") (params (("val" (int 1)))) (args ())) ((outs (("int*" 7))) (name "mul") (params (("a" (var 6)) ("b" (int 4)))) (args ())) ((outs (("int*" 8))) (name "add") (params (("a" (var 1)) ("b" (var 7)))) (args ())) ((outs (("int" 9))) (name "load") (params (("addr" (var 8)))) (args ())) ((outs (("int" 10))) (name "add") (params (("a" (var 9)) ("b" (var 5)))) (args ())) ((outs (("long" 11))) (name "imm") (params (("val" (int 2)))) (args ())) ((outs (("int*" 12))) (name "mul") (params (("a" (var 11)) ("b" (int 4)))) (args ())) ((outs (("int*" 13))) (name "add") (params (("a" (var 1)) ("b" (var 12)))) (args ())) ((outs (("int" 14))) (name "load") (params (("addr" (var 13)))) (args ())) ((outs (("int" 15))) (name "add") (params (("a" (var 14)) ("b" (var 10)))) (args ())) ((outs (("long" 16))) (name "imm") (params (("val" (int 3)))) (args ())) ((outs (("int*" 17))) (name "mul") (params (("a" (var 16)) ("b" (int 4)))) (args ())) ((outs (("int*" 18))) (name "add") (params (("a" (var 1)) ("b" (var 17)))) (args ())) ((outs (("int" 19))) (name "load") (params (("addr" (var 18)))) (args ())) ((outs (("int" 20))) (name "add") (params (("a" (var 19)) ("b" (var 15)))) (args ())) ((outs ()) (name "ret") (params ()) (args ((var 20)))))) (rets (0))))))) |
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 @@ | ||
fn int assignments(int y) @export | ||
{ | ||
int x = 0; | ||
x += y; | ||
x -= y; | ||
x %= y; | ||
x /= y; | ||
x *= y; | ||
x <<= y; | ||
x >>= y; | ||
x |= y; | ||
x &= y; | ||
return (int) x; | ||
} | ||
|
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 @@ | ||
("amd64:cmov" (opt ((max_total_cmov_inline_cost 4) (consteval_iterations 6) (loop_simplify 1) (if_eval 1))) (type ("int" simple ((float 0) (size 4) (align 4)))) (cu-block (((name "assignments") (export 1)) (block ((args (("int" 1))) (ops (((outs (("int" 0))) (name "imm") (params (("val" (uninit)))) (args ())) ((outs (("int" 3))) (name "imm") (params (("val" (int 0)))) (args ())) ((outs (("int" 2))) (name "imm") (params (("val" (var 3)))) (args ())) ((outs (("int" 4))) (name "add") (params (("a" (var 1)) ("b" (var 2)))) (args ())) ((outs (("int" 2))) (name "imm") (params (("val" (var 4)))) (args ())) ((outs (("int" 5))) (name "sub") (params (("a" (var 1)) ("b" (var 2)))) (args ())) ((outs (("int" 2))) (name "imm") (params (("val" (var 5)))) (args ())) ((outs (("int" 6))) (name "mod") (params (("a" (var 1)) ("b" (var 2)))) (args ())) ((outs (("int" 2))) (name "imm") (params (("val" (var 6)))) (args ())) ((outs (("int" 7))) (name "sdiv") (params (("a" (var 1)) ("b" (var 2)))) (args ())) ((outs (("int" 2))) (name "imm") (params (("val" (var 7)))) (args ())) ((outs (("int" 8))) (name "mul") (params (("a" (var 1)) ("b" (var 2)))) (args ())) ((outs (("int" 2))) (name "imm") (params (("val" (var 8)))) (args ())) ((outs (("int" 9))) (name "shl") (params (("a" (var 1)) ("b" (var 2)))) (args ())) ((outs (("int" 2))) (name "imm") (params (("val" (var 9)))) (args ())) ((outs (("int" 10))) (name "ashr") (params (("a" (var 1)) ("b" (var 2)))) (args ())) ((outs (("int" 2))) (name "imm") (params (("val" (var 10)))) (args ())) ((outs (("int" 11))) (name "or") (params (("a" (var 1)) ("b" (var 2)))) (args ())) ((outs (("int" 2))) (name "imm") (params (("val" (var 11)))) (args ())) ((outs (("int" 12))) (name "bwand") (params (("a" (var 1)) ("b" (var 2)))) (args ())) ((outs (("int" 2))) (name "imm") (params (("val" (var 12)))) (args ())) ((outs ()) (name "ret") (params ()) (args ((var 2)))))) (rets (0))))))) |
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,4 @@ | ||
set -e | ||
for f in *.c3; do | ||
../../build/c3c* compile-only $f --use-stdlib=no --backend=vxcc --emit-asm > $f.s | ||
done |
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,4 @@ | ||
fn int cmp(int a, int b) @export | ||
{ | ||
return (int) (a > 20 && a < b); | ||
} |
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 @@ | ||
("amd64:cmov" (opt ((max_total_cmov_inline_cost 4) (consteval_iterations 6) (loop_simplify 1) (if_eval 1))) (type ("int" simple ((float 0) (size 4) (align 4)))) (type ("bool" simple ((float 0) (size 1) (align 1)))) (cu-block (((name "cmp") (export 1)) (block ((args (("int" 1) ("int" 2))) (ops (((outs (("int" 0))) (name "imm") (params (("val" (uninit)))) (args ())) ((outs (("int" 3))) (name "imm") (params (("val" (int 20)))) (args ())) ((outs (("bool" 4))) (name "sgt") (params (("a" (var 1)) ("b" (var 3)))) (args ())) ((outs (("bool" 5))) (name "slt") (params (("a" (var 1)) ("b" (var 2)))) (args ())) ((outs (("bool" 6))) (name "and") (params (("a" (var 5)) ("b" (var 4)))) (args ())) ((outs (("int" 7))) (name "sx") (params (("val" (var 6)))) (args ())) ((outs ()) (name "ret") (params ()) (args ((var 7)))))) (rets (0))))))) |
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 @@ | ||
fn void colwise_reduce_sum(int* dest, int* a, usz w, usz h) @export | ||
{ | ||
for (usz col = 0; col < w; col ++) | ||
{ | ||
int sum = 0; | ||
for (usz row = 0; row < h; row ++) | ||
{ | ||
sum += a[col * w + row]; | ||
} | ||
dest[col] = sum; | ||
} | ||
} |
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 @@ | ||
("amd64:cmov" (opt ((max_total_cmov_inline_cost 4) (consteval_iterations 6) (loop_simplify 1) (if_eval 1))) (type ("int*" simple ((float 0) (size 8) (align 64)))) (type ("ulong" simple ((float 0) (size 8) (align 8)))) (type ("bool" simple ((float 0) (size 1) (align 1)))) (type ("int" simple ((float 0) (size 4) (align 4)))) (cu-block (((name "colwise_reduce_sum") (export 1)) (block ((args (("int*" 1) ("int*" 2) ("ulong" 3) ("ulong" 4))) (ops (((outs ()) (name "cfor") (params (("start" (block ((args ()) (ops (((outs (("ulong" 5))) (name "imm") (params (("val" (int 0)))) (args ())) ((outs (("ulong" 6))) (name "imm") (params (("val" (var 5)))) (args ())))) (rets ())))) ("cond" (block ((args ()) (ops (((outs (("bool" 7))) (name "ult") (params (("a" (var 6)) ("b" (var 3)))) (args ())))) (rets (7))))) ("endex" (block ((args ()) (ops (((outs (("ulong" 8))) (name "add") (params (("a" (var 6)) ("b" (int 1)))) (args ())) ((outs (("ulong" 6))) (name "imm") (params (("val" (var 8)))) (args ())))) (rets ())))) ("do" (block ((args ()) (ops (((outs (("int" 10))) (name "imm") (params (("val" (int 0)))) (args ())) ((outs (("int" 9))) (name "imm") (params (("val" (var 10)))) (args ())) ((outs ()) (name "cfor") (params (("start" (block ((args ()) (ops (((outs (("ulong" 11))) (name "imm") (params (("val" (int 0)))) (args ())) ((outs (("ulong" 12))) (name "imm") (params (("val" (var 11)))) (args ())))) (rets ())))) ("cond" (block ((args ()) (ops (((outs (("bool" 13))) (name "ult") (params (("a" (var 12)) ("b" (var 4)))) (args ())))) (rets (13))))) ("endex" (block ((args ()) (ops (((outs (("ulong" 14))) (name "add") (params (("a" (var 12)) ("b" (int 1)))) (args ())) ((outs (("ulong" 12))) (name "imm") (params (("val" (var 14)))) (args ())))) (rets ())))) ("do" (block ((args ()) (ops (((outs (("ulong" 15))) (name "mul") (params (("a" (var 3)) ("b" (var 6)))) (args ())) ((outs (("ulong" 16))) (name "add") (params (("a" (var 12)) ("b" (var 15)))) (args ())) ((outs (("int*" 17))) (name "mul") (params (("a" (var 16)) ("b" (int 4)))) (args ())) ((outs (("int*" 18))) (name "add") (params (("a" (var 2)) ("b" (var 17)))) (args ())) ((outs (("int" 19))) (name "load") (params (("addr" (var 18)))) (args ())) ((outs (("int" 20))) (name "add") (params (("a" (var 19)) ("b" (var 9)))) (args ())) ((outs (("int" 9))) (name "imm") (params (("val" (var 20)))) (args ())))) (rets ())))))) (args ())) ((outs (("int*" 21))) (name "mul") (params (("a" (var 6)) ("b" (int 4)))) (args ())) ((outs (("int*" 22))) (name "add") (params (("a" (var 1)) ("b" (var 21)))) (args ())) ((outs (("int" 23))) (name "load") (params (("addr" (var 22)))) (args ())) ((outs (("int*" 24))) (name "mul") (params (("a" (var 6)) ("b" (int 4)))) (args ())) ((outs (("int*" 25))) (name "add") (params (("a" (var 1)) ("b" (var 24)))) (args ())) ((outs ()) (name "store") (params (("addr" (var 25)) ("val" (var 9)))) (args ())))) (rets ())))))) (args ())))) (rets ())))))) |
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,7 @@ | ||
fn void eltwise_add(int* o, int* a, int* b, usz len) @export | ||
{ | ||
for (usz i = 0; i < len; i ++) | ||
{ | ||
o[i] = a[i] + b[i]; | ||
} | ||
} |
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 @@ | ||
("amd64:cmov" (opt ((max_total_cmov_inline_cost 4) (consteval_iterations 6) (loop_simplify 1) (if_eval 1))) (type ("int*" simple ((float 0) (size 8) (align 64)))) (type ("ulong" simple ((float 0) (size 8) (align 8)))) (type ("bool" simple ((float 0) (size 1) (align 1)))) (type ("int" simple ((float 0) (size 4) (align 4)))) (cu-block (((name "eltwise_add") (export 1)) (block ((args (("int*" 1) ("int*" 2) ("int*" 3) ("ulong" 4))) (ops (((outs ()) (name "cfor") (params (("start" (block ((args ()) (ops (((outs (("ulong" 5))) (name "imm") (params (("val" (int 0)))) (args ())) ((outs (("ulong" 6))) (name "imm") (params (("val" (var 5)))) (args ())))) (rets ())))) ("cond" (block ((args ()) (ops (((outs (("bool" 7))) (name "ult") (params (("a" (var 6)) ("b" (var 4)))) (args ())))) (rets (7))))) ("endex" (block ((args ()) (ops (((outs (("ulong" 8))) (name "add") (params (("a" (var 6)) ("b" (int 1)))) (args ())) ((outs (("ulong" 6))) (name "imm") (params (("val" (var 8)))) (args ())))) (rets ())))) ("do" (block ((args ()) (ops (((outs (("int*" 9))) (name "mul") (params (("a" (var 6)) ("b" (int 4)))) (args ())) ((outs (("int*" 10))) (name "add") (params (("a" (var 1)) ("b" (var 9)))) (args ())) ((outs (("int" 11))) (name "load") (params (("addr" (var 10)))) (args ())) ((outs (("int*" 12))) (name "mul") (params (("a" (var 6)) ("b" (int 4)))) (args ())) ((outs (("int*" 13))) (name "add") (params (("a" (var 2)) ("b" (var 12)))) (args ())) ((outs (("int" 14))) (name "load") (params (("addr" (var 13)))) (args ())) ((outs (("int*" 15))) (name "mul") (params (("a" (var 6)) ("b" (int 4)))) (args ())) ((outs (("int*" 16))) (name "add") (params (("a" (var 3)) ("b" (var 15)))) (args ())) ((outs (("int" 17))) (name "load") (params (("addr" (var 16)))) (args ())) ((outs (("int" 18))) (name "add") (params (("a" (var 17)) ("b" (var 14)))) (args ())) ((outs (("int*" 19))) (name "mul") (params (("a" (var 6)) ("b" (int 4)))) (args ())) ((outs (("int*" 20))) (name "add") (params (("a" (var 1)) ("b" (var 19)))) (args ())) ((outs ()) (name "store") (params (("addr" (var 20)) ("val" (var 18)))) (args ())))) (rets ())))))) (args ())))) (rets ())))))) |
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 @@ | ||
fn int max(int a, int b) @export | ||
{ | ||
int res; | ||
if (a > b) { | ||
res = a; | ||
} else { | ||
res = b; | ||
} | ||
return res; | ||
} |
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 @@ | ||
("amd64:cmov" (opt ((max_total_cmov_inline_cost 4) (consteval_iterations 6) (loop_simplify 1) (if_eval 1))) (type ("int" simple ((float 0) (size 4) (align 4)))) (type ("bool" simple ((float 0) (size 1) (align 1)))) (cu-block (((name "max") (export 1)) (block ((args (("int" 1) ("int" 2))) (ops (((outs (("int" 0))) (name "imm") (params (("val" (uninit)))) (args ())) ((outs (("int" 3))) (name "imm") (params (("val" (uninit)))) (args ())) ((outs ()) (name "if") (params (("cond" (var 4)) ("then" (block ((args ()) (ops (((outs (("int" 3))) (name "imm") (params (("val" (var 1)))) (args ())))) (rets ())))) ("else" (block ((args ()) (ops (((outs (("int" 3))) (name "imm") (params (("val" (var 2)))) (args ())))) (rets ())))))) (args ())) ((outs (("bool" 4))) (name "sgt") (params (("a" (var 1)) ("b" (var 2)))) (args ())) ((outs ()) (name "ret") (params ()) (args ((var 3)))))) (rets (0))))))) |
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 @@ | ||
fn int max2(int a, int b) @export | ||
{ | ||
if (a > b) { | ||
return a; | ||
} | ||
else { | ||
return b; | ||
} | ||
} |
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 @@ | ||
("amd64:cmov" (opt ((max_total_cmov_inline_cost 4) (consteval_iterations 6) (loop_simplify 1) (if_eval 1))) (type ("int" simple ((float 0) (size 4) (align 4)))) (type ("bool" simple ((float 0) (size 1) (align 1)))) (cu-block (((name "max2") (export 1)) (block ((args (("int" 1) ("int" 2))) (ops (((outs (("int" 0))) (name "imm") (params (("val" (uninit)))) (args ())) ((outs ()) (name "if") (params (("cond" (var 3)) ("then" (block ((args ()) (ops (((outs ()) (name "ret") (params ()) (args ((var 1)))))) (rets ())))) ("else" (block ((args ()) (ops (((outs ()) (name "ret") (params ()) (args ((var 2)))))) (rets ())))))) (args ())) ((outs (("bool" 3))) (name "sgt") (params (("a" (var 1)) ("b" (var 2)))) (args ())))) (rets (0))))))) |
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,7 @@ | ||
fn int max3(int a, int b) @export | ||
{ | ||
if (a > b) { | ||
return a; | ||
} | ||
return b; | ||
} |
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 @@ | ||
("amd64:cmov" (opt ((max_total_cmov_inline_cost 4) (consteval_iterations 6) (loop_simplify 1) (if_eval 1))) (type ("int" simple ((float 0) (size 4) (align 4)))) (type ("bool" simple ((float 0) (size 1) (align 1)))) (cu-block (((name "max3") (export 1)) (block ((args (("int" 1) ("int" 2))) (ops (((outs (("int" 0))) (name "imm") (params (("val" (uninit)))) (args ())) ((outs ()) (name "if") (params (("cond" (var 3)) ("then" (block ((args ()) (ops (((outs ()) (name "ret") (params ()) (args ((var 1)))))) (rets ())))) ("else" (block ((args ()) (ops ()) (rets ())))))) (args ())) ((outs (("bool" 3))) (name "sgt") (params (("a" (var 1)) ("b" (var 2)))) (args ())) ((outs ()) (name "ret") (params ()) (args ((var 2)))))) (rets (0))))))) |
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,4 @@ | ||
fn usz test(int a, int b) @export | ||
{ | ||
return ((usz) (&a)) + b; | ||
} |
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 @@ | ||
("amd64:cmov" (opt ((max_total_cmov_inline_cost 4) (consteval_iterations 6) (loop_simplify 1) (if_eval 1))) (type ("ulong" simple ((float 0) (size 8) (align 8)))) (type ("int" simple ((float 0) (size 4) (align 4)))) (type ("long" simple ((float 0) (size 8) (align 8)))) (type ("int*" simple ((float 0) (size 8) (align 64)))) (cu-block (((name "test") (export 1)) (block ((args (("int" 1) ("int" 2))) (ops (((outs (("ulong" 0))) (name "imm") (params (("val" (uninit)))) (args ())) ((outs (("int*" 3))) (name "place") (params (("var" (var 1)))) (args ())) ((outs (("long" 4))) (name "bitcast") (params (("val" (var 3)))) (args ())) ((outs (("long" 5))) (name "sx") (params (("val" (var 2)))) (args ())) ((outs (("long" 6))) (name "add") (params (("a" (var 5)) ("b" (var 4)))) (args ())) ((outs (("ulong" 7))) (name "bitcast") (params (("val" (var 6)))) (args ())) ((outs ()) (name "ret") (params ()) (args ((var 7)))))) (rets (0))))))) |
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,4 @@ | ||
fn int ptrtest(int* z) @export | ||
{ | ||
return z[2]; | ||
} |
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 @@ | ||
("amd64:cmov" (opt ((max_total_cmov_inline_cost 4) (consteval_iterations 6) (loop_simplify 1) (if_eval 1))) (type ("int" simple ((float 0) (size 4) (align 4)))) (type ("int*" simple ((float 0) (size 8) (align 64)))) (type ("long" simple ((float 0) (size 8) (align 8)))) (cu-block (((name "ptrtest") (export 1)) (block ((args (("int*" 1))) (ops (((outs (("int" 0))) (name "imm") (params (("val" (uninit)))) (args ())) ((outs (("long" 2))) (name "imm") (params (("val" (int 2)))) (args ())) ((outs (("int*" 3))) (name "mul") (params (("a" (var 2)) ("b" (int 4)))) (args ())) ((outs (("int*" 4))) (name "add") (params (("a" (var 1)) ("b" (var 3)))) (args ())) ((outs (("int" 5))) (name "load") (params (("addr" (var 4)))) (args ())) ((outs ()) (name "ret") (params ()) (args ((var 5)))))) (rets (0))))))) |
Oops, something went wrong.