Skip to content

Commit a3b8ce6

Browse files
Daniel SmithAmanieu
authored andcommitted
Fix stdarch-verify test
1 parent d9f539c commit a3b8ce6

File tree

2 files changed

+28
-15
lines changed

2 files changed

+28
-15
lines changed

crates/core_arch/src/x86/avx512f.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,4 @@ mod tests {
207207
);
208208
assert_eq_m512i(r, e);
209209
}
210-
211-
#[simd_test(enable = "avx512f")]
212-
unsafe fn test_mm512_cmplt_epu64_mask() {
213-
let a = _mm512_set_epi64(0, 1, -1, u64::MAX as i64, i64::MAX, i64::MIN, 100, -100);
214-
let b = _mm512_set1_epi64(-1);
215-
let m = _mm512_cmplt_epu64_mask(a, b);
216-
assert_eq!(m, 0b11001111);
217-
}
218210
}

crates/core_arch/src/x86_64/avx512f.rs

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,27 @@ pub unsafe fn _mm512_set_epi64(
1818
e1: i64,
1919
e0: i64,
2020
) -> __m512i {
21-
let r = i64x8(e0, e1, e2, e3, e4, e5, e6, e7);
22-
transmute(r)
21+
_mm512_setr_epi64(e7, e6, e5, e4, e3, e2, e1, e0);
2322
}
2423

25-
/// Compare packed unsigned 64-bit integers in a and b for less-than, and store the results in a mask vector.
24+
/// Sets packed 64-bit integers in `dst` with the supplied values in
25+
/// reverse order.
2626
///
27-
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=727,1063,4909,1062,1062&text=_mm512_cmplt_epu64)
27+
/// [Intel's documentation]( https://software.intel.com/sites/landingpage/IntrinsicsGuide/#expand=727,1063,4909,1062,1062,4909&text=_mm512_set_epi64)
2828
#[inline]
2929
#[target_feature(enable = "avx512f")]
30-
#[cfg_attr(test, assert_instr(vpcmpuq))]
31-
pub unsafe fn _mm512_cmplt_epu64_mask(a: __m512i, b: __m512i) -> __mmask8 {
32-
simd_bitmask::<__m512i, _>(simd_lt(a.as_u64x8(), b.as_u64x8()))
30+
pub unsafe fn _mm512_setr_epi64(
31+
e7: i64,
32+
e6: i64,
33+
e5: i64,
34+
e4: i64,
35+
e3: i64,
36+
e2: i64,
37+
e1: i64,
38+
e0: i64,
39+
) -> __m512i {
40+
let r = i64x8(e0, e1, e2, e3, e4, e5, e6, e7);
41+
transmute(r)
3342
}
3443

3544
#[cfg(test)]
@@ -47,4 +56,16 @@ mod tests {
4756
let m = _mm512_cmplt_epu64_mask(a, b);
4857
assert_eq!(m, 0b11001111);
4958
}
59+
60+
#[simd_test(enable = "avx512f")]
61+
unsafe fn test_mm512_set_epi64() {
62+
let r = _mm512_setr_epi64(0, 1, 2, 3, 4, 5, 6, 7);
63+
assert_eq_m512i(r, _mm512_set_epi64(7, 6, 5, 4, 3, 2, 1, 0))
64+
}
65+
66+
#[simd_test(enable = "avx512f")]
67+
unsafe fn test_mm512_setr_epi64() {
68+
let r = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7);
69+
assert_eq_m512i(r, _mm512_setr_epi64(7, 6, 5, 4, 3, 2, 1, 0))
70+
}
5071
}

0 commit comments

Comments
 (0)