OSDN Git Service

Move Half implementations to libcore to allow ART optimizations
authorxueliang.zhong <xueliang.zhong@linaro.org>
Tue, 22 Jan 2019 18:01:45 +0000 (18:01 +0000)
committerXueliang Zhong <xueliang.zhong@linaro.org>
Wed, 14 Aug 2019 14:07:44 +0000 (14:07 +0000)
commite008d965ca9231730f6d86b4d99fc1f181939ecb
tree63f1e13a7ac427ab89ab762e7987dcf4f6671372
parent55752cf8d433281a2cd2370d6988f5362dacf1ff
Move Half implementations to libcore to allow ART optimizations

Move Half FP16 implementations to libcore, to allow ART compiler to
optimize these methods with intrinsic implementations.

For example, on ARM64 with ARMv8.2 FP16 half registers and instructions:
- Half toFloat/toHalf can be implemented with FCVT;
- Half floor/ceil/round can be implmented with FRINT(pna);
- Half max/min can be implmented with FMIN/FMAX.

Such fast Half FP16 intrinsics can help accelerate ColorLong ARGB
encoding/decoding in Android framework.

Change-Id: I6225ebf8aa825b0394ce8f13e12db317f5c6e3fd
core/java/android/util/Half.java