Commit 2692adb7 authored by Julian Kranz's avatar Julian Kranz

X86 RREIL Translator

- Added semantics of: (V)PSLLW, (V)PSLLD, (V)PSLLQ
parent 7d3a24f1
......@@ -381,8 +381,16 @@ main:
#vpsignw %xmm1, %xmm2, %xmm3
#vpsignd %xmm1, %xmm2, %xmm3
pslldq $73, %xmm1
vpslldq $5, %xmm1, %xmm2
#pslldq $73, %xmm1
#vpslldq $5, %xmm1, %xmm2
psllw %mm1, %mm2
psllw (%rax), %xmm1
psllw $197, %xmm1
pslld $20, %mm1
psllq $10, %mm1
vpslld %xmm1, %xmm2, %xmm3
vpsllq $33, %xmm1, %xmm2
#vmovd %xmm5, %ebx
......
......@@ -1663,6 +1663,32 @@ end
val sem-pslldq x = sem-pslldq-vpslldq-opnd '0' x.opnd1 x.opnd1 x.opnd2
val sem-vpslldq x = sem-pslldq-vpslldq-opnd '1' x.opnd1 x.opnd2 x.opnd3
val sem-psll-vpsll-opnd avx-encoded element-size opnd1 opnd2 opnd3 = do
size <- sizeof1 opnd1;
src <- read size opnd2;
count <- read element-size opnd3;
dst <- lval size opnd1;
temp-src <- mktemp;
mov size temp-src src;
temp-dst <- mktemp;
let
val m i = do
offset <- return (element-size*i);
shl element-size (at-offset temp-dst offset) (var (at-offset temp-src offset)) count
end
in
vector-apply size element-size m
end;
write-extend avx-encoded size dst (var temp-dst)
end
val sem-psll element-size x = sem-psll-vpsll-opnd '0' element-size x.opnd1 x.opnd1 x.opnd2
val sem-vpsll element-size x = sem-psll-vpsll-opnd '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;
......
......@@ -1422,10 +1422,10 @@ val semantics insn =
| PSIGNB x: sem-psign 8 x
| PSIGND x: sem-psign 32 x
| PSIGNW x: sem-psign 16 x
| PSLLD x: sem-undef-arity2 x
| PSLLD x: sem-psll 32 x
| PSLLDQ x: sem-pslldq x
| PSLLQ x: sem-undef-arity2 x
| PSLLW x: sem-undef-arity2 x
| PSLLQ x: sem-psll 64 x
| PSLLW x: sem-psll 16 x
| PSRAD x: sem-undef-arity2 x
| PSRAW x: sem-undef-arity2 x
| PSRLD x: sem-undef-arity2 x
......@@ -2065,13 +2065,22 @@ val semantics insn =
case v of
VA3 x: sem-vpsign 16 x
end
| VPSLLD x: sem-undef-varity x
| VPSLLD v:
case v of
VA3 x: sem-vpsll 32 x
end
| VPSLLDQ v:
case v of
VA3 x: sem-vpslldq x
end
| VPSLLQ x: sem-undef-varity x
| VPSLLW x: sem-undef-varity x
| VPSLLQ v:
case v of
VA3 x: sem-vpsll 64 x
end
| VPSLLW v:
case v of
VA3 x: sem-vpsll 16 x
end
| VPSRAD x: sem-undef-varity x
| VPSRAW x: sem-undef-varity x
| VPSRLD 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