mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 20:46:07 +03:00
Match clang's code unsigned implementation for consistency
This commit is contained in:
committed by
Andrew Gallant
parent
6a081164bb
commit
d23da170d5
@@ -1379,8 +1379,8 @@ pub unsafe fn _mm_sub_pd(a: f64x2, b: f64x2) -> f64x2 {
|
|||||||
#[target_feature = "+sse2"]
|
#[target_feature = "+sse2"]
|
||||||
#[cfg_attr(test, assert_instr(andps))]
|
#[cfg_attr(test, assert_instr(andps))]
|
||||||
pub unsafe fn _mm_and_pd(a: f64x2, b: f64x2) -> f64x2 {
|
pub unsafe fn _mm_and_pd(a: f64x2, b: f64x2) -> f64x2 {
|
||||||
let a: i64x2 = mem::transmute(a);
|
let a: u64x2 = mem::transmute(a);
|
||||||
let b: i64x2 = mem::transmute(b);
|
let b: u64x2 = mem::transmute(b);
|
||||||
mem::transmute(a & b)
|
mem::transmute(a & b)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1389,8 +1389,8 @@ pub unsafe fn _mm_and_pd(a: f64x2, b: f64x2) -> f64x2 {
|
|||||||
#[target_feature = "+sse2"]
|
#[target_feature = "+sse2"]
|
||||||
#[cfg_attr(test, assert_instr(andnps))]
|
#[cfg_attr(test, assert_instr(andnps))]
|
||||||
pub unsafe fn _mm_andnot_pd(a: f64x2, b: f64x2) -> f64x2 {
|
pub unsafe fn _mm_andnot_pd(a: f64x2, b: f64x2) -> f64x2 {
|
||||||
let a: i64x2 = mem::transmute(a);
|
let a: u64x2 = mem::transmute(a);
|
||||||
let b: i64x2 = mem::transmute(b);
|
let b: u64x2 = mem::transmute(b);
|
||||||
mem::transmute((!a) & b)
|
mem::transmute((!a) & b)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1399,8 +1399,8 @@ pub unsafe fn _mm_andnot_pd(a: f64x2, b: f64x2) -> f64x2 {
|
|||||||
#[target_feature = "+sse2"]
|
#[target_feature = "+sse2"]
|
||||||
#[cfg_attr(test, assert_instr(orps))]
|
#[cfg_attr(test, assert_instr(orps))]
|
||||||
pub unsafe fn _mm_or_pd(a: f64x2, b: f64x2) -> f64x2 {
|
pub unsafe fn _mm_or_pd(a: f64x2, b: f64x2) -> f64x2 {
|
||||||
let a: i64x2 = mem::transmute(a);
|
let a: u64x2 = mem::transmute(a);
|
||||||
let b: i64x2 = mem::transmute(b);
|
let b: u64x2 = mem::transmute(b);
|
||||||
mem::transmute(a | b)
|
mem::transmute(a | b)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1409,8 +1409,8 @@ pub unsafe fn _mm_or_pd(a: f64x2, b: f64x2) -> f64x2 {
|
|||||||
#[target_feature = "+sse2"]
|
#[target_feature = "+sse2"]
|
||||||
#[cfg_attr(test, assert_instr(xorps))]
|
#[cfg_attr(test, assert_instr(xorps))]
|
||||||
pub unsafe fn _mm_xor_pd(a: f64x2, b: f64x2) -> f64x2 {
|
pub unsafe fn _mm_xor_pd(a: f64x2, b: f64x2) -> f64x2 {
|
||||||
let a: i64x2 = mem::transmute(a);
|
let a: u64x2 = mem::transmute(a);
|
||||||
let b: i64x2 = mem::transmute(b);
|
let b: u64x2 = mem::transmute(b);
|
||||||
mem::transmute(a ^ b)
|
mem::transmute(a ^ b)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3052,10 +3052,10 @@ unsafe fn _mm_sub_pd() {
|
|||||||
unsafe fn _mm_and_pd() {
|
unsafe fn _mm_and_pd() {
|
||||||
use std::mem::transmute;
|
use std::mem::transmute;
|
||||||
|
|
||||||
let a: f64x2 = transmute(i64x2::splat(5));
|
let a: f64x2 = transmute(u64x2::splat(5));
|
||||||
let b: f64x2 = transmute(i64x2::splat(3));
|
let b: f64x2 = transmute(u64x2::splat(3));
|
||||||
let r = sse2::_mm_and_pd(a, b);
|
let r = sse2::_mm_and_pd(a, b);
|
||||||
let e: f64x2 = transmute(i64x2::splat(1));
|
let e: f64x2 = transmute(u64x2::splat(1));
|
||||||
assert_eq!(r, e);
|
assert_eq!(r, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3063,10 +3063,10 @@ unsafe fn _mm_and_pd() {
|
|||||||
unsafe fn _mm_andnot_pd() {
|
unsafe fn _mm_andnot_pd() {
|
||||||
use std::mem::transmute;
|
use std::mem::transmute;
|
||||||
|
|
||||||
let a: f64x2 = transmute(i64x2::splat(5));
|
let a: f64x2 = transmute(u64x2::splat(5));
|
||||||
let b: f64x2 = transmute(i64x2::splat(3));
|
let b: f64x2 = transmute(u64x2::splat(3));
|
||||||
let r = sse2::_mm_andnot_pd(a, b);
|
let r = sse2::_mm_andnot_pd(a, b);
|
||||||
let e: f64x2 = transmute(i64x2::splat(2));
|
let e: f64x2 = transmute(u64x2::splat(2));
|
||||||
assert_eq!(r, e);
|
assert_eq!(r, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3074,10 +3074,10 @@ unsafe fn _mm_andnot_pd() {
|
|||||||
unsafe fn _mm_or_pd() {
|
unsafe fn _mm_or_pd() {
|
||||||
use std::mem::transmute;
|
use std::mem::transmute;
|
||||||
|
|
||||||
let a: f64x2 = transmute(i64x2::splat(5));
|
let a: f64x2 = transmute(u64x2::splat(5));
|
||||||
let b: f64x2 = transmute(i64x2::splat(3));
|
let b: f64x2 = transmute(u64x2::splat(3));
|
||||||
let r = sse2::_mm_or_pd(a, b);
|
let r = sse2::_mm_or_pd(a, b);
|
||||||
let e: f64x2 = transmute(i64x2::splat(7));
|
let e: f64x2 = transmute(u64x2::splat(7));
|
||||||
assert_eq!(r, e);
|
assert_eq!(r, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3085,10 +3085,10 @@ unsafe fn _mm_or_pd() {
|
|||||||
unsafe fn _mm_xor_pd() {
|
unsafe fn _mm_xor_pd() {
|
||||||
use std::mem::transmute;
|
use std::mem::transmute;
|
||||||
|
|
||||||
let a: f64x2 = transmute(i64x2::splat(5));
|
let a: f64x2 = transmute(u64x2::splat(5));
|
||||||
let b: f64x2 = transmute(i64x2::splat(3));
|
let b: f64x2 = transmute(u64x2::splat(3));
|
||||||
let r = sse2::_mm_xor_pd(a, b);
|
let r = sse2::_mm_xor_pd(a, b);
|
||||||
let e: f64x2 = transmute(i64x2::splat(6));
|
let e: f64x2 = transmute(u64x2::splat(6));
|
||||||
assert_eq!(r, e);
|
assert_eq!(r, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user