Commit Graph

451 Commits

Author SHA1 Message Date
Dan Gohman
8becc9a64c Bump version to 0.41.0 2019-08-30 23:22:48 -07:00
Nicolas B. Pierron
381578311c Split edges to have a block to add regmove & copy instructions.
When using basic block instructions cannot be added in-between jump instructions which are ending basic blocks. These changes create extra basic blocks such that extra space is available for the spilling and moving registers where they are expected.
2019-08-30 18:44:35 +02:00
Nicolas B. Pierron
04b10b3fde Add feature flags to test files.
Cranelift can be compiled with feature flags which can change its output. To
accomodate changes of output related to feature flags, test file can now include
`feature "..."` and `feature ! "..."` directives in the preamble of the test
file.

The test runner would skip the test if the flag does not match the expectation
of the test case.
2019-08-28 16:42:07 +02:00
Andrew Brown
9612c71fbd Remove calling convention on FunctionRunner test
For this test to run on Windows, the explicit calling convention
must be removed so that the parser is free to use the host's
calling convention.
2019-08-28 16:33:25 +02:00
Andrew Brown
6fdc69ff2e Add options for parsing test files (#942)
* Add options for parsing test files

This change allows adding parsing parameters more easily; e.g. a parameter is needed for setting the default calling convention for functions parsed as a part of the `run` test feature.

* Set default calling convention that of the host for `test run` file tests

Previously `test run` used the parser's hard-coded CallConv::Fast as the default calling convention but with this change any test being `run` will use the default calling convention of the machine running the test. `test run` will now throw an error if the calling convention of the function does not match the host's.
2019-08-27 20:31:08 +02:00
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
c3cc225de9 Add filetest for verifying emitted rodata (i.e. test rodata) 2019-08-26 16:12:06 -07:00
Andrew Brown
8d812b24cc Add x86 encoding for vconst 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
Till Schneidereit
9edbfed65f Switch from mmap to memmap to support Windows 2019-08-26 14:07:39 +02:00
Ujjwal Sharma
ec8f72bf20 Use roundss/roundsd when available for Ceil/Floor/Trunc/Nearest (#931)
Don't tie the preexisting SIMD ISA predicates to the shared
enable_simd setting but make new ones instead.

Fixes: https://github.com/CraneStation/cranelift/issues/908
2019-08-26 13:37:27 +02: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
Andrew Brown
cc57e84cbd Fix segfault due to b64 encoding (#919)
* Fix segfault due to b64 encoding

Prior to this patch, bconst.b64 encoded its instruction with a 32-bit immediate that caused improper decoding of the MOV instruction; instead, use a REX prefix and rely on zero-extension of the immediate. Fixes #911.
2019-08-23 18:04:34 +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
13f83d8291 Bump version to 0.40.0 2019-08-20 15:32:19 -07:00
Dan Gohman
fbfeaaa32b Revert the test changes too.
In 1169dc520815fa4a6b1285914748408729a28caa, I forgot to git add the
test file changes.
2019-08-20 15:26:52 -07:00
Dan Gohman
0d54517d35 Bump version to 0.39.0 2019-08-20 14:26:16 -07:00
Dan Gohman
0c2c597852 Update to latest versions of term, capstone, wabt, goblin, wasmparser. 2019-08-20 14:18:14 -07:00
Andrew Brown
b4ef90cfcd Remove SSE2 setting for x86
In talking to @sunfishcode, he preferred to avoid the confusion of more ISA predicates by eliminating SSE2. SSE2 was released with the Pentium 4 in 2000 so it is unlikely that current CPUs would have SIMD enabled and not have this feature. I tried to note the SSE2-specific instructions with comments in the code.
2019-08-20 10:21:12 -07:00
Andrew Brown
3fdc78174f Add x86 implementation of extractlane instruction 2019-08-20 10:21:12 -07: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
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
00b8d019c9 Bump version to 0.38.0 (#894) 2019-08-06 14:41:13 -05: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
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
bjorn3
8e33ca3055 Fix tests 2019-07-31 15:20:08 +02:00
Dan Gohman
16e16c49a7 Bump version to 0.37.0 2019-07-27 04:50:19 -07:00
Nicolas B. Pierron
42ebd2a5f4 Fix licm/jump-table-entry.clif test case to work with basic blocks. 2019-07-25 14:28:07 +02:00
Dan Gohman
4641fdd302 Bump version to 0.36.0 2019-07-19 16:28:40 -07:00
Andrew Brown
084e279def Add x86 implementation of splat instruction 2019-07-16 17:07:44 -07:00
Andrew Brown
3b36a1d1d8 Add x86 implementation of insertlane instruction 2019-07-16 17:07:44 -07:00
Andrew Brown
683e7c75a3 Add x86-specific shuffle instructions
This includes both PSHUFD and PSHUFB; these are necessary to legalize future SIMD instructions.
2019-07-16 17:07:44 -07:00
Andrew Brown
61772e9775 Add raw_bitcast instruction
Casts bits as a different type of the same width with no change to the data (unlike bitcast)
2019-07-16 17:07:44 -07:00
Andrew Brown
5f0e5567c1 Add scalar_to_vector instruction
Moves scalar values in a GPR register to an FPR register
2019-07-16 17:07:44 -07:00
Andrew Brown
f2c48009e8 Disable SIMD features by default 2019-07-16 17:07:44 -07:00
Dan Gohman
67dd0b5015 Bump version to 0.35.0 2019-07-12 15:48:19 -07:00
Nicolas B. Pierron
8edc40cb49 BB-like manual legalization for x86 ISA 2019-07-12 14:20:26 +02:00
Dan Gohman
59f6c81e4f Bump version to 0.34.0 2019-07-09 12:31:58 -07: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
Nicolas B. Pierron
f431465802 Replace newly inserted fallthrough by jump. 2019-07-08 15:17:49 +02:00
Nicolas B. Pierron
8bfdfbe68b Use BB-like EBB in filetests/regalloc/*.clif 2019-07-08 15:17:49 +02:00
Nicolas B. Pierron
a1a4b9bfb1 Use BB-like EBB in filetests/verifier/*.clif 2019-07-08 15:17:49 +02:00
Nicolas B. Pierron
8c65ec0dde Use BB-like EBB in filetests/regress/*.clif 2019-07-08 15:17:49 +02:00
Nicolas B. Pierron
3c6ca9049e Use BB-like EBB in filetests/simple_gvn/*.clif 2019-07-08 15:17:49 +02:00