Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIMD groundwork part 1 #27169

Merged
merged 40 commits into from
Aug 18, 2015
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c8b6d5b
Implement `repr(simd)` as an alias for `#[simd]`.
huonw Jul 13, 2015
c66554c
switch core::simd to repr(simd) and deprecate it.
huonw Jul 13, 2015
e364f0e
feature gate `cfg(target_feature)`.
huonw Jul 14, 2015
4f44258
Add some SIMD target_feature cfg's when appropriate.
huonw Jul 14, 2015
1bfbde6
Add comparison and shuffle SIMD intrinsics.
huonw Jul 16, 2015
9af385b
Add rustc_platform_intrinsics & some arm/x86 intrs.
huonw Jul 16, 2015
78eead6
Implement the simd_insert/simd_extract intrinsics.
huonw Jul 20, 2015
f1d3b02
Add x86 & arm reciprocal approximation intrinsics.
huonw Jul 29, 2015
ecb3df5
Add simd_cast intrinsic.
huonw Jul 29, 2015
8d8b489
Add intrinsics for SIMD arithmetic.
huonw Jul 31, 2015
cb1eb9d
Remove automatic built-in SIMD operators.
huonw Aug 4, 2015
5889127
Type check platform-intrinsics in typeck.
huonw Aug 5, 2015
717da95
Create "platform-intrinsic" ABI for SIMD/platform intrinsics.
huonw Aug 6, 2015
dbcd9f0
Create separate module for intrinsic typechecking.
huonw Aug 6, 2015
48f3507
Use error codes for platform-intrinsic typeck errors.
huonw Aug 6, 2015
bef1828
Rename `simd_basics` feature gate to `repr_simd`.
huonw Aug 6, 2015
4fe138c
Add _mm_shuffle_epi8 intrinsic.
huonw Aug 10, 2015
9b26895
Generalise SIMD casting to unequal bitwidths.
huonw Aug 10, 2015
e61f539
Add most SSE2 intrinsics.
huonw Aug 11, 2015
907bbac
Reorganise x86 intrinsic definitions.
huonw Aug 11, 2015
9d78efb
Add most SSE3 intrinsics.
huonw Aug 11, 2015
f6275b7
Add most SSSE3 intrinsics.
huonw Aug 11, 2015
627784b
Add most SSE4.1 intrinsics.
huonw Aug 11, 2015
67d56db
Rearrange x86 intrinsics to prepare for AVX.
huonw Aug 11, 2015
29b79aa
Add most AVX intrinsics.
huonw Aug 11, 2015
2a408ef
Add most AVX2 intrinsics.
huonw Aug 11, 2015
d598bdd
Reorganise ARM intrinsic definitions.
huonw Aug 11, 2015
2115468
Add most ARM intrinsics.
huonw Aug 12, 2015
1f5739f
Switch shuffle intrinsics to arrays of indices.
huonw Aug 12, 2015
8b68f58
Allow generic repr(simd) types.
huonw Aug 12, 2015
3e50067
Fix existing tests for new `#[repr(simd)]`.
huonw Aug 12, 2015
926b835
Tweak intrinsic error handling.
huonw Aug 13, 2015
84de8ca
Add tests for various intrinsic behaviours.
huonw Aug 13, 2015
4b24249
Code style tweaks.
huonw Aug 13, 2015
62ba85b
Rebase cleanup: is_simd lost its parameter.
huonw Aug 14, 2015
d792925
Shim some of the old std::simd functionality.
huonw Aug 14, 2015
891c914
simd_shuffleNNN returns its type parameter directly.
huonw Aug 14, 2015
502f9ac
Revamp SIMD intrinsic trans error handling.
huonw Aug 14, 2015
b067e44
Clean up simd_cast translation.
huonw Aug 14, 2015
02e9734
Add AArch64 vrecpeq_... intrinsic (necessary for minimal API).
huonw Aug 15, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/librustc_trans/trans/intrinsic.rs
Original file line number Diff line number Diff line change
@@ -1358,10 +1358,10 @@ fn generic_simd_intrinsic<'blk, 'tcx, 'a>

if let Some(cmp_op) = comparison {
assert_eq!(arg_tys.len(), 2);
require!(arg_tys[0].is_simd(tcx),
require!(arg_tys[0].is_simd(),
"SIMD comparison intrinsic monomorphized for non-SIMD argument type `{}`",
arg_tys[0]);
require!(ret_ty.is_simd(tcx),
require!(ret_ty.is_simd(),
"SIMD comparison intrinsic monomorphized for non-SIMD return type `{}`",
ret_ty);

@@ -1393,10 +1393,10 @@ fn generic_simd_intrinsic<'blk, 'tcx, 'a>
"bad `simd_shuffle` instruction only caught in trans?")
};

require!(arg_tys[0].is_simd(tcx),
require!(arg_tys[0].is_simd(),
"SIMD shuffle intrinsic monomorphized with non-SIMD input type `{}`",
arg_tys[0]);
require!(ret_ty.is_simd(tcx),
require!(ret_ty.is_simd(),
"SIMD shuffle intrinsic monomorphized for non-SIMD return type `{}`",
ret_ty);

@@ -1451,7 +1451,7 @@ fn generic_simd_intrinsic<'blk, 'tcx, 'a>
}

if name == "simd_insert" {
require!(arg_tys[0].is_simd(tcx),
require!(arg_tys[0].is_simd(),
"SIMD insert intrinsic monomorphized for non-SIMD input type");

let elem_ty = arg_tys[0].simd_type(tcx);
@@ -1460,7 +1460,7 @@ fn generic_simd_intrinsic<'blk, 'tcx, 'a>
return InsertElement(bcx, llargs[0], llargs[2], llargs[1])
}
if name == "simd_extract" {
require!(arg_tys[0].is_simd(tcx),
require!(arg_tys[0].is_simd(),
"SIMD insert intrinsic monomorphized for non-SIMD input type");

let elem_ty = arg_tys[0].simd_type(tcx);
@@ -1470,10 +1470,10 @@ fn generic_simd_intrinsic<'blk, 'tcx, 'a>
}

if name == "simd_cast" {
require!(arg_tys[0].is_simd(tcx),
require!(arg_tys[0].is_simd(),
"SIMD cast intrinsic monomorphized with non-SIMD input type `{}`",
arg_tys[0]);
require!(ret_ty.is_simd(tcx),
require!(ret_ty.is_simd(),
"SIMD cast intrinsic monomorphized with non-SIMD return type `{}`",
ret_ty);
require!(arg_tys[0].simd_size(tcx) == ret_ty.simd_size(tcx),
@@ -1614,7 +1614,7 @@ fn generic_simd_intrinsic<'blk, 'tcx, 'a>
($($name: ident: $($($p: ident),* => $call: expr),*;)*) => {
$(
if name == stringify!($name) {
require!(arg_tys[0].is_simd(tcx),
require!(arg_tys[0].is_simd(),
"`{}` intrinsic monomorphized with non-SIMD type `{}`",
name, arg_tys[0]);
let in_ = arg_tys[0].simd_type(tcx);
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/intrinsic.rs
Original file line number Diff line number Diff line change
@@ -481,7 +481,7 @@ fn match_intrinsic_type_to_type<'tcx, 'a>(
},
Pointer(_) => unimplemented!(),
Vector(ref inner_expected, len) => {
if !t.is_simd(tcx) {
if !t.is_simd() {
simple_error(&format!("non-simd type `{}`", t),
"simd type");
return;