Commit Graph

2940 Commits

Author SHA1 Message Date
Dan Gohman
45fb377457 Bump version to 0.48.0 (#1202)
* Bump version to 0.48.0

* Re-enable `byteorder`'s default features.

The code uses `WriteBytesExt` which depends on the `std` feature being
enabled. So for now, just enable `std`.
2019-11-05 13:59:19 -08:00
Peter Huene
8923bac7e8 Implement emitting Windows unwind information for fastcall functions. (#1155)
* Implement emitting Windows unwind information for fastcall functions.

This commit implements emitting Windows unwind information for x64 fastcall
calling convention functions.

The unwind information can be used to construct a Windows function table at
runtime for JIT'd code, enabling stack walking and unwinding by the operating
system.

* Address code review feedback.

This commit addresses code review feedback:

* Remove unnecessary unsafe code.
* Emit the unwind information always as little endian.
* Fix comments.

A dependency from cranelift-codegen to the byteorder crate was added.
The byteorder crate is a no-dependencies crate with a reasonable
abstraction for writing binary data for a specific endianness.

* Address code review feedback.

* Disable default features for the `byteorder` crate.
* Add a comment regarding the Windows ABI unwind code numerical values.
* Panic if we encounter a Windows function with a prologue greater than 256
  bytes in size.
2019-11-05 13:14:30 -08:00
dependabot-preview[bot]
2eea366530 Update goblin requirement from 0.0.24 to 0.1.0
Updates the requirements on [goblin](https://github.com/m4b/goblin) to permit the latest version.
- [Release notes](https://github.com/m4b/goblin/releases)
- [Changelog](https://github.com/m4b/goblin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/m4b/goblin/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-05 10:48:37 +01:00
Dan Gohman
a9868de3d8 Bump version to 0.47.0 2019-11-04 15:43:27 -08:00
dependabot-preview[bot]
811b5e0a7b Update smallvec requirement from 0.6.10 to 1.0.0
Updates the requirements on [smallvec](https://github.com/servo/rust-smallvec) to permit the latest version.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v0.6.10...v1.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-04 15:08:27 +01:00
dependabot-preview[bot]
b4d92f0978 Update indicatif requirement from 0.12.0 to 0.13.0
Updates the requirements on [indicatif](https://github.com/mitsuhiko/indicatif) to permit the latest version.
- [Release notes](https://github.com/mitsuhiko/indicatif/releases)
- [Commits](https://github.com/mitsuhiko/indicatif/compare/0.12.0...0.13.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-04 14:53:09 +01:00
Oliver Scherer
e1b0f1f990 Use less vague language 2019-11-04 12:46:58 +01:00
Oliver Scherer @ Cosmian
9903c75f82 Update variable.rs 2019-11-04 12:46:58 +01:00
Oliver Scherer @ Cosmian
d8fa5dcb29 Update outdated documentation 2019-11-04 12:46:58 +01:00
Nick Fitzgerald
d1c53a18df Document the test run filetest mode (#1189)
* Document the `test run` filetest mode

* Clarify that `test run` functions can return any boolean
2019-10-31 10:05:10 -07:00
Andrew Brown
8307ad3f3b Build documentation with private items in cranelift-codegen/meta 2019-10-31 09:35:08 -07:00
Andrew Brown
96f5a6b561 Fix documentation link issues 2019-10-31 09:35:08 -07:00
Andrew Brown
f19456640c Add documentation for top-level items in cranelift-codegen/meta 2019-10-31 09:35:08 -07:00
Andrew Brown
e45c283194 Enable documentation of private items in cranelift-codegen/meta; fixes #832 2019-10-31 09:35:08 -07:00
Benjamin Bouvier
8c2d9fd32f Tweak comments in regalloc code. 2019-10-31 16:54:30 +01:00
Josh Triplett
d6b3ca28b4 Add and use a From impl from CodegenError to ModuleError
This will also improve reporting of the chain of errors.
2019-10-30 17:15:09 -07:00
Josh Triplett
7e725cf880 Migrate from failure to thiserror
The failure crate invents its own traits that don't use
std::error::Error (because failure predates certain features added to
Error); this prevents using ? on an error from failure in a function
using Error. The thiserror crate integrates with the standard Error
trait instead.
2019-10-30 17:15:09 -07:00
Benjamin Bouvier
6de45ff8fc Update publish-all so it commits on a different branch.
This allows to open a PR for the changes to be submitted on the
repository, instead of silently pushing to master.
2019-10-30 12:55:21 -07:00
dependabot-preview[bot]
52fb94d24c Update object requirement from 0.14.0 to 0.15.0
Updates the requirements on [object](https://github.com/gimli-rs/object) to permit the latest version.
- [Release notes](https://github.com/gimli-rs/object/releases)
- [Commits](https://github.com/gimli-rs/object/compare/0.14.0...0.15.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-30 12:18:46 -07:00
Benjamin Bouvier
d8b840d2f5 [meta] Remove the OperandKindBuilder;
And replace it by constructors in OperandKind. There's a single optional
parameter function `set_doc` that remains, and didn't justify the whole
OperandKindBuilder concept to exist.
2019-10-30 18:39:20 +01:00
Benjamin Bouvier
d5e990220e [meta] Remove OperandKind::name field and explicitly pass rust_field_name/rust_type; (fixes #1177) 2019-10-30 18:39:20 +01:00
Benjamin Bouvier
0eb2dfc4a3 [meta] Rename OperandKind::default_member to format_field_name; 2019-10-30 18:39:20 +01:00
Benjamin Bouvier
4f5b0689f3 [meta] Remove OperandKind::imm_name method; 2019-10-30 18:39:20 +01:00
Benjamin Bouvier
ae3ea47dbd [meta] Delegate finding the default value to OperandKind instead of its builder.
This applies both to the default_member value (which is now determined at
runtime, instead of pre-computed) and the rust_type value (which is
determined in the Operand's ctor, instead of the builder).
2019-10-30 18:39:20 +01:00
Benjamin Bouvier
4632d35196 [meta] Remove the OperandBuilder, replace it with Operand ctors; 2019-10-30 18:39:20 +01:00
Benjamin Bouvier
2bebc40c16 [meta] Move the doc() default values in the Operand/OperandKind; 2019-10-30 18:39:20 +01:00
Benjamin Bouvier
0b8a579943 Fixes #851: Document instructions' input operands in InstBuilder; 2019-10-30 18:39:20 +01:00
Josh Triplett
fcf0ad1d5d Log function definition unconditionally
Don't log inside the `.map_err` call, which resulted in only logging
function definitions on codegen errors.
2019-10-30 15:55:26 +01:00
bjorn3
689771caf3 Don't force enable basic-blocks feature
Fixes #1179
2019-10-30 11:22:05 +01:00
lzutao
7e5c33a29e Use array::iter 2019-10-30 09:47:25 +01:00
Benjamin Bouvier
e8c03fbd09 [meta] Remove unused bit-vector functionalty;
It can be resurrected if needed in the future. It was used only for the
semantics descriptions, which went away with the transition of the
meta-language to Rust.
2019-10-29 14:23:10 +01:00
Benjamin Bouvier
5889dd2c64 [meta] Add more pub(crate) definitions. 2019-10-29 14:23:10 +01:00
Benjamin Bouvier
06b1817d89 [meta] Rename Operand::is_pure_immediate into is_immediate; 2019-10-29 14:23:10 +01:00
Benjamin Bouvier
b657aa57f6 [meta] Rename Operand::is_immediate to is_immediate_or_entityref 2019-10-29 14:23:10 +01:00
Andrew Brown
f37d1c7ecc Simplify binding of IntCC::Equals to SIMD icmp; fixes #1150 2019-10-28 11:09:37 -07:00
Joshua Nelson
e045a6df27 implement Debug for Linkage
this would have been useful while debugging something in my own project
2019-10-28 11:43:15 +01:00
Peter Huene
9f506692c2 Fix clippy warnings.
This commit fixes the current set of (stable) clippy warnings in the repo.
2019-10-24 17:20:12 -07:00
yjh
1176e4f178 Fix clippy warnings (#1168) 2019-10-24 09:54:31 -06:00
Benjamin Bouvier
2b6ea31621 [wasm] Include more large tests; 2019-10-23 10:15:49 +02:00
Andrew Brown
77035b44a6 Translate WASM all_true to CLIF 2019-10-22 11:01:05 -07:00
Andrew Brown
879ccf871a Add x86 SIMD vall_true
In order to implement SIMD's all_true (https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#all-lanes-true), we must legalize some instruction (I chose `vall_true`) to a comparison against 0 and a similar reduction as vany_true using `PTEST` and `SETNZ`. Since `icmp` only allows integers but `vall_true` could allow more vector types, `raw_bitcast` is used to convert the lane types into integers, e.g. b32x4 to i32x4. To do so without runtime type-checking, the `raw_bitcast` instruction (which emits no instruction) can now bitcast from any vector type to the same type, e.g. i32x4 to i32x4.
2019-10-22 11:01:05 -07:00
Andrew Brown
65e18df12f Translate WASM any_true to CLIF 2019-10-22 11:01:05 -07:00
Andrew Brown
186effc420 Add x86 SIMD vany_true and x86_ptest
In order to implement SIMD's any_true (https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#any-lane-true), we must legalize some instruction (I chose `vany_true`) to a sequence of `PTEST` and `SETNZ`. To emit `PTEST` I added the new CLIF instruction `x86_ptest` and used CLIF's `trueif ne` for `SETNZ`.
2019-10-22 11:01:05 -07:00
Benjamin Bouvier
873465e7a9 [contribution] Update contribution guidelines. 2019-10-22 15:33:09 +02:00
Benjamin Bouvier
499413dbc4 [contribution] Add a pull request template. 2019-10-22 15:33:09 +02:00
Benjamin Bouvier
f721821bec [contribution] Add Github issue templates; 2019-10-22 15:33:09 +02:00
Benjamin Bouvier
0243b642e3 [meta] Remove name lookups in formats;
This does a lot at once, since there was no clear way to split the three
commits:

- Instruction need to be passed an explicit InstructionFormat,
- InstructionFormat deduplication is checked once all entities have been
defined;
2019-10-22 14:05:12 +02:00
Benjamin Bouvier
9e9a7626d7 [meta] Use a ref-counted pointer to an InstructionFormat in instructions;
This avoids a lot of dereferences, and InstructionFormat are immutable
once they're created. It removes a lot of code that was keeping the
FormatRegistry around, just in case we needed the format. This is more
in line with the way we create Instructions, and make it easy to
reference InstructionFormats in general.
2019-10-22 14:05:12 +02:00
Benjamin Bouvier
d3e694fbe7 [meta] Remove unused InstructionGroup::{name, doc}; 2019-10-22 14:05:12 +02:00
Benjamin Bouvier
8fece43aa1 [meta] Use a type alias for Instruction;
... instead of embedding a Rc<InstructionContent>, just make it a type
alias.
2019-10-22 14:05:12 +02:00