From 79de90a76b7822145fcc57f45afb83ac34225bbf Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Fri, 17 Dec 2010 20:35:21 +0100 Subject: [PATCH] 3a_asm: ugly workaroud with ldil vs. ldilt workaround now. just don't use ldil, since "low" is default anyway. kkthxbye --- 3_test/vm.s | 1 + 3a_asm/DT.hs | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 120000 3_test/vm.s diff --git a/3_test/vm.s b/3_test/vm.s new file mode 120000 index 0000000..15350bc --- /dev/null +++ b/3_test/vm.s @@ -0,0 +1 @@ +../8_benchs/src/vm.s \ No newline at end of file diff --git a/3a_asm/DT.hs b/3a_asm/DT.hs index 562285b..8696ebe 100644 --- a/3a_asm/DT.hs +++ b/3a_asm/DT.hs @@ -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)] -- 2.25.1