Skip to content

Commit fbe045b

Browse files
authored
Add AVX2 simd support on x86 (#328)
The downside is SSE4.1 is the minimum for simd support
1 parent 52041d8 commit fbe045b

File tree

3 files changed

+240
-249
lines changed

3 files changed

+240
-249
lines changed

src/pcre2_jit_compile.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5945,6 +5945,7 @@ static BOOL check_fast_forward_char_pair_simd(compiler_common *common, fast_forw
59455945
{
59465946
sljit_s32 i, j, max_i = 0, max_j = 0;
59475947
sljit_u32 max_pri = 0;
5948+
sljit_s32 max_offset = max_fast_forward_char_pair_offset();
59485949
PCRE2_UCHAR a1, a2, a_pri, b1, b2, b_pri;
59495950

59505951
for (i = max - 1; i >= 1; i--)
@@ -5955,7 +5956,7 @@ static BOOL check_fast_forward_char_pair_simd(compiler_common *common, fast_forw
59555956
a2 = chars[i].chars[1];
59565957
a_pri = chars[i].last_count;
59575958

5958-
j = i - max_fast_forward_char_pair_offset();
5959+
j = i - max_offset;
59595960
if (j < 0)
59605961
j = 0;
59615962

@@ -14183,7 +14184,7 @@ common->compiler = compiler;
1418314184

1418414185
/* Main pcre2_jit_exec entry. */
1418514186
SLJIT_ASSERT((private_data_size & (sizeof(sljit_sw) - 1)) == 0);
14186-
sljit_emit_enter(compiler, 0, SLJIT_ARGS1(W, W), 5, 5, 0, 0, private_data_size);
14187+
sljit_emit_enter(compiler, 0, SLJIT_ARGS1(W, W), 5, 5, SLJIT_NUMBER_OF_SCRATCH_FLOAT_REGISTERS, 0, private_data_size);
1418714188

1418814189
/* Register init. */
1418914190
reset_ovector(common, (re->top_bracket + 1) * 2);

0 commit comments

Comments
 (0)