120707 Commits

Author SHA1 Message Date
Neil Fuller
dfcf065505 am 09fd5a18: Merge "Replacing FloatMath native implementation with calls to Math"
* commit '09fd5a1873fa1ab51f4e428b1b909fea35091a51':
  Replacing FloatMath native implementation with calls to Math
2014-10-20 10:10:34 +00:00
Neil Fuller
09fd5a1873 Merge "Replacing FloatMath native implementation with calls to Math" 2014-10-20 10:08:11 +00:00
Nick Kralevich
7b3db39aa4 Replacing FloatMath native implementation with calls to Math
On modern versions of Android running in AOT mode
FloatMath is slower than Math. Calls to Math.sqrt(),
etc. are replaced by intrinsics which can be as small
as a single CPU opcode.

When running in interpreted mode the new
implementation is unfortunately slower, but I'm
judging this acceptable and likely to be improved
over time. This change saves a small amount of native
code.

Example timings:

Mako AOSP AOT:

Method: Original / New / Direct call to Math
ceil: 596ns / 146.ns / 111ns
sqrt: 694ns / 56ns / 25ns

Mako AOSP interpreted:

Method: Original / New / Direct call to Math
ceil: 1900ns / 2307ns / 1485ns
sqrt: 1998ns / 2603ns / 1788ns

Other calls Mako AOT:

Method: Original / New
cos: 635ns / 270ns
exp: 566ns / 324ns
floor: 604ns / 150ns
hypot: 631ns / 232ns
pow: 936ns / 643ns
sin: 641ns / 299ns

The advice to use Math directly, in preference to
FloatMath, is still good. FloatMath will be deprecated
separately.

Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: If07fcbd78543d13bc6d75f9743f999860e8d58d7
2014-10-20 09:24:11 +01:00
Elliott Hughes
84e6d466ed am 4cd671e4: Merge "Revert "Replacing FloatMath native implementation with calls to Math""
* commit '4cd671e4d27befdd576fa86051956c3cafad6808':
  Revert "Replacing FloatMath native implementation with calls to Math"
2014-10-18 20:48:03 +00:00
Elliott Hughes
4cd671e4d2 Merge "Revert "Replacing FloatMath native implementation with calls to Math"" 2014-10-18 20:43:07 +00:00
Elliott Hughes
b3b68d0333 Revert "Replacing FloatMath native implementation with calls to Math"
This reverts commit 32b88b48daa7383880088246d7222dd93cf55285.

Change-Id: I40ea17f3a68f2b53eb013aebd3ba1becdc724f94
2014-10-18 20:41:27 +00:00
Neil Fuller
9b0109eb05 am c7aa8fe6: Merge "Removing some more FloatMath references"
* commit 'c7aa8fe62356fc09962941140c8bb7ed8bab2f8f':
  Removing some more FloatMath references
2014-10-17 14:54:17 +00:00
Neil Fuller
c7aa8fe623 Merge "Removing some more FloatMath references" 2014-10-17 14:48:17 +00:00
Dan Albert
b973422804 am 69c8d39d: Merge "Clean up unused parameter warnings."
* commit '69c8d39d1f9ebb55844ad7794d12fedf8b5be5bf':
  Clean up unused parameter warnings.
2014-10-17 07:38:20 +00:00
Dan Albert
69c8d39d1f Merge "Clean up unused parameter warnings." 2014-10-17 00:03:06 +00:00
Dan Albert
692018430f Clean up unused parameter warnings.
Change-Id: Ifbf310a0c10bd6afc3099bcad1026990bd1e6a22
2014-10-16 16:55:29 -07:00
Neil Fuller
8a3785cafe am fd2d41b7: Merge "Replacing FloatMath native implementation with calls to Math"
* commit 'fd2d41b742339d278f4a66f78a7c161108985ed8':
  Replacing FloatMath native implementation with calls to Math
2014-10-16 09:24:18 +00:00
Neil Fuller
fd2d41b742 Merge "Replacing FloatMath native implementation with calls to Math" 2014-10-16 08:16:24 +00:00
Chih-Hung Hsieh
57622210fb am e67bc0c9: (-s ours) Merge "Fix log call output format error. (DO NOT MERGE)"
* commit 'e67bc0c96733cee01e6f3027d9e6243f10ebbe40':
  Fix log call output format error. (DO NOT MERGE)
2014-10-15 17:09:03 +00:00
Chih-Hung Hsieh
e67bc0c967 Merge "Fix log call output format error. (DO NOT MERGE)" 2014-10-15 17:03:07 +00:00
Chih-Hung Hsieh
e07c9f140e Fix log call output format error. (DO NOT MERGE)
Cherry picked from googleplex-android c/445200.

BUG: 17916851
Change-Id: If4077e94d6dc7ef31ecf09cbcf41091c7e30268f
2014-10-15 16:48:22 +00:00
Neil Fuller
1802567a79 am e4625cc1: Merge "Fix Time docs to document various error cases"
* commit 'e4625cc1a861615f4b3447e2a4d4990590d51470':
  Fix Time docs to document various error cases
2014-10-15 16:01:01 +00:00
Neil Fuller
e4625cc1a8 Merge "Fix Time docs to document various error cases" 2014-10-15 15:56:06 +00:00
Neil Fuller
7079f2003c Fix Time docs to document various error cases
Bug: https://code.google.com/p/android/issues/detail?id=76386
Change-Id: Ibb71405b70453d5abaf45426ec4e36261b6695cf
2014-10-15 12:08:05 +01:00
Neil Fuller
32b88b48da Replacing FloatMath native implementation with calls to Math
On modern versions of Android running in AOT mode
FloatMath is slower than Math. Calls to Math.sqrt(),
etc. are replaced by intrinsics which can be as small
as a single CPU opcode.

When running in interpreted mode the new
implementation is unfortunately slower, but I'm
judging this acceptable and likely to be improved
over time. This change saves a small amount of native
code.

Example timings:

Mako AOSP AOT:

Method: Original / New / Direct call to Math
ceil: 596ns / 146.ns / 111ns
sqrt: 694ns / 56ns / 25ns

Mako AOSP interpreted:

Method: Original / New / Direct call to Math
ceil: 1900ns / 2307ns / 1485ns
sqrt: 1998ns / 2603ns / 1788ns

Other calls Mako AOT:

Method: Original / New
cos: 635ns / 270ns
exp: 566ns / 324ns
floor: 604ns / 150ns
hypot: 631ns / 232ns
pow: 936ns / 643ns
sin: 641ns / 299ns

The advice to use Math directly, in preference to
FloatMath, is still good. FloatMath will be deprecated
separately.

Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: I8d1947d88b3c576643138b1df589fb9da7c1ab88
2014-10-15 11:47:58 +01:00
Neil Fuller
6de42dac43 Removing some more FloatMath references
See frameworks/base commit 33253a4baa6279f81a73425b49dfb6abe5f5416e
for details.

Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: I46d4ee4c4be7972e3bcc6782fb50f024b6fff1ee
2014-10-15 11:45:45 +01:00
Dmitriy Ivanov
d1e735ef54 am ed583f5e: Merge "Link sigchain to main executable"
* commit 'ed583f5ed97c40951341d5750ecb73be6b10579f':
  Link sigchain to main executable
2014-10-14 17:43:28 +00:00
Dmitriy Ivanov
ed583f5ed9 Merge "Link sigchain to main executable" 2014-10-14 17:37:34 +00:00
Dmitriy Ivanov
96e0cfa721 Link sigchain to main executable
Also export necessary symbols to preempt calls from
 libart.so

Bug: 15345057
Bug: 15426766
Change-Id: If0b7f59a59824e30aa0c33dad76c7a44932180de
2014-10-09 15:03:07 -07:00
Elliott Hughes
b68fe9e5f3 am ae1b6805: Merge "Track change to private libcore data structure."
* commit 'ae1b6805a2609759186af8d7131c4750e011019a':
  Track change to private libcore data structure.
2014-10-09 18:13:54 +00:00
Elliott Hughes
ae1b6805a2 Merge "Track change to private libcore data structure." 2014-10-09 18:08:58 +00:00
Elliott Hughes
d47acaeecd Track change to private libcore data structure.
Bug: 15476051
Change-Id: I4e28ecfa3a1d03c21f9bbde7f3daf79a79d96fe6
2014-10-08 16:07:33 -07:00
Glenn Kasten
1c92912bcb am 6ba13ac5: Merge "AudioService: Fix monitorRotation for landscape applications"
* commit '6ba13ac56663a45a7f16feb465d451f0180fae26':
  AudioService: Fix monitorRotation for landscape applications
2014-10-02 16:23:36 +00:00
Glenn Kasten
6ba13ac566 Merge "AudioService: Fix monitorRotation for landscape applications" 2014-10-02 16:19:12 +00:00
Neil Fuller
ee665151a4 am 0c1faf43: Merge "Switch from FloatMath -> Math and Math.hypot where possible"
* commit '0c1faf43aecadc37b78c4ad6cb669eb351d21385':
  Switch from FloatMath -> Math and Math.hypot where possible
2014-10-02 10:18:29 +00:00
Neil Fuller
0c1faf43ae Merge "Switch from FloatMath -> Math and Math.hypot where possible" 2014-10-02 10:14:19 +00:00
Andreas Gampe
152d9aae63 am 31629651: Merge "Frameworks/base: Fix more aapt issues"
* commit '316296511bf12c4e14dfb6f54731d1a515114abf':
  Frameworks/base: Fix more aapt issues
2014-10-02 07:01:55 +00:00
Andreas Gampe
316296511b Merge "Frameworks/base: Fix more aapt issues" 2014-10-02 06:58:39 +00:00
Andreas Gampe
b8dc7bc582 Frameworks/base: Fix more aapt issues
Change-Id: I6da7dc674e9f9e3b0886a3cfd1e3194d6b5ac948
2014-10-01 20:42:00 -07:00
Andreas Gampe
1dcc75b2db am 0ce259c2: Merge "Frameworks/base: Fix AAPT warnings"
* commit '0ce259c2f69cefd09342a95fbbd4c1a63a0af484':
  Frameworks/base: Fix AAPT warnings
2014-10-01 23:38:25 +00:00
Andreas Gampe
0ce259c2f6 Merge "Frameworks/base: Fix AAPT warnings" 2014-10-01 23:34:31 +00:00
Andreas Gampe
2412f84064 Frameworks/base: Fix AAPT warnings
Turn on -Wall -Werror. Fix warnings.

Change-Id: I287fb3c1e851c654479bcf9ea8c73bd354a6b2a1
2014-10-01 16:18:06 -07:00
Dan Albert
fe50cfd533 am c46dbe8a: Merge "Use std::sort instead of qsort_r wrapper."
* commit 'c46dbe8ac4748a0084b026524ad9e5ac44fb9fde':
  Use std::sort instead of qsort_r wrapper.
2014-10-01 20:34:15 +00:00
Dan Albert
c46dbe8ac4 Merge "Use std::sort instead of qsort_r wrapper." 2014-10-01 20:30:52 +00:00
Dan Albert
0de19adc80 Use std::sort instead of qsort_r wrapper.
The HAVE_(BSD|GNU)_QSORT_R in AndroidConfig.h has never worked, and we
should just be using something standard anyway.

Change-Id: I784d6212f6c890a11c4af2f83d1ce2d279708652
2014-10-01 11:34:17 -07:00
Neil Fuller
33253a4baa Switch from FloatMath -> Math and Math.hypot where possible
The motivation is an API change: FloatMath is going to be
deprecated and/or removed. Performance is not the goal of
this change.

That said...

Math is faster than FloatMath with AOT compilation.

While making the change, occurances of:

{Float}Math.sqrt(x * x + y * y) and
{Float}Math.sqrt({Float}Math.pow(x, 2) + {Float}Math.pow(y, 2))

have been replaced with:

{(float)} Math.hypot(x, y)

Right now there is no runtime intrinsic for hypot so is not faster
in all cases for AOT compilation:

Math.sqrt(x * x + y * y) is faster than Math.hypot(x, y) with
AOT, but all other combinations of FloatMath, use of pow() etc.
are slower than hypot().

hypot() has the advantage of being self documenting and
could be optimized in future. None of the behavior differences
around NaN and rounding appear to be important for the cases
looked at: they all assume results and arguments are in range
and usually the results are cast to float.

Different implementations measured on hammerhead / L:

AOT compiled:

[FloatMath.hypot(x, y)]
benchmark=Hypot_FloatMathHypot} 633.85 ns; σ=0.32 ns @ 3 trials

[FloatMath.sqrt(x*x + y*y)]
benchmark=Hypot_FloatMathSqrtMult} 684.17 ns; σ=4.83 ns @ 3 trials

[FloatMath.sqrt(FloatMath.pow(x, 2) + FloatMath.pow(y, 2))]
benchmark=Hypot_FloatMathSqrtPow} 1270.65 ns; σ=12.20 ns @ 6 trials

[(float) Math.hypot(x, y)]
benchmark=Hypot_MathHypot} 96.80 ns; σ=0.05 ns @ 3 trials

[(float) Math.sqrt(x*x + y*y)]
benchmark=Hypot_MathSqrtMult} 23.97 ns; σ=0.01 ns @ 3 trials

[(float) Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))]
benchmark=Hypot_MathSqrtPow} 156.19 ns; σ=0.12 ns @ 3 trials

Interpreter:

benchmark=Hypot_FloatMathHypot} 1180.54 ns; σ=5.13 ns @ 3 trials
benchmark=Hypot_FloatMathSqrtMult} 1121.05 ns; σ=3.80 ns @ 3 trials
benchmark=Hypot_FloatMathSqrtPow} 3327.14 ns; σ=7.33 ns @ 3 trials
benchmark=Hypot_MathHypot} 856.57 ns; σ=1.41 ns @ 3 trials
benchmark=Hypot_MathSqrtMult} 1028.92 ns; σ=9.11 ns @ 3 trials
benchmark=Hypot_MathSqrtPow} 2539.47 ns; σ=24.44 ns @ 3 trials

Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: I06c91f682095e627cb547d60d936ef87941be692
2014-10-01 14:04:15 +01:00
Elliott Hughes
ee7684cad0 am 04517286: Merge "Use strerror(3) when reporting zygote failures."
* commit '0451728645d559d904f579894d4b59e971e2369e':
  Use strerror(3) when reporting zygote failures.
2014-09-30 17:10:00 +00:00
Elliott Hughes
0451728645 Merge "Use strerror(3) when reporting zygote failures." 2014-09-30 17:03:37 +00:00
Elliott Hughes
960e83185e Use strerror(3) when reporting zygote failures.
Bug: 17700596
Change-Id: I39a72ab6f19063de3c90c9fccdb749dc9a86324e
2014-09-30 08:49:01 -07:00
Andreas Gampe
6290c048e1 am 207cffe9: Merge "Frameworks/base: Fix services/jni warnings"
* commit '207cffe95a868ea21b74dd54e3ef7821162ce870':
  Frameworks/base: Fix services/jni warnings
2014-09-29 20:43:15 +00:00
Andreas Gampe
207cffe95a Merge "Frameworks/base: Fix services/jni warnings" 2014-09-29 18:10:26 +00:00
Dan Albert
c20a4bd1a4 am d7baaed8: Merge "Allow AOSP to boot."
* commit 'd7baaed89e498ad3cf7d9c487d6cae967e562ea4':
  Allow AOSP to boot.
2014-09-25 19:00:34 +00:00
Dan Albert
d7baaed89e Merge "Allow AOSP to boot." 2014-09-25 18:50:18 +00:00
Dan Albert
e08bd64184 Allow AOSP to boot.
HAVE_OOM_ADJ is really __linux__, and this code should never be run on
another platform.

Bug: 17641445
Change-Id: Ib8174106b6d03c9c2429794a4f582c09cb308646
2014-09-25 11:48:11 -07:00
Andreas Gampe
26872f4b9e Frameworks/base: Fix services/jni warnings
Update code for unused variables.

Ignore warnings generated by pulling in Skia.

Change-Id: I5b33c9b003c90bcabcea0761304c4c99cf5e39ec
2014-09-25 11:45:07 -07:00