summaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2014-10-14 11:15:18 +0000
committerkr.angelov <kr.angelov@gmail.com>2014-10-14 11:15:18 +0000
commitac288386c44bdfab783ae2cdc0882d411a9c6b00 (patch)
tree5ed4e7aecc60b2066188a25f6e36654f52bd2925 /src/runtime
parentb5cc77aea18e5855e95ddc1fb67039d99a2e956a (diff)
the compiler now allows + to be used as a floating point addition in the abstract syntax
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/c/pgf/data.h3
-rw-r--r--src/runtime/c/pgf/jit.c5
-rw-r--r--src/runtime/haskell/PGF/Binary.hs1
-rw-r--r--src/runtime/haskell/PGF/ByteCode.hs2
4 files changed, 10 insertions, 1 deletions
diff --git a/src/runtime/c/pgf/data.h b/src/runtime/c/pgf/data.h
index e734434cd..8e2b726a7 100644
--- a/src/runtime/c/pgf/data.h
+++ b/src/runtime/c/pgf/data.h
@@ -136,7 +136,8 @@ typedef enum {
PGF_INSTR_PUSH = 9,
PGF_INSTR_EVAL = 10,
PGF_INSTR_DROP = 13,
- PGF_INSTR_FAIL = 14
+ PGF_INSTR_FAIL = 14,
+ PGF_INSTR_ADD = 15
} PgfInstruction;
typedef GuSeq PgfConcrs;
diff --git a/src/runtime/c/pgf/jit.c b/src/runtime/c/pgf/jit.c
index c97113b5a..8cb2257d6 100644
--- a/src/runtime/c/pgf/jit.c
+++ b/src/runtime/c/pgf/jit.c
@@ -1160,6 +1160,11 @@ pgf_jit_function(PgfReader* rdr, PgfAbstr* abstr,
#endif
jit_jmpi(abstr->eval_gates->mk_const);
break;
+ case PGF_INSTR_ADD:
+#ifdef PGF_JIT_DEBUG
+ gu_printf(out, err, "ADD\n");
+#endif
+ break;
default:
gu_impossible();
}
diff --git a/src/runtime/haskell/PGF/Binary.hs b/src/runtime/haskell/PGF/Binary.hs
index ca2784da2..9a74ac2f2 100644
--- a/src/runtime/haskell/PGF/Binary.hs
+++ b/src/runtime/haskell/PGF/Binary.hs
@@ -170,6 +170,7 @@ instance Binary Instr where
put (EVAL (GLOBAL id) (UpdateCall b c)) = putWord8 51 >> put id >> put (b,c)
put (DROP n l ) = putWord8 52 >> put (n,l)
put (FAIL ) = putWord8 56
+ put (ADD ) = putWord8 60
instance Binary Type where
put (DTyp hypos cat exps) = put (hypos,cat,exps)
diff --git a/src/runtime/haskell/PGF/ByteCode.hs b/src/runtime/haskell/PGF/ByteCode.hs
index 393efa5b9..ababdde0d 100644
--- a/src/runtime/haskell/PGF/ByteCode.hs
+++ b/src/runtime/haskell/PGF/ByteCode.hs
@@ -28,6 +28,7 @@ data Instr
| EVAL IVal TailInfo
| DROP {-# UNPACK #-} !Int {-# UNPACK #-} !CodeLabel
| FAIL
+ | ADD
data IVal
= HEAP {-# UNPACK #-} !Int
@@ -61,6 +62,7 @@ ppInstr (PUSH v) = text "PUSH " <+> ppIVal v
ppInstr (EVAL v ti) = text "EVAL " <+> ppIVal v <+> ppTailInfo ti
ppInstr (DROP n l ) = text "DROP " <+> int n <+> ppLabel l
ppInstr (FAIL ) = text "FAIL"
+ppInstr (ADD ) = text "ADD"
ppIVal (HEAP n) = text "hp" <> parens (int n)
ppIVal (ARG_VAR n) = text "stk" <> parens (int n)