summaryrefslogtreecommitdiff
path: root/libc/src/math/generic/floor.cpp
diff options
context:
space:
mode:
authorSiva Chandra <sivachandra@google.com>2021-02-03 00:37:16 -0800
committerSiva Chandra <sivachandra@google.com>2021-02-03 10:46:00 -0800
commitbbb7555403855f5c2a61d62ae59f1e970ea37ec1 (patch)
treee8a7846cf7322b0c6e430255997db7456e23c8e4 /libc/src/math/generic/floor.cpp
parent15aa78abb6ca22294e72767d5ed2aea0b1cf23f9 (diff)
[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.
Diffstat (limited to 'libc/src/math/generic/floor.cpp')
-rw-r--r--libc/src/math/generic/floor.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/libc/src/math/generic/floor.cpp b/libc/src/math/generic/floor.cpp
new file mode 100644
index 000000000000..1f60aa715704
--- /dev/null
+++ b/libc/src/math/generic/floor.cpp
@@ -0,0 +1,17 @@
+//===-- Implementation of floor function ----------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/math/floor.h"
+#include "src/__support/common.h"
+#include "utils/FPUtil/NearestIntegerOperations.h"
+
+namespace __llvm_libc {
+
+LLVM_LIBC_FUNCTION(double, floor, (double x)) { return fputil::floor(x); }
+
+} // namespace __llvm_libc