[aarch64-port-dev ] RFR: 88158361: AArch64: Address calculation missed optimizations
Andrew Haley
aph at redhat.com
Mon Jun 26 11:17:09 UTC 2017
On 23/06/17 10:50, Zhongwei Yao wrote:
> Hi, Andrew,
>
> Besides pass jtreg on aarch64 and x86, for each pattern, I added one or two
> test cases, which will hit the testing pattern. And check the test cases'
> assembly output to ensure the hit pattern generates correct instructions.
>
> Here is a test case for: AddExtL_uxtb_and_shift pattern:
>
> // testrule: AddExtL_uxtb_and_shift
> // geninst: add.*x.*, x.*, w.*, uxtb #3
> public Flonglong adduxtb = new Flonglong() {
> public long func(long x, long y) {
> return y + ((x & 255) << 3);
> }
> };
>
> And the "geninst" line defines this case's required generated assembly
> instruction pattern.
>
> A script will check whether this case's generated C2 assembly has the
> required instruction "add.*x.*, x.*, w.*, uxtb #3". If yes, the test
> passes. And if there is a "nosense" on "// testrule" line, such check is
> skipped.
>
> All test cases are at http://cr.openjdk.java.net/~njian/8158361/ExtTest.java
This looks great, just one problem.
I'm seeing this with current JDK10 HotSpot:
0x000003ff95285b64: and x10, x2, #0xff
0x000003ff95285b68: add x0, x3, x10, lsl #3 ;*ladd {reexecute=0 rethrow=0 return_oop=0}
; - ExtTest$1::func at 8 (line 25)
This happens in three of the patterns.
public Flonglong adduxtb = new Flonglong() {
public long func(long x, long y) {
return y + ((x & 255) << 3);
}
};
public Flonglong adduxtb2 = new Flonglong() {
public long func(long x, long y) {
return y + (((x << 56) >>> 56) << 4);
}
};
public Flonglong subuxtb2 = new Flonglong() {
public long func(long x, long y) {
return y - (((x << 56) >>> 56) << 4);
}
};
--
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
More information about the aarch64-port-dev
mailing list