Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update x86 backend to support the AESIMC instruction #1000

Merged
merged 4 commits into from
Jan 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/SAWScript/Crucible/LLVM/X86.hs
Original file line number Diff line number Diff line change
Expand Up @@ -201,18 +201,13 @@ cryptolUninterpreted ::
SharedContext ->
[Term] ->
m Term
cryptolUninterpreted env nm sc xs@[_, _] =
cryptolUninterpreted env nm sc xs =
case lookupIn nm $ eTermEnv env of
Left _err -> throwX86 $ mconcat
[ "Failed to lookup Cryptol name \"", nm
, "\" in Cryptol environment"
]
Right t -> liftIO $ scApplyAll sc t xs
cryptolUninterpreted _ nm _ xs = throwX86 $ mconcat
[ "Type error in call to \"", nm
, "\": Expected 2 arguments, given ", show $ length xs
, " arguments"
]

-------------------------------------------------------------------------------
-- ** Entrypoint
Expand Down Expand Up @@ -248,6 +243,7 @@ llvm_verify_x86 (Some (llvmModule :: LLVMModule x)) path nm globsyms checkSat se
liftIO $ C.sawRegisterSymFunInterp sym (Macaw.fnAesDec sfs) $ cryptolUninterpreted cenv "aesdec"
liftIO $ C.sawRegisterSymFunInterp sym (Macaw.fnAesDecLast sfs) $ cryptolUninterpreted cenv "aesdeclast"
liftIO $ C.sawRegisterSymFunInterp sym (Macaw.fnAesKeyGenAssist sfs) $ cryptolUninterpreted cenv "aeskeygenassist"
liftIO $ C.sawRegisterSymFunInterp sym (Macaw.fnAesIMC sfs) $ cryptolUninterpreted cenv "aesimc"
liftIO $ C.sawRegisterSymFunInterp sym (Macaw.fnClMul sfs) $ cryptolUninterpreted cenv "clmul"

let preserved = Set.fromList . catMaybes $ stringToReg . Text.toLower . Text.pack <$> rwPreservedRegs rw
Expand Down