6961
6962 if (ae == StrIntrinsicNode::UU) {
6963 // Divide length by 2 to get number of chars
6964 shrl(cnt2, 1);
6965 }
6966 cmpl(cnt2, 1);
6967 jcc(Assembler::equal, LENGTH_DIFF_LABEL);
6968
6969 // Check if the strings start at the same location and setup scale and stride
6970 if (ae == StrIntrinsicNode::LL || ae == StrIntrinsicNode::UU) {
6971 cmpptr(str1, str2);
6972 jcc(Assembler::equal, LENGTH_DIFF_LABEL);
6973 if (ae == StrIntrinsicNode::LL) {
6974 scale = Address::times_1;
6975 stride = 16;
6976 } else {
6977 scale = Address::times_2;
6978 stride = 8;
6979 }
6980 } else {
6981 scale1 = Address::times_1;
6982 scale2 = Address::times_2;
6983 stride = 8;
6984 }
6985
6986 if (UseAVX >= 2 && UseSSE42Intrinsics) {
6987 Label COMPARE_WIDE_VECTORS, VECTOR_NOT_EQUAL, COMPARE_WIDE_TAIL, COMPARE_SMALL_STR;
6988 Label COMPARE_WIDE_VECTORS_LOOP, COMPARE_16_CHARS, COMPARE_INDEX_CHAR;
6989 Label COMPARE_TAIL_LONG;
6990 int pcmpmask = 0x19;
6991 if (ae == StrIntrinsicNode::LL) {
6992 pcmpmask &= ~0x01;
6993 }
6994
6995 // Setup to compare 16-chars (32-bytes) vectors,
6996 // start from first character again because it has aligned address.
6997 if (ae == StrIntrinsicNode::LL) {
6998 stride2 = 32;
6999 } else {
7000 stride2 = 16;
|
6961
6962 if (ae == StrIntrinsicNode::UU) {
6963 // Divide length by 2 to get number of chars
6964 shrl(cnt2, 1);
6965 }
6966 cmpl(cnt2, 1);
6967 jcc(Assembler::equal, LENGTH_DIFF_LABEL);
6968
6969 // Check if the strings start at the same location and setup scale and stride
6970 if (ae == StrIntrinsicNode::LL || ae == StrIntrinsicNode::UU) {
6971 cmpptr(str1, str2);
6972 jcc(Assembler::equal, LENGTH_DIFF_LABEL);
6973 if (ae == StrIntrinsicNode::LL) {
6974 scale = Address::times_1;
6975 stride = 16;
6976 } else {
6977 scale = Address::times_2;
6978 stride = 8;
6979 }
6980 } else {
6981 scale = Address::no_scale; // not used
6982 scale1 = Address::times_1;
6983 scale2 = Address::times_2;
6984 stride = 8;
6985 }
6986
6987 if (UseAVX >= 2 && UseSSE42Intrinsics) {
6988 Label COMPARE_WIDE_VECTORS, VECTOR_NOT_EQUAL, COMPARE_WIDE_TAIL, COMPARE_SMALL_STR;
6989 Label COMPARE_WIDE_VECTORS_LOOP, COMPARE_16_CHARS, COMPARE_INDEX_CHAR;
6990 Label COMPARE_TAIL_LONG;
6991 int pcmpmask = 0x19;
6992 if (ae == StrIntrinsicNode::LL) {
6993 pcmpmask &= ~0x01;
6994 }
6995
6996 // Setup to compare 16-chars (32-bytes) vectors,
6997 // start from first character again because it has aligned address.
6998 if (ae == StrIntrinsicNode::LL) {
6999 stride2 = 32;
7000 } else {
7001 stride2 = 16;
|