Skip to content

Commit b931c15

Browse files
authored
Merge pull request rust-lang#49 from rust-lang/feature/const-generics
Feature/const generics
2 parents d72927c + 5994771 commit b931c15

37 files changed

+1135
-1068
lines changed

Diff for: crates/core_simd/src/fmt.rs

+9-29
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@ debug_wrapper! {
3030
}
3131

3232
macro_rules! impl_fmt_trait {
33-
{ $($type:ty => $(($trait:ident, $format:ident)),*;)* } => {
33+
{ $($type:ident => $(($trait:ident, $format:ident)),*;)* } => {
3434
$( // repeat type
3535
$( // repeat trait
36-
impl core::fmt::$trait for $type {
36+
impl<const LANES: usize> core::fmt::$trait for crate::$type<LANES> {
3737
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
3838
$format(self.as_ref(), f)
3939
}
4040
}
4141
)*
4242
)*
4343
};
44-
{ integers: $($type:ty,)* } => {
44+
{ integers: $($type:ident,)* } => {
4545
impl_fmt_trait! {
4646
$($type =>
4747
(Debug, format),
@@ -54,7 +54,7 @@ macro_rules! impl_fmt_trait {
5454
)*
5555
}
5656
};
57-
{ floats: $($type:ty,)* } => {
57+
{ floats: $($type:ident,)* } => {
5858
impl_fmt_trait! {
5959
$($type =>
6060
(Debug, format),
@@ -63,7 +63,7 @@ macro_rules! impl_fmt_trait {
6363
)*
6464
}
6565
};
66-
{ masks: $($type:ty,)* } => {
66+
{ masks: $($type:ident,)* } => {
6767
impl_fmt_trait! {
6868
$($type =>
6969
(Debug, format);
@@ -74,32 +74,12 @@ macro_rules! impl_fmt_trait {
7474

7575
impl_fmt_trait! {
7676
integers:
77-
crate::u8x8, crate::u8x16, crate::u8x32, crate::u8x64,
78-
crate::i8x8, crate::i8x16, crate::i8x32, crate::i8x64,
79-
crate::u16x4, crate::u16x8, crate::u16x16, crate::u16x32,
80-
crate::i16x4, crate::i16x8, crate::i16x16, crate::i16x32,
81-
crate::u32x2, crate::u32x4, crate::u32x8, crate::u32x16,
82-
crate::i32x2, crate::i32x4, crate::i32x8, crate::i32x16,
83-
crate::u64x2, crate::u64x4, crate::u64x8,
84-
crate::i64x2, crate::i64x4, crate::i64x8,
85-
crate::u128x2, crate::u128x4,
86-
crate::i128x2, crate::i128x4,
87-
crate::usizex2, crate::usizex4, crate::usizex8,
88-
crate::isizex2, crate::isizex4, crate::isizex8,
77+
SimdU8, SimdU16, SimdU32, SimdU64, SimdU128,
78+
SimdI8, SimdI16, SimdI32, SimdI64, SimdI128,
79+
SimdUsize, SimdIsize,
8980
}
9081

9182
impl_fmt_trait! {
9283
floats:
93-
crate::f32x2, crate::f32x4, crate::f32x8, crate::f32x16,
94-
crate::f64x2, crate::f64x4, crate::f64x8,
95-
}
96-
97-
impl_fmt_trait! {
98-
masks:
99-
crate::mask8x8, crate::mask8x16, crate::mask8x32, crate::mask8x64,
100-
crate::mask16x4, crate::mask16x8, crate::mask16x16, crate::mask16x32,
101-
crate::mask32x2, crate::mask32x4, crate::mask32x8, crate::mask32x16,
102-
crate::mask64x2, crate::mask64x4, crate::mask64x8,
103-
crate::mask128x2, crate::mask128x4,
104-
crate::masksizex2, crate::masksizex4, crate::masksizex8,
84+
SimdF32, SimdF64,
10585
}

Diff for: crates/core_simd/src/intrinsics.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! This module contains the LLVM intrinsics bindings that provide the functionality for this
22
//! crate.
33
//!
4-
//! The LLVM assembly language is documented here: https://llvm.org/docs/LangRef.html
4+
//! The LLVM assembly language is documented here: <https://llvm.org/docs/LangRef.html>
55
66
/// These intrinsics aren't linked directly from LLVM and are mostly undocumented, however they are
77
/// simply lowered to the matching LLVM instructions by the compiler. The associated instruction
@@ -45,4 +45,11 @@ extern "platform-intrinsic" {
4545

4646
// ceil
4747
pub(crate) fn simd_ceil<T>(x: T) -> T;
48+
49+
pub(crate) fn simd_eq<T, U>(x: T, y: T) -> U;
50+
pub(crate) fn simd_ne<T, U>(x: T, y: T) -> U;
51+
pub(crate) fn simd_lt<T, U>(x: T, y: T) -> U;
52+
pub(crate) fn simd_le<T, U>(x: T, y: T) -> U;
53+
pub(crate) fn simd_gt<T, U>(x: T, y: T) -> U;
54+
pub(crate) fn simd_ge<T, U>(x: T, y: T) -> U;
4855
}

Diff for: crates/core_simd/src/lib.rs

+2-16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![no_std]
2-
#![feature(repr_simd, platform_intrinsics, link_llvm_intrinsics, simd_ffi)]
2+
#![feature(repr_simd, platform_intrinsics, link_llvm_intrinsics, simd_ffi, min_const_generics)]
33
#![warn(missing_docs)]
44
//! Portable SIMD module.
55
@@ -9,6 +9,7 @@ mod macros;
99
mod fmt;
1010
mod intrinsics;
1111
mod ops;
12+
mod round;
1213

1314
mod masks;
1415
pub use masks::*;
@@ -43,18 +44,3 @@ mod vectors_f32;
4344
pub use vectors_f32::*;
4445
mod vectors_f64;
4546
pub use vectors_f64::*;
46-
47-
mod vectors_mask8;
48-
pub use vectors_mask8::*;
49-
mod vectors_mask16;
50-
pub use vectors_mask16::*;
51-
mod vectors_mask32;
52-
pub use vectors_mask32::*;
53-
mod vectors_mask64;
54-
pub use vectors_mask64::*;
55-
mod vectors_mask128;
56-
pub use vectors_mask128::*;
57-
mod vectors_masksize;
58-
pub use vectors_masksize::*;
59-
60-
mod round;

0 commit comments

Comments
 (0)