1
- From faa46be2353c281ce25f53992d5a2d1fb4f26183 Mon Sep 17 00:00:00 2001
1
+ From ded6ccc89556e1bd5ab448f58e3a1103c11bddf5 Mon Sep 17 00:00:00 2001
2
2
From: Yaakov Selkowitz <
[email protected] >
3
3
Date: Thu, 12 May 2016 20:52:27 -0500
4
4
Subject: [PATCH 3/3] pcre2-10.40-cygwin-jit
@@ -11,10 +11,10 @@ Originally added in https://cygwin.com/git-cygwin-packages/?p=git/cygwin-package
11
11
3 files changed, 36 insertions(+), 36 deletions(-)
12
12
13
13
diff --git a/src/sljit/sljitConfigInternal.h b/src/sljit/sljitConfigInternal.h
14
- index ce4e7b0..e3f85dc 100644
14
+ index de06dd8..67daa14 100644
15
15
--- a/src/sljit/sljitConfigInternal.h
16
16
+++ b/src/sljit/sljitConfigInternal.h
17
- @@ -603 ,15 +603 ,15 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_sw sljit_exec_offset(void* ptr );
17
+ @@ -602 ,15 +602 ,15 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_sw sljit_exec_offset(void *code );
18
18
#define SLJIT_NUMBER_OF_TEMPORARY_REGISTERS 2
19
19
#define SLJIT_NUMBER_OF_FLOAT_REGISTERS 15
20
20
#define SLJIT_NUMBER_OF_TEMPORARY_FLOAT_REGISTERS 1
@@ -30,14 +30,14 @@ index ce4e7b0..e3f85dc 100644
30
30
#define SLJIT_LOCALS_OFFSET_BASE (4 * SSIZE_OF(sw))
31
31
- #endif /* !_WIN64 */
32
32
+ #endif /* !_WIN64 && !__CYGWIN__ */
33
- #define SLJIT_PREF_SHIFT_REG SLJIT_R3
34
- #define SLJIT_MASKED_SHIFT 1
35
- #define SLJIT_MASKED_SHIFT32 1
33
+ #define SLJIT_TMP_DEST_REG SLJIT_TMP_R0
34
+ #define SLJIT_TMP_MEM_REG SLJIT_TMP_R0
35
+ #define SLJIT_TMP_DEST_FREG SLJIT_TMP_FR0
36
36
diff --git a/src/sljit/sljitNativeX86_64.c b/src/sljit/sljitNativeX86_64.c
37
- index f313f3f..d0873c4 100644
37
+ index 1ab7929..d748fa7 100644
38
38
--- a/src/sljit/sljitNativeX86_64.c
39
39
+++ b/src/sljit/sljitNativeX86_64.c
40
- @@ -443 ,7 +443 ,7 @@ static sljit_u8* generate_put_label_code (struct sljit_put_label *put_label, slji
40
+ @@ -447 ,7 +447 ,7 @@ static sljit_u8* generate_mov_addr_code (struct sljit_jump *jump, sljit_u8 *code_
41
41
return code_ptr;
42
42
}
43
43
@@ -46,7 +46,7 @@ index f313f3f..d0873c4 100644
46
46
typedef struct {
47
47
sljit_sw regs[2];
48
48
} sljit_sse2_reg;
49
- @@ -457 ,11 +457 ,11 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
49
+ @@ -461 ,11 +461 ,11 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
50
50
sljit_s32 word_arg_count = 0;
51
51
sljit_s32 saved_arg_count = SLJIT_KEPT_SAVEDS_COUNT(options);
52
52
sljit_s32 saved_regs_size, tmp, i;
@@ -60,7 +60,7 @@ index f313f3f..d0873c4 100644
60
60
sljit_u8 *inst;
61
61
62
62
CHECK_ERROR();
63
- @@ -500 ,7 +500 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
63
+ @@ -504 ,7 +504 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
64
64
PUSH_REG(reg_lmap[i]);
65
65
}
66
66
@@ -69,7 +69,7 @@ index f313f3f..d0873c4 100644
69
69
local_size += SLJIT_LOCALS_OFFSET;
70
70
saved_float_regs_size = GET_SAVED_FLOAT_REGISTERS_SIZE(fscratches, fsaveds, sse2_reg);
71
71
72
- @@ -508 ,16 +508 ,16 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
72
+ @@ -512 ,16 +512 ,16 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
73
73
saved_float_regs_offset = ((local_size + 0xf) & ~0xf);
74
74
local_size = saved_float_regs_offset + saved_float_regs_size;
75
75
}
@@ -89,7 +89,7 @@ index f313f3f..d0873c4 100644
89
89
switch (word_arg_count) {
90
90
case 0:
91
91
tmp = SLJIT_R2;
92
- @@ -532 ,7 +532 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
92
+ @@ -536 ,7 +536 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
93
93
tmp = SLJIT_R3;
94
94
break;
95
95
}
@@ -98,7 +98,7 @@ index f313f3f..d0873c4 100644
98
98
switch (word_arg_count + float_arg_count) {
99
99
case 0:
100
100
tmp = SLJIT_R3;
101
- @@ -547 ,7 +547 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
101
+ @@ -551 ,7 +551 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
102
102
tmp = TMP_REG1;
103
103
break;
104
104
}
@@ -107,7 +107,7 @@ index f313f3f..d0873c4 100644
107
107
if (arg_types & SLJIT_ARG_TYPE_SCRATCH_REG) {
108
108
if (tmp != SLJIT_R0 + word_arg_count)
109
109
EMIT_MOV(compiler, SLJIT_R0 + word_arg_count, 0, tmp, 0);
110
- @@ -557 ,13 +557 ,13 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
110
+ @@ -561 ,13 +561 ,13 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
111
111
}
112
112
word_arg_count++;
113
113
} else {
@@ -123,7 +123,7 @@ index f313f3f..d0873c4 100644
123
123
}
124
124
arg_types >>= SLJIT_ARG_SHIFT;
125
125
}
126
- @@ -571 ,7 +571 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
126
+ @@ -575 ,7 +575 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
127
127
local_size = ((local_size + saved_regs_size + 0xf) & ~0xf) - saved_regs_size;
128
128
compiler->local_size = local_size;
129
129
@@ -132,7 +132,7 @@ index f313f3f..d0873c4 100644
132
132
if (local_size > 0) {
133
133
if (local_size <= 4 * 4096) {
134
134
if (local_size > 4096)
135
- @@ -600 ,12 +600 ,12 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
135
+ @@ -604 ,12 +604 ,12 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
136
136
if (local_size > 0)
137
137
EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_MEM1(SLJIT_SP), -local_size);
138
138
}
@@ -147,7 +147,7 @@ index f313f3f..d0873c4 100644
147
147
if (saved_float_regs_size > 0) {
148
148
compiler->mode32 = 1;
149
149
150
- @@ -620 ,7 +620 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
150
+ @@ -624 ,7 +624 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compi
151
151
saved_float_regs_offset += 16;
152
152
}
153
153
}
@@ -156,7 +156,7 @@ index f313f3f..d0873c4 100644
156
156
157
157
return SLJIT_SUCCESS;
158
158
}
159
- @@ -630 ,23 +630 ,23 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_set_context(struct sljit_compiler *comp
159
+ @@ -634 ,23 +634 ,23 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_set_context(struct sljit_compiler *comp
160
160
sljit_s32 fscratches, sljit_s32 fsaveds, sljit_s32 local_size)
161
161
{
162
162
sljit_s32 saved_regs_size;
@@ -185,7 +185,7 @@ index f313f3f..d0873c4 100644
185
185
186
186
/* Including the return address saved by the call instruction. */
187
187
saved_regs_size = GET_SAVED_REGISTERS_SIZE(scratches, saveds - SLJIT_KEPT_SAVEDS_COUNT(options), 1);
188
- @@ -659 ,13 +659 ,13 @@ static sljit_s32 emit_stack_frame_release(struct sljit_compiler *compiler, sljit
188
+ @@ -663 ,13 +663 ,13 @@ static sljit_s32 emit_stack_frame_release(struct sljit_compiler *compiler, sljit
189
189
sljit_uw size;
190
190
sljit_s32 local_size, i, tmp;
191
191
sljit_u8 *inst;
@@ -202,7 +202,7 @@ index f313f3f..d0873c4 100644
202
202
saved_float_regs_offset = GET_SAVED_FLOAT_REGISTERS_SIZE(fscratches, fsaveds, sse2_reg);
203
203
204
204
if (saved_float_regs_offset > 0) {
205
- @@ -685 ,7 +685 ,7 @@ static sljit_s32 emit_stack_frame_release(struct sljit_compiler *compiler, sljit
205
+ @@ -689 ,7 +689 ,7 @@ static sljit_s32 emit_stack_frame_release(struct sljit_compiler *compiler, sljit
206
206
207
207
compiler->mode32 = 0;
208
208
}
@@ -211,7 +211,7 @@ index f313f3f..d0873c4 100644
211
211
212
212
local_size = compiler->local_size;
213
213
214
- @@ -762 ,7 +762 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return_to(struct sljit_compiler *c
214
+ @@ -766 ,7 +766 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return_to(struct sljit_compiler *c
215
215
/* Call / return instructions */
216
216
/* --------------------------------------------------------------------- */
217
217
@@ -221,10 +221,10 @@ index f313f3f..d0873c4 100644
221
221
static sljit_s32 call_with_args(struct sljit_compiler *compiler, sljit_s32 arg_types, sljit_s32 *src_ptr)
222
222
{
223
223
diff --git a/src/sljit/sljitNativeX86_common.c b/src/sljit/sljitNativeX86_common.c
224
- index c2c0421..da8af3d 100644
224
+ index ecb7e9b..91dfcc8 100644
225
225
--- a/src/sljit/sljitNativeX86_common.c
226
226
+++ b/src/sljit/sljitNativeX86_common.c
227
- @@ -95 ,7 +95 ,7 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 2] = {
227
+ @@ -88 ,7 +88 ,7 @@ static const sljit_u8 freg_map[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 2] = {
228
228
/* Note: r12 & 0x7 == 0b100, which decoded as SIB byte present
229
229
Note: avoid to use r12 and r13 for memory addressing
230
230
therefore r12 is better to be a higher saved register. */
@@ -233,7 +233,7 @@ index c2c0421..da8af3d 100644
233
233
/* Args: rdi(=7), rsi(=6), rdx(=2), rcx(=1), r8, r9. Scratches: rax(=0), r10, r11 */
234
234
static const sljit_u8 reg_map[SLJIT_NUMBER_OF_REGISTERS + 4] = {
235
235
0, 0, 6, 7, 1, 8, 11, 10, 12, 5, 13, 14, 15, 3, 4, 2, 9
236
- @@ -130 ,7 +130 ,7 @@ static const sljit_u8 freg_lmap[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 2] = {
236
+ @@ -123 ,7 +123 ,7 @@ static const sljit_u8 freg_lmap[SLJIT_NUMBER_OF_FLOAT_REGISTERS + 2] = {
237
237
#define REX_B 0x41
238
238
#define REX 0x40
239
239
@@ -242,7 +242,7 @@ index c2c0421..da8af3d 100644
242
242
#define HALFWORD_MAX 0x7fffffffl
243
243
#define HALFWORD_MIN -0x80000000l
244
244
#else
245
- @@ -1228 ,7 +1228 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
245
+ @@ -1377 ,7 +1377 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
246
246
case SLJIT_DIV_UW:
247
247
case SLJIT_DIV_SW:
248
248
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
@@ -251,7 +251,7 @@ index c2c0421..da8af3d 100644
251
251
SLJIT_ASSERT(
252
252
reg_map[SLJIT_R0] == 0
253
253
&& reg_map[SLJIT_R1] == 2
254
- @@ -1245 ,7 +1245 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
254
+ @@ -1394 ,7 +1394 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
255
255
256
256
op = GET_OPCODE(op);
257
257
if ((op | 0x2) == SLJIT_DIV_UW) {
@@ -260,7 +260,7 @@ index c2c0421..da8af3d 100644
260
260
EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_R1, 0);
261
261
inst = emit_x86_instruction(compiler, 1, SLJIT_R1, 0, SLJIT_R1, 0);
262
262
#else
263
- @@ -1256 ,7 +1256 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
263
+ @@ -1405 ,7 +1405 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
264
264
}
265
265
266
266
if ((op | 0x2) == SLJIT_DIV_SW) {
@@ -269,7 +269,7 @@ index c2c0421..da8af3d 100644
269
269
EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_R1, 0);
270
270
#endif
271
271
272
- @@ -1281 ,7 +1281 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
272
+ @@ -1430 ,7 +1430 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
273
273
inst[0] = GROUP_F7;
274
274
inst[1] = MOD_REG | ((op >= SLJIT_DIVMOD_UW) ? reg_map[TMP_REG1] : reg_map[SLJIT_R1]);
275
275
#else /* !SLJIT_CONFIG_X86_32 */
@@ -278,7 +278,7 @@ index c2c0421..da8af3d 100644
278
278
size = (!compiler->mode32 || op >= SLJIT_DIVMOD_UW) ? 3 : 2;
279
279
#else /* !_WIN64 */
280
280
size = (!compiler->mode32) ? 3 : 2;
281
- @@ -1289 ,7 +1289 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
281
+ @@ -1438 ,7 +1438 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
282
282
inst = (sljit_u8*)ensure_buf(compiler, 1 + size);
283
283
FAIL_IF(!inst);
284
284
INC_SIZE(size);
@@ -287,7 +287,7 @@ index c2c0421..da8af3d 100644
287
287
if (!compiler->mode32)
288
288
*inst++ = REX_W | ((op >= SLJIT_DIVMOD_UW) ? REX_B : 0);
289
289
else if (op >= SLJIT_DIVMOD_UW)
290
- @@ -1319 ,7 +1319 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
290
+ @@ -1468 ,7 +1468 ,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compile
291
291
inst[1] |= IDIV;
292
292
break;
293
293
}
0 commit comments