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