Commit Graph

301 Commits

Author SHA1 Message Date
Tristan Ravitch
02c2fcd96a
Clean up the PowerPC architecture specifications (#130)
This commit reduces duplication in the PowerPC backend.  Instances are now in terms of the generic `AnyPPC` type, rather than having separate instances for 32 and 64 bit.  Shuffling some type parameters also allows us to remove a large number of type equalities that e.g., fix the arch register type to `PPCReg`.
2020-04-19 11:56:42 -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
cbe4a9f0c0 Fix the macaw-ppc build 2020-04-08 20:19:33 -07:00
Tristan Ravitch
a5977918ac Merge remote-tracking branch 'origin/wip/equiv' into feature/asl 2020-04-06 23:16:15 -07:00
Tristan Ravitch
58150e91b5 Update macaw-ppc to the macaw-semmc endianness parameterization 2020-04-05 14:44:53 -07:00
Daniel Wagner
95dd08bce9 Merge branch 'master' into wip/equiv 2020-02-04 12:21:51 -05:00
Tristan Ravitch
e3aaf47a50
Tr/update submodules (#105)
The main change here is in macaw-semmc to account for a change to the BVOrBits
operation in Crucible.
2020-01-25 12:25:38 -08:00
Tristan Ravitch
d119a9ed5a
Update submodules (#104)
The main change here is in macaw-semmc to account for a change to the BVOrBits
operation in Crucible.
2020-01-17 16:17:30 -08:00
Daniel Wagner
c22f140a3b Merge branch 'tr/new-macaw-symbolic-entry' into wip/equiv 2020-01-13 22:21:51 -05:00
Tristan Ravitch
b44e8c480f Update the semmc submodule
This brings it up to master.  The submodule has some improvements to synthesis,
but they changed some APIs.
2019-11-21 20:42:05 -08:00
Tristan Ravitch
9e9eb1b770 Fix macaw-ppc compilation
Fixes #80, which removed a type parameter from `IntraJumpBounds`
2019-11-19 17:28:40 -08:00
Tristan Ravitch
4c7a69b11d Update macaw-ppc to account for recent changes in macaw-base
The main changes are:

- `postCallAbsState` was removed from the architecture info
- `mkInitialRegsForBlock` was renamed to `initialBlockRegs` and takes slightly
  different parameters
- There is a new type family and some new functions in the architecture info
  relating to post-block/terminator abstract state construction

PowerPC doesn't need any extra information to compute post-block abstract
states, so we use () as the ArchBlockPrecond type.
2019-11-12 17:27:14 -08:00
Daniel Wagner
10a1fbc24a misc. build fixes 2019-10-17 16:38:16 -04:00
Daniel Wagner
5f15b14136 Merge branch 'master' into wip/equiv 2019-10-01 14:40:52 -04:00
Joe Hendrix
494aff6ff0
This makes a number of changes to abstract domains.
The goal is to support a jumptable testcase that is not supported by
the current jump bounds check.  The jump bounds check needs to be
augmented so that it understands equality relationships between stack
values and registers, and bounds on both.

This patch tracks when a register points to a concrete stack offset.

As part of this, we droped the AbsDomain instance for AbsBlockState.
Clients should now likely use `fnStartAbsBlockState` in lieu of `top`.

The other client visible change is that the ClassifyFailure
constructor now has an extra argument with details about why
classification failure occured.
2019-08-21 23:29:16 -07:00
Tristan Ravitch
06f64078df
Wip/ppc no block labels (#66)
Update to API changes in macaw-base in macaw-ppc and macaw-arm

The "block label" abstraction (used during arch-specific disassembly) was removed some time ago in the base macaw library.  This change updates macaw-ppc and macaw-arm to remove uses of block labels.  The major change is that the disassembly function only returns a single block at a time instead of a sequence of blocks.

To facilitate this, the handling of the PowerPC conditional trap instruction (trap doubleword) is now an architecture-specific terminator instruction instead of encoding the logic of conditional trapping.  We will now have to encode the conditional trapping logic in macaw-ppc-symbolic.  Note that we have not done so yet.

This commit also updates the expected results of the PowerPC tests; the number of discovered blocks is different, but not significantly so.  It is hard to tell if this is a regression or an improvement.
2019-08-09 16:11:59 -07:00
Kevin Quick
fb31de230f
Merge branch 'master' into semiring_upd 2019-07-19 13:17:09 -07:00
Daniel Wagner
1dae825c73 DRY 2019-07-17 15:08:57 -04:00
Kevin Quick
6f76e4bef2
[macaw-ppc] Add test to check the number of blocks found for gzip.
Verifies that the number of blocks found matches what should generally
be expected from this particular executable.

The specific value checked for is not independently verified, it just
happens to be a reasonable-looking value that the discovery process
currently identifies, and encoding it here ensures that if discovery
ever changes that the change will be seen and explicitly accepted or
fixed as needed.
2019-07-11 14:25:13 -07:00
Kevin Quick
f525351621
Handle conversions for Float Mux in macaw-ppc. 2019-07-11 13:55:01 -07:00
Kevin Quick
a89ca13413
[macaw-ppc] Update for semiring changes in What4 Exprs. 2019-07-11 11:24:23 -07:00
Joe Hendrix
fbb3b300ce
Prep work to get building with warning as errors. 2019-03-25 14:39:33 -07:00
Luke Maurer
68ae66bff5 NatRepr changes 2019-02-13 14:21:48 -08:00
Kevin Quick
0f97a86c3e
Added missing pretty-printer import. 2019-02-08 17:29:03 -08:00
Kevin Quick
9f46c9e60b Merge branch 'master' of github.com:GaloisInc/macaw-semmc 2019-02-08 14:37:54 -08:00
Luke Maurer
8d3c501fd0 Coerce PPCTermStmts rather than returning new ones when rewriting
This was eating up a surprising amount of heap space.
2019-01-28 14:48:25 -08:00
Kevin Quick
4e32007436
[ppc] Use pretty representation for IP in error messages. 2019-01-22 23:17:24 -08:00
Tristan Ravitch
7e573101b4 Finish porting macaw-ppc to use the unified PPC architecture tag 2019-01-08 13:27:40 -08:00
Tristan Ravitch
be3bc845f9 Change an 'undefined' to a more informative error 2019-01-08 11:22:55 -08:00
Luke Maurer
dbce1b1265 Refactor to use AnyPPC 2018-12-21 11:47:40 -08:00
Luke Maurer
b5a75832a3 Adapt to and re-export new AnyPPC arch constructor 2018-12-20 16:43:46 -08:00
Kevin Quick
294299a8eb
[macaw-ppc] ArchitecturInfo updates: mkInitialRegsForBlock, checkForReturnAddr. 2018-12-13 22:48:26 -08:00
Daniel Wagner
718467815b fix GaloisInc/semmc/issues/15
We now thread a snapshot of the register state from the beginning of the
instruction evaluation through each instruction's semantics instead of
re-fetching register values each time we need it and potentially seeing
incorrect, partially modified register values.
2018-12-03 17:34:18 -05:00
Tristan Ravitch
72040c023d Fix handling of InstructionStart
The field it contains is supposed to be the instruction offset in its basic
block; overflowing it can cause significant problems during symbolic simulation.
2018-11-28 20:26:58 -08:00
Tristan Ravitch
30b5d2e091 Update macaw-arm and macaw-ppc to emit extra metadata
There is a new metadata statement that tracks the start address of each
instruction.  This is used in the translation to Crucible to provide better
error messages.  The x86 backend was already updated, this commit adds the
metadata to the ARM and PowerPC backends.
2018-11-28 10:22:25 -08:00
Tristan Ravitch
ff79eba6aa ppc: Use the new HasTOC class
This avoids a hard dependency on the exact format of ArchBinaryData for PowerPC
2018-10-30 11:01:46 -07:00
Tristan Ravitch
ebcbbe6c5c Remove the BinaryAddrWidth type family 2018-10-30 10:34:56 -07:00
Kevin Quick
d464403a25
Update tests from deprecated relativeSegmentAddr to segoffAddr. 2018-10-29 15:55:41 -07:00
Kevin Quick
730f855c71
Update to use macaw-loader for uniform binary loading. 2018-10-29 15:51:42 -07:00
Tristan Ravitch
ee58037c2d Make the powerpc tests more verbose when encountering a translation error 2018-10-24 10:26:55 -07:00
Tristan Ravitch
f1ac01edd9 Update to the latest macaw 2018-10-23 11:49:23 -07:00
Andrei Stefanescu
f3f2732663 Fix PPC SBVToFloat translation. 2018-09-19 18:45:50 -07:00
Andrei Stefanescu
1c002f160b Minor fixes. 2018-09-18 21:56:17 -07:00
Andrei Stefanescu
32961d20cb Use name instead of nonce id for uninterpreted functions. 2018-09-14 19:01:27 -07:00
Andrei Stefanescu
85ef5b4f0b Add float le and float round. 2018-09-14 19:01:19 -07:00
Andrei Stefanescu
4b498807fd Handle floating-point rounding. 2018-09-12 11:10:23 -07:00
Andrei Stefanescu
dab4f92ed9 Use BVSelect instead of BVTrunc. 2018-09-06 14:47:37 -07:00
Andrei Stefanescu
2886c86e2b Add floats to Macaw-PPC. 2018-09-06 14:47:37 -07:00
Andrei Stefanescu
fcf39588e1 Update macaw-ppc and macaw-arm to use the latest What4.ExprBuilder. 2018-08-16 20:20:50 -07:00
Tristan Ravitch
f7b87224a4 Update to the latest macaw
In macaw core, the type of the arch-specific 'disassemble' function changed to
no longer take a Memory, and to pass the maximum offset as an Int instead of a
MemWord.  It also removed the jump table entry size (which is no longer
required).

The removal of the Memory parameter required a bit of a change in how the
instruction parsers are structured, but it isn't a huge change (the "memory
contents after an address" can be computed from a MemSegmentOff, too).
2018-08-16 10:26:55 -07:00