Skip to content

Commit 72d9deb

Browse files
author
Zoltan Herczeg
committed
Prepare for release in JIT
1 parent 6aafc18 commit 72d9deb

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

src/pcre2_jit_simd_inc.h

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,17 @@ typedef enum {
5555
static SLJIT_INLINE sljit_s32 max_fast_forward_char_pair_offset(void)
5656
{
5757
#if PCRE2_CODE_UNIT_WIDTH == 8
58-
return sljit_has_cpu_feature(SLJIT_HAS_AVX2) ? 31 : 15;
58+
/* The AVX2 code path is currently disabled. */
59+
/* return sljit_has_cpu_feature(SLJIT_HAS_AVX2) ? 31 : 15; */
60+
return 15;
5961
#elif PCRE2_CODE_UNIT_WIDTH == 16
60-
return sljit_has_cpu_feature(SLJIT_HAS_AVX2) ? 15 : 7;
62+
/* The AVX2 code path is currently disabled. */
63+
/* return sljit_has_cpu_feature(SLJIT_HAS_AVX2) ? 15 : 7; */
64+
return 7;
6165
#elif PCRE2_CODE_UNIT_WIDTH == 32
62-
return sljit_has_cpu_feature(SLJIT_HAS_AVX2) ? 7 : 3;
66+
/* The AVX2 code path is currently disabled. */
67+
/* return sljit_has_cpu_feature(SLJIT_HAS_AVX2) ? 7 : 3; */
68+
return 3;
6369
#else
6470
#error "Unsupported unit width"
6571
#endif
@@ -228,7 +234,9 @@ static void fast_forward_char_simd(compiler_common *common, PCRE2_UCHAR char1, P
228234
{
229235
DEFINE_COMPILER;
230236
sljit_u8 instruction[8];
231-
sljit_s32 reg_type = sljit_has_cpu_feature(SLJIT_HAS_AVX2) ? SLJIT_SIMD_REG_256 : SLJIT_SIMD_REG_128;
237+
/* The AVX2 code path is currently disabled. */
238+
/* sljit_s32 reg_type = sljit_has_cpu_feature(SLJIT_HAS_AVX2) ? SLJIT_SIMD_REG_256 : SLJIT_SIMD_REG_128; */
239+
sljit_s32 reg_type = SLJIT_SIMD_REG_128;
232240
sljit_s32 value;
233241
struct sljit_label *start;
234242
#if defined SUPPORT_UNICODE && PCRE2_CODE_UNIT_WIDTH != 32
@@ -363,7 +371,9 @@ static jump_list *fast_requested_char_simd(compiler_common *common, PCRE2_UCHAR
363371
{
364372
DEFINE_COMPILER;
365373
sljit_u8 instruction[8];
366-
sljit_s32 reg_type = sljit_has_cpu_feature(SLJIT_HAS_AVX2) ? SLJIT_SIMD_REG_256 : SLJIT_SIMD_REG_128;
374+
/* The AVX2 code path is currently disabled. */
375+
/* sljit_s32 reg_type = sljit_has_cpu_feature(SLJIT_HAS_AVX2) ? SLJIT_SIMD_REG_256 : SLJIT_SIMD_REG_128; */
376+
sljit_s32 reg_type = SLJIT_SIMD_REG_128;
367377
sljit_s32 value;
368378
struct sljit_label *start;
369379
struct sljit_jump *quit;
@@ -468,7 +478,9 @@ static void fast_forward_char_pair_simd(compiler_common *common, sljit_s32 offs1
468478
{
469479
DEFINE_COMPILER;
470480
sljit_u8 instruction[8];
471-
sljit_s32 reg_type = sljit_has_cpu_feature(SLJIT_HAS_AVX2) ? SLJIT_SIMD_REG_256 : SLJIT_SIMD_REG_128;
481+
/* The AVX2 code path is currently disabled. */
482+
/* sljit_s32 reg_type = sljit_has_cpu_feature(SLJIT_HAS_AVX2) ? SLJIT_SIMD_REG_256 : SLJIT_SIMD_REG_128; */
483+
sljit_s32 reg_type = SLJIT_SIMD_REG_128;
472484
sljit_s32 value;
473485
vector_compare_type compare1_type = vector_compare_match1;
474486
vector_compare_type compare2_type = vector_compare_match1;

src/pcre2_jit_test.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ static struct regression_test_case regression_test_cases[] = {
394394
{ MU, A, 0, 0, "[^\\x{801}-\\x{fffe}]+", "\xe0\xa0\x81#\xc3\xa9\xf0\x90\x90\x80\xe0\xa0\x80\xef\xbf\xbf\xef\xbf\xbe" },
395395
{ MU, A, 0, 0, "[\\x{10001}-\\x{10fffe}]+", "#\xc3\xa9\xe2\xb1\xa5\xf0\x90\x80\x80\xf0\x90\x80\x81\xf4\x8f\xbf\xbe\xf4\x8f\xbf\xbf" },
396396
{ MU, A, 0, 0, "[^\\x{10001}-\\x{10fffe}]+", "\xf0\x90\x80\x81#\xc3\xa9\xe2\xb1\xa5\xf0\x90\x80\x80\xf4\x8f\xbf\xbf\xf4\x8f\xbf\xbe" },
397-
{ CMU, A, 0, 0 | F_NOMATCH, "^[\\x{0100}-\\x{017f}]", " " },
397+
{ CMU, A, 0, 0 | F_NOMATCH | F_PROPERTY, "^[\\x{100}-\\x{17f}]", " " },
398398

399399
/* Unicode properties. */
400400
{ MUP, A, 0, 0, "[1-5\xc3\xa9\\w]", "\xc3\xa1_" },
@@ -417,13 +417,13 @@ static struct regression_test_case regression_test_cases[] = {
417417
{ MUP, A, 0, 0 | F_PROPERTY, "[\xc3\xa2-\xc3\xa6\xc3\x81-\xc3\x84\xe2\x80\xa8-\xe2\x80\xa9\xe6\x92\xad\\p{Zs}]{2,}", "\xe2\x80\xa7\xe2\x80\xa9\xe6\x92\xad \xe6\x92\xae" },
418418
{ MUP, A, 0, 0 | F_PROPERTY, "[\\P{L&}]{2}[^\xc2\x85-\xc2\x89\\p{Ll}\\p{Lu}]{2}", "\xc3\xa9\xe6\x92\xad.a\xe6\x92\xad|\xc2\x8a#" },
419419
{ PCRE2_UCP, 0, 0, 0 | F_PROPERTY, "[a-b\\s]{2,5}[^a]", "AB baaa" },
420-
{ MUP, 0, 0, 0 | F_NOMATCH, "[^\\p{Hangul}\\p{Z}]", " " },
420+
{ MUP, 0, 0, 0 | F_NOMATCH | F_PROPERTY, "[^\\p{Hangul}\\p{Z}]", " " },
421421
{ MUP, 0, 0, 0, "[\\p{Lu}\\P{Latin}]+", "c\xEA\xA4\xAE,A,b" },
422422
{ MUP, 0, 0, 0, "[\\x{a92e}\\p{Lu}\\P{Latin}]+", "c\xEA\xA4\xAE,A,b" },
423423
{ CMUP, 0, 0, 0, "[^S]\\B", "\xe2\x80\x8a" },
424424
{ MUP, 0, 0, 0 | F_NOMATCH, "[^[:print:]\\x{f6f6}]", "\xef\x9b\xb6" },
425425
{ MUP, 0, 0, 0, "[[:xdigit:]\\x{6500}]#", "\xe6\x94\x80#" },
426-
{ MUP, 0, 0, 0, "[\\pC\\PC]#", "A#" },
426+
{ MUP, 0, 0, 0 | F_PROPERTY, "[\\pC\\PC]#", "A#" },
427427

428428
/* Possible empty brackets. */
429429
{ MU, A, 0, 0, "(?:|ab||bc|a)+d", "abcxabcabd" },
@@ -907,7 +907,7 @@ static struct regression_test_case regression_test_cases[] = {
907907
{ MU, A, 0, 0, "!(*sr:\\w\\w|\\w\\w\\w)++#", "!abcdefghijklmno!abcdefghijklmno!abcdef#" },
908908
{ MU, A, 0, 0, "!(*sr:\\w\\w|\\w\\w\\w)?#", "!ab!abc!ab!ab#" },
909909
{ MU, A, 0, 0, "!(*sr:\\w\\w|\\w\\w\\w)??#", "!ab!abc!ab!ab#" },
910-
#endif
910+
#endif /* SUPPORT_UNICODE */
911911

912912
/* Deep recursion. */
913913
{ MU, A, 0, 0, "((((?:(?:(?:\\w)+)?)*|(?>\\w)+?)+|(?>\\w)?\?)*)?\\s", "aaaaa+ " },

0 commit comments

Comments
 (0)