* add x86 encodings for shift-immediate instructions
implements encodings for ishl_imm, sshr_imm, and ushr_imm. uses 8-bit immediates.
added tests for the encodings to intel/binary64.cton. Canonical versions
come from llvm-mc.
* translate test to use shift-immediates
* shift immediate encodings: use enc_i32_i64
and note why the regular shift encodings cant use it above
* add additional encoding tests for shift immediates
this covers 32 bit mode, and 64 bit operations in 64 bit mode.
There appear to be underlying problems with the way Cretonne handles value
aliases, which are causing problems for LICM. Disable LICM until we have
a chance to fix the underlying issues.
Fixes#275.
* cton-util: fix some clippy unnecessary pass-by-value warnings
* clippy: ignore too many arguments / cyclomatic complexity in module
since these functions are taking args coming from the command line, i
dont think this is actually a valid lint, morally the arguments are all
from one structure
* cton-util: take care of remaining clippy warnings
* cton-reader: fix all non-suspicious clippy warnings
* cton-reader: disable clippy at site of suspicious lint
* cton-frontend: disable clippy at the site of an invalid lint
* cton-frontend: fix clippy warnings, or ignore benign ones
* clippy: ignore the camelcase word WebAssembly in docs
* cton-wasm: fix clippy complaints or ignore benign ones
* cton-wasm tests: fix clippy complaints
* cretonne: starting point turns off all clippy warnings
* cretonne: clippy fixes, or lower allow() to source of problem
* cretonne: more clippy fixes
* cretonne: fix or disable needless_lifetimes lint
this linter is buggy when the declared lifetime is used for another type
constraint.
* cretonne: fix clippy complaint about Pass::NoPass
* rustfmt
* fix prev minor api changes clippy suggested
* add clippy to test-all
* cton-filetests: clippy fixes
* simplify clippy reporting in test-all
* cretonne: document clippy allows better
* cretonne: fix some more clippy lints
* cretonne: fix clippy lints (mostly doc comments)
* cretonne: allow all needless_lifetimes clippy warnings
remove overrides at the false positives
* rustfmt
Merge the `use` parts of the `no_std` branch. This reduces the diffs
between master and the `no_std` branch, making it easier to maintain.
Most of these changes are derived from patches by @lachlansneff in
https://github.com/Cretonne/cretonne/tree/no_std.
This will allow wasm implementations that wish to insert code into
every loop, for example to insert an interrupt check or a safepoint.
do so without relying on asynchronous signals.
* Rename `I32` -> `X86_32` and `I64` -> `X86_64`
* Format file to pass flake8 tests
* Fix comment so lines are under 80 char limit
* Remove trailing whitespace from comment
* Renamed `enc_i64` to `enc_x86_64` as per suggestion from PR
In this case, it's a little nicer to just use more assertions,
which will print their line number indicating how far the test
got, when they fail.
And this allows the tests to be run in no_std configurations.
This allows us to run the tests via a library call rather than just
as a command execution. And, it's a step toward a broader goal, which
is to keep the code in the top-level src directory minimal, with
important functionality exposed as crates.
Refactor the filetests harness so that it can be run as part of
`cargo test`. And begin reorganizing the test harness code in preparation
for moving it out of the src directory.
- Test subcommand files are now named `test_*.rs`.
- cton-util subcommand files now just export their `run` and nothing else.
- src/filetest/mod.rs now also just exports `run` and nothing else.
- Tests are now run in release mode (with debug assertions enabled).
This makes it a little simpler to generate 'match' statements, and
it performs deduplication of identical arms. And it means I don't
have to think about as many strings like '{} {{ {}.. }} => {}'
when I'm trying to think about how instructions work :-).
* Rename `ILBuilder` to `FunctionBuilderContext` and update corresponding
code
* Refactor usages of ILBuilder to become FunctionBuilderContext,
update variable names to reflect this change
* Reformat to ensure that lines stay under 100 char limit
* Apply corrections from `rustfmt` to pass tests
* Rename variables to be more consistent with refactor of ILBuilder
In this case, it's a little nicer to just use more assertions,
which will print their line number indicating how far the test
got, when they fail.
And this allows the tests to be run in no_std configurations.
Compute the bound values for expand_fcvt_to_sint using bitwise integer
arithmetic rather than floating-point arithmetic, to avoid relying on
host floating point arithmetic.
This allows the assertions to be disabled in release builds, so that
the code is faster and smaller, at the expense of not performing the
checks. Assertions can be re-enabled in release builds with the
debug-assertions flag in Cargo.toml, as the top-level Cargo.toml
file does.
Previously, cretonne-wasm used its own Local struct for identifying
local variables. However, now that cretonne-frontend provides a
Variable struct, just use that instead.
Frontends can still use their own types with `ILBuilder` and
`FunctionBuilder`. This just provides a basic `Variable` struct
for frontends that want it.