implement export control

This commit is contained in:
Quentin Carbonneaux 2016-03-28 10:30:55 -04:00
parent 54d734f6a4
commit 1b4943eb1f
27 changed files with 65 additions and 22 deletions

View file

@ -20,6 +20,7 @@ function $alpha(l %p, w %l, l %n) {
ret
}
export
function $test() {
@start
%p =l alloc4 17

View file

@ -1,5 +1,6 @@
type :fps = { s, b, s }
export
function s $sum(:fps %p) {
@start
%f1 =s load %p

View file

@ -2,6 +2,7 @@ type :four = {l, b, w}
data $z = { w 0 }
export
function $test() {
@start
%a =w loadw $z

View file

@ -18,6 +18,7 @@ function $alpha(l %p, w %l, l %n) {
ret
}
export
function :mem $test() {
@start
%p =l alloc4 17

View file

@ -18,6 +18,7 @@ data $fmt6 = { b "t6: %s\n", b 0 }
data $fmt7 = { b "t7: %f %f\n", b 0 }
data $fmt8 = { b "t8: %d %d %d %d\n", b 0 }
export
function $test() {
@start
%r1 =:st1 call $t1()

View file

@ -1,3 +1,4 @@
export
function $test() {
@start
%x =l alloc16 16

View file

@ -3,6 +3,7 @@
# we use a fast local array to
# memoize small collatz numbers
export
function $test() {
@start
%mem =l alloc4 4000

View file

@ -2,6 +2,7 @@
# compiler from the C program
# following in comments
export
function w $main() {
@start
%v0 =l alloc8 4

View file

@ -1,5 +1,6 @@
# counts up from -1988 to 1991
export
function $test() {
@start
@loop

View file

@ -6,6 +6,7 @@ type :magic = align 1 { 0 }
data $ret = { l 0 }
export
function $test(:magic %p) {
@start
%av =w loadw $a

View file

@ -1,3 +1,4 @@
export
function $test() {
@start
%x1 =d copy d_0.1

View file

@ -1,3 +1,4 @@
export
function w $main(w %argc, l %argv) {
@start
%fmt =l alloc8 8

View file

@ -3,6 +3,7 @@
# ssa program because of the
# swap of b and a
export
function $test() {
@start

View file

@ -1,3 +1,4 @@
export
function w $test() {
@l0
%a =l alloc4 4

View file

@ -1,5 +1,6 @@
# floating point casts and conversions
export
function s $fneg(s %f) {
@fneg
%b0 =w cast %f
@ -8,6 +9,7 @@ function s $fneg(s %f) {
ret %rs
}
export
function d $ftrunc(d %f) {
@ftrunc
%l0 =l ftosi %f

View file

@ -1,6 +1,7 @@
# simple looping program
# sums all integers from 100 to 0
export
function $test() {
@start

View file

@ -29,6 +29,7 @@ function w $mandel(d %x, d %y) {
ret 0
}
export
function w $main() {
@main
@loopy

View file

@ -6,6 +6,7 @@
data $arr = { b 10, b -60, b 10, b 100, b 200, b 0 }
export
function $test() {
@start
@loop

View file

@ -1,6 +1,7 @@
# find the 10,001st prime
# store it in a
export
function $test() {
@start
@loop

View file

@ -1,3 +1,4 @@
export
function $main() {
@start
%y =l alloc4 4

View file

@ -1,5 +1,6 @@
# Simple test for addressing modes.
export
function w $sum(l %arr, w %num) {
@start
@loop