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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • hs16
    • hs16
    • hotspot
    • b09
    • x86
    • solaris
    • Verified

        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

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

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: