Merge "Use builtins for ceil/floor/rint/trunc on arm64"

This commit is contained in:
Elliott Hughes 2018-09-27 20:24:28 +00:00 committed by Gerrit Code Review
commit 7208139406
6 changed files with 12 additions and 112 deletions

View file

@ -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",

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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