[libc][NFC] Move generic math implementations to the generic directory.

This expands the pattern suggest in https://reviews.llvm.org/D95850 to all
math functions.

GitOrigin-RevId: bbb7555403855f5c2a61d62ae59f1e970ea37ec1
diff --git a/src/math/CMakeLists.txt b/src/math/CMakeLists.txt
index ac4ee31..8febb4a 100644
--- a/src/math/CMakeLists.txt
+++ b/src/math/CMakeLists.txt
@@ -36,958 +36,109 @@
 add_math_entrypoint_object(ceilf)
 add_math_entrypoint_object(ceill)
 
-add_object_library(
-  math_utils
-  SRCS
-    math_utils.cpp
-  HDRS
-    math_utils.h
-  DEPENDS
-    libc.include.errno
-    libc.include.math
-    libc.src.errno.__errno_location
-)
+add_math_entrypoint_object(copysign)
+add_math_entrypoint_object(copysignf)
+add_math_entrypoint_object(copysignl)
 
-add_object_library(
-  sincosf_utils
-  HDRS
-    sincosf_utils.h
-  SRCS
-    sincosf_data.cpp
-  DEPENDS
-    .math_utils
-)
+add_math_entrypoint_object(cosf)
 
-add_entrypoint_object(
-  cosf
-  SRCS
-    cosf.cpp
-  HDRS
-    cosf.h
-  DEPENDS
-    .sincosf_utils
-    libc.include.math
-    libc.src.errno.__errno_location
-)
+add_math_entrypoint_object(expf)
 
-add_entrypoint_object(
-  sinf
-  SRCS
-    sinf.cpp
-  HDRS
-    sinf.h
-  DEPENDS
-    .sincosf_utils
-    libc.include.math
-    libc.src.errno.__errno_location
-)
+add_math_entrypoint_object(exp2f)
 
-add_entrypoint_object(
-  sincosf
-  SRCS
-    sincosf.cpp
-  HDRS
-    sincosf.h
-  DEPENDS
-    .sincosf_utils
-    libc.include.math
-    libc.src.errno.__errno_location
-)
+add_math_entrypoint_object(fabs)
+add_math_entrypoint_object(fabsf)
+add_math_entrypoint_object(fabsl)
 
-add_entrypoint_object(
-  fabs
-  SRCS
-    fabs.cpp
-  HDRS
-    fabs.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(fdim)
+add_math_entrypoint_object(fdimf)
+add_math_entrypoint_object(fdiml)
 
-add_entrypoint_object(
-  fabsf
-  SRCS
-    fabsf.cpp
-  HDRS
-    fabsf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(floor)
+add_math_entrypoint_object(floorf)
+add_math_entrypoint_object(floorl)
 
-add_entrypoint_object(
-  fabsl
-  SRCS
-    fabsl.cpp
-  HDRS
-    fabsl.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(fmaf)
 
-add_entrypoint_object(
-  trunc
-  SRCS
-    trunc.cpp
-  HDRS
-    trunc.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(fmax)
+add_math_entrypoint_object(fmaxf)
+add_math_entrypoint_object(fmaxl)
 
-add_entrypoint_object(
-  truncf
-  SRCS
-    truncf.cpp
-  HDRS
-    truncf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(fmin)
+add_math_entrypoint_object(fminf)
+add_math_entrypoint_object(fminl)
 
-add_entrypoint_object(
-  truncl
-  SRCS
-    truncl.cpp
-  HDRS
-    truncl.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(frexp)
+add_math_entrypoint_object(frexpf)
+add_math_entrypoint_object(frexpl)
 
-add_entrypoint_object(
-  floor
-  SRCS
-    floor.cpp
-  HDRS
-    floor.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(hypot)
+add_math_entrypoint_object(hypotf)
 
-add_entrypoint_object(
-  floorf
-  SRCS
-    floorf.cpp
-  HDRS
-    floorf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(ilogb)
+add_math_entrypoint_object(ilogbf)
+add_math_entrypoint_object(ilogbl)
 
-add_entrypoint_object(
-  floorl
-  SRCS
-    floorl.cpp
-  HDRS
-    floorl.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(ldexp)
+add_math_entrypoint_object(ldexpf)
+add_math_entrypoint_object(ldexpl)
 
-add_entrypoint_object(
-  round
-  SRCS
-    round.cpp
-  HDRS
-    round.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(logb)
+add_math_entrypoint_object(logbf)
+add_math_entrypoint_object(logbl)
 
-add_entrypoint_object(
-  roundf
-  SRCS
-    roundf.cpp
-  HDRS
-    roundf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(llrint)
+add_math_entrypoint_object(llrintf)
+add_math_entrypoint_object(llrintl)
 
-add_entrypoint_object(
-  roundl
-  SRCS
-    roundl.cpp
-  HDRS
-    roundl.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(llround)
+add_math_entrypoint_object(llroundf)
+add_math_entrypoint_object(llroundl)
 
-add_entrypoint_object(
-  lround
-  SRCS
-    lround.cpp
-  HDRS
-    lround.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(lrint)
+add_math_entrypoint_object(lrintf)
+add_math_entrypoint_object(lrintl)
 
-add_entrypoint_object(
-  lroundf
-  SRCS
-    lroundf.cpp
-  HDRS
-    lroundf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(lround)
+add_math_entrypoint_object(lroundf)
+add_math_entrypoint_object(lroundl)
 
-add_entrypoint_object(
-  lroundl
-  SRCS
-    lroundl.cpp
-  HDRS
-    lroundl.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(modf)
+add_math_entrypoint_object(modff)
+add_math_entrypoint_object(modfl)
 
-add_entrypoint_object(
-  llround
-  SRCS
-    llround.cpp
-  HDRS
-    llround.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(nearbyint)
+add_math_entrypoint_object(nearbyintf)
+add_math_entrypoint_object(nearbyintl)
 
-add_entrypoint_object(
-  llroundf
-  SRCS
-    llroundf.cpp
-  HDRS
-    llroundf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(nextafter)
+add_math_entrypoint_object(nextafterf)
+add_math_entrypoint_object(nextafterl)
 
-add_entrypoint_object(
-  llroundl
-  SRCS
-    llroundl.cpp
-  HDRS
-    llroundl.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(remainder)
+add_math_entrypoint_object(remainderf)
+add_math_entrypoint_object(remainderl)
 
-add_entrypoint_object(
-  rint
-  SRCS
-    rint.cpp
-  HDRS
-    rint.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(remquo)
+add_math_entrypoint_object(remquof)
+add_math_entrypoint_object(remquol)
 
-add_entrypoint_object(
-  rintf
-  SRCS
-    rintf.cpp
-  HDRS
-    rintf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(rint)
+add_math_entrypoint_object(rintf)
+add_math_entrypoint_object(rintl)
 
-add_entrypoint_object(
-  rintl
-  SRCS
-    rintl.cpp
-  HDRS
-    rintl.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(round)
+add_math_entrypoint_object(roundf)
+add_math_entrypoint_object(roundl)
 
-add_entrypoint_object(
-  lrint
-  SRCS
-    lrint.cpp
-  HDRS
-    lrint.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(sincosf)
 
-add_entrypoint_object(
-  lrintf
-  SRCS
-    lrintf.cpp
-  HDRS
-    lrintf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(sinf)
 
-add_entrypoint_object(
-  lrintl
-  SRCS
-    lrintl.cpp
-  HDRS
-    lrintl.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(sqrt)
+add_math_entrypoint_object(sqrtf)
+add_math_entrypoint_object(sqrtl)
 
-add_entrypoint_object(
-  llrint
-  SRCS
-    llrint.cpp
-  HDRS
-    llrint.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  llrintf
-  SRCS
-    llrintf.cpp
-  HDRS
-    llrintf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  llrintl
-  SRCS
-    llrintl.cpp
-  HDRS
-    llrintl.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  nearbyint
-  SRCS
-    nearbyint.cpp
-  HDRS
-    nearbyint.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  nearbyintf
-  SRCS
-    nearbyintf.cpp
-  HDRS
-    nearbyintf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  nearbyintl
-  SRCS
-    nearbyintl.cpp
-  HDRS
-    nearbyintl.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_object_library(
-  exp_utils
-  HDRS
-    exp_utils.h
-  SRCS
-    exp_utils.cpp
-  DEPENDS
-    .math_utils
-)
-
-add_entrypoint_object(
-  expf
-  SRCS
-    expf.cpp
-  HDRS
-    expf.h
-  DEPENDS
-    .exp_utils
-    .math_utils
-    libc.include.math
-)
-
-add_entrypoint_object(
-  exp2f
-  SRCS
-    exp2f.cpp
-  HDRS
-    exp2f.h
-  DEPENDS
-    .exp_utils
-    .math_utils
-    libc.include.math
-)
-
-add_entrypoint_object(
-  copysign
-  SRCS
-    copysign.cpp
-  HDRS
-    copysign.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  copysignf
-  SRCS
-    copysignf.cpp
-  HDRS
-    copysignf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  copysignl
-  SRCS
-    copysignl.cpp
-  HDRS
-    copysignl.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  frexp
-  SRCS
-    frexp.cpp
-  HDRS
-    frexp.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  frexpf
-  SRCS
-    frexpf.cpp
-  HDRS
-    frexpf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  frexpl
-  SRCS
-    frexpl.cpp
-  HDRS
-    frexpl.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  ilogb
-  SRCS
-    ilogb.cpp
-  HDRS
-    ilogb.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  ilogbf
-  SRCS
-    ilogbf.cpp
-  HDRS
-    ilogbf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  ilogbl
-  SRCS
-    ilogbl.cpp
-  HDRS
-    ilogbl.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  ldexp
-  SRCS
-    ldexp.cpp
-  HDRS
-    ldexp.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  ldexpf
-  SRCS
-    ldexpf.cpp
-  HDRS
-    ldexpf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  ldexpl
-  SRCS
-    ldexpl.cpp
-  HDRS
-    ldexpl.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  logb
-  SRCS
-    logb.cpp
-  HDRS
-    logb.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  logbf
-  SRCS
-    logbf.cpp
-  HDRS
-    logbf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  logbl
-  SRCS
-    logbl.cpp
-  HDRS
-    logbl.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  modf
-  SRCS
-    modf.cpp
-  HDRS
-    modf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  modff
-  SRCS
-    modff.cpp
-  HDRS
-    modff.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  modfl
-  SRCS
-    modfl.cpp
-  HDRS
-    modfl.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  fmin
-  SRCS
-    fmin.cpp
-  HDRS
-    fmin.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  fminf
-  SRCS
-    fminf.cpp
-  HDRS
-    fminf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  fminl
-  SRCS
-    fminl.cpp
-  HDRS
-    fminl.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  fmax
-  SRCS
-    fmax.cpp
-  HDRS
-    fmax.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  fmaxf
-  SRCS
-    fmaxf.cpp
-  HDRS
-    fmaxf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  fmaxl
-  SRCS
-    fmaxl.cpp
-  HDRS
-    fmaxl.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  sqrt
-  SRCS
-    sqrt.cpp
-  HDRS
-    sqrt.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  sqrtf
-  SRCS
-    sqrtf.cpp
-  HDRS
-    sqrtf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  sqrtl
-  SRCS
-    sqrtl.cpp
-  HDRS
-    sqrtl.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  remquof
-  SRCS
-    remquof.cpp
-  HDRS
-    remquof.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  remquo
-  SRCS
-    remquo.cpp
-  HDRS
-    remquo.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  remquol
-  SRCS
-    remquol.cpp
-  HDRS
-    remquol.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  remainderf
-  SRCS
-    remainderf.cpp
-  HDRS
-    remainderf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  remainder
-  SRCS
-    remainder.cpp
-  HDRS
-    remainder.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  remainderl
-  SRCS
-    remainderl.cpp
-  HDRS
-    remainderl.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  hypotf
-  SRCS
-    hypotf.cpp
-  HDRS
-    hypotf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  fdim
-  SRCS
-    fdim.cpp
-  HDRS
-    fdim.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  fdimf
-  SRCS
-    fdimf.cpp
-  HDRS
-    fdimf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  fdiml
-  SRCS
-    fdiml.cpp
-  HDRS
-    fdiml.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  hypot
-  SRCS
-    hypot.cpp
-  HDRS
-    hypot.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  nextafter
-  SRCS
-    nextafter.cpp
-  HDRS
-    nextafter.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  nextafterf
-  SRCS
-    nextafterf.cpp
-  HDRS
-    nextafterf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  nextafterl
-  SRCS
-    nextafterl.cpp
-  HDRS
-    nextafterl.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
-
-add_entrypoint_object(
-  fmaf
-  SRCS
-    fmaf.cpp
-  HDRS
-    fmaf.h
-  DEPENDS
-    libc.utils.FPUtil.fputil
-  COMPILE_OPTIONS
-    -O2
-)
+add_math_entrypoint_object(trunc)
+add_math_entrypoint_object(truncf)
+add_math_entrypoint_object(truncl)
diff --git a/src/math/generic/CMakeLists.txt b/src/math/generic/CMakeLists.txt
index 6c481b5..fc02622 100644
--- a/src/math/generic/CMakeLists.txt
+++ b/src/math/generic/CMakeLists.txt
@@ -33,3 +33,959 @@
   COMPILE_OPTIONS
     -O2
 )
+
+add_object_library(
+  math_utils
+  SRCS
+    math_utils.cpp
+  HDRS
+    math_utils.h
+  DEPENDS
+    libc.include.errno
+    libc.include.math
+    libc.src.errno.__errno_location
+)
+
+add_object_library(
+  sincosf_utils
+  HDRS
+    sincosf_utils.h
+  SRCS
+    sincosf_data.cpp
+  DEPENDS
+    .math_utils
+)
+
+add_entrypoint_object(
+  cosf
+  SRCS
+    cosf.cpp
+  HDRS
+    ../cosf.h
+  DEPENDS
+    .sincosf_utils
+    libc.include.math
+    libc.src.errno.__errno_location
+)
+
+add_entrypoint_object(
+  sinf
+  SRCS
+    sinf.cpp
+  HDRS
+    ../sinf.h
+  DEPENDS
+    .sincosf_utils
+    libc.include.math
+    libc.src.errno.__errno_location
+)
+
+add_entrypoint_object(
+  sincosf
+  SRCS
+    sincosf.cpp
+  HDRS
+    ../sincosf.h
+  DEPENDS
+    .sincosf_utils
+    libc.include.math
+    libc.src.errno.__errno_location
+)
+
+add_entrypoint_object(
+  fabs
+  SRCS
+    fabs.cpp
+  HDRS
+    ../fabs.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  fabsf
+  SRCS
+    fabsf.cpp
+  HDRS
+    ../fabsf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  fabsl
+  SRCS
+    fabsl.cpp
+  HDRS
+    ../fabsl.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  trunc
+  SRCS
+    trunc.cpp
+  HDRS
+    ../trunc.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  truncf
+  SRCS
+    truncf.cpp
+  HDRS
+    ../truncf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  truncl
+  SRCS
+    truncl.cpp
+  HDRS
+    ../truncl.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  floor
+  SRCS
+    floor.cpp
+  HDRS
+    ../floor.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  floorf
+  SRCS
+    floorf.cpp
+  HDRS
+    ../floorf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  floorl
+  SRCS
+    floorl.cpp
+  HDRS
+    ../floorl.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  round
+  SRCS
+    round.cpp
+  HDRS
+    ../round.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  roundf
+  SRCS
+    roundf.cpp
+  HDRS
+    ../roundf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  roundl
+  SRCS
+    roundl.cpp
+  HDRS
+    ../roundl.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  lround
+  SRCS
+    lround.cpp
+  HDRS
+    ../lround.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  lroundf
+  SRCS
+    lroundf.cpp
+  HDRS
+    ../lroundf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  lroundl
+  SRCS
+    lroundl.cpp
+  HDRS
+    ../lroundl.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  llround
+  SRCS
+    llround.cpp
+  HDRS
+    ../llround.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  llroundf
+  SRCS
+    llroundf.cpp
+  HDRS
+    ../llroundf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  llroundl
+  SRCS
+    llroundl.cpp
+  HDRS
+    ../llroundl.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  rint
+  SRCS
+    rint.cpp
+  HDRS
+    ../rint.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  rintf
+  SRCS
+    rintf.cpp
+  HDRS
+    ../rintf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  rintl
+  SRCS
+    rintl.cpp
+  HDRS
+    ../rintl.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  lrint
+  SRCS
+    lrint.cpp
+  HDRS
+    ../lrint.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  lrintf
+  SRCS
+    lrintf.cpp
+  HDRS
+    ../lrintf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  lrintl
+  SRCS
+    lrintl.cpp
+  HDRS
+    ../lrintl.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  llrint
+  SRCS
+    llrint.cpp
+  HDRS
+    ../llrint.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  llrintf
+  SRCS
+    llrintf.cpp
+  HDRS
+    ../llrintf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  llrintl
+  SRCS
+    llrintl.cpp
+  HDRS
+    ../llrintl.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  nearbyint
+  SRCS
+    nearbyint.cpp
+  HDRS
+    ../nearbyint.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  nearbyintf
+  SRCS
+    nearbyintf.cpp
+  HDRS
+    ../nearbyintf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  nearbyintl
+  SRCS
+    nearbyintl.cpp
+  HDRS
+    ../nearbyintl.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_object_library(
+  exp_utils
+  HDRS
+    exp_utils.h
+  SRCS
+    exp_utils.cpp
+  DEPENDS
+    .math_utils
+)
+
+add_entrypoint_object(
+  expf
+  SRCS
+    expf.cpp
+  HDRS
+    ../expf.h
+  DEPENDS
+    .exp_utils
+    .math_utils
+    libc.include.math
+)
+
+add_entrypoint_object(
+  exp2f
+  SRCS
+    exp2f.cpp
+  HDRS
+    ../exp2f.h
+  DEPENDS
+    .exp_utils
+    .math_utils
+    libc.include.math
+)
+
+add_entrypoint_object(
+  copysign
+  SRCS
+    copysign.cpp
+  HDRS
+    ../copysign.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  copysignf
+  SRCS
+    copysignf.cpp
+  HDRS
+    ../copysignf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  copysignl
+  SRCS
+    copysignl.cpp
+  HDRS
+    ../copysignl.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  frexp
+  SRCS
+    frexp.cpp
+  HDRS
+    ../frexp.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  frexpf
+  SRCS
+    frexpf.cpp
+  HDRS
+    ../frexpf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  frexpl
+  SRCS
+    frexpl.cpp
+  HDRS
+    ../frexpl.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  ilogb
+  SRCS
+    ilogb.cpp
+  HDRS
+    ../ilogb.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  ilogbf
+  SRCS
+    ilogbf.cpp
+  HDRS
+    ../ilogbf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  ilogbl
+  SRCS
+    ilogbl.cpp
+  HDRS
+    ../ilogbl.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  ldexp
+  SRCS
+    ldexp.cpp
+  HDRS
+    ../ldexp.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  ldexpf
+  SRCS
+    ldexpf.cpp
+  HDRS
+    ../ldexpf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  ldexpl
+  SRCS
+    ldexpl.cpp
+  HDRS
+    ../ldexpl.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  logb
+  SRCS
+    logb.cpp
+  HDRS
+    ../logb.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  logbf
+  SRCS
+    logbf.cpp
+  HDRS
+    ../logbf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  logbl
+  SRCS
+    logbl.cpp
+  HDRS
+    ../logbl.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  modf
+  SRCS
+    modf.cpp
+  HDRS
+    ../modf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  modff
+  SRCS
+    modff.cpp
+  HDRS
+    ../modff.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  modfl
+  SRCS
+    modfl.cpp
+  HDRS
+    ../modfl.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  fmin
+  SRCS
+    fmin.cpp
+  HDRS
+    ../fmin.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  fminf
+  SRCS
+    fminf.cpp
+  HDRS
+    ../fminf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  fminl
+  SRCS
+    fminl.cpp
+  HDRS
+    ../fminl.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  fmax
+  SRCS
+    fmax.cpp
+  HDRS
+    ../fmax.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  fmaxf
+  SRCS
+    fmaxf.cpp
+  HDRS
+    ../fmaxf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  fmaxl
+  SRCS
+    fmaxl.cpp
+  HDRS
+    ../fmaxl.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  sqrt
+  SRCS
+    sqrt.cpp
+  HDRS
+    ../sqrt.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  sqrtf
+  SRCS
+    sqrtf.cpp
+  HDRS
+    ../sqrtf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  sqrtl
+  SRCS
+    sqrtl.cpp
+  HDRS
+    ../sqrtl.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  remquof
+  SRCS
+    remquof.cpp
+  HDRS
+    ../remquof.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  remquo
+  SRCS
+    remquo.cpp
+  HDRS
+    ../remquo.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  remquol
+  SRCS
+    remquol.cpp
+  HDRS
+    ../remquol.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  remainderf
+  SRCS
+    remainderf.cpp
+  HDRS
+    ../remainderf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  remainder
+  SRCS
+    remainder.cpp
+  HDRS
+    ../remainder.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  remainderl
+  SRCS
+    remainderl.cpp
+  HDRS
+    ../remainderl.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  hypotf
+  SRCS
+    hypotf.cpp
+  HDRS
+    ../hypotf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  fdim
+  SRCS
+    fdim.cpp
+  HDRS
+    ../fdim.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  fdimf
+  SRCS
+    fdimf.cpp
+  HDRS
+    ../fdimf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  fdiml
+  SRCS
+    fdiml.cpp
+  HDRS
+    ../fdiml.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  hypot
+  SRCS
+    hypot.cpp
+  HDRS
+    ../hypot.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  nextafter
+  SRCS
+    nextafter.cpp
+  HDRS
+    ../nextafter.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  nextafterf
+  SRCS
+    nextafterf.cpp
+  HDRS
+    ../nextafterf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  nextafterl
+  SRCS
+    nextafterl.cpp
+  HDRS
+    ../nextafterl.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
+
+add_entrypoint_object(
+  fmaf
+  SRCS
+    fmaf.cpp
+  HDRS
+    ../fmaf.h
+  DEPENDS
+    libc.utils.FPUtil.fputil
+  COMPILE_OPTIONS
+    -O2
+)
diff --git a/src/math/copysign.cpp b/src/math/generic/copysign.cpp
similarity index 100%
rename from src/math/copysign.cpp
rename to src/math/generic/copysign.cpp
diff --git a/src/math/copysignf.cpp b/src/math/generic/copysignf.cpp
similarity index 100%
rename from src/math/copysignf.cpp
rename to src/math/generic/copysignf.cpp
diff --git a/src/math/copysignl.cpp b/src/math/generic/copysignl.cpp
similarity index 100%
rename from src/math/copysignl.cpp
rename to src/math/generic/copysignl.cpp
diff --git a/src/math/cosf.cpp b/src/math/generic/cosf.cpp
similarity index 100%
rename from src/math/cosf.cpp
rename to src/math/generic/cosf.cpp
diff --git a/src/math/exp2f.cpp b/src/math/generic/exp2f.cpp
similarity index 100%
rename from src/math/exp2f.cpp
rename to src/math/generic/exp2f.cpp
diff --git a/src/math/exp_utils.cpp b/src/math/generic/exp_utils.cpp
similarity index 98%
rename from src/math/exp_utils.cpp
rename to src/math/generic/exp_utils.cpp
index a1bda63..9555dd6 100644
--- a/src/math/exp_utils.cpp
+++ b/src/math/generic/exp_utils.cpp
@@ -6,9 +6,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "src/math/exp_utils.h"
 #include "exp_utils.h"
-
 #include "math_utils.h"
 
 namespace __llvm_libc {
diff --git a/src/math/exp_utils.h b/src/math/generic/exp_utils.h
similarity index 100%
rename from src/math/exp_utils.h
rename to src/math/generic/exp_utils.h
diff --git a/src/math/expf.cpp b/src/math/generic/expf.cpp
similarity index 100%
rename from src/math/expf.cpp
rename to src/math/generic/expf.cpp
diff --git a/src/math/fabs.cpp b/src/math/generic/fabs.cpp
similarity index 100%
rename from src/math/fabs.cpp
rename to src/math/generic/fabs.cpp
diff --git a/src/math/fabsf.cpp b/src/math/generic/fabsf.cpp
similarity index 100%
rename from src/math/fabsf.cpp
rename to src/math/generic/fabsf.cpp
diff --git a/src/math/fabsl.cpp b/src/math/generic/fabsl.cpp
similarity index 100%
rename from src/math/fabsl.cpp
rename to src/math/generic/fabsl.cpp
diff --git a/src/math/fdim.cpp b/src/math/generic/fdim.cpp
similarity index 100%
rename from src/math/fdim.cpp
rename to src/math/generic/fdim.cpp
diff --git a/src/math/fdimf.cpp b/src/math/generic/fdimf.cpp
similarity index 100%
rename from src/math/fdimf.cpp
rename to src/math/generic/fdimf.cpp
diff --git a/src/math/fdiml.cpp b/src/math/generic/fdiml.cpp
similarity index 100%
rename from src/math/fdiml.cpp
rename to src/math/generic/fdiml.cpp
diff --git a/src/math/floor.cpp b/src/math/generic/floor.cpp
similarity index 100%
rename from src/math/floor.cpp
rename to src/math/generic/floor.cpp
diff --git a/src/math/floorf.cpp b/src/math/generic/floorf.cpp
similarity index 100%
rename from src/math/floorf.cpp
rename to src/math/generic/floorf.cpp
diff --git a/src/math/floorl.cpp b/src/math/generic/floorl.cpp
similarity index 100%
rename from src/math/floorl.cpp
rename to src/math/generic/floorl.cpp
diff --git a/src/math/fmaf.cpp b/src/math/generic/fmaf.cpp
similarity index 97%
rename from src/math/fmaf.cpp
rename to src/math/generic/fmaf.cpp
index 1ab1906..c2ab7e7 100644
--- a/src/math/fmaf.cpp
+++ b/src/math/generic/fmaf.cpp
@@ -14,7 +14,7 @@
 
 namespace __llvm_libc {
 
-LLVM_LIBC_FUNCTION(float, fmaf, (float x, float y, float z)){
+LLVM_LIBC_FUNCTION(float, fmaf, (float x, float y, float z)) {
   // Product is exact.
   double prod = static_cast<double>(x) * static_cast<double>(y);
   double z_d = static_cast<double>(z);
diff --git a/src/math/fmax.cpp b/src/math/generic/fmax.cpp
similarity index 100%
rename from src/math/fmax.cpp
rename to src/math/generic/fmax.cpp
diff --git a/src/math/fmaxf.cpp b/src/math/generic/fmaxf.cpp
similarity index 100%
rename from src/math/fmaxf.cpp
rename to src/math/generic/fmaxf.cpp
diff --git a/src/math/fmaxl.cpp b/src/math/generic/fmaxl.cpp
similarity index 100%
rename from src/math/fmaxl.cpp
rename to src/math/generic/fmaxl.cpp
diff --git a/src/math/fmin.cpp b/src/math/generic/fmin.cpp
similarity index 100%
rename from src/math/fmin.cpp
rename to src/math/generic/fmin.cpp
diff --git a/src/math/fminf.cpp b/src/math/generic/fminf.cpp
similarity index 100%
rename from src/math/fminf.cpp
rename to src/math/generic/fminf.cpp
diff --git a/src/math/fminl.cpp b/src/math/generic/fminl.cpp
similarity index 100%
rename from src/math/fminl.cpp
rename to src/math/generic/fminl.cpp
diff --git a/src/math/frexp.cpp b/src/math/generic/frexp.cpp
similarity index 100%
rename from src/math/frexp.cpp
rename to src/math/generic/frexp.cpp
diff --git a/src/math/frexpf.cpp b/src/math/generic/frexpf.cpp
similarity index 100%
rename from src/math/frexpf.cpp
rename to src/math/generic/frexpf.cpp
diff --git a/src/math/frexpl.cpp b/src/math/generic/frexpl.cpp
similarity index 100%
rename from src/math/frexpl.cpp
rename to src/math/generic/frexpl.cpp
diff --git a/src/math/hypot.cpp b/src/math/generic/hypot.cpp
similarity index 100%
rename from src/math/hypot.cpp
rename to src/math/generic/hypot.cpp
diff --git a/src/math/hypotf.cpp b/src/math/generic/hypotf.cpp
similarity index 100%
rename from src/math/hypotf.cpp
rename to src/math/generic/hypotf.cpp
diff --git a/src/math/ilogb.cpp b/src/math/generic/ilogb.cpp
similarity index 100%
rename from src/math/ilogb.cpp
rename to src/math/generic/ilogb.cpp
diff --git a/src/math/ilogbf.cpp b/src/math/generic/ilogbf.cpp
similarity index 100%
rename from src/math/ilogbf.cpp
rename to src/math/generic/ilogbf.cpp
diff --git a/src/math/ilogbl.cpp b/src/math/generic/ilogbl.cpp
similarity index 100%
rename from src/math/ilogbl.cpp
rename to src/math/generic/ilogbl.cpp
diff --git a/src/math/ldexp.cpp b/src/math/generic/ldexp.cpp
similarity index 100%
rename from src/math/ldexp.cpp
rename to src/math/generic/ldexp.cpp
diff --git a/src/math/ldexpf.cpp b/src/math/generic/ldexpf.cpp
similarity index 100%
rename from src/math/ldexpf.cpp
rename to src/math/generic/ldexpf.cpp
diff --git a/src/math/ldexpl.cpp b/src/math/generic/ldexpl.cpp
similarity index 100%
rename from src/math/ldexpl.cpp
rename to src/math/generic/ldexpl.cpp
diff --git a/src/math/llrint.cpp b/src/math/generic/llrint.cpp
similarity index 100%
rename from src/math/llrint.cpp
rename to src/math/generic/llrint.cpp
diff --git a/src/math/llrintf.cpp b/src/math/generic/llrintf.cpp
similarity index 100%
rename from src/math/llrintf.cpp
rename to src/math/generic/llrintf.cpp
diff --git a/src/math/llrintl.cpp b/src/math/generic/llrintl.cpp
similarity index 100%
rename from src/math/llrintl.cpp
rename to src/math/generic/llrintl.cpp
diff --git a/src/math/llround.cpp b/src/math/generic/llround.cpp
similarity index 100%
rename from src/math/llround.cpp
rename to src/math/generic/llround.cpp
diff --git a/src/math/llroundf.cpp b/src/math/generic/llroundf.cpp
similarity index 100%
rename from src/math/llroundf.cpp
rename to src/math/generic/llroundf.cpp
diff --git a/src/math/llroundl.cpp b/src/math/generic/llroundl.cpp
similarity index 100%
rename from src/math/llroundl.cpp
rename to src/math/generic/llroundl.cpp
diff --git a/src/math/logb.cpp b/src/math/generic/logb.cpp
similarity index 100%
rename from src/math/logb.cpp
rename to src/math/generic/logb.cpp
diff --git a/src/math/logbf.cpp b/src/math/generic/logbf.cpp
similarity index 100%
rename from src/math/logbf.cpp
rename to src/math/generic/logbf.cpp
diff --git a/src/math/logbl.cpp b/src/math/generic/logbl.cpp
similarity index 100%
rename from src/math/logbl.cpp
rename to src/math/generic/logbl.cpp
diff --git a/src/math/lrint.cpp b/src/math/generic/lrint.cpp
similarity index 100%
rename from src/math/lrint.cpp
rename to src/math/generic/lrint.cpp
diff --git a/src/math/lrintf.cpp b/src/math/generic/lrintf.cpp
similarity index 100%
rename from src/math/lrintf.cpp
rename to src/math/generic/lrintf.cpp
diff --git a/src/math/lrintl.cpp b/src/math/generic/lrintl.cpp
similarity index 100%
rename from src/math/lrintl.cpp
rename to src/math/generic/lrintl.cpp
diff --git a/src/math/lround.cpp b/src/math/generic/lround.cpp
similarity index 100%
rename from src/math/lround.cpp
rename to src/math/generic/lround.cpp
diff --git a/src/math/lroundf.cpp b/src/math/generic/lroundf.cpp
similarity index 100%
rename from src/math/lroundf.cpp
rename to src/math/generic/lroundf.cpp
diff --git a/src/math/lroundl.cpp b/src/math/generic/lroundl.cpp
similarity index 100%
rename from src/math/lroundl.cpp
rename to src/math/generic/lroundl.cpp
diff --git a/src/math/math_utils.cpp b/src/math/generic/math_utils.cpp
similarity index 96%
rename from src/math/math_utils.cpp
rename to src/math/generic/math_utils.cpp
index b72dc27..42a912b 100644
--- a/src/math/math_utils.cpp
+++ b/src/math/generic/math_utils.cpp
@@ -6,7 +6,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "src/math/math_utils.h"
 #include "math_utils.h"
 
 namespace __llvm_libc {
diff --git a/src/math/math_utils.h b/src/math/generic/math_utils.h
similarity index 100%
rename from src/math/math_utils.h
rename to src/math/generic/math_utils.h
diff --git a/src/math/modf.cpp b/src/math/generic/modf.cpp
similarity index 100%
rename from src/math/modf.cpp
rename to src/math/generic/modf.cpp
diff --git a/src/math/modff.cpp b/src/math/generic/modff.cpp
similarity index 100%
rename from src/math/modff.cpp
rename to src/math/generic/modff.cpp
diff --git a/src/math/modfl.cpp b/src/math/generic/modfl.cpp
similarity index 100%
rename from src/math/modfl.cpp
rename to src/math/generic/modfl.cpp
diff --git a/src/math/nearbyint.cpp b/src/math/generic/nearbyint.cpp
similarity index 100%
rename from src/math/nearbyint.cpp
rename to src/math/generic/nearbyint.cpp
diff --git a/src/math/nearbyintf.cpp b/src/math/generic/nearbyintf.cpp
similarity index 100%
rename from src/math/nearbyintf.cpp
rename to src/math/generic/nearbyintf.cpp
diff --git a/src/math/nearbyintl.cpp b/src/math/generic/nearbyintl.cpp
similarity index 100%
rename from src/math/nearbyintl.cpp
rename to src/math/generic/nearbyintl.cpp
diff --git a/src/math/nextafter.cpp b/src/math/generic/nextafter.cpp
similarity index 100%
rename from src/math/nextafter.cpp
rename to src/math/generic/nextafter.cpp
diff --git a/src/math/nextafterf.cpp b/src/math/generic/nextafterf.cpp
similarity index 100%
rename from src/math/nextafterf.cpp
rename to src/math/generic/nextafterf.cpp
diff --git a/src/math/nextafterl.cpp b/src/math/generic/nextafterl.cpp
similarity index 100%
rename from src/math/nextafterl.cpp
rename to src/math/generic/nextafterl.cpp
diff --git a/src/math/remainder.cpp b/src/math/generic/remainder.cpp
similarity index 100%
rename from src/math/remainder.cpp
rename to src/math/generic/remainder.cpp
diff --git a/src/math/remainderf.cpp b/src/math/generic/remainderf.cpp
similarity index 100%
rename from src/math/remainderf.cpp
rename to src/math/generic/remainderf.cpp
diff --git a/src/math/remainderl.cpp b/src/math/generic/remainderl.cpp
similarity index 100%
rename from src/math/remainderl.cpp
rename to src/math/generic/remainderl.cpp
diff --git a/src/math/remquo.cpp b/src/math/generic/remquo.cpp
similarity index 100%
rename from src/math/remquo.cpp
rename to src/math/generic/remquo.cpp
diff --git a/src/math/remquof.cpp b/src/math/generic/remquof.cpp
similarity index 100%
rename from src/math/remquof.cpp
rename to src/math/generic/remquof.cpp
diff --git a/src/math/remquol.cpp b/src/math/generic/remquol.cpp
similarity index 100%
rename from src/math/remquol.cpp
rename to src/math/generic/remquol.cpp
diff --git a/src/math/rint.cpp b/src/math/generic/rint.cpp
similarity index 100%
rename from src/math/rint.cpp
rename to src/math/generic/rint.cpp
diff --git a/src/math/rintf.cpp b/src/math/generic/rintf.cpp
similarity index 100%
rename from src/math/rintf.cpp
rename to src/math/generic/rintf.cpp
diff --git a/src/math/rintl.cpp b/src/math/generic/rintl.cpp
similarity index 100%
rename from src/math/rintl.cpp
rename to src/math/generic/rintl.cpp
diff --git a/src/math/round.cpp b/src/math/generic/round.cpp
similarity index 100%
rename from src/math/round.cpp
rename to src/math/generic/round.cpp
diff --git a/src/math/roundf.cpp b/src/math/generic/roundf.cpp
similarity index 100%
rename from src/math/roundf.cpp
rename to src/math/generic/roundf.cpp
diff --git a/src/math/roundl.cpp b/src/math/generic/roundl.cpp
similarity index 100%
rename from src/math/roundl.cpp
rename to src/math/generic/roundl.cpp
diff --git a/src/math/sincosf.cpp b/src/math/generic/sincosf.cpp
similarity index 100%
rename from src/math/sincosf.cpp
rename to src/math/generic/sincosf.cpp
diff --git a/src/math/sincosf_data.cpp b/src/math/generic/sincosf_data.cpp
similarity index 100%
rename from src/math/sincosf_data.cpp
rename to src/math/generic/sincosf_data.cpp
diff --git a/src/math/sincosf_utils.h b/src/math/generic/sincosf_utils.h
similarity index 100%
rename from src/math/sincosf_utils.h
rename to src/math/generic/sincosf_utils.h
diff --git a/src/math/sinf.cpp b/src/math/generic/sinf.cpp
similarity index 100%
rename from src/math/sinf.cpp
rename to src/math/generic/sinf.cpp
diff --git a/src/math/sqrt.cpp b/src/math/generic/sqrt.cpp
similarity index 100%
rename from src/math/sqrt.cpp
rename to src/math/generic/sqrt.cpp
diff --git a/src/math/sqrtf.cpp b/src/math/generic/sqrtf.cpp
similarity index 100%
rename from src/math/sqrtf.cpp
rename to src/math/generic/sqrtf.cpp
diff --git a/src/math/sqrtl.cpp b/src/math/generic/sqrtl.cpp
similarity index 100%
rename from src/math/sqrtl.cpp
rename to src/math/generic/sqrtl.cpp
diff --git a/src/math/trunc.cpp b/src/math/generic/trunc.cpp
similarity index 100%
rename from src/math/trunc.cpp
rename to src/math/generic/trunc.cpp
diff --git a/src/math/truncf.cpp b/src/math/generic/truncf.cpp
similarity index 100%
rename from src/math/truncf.cpp
rename to src/math/generic/truncf.cpp
diff --git a/src/math/truncl.cpp b/src/math/generic/truncl.cpp
similarity index 100%
rename from src/math/truncl.cpp
rename to src/math/generic/truncl.cpp