History log of /art/compiler/optimizing/intrinsics_mips64.cc
Revision Date Author Comments
5863f85483c8cc0f21adbd44698fa1018c72f9f7 23-Mar-2017 Chris Larsen <chris.larsen@imgtec.com> MIPS64: java.lang.System.arraycopy() for copying char[] to char[].

Test: run-test --64 --no-prebuild --optimizing 011-array-copy
Test: run-test --64 --no-prebuild 011-array-copy
Test: run-test --64 --optimizing 011-array-copy
Test: run-test --64 011-array-copy
Test: ART_TEST_OPTIMIZING=true test-art-target-run-test
Test: booted MIPS64R6 emulator.

Change-Id: I418571c639b2776869b3c8f3f67c09aadbb30133
716d0738c0ed8f924a44e5c645fa89c1a6079c95 07-Apr-2017 Goran Jakovljevic <Goran.Jakovljevic@imgtec.com> MIPS64: Fix Math.ceil/floor intrinsics

The latest MIPS64R6 emulator supports NAN2008 standard. When
FCSR.NAN2008=1 (required from R6) ceil.l.d and floor.l.d instructions
will return -2^63 when the input value is smaller than -2^63. This
wasn't the case when FCSR.NAN2008=0. In that case, result from the
instructions was 2^63-1 when the input value was smaller than -2^63.

This fixes test 082-inline-execute.

Test: ./testrunner.py --target --optimizing --64 -j1 (in QEMU)

Change-Id: I3d2cdd1d55b3694549f88f4f5b903a0c4f1c0d09
74c2058ed83f43aa59f467ac4ecc730edbe42e41 29-Mar-2017 Chris Larsen <chris.larsen@imgtec.com> MIPS64: Add direct calls to math intrinsics.

- cos - sin - acos - asin
- atan - atan2 - cbrt - cosh
- exp - expm1 - hypot - log
- log10 - nextAfter - sinh - tan
- tanh

Test: run-test --64 --no-prebuild --optimizing 123-inline-execute2
Test: run-test --64 --no-prebuild 123-inline-execute2
Test: run-test --64 --optimizing 123-inline-execute2
Test: run-test --64 123-inline-execute2
Test: Booted MIPS64R6 emulator.

Change-Id: I989a5469e6732dd42f39e8305c3d12c32a75eab4
1595815c2a914a78df7dfb6f0082f47d4e82bb36 10-Feb-2017 Alexey Frunze <Alexey.Frunze@imgtec.com> MIPS: Implement read barriers.

This is the core functionality. Further improvements
will be done separately.

This also adds/moves memory barriers where they belong and
removes the UnsafeGetLongVolatile and UnsafePutLongVolatile
MIPS32 intrinsics as they need to load/store a pair of
registers atomically, which is not supported directly by
the CPU.

Test: booted MIPS32R2 in QEMU
Test: test-art-target-run-test
Test: booted MIPS64 (with 2nd arch MIPS32R6) in QEMU
Test: "testrunner.py --target --optimizing -j1"
Test: same MIPS64 boot/test with ART_READ_BARRIER_TYPE=TABLELOOKUP
Test: "testrunner.py --target --optimizing --32 -j2" on CI20
Test: same CI20 test with ART_READ_BARRIER_TYPE=TABLELOOKUP

Change-Id: I0ff91525fefba3ec1cc019f50316478a888acced
366d43387f8e31fb64b31419126c88d36b6ca491 23-Mar-2017 Chris Larsen <chris.larsen@imgtec.com> MIPS64: Remove memcpy() from java.lang.String.getChars intrinsic.

Test: run-test --64 --optimizing 020-string
Test: run-test --64 020-string
Test: run-test --64 --no-prebuild --optimizing 020-string
Test: run-test --64 --no-prebuild 020-string
Test: mma -j2 ART_TEST_OPTIMIZING=true test-art-target-run-test
Test: mma test-art-target-gtest -j2
Test: booted MIPS64R6 emulator.

Note: All tests run against MIPS64 QEMU.

Change-Id: I8ad3e39c66a489779476f7e9f9f88cd0c6270c20
331605a7ba842573b3876e14c933175382b923c8 01-Mar-2017 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Intrinsify Integer.valueOf.""

Fix heap poisoning.
LOG INFO instead of ERROR to avoid run-test failures with --no-image.

bug:30933338
Test: ART_HEAP_POISONING=true test-art-host test-art-target

This reverts commit db7b44ac3ea80a722aaed12e913ebc1661a57998.

Change-Id: I0b7d4f1eb11c62c9a3df8e0de0b1a5d8af760181
db7b44ac3ea80a722aaed12e913ebc1661a57998 28-Feb-2017 Nicolas Geoffray <ngeoffray@google.com> Revert "Intrinsify Integer.valueOf."

Heap poisoning missing
jit-gcstress not optimizing it.

bug:30933338

This reverts commit cd0b27287843cfd904dd163056322579ab4bbf27.

Change-Id: I5ece1818afbca5214babb6803f62614a649aedeb
64fa84fba1d46afd5a2dc7dc3cc1de77461888bc 27-Feb-2017 Goran Jakovljevic <Goran.Jakovljevic@imgtec.com> Apply String.equals() optimizations on MIPS32 and MIPS64

Also extended test 536-checker-intrinsic-optimization.

Test: mma test-art-target-run-test in QEMU (MIPS64R6 and MIPS32R6)
Test: mma test-art-target-run-test on CI20 (MIPS32R2)

Change-Id: I6bff42f81dcb05094ac698181df16c56193bb4a8
cd0b27287843cfd904dd163056322579ab4bbf27 23-Feb-2017 Nicolas Geoffray <ngeoffray@google.com> Intrinsify Integer.valueOf.

Improves performance of ArrayListStress and Ritz by ~10% and ~3%.

Test: test-art-host test-art-target
bug: 30933338

Change-Id: I639046e3a18dae50069d3a7ecb538a900bb590a1
c061de1236e98fdd34d0214a9bbcc0e2149ff226 14-Feb-2017 Alexey Frunze <Alexey.Frunze@imgtec.com> MIPS: Implement heap poisoning in ART's Optimizing compiler.

This is in preparation for read barrier support.

Bug: 12687968

Test: test-art-host-gtest
Test: booted MIPS32R2 in QEMU
Test: test-art-target
Test: booted MIPS64 (with 2nd arch MIPS32R6) in QEMU
Test: test-art-target (both MIPS64R6 and MIPS32R6)

Note: built with ART_HEAP_POISONING=true.

Change-Id: I0e6e04ff8de2fc8ca6126388409fa218e6920734
f94fa81e20d00929ef52707cd577353b95d40284 10-Feb-2017 Goran Jakovljevic <Goran.Jakovljevic@imgtec.com> String Compression for MIPS32 and MIPS64

Changes on intrinsics and Code Generation on MIPS32 and MIPS64 for
string compression feature.

Testing is done with STRING_COMPRESSION_ENABLED = true (in libcore),
mirror::kUseStringCompression = true and STRING_COMPRESSION_FEATURE set
to 1.

Test: booted MIPS32 and MIPS64 in QEMU
Test: mma test-art-target-run-test on CI20 (MIPS32R2)
Test: mma test-art-target-run-test in QEMU (MIPS64R6)

Change-Id: If50a6b6c0792bfa34d4fdff6bf2c7542211d2689
5e8d5f01b0fe87a6c649bd3a9f1534228b93423d 18-Oct-2016 Roland Levillain <rpl@google.com> Fix some typos in ART.

Test: m build-art-host
Test: m cpplint-art
Change-Id: Ifc6ce3d0d645c4a8dca72dd483fc03fc05077130
e36605910cb13da1440fb9d7a8293842a9209c97 09-Nov-2016 Chris Larsen <chris.larsen@imgtec.com> MIPS64: java.lang.String.getChars

Test: run-test --64 --optimizing 020-string
Test: run-test --64 020-string
Test: run-test --64 --no-prebuild --optimizing 020-string
Test: run-test --64 --no-prebuild 020-string
Test: run-test --64 --optimizing 082-inline-execute
Test: run-test --64 082-inline-execute
Test: run-test --64 --no-prebuild --optimizing 082-inline-execute
Test: run-test --64 --no-prebuild 082-inline-execute
Test: mma -j2 ART_TEST_OPTIMIZING=true test-art-target-run-test
Test: mma test-art-target-gtest -j2
Test: booted MIPS64R6 emulator.

Note: All tests run against MIPS64 QEMU.

Change-Id: I48b9a87465f2516044a2e4f598cc5dce56b0d1c9
71bf7b43380eb445973f32a7f789d9670f8cc97d 16-Nov-2016 Aart Bik <ajcbik@google.com> Optimizations around escape analysis. With tests.

Details:
(1) added new intrinsics
(2) implemented optimizations
more !can be null information
more null check removals
replace return-this uses with incoming parameter
remove dead StringBuffer/Builder calls (with escape analysis)
(3) Fixed exposed bug in CanBeMoved()

Performance gain:
This improves CafeineString by about 360%
(removes null check from first loop, eliminates second loop completely)

Test: test-art-host

Change-Id: Iaf16a1b9cab6a7386f43d71c6b51dd59600e81c1
ff7d89c0364f6ebd0f0798eb18ef8bd62917de6a 07-Nov-2016 Aart Bik <ajcbik@google.com> Allow read side effects for removing dead instructions.

Rationale:
Instructions that only have the harmless read side effect may
be removed when dead as well, we were too strict previously.
As proof of concept, this cl also provides more accurate information
on a few string related intrinsics. This removes the dead indexOf
from CaffeineString (17% performance improvement, big bottleneck
of the StringBuffer's toString() still remains in loop).

Test: test-art-host
Change-Id: Id835a8e287e13e1f09be6b46278a039b8865802e
68db2a9514d67708a21bb0975aee4c5d1c2bf49e 15-Sep-2016 Chris Larsen <chris.larsen@imgtec.com> MIPS64: Fix overlapping use of "in" & "out" registers.

Test: Boot MIPS64 QEMU
Test: 568-checker-onebit

Change-Id: Ifc89fd8df674b1f3ffcdde52256a35b4a3562d45
fc734088e6656a918b6c75094eb942a22bd799e8 19-Jul-2016 Serban Constantinescu <serban.constantinescu@linaro.org> Extend the InvokeRuntime() changes to mips64.

Change-Id: I3f825746053b9288ca31ab5e823d6a1648dfd894
542451cc546779f5c67840e105c51205a1b0a8fd 26-Jul-2016 Andreas Gampe <agampe@google.com> ART: Convert pointer size to enum

Move away from size_t to dedicated enum (class).

Bug: 30373134
Bug: 30419309
Test: m test-art-host
Change-Id: Id453c330f1065012e7d4f9fc24ac477cc9bb9269
806f0122e923581f559043e82cf958bab5defc87 09-Mar-2016 Serban Constantinescu <serban.constantinescu@linaro.org> Add support for CallKind::kCallOnMainAndSlowPath

Some of the intrinsics call on both the main and slowpath. This patch
adds support for such a CallKind and marks the intrinsics accordingly.

This will be exercised by a later patch that refactors all the runtime
calls to use InvokeRuntime().

Please note that without this patch, the calls to ValidateInvokeRuntime()
exercised by the following patches would fail.

Change-Id: I450571b8b47280a004b714996189ba6db13fb57d
54ff482710910929900f8348a19c5b875e519237 07-Jul-2016 Serban Constantinescu <serban.constantinescu@linaro.org> Rename kCall to kCallOnMainOnly

This patch renames kCall to kCallOnMainOnly in preparation for
the next patch in this series which will be adding kCallOnMainAndSlowPath.

Note: With this patch there will be places where we use kCallOnMainOnly
even though we call on the slow path too. The next patch in this series
will fix that.

Test: ART host tests.
Change-Id: Iabfdb0901990d163be5d780f3bdd2fab6fa17b32
ab922503cee2b105dfd9dbdde9fb60c26a35d2df 15-Apr-2016 Chris Larsen <chris.larsen@imgtec.com> MIPS64: Highest/Lowest Bit Intrinsic Support

- int java.lang.Integer.highestOneBit(int)
- long java.lang.Long.highestOneBit(long)
- int java.lang.Integer.lowestOneBit(int)
- long java.lang.Long.lowestOneBit(long)

Change-Id: I0db7858542130d759ee7d17ecb1eadb7ec3dc04c
87f3fcbd0db352157fc59148e94647ef21b73bce 28-Apr-2016 Vladimir Marko <vmarko@google.com> Replace String.charAt() with HIR.

Replace String.charAt() with HArrayLength, HBoundsCheck and
HArrayGet. This allows GVN on the HArrayLength and BCE on
the HBoundsCheck as well as using the infrastructure for
HArrayGet, i.e. better handling of constant indexes than
the old intrinsic and using the HArm64IntermediateAddress.

Bug: 28330359
Change-Id: I32bf1da7eeafe82537a60416abf6ac412baa80dc
7adaab070bbe9783130e78eea163c459303c980b 21-Apr-2016 Chris Larsen <chris.larsen@imgtec.com> MIPS64: java.lang.Math.round

- int java.lang.Math.round(float)
- long java.lang.Math.round(double)

BUG=26327751

Change-Id: I8bb7a5f32375b06b886a0babf39eb3e20df3a085
da05108b17b020b28555a8d5db5caa42e4435981 17-May-2016 Vladimir Marko <vmarko@google.com> Clean up String.indexOf() intrinsics.

Additional cleanup after
https://android-review.googlesource.com/223260

Bug: 28330359
Change-Id: I88def196babec70123896ef581ec8d61bb1b9a9a
fb6c90a1d7c8333c74c09f64f7eb2f402c3ea002 06-May-2016 Vladimir Marko <vmarko@google.com> Improve String.indexOf() intrinsics.

If the code point input is a char, we don't need the slow
path. Also improve the slow-path check (if we do need it)
on arm and arm64 to avoid loading 0xffff into a register.

Bug: 28330359
Change-Id: Ie6514c16126717bb0b11e3c7ab2b60eaa70fed4c
7fda7854ed734c4cdc786e46fcfdaa71ec600ecf 22-Apr-2016 Chris Larsen <chris.larsen@imgtec.com> MIPS64: Implement bitCount intrinsics.

- int java.lang.Integer.bitCount(int)
- int java.lang.Long.bitCount(long)

Change-Id: If2390beeb5b900e8680ead1927e0455b35f1948a
ddc4055abab40740e689d91e9a4fe20a7b8e5d28 11-Mar-2016 Goran Jakovljevic <Goran.Jakovljevic@imgtec.com> MIPS: Don't use $t8 for calling entrypoints

When jumping to entrypoints, $t9 register must be used. Value of $gp
is calculated based on value from $t9 and it should contain the
address of the first instruction of the entrypoint.

This CL enables MIPS32 and MIPS64 to boot.

Change-Id: Idf0f7f479cceafabb88b1b087da190dbda86e1c3
f969a209c30e3af636342d2fb7851d82a2529bf7 09-Mar-2016 Roland Levillain <rpl@google.com> Fix and enable java.lang.StringFactory intrinsics.

The following intrinsics were not considered by the
intrinsics recognizer:
- StringNewStringFromBytes
- StringNewStringFromChars
- StringNewStringFromString
This CL enables them and add tests for them.

This CL also:
- Fixes the locations of the ARM64 & MIPS64
StringNewStringFromString intrinsics.
- Fixes the definitions of the FOUR_ARG_DOWNCALL macros on
ARM and x86, which are used to implement the
art_quick_alloc_string_from_bytes* runtime entry points.
- Fixes PC info (stack maps) recording in the
StringNewStringFromBytes, StringNewStringFromChars and
StringNewStringFromString ARM, ARM64 & MIPS64 intrinsics.

Bug: 27425743
Change-Id: I38c00d3f0b2e6b64f7d3fe9146743493bef9e45c
1193259cb37c9763a111825aa04718a409d07145 08-Mar-2016 Aart Bik <ajcbik@google.com> Implement the 1.8 unsafe memory fences directly in HIR.

Rationale:
More efficient since it exposes full semantics to
all operations on the graph and allows for proper
code generation for all architectures.

bug=26264765

Change-Id: Ic435886cf0645927a101a8502f0623fa573989ff
cf283daf579e9eda586f312c3fc89444601e2525 20-Jan-2016 Chris Larsen <chris.larsen@imgtec.com> MIPS32: java.lang.Thread, and java.lang.String intrinsics:

- Thread java.lang.Thread.currentThread()
- int java.lang.String.compareTo(String anotherString)
- int java.lang.String.indexOf(int ch)
- int java.lang.String.indexOf(int ch, int fromIndex)
- java.lang.StringFactory.newStringFromBytes(byte[] data,
int high,
int offset,
int byteCount)
- java.lang.StringFactory.newStringFromChars(int offset,
int charCount,
char[] data)
- java.lang.StringFactory.newStringFromString(String toCopy)

Change-Id: I96a06ff81e1e3bf18d45760282356854efaf4945
0e54c0160c84894696c05af6cad9eae3690f9496 04-Mar-2016 Aart Bik <ajcbik@google.com> Unsafe: Recognize intrinsics for 1.8 java.util.concurrent
With unit test.

Rationale:
Recognizing the 1.8 methods as intrinsics is the first step
towards providing efficient implementation on all architectures.
Where not implemented (everywhere for now), the methods fall back
to the JNI native or reference implementation.

NOTE: needs iam's CL first!

bug=26264765

Change-Id: Ife65e81689821a16cbcdd2bb2d35641c6de6aeb6
ddec7f9c117baa2b90d06ccfdb3460a4c5caf35f 16-Feb-2016 Chris Larsen <chris.larsen@imgtec.com> MIPS64: Implement isInfinite intrinsics.

- boolean java.lang.Float.isInfinite(float)
- boolean java.lang.Double.isInfinite(double)

Change-Id: I8e94a9cc462e6b1cf99bb14b17c1ff009c9c29a4
2f9fcc999fab4ba6cd86c30e664325b47b9618e5 02-Mar-2016 Aart Bik <ajcbik@google.com> Simplified intrinsic macro mechanism.

Rationale:
Reduces boiler-plate code in all intrinsics code generators.
Also, the newly introduced "unreachable" macro provides a
static verifier that we do not have unreachable and thus
redundant code in the generators. In fact, this change
exposes that the MIPS32 and MIPS64 rotation intrinsics
(IntegerRotateRight, LongRotateRight, IntegerRotateLeft,
LongRotateLeft) are unreachable, since they are handled
as HIR constructs for all architectures. Thus the code
can be removed.

Change-Id: I0309799a0db580232137ded72bb8a7bbd45440a8
42ad288254e660ad091d03fad8c8fbad1d34ec89 29-Feb-2016 Roland Levillain <rpl@google.com> Fix the signature of the IndexOf entry point.

The IndexOf entry point was declared as taking four
arguments (void*, uint32_t, uint32_t, uint32_t) whereas all
actual implementations use three arguments (void*, uint32_t,
uint32_t). As that fourth argument is not documented, drop
it from the intrinsic declaration to have it match the
implementations.

Change-Id: I65d747033192025ccd2b9a5e8f8ed05b77a21941
cc3839c15555a2751e13980638fc40e4d3da633e 29-Feb-2016 Roland Levillain <rpl@google.com> Improve documentation about StringFactory.newStringFromChars.

Make it clear that the native method requires its third
argument to be non-null, and therefore that the intrinsics
do not need a null check for it.

Bug: 27378573
Change-Id: Id2f78ceb0f7674f1066bc3f216b738358ca25542
2a6aad9d388bd29bff04aeec3eb9429d436d1873 25-Feb-2016 Aart Bik <ajcbik@google.com> Implement fp to bits methods as intrinsics.

Rationale:
Better optimization, better performance.

Results on libcore benchmark:

Most gain is from moving the invariant call out of the loop
after we detect everything is a side-effect free intrinsic.
But generated code in general case is much cleaner too.

Before:
timeFloatToIntBits() in 181 ms.
timeFloatToRawIntBits() in 35 ms.
timeDoubleToLongBits() in 208 ms.
timeDoubleToRawLongBits() in 35 ms.

After:
timeFloatToIntBits() in 36 ms.
timeFloatToRawIntBits() in 35 ms.
timeDoubleToLongBits() in 35 ms.
timeDoubleToRawLongBits() in 34 ms.

bug=11548336

Change-Id: I6e001bd3708e800bd75a82b8950fb3a0fc01766e
9cd6d378bd573cdc14d049d32bdd22a97fa4d84a 09-Feb-2016 David Srbecky <dsrbecky@google.com> Associate slow paths with the instruction that they belong to.

Almost all slow paths already know the instruction they belong to,
this CL just moves the knowledge to the base class as well.

This is needed to be be able to get the corresponding dex pc for
slow path, which allows us generate better native line numbers,
which in turn fixes some native debugging stepping issues.

Change-Id: I568dbe78a7cea6a43a4a71a014b3ad135782c270
b74353a6765447b1551b337fd76803eb6aa86b8b 20-Nov-2015 Chris Larsen <chris.larsen@imgtec.com> MIPS32: Implement intrinsics from java.lang.Math:

- abs(double) - abs(float) - abs(int)
- abs(long) - max(double, double) - max(float, float)
- max(int, int) - max(long, long) - min(double, double)
- min(float, float) - min(int, int) - min(long, long)
- sqrt(double)

The math intrinsics:

- ceil(double) - floor(double) - rint(double)
- round(double) - round(float)

aren't implemented because they require instructions which only exist
for MIPS64, or for MIPS32r6.

Change-Id: I943be3592b52a423fcb7ac40f46f38a5e2a58c50
75a38b24801bd4d27c95acef969930f626dd11da 17-Feb-2016 Aart Bik <ajcbik@google.com> Implement isNaN intrinsic through HIR equivalent.

Rationale:
Efficient implementation on all platforms.
Subject to better compiler optimizations.

Change-Id: Ie8876bf5943cbe1138491a25d32ee9fee554043c
a19616e3363276e7f2c471eb2839fb16f1d43f27 02-Feb-2016 Aart Bik <ajcbik@google.com> Implemented compare/signum intrinsics as HCompare
(with all code generation for all)

Rationale:
At HIR level, many more optimizations are possible, while ultimately
generated code can take advantage of full semantics.

Change-Id: I6e2ee0311784e5e336847346f7f3c4faef4fd17e
d967266cdfc8011c81ba6e9857a247c4a73bd0fc 03-Sep-2015 Lazar Trsic <Lazar.Trsic@imgtec.com> MIPS64: Remove unaligned memory access from art generated code

Unaligned memory access was caused by sd, ld, ldc1 and sdc1
instructions. Check if offset is unaligned and replace it
with two 32 bit memory accesses, if so.

Added assembler tests for new instructions, as well as assembler
tests for LoadFromOffset, LoadFpuFromOffset, StoreToOffset and
StoreFpuToOffset.

Change-Id: I0228a4a2ce6c801eeb5b46952b8330e14468deb3
59c9454b92c2096a30a2bbdffb64edf33dbdd916 25-Jan-2016 Aart Bik <ajcbik@google.com> Recognize common utilities as intrinsics.

Rationale:
Recognizing these method calls as intrinsics already has
major advantages (compiler knows about no-side-effects/no-throw
properties). Next step is, of course, to implement these
with native instructions on each architecture.

Change-Id: I06fd12973238caec00d67b31b195d7f8807a538e
8ed1826a9da054920f2d39d34dfc7ba43337e4c9 22-Jan-2016 Goran Jakovljevic <Goran.Jakovljevic@imgtec.com> Fix MIPS64 booting problem

Add missing MarkGCCard in compareAndSwapObject intinsic.

Additionaly, don't do a null test in MarkGCCard if the value
cannot be null for MIPS64.

Change-Id: Iad50f9e6be8cd27fedb31abb00d5829498941696
3f67e692860d281858485d48a4f1f81b907f1444 15-Jan-2016 Aart Bik <ajcbik@google.com> Implemented BitCount as an intrinsic. With unit test.

Rationale:
Recognizing this important operation as an intrinsic has
various advantages:
(1) having the no-side-effects/no-throw allows for
much more GVN/LICM/BCE.
(2) Some architectures, like x86_64, provide direct
support for this operation.

Performance improvements on X86_64:
CheckersEvalBench (32-bit bitboard): 27,210KNS -> 36,798KNS = + 35%
ReversiEvalBench (64-bit bitboard): 52,562KNS -> 89,086KNS = + 69%

Change-Id: I65d549b0469b7909b12c6611cdc34a8640a5751f
391b866ce55b8e78b1f9a6b98321d837256e8d66 18-Dec-2015 Roland Levillain <rpl@google.com> Disable the UnsafeCASObject intrinsic with read barriers.

The current implementations of the UnsafeCASObject
intrinsics are missing a read barrier. Temporarily disable
them when read barriers are enabled.

Also re-enable the jsr166.LinkedTransferQueueTest tests that
were failing on the concurrent collector configuration, as
the UnsafeCASObject JNI implementation now correctly
implements the read barrier which was missing.

Bug: 25883050
Bug: 26205973
Change-Id: Iaf5d515532949662d0ac6702c9452a00aa0a23e6
a4f1220c1518074db18ca1044e9201492975750b 06-Aug-2015 Mark Mendell <mark.p.mendell@intel.com> Optimizing: Add direct calls to math intrinsics

Support the double forms of:
cos, sin, acos, asin, atan, atan2, cbrt, cosh, exp, expm1,
hypot, log, log10, nextAfter, sinh, tan, tanh

Add these entries to the vector addressed off the thread pointer. Call
the libc routines directly, which means that we have to implement the
native ABI, not the ART one. For x86_64, that includes saving XMM12-15
as the native ABI considers them caller-save, while the ART ABI
considers them callee-save. We save them by marking them as used by the
call to the math function. For x86, this is not an issue, as all the XMM
registers are caller-save.

Other architectures will call Java as before until they are ready to
implement the new intrinsics.

Bump the OAT version since we are incompatible with old boot.oat files.

Change-Id: Ic6332c3555c09393a17d1ad4daf62932488722fb
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
bf84a3d2aa29c0975b4ac0f6f983d56724b2cc57 04-Dec-2015 Roland Levillain <rpl@google.com> Annotate Boolean literals more uniformly in Optimizing's intrinsics.

Change-Id: Ida40309b4bc170a18b4e5db552b77f021a7b89df
a0e87b0a97fadd54540ec7e8331b61bebd82d378 25-Sep-2015 Alexey Frunze <Alexey.Frunze@imgtec.com> MIPS64: Support short and long branches

Change-Id: I618c960bd211048166d9fde78d4106bd3ca42b3a
972d6d7b3b36c48ead6d95fa6a2a936390b868ac 20-Oct-2015 Chris Larsen <chris.larsen@imgtec.com> MIPS64: Add java.lang.String.equals intrinsic.

Change-Id: I71e41b20ebaf7640b2c72c590455eb0be4cbc5b7
53afca191ace3d7447b09097f9ea82a513075c52 06-Nov-2015 Alexey Frunze <Alexey.Frunze@imgtec.com> MIPS64: Implement virtual intrinsic slow path

This fixes a crash in dex2oat while compiling boot.oat.

Change-Id: I44fc92809902d7fc226c88b3e3f081b72cc19ce5
36427494be5700bc8adba514b5c67dc3ac429176 23-Oct-2015 Chris Larsen <chris.larsen@imgtec.com> MIPS64: Add "Compare and Swap" intrinsic support.

Add following functions from sun.misc.Unsafe:

- boolean compareAndSwapInt(Object, long, int expected, int)
- boolean compareAndSwapLong(Object, long, long expected, long)
- boolean compareAndSwapObject(Object, long, Object expected, Object)

Change-Id: Iea0bf486ce1fc0d77ce349dfd6c089c9835fbe92
8128437353f34648fc11c5501800cd2ce7156dce 22-Oct-2015 Chris Larsen <chris.larsen@imgtec.com> MIPS64: Clean-up intrinsics code

- Wrap lines longer that 100 characters.
- Fix return type in comments for various Long intrinsics.
- Add Location::OutputOverlap parameter to CreateFPToFP() function;
wrong value was being used for floor()/ceil() intrinsics.

Change-Id: I998b647e1c20521a72da89cfe2d5a4c27e3ab85c
0f8f8643bc10160a9034b9e3ccfd81e9e6ed8e74 03-Oct-2015 Chris Larsen <chris.larsen@imgtec.com> MIPS64: Add intrinsic support for bit rotation

- int java.lang.Integer.rotateLeft(int i, int distance)
- int java.lang.Long.rotateLeft(long i, int distance)

Change-Id: I048ebf310265c6b20a80108673a7931cbeee0513
9aebff2f19b605bff864308be51b604b7191163e 23-Sep-2015 Chris Larsen <chris.larsen@imgtec.com> MIPS64: Add intrinsic support for bit rotation

- int java.lang.Integer.rotateRight(int i, int distance)
- int java.lang.Long.rotateRight(long i, int distance)

Assembler tests for new MIPS instructions will be provided in a
separate patch.

Change-Id: I6dd4786e2d5f674bf56ff3d5afd321bb1bef589e
0646da7c04e4744c84d1b0a03df33ccae1d6d477 23-Sep-2015 Chris Larsen <chris.larsen@imgtec.com> MIPS64: Add intrinsics support for trailing zeros

- int java.lang.Integer.numberOfTrailingZeros(int i)
- int java.lang.Long.numberOfTrailingZeros(long i)

Change-Id: I0fc1c2629738de9047313b6511b490639eef68f3
1360adac0b8f523e3de7da58f6b85f724ec6e42e 05-Sep-2015 Chris Larsen <chris.larsen@imgtec.com> MIPS64: Implement intrinsics from sun.misc.Unsafe:

- int getInt(Object, long)
- int getIntVolatile(Object, long)
- long getLong(Object, long)
- long getLongVolatile(Object, long)
- Object getObject(Object, long)
- Object getObjectVolatile(Object, long)
- void putInt(Object, long, int)
- void putOrderedInt(Object, long, int)
- void putIntVolatile(Object, long, int)
- void putObject(Object, long, Object)
- void putOrderedObject(Object, long, Object)
- void putObjectVolatile(Object, long, Object)
- void putLong(Object, long, long)
- void putOrderedLong(Object, long, long)
- void putLongVolatile(Object, long, long)

The compareAndSwap*() functions will be delivered in a separate patch.

Change-Id: I94238254b2f9df017d58fa9a4bb38632f6479472
ee3cf0731d0ef0787bc2947c8e3ca432b513956b 06-Oct-2015 Nicolas Geoffray <ngeoffray@google.com> Intrinsify System.arraycopy.

Currently on x64, will do the other architectures in
different changes.

Change-Id: I15fbbadb450dd21787809759a8b14b21b1e42624
9701c2ee2dde033e2269dcfc592a09f21151e97e 05-Sep-2015 Chris Larsen <chris.larsen@imgtec.com> MIPS64: Implement intrinsics from java.lang.String:

- char charAt(int index)
- int compareTo(String anotherString)
- int indexOf(int ch)
- int indexOf(int ch, int fromIndex)
- String(byte[] bytes)
- String(char[] value)
- String(String original)

Change-Id: I9c309b62580b42ae08a09cb1c2b4ebd1a203c5d2
145008296e80b8ac5affa4fb9bc20e411bf0bd92 01-Oct-2015 Chris Larsen <chris.larsen@imgtec.com> MIPS64: Code cleanup.

1. Add comment to explain logic for GenMinMax in intrinsics code.
2. Declare enumerated type for class.s/class.d mask values.
3. Change intrinsics code to use the enumerated values described in
item 2.
4. Change "CLASS_MASK" to "kFPLeaveUnchanged" to match ART coding
standards.

Change-Id: Ib1fe4b01515595b46e5f101e0082bb9bbcf0c688
49e553927a70704cd6a29c7c8b96861e63808470 05-Sep-2015 Chris Larsen <chris.larsen@imgtec.com> MIPS64: Implement intrinsic java.lang.Thread.currentThread()

Change-Id: I45378414e5b6071dce9663ee42a2136874eba6ff
0b7ac98ecdb891797a282c508b41238451d6c770 04-Sep-2015 Chris Larsen <chris.larsen@imgtec.com> MIPS64: Implement intrinsics from java.lang.Math:

- abs(double) - abs(float) - abs(int)
- abs(long) - ceil(double) - floor(double)
- max(double, double) - max(float, float) - max(int, int)
- max(long, long) - min(double, double) - min(float, float)
- min(int, int) - min(long, long) - rint(double)
- sqrt(double)

The math intrinsics:

- round(double) - round(float)

aren't implemented because there is no simple mapping from these Java
functions into MIPS assembly code.

Change-Id: I37ee5224d3d64f7162ed98521ba566fbc58d7905
70fb1f447970548555c3a994de880be2a17a146a 04-Sep-2015 Chris Larsen <chris.larsen@imgtec.com> MIPS64: Implement intrinsics from libcore.io.Memory:

- peekByte(long address)
- peekShort(long address)
- peekInt(long address)
- peekLong(long address)
- pokeByte(long address, byte value)
- pokeShort(long address, short value)
- pokeInt(long address, int value)
- pokeLong(long address, long value)

Change-Id: Ic5996ea035bf7e622b6fc85b9526ee8318cb6b1f
3039e381b79ac1ef01c420511f6629f639d40ab4 26-Aug-2015 Chris Larsen <chris.larsen@imgtec.com> MIPS64: Implement miscellaneous bit manipulation intrinsics

// java.lang.Double
- doubleToRawLongBits(double) - longBitsToDouble(long)

// java.lang.Float
- floatToRawIntBits(float) - intBitsToFloat(int)

// java.lang.Integer
- numberOfLeadingZeros(int) - reverseBytes(int)
- reverse(int)

// java.lang.Long
- numberOfLeadingZeros(long) - reverseBytes(long)
- reverse(long)

// java.lang.Short
- reverseBytes(short)

Change-Id: Ic8f8c4e7b584132e2282b4fd267453870fefbaaa