RFR: 8273454: C2: Transform (-a)*(-b) into a*b [v5]
Zhengyu Gu
zgu at openjdk.java.net
Wed Sep 15 15:08:29 UTC 2021
> The transformation reduce instructions in generated code.
>
> ### x86_64:
>
> Before:
> ```
> 0x00007fb92c78b3ac: neg %esi
> 0x00007fb92c78b3ae: neg %edx
> 0x00007fb92c78b3b0: mov %esi,%eax
> 0x00007fb92c78b3b2: imul %edx,%eax ;*imul {reexecute=0 rethrow=0 return_oop=0}
> ; - TestSub::runSub at 4 (line 9)
>
> After:
>
> ; - TestSub::runSub at -1 (line 9)
> 0x00007fc8c05b74ac: mov %esi,%eax
> 0x00007fc8c05b74ae: imul %edx,%eax ;*imul {reexecute=0 rethrow=0 return_oop=0}
> ; - TestSub::runSub at 4 (line 9)
>
>
>
> ### AArch64:
> Before:
>
> 0x0000ffff814b4a70: neg w11, w1
> 0x0000ffff814b4a74: mneg w0, w2, w11 ;*imul {reexecute=0 rethrow=0 return_oop=0}
> ; - TestSub::runSub at 4 (line 9)
>
>
> After:
>
> 0x0000ffff794a67f0: mul w0, w1, w2 ;*imul {reexecute=0 rethrow=0 return_oop=0}
> ; - TestSub::runSub at 4 (line 9)
Zhengyu Gu has updated the pull request incrementally with one additional commit since the last revision:
@TobiHartmann's comments
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/5403/files
- new: https://git.openjdk.java.net/jdk/pull/5403/files/71aa6ac4..f9d7d612
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=5403&range=04
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=5403&range=03-04
Stats: 79 lines in 2 files changed: 27 ins; 37 del; 15 mod
Patch: https://git.openjdk.java.net/jdk/pull/5403.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/5403/head:pull/5403
PR: https://git.openjdk.java.net/jdk/pull/5403
More information about the hotspot-compiler-dev
mailing list