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

RISC-V: misaligned memory access in String.Compare intrinsic

    XMLWordPrintable

Details

    • b09
    • riscv
    • linux

    Backports

      Description

        String.compare intrinsics:
        C2_MacroAssembler::string_compare()
        generate_compare_long_string_different_encoding()
        generate_compare_long_string_same_encoding()

        All do misaligned memory access even when -XX:+AvoidUnalignedAccesses
        C2_MacroAssembler::string_compare() and generate_compare_long_string_same_encoding() do it only for the tail.


        generate_compare_long_string_different_encoding does it for Latin string ( address is 4 b-bytes aligned but no 8-bytes aligned, and reading 8 bytes on every iteration of the loop).

        This results in pretty bad results ( in jmh benches) on platforms without hardware misaligned access support ( like hifive unmatched)

        Attachments

          Issue Links

            Activity

              People

                vkempik Vladimir Kempik
                vkempik Vladimir Kempik
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: