816 Commits

Author SHA1 Message Date
Hans Kratz
26cce19427
Make dedup guard optional (#1215) 2021-09-20 17:19:05 +01:00
Hans Kratz
504b0cf68b
Arm Fused Multiply-Add fixes (#1219) 2021-09-20 17:18:20 +01:00
Sparrow Li
328553ef64
Complete vld1 instructions with some corrections (#1216) 2021-09-18 14:13:24 +01:00
Hans Kratz
4f8ed0335c
Check inlining and instruction count for assert_instr(nop) as well (#1218) 2021-09-18 01:53:32 +01:00
Jamie Cunliffe
bd0e352338
Intrinsic test tool to compare neon intrinsics with C (#1170) 2021-09-09 19:16:45 +01:00
Hans Kratz
5cd6850171
Normalize [us]shll.* ..., #0 aarch64 disassembly to the preferred [us]xtl.* (#1213) 2021-09-08 23:41:31 +01:00
Hans Kratz
00f611f305
Change aarch64 vld1* instructions to not cause individual loads (#1207) 2021-09-08 23:40:49 +01:00
Hans Kratz
bf2122753a Disable arm inlining check again for now as some tests are still failing. 2021-09-09 00:22:33 +02:00
Hans Kratz
5995d769ad Use a lighter dedup guard in the assert_instr test shims. 2021-09-09 00:22:33 +02:00
Hans Kratz
755e622d17 Implement proper subroutine call detection for x86, x86_64, aarch64 and wasm32. 2021-09-08 19:14:13 +02:00
Hans Kratz
03fa985cf0 remove assembly parsing special case for otool output (no longer needed) 2021-09-08 19:14:13 +02:00
Hans Kratz
999d954aa4 using v8.6a target feature to cover more instructions 2021-09-08 19:14:13 +02:00
Hans Kratz
f5af9d15a9 Use objdump on Macos x86_64 as well. 2021-09-08 19:14:13 +02:00
Hans Kratz
f15c851517 Use LLVM objdump on Macos ARM64 because it is not possible to enable TME support with otool 2021-09-08 19:14:13 +02:00
Sparrow Li
9e34c6d4c8
Add vst neon instructions (#1205)
* add vst neon instructions

* modify the instruction limit
2021-08-31 21:35:30 +01:00
Joshua Liebow-Feeser
c9e0420448
powerpc::vector_bool_long is a vector of two i64s (#1204) 2021-08-27 17:33:23 +01:00
Sparrow Li
4baf95fddd
add vldx neon instructions (#1200) 2021-08-24 19:51:30 +01:00
Alex Crichton
b10d00cae0
Update codegen for simd wasm intrinsics with LLVM 13 (#1203) 2021-08-23 01:45:59 +01:00
Frank Steffahn
870cf5751d Fix typos “an”→“a” 2021-08-22 18:55:49 +01:00
Frank Steffahn
5b5df599d3 Fix typos “a”→“an” 2021-08-22 18:55:49 +01:00
Pierre Krieger
78bef173f4 Fix "it's purpose" -> "its purpose" 2021-08-14 17:44:03 +01:00
Ömer Sinan Ağacan
103e90de1d Rewording in Wasm all_true SIMD instruction docs
- Use "true" and "false" instead of "1" and "0"
- "nonzero" -> "non-zero"
- "returns true if ... or false if ..." -> "returns true ..., false
  otherwise"
2021-08-14 09:28:29 +01:00
Aleksey Kladov
e91f80fc22 mark core::arch::wasm32::unreachable as safe
This intrinsic doesn't have any preconditions and is always safe to
call, so it can be safe.

This function is already stable, but dropping `unsafe` is a backwards
compatible change.

Note tha we already have a precedent for wasm intrinsics being safe --
wasm simd is safe.

It is relatively practically important to mark this safe --
wasm32::unreachable is directly useful in practice as more codesize
efficient `panic!()`.
2021-08-12 11:09:05 +01:00
Mara Bos
685e8d906d Remove references to the crates on crates.io.
They haven't been published in years. This removes the suggestion that
the crates on crates.io are actively updated/maintained.
2021-08-12 00:24:32 +01:00
Jamie Cunliffe
0285e513e0 Update arm vcvt intrinsics to use llvm.fpto(su)i.sat
Those intrinsics have the correct semantics for the desired fcvtz instruction,
without any undefined behaviour. The previous simd_cast was undefined for
infinite and NaN which could cause issues.
2021-08-11 13:13:19 +01:00
Amanieu d'Antras
52dae87319 Remove unused wasm feature 2021-08-11 11:46:45 +01:00
Alex Crichton
b5c437e119 Add tests for remaining wasm simd intrinsics
Wasmtime now supports all of the simd proposal, so this commit
uncomments instruction assertions and tests, while also adding more
tests, for all wasm simd instructions. This means that all wasm simd
instructions should be tested and have running instruction assertions,
except for `i64x2.abs`, which will require an LLVM upgrade to LLVM 13.
2021-08-03 00:46:38 +01:00
Adam Gemmell
3347e8cc98 Remove the bootstrap directive for cryptographic target_features 2021-08-02 23:38:57 +01:00
Adam Gemmell
8cb8cd2142 Replace the crypto feature with aes in generated intrinsics for aarch64
This allows us to deprecate the crypto target_feature in favour of its
subfeatures.

We cannot do this yet for ARM targets as LLVM requires the crypto
feature. This was fixed in
b8baa2a913
2021-08-02 23:38:57 +01:00
Alex Crichton
5800a3624a Remove stabilized features 2021-07-30 12:52:55 +02:00
Alex Crichton
8e8879ddd9 Mark f32x4 and f64x2 as const-stable on wasm
Now that `transmute` can be flagged as `const`-stable this commit
updates the `f32x4` and `f64x2` constructors as `const`-stable as well.
This also additionally rewrites the other integer constructors in a more
readable fashion now that the general `v128()` method is `const`-stable.
2021-07-30 12:52:55 +02:00
Amanieu d'Antras
335bc49609
Force the use of sysv64 calling convention in x86_64 disassembly tests (#1187)
This ensures that results are consistent across windows/linux tests.
2021-07-20 20:02:22 +01:00
bstrie
bfb3f78b6b
Revert "Move asm! and global_asm! to core::arch (#1183)" (#1185)
This reverts commit 9437b11cd4f42c5995eb41aa92ead877b9b7823a.
2021-07-20 09:49:59 +01:00
Alex Crichton
487db3bf1b
Document unsafety of wasm simd intrinsics (#1184)
Since most intrinsics are safe it likely makes sense to explicitly
document why there are a few intrinsics that are not safe. These
intrinsics are all unsafe for the same reason, which is that they're
dealing with a raw pointer that must be valid to load/store memory to.
Note that the are no alignment requirements on any of these intrinsics.
2021-07-16 17:40:14 +01:00
bstrie
4b8c2e5376
Move asm! and global_asm! to core::arch (#1183) 2021-07-15 05:21:50 +01:00
Yuki Okushi
069adbcc4c
Fix the stabilized version for simd_x86_bittest (#1182) 2021-06-12 18:25:16 +01:00
Yuki Okushi
fc0837cfa5
Stabilize simd_x86_bittest feature (#1180) 2021-06-11 01:31:44 +01:00
Alex Crichton
79140b43ea
wasm: Mark simd intrinsics as stable (#1179) 2021-06-10 20:32:39 +01:00
Alex Crichton
2c11b9fa1f
wasm: Mark most simd intrinsics as safe (#1177) 2021-06-10 12:13:33 +01:00
Adam Gemmell
1069e66439
Update aarch64 linux feature detection (#1146) 2021-05-28 01:37:20 +01:00
Alex Crichton
4e4a60b9d9
wasm: Lower alignment of all loads/stores (#1175)
This changes wasm simd intrisnics which deal with memory to match clang
where they all are emitted with an alignment of 1. This is expected to
not impact performance since wasm engines generally ignore alignment as
it's just a hint. Otherwise this can increase safety slightly when used
from Rust since if an unaligned pointer was previously passed in that
could result in UB on the LLVM side. This means that the intrinsics are
slighly more usable in more situations than before.

It's expected that if higher alignment is desired then programs will not
use these intrinsics but rather the component parts. For example instead
of `v128_load` you'd just load the pointer itself (and loading from a
pointer in Rust automatically assumes correct alignment). For
`v128_load64_splat` you'd do a load followed by a splat operation, which
LLVM should optimized into a `v128.load64_splat` instruction with the
desired alignment. LLVM doesn't fully support some optimizations (such
as optimizing `v128.load16_lane` from component parts) but that's
expected to be a temporary issue. Additionally we don't have a way of
configuring the alignment on operations that otherwise can't be
decomposed into their portions (such as with `i64x2_load_extend_u32x2`),
but we can ideally cross such a bridge when we get there if anyone ever
needs the alignment configured there.
2021-05-28 00:02:56 +01:00
Alex Crichton
4d6fa80bb3
wasm: Add convenience aliases with unsigned names (#1174)
Naming right now for wasm simd intrinsics takes the signededness of the
instruction into account, but some operations are the same regardless of
signededness, such as `i32x4_add`. This commit adds aliases for all of
these operations under unsigned names as well (such as `u32x4_add`)
which are just a `pub use` to rename the item as two names. The goal of
this is to assist in reading code (no need to switch back and forth
between `i` and `u`) as well as writing code (no need to always remember
which operations are the same for signed/unsigned but only available
under the signed names).
2021-05-27 16:52:15 +01:00
Alex Crichton
b3f06eb658
wasm: Change *_bitmask return values (#1173)
First change them all to unsigned since they're just returning bits, and
then also change them to the smallest-size integer which fits the return
value (`u16` for `i8x16_bitmask` and `u8` for everything else). This
suffers from an LLVM codegen bug for now, but it will hopefully get
fixed in the not too distant future.
2021-05-27 16:23:24 +01:00
Nils Hasenbanck
3ecc56b329
Add vst1_* neon intrinsics. (#1171) 2021-05-27 07:40:45 +01:00
Sparrow Li
10f7ebc387
Add vfma and vfms neon instructions (#1169) 2021-05-21 12:26:21 +01:00
Amanieu d'Antras
b216e9f9c4
Fix x86 SIMD byte shift intrinsics (#1168) 2021-05-20 01:47:38 +01:00
Sparrow Li
15749b0ed3
Modify the implementation of d_s64 suffix instructions (#1167) 2021-05-19 03:43:53 +01:00
Jamie Cunliffe
a98b05c635
Add support for the remaining vget(q)_lane functions. (#1164) 2021-05-19 02:53:59 +01:00
Aaron Hill
750250023f
Use #![feature(const_panic)] to produce better assertion errors (#1165) 2021-05-15 23:47:59 +01:00
Sparrow Li
09a05e02f4
Add vmull_p64 and vmull_high_p64 for aarch64 (#1157) 2021-05-15 21:58:23 +01:00