aboutsummaryrefslogtreecommitdiff
path: root/src/stage1/softfloat.hpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-10-15 10:05:00 -0400
committerGitHub <noreply@github.com>2022-10-15 10:05:00 -0400
commitb4e3424594aecbd5a038d7c3a9e1e01c66a239ee (patch)
treee5dfde6fa751626cd9e0ba6bf36bbd0bb9789fa1 /src/stage1/softfloat.hpp
parent8bb2e96ac3b61a8aa393f250144fb9e1195ca60a (diff)
parenta168893e0097093665154c7897b7f909cec855a1 (diff)
downloadzig-b4e3424594aecbd5a038d7c3a9e1e01c66a239ee.tar.gz
zig-b4e3424594aecbd5a038d7c3a9e1e01c66a239ee.zip
Merge pull request #13100 from topolarity/powerpc64le
stage2: Fix softfloat support for PPC64(LE)
Diffstat (limited to 'src/stage1/softfloat.hpp')
-rw-r--r--src/stage1/softfloat.hpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/stage1/softfloat.hpp b/src/stage1/softfloat.hpp
index a0d270d55f..b9d886d311 100644
--- a/src/stage1/softfloat.hpp
+++ b/src/stage1/softfloat.hpp
@@ -21,6 +21,20 @@ static inline float16_t zig_double_to_f16(double x) {
return f64_to_f16(y);
}
+static inline void zig_double_to_extF80M(double x, extFloat80_t *result) {
+ float64_t y;
+ static_assert(sizeof(x) == sizeof(y), "");
+ memcpy(&y, &x, sizeof(x));
+ f64_to_extF80M(y, result);
+}
+
+static inline void zig_double_to_f128M(double x, float128_t *result) {
+ float64_t y;
+ static_assert(sizeof(x) == sizeof(y), "");
+ memcpy(&y, &x, sizeof(x));
+ f64_to_f128M(y, result);
+}
+
// Return value is safe to coerce to float even when |x| is NaN or Infinity.
static inline double zig_f16_to_double(float16_t x) {