From f54f0a13ba2fa61e1a748e1ff932cfca74a5705b Mon Sep 17 00:00:00 2001 From: Iavor Diatchki Date: Mon, 26 Mar 2018 18:51:19 -0700 Subject: [PATCH] Add some support for unpack; no symbolic implementation yet. --- x86/src/Data/Macaw/X86/ArchTypes.hs | 7 +++++++ x86/src/Data/Macaw/X86/Semantics/AVX.hs | 1 + 2 files changed, 8 insertions(+) diff --git a/x86/src/Data/Macaw/X86/ArchTypes.hs b/x86/src/Data/Macaw/X86/ArchTypes.hs index f55e6601..1c113c25 100644 --- a/x86/src/Data/Macaw/X86/ArchTypes.hs +++ b/x86/src/Data/Macaw/X86/ArchTypes.hs @@ -252,6 +252,12 @@ data AVXOp2 = VPAnd -- ^ Bitwise and * upper 4 bits -> index in 2nd op; Indexes are always 0 or 1. -} + | VPUnpackLQDQ + -- ^ A,B,C,D + P,Q,R,S = C,R,D,S + -- This one is for DQ, i.e., 64-bit things + -- but there are equivalents for all sizes, so we should + -- probably parameterize on size. + data AVXPointWiseOp2 = PtAdd -- ^ Pointwise add; overflow wraps around; no overflow flags @@ -273,6 +279,7 @@ instance Show AVXOp2 where VAESEnc -> "vaesenc" VAESEncLast -> "vaesenclast" VPCLMULQDQ i -> "vpclmulqdq_" ++ show i + VPUnpackLQDQ -> "vpunpacklqdq" instance Show AVXPointWiseOp2 where show x = case x of diff --git a/x86/src/Data/Macaw/X86/Semantics/AVX.hs b/x86/src/Data/Macaw/X86/Semantics/AVX.hs index 4b0c107d..3b5354b4 100644 --- a/x86/src/Data/Macaw/X86/Semantics/AVX.hs +++ b/x86/src/Data/Macaw/X86/Semantics/AVX.hs @@ -215,6 +215,7 @@ all_instructions = , avxOp2 "vaesenc" VAESEnc , avxOp2 "vaesenclast" VAESEncLast + , avxOp2 "vpunpcklqdq" VPUnpackLQDQ , avx3 "vextractf128" $ \arg1 arg2 arg -> do SomeBV vec <- getSomeBVValue arg2