Commit Graph

17 Commits

Author SHA1 Message Date
Dan Gohman
f4dbd38a4c Rename Cretonne to Cranelift! 2018-07-13 09:15:16 -07:00
Dan Gohman
cc94adca3b Update to the rustfmt in rust 1.27, which is now stable. (#377) 2018-06-26 13:06:16 -07:00
Dan Gohman
d209137149 Rename TargetIsa's emit_function to emit_function_to_memory.
This reflects the fact that it takes a concrete `MemoryCodeSink` rather than
a `CodeSink` trait object.
2018-06-21 15:50:29 -07:00
Dan Gohman
8a26a50475 Rename CtonError and CtonResult to CodegenError and CodegenResult. 2018-06-12 05:02:25 -07:00
Dan Gohman
02e34d1bf7 Make CtonError parameterized on the result type.
This makes it more consistent with other custom `Result` types.
2018-06-12 05:02:25 -07:00
Dan Gohman
13f22065a2 Rename verifier's Result and Error.
This provides consistency with similar types in other parts of
Cretonne, and avoids shadowing `Result` from the standard prelude.
2018-06-12 05:02:25 -07:00
Sergey Pepyakin
e4fe1db3b8 Assert that stack_limit is none. 2018-06-09 13:18:12 -07:00
Dan Gohman
6b88cd44a8 Update to rustfmt-preview (#348)
* Update to rustfmt-preview.

* Run "cargo fmt --all" with rustfmt 0.4.1.

rustfmt 0.4.1 is the latest release of rustfmt-preview available on the
stable channel.

* Fix a long line that rustfmt 0.4.1 can't handle.

* Remove unneeded commas left behind by rustfmt.
2018-05-25 11:38:38 -07:00
pup
b36fc6b75f Issue 311 - Add a pass to make NaN bits deterministic. (#322) 2018-05-09 15:11:58 -05:00
Dan Gohman
5bcfd47f3f Remove the non-REX encodings for regmove et al.
regmove, regfill, and regspill have immediates which aren't value
operands, so they aren't in the set of things that can be described by
the existing constraint system. Consequently, constraints saying that
the non-REX encodings only support registers that don't need REX
prefixes don't work. Fow now, just remove the non-REX encodings, so
that they don't get selected when they aren't valid.

This fixes the last known issue with instruction shrinking, so it can
be re-enabled.
2018-04-22 22:31:56 -07:00
Dan Gohman
e876529152 Merge pull request #303 from sunfishcode/no_std_merge
Merge no_std into master
2018-04-20 12:11:53 -07:00
Dan Gohman
3e4531657c Temporarily disable the shink_instruction pass.
It appears some of the instruction encodings are incorrect. Temporarily
disable the use of shorter encodings until these are fixed.
2018-04-19 17:49:48 -07:00
Dan Gohman
bce8af97e3 Add an instruction shrinking pass.
When an instruction has multiple valid encodings, such as with and
without a REX prefix on x86-64, Cretonne typically picks the encoding
which gives the register allocator the most flexibility, which is
typically the longest encoding. This patch adds a pass that runs after
register allocation that picks the smallest encoding, working within the
constraints of the register allocator's choices. The result is smaller
and easier to read encodings.

In the future, we may want to merge this pass into the relaxation pass,
or possibly fold it into the final encoding step, however for now, a
discrete pass will suffice.
2018-04-19 17:04:56 -07:00
Dan Gohman
830ee60d28 Add no_std support in module, simplejit, and umbrella. 2018-04-19 12:39:56 -07:00
Dan Gohman
d7e13284b2 Mark emit_to_memory as unsafe, and introduce a safe emit. (#281)
* Mark emit_to_memory as unsafe, and provide a safe compile_and_emit.

Mark `Context::emit_to_memory` and `MemoryCodeSink::new` as unsafe, as
`MemoryCodeSink` does not perform bounds checking when writing to
memory.

Add a `Context::compile_and_emit` function which provides a convenient
interface for doing `compile` and `emit_to_memory` in one step, and
which can also provide a safe interface, since it allocates memory of
the needed size itself.

* Mention that `MemoryCodeSink` can't guarantee that the pointer is valid.
2018-04-18 06:35:47 -07:00
Dan Gohman
bf597b7abf Enable and fix several more clippy lints. 2018-04-17 17:05:03 -07:00
Dan Gohman
24fa169e1f Rename the 'cretonne' crate to 'cretonne-codegen'.
This fixes the next part of #287.
2018-04-17 09:46:56 -07:00