diff options
| author | Gabriel Kerneis | 2014-02-12 17:03:37 +0000 |
|---|---|---|
| committer | Gabriel Kerneis | 2014-02-12 17:03:37 +0000 |
| commit | 46da9326ddd64e123294ebaa50265db4d1ba9835 (patch) | |
| tree | f9edee8f99a387ab2b1921b5a19cf66a3c07c55f /src/test | |
| parent | cdcd5880a27ff16fdafb82bdaab57ab361e1f546 (diff) | |
More library functions for interpreter
There is now enough stuff to decode and execute a very basic Branch
instruction (encoding everything as little-endian rather than big-
endian among many other work-arounds).
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/power.sail | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/test/power.sail b/src/test/power.sail index f0b56e11..9c07a39f 100644 --- a/src/test/power.sail +++ b/src/test/power.sail @@ -1,6 +1,10 @@ -val extern ( nat * nat ) -> nat effect pure (deinfix + ) = "add" -(* XXX type is wrong *) +(* XXX types are wrong *) +val extern forall Type 'a . ( 'a * 'a ) -> 'a effect pure (deinfix + ) = "add" val extern forall Type 'a . ( 'a * 'a ) -> 'a effect pure (deinfix : ) = "vec_concat" +val extern forall Type 'a . 'a -> nat effect pure to_num_inc = "to_num_inc" +val extern forall Type 'a . 'a -> nat effect pure to_num_dec = "to_num_dec" +val extern forall Type 'a . nat -> 'a effect pure to_vec_inc = "to_vec_inc" +val extern forall Type 'a . nat -> 'a effect pure to_vec_dec = "to_vec_dec" val extern forall Type 'a . ( 'a * 'a ) -> bit effect pure (deinfix != ) = "neq" @@ -190,8 +194,8 @@ end ast function unit main _ = { (* init *) - CIA := 0b0; - NIA := 0b0; + CIA := 0b10; + NIA := 0b11; (* should decode as Branch *) execute(decode(0b00000000000000000000000000010010)); |
