Andrew Brown
020e5987d3
Use little-endian ordering for CLIF vconst immediate
...
Examining wasm-objdump revealed that it stores SIMD constants in little-endian order, e.g.:
000071 func[2] <test_const>:
000072: fd 02 01 00 00 00 02 00 00 | v128.const 0x00000001 0x00000002 0x00000003 0x00000004
00007b: 00 03 00 00 00 04 00 00 00 |
000084: fd 0d 03 | i32x4.extract_lane 3
000087: 0b | end
This change avoids confusion by making the CLIF representation use little-endian order as well.
2019-08-26 16:12:06 -07:00
Andrew Brown
684721ca29
Add x86 recipe for vconst
2019-08-26 16:12:06 -07:00
Andrew Brown
407d24c013
Add operand kind and format for unsigned 128-bit immediates
2019-08-26 16:12:06 -07:00
Andrew Brown
5ded38ce3e
Add unsigned 128-bit immediate
2019-08-26 16:12:06 -07:00
Andrew Brown
7b2d055f78
Add ability to relocate constants using RelocSink
2019-08-26 16:12:06 -07:00
Andrew Brown
c20b13d5a9
Add ConstantPool
2019-08-26 16:12:06 -07:00
Andrew Brown
ea9ee202bb
Clear jump tables when function data is cleared
2019-08-26 16:12:06 -07:00
julian-seward1
b8fb52446c
Cranelift: implement redundant fill removal on tree-shaped CFG regions. Mozilla bug 1570584. ( #906 )
2019-08-25 19:37:34 +02:00
Artur Jamro
d3815a0399
Implement serde and equality traits for SecondaryMap
2019-08-22 15:54:10 -07:00
Sean Stangl
e736367b8c
Make fold_redundant_jumps() feature-gated on basic-blocks
2019-08-22 18:54:49 +02:00
Andrew Brown
ff3c44385c
Add test run to cranelift-filetests to allow executing CLIF ( #890 )
...
* Add ability to run CLIF IR using `clif-util run [-v] {file}` and add `test run` to cranelift-filetests to allow executing CLIF
This re-factors the compile/execute parts to a FunctionRunner that is shared between cranelift-filetests and clif-util. CLIF can be now be run using `clif-util run` as well as during `clif-util test` for files with a `test run` header. As before, only functions suffixed with a `run` comment are executed. The `run: fn(...) == ...` expression syntax is left for a subsequent change.
2019-08-21 18:03:09 +02:00
Dan Gohman
291afaf4ad
Temporarily disable fold_redundant_jumps.
...
See #916 for details.
2019-08-20 15:14:28 -07:00
Benjamin Bouvier
036b9aea94
[codegen] Rename and explicit usage of replace_with_alias;
...
It can actually only replace one result; don't try to make it generic
yet, since there's no point in doing so right now, and make it do the
dumb thing so it's not surprising to use.
2019-08-20 19:06:09 +02:00
Joshua Nelson
bf77985e25
Fix broken links using rustdoc nightly
...
Uses cross-crate documentation links so that rustdoc does the hard work
of making relative links for us.
Requires nightly version of rustdoc in order to generate links based on
path names, see
https://github.com/rust-lang/rfcs/blob/master/text/1946-intra-rustdoc-links.md
for details.
2019-08-19 11:48:37 +02:00
Carmen Kwan
19257f80c1
Add reference types R32 and R64
...
-Add resumable_trap, safepoint, isnull, and null instructions
-Add Stackmap struct and StackmapSink trait
Co-authored-by: Mir Ahmed <mirahmed753@gmail.com >
Co-authored-by: Dan Gohman <sunfish@mozilla.com >
2019-08-16 11:35:16 -07:00
Benjamin Bouvier
b659262d2a
Use aliasing instead of copying in simple_preopt;
2019-08-16 10:41:51 -07:00
Benjamin Bouvier
2ee35b7ea1
Implement a Windows Baldrdash calling convention;
2019-08-16 14:25:15 +02:00
Benjamin Bouvier
d8d3602257
Adds the libcall_call_conv setting and use it for libcall calls expansion;
2019-08-12 16:12:00 -07:00
Sean Stangl
c7b4b98cac
Add a fold_redundant_jumps() pass to the branch relaxation phase. ( #887 )
2019-08-09 15:30:11 -06:00
Yury Delendik
29b32b3062
Serialize ValueLabel and StackSlots ( #888 )
2019-08-05 08:31:00 -05:00
Nicolas B. Pierron
c903735ea8
Shrink: Factor accesses of instruction data
2019-08-02 19:34:18 +02:00
Benjamin Bouvier
627ba24b59
Simplify jump table instructions and add missing conversion;
...
This makes non-legalized jump table instructions operate on operands with
pointer-sized types. This means we need to extend smaller types into the
pointer-sized operand, when the two don't match.
2019-08-02 18:39:39 +02:00
Nicolas B. Pierron
f0d7438728
Properly legalize with empty jump tables.
2019-08-01 13:47:28 +02:00
iximeow
6e57e3f8f3
preopt: use replaced arg after having replaced BinaryImm
...
when replacing BinaryImm, we use the prior arg, but later use the arg
that was replaced when writing an alias if we can determine the new op
is actually equivalent to a simple copy
2019-08-01 11:00:37 +02:00
Benjamin Bouvier
057d4f6e3c
Simple preopt: Fold (imm OP x) into (OP_IMM x imm) whenever possible;
2019-07-31 17:42:05 +02:00
Benjamin Bouvier
23ac723d4c
Simple preopt: fold instructions using simple algebraic identities;
2019-07-31 17:42:05 +02:00
Benjamin Bouvier
2fef2eef67
Simple preopt: try to fold right-shift of left-shift into an extended move;
2019-07-31 17:42:05 +02:00
Benjamin Bouvier
141b45e0e1
Simple preopt: fold binary opcodes chains together;
2019-07-31 17:42:05 +02:00
Benjamin Bouvier
dc58a5fc5c
Simple preopt: use the immediate form for adjust_sp_down/ifcmp whenever possible;
2019-07-31 17:42:05 +02:00
bjorn3
6042ee6f2d
Improve graphviz rendering
2019-07-31 15:20:08 +02:00
Andrew Brown
4074ce2f5d
Add a unit test for ir::Type::lane_type() for a vector type
...
Closes #834
2019-07-29 11:13:39 +02:00
Nicolas B. Pierron
feecd23967
Assert if newly added instructions break the Basic Block invariant.
2019-07-25 14:33:25 +02:00
Sean Stangl
8efaeec502
Verify that FunctionBuilder blocks are basic blocks in debug mode ( #857 )
...
To use, enable the "basic-blocks" feature on cranelift-frontend.
2019-07-19 09:52:05 -06:00
Sean Stangl
9b97ddf29a
Enable basic block checks through a feature. ( #856 )
...
This allows prefixing BB-specific code with "#[cfg(feature = "basic-blocks")]",
which avoids having to reference an environment variable across the codebase.
The easiest way to enable the feature locally is to add the arguments
'features = ["basic-blocks"]' to the workspace Cargo.toml, where it defines
the cranelift-codegen dependency.
2019-07-18 09:59:28 -06:00
Andrew Brown
084e279def
Add x86 implementation of splat instruction
2019-07-16 17:07:44 -07:00
Andrew Brown
c39a9b4e3f
Assign vector arguments to FPR registers
2019-07-16 17:07:44 -07:00
Andrew Brown
f2c48009e8
Disable SIMD features by default
2019-07-16 17:07:44 -07:00
Artur Jamro
9e884b4433
Add support for some serde serialization ( #847 )
...
* Add support for some serde serialization
2019-07-12 15:30:50 -07:00
Nicolas B. Pierron
8edc40cb49
BB-like manual legalization for x86 ISA
2019-07-12 14:20:26 +02:00
Mark McCaskey
f856b124fd
Use Default trait for Position and DisplayFunctionAnnotations ( #843 )
2019-07-12 11:21:00 +02:00
Sean Stangl
237d48477a
Fix an outdated comment referring to FunctionLayout instead of Layout
2019-07-09 18:05:36 +02:00
Nicolas B. Pierron
3ac7466cab
Legalize br_table to a BB-like format.
2019-07-09 16:48:54 +02:00
Nicolas B. Pierron
1963c223b1
Legalize trapz/trapnz to a BB-like format.
2019-07-09 16:02:49 +02:00
Benjamin Bouvier
f11fc34066
Build fix: add crates::predicates to the Riscv enc_tables file;
2019-07-09 11:31:21 +02:00
Benjamin Bouvier
cd4c28ad97
[meta] Legalization: Unprefix some module paths to make code neater;
2019-07-09 10:56:50 +02:00
Benjamin Bouvier
3545363006
Add ir::Types::lane_of as an alias of lane_type to be used in typevar constraints;
2019-07-09 10:56:50 +02:00
Benjamin Bouvier
563525b090
[meta] Remove mentions to Python in comments of the non-meta crate;
2019-07-05 17:50:17 +02:00
Benjamin Bouvier
88307f693a
[meta] Generate the encodings files;
2019-07-05 17:50:17 +02:00
Nicolas B. Pierron
460fdaa34d
Add verification pass to migrate from EBB to BB.
2019-07-03 13:57:14 +02:00
Benjamin Bouvier
079ccf1f6e
Remove unused results warnings;
2019-06-24 11:42:26 +02:00