This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: generic fabs implementation


> Szabolcs Nagy wrote:
>
> (looks good to me and same should be done for fabs)

Yes - and that is yet another example of unnecessary target code...

Given GLIBC can now rely on a modern GCC for its build, can we avoid
this and actually use the builtins rather than having each target
override the generic implementation with an inline assembler version?

double
 __fabs (double x)
 {
-  u_int32_t high;
-  GET_HIGH_WORD (high, x);
-  SET_HIGH_WORD (x, high & 0x7fffffff);
-  return x;
+  return __builtin_fabs (x);
 }

GCC will always inline __builtin_fabs, with -O0, -Os and -fno-builtin.

Wilco




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]