Commit f6982a1e authored by Julian Kranz's avatar Julian Kranz

X86 RREIL Translator

- Added semantics of: (V)PSRAW, (V)PSRAD
parent 2692adb7
......@@ -384,13 +384,17 @@ main:
#pslldq $73, %xmm1
#vpslldq $5, %xmm1, %xmm2
psllw %mm1, %mm2
psllw (%rax), %xmm1
psllw $197, %xmm1
pslld $20, %mm1
#psllw %mm1, %mm2
#psllw (%rax), %xmm1
#psllw $197, %xmm1
#pslld $20, %mm1
psllq $10, %mm1
vpslld %xmm1, %xmm2, %xmm3
vpsllq $33, %xmm1, %xmm2
#vpsllq $33, %xmm1, %xmm2
psrad $42, %xmm1
vpsraw $22, %xmm1, %xmm2
vpsrad %xmm1, %xmm2, %xmm3
#vmovd %xmm5, %ebx
......
......@@ -1663,7 +1663,7 @@ 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
val sem-ps-vps-opnd avx-encoded element-size shifter opnd1 opnd2 opnd3 = do
size <- sizeof1 opnd1;
src <- read size opnd2;
count <- read element-size opnd3;
......@@ -1677,7 +1677,7 @@ val sem-psll-vpsll-opnd avx-encoded element-size opnd1 opnd2 opnd3 = do
val m i = do
offset <- return (element-size*i);
shl element-size (at-offset temp-dst offset) (var (at-offset temp-src offset)) count
shifter element-size (at-offset temp-dst offset) (var (at-offset temp-src offset)) count
end
in
vector-apply size element-size m
......@@ -1686,8 +1686,10 @@ val sem-psll-vpsll-opnd avx-encoded element-size opnd1 opnd2 opnd3 = do
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 sem-psll element-size x = sem-ps-vps-opnd '0' element-size shl x.opnd1 x.opnd1 x.opnd2
val sem-vpsll element-size x = sem-ps-vps-opnd '1' element-size shl x.opnd1 x.opnd2 x.opnd3
val sem-psra element-size x = sem-ps-vps-opnd '0' element-size shrs x.opnd1 x.opnd1 x.opnd2
val sem-vpsra element-size x = sem-ps-vps-opnd '1' element-size shrs x.opnd1 x.opnd2 x.opnd3
val ps-push opnd-sz opnd = do
mode64 <- mode64?;
......
......@@ -1426,8 +1426,8 @@ val semantics insn =
| PSLLDQ x: sem-pslldq 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
| PSRAD x: sem-psra 32 x
| PSRAW x: sem-psra 16 x
| PSRLD x: sem-undef-arity2 x
| PSRLDQ x: sem-undef-arity2 x
| PSRLQ x: sem-undef-arity2 x
......@@ -2081,8 +2081,14 @@ val semantics insn =
case v of
VA3 x: sem-vpsll 16 x
end
| VPSRAD x: sem-undef-varity x
| VPSRAW x: sem-undef-varity x
| VPSRAD v:
case v of
VA3 x: sem-vpsra 32 x
end
| VPSRAW v:
case v of
VA3 x: sem-vpsra 16 x
end
| VPSRLD x: sem-undef-varity x
| VPSRLDQ x: sem-undef-varity x
| VPSRLQ 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