summaryrefslogtreecommitdiffstats
path: root/compiler-rt
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2011-03-21 23:30:19 +0000
committerDaniel Dunbar <daniel@zuster.org>2011-03-21 23:30:19 +0000
commitf3798a397d6e8990e49173e5865e4a47fb432e0b (patch)
treed5030516ecf8396849194f138d0ded96acf9d243 /compiler-rt
parent9746286beca2539438e0a6b783e106bc359036ca (diff)
downloadbcm5719-llvm-f3798a397d6e8990e49173e5865e4a47fb432e0b.tar.gz
bcm5719-llvm-f3798a397d6e8990e49173e5865e4a47fb432e0b.zip
compiler-rt: Split subdf3 and subsf3 out of add implementations, for
consistency. llvm-svn: 128038
Diffstat (limited to 'compiler-rt')
-rw-r--r--compiler-rt/lib/adddf3.c11
-rw-r--r--compiler-rt/lib/addsf3.c21
-rw-r--r--compiler-rt/lib/subdf3.c23
-rw-r--r--compiler-rt/lib/subsf3.c23
4 files changed, 52 insertions, 26 deletions
diff --git a/compiler-rt/lib/adddf3.c b/compiler-rt/lib/adddf3.c
index c40135613dd..5338a4b4f44 100644
--- a/compiler-rt/lib/adddf3.c
+++ b/compiler-rt/lib/adddf3.c
@@ -1,4 +1,4 @@
-//===-- lib/adddf3.c - Double-precision addition and subtraction --*- C -*-===//
+//===-- lib/adddf3.c - Double-precision addition ------------------*- C -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
//
-// This file implements double-precision soft-float addition and subtraction
-// with the IEEE-754 default rounding (to nearest, ties to even).
+// This file implements double-precision soft-float addition with the IEEE-754
+// default rounding (to nearest, ties to even).
//
//===----------------------------------------------------------------------===//
@@ -147,8 +147,3 @@ fp_t __adddf3(fp_t a, fp_t b) {
if (roundGuardSticky == 0x4) result += result & 1;
return fromRep(result);
}
-
-// Subtraction; flip the sign bit of b and add.
-fp_t __subdf3(fp_t a, fp_t b) {
- return __adddf3(a, fromRep(toRep(b) ^ signBit));
-}
diff --git a/compiler-rt/lib/addsf3.c b/compiler-rt/lib/addsf3.c
index c0e8d8e70dc..061528b35eb 100644
--- a/compiler-rt/lib/addsf3.c
+++ b/compiler-rt/lib/addsf3.c
@@ -1,4 +1,4 @@
-//===-- lib/addsf3.c - Single-precision addition and subtraction --*- C -*-===//
+//===-- lib/addsf3.c - Single-precision addition ------------------*- C -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
//
-// This file implements single-precision soft-float addition and subtraction
-// with the IEEE-754 default rounding (to nearest, ties to even).
+// This file implements single-precision soft-float addition with the IEEE-754
+// default rounding (to nearest, ties to even).
//
//===----------------------------------------------------------------------===//
@@ -147,18 +147,3 @@ fp_t __addsf3(fp_t a, fp_t b) {
if (roundGuardSticky == 0x4) result += result & 1;
return fromRep(result);
}
-
-// Subtraction; flip the sign bit of b and add.
-fp_t __subsf3(fp_t a, fp_t b) {
- return __addsf3(a, fromRep(toRep(b) ^ signBit));
-}
-
-
-
-
-
-
-
-
-
-
diff --git a/compiler-rt/lib/subdf3.c b/compiler-rt/lib/subdf3.c
new file mode 100644
index 00000000000..241bf1b125a
--- /dev/null
+++ b/compiler-rt/lib/subdf3.c
@@ -0,0 +1,23 @@
+//===-- lib/adddf3.c - Double-precision subtraction ---------------*- C -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements double-precision soft-float subtraction with the
+// IEEE-754 default rounding (to nearest, ties to even).
+//
+//===----------------------------------------------------------------------===//
+
+#define DOUBLE_PRECISION
+#include "fp_lib.h"
+
+fp_t __adddf3(fp_t a, fp_t b);
+
+// Subtraction; flip the sign bit of b and add.
+fp_t __subdf3(fp_t a, fp_t b) {
+ return __adddf3(a, fromRep(toRep(b) ^ signBit));
+}
diff --git a/compiler-rt/lib/subsf3.c b/compiler-rt/lib/subsf3.c
new file mode 100644
index 00000000000..9ce14d7ac22
--- /dev/null
+++ b/compiler-rt/lib/subsf3.c
@@ -0,0 +1,23 @@
+//===-- lib/subsf3.c - Single-precision subtraction ---------------*- C -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements single-precision soft-float subtraction with the
+// IEEE-754 default rounding (to nearest, ties to even).
+//
+//===----------------------------------------------------------------------===//
+
+#define SINGLE_PRECISION
+#include "fp_lib.h"
+
+fp_t __addsf3(fp_t a, fp_t b);
+
+// Subtraction; flip the sign bit of b and add.
+fp_t __subsf3(fp_t a, fp_t b) {
+ return __addsf3(a, fromRep(toRep(b) ^ signBit));
+}
OpenPOWER on IntegriCloud