diff options
author | Elliott Hughes <enh@google.com> | 2018-09-27 20:24:28 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-09-27 20:24:28 +0000 |
commit | 7208139406adbd40782ccd7554e1a21458da2b37 (patch) | |
tree | 8b9066c3f08d71320a650be8356b862938457585 | |
parent | e27886eaea1317f3a7fca59d4841448fa8899dcc (diff) | |
parent | 1e108e3432cd185594e1ac84913b1cbd489fbe52 (diff) | |
download | bionic-7208139406adbd40782ccd7554e1a21458da2b37.tar.gz |
Merge "Use builtins for ceil/floor/rint/trunc on arm64"
-rw-r--r-- | libm/Android.bp | 4 | ||||
-rw-r--r-- | libm/arm64/ceil.S | 27 | ||||
-rw-r--r-- | libm/arm64/floor.S | 27 | ||||
-rw-r--r-- | libm/arm64/rint.S | 27 | ||||
-rw-r--r-- | libm/arm64/trunc.S | 27 | ||||
-rw-r--r-- | libm/builtins.cpp | 12 |
6 files changed, 12 insertions, 112 deletions
diff --git a/libm/Android.bp b/libm/Android.bp index 3b88fa3a8..6d55967ca 100644 --- a/libm/Android.bp +++ b/libm/Android.bp @@ -290,13 +290,9 @@ cc_library { arm64: { srcs: [ - "arm64/ceil.S", "arm64/fenv.c", - "arm64/floor.S", "arm64/lrint.S", - "arm64/rint.S", "arm64/sqrt.S", - "arm64/trunc.S", ], exclude_srcs: [ "upstream-freebsd/lib/msun/src/e_sqrt.c", diff --git a/libm/arm64/ceil.S b/libm/arm64/ceil.S deleted file mode 100644 index 7217d57c5..000000000 --- a/libm/arm64/ceil.S +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2015 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <private/bionic_asm.h> - -ENTRY(ceil) - frintP d0, d0 - ret -END(ceil) - -ENTRY(ceilf) - frintP s0, s0 - ret -END(ceilf) diff --git a/libm/arm64/floor.S b/libm/arm64/floor.S deleted file mode 100644 index ca106bdd5..000000000 --- a/libm/arm64/floor.S +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2015 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <private/bionic_asm.h> - -ENTRY(floor) - frintM d0, d0 - ret -END(floor) - -ENTRY(floorf) - frintM s0, s0 - ret -END(floorf) diff --git a/libm/arm64/rint.S b/libm/arm64/rint.S deleted file mode 100644 index bf49f5b53..000000000 --- a/libm/arm64/rint.S +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2015 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <private/bionic_asm.h> - -ENTRY(rint) - frintX d0, d0 - ret -END(rint) - -ENTRY(rintf) - frintX s0, s0 - ret -END(rintf) diff --git a/libm/arm64/trunc.S b/libm/arm64/trunc.S deleted file mode 100644 index aa0d4bd02..000000000 --- a/libm/arm64/trunc.S +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2015 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include <private/bionic_asm.h> - -ENTRY(trunc) - frintZ d0, d0 - ret -END(trunc) - -ENTRY(truncf) - frintZ s0, s0 - ret -END(truncf) diff --git a/libm/builtins.cpp b/libm/builtins.cpp index 2ea63055c..3b9228c61 100644 --- a/libm/builtins.cpp +++ b/libm/builtins.cpp @@ -46,6 +46,12 @@ long double fabsl(long double x) { #endif #if defined(__aarch64__) +float ceilf(float x) { return __builtin_ceilf(x); } +double ceil(double x) { return __builtin_ceil(x); } + +float floorf(float x) { return __builtin_floorf(x); } +double floor(double x) { return __builtin_floor(x); } + float fmaf(float x, float y, float z) { return __builtin_fmaf(x, y, z); } double fma(double x, double y, double z) { return __builtin_fma(x, y, z); } @@ -55,6 +61,12 @@ double fmax(double x, double y) { return __builtin_fmax(x, y); } float fminf(float x, float y) { return __builtin_fminf(x, y); } double fmin(double x, double y) { return __builtin_fmin(x, y); } +float rintf(float x) { return __builtin_rintf(x); } +double rint(double x) { return __builtin_rint(x); } + float roundf(float x) { return __builtin_roundf(x); } double round(double x) { return __builtin_round(x); } + +float truncf(float x) { return __builtin_truncf(x); } +double trunc(double x) { return __builtin_trunc(x); } #endif |