Skip to main content

core/num/imp/
x87_f80.rs

1/// The raw x87 80-bit extended-precision floating-point type.
2///
3/// This type has a size of 80 bits, and corresponds to the store size (what a load/store touches)
4/// of x87_f80. This is different to what LLVM calls the alloc size, the number of bytes used to
5/// calculate field offsets or the size of an alloca.
6///
7/// The `x87_f80` wrapper type below corresponds to the alloc size: it applies the target-specific
8/// alignment, raising the total size to 12 or 16.
9///
10/// NOTE: this type should not be used anywhere except in the x87_f80 wrapper below. The backend
11/// can handle it fine, but callconv calculation will likely panic.
12#[cfg_attr(any(target_arch = "x86", target_arch = "x86_64"), lang = "x87_f80_raw")]
13#[allow(non_camel_case_types)]
14#[derive(Clone, Copy)]
15struct x87_f80_raw {}
16
17/// The x87 80-bit extended-precision floating-point lang item.
18///
19/// Here we define just the lang item, the public-facing type is defined
20/// in core_arch. It transparently wraps this definition.
21///
22/// This x87_f80 type should only be used on x86 and x86_64 targets, but is always defined
23/// for the purpose of doc builds, specifically doc builds in the stdarch repo.
24#[doc(hidden)]
25#[cfg_attr(any(target_arch = "x86", target_arch = "x86_64"), lang = "x87_f80")]
26#[unstable(feature = "num_internals", issue = "none")]
27#[allow(non_camel_case_types, dead_code)]
28#[derive(Clone, Copy)]
29pub struct x87_f80(x87_f80_raw);
30
31#[unstable(feature = "num_internals", issue = "none")]
32impl crate::fmt::Debug for x87_f80 {
33    fn fmt(&self, f: &mut crate::fmt::Formatter<'_>) -> crate::fmt::Result {
34        f.debug_tuple("x87_f80").finish()
35    }
36}