Commit 93a5a8e5 authored by Julian Kranz's avatar Julian Kranz

X86 RREIL Translator

- Finished to add semantics of: ROR
parent 3830c15e
......@@ -448,9 +448,13 @@ main:
#pxor %xmm1, %xmm2
#vpxor %xmm1, %xmm2, %xmm3
rol $42, %al
rol %cl, %rax
rol $1, %eax
#rol $42, %al
#rol %cl, %rax
#rol $1, %eax
ror $42, %al
ror %cl, %rax
ror $1, %eax
#vmovd %xmm5, %ebx
......
......@@ -1884,11 +1884,11 @@ val sem-rol x = do
orb size temp-dst (var (at-offset temp-dst size)) (var temp-dst);
temp <- mktemp;
sub size temp (imm size) (var temp-count);
shr size temp src (var temp);
#sub size temp (imm size) (var temp-count);
#shr size temp src (var temp);
cf <- fCF;
mov 1 cf (var temp);
mov 1 cf (var temp-dst);
ov <- fOF;
andb size temp count (imm count-mask);
......@@ -1901,6 +1901,54 @@ val sem-rol x = do
write size dst (var temp-dst)
end
val sem-ror x = do
size <- sizeof1 x.opnd1;
src <- read size x.opnd1;
dst <- lval size x.opnd1;
count <- read size x.opnd2;
count-mask <- return (
if x.opnd-sz === 64 then
0x3f
else
0x1f
);
count-mask-full <- return (
case size of
64: 0x3f
| 32: 0x1f
| 16: 0x0f
| 8: 0x07
end
);
temp-count <- mktemp;
andb size temp-count count (imm count-mask-full);
temp-dst <- mktemp;
mov size (at-offset temp-dst size) src;
mov size temp-dst (imm 0);
shr (2*size) temp-dst (var temp-dst) (var temp-count);
orb size temp-dst (var (at-offset temp-dst size)) (var temp-dst);
temp <- mktemp;
cf <- fCF;
mov 1 cf (var (at-offset temp-dst (size - 1)));
ov <- fOF;
andb size temp count (imm count-mask);
_if (/eq size (var temp) (imm 1)) _then
xorb 1 ov (var (at-offset temp-dst (size - 1))) (var (at-offset temp-dst (size - 2)))
_else
undef 1 ov
;
write size dst (var temp-dst)
end
val sem-rep-repe-repne size sem fc = do
count-reg <- return (semantic-register-of (register-by-size low C size));
......
......@@ -1490,7 +1490,7 @@ val semantics insn =
| RET x: sem-ret x
| RET_FAR x: sem-ret-far x
| ROL x: sem-rol x
| ROR x: sem-undef-arity2 x
| ROR x: sem-ror x
| ROUNDPD x: sem-undef-arity3 x
| ROUNDPS x: sem-undef-arity3 x
| ROUNDSD x: sem-undef-arity3 x
......
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