[llvm-commits] [compiler-rt] r107554 - in /compiler-rt/trunk/lib: floatunsidf.c floatunsisf.c floatunssidf.c floatunssisf.c negdf2.c negsf2.c

Stephen Canon scanon at apple.com
Fri Jul 2 17:56:04 PDT 2010


Author: scanon
Date: Fri Jul  2 19:56:03 2010
New Revision: 107554

URL: http://llvm.org/viewvc/llvm-project?rev=107554&view=rev
Log:
Renamed unsigned->float routines to match GCC convention

Added:
    compiler-rt/trunk/lib/floatunsidf.c
      - copied, changed from r107535, compiler-rt/trunk/lib/floatunssidf.c
    compiler-rt/trunk/lib/floatunsisf.c
      - copied, changed from r107535, compiler-rt/trunk/lib/floatunssisf.c
Removed:
    compiler-rt/trunk/lib/floatunssidf.c
    compiler-rt/trunk/lib/floatunssisf.c
Modified:
    compiler-rt/trunk/lib/negdf2.c
    compiler-rt/trunk/lib/negsf2.c

Copied: compiler-rt/trunk/lib/floatunsidf.c (from r107535, compiler-rt/trunk/lib/floatunssidf.c)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/floatunsidf.c?p2=compiler-rt/trunk/lib/floatunsidf.c&p1=compiler-rt/trunk/lib/floatunssidf.c&r1=107535&r2=107554&rev=107554&view=diff
==============================================================================
--- compiler-rt/trunk/lib/floatunssidf.c (original)
+++ compiler-rt/trunk/lib/floatunsidf.c Fri Jul  2 19:56:03 2010
@@ -1,4 +1,4 @@
-//===-- lib/floatunssidf.c - uint -> double-precision conversion --*- C -*-===//
+//===-- lib/floatunsidf.c - uint -> double-precision conversion ---*- C -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -16,7 +16,7 @@
 #define DOUBLE_PRECISION
 #include "fp_lib.h"
 
-fp_t __floatunssidf(unsigned int a) {
+fp_t __floatunsidf(unsigned int a) {
     
     const int aWidth = sizeof a * CHAR_BIT;
     

Copied: compiler-rt/trunk/lib/floatunsisf.c (from r107535, compiler-rt/trunk/lib/floatunssisf.c)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/floatunsisf.c?p2=compiler-rt/trunk/lib/floatunsisf.c&p1=compiler-rt/trunk/lib/floatunssisf.c&r1=107535&r2=107554&rev=107554&view=diff
==============================================================================
--- compiler-rt/trunk/lib/floatunssisf.c (original)
+++ compiler-rt/trunk/lib/floatunsisf.c Fri Jul  2 19:56:03 2010
@@ -1,4 +1,4 @@
-//===-- lib/floatunssisf.c - uint -> single-precision conversion --*- C -*-===//
+//===-- lib/floatunsisf.c - uint -> single-precision conversion ---*- C -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -16,7 +16,7 @@
 #define SINGLE_PRECISION
 #include "fp_lib.h"
 
-fp_t __floatunssisf(unsigned int a) {
+fp_t __floatunsisf(unsigned int a) {
     
     const int aWidth = sizeof a * CHAR_BIT;
     

Removed: compiler-rt/trunk/lib/floatunssidf.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/floatunssidf.c?rev=107553&view=auto
==============================================================================
--- compiler-rt/trunk/lib/floatunssidf.c (original)
+++ compiler-rt/trunk/lib/floatunssidf.c (removed)
@@ -1,45 +0,0 @@
-//===-- lib/floatunssidf.c - uint -> double-precision conversion --*- C -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements unsigned integer to double-precision conversion for the
-// compiler-rt library in the IEEE-754 default round-to-nearest, ties-to-even
-// mode.
-//
-//===----------------------------------------------------------------------===//
-
-#define DOUBLE_PRECISION
-#include "fp_lib.h"
-
-fp_t __floatunssidf(unsigned int a) {
-    
-    const int aWidth = sizeof a * CHAR_BIT;
-    
-    // Handle zero as a special case to protect clz
-    if (a == 0) return fromRep(0);
-    
-    // Exponent of (fp_t)a is the width of abs(a).
-    const int exponent = (aWidth - 1) - __builtin_clz(a);
-    rep_t result;
-    
-    // Shift a into the significand field, rounding if it is a right-shift
-    if (exponent <= significandBits) {
-        const int shift = significandBits - exponent;
-        result = (rep_t)a << shift ^ implicitBit;
-    } else {
-        const int shift = exponent - significandBits;
-        result = (rep_t)a >> shift ^ implicitBit;
-        rep_t round = (rep_t)a << (typeWidth - shift);
-        if (round > signBit) result++;
-        if (round == signBit) result += result & 1;
-    }
-    
-    // Insert the exponent
-    result += (rep_t)(exponent + exponentBias) << significandBits;
-    return fromRep(result);
-}

Removed: compiler-rt/trunk/lib/floatunssisf.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/floatunssisf.c?rev=107553&view=auto
==============================================================================
--- compiler-rt/trunk/lib/floatunssisf.c (original)
+++ compiler-rt/trunk/lib/floatunssisf.c (removed)
@@ -1,45 +0,0 @@
-//===-- lib/floatunssisf.c - uint -> single-precision conversion --*- C -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements unsigned integer to single-precision conversion for the
-// compiler-rt library in the IEEE-754 default round-to-nearest, ties-to-even
-// mode.
-//
-//===----------------------------------------------------------------------===//
-
-#define SINGLE_PRECISION
-#include "fp_lib.h"
-
-fp_t __floatunssisf(unsigned int a) {
-    
-    const int aWidth = sizeof a * CHAR_BIT;
-    
-    // Handle zero as a special case to protect clz
-    if (a == 0) return fromRep(0);
-    
-    // Exponent of (fp_t)a is the width of abs(a).
-    const int exponent = (aWidth - 1) - __builtin_clz(a);
-    rep_t result;
-    
-    // Shift a into the significand field, rounding if it is a right-shift
-    if (exponent <= significandBits) {
-        const int shift = significandBits - exponent;
-        result = (rep_t)a << shift ^ implicitBit;
-    } else {
-        const int shift = exponent - significandBits;
-        result = (rep_t)a >> shift ^ implicitBit;
-        rep_t round = (rep_t)a << (typeWidth - shift);
-        if (round > signBit) result++;
-        if (round == signBit) result += result & 1;
-    }
-    
-    // Insert the exponent
-    result += (rep_t)(exponent + exponentBias) << significandBits;
-    return fromRep(result);
-}

Modified: compiler-rt/trunk/lib/negdf2.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/negdf2.c?rev=107554&r1=107553&r2=107554&view=diff
==============================================================================
--- compiler-rt/trunk/lib/negdf2.c (original)
+++ compiler-rt/trunk/lib/negdf2.c Fri Jul  2 19:56:03 2010
@@ -1,4 +1,4 @@
-//===-- lib/negdf3.c - double-precision negation ------------------*- C -*-===//
+//===-- lib/negdf2.c - double-precision negation ------------------*- C -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //

Modified: compiler-rt/trunk/lib/negsf2.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/negsf2.c?rev=107554&r1=107553&r2=107554&view=diff
==============================================================================
--- compiler-rt/trunk/lib/negsf2.c (original)
+++ compiler-rt/trunk/lib/negsf2.c Fri Jul  2 19:56:03 2010
@@ -1,4 +1,4 @@
-//===-- lib/negsf3.c - single-precision negation ------------------*- C -*-===//
+//===-- lib/negsf2.c - single-precision negation ------------------*- C -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //





More information about the llvm-commits mailing list