Skip to content

Commit

Permalink
adds an llvm decode for x86
Browse files Browse the repository at this point in the history
  • Loading branch information
ivg committed Sep 29, 2020
1 parent c0a3d55 commit 4808ca9
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion lib/x86_cpu/x86_target.ml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,23 @@ let enable_arch () =
then `x86
else `unknown


let llvm_x86_encoding =
Theory.Language.declare ~package:"llvm" "x86"
let llvm_x86_64_encoding =
Theory.Language.declare ~package:"llvm" "x86-64"

let enable_decoder () =
let open KB.Syntax in
KB.promise Theory.Label.encoding @@ fun label ->
Theory.Label.target label >>| fun t ->
if Theory.Target.belongs amd64 t
then llvm_x86_64_encoding else
if Theory.Target.belongs parent t
then llvm_x86_encoding
else Theory.Language.unknown

let load () =
enable_loader ();
enable_arch ()
enable_arch ();
enable_decoder ()

0 comments on commit 4808ca9

Please sign in to comment.