Krait enhancements from caf
msm8960: Improve performance of memmove, bcopy, and memmove_words
Change-Id: I62b3da046889387f835da741110d35ffd3c8f806
Conflicts:
libc/Android.mk
msm8960: Improve performance of memcpy
Change-Id: I0c8355ae5e92060ad5a0811d33937e6913c8b633
Bionic/libm: fast neon pow() for small x,y
Add a fast neon version of pow() suitable for relatively small
positive x and y (between 0 and 4). Run the standard
implementation in all other cases. Gives approximately 60%
performance improvement to AnTuTu FPU score.
Change-Id: I9234d37eaa6a815d1e619375f5b049c4ec88f557
msm7627a: Enable neon optimized memove and pow functions.
Define SPARROW_NEON_OPTIMIZATION flag so that neon optimized
memove and pow functions are used. Also add Corresponding
definitions in make files.
Change-Id: I12089fc7002e3ec294e63632bd84e395fbd24936
Bionic/libm: Prefer branches and VFP ABI
For internal functions set gcc attribute "aapcs-vfp" for ARM
and use -fno-if-conversion to prefer branches over predicated
instructions (improves performance on architectures with good
branch prediction).
Change-Id: I365e9508bd3babb0bb06fc5de127c1ae17445bcc
Bionic/libm: add assembly versions of sin/cos
Add assembly versions of sin/cos with integrated remainder pi/2
calculation. Directly extracted from binary libm.so compiled with
__ieee754_rem_pio2 calls inlined.
Change-Id: I9a999c01cea92aace9df7be9ad8f90f150040375
Conflicts:
libm/Android.mk
Bionic/libm: Remove extra vmov from sin/cos
Move integer representations of x bits on the integer side rather
than moving them to and from the FP registers.
Change-Id: I1d0800730d7553a47c462ee2a0cc044ffe62eb20
Bionic/libm: Pow optimizations and bug fixes
Use VFP calling convention for pow_neon handoff function by default.
Fix register usage collision between two different polynomial
coefficients in pow_neon. Remove conditional execution in pow_neon
and replace with branching.
Change-Id: I254617940b2787297aff2ab97dbf45c11e6a2b08
Bionic/libm: Add precision-correct de-serialize sin/cos
Modify sin/cos to improve performance while retaining either
bit-for-bit agreement with previous algorithm or <1 ulp
deviation from arbitrary precision result.
Change-Id: Icbd6d66fb1c0ceb53f43fed6541e0c89cc6e7a63
diff --git a/libm/src/k_cos.c b/libm/src/k_cos.c
index 00916d7..b8cdf8f 100644
--- a/libm/src/k_cos.c
+++ b/libm/src/k_cos.c
@@ -69,6 +69,17 @@
double
__kernel_cos(double x, double y)
{
+#if defined(KRAIT_NEON_OPTIMIZATION)
+ double hz,z,zz,r,w,k;
+
+ z = x*x;
+ zz = z*z;
+ k = x*y;
+ hz = (float)0.5*z;
+ r = z*(z*(C1+z*(C2+z*((C3+z*C4)+zz*(C5+z*C6)))));
+ w = one-hz;
+ return w + (((one-w)-hz) + (r-k));
+#else
double hz,z,r,w;
z = x*x;
@@ -76,4 +87,5 @@
hz = (float)0.5*z;
w = one-hz;
return w + (((one-w)-hz) + (z*r-x*y));
+#endif
}