Commit Graph

17 Commits

Author SHA1 Message Date
Angus Holder
cfdecfdcbf We now parse and record a ValueLoc for each SSA value result of each instruction. Code currently not passing tests. 2017-03-09 07:19:28 -08:00
Angus Holder
10f86baf63 Added tests, some refactoring, fixed a parsing bug. 2017-03-08 13:01:32 -08:00
Angus Holder
a081b09c94 Added parsing of instruction encodings and result registers specifications. 2017-03-08 13:01:32 -08:00
rep-nop
7edbc90d5e Ran rustfmt 2017-02-26 07:50:55 -08:00
rep-nop
7459fee71a Converts all try! macros to ? syntax.
Fixes #46
2017-02-26 07:50:55 -08:00
Jakob Stoklund Olesen
c8be39fa9d Add ABI annotations to function signatures.
Specify the location of arguments as well as the size of stack argument
array needed. The ABI annotations are optional, just like the value
locations.

Remove the Eq implementation for Signature which was only used by a
single parser test.
2017-02-24 13:53:46 -08:00
Angus Holder
a4e4776087 Removed the Opcode::NotAnOpcode variant, replaced its uses with Option<Opcode>, and used the NonZero optimization to maintain the small 1-byte size of an optional Opcode. 2017-02-22 10:22:08 -08:00
Jakob Stoklund Olesen
62334b26b4 Add return_reg encodings for RISC-V. 2017-02-21 16:29:23 -08:00
Jakob Stoklund Olesen
20ff2f0025 Add a return_reg instruction to the base instruction set.
Register-style return is used by all RISC architectures, so it is
natural to have a shared instruction representation.
2017-02-21 13:05:17 -08:00
Jakob Stoklund Olesen
2e6cf219e9 Use PackedOption<Value> instead of NO_VALUE.
- Remove NO_VALUE and ExpandedValue::None.
- Remove the Default implelmentation for Value.
- InstructionData::second_result() returns an Option<Value>.
- InstructionData::second_result() returns a reference to the packed
  option.
2017-01-19 15:55:18 -08:00
Jakob Stoklund Olesen
f2b9f62f24 Avoid using NO_INST in the parser.
This was only used for the comment rewrite mechanism, and we can just
predict the next allocated instruction number instead. See the other
uses of next_key() for gather_comments().
2017-01-19 14:49:55 -08:00
Jakob Stoklund Olesen
5fc222348d Use PackedOption<Ebb> to represent jump tables.
Avoid NO_EBB.
2017-01-19 13:41:56 -08:00
Jakob Stoklund Olesen
c1b7080bf6 Gather comments in the preamble of a test file.
Comments preceding the first function are not associated with any
specific entity in the file. Put them in a TestFile::preamble_comments
field.
2016-11-04 10:42:31 -07:00
Jakob Stoklund Olesen
d85225c537 Parse signature and function declarations.
Also add support for parsing call and call_indirect instructions.
2016-10-18 13:19:24 -07:00
Jakob Stoklund Olesen
e4e1c30f87 Add call and call_indirect instructions.
Add a new IndirectCall instruction format which has a value callee as
well as the call arguments.

Define call and call_indirect instructions.
2016-10-18 10:04:06 -07:00
Jakob Stoklund Olesen
45cf655ce4 Generalize def_inst() to def_entity().
Use this source map method for assigning a location to any entity whose
source number is not exposed. This could be

- Instructions.
- Signatures defined implicitly by function decls.

These entities only appear in the location map, not the entity number
maps.
2016-10-18 09:38:05 -07:00
Jakob Stoklund Olesen
0764df28b5 Move library crates under 'lib/'.
Give these crates each a more standard directory layout with sources in
a 'src' sub-sirectory and Cargo.toml in the top lib/foo directory.

Add license and description fields to each.

The build script for the cretonne crate now lives in
'lib/cretonne/build.rs' separating it from the normal library sources
under 'lib/cretonne/src'.
2016-10-17 14:44:43 -07:00