FORTIFY_SOURCE: remove memcpy overlap checks

These checks haven't been as useful as I hoped, and it's
causing a false positive finding.  Remove the overlap
compile time checks.

Change-Id: I5d45dde10ae4663d728230d41fa904adf20acaea
bionic: Add workarounds for current compilers
With current compilers, we're getting "this function cannot be inlined"
errors on vsnprintf and strlcpy because the always_inline attribute is
set.

Before marking this a "fix" instead of a "workaround", we should figure
out why the functions can't be inlined.

Change-Id: Id6c5464defafb3f9044c102d32a57e70d760b05d
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
Signed-off-by: Stevespear426 <stephen.k.spear@gmail.com>
Fix assembler error using newer toolchains.
Fixes a ".size expression for pow does not evaluate to a constant" assembler error using linaro 4.7.x.

Change-Id: I5ad3643794df330c0e54508ba946f9fc769e62e2
bionic: Fix aliasing violations

This makes bionic compile with compilers enforcing
strict adherence to aliasing rules (e.g. gcc 4.6+
with -Wstrict-aliasing=2 -Werror=strict-aliasing).

Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
Revert "Add ARMv7 optimized strlen()"

This reverts commit 9b58b97c72f3ec577a1c36dd6ee9a7a3dc9aa589.

Conflicts:

	libc/Android.mk

Signed-off-by: Stevespear426 <stephen.k.spear@gmail.com>
libm: Add a proper sincos() implementation

Add a proper sincos() implementation that unifies the common
calculations for sin and cos instead of running them twice.

This should cause a speedup even in code not using that
(fairly uncommon) function because gcc can optimize separate
sin() and cos() calls into sincos() calls.

Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
bionic: Add ARMv7 optimized string handling routines

Add ARMv7 - and especially Cortex-A9 - optimized string handling
routines based on the versions found in the cortex-strings library.

Change-Id: I497075bea5b82aef8989625bdec512029676fe7f
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
Add optimized version of memcpy for Cortex A9

Adds new code to memcpy function, optimized for Cortex A9.
Adds new ARM-only loop, for operations where source and
destination are aligned.

Copyright (C) ST-Ericsson SA 2010

Modified neon implementation to fit Cortex A9 cache line size,
for those running 32 bytes L2 cache line size.
Also split the implementation in aligned and unaligned access,
for those that allows unaligned memory access with Neon.
For totally aligned operations, arm-only code is used.

Change-Id: I95ebf6164cd6486b12a7e3e98e369db21e7e18d2
Author: Henrik Smiding henrik.smiding@stericsson.com for ST-Ericsson.
Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
bionic: Make use of new memcpy, tweak settings

The new memcpy() is slightly faster than the cortex-strings version,
and fixes the Galaxy Nexus camera issue.

Change-Id: Ie65d14992a399e9bc2709a3d710d52b5b1a62e87
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
add back bzero

Signed-off-by: Stevespear426 <stephen.k.spear@gmail.com>
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

Conflicts:
	libc/Android.mk
	libm/Android.mk
	libm/arm/e_pow.S
	libm/src/e_pow.c
bionic: Optimizations for gettimeofday and clock_gettime.

Use the kernel user helper feature to calculate the results
of gettimeofday and clock_gettime without actually calling
into kernel space. If the user helper patches have not been
applied to the kernel, the regular system calls are used as
a fallback.

Change-Id: I3aebc6ac19ab4743725648a1a279819e624cc5c4
Fix perf regression on Cortex A15 by optimized memcpy for Cortex A9

The new Cortex A9 optimized memcpy included an arm-only version that is
slower than the current neon Cortex A15. This arm-only version was used
when the dst was aligned to an 8 byte boundary, otherwise, the original
neon only version was used. This change modifies the code so it always
uses the neon only version for the Cortex A15. It also fixes the use of
a define removed with the previous optimization.

Change-Id: I971527568a177218cd8b76a8bd160aaaf6ea1e42
Fix Build Blame BMC and Nocoast!

Signed-off-by: Stevespear426 <stephen.k.spear@gmail.com>