[llvm-commits] [compiler-rt] r128038 - in /compiler-rt/trunk/lib: adddf3.c addsf3.c subdf3.c subsf3.c

Daniel Dunbar daniel at zuster.org
Mon Mar 21 16:30:19 PDT 2011


Author: ddunbar
Date: Mon Mar 21 18:30:19 2011
New Revision: 128038

URL: http://llvm.org/viewvc/llvm-project?rev=128038&view=rev
Log:
compiler-rt: Split subdf3 and subsf3 out of add implementations, for
consistency.

Added:
    compiler-rt/trunk/lib/subdf3.c
    compiler-rt/trunk/lib/subsf3.c
Modified:
    compiler-rt/trunk/lib/adddf3.c
    compiler-rt/trunk/lib/addsf3.c

Modified: compiler-rt/trunk/lib/adddf3.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/adddf3.c?rev=128038&r1=128037&r2=128038&view=diff
==============================================================================
--- compiler-rt/trunk/lib/adddf3.c (original)
+++ compiler-rt/trunk/lib/adddf3.c Mon Mar 21 18:30:19 2011
@@ -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 @@
     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));
-}

Modified: compiler-rt/trunk/lib/addsf3.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/addsf3.c?rev=128038&r1=128037&r2=128038&view=diff
==============================================================================
--- compiler-rt/trunk/lib/addsf3.c (original)
+++ compiler-rt/trunk/lib/addsf3.c Mon Mar 21 18:30:19 2011
@@ -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 @@
     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));
-}
-
-
-
-
-
-
-
-
-
-

Added: compiler-rt/trunk/lib/subdf3.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/subdf3.c?rev=128038&view=auto
==============================================================================
--- compiler-rt/trunk/lib/subdf3.c (added)
+++ compiler-rt/trunk/lib/subdf3.c Mon Mar 21 18:30:19 2011
@@ -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));
+}

Added: compiler-rt/trunk/lib/subsf3.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/subsf3.c?rev=128038&view=auto
==============================================================================
--- compiler-rt/trunk/lib/subsf3.c (added)
+++ compiler-rt/trunk/lib/subsf3.c Mon Mar 21 18:30:19 2011
@@ -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));
+}





More information about the llvm-commits mailing list