[ppc] Add preliminary support for popcount

It isn't supported in SimpleBuilder, so we use an uninterpreted function in the
formula language for now.
This commit is contained in:
Tristan Ravitch 2017-11-10 16:52:38 -08:00
parent bbd00f7ef2
commit 2002afa246
2 changed files with 15 additions and 1 deletions

View File

@ -468,6 +468,20 @@ evalNonceAppTH bvi nonceApp =
addExpr (AppExpr (M.Bsr (NR.knownNat @64) locExp))
|]
_ -> fail ("Unsupported argument list for clz: " ++ showF args)
"popcnt_32" ->
case FC.toListFC Some args of
[Some loc] -> do
[| do locExp <- $(addEltTH bvi loc)
addExpr (AppExpr (M.PopCount (NR.knownNat @32) locExp))
|]
_ -> fail ("Unsupported argument list for popcnt: " ++ showF args)
"popcnt_64" ->
case FC.toListFC Some args of
[Some loc] -> do
[| do locExp <- $(addEltTH bvi loc)
addExpr (AppExpr (M.PopCount (NR.knownNat @64) locExp))
|]
_ -> fail ("Unsupported argument list for popcnt: " ++ showF args)
_ | Just nBytes <- readMemBytes fnName -> do
case FC.toListFC Some args of
[_, Some addrElt] -> do

@ -1 +1 @@
Subproject commit 2e5ce7f6797466c09cd9e5799a351aaa16016a12
Subproject commit cef6197ed5a53b22f41a9c7961689543b9dd8f1c