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>
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 new header files for graphics

The header files "hwmem.h" and "b2r2_blt.h" are needed
by the ST-Ericsson graphics implementation.

Signed-off-by: Patrik Ryd <patrik.ryd@stericsson.com>
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>
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>
Add missing define to build qcom libgralloc.

This is needed by hardware/qcom/display/libgralloc/ashmemalloc.cpp.

Change-Id: I7b35bcdaedf3874d17a0e6ce18931c11db1e133d
headers: Unbreak some ARM syscalls

Restore the outside-kernel exclusion for some syscalls that was
removed by change I959b64280e184655ef8c713aa79f9e23cb1f7df4,
since these syscalls are used elsewhere.

Change-Id: I5b5bf3d78edd137e820d25281a375966b6c009ec
linker: restore prelink support

Prelink support is required to load old vendor binary blobs
on many devices properly

This commit partially reverts 4688279db5dcc4004941e7f133c4a1c3617d842c

Change-Id: Ibc835095579c0bbd18aff61f37bd420de353e94d
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
Revert "bionic: Add ARMv7 optimized string handling routines"

This reverts commit 74beb12410bd700375138c991e40c60810d67d6a.
Revert "libm: Add a proper sincos() implementation"

This reverts commit 758630b4242db1926f867faba1f7c532abab9ba5.
msm8960: Improve performance of memmove, bcopy, and memmove_words

Change-Id: I62b3da046889387f835da741110d35ffd3c8f806
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
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 bit-for-bit
accuracy with existing algorithm.

Change-Id: Icbd6d66fb1c0ceb53f43fed6541e0c89cc6e7a63