summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-07-18 16:41:02 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-09-15 23:01:28 -0400
commite5a7482b54f0840d4b9fe37488020410cd67a684 (patch)
tree4d1132b650aa4f44f90f6bbaf1234c859715b5bf
parentc16532b9b0e1dc2678d764f4a655cfb8002cdf44 (diff)
downloadroux-e5a7482b54f0840d4b9fe37488020410cd67a684.tar.gz
rename mod to rem
-rw-r--r--lisc/lisc.h16
-rw-r--r--lisc/parse.c10
2 files changed, 11 insertions, 15 deletions
diff --git a/lisc/lisc.h b/lisc/lisc.h
index 7e8b75a..66f12ad 100644
--- a/lisc/lisc.h
+++ b/lisc/lisc.h
@@ -52,24 +52,20 @@ enum {
#define CONST(x) (Ref){RConst, x}
static inline int req(Ref a, Ref b)
-{
- return a.type == b.type && a.val == b.val;
-}
+{ return a.type == b.type && a.val == b.val; }
static inline int rtype(Ref r)
-{
- return req(r, R) ? -1 : r.type;
-}
+{ return req(r, R) ? -1 : r.type; }
enum {
OXXX = 0,
+ /* public instruction */
OAdd,
OSub,
ODiv,
- OMod,
- OCopy,
-
+ ORem,
/* reserved instructions */
- OX86Div,
+ OCopy,
+ OXDiv,
OLast
};
diff --git a/lisc/parse.c b/lisc/parse.c
index 7a9da59..6f5a030 100644
--- a/lisc/parse.c
+++ b/lisc/parse.c
@@ -13,7 +13,7 @@ OpDesc opdesc[OLast] = {
[OAdd] = { 2, 1, "add" },
[OSub] = { 2, 0, "sub" },
[ODiv] = { 2, 0, "div" },
- [OMod] = { 2, 0, "mod" },
+ [ORem] = { 2, 0, "mod" },
[OCopy] = { 1, 0, "copy" },
};
@@ -31,7 +31,7 @@ typedef enum {
TAdd,
TSub,
TDiv,
- TMod,
+ TRem,
TPhi,
TJmp,
TJez,
@@ -97,7 +97,7 @@ lex()
{ "add", TAdd },
{ "sub", TSub },
{ "div", TDiv },
- { "mod", TMod },
+ { "rem", TRem },
{ "phi", TPhi },
{ "jmp", TJmp },
{ "jez", TJez },
@@ -372,8 +372,8 @@ parseline(PState ps)
case TDiv:
op = ODiv;
break;
- case TMod:
- op = OMod;
+ case TRem:
+ op = ORem;
break;
case TPhi:
if (ps != PPhi)