r188065 - Add lrint to the list of math builtins. It never sets errno so we can mark it as readnone.

Benjamin Kramer benny.kra at googlemail.com
Fri Aug 9 03:12:31 PDT 2013


Author: d0k
Date: Fri Aug  9 05:12:30 2013
New Revision: 188065

URL: http://llvm.org/viewvc/llvm-project?rev=188065&view=rev
Log:
Add lrint to the list of math builtins. It never sets errno so we can mark it as readnone.

Modified:
    cfe/trunk/include/clang/Basic/Builtins.def
    cfe/trunk/test/CodeGen/libcall-declarations.c

Modified: cfe/trunk/include/clang/Basic/Builtins.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Builtins.def?rev=188065&r1=188064&r2=188065&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Builtins.def (original)
+++ cfe/trunk/include/clang/Basic/Builtins.def Fri Aug  9 05:12:30 2013
@@ -887,6 +887,10 @@ LIBBUILTIN(log2, "dd", "fe", "math.h", A
 LIBBUILTIN(log2l, "LdLd", "fe", "math.h", ALL_LANGUAGES)
 LIBBUILTIN(log2f, "ff", "fe", "math.h", ALL_LANGUAGES)
 
+LIBBUILTIN(lrint, "Lid", "fc", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(lrintl, "LiLd", "fc", "math.h", ALL_LANGUAGES)
+LIBBUILTIN(lrintf, "Lif", "fc", "math.h", ALL_LANGUAGES)
+
 LIBBUILTIN(nearbyint, "dd", "fc", "math.h", ALL_LANGUAGES)
 LIBBUILTIN(nearbyintl, "LdLd", "fc", "math.h", ALL_LANGUAGES)
 LIBBUILTIN(nearbyintf, "ff", "fc", "math.h", ALL_LANGUAGES)

Modified: cfe/trunk/test/CodeGen/libcall-declarations.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/libcall-declarations.c?rev=188065&r1=188064&r2=188065&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/libcall-declarations.c (original)
+++ cfe/trunk/test/CodeGen/libcall-declarations.c Fri Aug  9 05:12:30 2013
@@ -50,6 +50,9 @@ float logf(float);
 double log2(double);
 long double log2l(long double);
 float log2f(float);
+long lrint(double);
+long lrintl(long double);
+long lrintf(float);
 double nearbyint(double);
 long double nearbyintl(long double);
 float nearbyintf(float);
@@ -76,15 +79,15 @@ long double truncl(long double);
 float truncf(float);
 
 // Force emission of the declare statements.
-void *use[] = {
-  acos, acosl, acosf, asin, asinl, asinf, atan, atanl, atanf, atan2, atan2l,
-  atan2f, ceil, ceill, ceilf, copysign, copysignl, copysignf, cos, cosl, cosf,
-  exp, expl, expf, exp2, exp2l, exp2f, fabs, fabsl, fabsf, floor, floorl,
-  floorf, fma, fmal, fmaf, fmax, fmaxl, fmaxf, fmin, fminl, fminf, log, logl,
-  logf, log2, log2l, log2f, nearbyint, nearbyintl, nearbyintf, pow, powl, powf,
-  rint, rintl, rintf, round, roundl, roundf, sin, sinl, sinf, sqrt, sqrtl,
-  sqrtf, tan, tanl, tanf, trunc, truncl, truncf
-};
+void *use[] = { acos, acosl, acosf, asin, asinl, asinf, atan, atanl, atanf,
+                atan2, atan2l, atan2f, ceil, ceill, ceilf, copysign, copysignl,
+                copysignf, cos, cosl, cosf, exp, expl, expf, exp2, exp2l, exp2f,
+                fabs, fabsl, fabsf, floor, floorl, floorf, fma, fmal, fmaf,
+                fmax, fmaxl, fmaxf, fmin, fminl, fminf, log, logl, logf, log2,
+                log2l, log2f, lrint, lrintl, lrintf, nearbyint, nearbyintl,
+                nearbyintf, pow, powl, powf, rint, rintl, rintf, round, roundl,
+                roundf, sin, sinl, sinf, sqrt, sqrtl, sqrtf, tan, tanl, tanf,
+                trunc, truncl, truncf };
 
 // CHECK-NOERRNO: declare double @acos(double) [[NUW:#[0-9]+]]
 // CHECK-NOERRNO: declare x86_fp80 @acosl(x86_fp80) [[NUW]]
@@ -134,6 +137,9 @@ void *use[] = {
 // CHECK-NOERRNO: declare double @log2(double) [[NUW]]
 // CHECK-NOERRNO: declare x86_fp80 @log2l(x86_fp80) [[NUW]]
 // CHECK-NOERRNO: declare float @log2f(float) [[NUW]]
+// CHECK-NOERRNO: declare {{i..}} @lrint(double) [[NUW]]
+// CHECK-NOERRNO: declare {{i..}} @lrintl(x86_fp80) [[NUW]]
+// CHECK-NOERRNO: declare {{i..}} @lrintf(float) [[NUW]]
 // CHECK-NOERRNO: declare double @nearbyint(double) [[NUW]]
 // CHECK-NOERRNO: declare x86_fp80 @nearbyintl(x86_fp80) [[NUW]]
 // CHECK-NOERRNO: declare float @nearbyintf(float) [[NUW]]
@@ -177,6 +183,9 @@ void *use[] = {
 // CHECK-ERRNO: declare double @fmin(double, double) [[NUW]]
 // CHECK-ERRNO: declare x86_fp80 @fminl(x86_fp80, x86_fp80) [[NUW]]
 // CHECK-ERRNO: declare float @fminf(float, float) [[NUW]]
+// CHECK-ERRNO: declare {{i..}} @lrint(double) [[NUW]]
+// CHECK-ERRNO: declare {{i..}} @lrintl(x86_fp80) [[NUW]]
+// CHECK-ERRNO: declare {{i..}} @lrintf(float) [[NUW]]
 // CHECK-ERRNO: declare double @nearbyint(double) [[NUW]]
 // CHECK-ERRNO: declare x86_fp80 @nearbyintl(x86_fp80) [[NUW]]
 // CHECK-ERRNO: declare float @nearbyintf(float) [[NUW]]





More information about the cfe-commits mailing list