RFR: JDK-8283140: Remove unused encoding classes/operands from x86_64.ad

Tobias Hartmann thartmann at openjdk.org
Wed Oct 25 07:20:36 UTC 2023


On Mon, 23 Oct 2023 17:51:47 GMT, Cesar Soares Lucas <cslucas at openjdk.org> wrote:

> These encoding classes became dead code when the instructions' definitions were patched to use the MacroAssembler.
> 
> Tested with tier 1-3 on Linux, Windows & MacOS.

src/hotspot/cpu/x86/x86_64.ad line 818:

> 816: 
> 817:   if (framesize) {
> 818:     __ addq(as_Register(RSP_enc), framesize);

Isn't this changing the encoding of the add?

src/hotspot/cpu/x86/x86_64.ad line 822:

> 820: 
> 821:   // popq rbp
> 822:   __ popq(as_Register(RBP_enc));

I think the comment is useless now.

src/hotspot/cpu/x86/x86_64.ad line 5044:

> 5042:   format %{ "movl    $dst, $src\t# int stk" %}
> 5043:   ins_encode %{
> 5044:     __ movl ($dst$$Register, $src$$Address);

Suggestion:

    __ movl($dst$$Register, $src$$Address);

src/hotspot/cpu/x86/x86_64.ad line 5056:

> 5054:   format %{ "movq    $dst, $src\t# long stk" %}
> 5055:   ins_encode %{
> 5056:     __ movq ($dst$$Register, $src$$Address);

Suggestion:

    __ movq($dst$$Register, $src$$Address);

src/hotspot/cpu/x86/x86_64.ad line 5068:

> 5066:   format %{ "movq    $dst, $src\t# ptr stk" %}
> 5067:   ins_encode %{
> 5068:     __ movq ($dst$$Register, $src$$Address);

Suggestion:

    __ movq($dst$$Register, $src$$Address);

src/hotspot/cpu/x86/x86_64.ad line 5528:

> 5526:   format %{ "movl    $dst, $src\t# int stk" %}
> 5527:   ins_encode %{
> 5528:     __ movl ($dst$$Address, $src$$Register);

Suggestion:

    __ movl $dst$$Address, $src$$Register);

src/hotspot/cpu/x86/x86_64.ad line 5540:

> 5538:   format %{ "movq    $dst, $src\t# long stk" %}
> 5539:   ins_encode %{
> 5540:     __ movq ($dst$$Address, $src$$Register);

Suggestion:

    __ movq($dst$$Address, $src$$Register);

src/hotspot/cpu/x86/x86_64.ad line 5552:

> 5550:   format %{ "movq    $dst, $src\t# ptr stk" %}
> 5551:   ins_encode %{
> 5552:     __ movq ($dst$$Address, $src$$Register);

Suggestion:

    __ movq($dst$$Address, $src$$Register);

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16319#discussion_r1371264140
PR Review Comment: https://git.openjdk.org/jdk/pull/16319#discussion_r1371251728
PR Review Comment: https://git.openjdk.org/jdk/pull/16319#discussion_r1371250786
PR Review Comment: https://git.openjdk.org/jdk/pull/16319#discussion_r1371250715
PR Review Comment: https://git.openjdk.org/jdk/pull/16319#discussion_r1371250588
PR Review Comment: https://git.openjdk.org/jdk/pull/16319#discussion_r1371250468
PR Review Comment: https://git.openjdk.org/jdk/pull/16319#discussion_r1371250385
PR Review Comment: https://git.openjdk.org/jdk/pull/16319#discussion_r1371250280


More information about the hotspot-compiler-dev mailing list