diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2014-04-08 18:08:08 -0400 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2014-04-22 20:47:28 -0400 |
| commit | dc7d7d2698139d9d9b0887481c4f50773daa392b (patch) | |
| tree | cd48dd32d932cb90c80c536783c4955f5883b068 /src/libstd | |
| parent | 09bfb92fdc3ccff42dfcf91b0af368f88dc3e446 (diff) | |
| download | rust-dc7d7d2698139d9d9b0887481c4f50773daa392b.tar.gz rust-dc7d7d2698139d9d9b0887481c4f50773daa392b.zip | |
add support for quadruple precision floating point
This currently requires linking against a library like libquadmath (or libgcc), because compiler-rt barely has any support for this and most hardware does not yet have 128-bit precision floating point. For this reason, it's currently hidden behind a feature gate. When compiler-rt is updated to trunk, some tests can be added for constant evaluation since there will be support for the comparison operators. Closes #13381
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/intrinsics.rs | 2 | ||||
| -rw-r--r-- | src/libstd/lib.rs | 4 | ||||
| -rw-r--r-- | src/libstd/reflect.rs | 8 | ||||
| -rw-r--r-- | src/libstd/repr.rs | 2 |
4 files changed, 15 insertions, 1 deletions
diff --git a/src/libstd/intrinsics.rs b/src/libstd/intrinsics.rs index 7f02ab28342..43b5f42163e 100644 --- a/src/libstd/intrinsics.rs +++ b/src/libstd/intrinsics.rs @@ -95,6 +95,8 @@ pub trait TyVisitor { fn visit_f32(&mut self) -> bool; fn visit_f64(&mut self) -> bool; + #[cfg(not(stage0))] + fn visit_f128(&mut self) -> bool; fn visit_char(&mut self) -> bool; diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 9325a0ad112..7cb07e8e551 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -52,11 +52,13 @@ html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_root_url = "http://static.rust-lang.org/doc/master")] #![feature(macro_rules, globs, asm, managed_boxes, thread_local, link_args, - simd, linkage, default_type_params, phase, concat_idents)] + simd, linkage, default_type_params, phase, concat_idents, quad_precision_float)] // Don't link to std. We are std. #![no_std] +// NOTE: remove after snapshot +#![allow(unknown_features)] #![deny(missing_doc)] // When testing libstd, bring in libuv as the I/O backend so tests can print diff --git a/src/libstd/reflect.rs b/src/libstd/reflect.rs index e64a6b86d02..45f214e26fb 100644 --- a/src/libstd/reflect.rs +++ b/src/libstd/reflect.rs @@ -176,6 +176,14 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> { true } + #[cfg(not(stage0))] + fn visit_f128(&mut self) -> bool { + self.align_to::<f128>(); + if ! self.inner.visit_f128() { return false; } + self.bump_past::<f128>(); + true + } + fn visit_char(&mut self) -> bool { self.align_to::<char>(); if ! self.inner.visit_char() { return false; } diff --git a/src/libstd/repr.rs b/src/libstd/repr.rs index 668edbcc42f..61154502445 100644 --- a/src/libstd/repr.rs +++ b/src/libstd/repr.rs @@ -280,6 +280,8 @@ impl<'a> TyVisitor for ReprVisitor<'a> { fn visit_f32(&mut self) -> bool { self.write::<f32>() } fn visit_f64(&mut self) -> bool { self.write::<f64>() } + #[cfg(not(stage0))] + fn visit_f128(&mut self) -> bool { fail!("not implemented") } fn visit_char(&mut self) -> bool { self.get::<char>(|this, &ch| { |
