From 46da9326ddd64e123294ebaa50265db4d1ba9835 Mon Sep 17 00:00:00 2001 From: Gabriel Kerneis Date: Wed, 12 Feb 2014 17:03:37 +0000 Subject: 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). --- src/test/power.sail | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/test') 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)); -- cgit v1.2.3