[PATCH] D24483: Convert finite to builtin

Dehao Chen via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 12 17:52:41 PDT 2016


danielcdh added a comment.

In https://reviews.llvm.org/D24483#540597, @efriedma wrote:

> GNU_LANG is the flag you're looking for.
>
> "it will automatically expand to finite()"
>
> What exactly is your build configuration (operating system, compiler, libc version if applicable)?


I'm running on ubuntu with clang 4.0.

I found that the __finite is expanded from math.h:

define isfinite(x) \
====================

  (sizeof (x) == sizeof (float)                                            \
   ? __finitef (x)                                                         \
   : sizeof (x) == sizeof (double)                                         \
   ? __finite (x) : __finitel (x))

finite() is expanded from /usr/include/x86_64-linux-gnu/bits/mathcalls.h

/* Return nonzero if VALUE is finite and not NaN.  */
__MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__));

which is expanded to:
extern int finite (double __value) throw () __attribute__ ((__const__));

Not sure what is the right thing to do here...

Thanks,
Dehao

> Also, this is missing a test (see test/CodeGen/builtins.c).


added


https://reviews.llvm.org/D24483





More information about the llvm-commits mailing list