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

XMLWordPrintable

    • b03
    • aarch64
    • linux

      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

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

              Created:
              Updated:
              Resolved:

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