Revision: 1051
http://vcs.pcre.org/viewvc?view=rev&revision=1051
Author: zherczeg
Date: 2012-10-02 09:18:24 +0100 (Tue, 02 Oct 2012)
Log Message:
-----------
PowerPC 64 fixes in the JIT.
Modified Paths:
--------------
code/trunk/pcre_jit_compile.c
code/trunk/pcre_jit_test.c
Modified: code/trunk/pcre_jit_compile.c
===================================================================
--- code/trunk/pcre_jit_compile.c 2012-09-30 18:20:10 UTC (rev 1050)
+++ code/trunk/pcre_jit_compile.c 2012-10-02 08:18:24 UTC (rev 1051)
@@ -4019,14 +4019,18 @@
case PT_CLIST:
other_cases = PRIV(ucd_caseless_sets) + cc[1];
+ /* At least two characters are required. */
+ SLJIT_ASSERT(other_cases[0] != NOTACHAR && other_cases[1] != NOTACHAR);
+
OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, *other_cases++ - charoffset);
COND_VALUE(SLJIT_MOV, TMP2, 0, SLJIT_C_EQUAL);
- while (*other_cases < NOTACHAR)
+ do
{
OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, *other_cases++ - charoffset);
- COND_VALUE(SLJIT_OR, TMP2, 0, SLJIT_C_EQUAL);
+ COND_VALUE(SLJIT_OR | ((*other_cases == NOTACHAR) ? SLJIT_SET_E : 0), TMP2, 0, SLJIT_C_EQUAL);
}
+ while (*other_cases != NOTACHAR);
jump = JUMP(SLJIT_C_NOT_ZERO ^ invertcmp);
break;
}
@@ -4239,7 +4243,7 @@
OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM2(TMP1, TMP2), 3);
OP2(SLJIT_SHL, STACK_TOP, 0, STACK_TOP, 0, SLJIT_IMM, 2);
- OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), (sljit_w)PRIV(ucp_gbtable));
+ OP1(SLJIT_MOV_UI, TMP1, 0, SLJIT_MEM1(STACK_TOP), (sljit_w)PRIV(ucp_gbtable));
OP1(SLJIT_MOV, STACK_TOP, 0, TMP2, 0);
OP2(SLJIT_SHL, TMP2, 0, SLJIT_IMM, 1, TMP2, 0);
OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, TMP2, 0);
Modified: code/trunk/pcre_jit_test.c
===================================================================
--- code/trunk/pcre_jit_test.c 2012-09-30 18:20:10 UTC (rev 1050)
+++ code/trunk/pcre_jit_test.c 2012-10-02 08:18:24 UTC (rev 1051)
@@ -1105,7 +1105,7 @@
if (utf8 == utf16 && !(current->start_offset & F_FORCECONV)) {
/* All results must be the same. */
if (return_value8_1 != return_value8_2 || return_value8_1 != return_value16_1 || return_value8_1 != return_value16_2) {
- printf("\n8 and 16 bit: Return value differs(%d:%d:%d:%d): [%d] '%s' @ '%s'\n",
+ printf("\n8 and 16 bit: Return value differs(J8:%d,I8:%d,J16:%d,I16%d): [%d] '%s' @ '%s'\n",
return_value8_1, return_value8_2, return_value16_1, return_value16_2,
total, current->pattern, current->input);
is_successful = 0;
@@ -1130,7 +1130,7 @@
for (i = 0; i < return_value8_1; ++i)
if (ovector8_1[i] != ovector8_2[i] || ovector8_1[i] != ovector16_1[i] || ovector8_1[i] != ovector16_2[i]) {
- printf("\n8 and 16 bit: Ovector[%d] value differs(%d:%d:%d:%d): [%d] '%s' @ '%s' \n",
+ printf("\n8 and 16 bit: Ovector[%d] value differs(J8:%d,I8:%d,J16:%d,I16%d): [%d] '%s' @ '%s' \n",
i, ovector8_1[i], ovector8_2[i], ovector16_1[i], ovector16_2[i],
total, current->pattern, current->input);
is_successful = 0;
@@ -1141,7 +1141,7 @@
/* Only the 8 bit and 16 bit results must be equal. */
#ifdef SUPPORT_PCRE8
if (return_value8_1 != return_value8_2) {
- printf("\n8 bit: Return value differs(%d:%d): [%d] '%s' @ '%s'\n",
+ printf("\n8 bit: Return value differs(J8:%d,I8:%d): [%d] '%s' @ '%s'\n",
return_value8_1, return_value8_2, total, current->pattern, current->input);
is_successful = 0;
} else if (return_value8_1 >= 0 || return_value8_1 == PCRE_ERROR_PARTIAL) {
@@ -1152,7 +1152,7 @@
for (i = 0; i < return_value8_1; ++i)
if (ovector8_1[i] != ovector8_2[i]) {
- printf("\n8 bit: Ovector[%d] value differs(%d:%d): [%d] '%s' @ '%s'\n",
+ printf("\n8 bit: Ovector[%d] value differs(J8:%d,I8:%d): [%d] '%s' @ '%s'\n",
i, ovector8_1[i], ovector8_2[i], total, current->pattern, current->input);
is_successful = 0;
}
@@ -1161,7 +1161,7 @@
#ifdef SUPPORT_PCRE16
if (return_value16_1 != return_value16_2) {
- printf("\n16 bit: Return value differs(%d:%d): [%d] '%s' @ '%s'\n",
+ printf("\n16 bit: Return value differs(J16:%d,I16:%d): [%d] '%s' @ '%s'\n",
return_value16_1, return_value16_2, total, current->pattern, current->input);
is_successful = 0;
} else if (return_value16_1 >= 0 || return_value16_1 == PCRE_ERROR_PARTIAL) {
@@ -1172,7 +1172,7 @@
for (i = 0; i < return_value16_1; ++i)
if (ovector16_1[i] != ovector16_2[i]) {
- printf("\n16 bit: Ovector[%d] value differs(%d:%d): [%d] '%s' @ '%s'\n",
+ printf("\n16 bit: Ovector[%d] value differs(J16:%d,I16:%d): [%d] '%s' @ '%s'\n",
i, ovector16_1[i], ovector16_2[i], total, current->pattern, current->input);
is_successful = 0;
}