Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8292338

aarch64: Use cbnz instruction in gen_continuation_enter when possible

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 20
    • 20
    • hotspot
    • None
    • b11
    • aarch64
    • generic

      This is a trivial improvement for gen_continuation_enter on aarch64.
      We can combine Compare and Branch on Zero/Nonzero into CBZ/CBNZ to save one instruction.

      Proposed fix:

      diff --git a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
      index 55a49594fb3..2640157a818 100644
      --- a/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
      +++ b/src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
      @@ -1050,8 +1050,7 @@ static void gen_continuation_enter(MacroAssembler* masm,

           fill_continuation_entry(masm);

      - __ cmp(c_rarg2, (u1)0);
      - __ br(Assembler::NE, call_thaw);
      + __ cbnz(c_rarg2, call_thaw);

           address mark = __ pc();
           __ trampoline_call(resolve);
      @@ -1076,8 +1075,7 @@ static void gen_continuation_enter(MacroAssembler* masm,

         fill_continuation_entry(masm);

      - __ cmp(c_rarg2, (u1)0);
      - __ br(Assembler::NE, call_thaw);
      + __ cbnz(c_rarg2, call_thaw);

         address mark = __ pc();
         __ trampoline_call(resolve);

            fyang Fei Yang
            fyang Fei Yang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: