diff options
author | Mike Pall <mike> | 2010-12-31 01:09:30 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2010-12-31 03:47:30 +0100 |
commit | 1f269610925829f55ed3e88e4af2b6575598adbc (patch) | |
tree | 69bce04f2686f7e05d77ff4445c78a4e9bc27a31 /src/buildvm_fold.c | |
parent | 65b194a2f89eb315029724af56354bb527021192 (diff) | |
download | luajit-1f269610925829f55ed3e88e4af2b6575598adbc.tar.gz luajit-1f269610925829f55ed3e88e4af2b6575598adbc.tar.bz2 luajit-1f269610925829f55ed3e88e4af2b6575598adbc.zip |
Refactoring of conversion ops, part 3: add FOLD rules for IR_CONV.
Diffstat (limited to 'src/buildvm_fold.c')
-rw-r--r-- | src/buildvm_fold.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/buildvm_fold.c b/src/buildvm_fold.c index 468e5300..5f463575 100644 --- a/src/buildvm_fold.c +++ b/src/buildvm_fold.c | |||
@@ -124,7 +124,7 @@ static uint32_t nexttoken(char **pp, int allowlit, int allowany) | |||
124 | if (*p == '\0') | 124 | if (*p == '\0') |
125 | return i; | 125 | return i; |
126 | } else if (allowany && !strcmp("any", p)) { | 126 | } else if (allowany && !strcmp("any", p)) { |
127 | return 0xff; | 127 | return allowany; |
128 | } else { | 128 | } else { |
129 | for (i = 0; ir_names[i]; i++) | 129 | for (i = 0; ir_names[i]; i++) |
130 | if (!strcmp(ir_names[i], p)) | 130 | if (!strcmp(ir_names[i], p)) |
@@ -140,9 +140,9 @@ static uint32_t nexttoken(char **pp, int allowlit, int allowany) | |||
140 | static void foldrule(char *p) | 140 | static void foldrule(char *p) |
141 | { | 141 | { |
142 | uint32_t op = nexttoken(&p, 0, 0); | 142 | uint32_t op = nexttoken(&p, 0, 0); |
143 | uint32_t left = nexttoken(&p, 0, 1); | 143 | uint32_t left = nexttoken(&p, 0, 0x7f); |
144 | uint32_t right = nexttoken(&p, 1, 1); | 144 | uint32_t right = nexttoken(&p, 1, 0x3ff); |
145 | uint32_t key = (funcidx << 24) | (op << 16) | (left << 8) | right; | 145 | uint32_t key = (funcidx << 24) | (op << 17) | (left << 10) | right; |
146 | uint32_t i; | 146 | uint32_t i; |
147 | if (nkeys >= BUILD_MAX_FOLD) { | 147 | if (nkeys >= BUILD_MAX_FOLD) { |
148 | fprintf(stderr, "Error: too many fold rules, increase BUILD_MAX_FOLD.\n"); | 148 | fprintf(stderr, "Error: too many fold rules, increase BUILD_MAX_FOLD.\n"); |