Skip to content

Commit a1f3c97

Browse files
p32blognzlbg
authored andcommitted
Add documentation for testz, testc and testnzc
1 parent 3655a4d commit a1f3c97

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

src/x86/sse41.rs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,20 +411,57 @@ pub unsafe fn _mm_mullo_epi32 (a: i32x4, b:i32x4) -> i32x4 {
411411
a * b
412412
}
413413

414+
/// Tests whether the specified bits in a 128-bit integer vector are all
415+
/// zeros.
416+
///
417+
/// Arguments:
418+
///
419+
/// * `a` - A 128-bit integer vector containing the bits to be tested.
420+
/// * `mask` - A 128-bit integer vector selecting which bits to test in operand `a`.
421+
///
422+
/// Returns:
423+
///
424+
/// * `1` - if the specified bits are all zeros,
425+
/// * `0` - otherwise.
414426
#[inline(always)]
415427
#[target_feature = "+sse4.1"]
416428
#[cfg_attr(test, assert_instr(ptest))]
417429
pub unsafe fn _mm_testz_si128(a: i64x2, mask: i64x2) -> i32 {
418430
ptestz(a, mask)
419431
}
420432

433+
434+
/// Tests whether the specified bits in a 128-bit integer vector are all
435+
/// ones.
436+
///
437+
/// Arguments:
438+
///
439+
/// * `a` - A 128-bit integer vector containing the bits to be tested.
440+
/// * `mask` - A 128-bit integer vector selecting which bits to test in operand `a`.
441+
///
442+
/// Returns:
443+
///
444+
/// * `1` - if the specified bits are all ones,
445+
/// * `0` - otherwise.
421446
#[inline(always)]
422447
#[target_feature = "+sse4.1"]
423448
#[cfg_attr(test, assert_instr(ptest))]
424449
pub unsafe fn _mm_testc_si128(a: i64x2, mask: i64x2) -> i32 {
425450
ptestc(a, mask)
426451
}
427452

453+
/// Tests whether the specified bits in a 128-bit integer vector are
454+
/// neither all zeros nor all ones.
455+
///
456+
/// Arguments:
457+
///
458+
/// * `a` - A 128-bit integer vector containing the bits to be tested.
459+
/// * `mask` - A 128-bit integer vector selecting which bits to test in operand `a`.
460+
///
461+
/// Returns:
462+
///
463+
/// * `1` - if the specified bits are neither all zeros nor all ones,
464+
/// * `0` - otherwise.
428465
#[inline(always)]
429466
#[target_feature = "+sse4.1"]
430467
#[cfg_attr(test, assert_instr(ptest))]

0 commit comments

Comments
 (0)