3a_asm: ugly workaroud with ldil vs. ldilt
authorBernhard Urban <lewurm@gmail.com>
Fri, 17 Dec 2010 19:35:21 +0000 (20:35 +0100)
committerBernhard Urban <lewurm@gmail.com>
Fri, 17 Dec 2010 19:35:21 +0000 (20:35 +0100)
workaround now. just don't use ldil, since "low" is default anyway. kkthxbye

3_test/vm.s [new symlink]
3a_asm/DT.hs

diff --git a/3_test/vm.s b/3_test/vm.s
new file mode 120000 (symlink)
index 0000000..15350bc
--- /dev/null
@@ -0,0 +1 @@
+../8_benchs/src/vm.s
\ No newline at end of file
index 562285ba8c2d621e1febecb46f81cb4876218ba0..8696ebe145b23dd3e3dabe8b2f57341226497fe6 100644 (file)
@@ -70,6 +70,15 @@ condition = do
        let (Just ret) = lookup str conds
        return $ ret
 
+hlcondition :: Parser (Word32,Word32)
+hlcondition = try(do {
+               c1 <- condition;
+               return $ (0,c1)
+       }) <|> do {
+               hl <- highlow; c <- condition;
+               return $ (hl,c)
+       } <?> "DO NOT USE ldil (you can skip 'l' [low], since it is default)"
+
 carry :: Parser Word32
 carry = do { char 'c'; return 1} <|> do {string ""; return 0}
 
@@ -116,7 +125,7 @@ csv2m dict f = f<$>condition<%>reg<.>(iLit15 dict)<@>reg
 csv2i_cd dict f = f<$>carry<*>updateDisable<*>condition<%>reg<.>reg<.>(iLit5 dict)
 csv2i_d dict f = f<$>updateDisable<*>condition<%>reg<.>reg<.>(iLit5 dict)
 csv2i_scd dict f = f<$>sign<*>carry<*>updateDisable<*>condition<%>reg<.>reg<.>(iLit12 dict)
-csv2i_sl dict f = f<$>sign<*>highlow<*>condition<%>reg<.>(iLit16 dict)
+csv2i_sl dict f = f<$>sign<*>hlcondition<%>reg<.>(iLit16 dict)
 csv2i_lfd dict f = f<$>highlow<*>fill<*>updateDisable<*>condition<%>reg<.>(iLit16 dict)
 csv3_cd f = f<$>carry<*>updateDisable<*>condition<%>reg<.>reg<.>reg
 csv3_d f = f<$>updateDisable<*>condition<%>reg<.>reg<.>reg
@@ -188,7 +197,7 @@ aformi opcd s c d cond rd ra imm = pack [(cond,28),(opcd,23),(rd,19),(ra,15),(im
 aformi' opcd s c d cond rd ra = aformi opcd s c d cond rd ra 0
 
 lformi opcd hl f d cond rd imm = pack [(cond,28),(opcd,23),(rd,19),(imm,3),(hl,2),(f,1),(d,0)]
-lformi' opcd s hl cond rd imm = lformi opcd s hl 0 cond rd imm
+lformi' opcd s (hl,cond) rd imm = lformi opcd s hl 0 cond rd imm
 lformi'not opcd cond rd = lformi opcd 0 1 0 cond rd 0xefffffff
 
 mformi opcd cond rd disp ra = pack [(cond,28),(opcd,23),(rd,19),(ra,15),(disp,0)]