Commit 005b79a1 authored by Julian Kranz's avatar Julian Kranz

X86 RREIL Translator

- Added semantics of: (V)PUNPCKHBW, (V)PUNPCKHWD, (V)PUNPCKHDQ, (V)PUNPCKHQDQ
parent 7b9a7dab
......@@ -422,9 +422,18 @@ main:
#vpsubusb %xmm1, %xmm2, %xmm3
#vpsubusw %xmm1, %xmm2, %xmm3
ptest %xmm1, %xmm2
vptest %xmm1, %xmm2
vptest %ymm1, %ymm2
#ptest %xmm1, %xmm2
#vptest %xmm1, %xmm2
#vptest %ymm1, %ymm2
punpckhbw %mm1, %mm2
punpckhwd %xmm1, %xmm2
punpckhdq %mm1, %mm2
punpckhqdq %xmm1, %xmm2
vpunpckhbw %xmm1, %xmm2, %xmm3
vpunpckhwd %xmm1, %xmm2, %xmm3
vpunpckhdq %xmm1, %xmm2, %xmm3
vpunpckhqdq %xmm1, %xmm2, %xmm3
#vmovd %xmm5, %ebx
......
......@@ -1691,6 +1691,38 @@ val sem-ptest-vptest x = do
mov 1 sf (imm 0)
end
val sem-punpck-vpunpck-opnd avx-encoded use-high element-size opnd1 opnd2 opnd3 = do
size <- sizeof1 opnd1;
src1 <- read size opnd2;
src2 <- read size opnd3;
dst <- lval size opnd1;
temp-src1 <- mktemp;
mov size temp-src1 src1;
temp-src2 <- mktemp;
mov size temp-src2 src2;
source-position <- return ((divb size 2)*use-high);
temp-dst <- mktemp;
let
val m i = do
dst-offset <- return (2*element-size*i);
src-offset <- return (element-size*i + source-position);
mov element-size (at-offset temp-dst dst-offset) (var (at-offset temp-src1 src-offset));
mov element-size (at-offset temp-dst (dst-offset + element-size)) (var (at-offset temp-src2 src-offset))
end
in
vector-apply size (2*element-size) m
end;
write-extend avx-encoded size dst (var temp-dst)
end
val sem-punpckh element-size x = sem-punpck-vpunpck-opnd '0' 1 element-size x.opnd1 x.opnd1 x.opnd2
val sem-vpunpckh element-size x = sem-punpck-vpunpck-opnd '1' 1 element-size x.opnd1 x.opnd2 x.opnd3
val ps-push opnd-sz opnd = do
mode64 <- mode64?;
stack-addr-sz <- runtime-stack-address-size;
......
......@@ -1461,10 +1461,10 @@ val semantics insn =
| PSUBUSW x: sem-psubus 16 x
| PSUBW x: sem-psub 16 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
| PUNPCKHWD x: sem-undef-arity2 x
| PUNPCKHBW x: sem-punpckh 8 x
| PUNPCKHDQ x: sem-punpckh 32 x
| PUNPCKHQDQ x: sem-punpckh 64 x
| PUNPCKHWD x: sem-punpckh 16 x
| PUNPCKLBW x: sem-undef-arity2 x
| PUNPCKLDQ x: sem-undef-arity2 x
| PUNPCKLQDQ x: sem-undef-arity2 x
......@@ -2161,10 +2161,22 @@ val semantics insn =
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
| VPUNPCKHWD x: sem-undef-varity x
| VPUNPCKHBW v:
case v of
VA3 x: sem-vpunpckh 8 x
end
| VPUNPCKHDQ v:
case v of
VA3 x: sem-vpunpckh 32 x
end
| VPUNPCKHQDQ v:
case v of
VA3 x: sem-vpunpckh 64 x
end
| VPUNPCKHWD v:
case v of
VA3 x: sem-vpunpckh 16 x
end
| VPUNPCKLBW x: sem-undef-varity x
| VPUNPCKLDQ x: sem-undef-varity x
| VPUNPCKLQDQ 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