Skip to content

Commit f144def

Browse files
committed
Remove use of SIMD types, for now
The simd module should be able to support using real SIMD types when compiled with a nightly and 'fake' SIMD types when compiled against stable. However, I'm hitting some ICE that I don't know how to workaround when trying to use the real SIMD types with this approach. So, disable SIMD types until we can figure that out.
1 parent 2155cd5 commit f144def

File tree

3 files changed

+1
-44
lines changed

3 files changed

+1
-44
lines changed

src/aessafe.rs

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,10 @@ use std::ops::{BitAnd, BitXor, Not};
127127
use std::default::Default;
128128

129129
use cryptoutil::{read_u32v_le, write_u32_le};
130+
use simd::u32x4;
130131
use step_by::RangeExt;
131132
use symmetriccipher::{BlockEncryptor, BlockEncryptorX8, BlockDecryptor, BlockDecryptorX8};
132133

133-
// Using std::unstable::simd::u32x4 results in issues creating static arrays of u32x4 values.
134-
// Defining the type here avoids that problem. Additionally, we need to implement various trait from
135-
// libstd which wouldn't be possible if we used that type directly.
136-
#[simd]
137-
#[derive(Copy, Eq, PartialEq)]
138-
#[allow(non_camel_case_types)]
139-
pub struct u32x4(u32, u32, u32, u32);
140-
141134
const U32X4_0: u32x4 = u32x4(0, 0, 0, 0);
142135
const U32X4_1: u32x4 = u32x4(-1, -1, -1, -1);
143136

@@ -1196,22 +1189,6 @@ impl u32x4 {
11961189
}
11971190
}
11981191

1199-
impl BitXor for u32x4 {
1200-
type Output = u32x4;
1201-
1202-
fn bitxor(self, rhs: u32x4) -> u32x4 {
1203-
self ^ rhs
1204-
}
1205-
}
1206-
1207-
impl BitAnd for u32x4 {
1208-
type Output = u32x4;
1209-
1210-
fn bitand(self, rhs: u32x4) -> u32x4 {
1211-
self & rhs
1212-
}
1213-
}
1214-
12151192
impl Not for u32x4 {
12161193
type Output = u32x4;
12171194

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// option. This file may not be copied, modified, or distributed
55
// except according to those terms.
66

7-
#![feature(simd)]
87
#![cfg_attr(test, feature(test))]
98

109
extern crate rand;

src/simd.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,12 @@
44
// option. This file may not be copied, modified, or distributed
55
// except according to those terms.
66

7-
#[cfg(not(ndebug))]
87
pub use self::fake::*;
98

10-
#[cfg(ndebug)]
11-
pub use self::real::*;
12-
139
pub trait SimdExt {
1410
fn simd_eq(self, rhs: Self) -> Self;
1511
}
1612

17-
#[cfg(not(ndebug))]
1813
impl SimdExt for fake::u32x4 {
1914
fn simd_eq(self, rhs: Self) -> Self {
2015
if self == rhs {
@@ -25,14 +20,6 @@ impl SimdExt for fake::u32x4 {
2520
}
2621
}
2722

28-
#[cfg(ndebug)]
29-
impl SimdExt for real::u32x4 {
30-
fn simd_eq(self, rhs: Self) -> Self {
31-
self == rhs
32-
}
33-
}
34-
35-
#[cfg(not(ndebug))]
3623
mod fake {
3724
use std::ops::{Add, BitAnd, BitOr, BitXor, Shl, Shr, Sub};
3825

@@ -133,9 +120,3 @@ mod fake {
133120
}
134121
}
135122

136-
#[cfg(ndebug)]
137-
mod real {
138-
pub use std::simd::u32x4;
139-
pub use std::simd::u64x2;
140-
}
141-

0 commit comments

Comments
 (0)