225 Commits

Author SHA1 Message Date
Daniel Smith
ad2fe20a87 Use correct instruction 2020-05-29 00:07:03 +01:00
Daniel Smith
2d717c3623 Fix stdarch-verify test 2020-05-29 00:07:03 +01:00
Daniel Smith
7ab646ef42 Move 64 bit function based on stdarch-verify 2020-05-29 00:07:03 +01:00
Daniel Smith
e0ffa88fe7 Add one AVX512f comparison and the intrinsics needed to test it 2020-05-29 00:07:03 +01:00
Daniel Smith
7a29fcc1c8 Convert __mmask16 to use an unsigned type 2020-05-28 22:24:46 +01:00
Marko Mijalkovic
15154a882d Use fp64 detection instead of OS blacklist 2020-05-07 20:48:47 +01:00
Marko Mijalkovic
66ef866b34 Fix code style 2020-05-07 20:48:47 +01:00
Marko Mijalkovic
aaee0709b3 Fix building libcore for the Sony PSP
Building the MIPS MSA module for non-fp64 targets fails with an LLVM
error. This commit blacklists PSP targets from MSA support in order to
fix building libcore.
2020-05-07 20:48:47 +01:00
Daniel Verkamp
d9a67ea922
Manually preserve rbx across cpuid instruction (#851)
* Manually preserve rbx across cpuid instruction

This fixes an issue observed when using __cpuid and __cpuid_count with
Address Sanitizer enabled: the generated code uses the rbx register to
access ASAN tracking information without reloading it after cpuid,
resulting in a segfault since the rbx register is overwritten by cpuid
(https://crbug.com/1072045).

This seems like a compiler backend bug, and indeed there is a
long-standing LLVM bug report about a very similar issue:
https://bugs.llvm.org/show_bug.cgi?id=17907

To work around this issue, we can manually preserve the rbx register
contents in the inline assembly.  This is the approach taken by LLVM's
own host cpuid detection code (lib/Host/Support.cpp).  The original rbx
value is stashed in rsi, which is then swapped with rbx to restore the
original value as well as keep the output ebx value from the CPUID
instruction to be used as an output of the inline assembly.

The rbx clobber is also removed; this seems ineffective, and it
conflicts with the ebx output of the inline assembly (ebx is a
subregister of rbx): "Note that clobbering named registers that are also
present in output constraints is not legal."
(https://llvm.org/docs/LangRef.html#clobber-constraints)

* Add link to LLVM bug in cpuid workaround comment
2020-04-29 01:50:13 +01:00
Amanieu d'Antras
1f32017c84 Rustfmt 2020-04-24 00:36:01 +01:00
Amanieu d'Antras
04c1a9a9e9
Use llvm_asm! instead of asm! (#846) 2020-04-09 00:05:10 +01:00
Heinz N. Gies
70f3623b52
Implement additional ARM NEON intriniscs (#792) 2020-04-07 20:06:38 +01:00
Linus Färnstrand
d7a1dbd509 Replace all std::<primitive>::MIN/MAX with just <primitive>::MIN/MAX 2020-04-04 09:51:11 -07:00
Linus Färnstrand
f14b746319 Replace all max/min_value() with MAX/MIN 2020-04-04 09:51:11 -07:00
Linus Färnstrand
e0533a30d3 Stop importing int/float modules 2020-04-04 09:51:11 -07:00
Makoto Kato
d5d3117b9b
Support crc32 even if on arm32 (#834)
CRC32 is supported on A32 and T32.
2020-03-30 16:38:23 +01:00
Linus Färnstrand
b852344de5
Replace module MIN/MAX and min/max_value() with assoc consts (#843) 2020-03-29 17:08:21 +01:00
Tyg13
9ab5dc0873
Remove unnecessary parens. (#839) 2020-01-30 13:15:36 +01:00
Luca Barbato
1601ce4f2f Add Icelake avx512 features (#838)
* Add Icelake avx512 features

As documented in https://software.intel.com/sites/default/files/managed/c5/15//architecture-instruction-set-extensions-programming-reference.pdf

* Sort the avx512 feature checks by bit

* Unbreak macos

Force nightly.
2020-01-26 13:10:29 -06:00
Yuki Okushi
c8c587d0cd Use issue = "none" instead of "0" 2019-12-27 11:25:13 +01:00
Oliver Scherer
43d49b6247 Update simd_llvm.rs 2019-12-20 23:31:51 +01:00
Oliver Scherer
5548609204 Add const unstability attributes
These are needed for rustc to be able to correctly handle stability of constness of intrinsics. Without either `rustc_const_unstable` or `rustc_const_stable` an intrinsic is not const evaluable at all.
2019-12-20 23:31:51 +01:00
bjorn3
c8249c76c4 Revert mmx changes
On i586 the simd_* intrinsics don't compile to MMX instructions, even
with `#[target_feature(enable = "mmx")]`.
2019-12-18 17:41:21 +01:00
bjorn3
ea51d868ec Rustfmt 2019-12-18 17:41:21 +01:00
bjorn3
0aa5e29724 Revert _mm_{min,max}_ps changes and add explanation why 2019-12-18 17:41:21 +01:00
bjorn3
2112972a64 Use <i64>::swap_bytes instead of llvm.bswap.i64 2019-12-18 17:41:21 +01:00
bjorn3
61693f3b53 Remove some unused llvm intrinsic declarations 2019-12-18 17:41:21 +01:00
bjorn3
c7e16bcebe Use <i32>::swap_bytes instead of llvm.bswap.i32 2019-12-18 17:41:21 +01:00
bjorn3
35fc3c36e3 Use simd_* in x86/avx2.rs where possible 2019-12-18 17:41:21 +01:00
bjorn3
fb84f79ce7 Use simd_* in x86/avx.rs where possible 2019-12-18 17:41:21 +01:00
bjorn3
c5572ec1f6 Use simd_* in x86/sse41.rs where possible 2019-12-18 17:41:21 +01:00
bjorn3
4da22d5120 Use simd_saturating_* in x86/sse2.rs where possible 2019-12-18 17:41:21 +01:00
bjorn3
039944d366 Use simd_fmin and simd_fmax for _mm_min_ps and _mm_max_ps 2019-12-18 17:41:21 +01:00
bjorn3
4de364cfb4 Use simd_* in x86/mmx.rs where possible 2019-12-18 17:41:21 +01:00
bjorn3
1c38869538 Add missing simd platform intrinsics 2019-12-18 17:41:21 +01:00
bjorn3
a4cd918dff Use simd_fma where possible 2019-12-18 17:41:21 +01:00
bjorn3
8c643df017 Use simd_floor and simd_ceil where possible 2019-12-18 17:41:21 +01:00
bjorn3
1ac2f13d76 Use simd_fsqrt where possible 2019-12-18 17:41:21 +01:00
Makoto Kato
51c3295de1 Fix unused import: mem::transmute
When building on aarch64, the following warning occurs.

```
warning: unused import: `mem::transmute`
 --> crates/core_arch/src/arm/neon.rs:3:38
  |
3 | use crate::{core_arch::simd_llvm::*, mem::transmute};
  |                                      ^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default
```
2019-12-06 12:17:56 +01:00
ecstatic-morse
7c56404f1a Add #[rustc_args_required_const] to simd_shuffle
Currently, these have to be special-cased in the promotion logic for rustc.
2019-10-30 10:29:15 +01:00
Mateusz Mikuła
ed27e2fccd Replace rustfmt::skip custom inner attribute with rustfmt.toml 2019-10-26 18:46:22 +02:00
Taiki Endo
cd7aa7720a Remove azure pipelines badges 2019-10-10 12:42:41 +02:00
gnzlbg
226b3265c8 Format 2019-09-16 23:43:01 +02:00
bors
5bfd08cd65 Auto merge of #796 - Mark-Simulacrum:bootstrap-snap, r=gnzlbg
Apply snap of bootstrap compiler in rust-lang/rust

FWIW, in the future we should try to avoid this as I'm assuming we'll break CI trying to land this here (and we can't swap bootstrap compilers in Rust until this lands).
2019-08-19 16:31:38 +00:00
bors
c519f89682 Auto merge of #799 - gnzlbg:has_test, r=gnzlbg
Verify that all intrinsics have a run-time test

Add a check to stdsimd-verify to check that all intrinsics have a run-time test. This is not the case right now, but we should at least not add intrinsics without tests.
2019-08-18 12:46:54 +00:00
atouchet
1422e0f95c Fix more links 2019-08-18 14:46:04 +02:00
gnzlbg
ed67655cc8 Verify that all intrinsics have a run-time test 2019-08-17 21:14:54 +02:00
gnzlbg
00e10f12ce Update badges 2019-08-13 18:04:22 +02:00
Mark Rousskov
c448527789 Apply snap of bootstrap compiler in rust-lang/rust 2019-08-12 19:36:23 -04:00
bjorn3
98122a49ce Make the _mm_movemask_epi8 test a non palindrome 2019-08-02 16:31:38 +02:00