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

Intrinsic for String.indexOf() is broken on x86 with SSE4.2

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: hs16
    • Fix Version/s: hs16
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b09
    • CPU:
      x86
    • OS:
      solaris
    • Verification:
      Verified

      Backports

        Description

        Implementation of String.indexOf() intrinsic using SSE 4.2 instructions is incorrect.
        The regression is introduced by 6761600 in HS15_b05 so jdk6u14p, jdk6u18 and JDK7 are affected.

        % cat Test.java
        public class Test {

          static int IndexOfTest(String str) {
            return str.indexOf("11111xx1x");
          }

          public static void main(String args[]) {
            String str = "11111xx11111xx1x";
            int idx = IndexOfTest(str);
            System.out.println("IndexOf = " + idx);
          }
        }

        % /java/re/jdk/6u14/promoted/p/b03/binaries/solaris-amd64/bin/java -d64 -Xcomp Test
        IndexOf = -1

        % /java/re/jdk/6u18/promoted/latest/binaries/solaris-i586/bin/java -Xcomp Test
        IndexOf = -1
        i% /java/re/jdk/6u18/promoted/latest/binaries/solaris-amd64/bin/java -d64 -Xcomp Test
        IndexOf = -1
        % /java/re/jdk/6u18/promoted/latest/binaries/solaris-i586/bin/java -XX:-UseSSE42Intrinsics -Xcomp Test
        IndexOf = 7

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  kvn Vladimir Kozlov
                  Reporter:
                  kvn Vladimir Kozlov
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: