Merge "Use builtins for fma/fmax/fmin/round on arm64."
am: 9b0def7139
Change-Id: I98996cd4216643c686e985136c9edb92aa6bf397
This commit is contained in:
commit
546c416fa4
3 changed files with 23 additions and 31 deletions
|
@ -211,7 +211,7 @@ cc_library {
|
|||
"fake_long_double.c",
|
||||
|
||||
// Home-grown stuff.
|
||||
"fabs.cpp",
|
||||
"builtins.cpp",
|
||||
"signbit.cpp",
|
||||
],
|
||||
|
||||
|
@ -302,7 +302,6 @@ cc_library {
|
|||
srcs: [
|
||||
"arm64/ceil.S",
|
||||
"arm64/fenv.c",
|
||||
"arm64/fma.S",
|
||||
"arm64/floor.S",
|
||||
"arm64/lrint.S",
|
||||
"arm64/rint.S",
|
||||
|
@ -314,16 +313,22 @@ cc_library {
|
|||
"upstream-freebsd/lib/msun/src/e_sqrtf.c",
|
||||
"upstream-freebsd/lib/msun/src/s_ceil.c",
|
||||
"upstream-freebsd/lib/msun/src/s_ceilf.c",
|
||||
"upstream-freebsd/lib/msun/src/s_fma.c",
|
||||
"upstream-freebsd/lib/msun/src/s_fmaf.c",
|
||||
"upstream-freebsd/lib/msun/src/s_floor.c",
|
||||
"upstream-freebsd/lib/msun/src/s_floorf.c",
|
||||
"upstream-freebsd/lib/msun/src/s_fma.c",
|
||||
"upstream-freebsd/lib/msun/src/s_fmaf.c",
|
||||
"upstream-freebsd/lib/msun/src/s_fmax.c",
|
||||
"upstream-freebsd/lib/msun/src/s_fmaxf.c",
|
||||
"upstream-freebsd/lib/msun/src/s_fmin.c",
|
||||
"upstream-freebsd/lib/msun/src/s_fminf.c",
|
||||
"upstream-freebsd/lib/msun/src/s_llrint.c",
|
||||
"upstream-freebsd/lib/msun/src/s_llrintf.c",
|
||||
"upstream-freebsd/lib/msun/src/s_lrint.c",
|
||||
"upstream-freebsd/lib/msun/src/s_lrintf.c",
|
||||
"upstream-freebsd/lib/msun/src/s_rint.c",
|
||||
"upstream-freebsd/lib/msun/src/s_rintf.c",
|
||||
"upstream-freebsd/lib/msun/src/s_round.c",
|
||||
"upstream-freebsd/lib/msun/src/s_roundf.c",
|
||||
"upstream-freebsd/lib/msun/src/s_trunc.c",
|
||||
"upstream-freebsd/lib/msun/src/s_truncf.c",
|
||||
],
|
||||
|
|
|
@ -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(fma)
|
||||
fmadd d0, d0, d1, d2
|
||||
ret
|
||||
END(fma)
|
||||
|
||||
ENTRY(fmaf)
|
||||
fmadd s0, s0, s1, s2
|
||||
ret
|
||||
END(fmaf)
|
|
@ -44,3 +44,17 @@ long double fabsl(long double x) {
|
|||
return fabs(x);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__aarch64__)
|
||||
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); }
|
||||
|
||||
float fmaxf(float x, float y) { return __builtin_fmaxf(x, y); }
|
||||
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 roundf(float x) { return __builtin_roundf(x); }
|
||||
double round(double x) { return __builtin_round(x); }
|
||||
#endif
|
Loading…
Reference in a new issue