Commit 7b9a7dab authored by Julian Kranz's avatar Julian Kranz

X86 RREIL Translator

- Added semantics of: (V)PTEST
parent af6ad5b2
......@@ -417,10 +417,14 @@ main:
#vpsubsb %xmm1, %xmm2, %xmm3
#vpsubsw %xmm1, %xmm2, %xmm3
psubusb (%rax), %mm1
psubusw (%rax), %xmm1
vpsubusb %xmm1, %xmm2, %xmm3
vpsubusw %xmm1, %xmm2, %xmm3
#psubusb (%rax), %mm1
#psubusw (%rax), %xmm1
#vpsubusb %xmm1, %xmm2, %xmm3
#vpsubusw %xmm1, %xmm2, %xmm3
ptest %xmm1, %xmm2
vptest %xmm1, %xmm2
vptest %ymm1, %ymm2
#vmovd %xmm5, %ebx
......
......@@ -1665,6 +1665,32 @@ val sem-vpsubs element-size x = sem-pbinop-opnd '1' element-size sub-signed-satu
val sem-psubus element-size x = sem-pbinop-opnd '0' element-size sub-unsigned-saturating x.opnd1 x.opnd1 x.opnd2
val sem-vpsubus element-size x = sem-pbinop-opnd '1' element-size sub-unsigned-saturating x.opnd1 x.opnd2 x.opnd3
val sem-ptest-vptest x = do
size <- sizeof1 x.opnd1;
src1 <- read size x.opnd1;
src2 <- read size x.opnd2;
temp <- mktemp;
andb size temp src1 src2;
zf <- fZF;
cmpeq size zf (var temp) (imm 0);
xorb size temp src1 (imm (0-1));
andb size temp (var temp) src2;
cf <- fCF;
cmpeq size cf (var temp) (imm 0);
af <- fAF;
mov 1 af (imm 0);
ov <- fOF;
mov 1 ov (imm 0);
pf <- fPF;
mov 1 pf (imm 0);
sf <- fSF;
mov 1 sf (imm 0)
end
val ps-push opnd-sz opnd = do
mode64 <- mode64?;
stack-addr-sz <- runtime-stack-address-size;
......
......@@ -1460,7 +1460,7 @@ val semantics insn =
| PSUBUSB x: sem-psubus 8 x
| PSUBUSW x: sem-psubus 16 x
| PSUBW x: sem-psub 16 x
| PTEST x: sem-undef-arity2 x
| PTEST x: sem-ptest-vptest x
| PUNPCKHBW x: sem-undef-arity2 x
| PUNPCKHDQ x: sem-undef-arity2 x
| PUNPCKHQDQ x: sem-undef-arity2 x
......@@ -2157,7 +2157,10 @@ val semantics insn =
case v of
VA3 x: sem-vpsub 16 x
end
| VPTEST x: sem-undef-varity x
| VPTEST v:
case v of
VA2 x: sem-ptest-vptest x
end
| VPUNPCKHBW x: sem-undef-varity x
| VPUNPCKHDQ x: sem-undef-varity x
| VPUNPCKHQDQ x: sem-undef-varity 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