• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * This file has no copyright assigned and is placed in the Public Domain.
3  * This file is part of the mingw-w64 runtime package.
4  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5  */
6 #define __CRT__NO_INLINE
7 #include <math.h>
8 
9 double
fabs(double x)10 fabs (double x)
11 {
12 #if defined(__x86_64__) || defined(_AMD64_) || defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_)
13   return __builtin_fabs (x);
14 #elif defined(__i386__) || defined(_X86_)
15   double res = 0.0;
16 
17   asm volatile ("fabs;" : "=t" (res) : "0" (x));
18   return res;
19 #endif /* defined(__x86_64__) || defined(_AMD64_) || defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || defined(_ARM64_) */
20 }
21