Commit a46c1d0a authored by Julian Kranz's avatar Julian Kranz
Browse files

X86 RREIL Translator

- Arithmetic adjust flag
parents 7aa5b39c 948b891f
......@@ -869,7 +869,8 @@ structure Cost = struct
"unop",
"binop",
"ternop",
"quaternop"])
"quaternop",
"void"])
;neverInline:=
Set.union
(!neverInline,
......
......@@ -34,6 +34,7 @@ end = struct
val update = get "update"
val query = get "query"
val slice = get "slice"
val void = get "void"
val answer = field (Atom.atom "1")
val state = field (Atom.atom "2")
fun select (f, e) = APP (SELECT f, [e])
......@@ -116,8 +117,10 @@ end = struct
in
(return, [a], FN (s, e))
end
val void = (void, [], RECORD [])
in
[>>=, >>, return, update, query]
[>>=, >>, return, update, query, void]
end
end
......
......@@ -235,7 +235,8 @@ structure Primitives = struct
FUN ([content'', VEC out], content''')], content''''),
flow = BD.meetVarImpliesVar (bvar content'''', bvar content') o
BD.meetVarImpliesVar (bvar content'''', bvar content''') o
BD.meetVarImpliesVar (bvar content'', bvar content')}
BD.meetVarImpliesVar (bvar content'', bvar content')},
{name="void", ty=UNIT, flow = noFlow}
]
val primitiveSizeConstraints =
......
......@@ -181,7 +181,7 @@ val sem-undef-arity-ge1 x = do
end
val sem-undef-arity0 x = do
0
return void
end
val sem-undef-arity1 x = do
......@@ -210,7 +210,7 @@ val sem-undef-varity x = do
end
val sem-undef-flow1 x = do
0
return void
end
val emit-parity-flag sz r = do
......@@ -240,7 +240,11 @@ val emit-arithmetic-adjust-flag sz r a b = do
# Hacker's Delight - How the Computer Sets Overflow for Signed Add/Subtract
t <- mktemp;
xorb sz t r a;
xorb sz t t b;
xorb sz t (var t) b;
andb sz t (var t) (imm 0x10);
af <- fAF;
cmpneq sz af (var t) (imm 0)
end
val emit-add-flags sz a b c = do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment