summaryrefslogtreecommitdiff
path: root/rts/Interpreter.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2009-09-18 13:32:04 +0000
committerSimon Marlow <marlowsd@gmail.com>2009-09-18 13:32:04 +0000
commit656e9d6b1db053c88ba1518b6095060347e09418 (patch)
treed49e31cdb0bdfd918fbc4dce77f37c2839490a03 /rts/Interpreter.c
parentba67234542412c2ca6656dbeadb7d225bc94d4b2 (diff)
downloadhaskell-656e9d6b1db053c88ba1518b6095060347e09418.tar.gz
implement case-on-Word in the byte code generator/interpreter (#2881)
Diffstat (limited to 'rts/Interpreter.c')
-rw-r--r--rts/Interpreter.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/rts/Interpreter.c b/rts/Interpreter.c
index 9c494c1f29..ea2064fd04 100644
--- a/rts/Interpreter.c
+++ b/rts/Interpreter.c
@@ -1227,6 +1227,27 @@ run_BCO:
goto nextInsn;
}
+ case bci_TESTLT_W: {
+ // There should be an Int at Sp[1], and an info table at Sp[0].
+ int discr = BCO_NEXT;
+ int failto = BCO_GET_LARGE_ARG;
+ W_ stackWord = (W_)Sp[1];
+ if (stackWord >= (W_)BCO_LIT(discr))
+ bciPtr = failto;
+ goto nextInsn;
+ }
+
+ case bci_TESTEQ_W: {
+ // There should be an Int at Sp[1], and an info table at Sp[0].
+ int discr = BCO_NEXT;
+ int failto = BCO_GET_LARGE_ARG;
+ W_ stackWord = (W_)Sp[1];
+ if (stackWord != (W_)BCO_LIT(discr)) {
+ bciPtr = failto;
+ }
+ goto nextInsn;
+ }
+
case bci_TESTLT_D: {
// There should be a Double at Sp[1], and an info table at Sp[0].
int discr = BCO_NEXT;