core/stdarch/crates/core_arch/src/powerpc/
mod.rs1pub(crate) mod macros;
4
5#[lang = "ppcf128"]
8#[doc(alias = "__ibm128")]
9#[doc(alias = "doubledouble")]
10#[doc(alias = "f64f64")]
11#[unstable(feature = "powerpc_ppcf128", issue = "163323")]
12#[allow(non_camel_case_types)]
13#[doc(cfg(any(target_arch = "powerpc", target_arch = "powerpc64")))]
14#[derive(Clone, Copy)]
15pub struct ppcf128(u128);
16
17#[unstable(feature = "powerpc_ppcf128", issue = "163323")]
18impl crate::fmt::Debug for ppcf128 {
19 fn fmt(&self, f: &mut crate::fmt::Formatter<'_>) -> crate::fmt::Result {
20 let (hi, lo) = self.to_components();
21 write!(f, "ppcf128({hi:?}, {lo:?})")
22 }
23}
24
25impl ppcf128 {
26 #[unstable(feature = "powerpc_ppcf128", issue = "163323")]
29 #[inline]
30 pub const fn to_ne_bytes(self) -> [u8; 16] {
31 unsafe { crate::mem::transmute::<ppcf128, [u8; 16]>(self) }
33 }
34
35 #[unstable(feature = "powerpc_ppcf128", issue = "163323")]
37 #[rustc_const_unstable(feature = "powerpc_ppcf128", issue = "163323")]
38 #[inline]
39 pub const fn to_components(self) -> (f64, f64) {
40 let [large, small] = unsafe { crate::mem::transmute::<ppcf128, [f64; 2]>(self) };
42 (large, small)
43 }
44}
45
46mod altivec;
47#[unstable(feature = "stdarch_powerpc", issue = "111145")]
48pub use self::altivec::*;
49
50mod vsx;
51#[unstable(feature = "stdarch_powerpc", issue = "111145")]
52pub use self::vsx::*;
53
54#[cfg(test)]
55use stdarch_test::assert_instr;
56
57#[cfg_attr(test, assert_instr(trap))]
59#[inline]
60#[unstable(feature = "stdarch_powerpc", issue = "111145")]
61pub unsafe fn trap() -> ! {
62 crate::intrinsics::abort_immediate()
63}