implement export control
This commit is contained in:
parent
54d734f6a4
commit
1b4943eb1f
27 changed files with 65 additions and 22 deletions
|
@ -20,6 +20,7 @@ function $alpha(l %p, w %l, l %n) {
|
|||
ret
|
||||
}
|
||||
|
||||
export
|
||||
function $test() {
|
||||
@start
|
||||
%p =l alloc4 17
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
type :fps = { s, b, s }
|
||||
|
||||
export
|
||||
function s $sum(:fps %p) {
|
||||
@start
|
||||
%f1 =s load %p
|
||||
|
|
|
@ -2,6 +2,7 @@ type :four = {l, b, w}
|
|||
|
||||
data $z = { w 0 }
|
||||
|
||||
export
|
||||
function $test() {
|
||||
@start
|
||||
%a =w loadw $z
|
||||
|
|
|
@ -18,6 +18,7 @@ function $alpha(l %p, w %l, l %n) {
|
|||
ret
|
||||
}
|
||||
|
||||
export
|
||||
function :mem $test() {
|
||||
@start
|
||||
%p =l alloc4 17
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
export
|
||||
function $test() {
|
||||
@start
|
||||
%x =l alloc16 16
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
# we use a fast local array to
|
||||
# memoize small collatz numbers
|
||||
|
||||
export
|
||||
function $test() {
|
||||
@start
|
||||
%mem =l alloc4 4000
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
# compiler from the C program
|
||||
# following in comments
|
||||
|
||||
export
|
||||
function w $main() {
|
||||
@start
|
||||
%v0 =l alloc8 4
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# counts up from -1988 to 1991
|
||||
|
||||
export
|
||||
function $test() {
|
||||
@start
|
||||
@loop
|
||||
|
|
|
@ -6,6 +6,7 @@ type :magic = align 1 { 0 }
|
|||
|
||||
data $ret = { l 0 }
|
||||
|
||||
export
|
||||
function $test(:magic %p) {
|
||||
@start
|
||||
%av =w loadw $a
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
export
|
||||
function $test() {
|
||||
@start
|
||||
%x1 =d copy d_0.1
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
export
|
||||
function w $main(w %argc, l %argv) {
|
||||
@start
|
||||
%fmt =l alloc8 8
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
# ssa program because of the
|
||||
# swap of b and a
|
||||
|
||||
export
|
||||
function $test() {
|
||||
@start
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
export
|
||||
function w $test() {
|
||||
@l0
|
||||
%a =l alloc4 4
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# simple looping program
|
||||
# sums all integers from 100 to 0
|
||||
|
||||
export
|
||||
function $test() {
|
||||
@start
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ function w $mandel(d %x, d %y) {
|
|||
ret 0
|
||||
}
|
||||
|
||||
export
|
||||
function w $main() {
|
||||
@main
|
||||
@loopy
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
data $arr = { b 10, b -60, b 10, b 100, b 200, b 0 }
|
||||
|
||||
export
|
||||
function $test() {
|
||||
@start
|
||||
@loop
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# find the 10,001st prime
|
||||
# store it in a
|
||||
|
||||
export
|
||||
function $test() {
|
||||
@start
|
||||
@loop
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
export
|
||||
function $main() {
|
||||
@start
|
||||
%y =l alloc4 4
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# Simple test for addressing modes.
|
||||
|
||||
export
|
||||
function w $sum(l %arr, w %num) {
|
||||
@start
|
||||
@loop
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue