A question about bytecodes + unsigned load performance ./. add performace
Ulf Zibis
Ulf.Zibis at gmx.de
Fri Jan 9 15:44:49 PST 2009
Am 10.01.2009 00:17, John Rose schrieb:
>
> Note that compilers tend to optimize expressions like myByteArray[i]
> & 0xFF into unsigned loads, and packaging this into an intrinsic
> method would add predicability of compilation (if anybody cares), and
> the case is not frequent enough to warrant shaving a few bytes off the
> instruction format.
>
... but myByte + 0x80 is faster than myByte & 0xFF. For me this is an
unintelligible mystery.
source see here (line 141..144):
http://hg.openjdk.java.net/jdk7/tl/jdk/file/b89ba9a6d9a6/make/tools/src/build/tools/charsetmapping/GenerateSBCS.java
How can adding be faster than unsigned load of a byte?
-Ulf
More information about the hotspot-dev
mailing list