Commit Graph

22 Commits

Author SHA1 Message Date
Tristan Ravitch
89fc5a73f7
Tr/full arm intrinsics (#137)
Improve the TH codegen for macaw-semmc

This change lazily translates as much as possible.  It also generates somewhat more compact code. This change also finishes implementing primitives for the aarch32 backend.  Complementing the aarch32 changes, the macaw-semmc interface has been modified to allow macaw-aarch32 to avoid a redundant serialize-deserialize round.

Co-authored-by: Kevin Quick <kquick@galois.com>
2020-05-26 09:24:45 -07:00
Kevin Quick
aff97bec6a
Update bv-sized lower constraint to allow parameterized-utils 2.1.0. 2020-05-15 10:25:12 -07:00
Kevin Quick
5da67a8ec1
Update bv-sized package constraints. 2020-05-15 10:22:20 -07:00
Kevin Quick
3bee174f5f
[macaw-aarch32] Update for bv-sized API changes in version 1.0 2020-05-14 16:48:54 -07:00
Tristan Ravitch
a824fc4051
Tr/warning cleanups (#127)
Warning and style cleanups in macaw-semmc and macaw-aarch32
2020-04-14 00:07:15 -07:00
Tristan Ravitch
e536e43f1b Introduce macaw-aarch32 and macaw-aarch32-symbolic
These packages replace the old macaw-arm (which has been removed).  The only
change to the core macaw is to introduce a `Lift` instance for the Endianness
data type, which is used in macaw-semmc.

The macaw-aarch32 package uses the official ARM semantics (via the
asl-translator package).  In its current state, macaw-aarch32 seems to handle
the common idioms of simple ARM binaries.  Position independent executables have
not been tested yet.  The semantics and disassemblers for Thumb are present, but
not integrated into code discovery at this time.  There are some tests in
macaw-aarch32.  Compile times are longer than necessarily desired.
macaw-aarch32 can be compiled in two modes: lite mode (cabal flag -fasl-lite),
which uses a restricted set of instructions for testing, and takes less time to
compile.  The full instruction set is the default, though there are a few
undefined functions that are not yet handled for the full set, mostly relating
to floating point operations.

The macaw-aarch32-symbolic package is currently a stub, but is implemented to
provide a few necessary instances.
2020-04-12 19:53:00 -07:00
Tristan Ravitch
73f758544d Update tests and expected outputs
The tests were issuing the exit syscall incorrectly (they didn't set the sycall
number) and were not executable.
2020-04-08 21:21:28 -07:00
Tristan Ravitch
3e1c2aa487 Warning cleanup 2020-04-08 20:27:29 -07:00
Tristan Ravitch
fabb8799d8 Make tests less chatty 2020-04-08 19:57:26 -07:00
Tristan Ravitch
958aeaa3ed Remove the nested mux match rule from macaw core
We can now do enough rewriting in the ARM backend that it isn't needed.  This
adds extra ARM rewriting rules and a term cache to make matching easier.
2020-04-08 19:46:32 -07:00
Tristan Ravitch
d865811701 In ARM, read the current register value from a snapshot
We were reading partially updated values that were committed to the register
state out-of-order, yielding some bad results.

This commit takes a snapshot of the register state before executing each
instruction and only reads register values from the snapshot.
2020-04-08 11:54:28 -07:00
Tristan Ravitch
36c67eb586 Fix an error introduced during cleanup 2020-04-08 07:27:28 -07:00
Tristan Ravitch
b0683c06a9 Poke the ARM simplifier into working
The generic simplifier needed a case to handle xor.

The more specific simplifier needed a case to coalesce adjacent additions.
2020-04-08 02:23:47 -07:00
Tristan Ravitch
997e435a0c WIP Debugging rewriting rules
They fire sometimes and definitely clean up the IR, but they are missing a few
key cases still
2020-04-08 00:04:51 -07:00
Daniel Matichuk
2257c18d65 use appendStmt properly for SIMD write mode 2020-04-06 21:37:47 -07:00
Daniel Matichuk
464835403e import fixup 2020-04-06 20:53:06 -07:00
Daniel Matichuk
a2ee426714 Merge remote-tracking branch 'origin/feature/asl' into feature/asl 2020-04-06 20:48:34 -07:00
Daniel Matichuk
c3bdbfd191 add guarded register/memory writes 2020-04-06 20:38:39 -07:00
Tristan Ravitch
5e5c90c993 Updates to the simplifier and call recognition 2020-04-06 17:56:22 -07:00
Tristan Ravitch
b8c3e65389 Add a test with a call 2020-04-06 15:56:43 -07:00
Tristan Ravitch
c5fe84f97c Add a missing instance for ARMReg 2020-04-05 21:17:47 -07:00
Tristan Ravitch
1fa9b86b26 Rename macaw-asl to macaw-aarch32
This is more descriptive, especially since we will eventually have
macaw-aarch32 (also derived from the ASL specs)
2020-04-05 15:16:39 -07:00