Skip to content

Commit 1cb4b0a

Browse files
lu-zeroAmanieu
authored andcommitted
Add vec_any_nan, vec_any_nge, vec_any_ngt, vec_any_nle, vec_any_nlt and vec_any_numeric
1 parent 22915e2 commit 1cb4b0a

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

crates/core_arch/src/powerpc/altivec.rs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2329,6 +2329,14 @@ pub unsafe fn vec_all_nan(a: vector_float) -> bool {
23292329
vcmpeqfp_p(0, a, a) != 0
23302330
}
23312331

2332+
/// Any Elements Not a Number
2333+
#[inline]
2334+
#[target_feature(enable = "altivec")]
2335+
#[cfg_attr(test, assert_instr("vcmpeqfp."))]
2336+
pub unsafe fn vec_any_nan(a: vector_float) -> bool {
2337+
vcmpeqfp_p(3, a, a) != 0
2338+
}
2339+
23322340
/// Vector All Elements Not Equal
23332341
#[inline]
23342342
#[target_feature(enable = "altivec")]
@@ -2389,6 +2397,46 @@ pub unsafe fn vec_all_numeric(a: vector_float) -> bool {
23892397
vcmpgefp_p(2, a, a) != 0
23902398
}
23912399

2400+
/// Any Elements Not Greater Than or Equal
2401+
#[inline]
2402+
#[target_feature(enable = "altivec")]
2403+
#[cfg_attr(test, assert_instr("vcmpgefp."))]
2404+
pub unsafe fn vec_any_nge(a: vector_float, b: vector_float) -> bool {
2405+
vcmpgefp_p(3, a, b) != 0
2406+
}
2407+
2408+
/// Any Elements Not Greater Than
2409+
#[inline]
2410+
#[target_feature(enable = "altivec")]
2411+
#[cfg_attr(test, assert_instr("vcmpgtfp."))]
2412+
pub unsafe fn vec_any_ngt(a: vector_float, b: vector_float) -> bool {
2413+
vcmpgtfp_p(3, a, b) != 0
2414+
}
2415+
2416+
/// Any Elements Not Less Than or Equal
2417+
#[inline]
2418+
#[target_feature(enable = "altivec")]
2419+
#[cfg_attr(test, assert_instr("vcmpgefp."))]
2420+
pub unsafe fn vec_any_nle(a: vector_float, b: vector_float) -> bool {
2421+
vcmpgefp_p(3, b, a) != 0
2422+
}
2423+
2424+
/// Any Elements Not Less Than
2425+
#[inline]
2426+
#[target_feature(enable = "altivec")]
2427+
#[cfg_attr(test, assert_instr("vcmpgtfp."))]
2428+
pub unsafe fn vec_any_nlt(a: vector_float, b: vector_float) -> bool {
2429+
vcmpgtfp_p(3, b, a) != 0
2430+
}
2431+
2432+
/// Any Elements Numeric
2433+
#[inline]
2434+
#[target_feature(enable = "altivec")]
2435+
#[cfg_attr(test, assert_instr("vcmpgefp."))]
2436+
pub unsafe fn vec_any_numeric(a: vector_float) -> bool {
2437+
vcmpgefp_p(1, a, a) != 0
2438+
}
2439+
23922440
#[cfg(target_endian = "big")]
23932441
mod endian {
23942442
use super::*;

0 commit comments

Comments
 (0)