Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorSiva Chandra Reddy <sivachandra@google.com>2020-06-04 08:39:34 +0300
committerSiva Chandra Reddy <sivachandra@google.com>2020-06-04 08:39:34 +0300
commitb28167928d2722e8774da3fce8b3307a0fa27245 (patch)
tree237affeb1e54fd04c7b1263fef9cb54966d4ee1d /libc
parent1a2d4bf34e19eec9563e871a102d1f9a5c183daa (diff)
[libc][NFC] Add ceil[f], floor[f] and trunc[f] to the spec and config files.
Diffstat (limited to 'libc')
-rw-r--r--libc/config/linux/api.td6
-rw-r--r--libc/config/linux/x86_64/entrypoints.txt10
-rw-r--r--libc/spec/stdc.td9
3 files changed, 24 insertions, 1 deletions
diff --git a/libc/config/linux/api.td b/libc/config/linux/api.td
index d45be84fa080..4259fd7d4ff4 100644
--- a/libc/config/linux/api.td
+++ b/libc/config/linux/api.td
@@ -149,14 +149,20 @@ def MathAPI : PublicAPI<"math.h"> {
FloatT,
];
let Functions = [
+ "ceil",
+ "ceilf",
"cosf",
"fabs",
"fabsf",
+ "floor",
+ "floorf",
"expf",
"exp2f",
"round",
"sincosf",
"sinf",
+ "trunc",
+ "truncf",
];
}
diff --git a/libc/config/linux/x86_64/entrypoints.txt b/libc/config/linux/x86_64/entrypoints.txt
index 2f79d7f256f8..54fe783795f7 100644
--- a/libc/config/linux/x86_64/entrypoints.txt
+++ b/libc/config/linux/x86_64/entrypoints.txt
@@ -42,8 +42,16 @@ set(LIBC_ENTRYPOINTS
set(LIBM_ENTRYPOINTS
# math.h entrypoints
+ libc.src.math.ceil
+ libc.src.math.ceilf
libc.src.math.cosf
+ libc.src.math.expf
+ libc.src.math.exp2f
+ libc.src.math.floor
+ libc.src.math.floorf
libc.src.math.round
libc.src.math.sincosf
libc.src.math.sinf
-) \ No newline at end of file
+ libc.src.math.trunc
+ libc.src.math.truncf
+)
diff --git a/libc/spec/stdc.td b/libc/spec/stdc.td
index 4e6bfbfac160..077dc2127355 100644
--- a/libc/spec/stdc.td
+++ b/libc/spec/stdc.td
@@ -187,9 +187,15 @@ def StdC : StandardSpec<"stdc"> {
],
[], // Enumerations
[
+ FunctionSpec<"ceil", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
+ FunctionSpec<"ceilf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
+
FunctionSpec<"fabs", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
FunctionSpec<"fabsf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
+ FunctionSpec<"floor", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
+ FunctionSpec<"floorf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
+
FunctionSpec<"cosf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
FunctionSpec<"sinf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
@@ -197,6 +203,9 @@ def StdC : StandardSpec<"stdc"> {
FunctionSpec<"exp2f", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
FunctionSpec<"round", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
+
+ FunctionSpec<"trunc", RetValSpec<DoubleType>, [ArgSpec<DoubleType>]>,
+ FunctionSpec<"truncf", RetValSpec<FloatType>, [ArgSpec<FloatType>]>,
]
>;