`urm_noflags` is a variant of `urm` which doesn't clobber the flags, and
`urm_noflags_abcd` is a further variant for ABCD registers, so it also
doesn't clobber the flags.
This switches from a custom list of architectures to use the
target-lexicon crate.
- "set is_64bit=1; isa x86" is replaced with "target x86_64", and
similar for other architectures, and the `is_64bit` flag is removed
entirely.
- The `is_compressed` flag is removed too; it's no longer being used to
control REX prefixes on x86-64, ARM and Thumb are separate
architectures in target-lexicon, and we can figure out how to
select RISC-V compressed encodings when we're ready.
* 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.
With 8f4a3586e5a787fd32a9afe35df4a9811d92c66b, we now have proper wabt
integration, so we no longer need to download and install a separate
binary package.
* Optimize 0.0 floating point constants. Rather than using the existing
process of emitting bit patterns and moving them into floating point
registers, use the `xorps` instruction to zero out the register.
* is_zero predicate function will not accept negative zero. Fixed formatting for encoding recipe and filetests.
Define `WasmError` (and an accompanying `WasmResult`) to represent
errors translating WebAssembly functions. Make `translate_call` and
related functions return `WasmResult`s so that embedders have the
flexibility to reject features they don't support.
Move `InvalidInput` out of `CtonError` and into `WasmError`, where it's
now named `InvalidWebAssembly`, as it's a WebAssembly-specific error
condition. Also extend it to preserve the original error message and
bytecode offset.
* Use FxHashMap instead of HashMap for better performance
* Replace the binary search in the coalescing pass with a FxHashMap
This speeds up coalescing by up to 16% and overall compilation by 9%
* Generate debug symbols in optimized builds.
This allows profiling tools to provide more accurate information,
especially details about inlined functions.
* Rewrite and optimize partition_slice
This improves the performance of the register allocation passes
which use LiveValueTracker.
Include the name of the variable when diagnosing uses and defs of
undeclared variables. And, add an assert to def_var to check that the
declared type of a variable matches the value type of the def.
With this change, `Variable` implementations must now implement `Debug`.
* added wip translate_module fuzzer
* use local binaryen-rs fork (with shim) for fuzzing
* minor doc cleanup
* check fuzzer integration via CI
* switch back to upstream binaryen-rs; add forgotten integration test directive
* Start adding the load_complex and store_complex instructions.
N.b.:
The text format is not correct yet. Requires changes to the lexer and parser.
I'm not sure why I needed to change the RuntimeError to Exception yet. Will fix.
* Get first few encodings of load_complex working. Still needs var args type checking.
* Clean up ModRM helper functions in binemit.
* Implement 32-bit displace for load_complex
* Use encoding helpers instead of doing them all by hand
* Initial implementation of store_complex
* Parse value list for load/store_complex with + as delimiter. Looks nice.
* Add sign/zero-extension and size variants for load_complex.
* Add size variants of store_complex.
* Add asm helper lines to load/store complex bin tests.
* Example of length-checking the instruction ValueList for an encoding. Extremely questionable implementation.
* Fix Python linting issues
* First draft of postopt pass to fold adds and loads into load_complex. Just simple loads for now.
* Optimization pass now works with all types of loads.
* Add store+add -> store_complex to postopt pass
* Put complex address optimization behind ISA flag.
* Add load/store complex for f32 and f64
* Fixes changes to lexer that broke NaN parsing.
Abstracts away the repeated checks for whether or not the characters
following a + or - are going to be parsed as a number or not.
* Fix formatting issues
* Fix register restrictions for complex addresses.
* Encoding tests for x86-32.
* Add documentation for newly added instructions, recipes, and cdsl changes.
* Fix python formatting again
* Apply value-list length predicates to all LoadComplex and StoreComplex instructions.
* Add predicate types to new encoding helpers for mypy.
* Import FieldPredicate to satisfy mypy.
* Add and fix some "asm" strings in the encoding tests.
* Line-up 'bin' comments in x86/binary64 test
* Test parsing of offset-less store_complex instruction.
* 'sNaN' not 'sNan'
* Bounds check the lookup for polymorphic typevar operand.
* Fix encodings for istore16_complex.
* initial set of work for windows fastcall (x64) call convention
- call conventions: rename `fastcall` to `windows_fastcall`
- add initial set of filetests
- ensure arguments are written after the shadow space/store (offset-wise)
The shadow space available before the arguments (range 0..32)
is not used as spill space yet.
* address review feedback
* x86 recipes: emit StackOverflow trap for all sp-relative loads and stores
* x86 recipes: emit StackOverflow trap for push and pop
* x86 binary filetests: add stk_ovf trap annotations
* Remove the mypy version constraint and set strict_optional to False.
* Add type annotations for `ISA` variables.
mypy 0.600 seems to require explicit annotations here.
* Annotate the ISA variables in the defs.py files too.
* cretonne-faerie: add a translation mechanism for LibCalls
* cretonne-faerie: docs for libcall_names, rustfmt
* cretonne-faerie: switch libcall naming to use a closure
* travis: debug mypy version
* travis: pin mypy to 0.521
mypy released 0.600 today and even with `--no-strict-optional` flag
passed to it (in lib/codegen/meta/check.sh) it fails to infer the type
of values that did not need type annotations in the past
* faerie-backend: fix swapped nearbyint functions
* cretonne-faerie: move boxing out of FaerieBuilder