Skip to content

Commit

Permalink
fixed _mm_set_pd and _mm_setr_pd by reversing order (rust-lang#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
pythoneer authored and alexcrichton committed Oct 16, 2017
1 parent aafe927 commit 13d2384
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/x86/sse2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1842,15 +1842,15 @@ pub unsafe fn _mm_set_pd1(a: f64) -> f64x2 {
#[inline(always)]
#[target_feature = "+sse2"]
pub unsafe fn _mm_set_pd(a: f64, b: f64) -> f64x2 {
f64x2::new(a, b)
f64x2::new(b, a)
}

/// Set packed double-precision (64-bit) floating-point elements in the return value with the
/// supplied values in reverse order.
#[inline(always)]
#[target_feature = "+sse2"]
pub unsafe fn _mm_setr_pd(a: f64, b: f64) -> f64x2 {
f64x2::new(b, a)
f64x2::new(a, b)
}

/// returns packed double-precision (64-bit) floating-point elements with all zeros.
Expand Down Expand Up @@ -3774,13 +3774,13 @@ mod tests {
#[simd_test = "sse2"]
unsafe fn _mm_set_pd() {
let r = sse2::_mm_set_pd(1.0_f64, 5.0_f64);
assert_eq!(r, f64x2::new(1.0_f64, 5.0_f64));
assert_eq!(r, f64x2::new(5.0_f64, 1.0_f64));
}

#[simd_test = "sse2"]
unsafe fn _mm_setr_pd() {
let r = sse2::_mm_setr_pd(1.0_f64, -5.0_f64);
assert_eq!(r, f64x2::new(-5.0_f64, 1.0_f64));
assert_eq!(r, f64x2::new(1.0_f64, -5.0_f64));
}

#[simd_test = "sse2"]
Expand Down

0 comments on commit 13d2384

Please sign in to comment.