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 scores

Change-Id: I97e0712daeb2740764b26a44be0caaa39c481453
(cherry picked from commit df58b162751ccad4f6a9dee1d4d8cdb5aeef39f9)
(cherry picked from commit 844736c1cd73f0118cdeb2f322c84efba0793f54)
(cherry picked from commit 8b74afbad26480891890586e811b5167f43ec28c)
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: I8424e0e82a19d35e7e3b6e3e122dcdecdd5426fd
(cherry picked from commit a8ed843c678e2a4019c0b88a7a11ff8e3bdb4f70)
(cherry picked from commit 7cbe6a43c3152147f581cb1423bd14582619a2af)
(cherry picked from commit 885827b36a52939f2434b19d458fc9c18680e54f)
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: I76095f4a006e2fb01a53943b66fd69bfa1fd3033
(cherry picked from commit 5f0ee8c38363ecb99f7ceb487583b5e7152e63ce)
(cherry picked from commit f4a020fad7881195bff087b5803e4a7b528b81f1)
(cherry picked from commit 22157646da56cba346893ea17a1de5e4fd689b53)
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: Ia093f420e58e794635e3a5f09e8236ae7601f1f6
(cherry picked from commit 19a356a1ed6384a9161739d5833cf5cfd88a8d3b)
(cherry picked from commit 1c9bdcfa6a68cd1a13a1e3b1a51616bddffeefad)
(cherry picked from commit cdaad8ab61325e958926b57a6a726d0cfa6f7511)
libm: sqrt and sqrtf via ARM vsqrt instruction

Optimized sqrt and sqrtf for arm by using hardware
opcode for sqrt rather than generic slow portable
code.

Change-Id: I84694159577aef6418710548085d8149c45e0e3f
(cherry picked from commit 434d98cd36cdd2514a7118e69624e5d205ca849a)
(cherry picked from commit 5fe41e6f146bcadd4904da26351c646cdc90d196)
(cherry picked from commit e314f75340c8e818b17373314ceb54039fcd76ad)
libm: optimistic pow calling.

Call optimized pow optimistically and revert to full range
implementation if we detect an out-of-range input.

Change-Id: I6f3aa734adbf99484b7ff70736ef83a41e5815b8
(cherry picked from commit e7fd29685a75f1d26061ac511e7a29479fd871b5)
(cherry picked from commit 7916899916973ca5695526ae45283e54709df32a)
(cherry picked from commit d39a7f744c78409949482e3cb3c9710e8f281a33)
Bionic/libm: enable optimized math functions on more QCOM targets.

allow more QCOM targets to use optimized math functions.

Change-Id: I76ee1bf951ae1c8397fef3af6e9937ed8cad9b62
(cherry picked from commit a7b5a06b144c96324db2370bd63b83c81d41ddc3)
(cherry picked from commit 8ccd613ff555349e0751659ebe03c182dae9a2eb)
(cherry picked from commit ccd4b1db5b225b0b4913b80b014f1c2f99c6fdff)
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: I1895db385c9616cdae9ab6403f392dfbae292adc
(cherry picked from commit 1d0c5a9fe67141515fa54403d985828590f9c206)
(cherry picked from commit ca46b68c30cf470464ffac530b8bdba242cc5c17)
(cherry picked from commit d7acb8827620ab7331995e843fd79015aed84996)
libm: krait: Fix build warning for e_pow.o

e_pow.o given more than once in the same rule. Remove extra arm/e_pow.S
reference in libm/Android.mk.

(cherry picked from commit a730ffa1195ad85a0e77afc9bf2cb78754b5985c)

Change-Id: I5a4c38e838978e0538697c8a5df1e97f1175e39e
(cherry picked from commit 1002139bee177b90dc011b8ac9f24c4696cf82b6)
(cherry picked from commit 99146f7c6c1ee984608ad705b67f562fb9006cd0)
Add cortex-a5 cpu variant

Change-Id: I0f8e759d83a23f9d9cdfe0e4cb8224e13cf6da21
linker: restore prelink support

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

This commit partially reverts 4688279db5dcc4004941e7f133c4a1c3617d842c

Picked from android-4.3. This solves Baseband issue on legacy devices.

Change-Id: Ic32ed1a5f851c0d03951ad0ef16ec51942ba033f
libc: krait: Use performance version of bcopy and memmove

Ported from CM10.2.

bionic-benchmarks on mako:
before:
                     iterations      ns/op
BM_string_memmove/8    50000000         32   243.54 MiB/s
BM_string_memmove/64   20000000        143   446.41 MiB/s
BM_string_memmove/512    2000000        885   578.14 MiB/s
BM_string_memmove/1K    1000000       1733   590.55 MiB/s
BM_string_memmove/8K     200000      13618   601.54 MiB/s
BM_string_memmove/16K     100000      27276   600.66 MiB/s
BM_string_memmove/32K      50000      59115   554.30 MiB/s
BM_string_memmove/64K      10000     118162   554.63 MiB/s

after:
                     iterations      ns/op
BM_string_memmove/8    50000000         20   381.94 MiB/s
BM_string_memmove/64  100000000         17  3636.07 MiB/s
BM_string_memmove/512   50000000         50 10116.80 MiB/s
BM_string_memmove/1K   20000000         98 10429.23 MiB/s
BM_string_memmove/8K    2000000        876  9346.43 MiB/s
BM_string_memmove/16K    1000000       1836  8923.09 MiB/s
BM_string_memmove/32K     500000       4392  7459.79 MiB/s
BM_string_memmove/64K     200000       8562  7653.85 MiB/s

Change-Id: Id64913a71857d9cfdf6bd1bbe2c66cfc49d72748
bionic: Fix aliasing violations.
Disable LTO for libc and libdl. They don't play nice.
Add __popcountsi2 to the function compat list.

This is needed if we use Clang to compile Bionic, which won't include
__popcountsi2 anymore as Clang generates inline instructions. However
prebuilt binary blobs still depend on libc.so to resolve __popcountsi2.

Change-Id: I9001a3884c4be250c0ceebcd79922783fae1a0b7
Re-export libgcc's __aeabi_uidivmod and __popcount_tab

This is required to make the Nexus 10 graphics driver work on a system
compiled with gcc 4.9.

Change-Id: If3f3d488652a736d9ea3e583548d74fae3ffa902
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
Add all implicitly loaded symbols from libgcc.a into libgcc_compat.c.

Change-Id: I0e66a73e849a01817d016a688d7291c2fb604e48
libm: Fix multiple inclusion warning

Change-Id: Ifa732ec52fb582c34512cd1d09d918199ae7395e
Add Scorpion TARGET_CPU_VARIANT

Change-Id: I7e814f29681097e6b56fba61b1041e0bc42b3726
Upgrade to tzdata2014b.

From the release notes:

  Changes affecting near-future time stamps

    Crimea switches to Moscow time on 2014-03-30 at 02:00 local time.
    (Thanks to Alexander Krivenyshev.)  Move its zone.tab entry from UA
    to RU.

    New entry for Troll station, Antarctica.  (Thanks to Paul-Inge
    Flakstad and Bengt-Inge Larsson.)  This is currently an
    approximation; a better version will require the zic and localtime
    fixes mentioned [in the full release notes], and the plan is to wait
    for a while until at least the zic fixes propagate.

Change-Id: Ib00f6cbc7b92e26822792b45e53a5f5381e0f6bf
(cherry picked from commit fe6adbad196504650c555bb4ae90dc969b3403e6)