Skip to content

Commit 4ba0256

Browse files
committed
mmx requires i686
1 parent 1eae935 commit 4ba0256

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

coresimd/src/x86/i586/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
pub use self::cpuid::*;
44
pub use self::xsave::*;
55

6-
pub use self::mmx::*;
76
pub use self::sse::*;
87
pub use self::sse2::*;
98
pub use self::sse3::*;
@@ -23,7 +22,6 @@ pub use self::tbm::*;
2322
mod cpuid;
2423
mod xsave;
2524

26-
mod mmx;
2725
mod sse;
2826
mod sse2;
2927
mod sse3;

coresimd/src/x86/i586/mmx.rs renamed to coresimd/src/x86/i686/mmx.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ use stdsimd_test::assert_instr;
1818
/// Constructs a 64-bit integer vector initialized to zero.
1919
#[inline(always)]
2020
#[target_feature = "+mmx,+sse"]
21-
#[cfg_attr(all(test, target_arch = "x86"), assert_instr(xorps))]
21+
// FIXME: this produces a movl instead of xorps on x86
22+
// FIXME: this produces a xor intrinsic instead of xorps on x86_64
2223
#[cfg_attr(all(test, target_arch = "x86_64"), assert_instr(xor))]
2324
pub unsafe fn _mm_setzero_si64() -> __m64 {
2425
mem::transmute(0_i64)
@@ -59,7 +60,7 @@ extern "C" {
5960
#[cfg(test)]
6061
mod tests {
6162
use v64::{i16x4, i32x2, i8x8};
62-
use x86::i586::mmx;
63+
use x86::i686::mmx;
6364
use x86::__m64;
6465
use stdsimd_test::simd_test;
6566

coresimd/src/x86/i686/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
//! `i686` intrinsics
22
3+
mod mmx;
4+
pub use self::mmx::*;
5+
36
mod sse;
47
pub use self::sse::*;
58

coresimd/src/x86/i686/sse.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ use v128::f32x4;
44
use v64::{i16x4, i32x2, i8x8, u8x8};
55
use x86::__m64;
66
use core::mem;
7+
use x86::i586;
8+
use x86::i686::mmx;
79

810
#[cfg(test)]
911
use stdsimd_test::assert_instr;
@@ -139,9 +141,9 @@ pub unsafe fn _mm_cvt_ps2pi(a: f32x4) -> i32x2 {
139141
#[cfg_attr(test, assert_instr(cvtps2pi))]
140142
pub unsafe fn _mm_cvtps_pi16(a: f32x4) -> i16x4 {
141143
let b = _mm_cvtps_pi32(a);
142-
let a = ::x86::_mm_movehl_ps(a, a);
144+
let a = i586::_mm_movehl_ps(a, a);
143145
let c = _mm_cvtps_pi32(a);
144-
::x86::_mm_packs_pi32(b, c)
146+
mmx::_mm_packs_pi32(b, c)
145147
}
146148

147149
/// Convert packed single-precision (32-bit) floating-point elements in `a` to
@@ -152,8 +154,8 @@ pub unsafe fn _mm_cvtps_pi16(a: f32x4) -> i16x4 {
152154
#[cfg_attr(test, assert_instr(cvtps2pi))]
153155
pub unsafe fn _mm_cvtps_pi8(a: f32x4) -> i8x8 {
154156
let b = _mm_cvtps_pi16(a);
155-
let c = ::x86::_mm_setzero_si64();
156-
::x86::_mm_packs_pi16(b, mem::transmute(c))
157+
let c = mmx::_mm_setzero_si64();
158+
mmx::_mm_packs_pi16(b, mem::transmute(c))
157159
}
158160

159161
#[cfg(test)]

0 commit comments

Comments
 (0)