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

AArch64: Some temp vars in string_compare intrinsics for processing the last 4 chars (LU/UL) are no use

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 14
    • Fix Version/s: 15
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b03
    • CPU:
      aarch64
    • OS:
      linux

      Description

      In generate_compare_long_string_different_encoding, the two Register vars strU and strL were used to record the pointers of the last 4 characters for the final comparisons. strU has been no use since the latest code updates as the chars got pre-loaded by compare_string_16_x_LU, and strL is redundant too since the pointer is available in another variable. Removing them can save two add, two temp vars, and replace two sub with mov.

      http://hg.openjdk.java.net/jdk/jdk/file/11b96254ea92/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp

      Register strU = isLU ? str2 : str1, // <-- this can be removed
                    strL = isLU ? str1 : str2, // <-- this can be removed
                    tmpU = isLU ? rscratch1 : tmp1, // where to keep U for comparison
                    tmpL = isLU ? tmp1 : rscratch1; // where to keep L for comparison
          __ push(spilled_regs, sp);
          __ sub(tmp2, strL, cnt2); // strL pointer to load from
          __ sub(cnt1, strU, cnt2, __ LSL, 1); // strU pointer to load from

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                qpzhang Patrick Zhang
                Reporter:
                qpzhang Patrick Zhang
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 day
                  1d
                  Remaining:
                  Remaining Estimate - 1 day
                  1d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified