For below java code:
(s[0] & 0xf) << 3; // s[0] can be any primitive type.
AArch64 OpenJDK c2 compiler generates:
and w11, w10, #0xf
lsl w0, w11, #3
It can be improved to generate (gcc does):
ubfiz w0, w0, #3, #4
Daniel Stewart will contribute a patch for this.
(s[0] & 0xf) << 3; // s[0] can be any primitive type.
AArch64 OpenJDK c2 compiler generates:
and w11, w10, #0xf
lsl w0, w11, #3
It can be improved to generate (gcc does):
ubfiz w0, w0, #3, #4
Daniel Stewart will contribute a patch for this.