pcre  8.32
About: PCRE - Perl-compatible regular expressions
  Fossies Dox: pcre-8.32.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
sljitNativeX86_32.c
Go to the documentation of this file.
1 /*
2  * Stack-less Just-In-Time compiler
3  *
4  * Copyright 2009-2012 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without modification, are
7  * permitted provided that the following conditions are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright notice, this list of
10  * conditions and the following disclaimer.
11  *
12  * 2. Redistributions in binary form must reproduce the above copyright notice, this list
13  * of conditions and the following disclaimer in the documentation and/or other materials
14  * provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND CONTRIBUTORS ``AS IS'' AND ANY
17  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
19  * SHALL THE COPYRIGHT HOLDER(S) OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
21  * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
22  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
24  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  */
26 
27 /* x86 32-bit arch dependent functions. */
28 
29 static sljit_si emit_do_imm(struct sljit_compiler *compiler, sljit_ub opcode, sljit_sw imm)
30 {
31  sljit_ub *inst;
32 
33  inst = (sljit_ub*)ensure_buf(compiler, 1 + 1 + sizeof(sljit_sw));
34  FAIL_IF(!inst);
35  INC_SIZE(1 + sizeof(sljit_sw));
36  *inst++ = opcode;
37  *(sljit_sw*)inst = imm;
38  return SLJIT_SUCCESS;
39 }
40 
41 static sljit_ub* generate_far_jump_code(struct sljit_jump *jump, sljit_ub *code_ptr, sljit_si type)
42 {
43  if (type == SLJIT_JUMP) {
44  *code_ptr++ = JMP_i32;
45  jump->addr++;
46  }
47  else if (type >= SLJIT_FAST_CALL) {
48  *code_ptr++ = CALL_i32;
49  jump->addr++;
50  }
51  else {
52  *code_ptr++ = GROUP_0F;
53  *code_ptr++ = get_jump_code(type);
54  jump->addr += 2;
55  }
56 
57  if (jump->flags & JUMP_LABEL)
58  jump->flags |= PATCH_MW;
59  else
60  *(sljit_sw*)code_ptr = jump->u.target - (jump->addr + 4);
61  code_ptr += 4;
62 
63  return code_ptr;
64 }
65 
67 {
68  sljit_si size;
69  sljit_si locals_offset;
70  sljit_ub *inst;
71 
72  CHECK_ERROR();
73  check_sljit_emit_enter(compiler, args, scratches, saveds, local_size);
74 
75  compiler->scratches = scratches;
76  compiler->saveds = saveds;
77  compiler->args = args;
78  compiler->flags_saved = 0;
79 #if (defined SLJIT_DEBUG && SLJIT_DEBUG)
80  compiler->logical_local_size = local_size;
81 #endif
82 
83 #if (defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL)
84  size = 1 + (saveds <= 3 ? saveds : 3) + (args > 0 ? (args * 2) : 0) + (args > 2 ? 2 : 0);
85 #else
86  size = 1 + (saveds <= 3 ? saveds : 3) + (args > 0 ? (2 + args * 3) : 0);
87 #endif
88  inst = (sljit_ub*)ensure_buf(compiler, 1 + size);
89  FAIL_IF(!inst);
90 
91  INC_SIZE(size);
92  PUSH_REG(reg_map[TMP_REGISTER]);
93 #if !(defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL)
94  if (args > 0) {
95  *inst++ = MOV_r_rm;
96  *inst++ = MOD_REG | (reg_map[TMP_REGISTER] << 3) | 0x4 /* esp */;
97  }
98 #endif
99  if (saveds > 2)
100  PUSH_REG(reg_map[SLJIT_SAVED_REG3]);
101  if (saveds > 1)
102  PUSH_REG(reg_map[SLJIT_SAVED_REG2]);
103  if (saveds > 0)
104  PUSH_REG(reg_map[SLJIT_SAVED_REG1]);
105 
106 #if (defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL)
107  if (args > 0) {
108  *inst++ = MOV_r_rm;
109  *inst++ = MOD_REG | (reg_map[SLJIT_SAVED_REG1] << 3) | reg_map[SLJIT_SCRATCH_REG3];
110  }
111  if (args > 1) {
112  *inst++ = MOV_r_rm;
113  *inst++ = MOD_REG | (reg_map[SLJIT_SAVED_REG2] << 3) | reg_map[SLJIT_SCRATCH_REG2];
114  }
115  if (args > 2) {
116  *inst++ = MOV_r_rm;
117  *inst++ = MOD_DISP8 | (reg_map[SLJIT_SAVED_REG3] << 3) | 0x4 /* esp */;
118  *inst++ = 0x24;
119  *inst++ = sizeof(sljit_sw) * (3 + 2); /* saveds >= 3 as well. */
120  }
121 #else
122  if (args > 0) {
123  *inst++ = MOV_r_rm;
124  *inst++ = MOD_DISP8 | (reg_map[SLJIT_SAVED_REG1] << 3) | reg_map[TMP_REGISTER];
125  *inst++ = sizeof(sljit_sw) * 2;
126  }
127  if (args > 1) {
128  *inst++ = MOV_r_rm;
129  *inst++ = MOD_DISP8 | (reg_map[SLJIT_SAVED_REG2] << 3) | reg_map[TMP_REGISTER];
130  *inst++ = sizeof(sljit_sw) * 3;
131  }
132  if (args > 2) {
133  *inst++ = MOV_r_rm;
134  *inst++ = MOD_DISP8 | (reg_map[SLJIT_SAVED_REG3] << 3) | reg_map[TMP_REGISTER];
135  *inst++ = sizeof(sljit_sw) * 4;
136  }
137 #endif
138 
139 #if (defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL)
140  locals_offset = 2 * sizeof(sljit_uw);
141 #else
142  SLJIT_COMPILE_ASSERT(FIXED_LOCALS_OFFSET >= 2 * sizeof(sljit_uw), require_at_least_two_words);
143  locals_offset = FIXED_LOCALS_OFFSET;
144 #endif
145  compiler->scratches_start = locals_offset;
146  if (scratches > 3)
147  locals_offset += (scratches - 3) * sizeof(sljit_uw);
148  compiler->saveds_start = locals_offset;
149  if (saveds > 3)
150  locals_offset += (saveds - 3) * sizeof(sljit_uw);
151  compiler->locals_offset = locals_offset;
152  local_size = locals_offset + ((local_size + sizeof(sljit_uw) - 1) & ~(sizeof(sljit_uw) - 1));
153 
154  compiler->local_size = local_size;
155 #ifdef _WIN32
156  if (local_size > 1024) {
157 #if (defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL)
158  FAIL_IF(emit_do_imm(compiler, MOV_r_i32 + reg_map[SLJIT_SCRATCH_REG1], local_size));
159 #else
160  local_size -= FIXED_LOCALS_OFFSET;
161  FAIL_IF(emit_do_imm(compiler, MOV_r_i32 + reg_map[SLJIT_SCRATCH_REG1], local_size));
162  FAIL_IF(emit_non_cum_binary(compiler, SUB_r_rm, SUB_rm_r, SUB, SUB_EAX_i32,
163  SLJIT_LOCALS_REG, 0, SLJIT_LOCALS_REG, 0, SLJIT_IMM, FIXED_LOCALS_OFFSET));
164 #endif
165  FAIL_IF(sljit_emit_ijump(compiler, SLJIT_CALL1, SLJIT_IMM, SLJIT_FUNC_OFFSET(sljit_grow_stack)));
166  }
167 #endif
168 
169  SLJIT_ASSERT(local_size > 0);
170  return emit_non_cum_binary(compiler, SUB_r_rm, SUB_rm_r, SUB, SUB_EAX_i32,
171  SLJIT_LOCALS_REG, 0, SLJIT_LOCALS_REG, 0, SLJIT_IMM, local_size);
172 }
173 
174 SLJIT_API_FUNC_ATTRIBUTE void sljit_set_context(struct sljit_compiler *compiler, sljit_si args, sljit_si scratches, sljit_si saveds, sljit_si local_size)
175 {
176  sljit_si locals_offset;
177 
179  check_sljit_set_context(compiler, args, scratches, saveds, local_size);
180 
181  compiler->scratches = scratches;
182  compiler->saveds = saveds;
183  compiler->args = args;
184 #if (defined SLJIT_DEBUG && SLJIT_DEBUG)
185  compiler->logical_local_size = local_size;
186 #endif
187 
188 #if (defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL)
189  locals_offset = 2 * sizeof(sljit_uw);
190 #else
191  locals_offset = FIXED_LOCALS_OFFSET;
192 #endif
193  compiler->scratches_start = locals_offset;
194  if (scratches > 3)
195  locals_offset += (scratches - 3) * sizeof(sljit_uw);
196  compiler->saveds_start = locals_offset;
197  if (saveds > 3)
198  locals_offset += (saveds - 3) * sizeof(sljit_uw);
199  compiler->locals_offset = locals_offset;
200  compiler->local_size = locals_offset + ((local_size + sizeof(sljit_uw) - 1) & ~(sizeof(sljit_uw) - 1));
201 }
202 
204 {
205  sljit_si size;
206  sljit_ub *inst;
207 
208  CHECK_ERROR();
209  check_sljit_emit_return(compiler, op, src, srcw);
210  SLJIT_ASSERT(compiler->args >= 0);
211 
212  compiler->flags_saved = 0;
213  FAIL_IF(emit_mov_before_return(compiler, op, src, srcw));
214 
215  SLJIT_ASSERT(compiler->local_size > 0);
216  FAIL_IF(emit_cum_binary(compiler, ADD_r_rm, ADD_rm_r, ADD, ADD_EAX_i32,
218 
219  size = 2 + (compiler->saveds <= 3 ? compiler->saveds : 3);
220 #if (defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL)
221  if (compiler->args > 2)
222  size += 2;
223 #else
224  if (compiler->args > 0)
225  size += 2;
226 #endif
227  inst = (sljit_ub*)ensure_buf(compiler, 1 + size);
228  FAIL_IF(!inst);
229 
230  INC_SIZE(size);
231 
232  if (compiler->saveds > 0)
233  POP_REG(reg_map[SLJIT_SAVED_REG1]);
234  if (compiler->saveds > 1)
235  POP_REG(reg_map[SLJIT_SAVED_REG2]);
236  if (compiler->saveds > 2)
237  POP_REG(reg_map[SLJIT_SAVED_REG3]);
238  POP_REG(reg_map[TMP_REGISTER]);
239 #if (defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL)
240  if (compiler->args > 2)
241  RET_I16(sizeof(sljit_sw));
242  else
243  RET();
244 #else
245  RET();
246 #endif
247 
248  return SLJIT_SUCCESS;
249 }
250 
251 /* --------------------------------------------------------------------- */
252 /* Operators */
253 /* --------------------------------------------------------------------- */
254 
255 /* Size contains the flags as well. */
256 static sljit_ub* emit_x86_instruction(struct sljit_compiler *compiler, sljit_si size,
257  /* The register or immediate operand. */
258  sljit_si a, sljit_sw imma,
259  /* The general operand (not immediate). */
260  sljit_si b, sljit_sw immb)
261 {
262  sljit_ub *inst;
263  sljit_ub *buf_ptr;
264  sljit_si flags = size & ~0xf;
265  sljit_si inst_size;
266 
267  /* Both cannot be switched on. */
269  /* Size flags not allowed for typed instructions. */
270  SLJIT_ASSERT(!(flags & (EX86_BIN_INS | EX86_SHIFT_INS)) || (flags & (EX86_BYTE_ARG | EX86_HALF_ARG)) == 0);
271  /* Both size flags cannot be switched on. */
273 #if (defined SLJIT_SSE2 && SLJIT_SSE2)
274  /* SSE2 and immediate is not possible. */
275  SLJIT_ASSERT(!(a & SLJIT_IMM) || !(flags & EX86_SSE2));
276  SLJIT_ASSERT((flags & (EX86_PREF_F2 | EX86_PREF_F3)) != (EX86_PREF_F2 | EX86_PREF_F3)
277  && (flags & (EX86_PREF_F2 | EX86_PREF_66)) != (EX86_PREF_F2 | EX86_PREF_66)
278  && (flags & (EX86_PREF_F3 | EX86_PREF_66)) != (EX86_PREF_F3 | EX86_PREF_66));
279 #endif
280 
281  size &= 0xf;
282  inst_size = size;
283 
284 #if (defined SLJIT_SSE2 && SLJIT_SSE2)
285  if (flags & (EX86_PREF_F2 | EX86_PREF_F3))
286  inst_size++;
287 #endif
288  if (flags & EX86_PREF_66)
289  inst_size++;
290 
291  /* Calculate size of b. */
292  inst_size += 1; /* mod r/m byte. */
293  if (b & SLJIT_MEM) {
294  if ((b & 0x0f) == SLJIT_UNUSED)
295  inst_size += sizeof(sljit_sw);
296  else if (immb != 0 && !(b & 0xf0)) {
297  /* Immediate operand. */
298  if (immb <= 127 && immb >= -128)
299  inst_size += sizeof(sljit_sb);
300  else
301  inst_size += sizeof(sljit_sw);
302  }
303 
304  if ((b & 0xf) == SLJIT_LOCALS_REG && !(b & 0xf0))
305  b |= SLJIT_LOCALS_REG << 4;
306 
307  if ((b & 0xf0) != SLJIT_UNUSED)
308  inst_size += 1; /* SIB byte. */
309  }
310 
311  /* Calculate size of a. */
312  if (a & SLJIT_IMM) {
313  if (flags & EX86_BIN_INS) {
314  if (imma <= 127 && imma >= -128) {
315  inst_size += 1;
316  flags |= EX86_BYTE_ARG;
317  } else
318  inst_size += 4;
319  }
320  else if (flags & EX86_SHIFT_INS) {
321  imma &= 0x1f;
322  if (imma != 1) {
323  inst_size ++;
324  flags |= EX86_BYTE_ARG;
325  }
326  } else if (flags & EX86_BYTE_ARG)
327  inst_size++;
328  else if (flags & EX86_HALF_ARG)
329  inst_size += sizeof(short);
330  else
331  inst_size += sizeof(sljit_sw);
332  }
333  else
334  SLJIT_ASSERT(!(flags & EX86_SHIFT_INS) || a == SLJIT_PREF_SHIFT_REG);
335 
336  inst = (sljit_ub*)ensure_buf(compiler, 1 + inst_size);
337  PTR_FAIL_IF(!inst);
338 
339  /* Encoding the byte. */
340  INC_SIZE(inst_size);
341 #if (defined SLJIT_SSE2 && SLJIT_SSE2)
342  if (flags & EX86_PREF_F2)
343  *inst++ = 0xf2;
344  if (flags & EX86_PREF_F3)
345  *inst++ = 0xf3;
346 #endif
347  if (flags & EX86_PREF_66)
348  *inst++ = 0x66;
349 
350  buf_ptr = inst + size;
351 
352  /* Encode mod/rm byte. */
353  if (!(flags & EX86_SHIFT_INS)) {
354  if ((flags & EX86_BIN_INS) && (a & SLJIT_IMM))
355  *inst = (flags & EX86_BYTE_ARG) ? GROUP_BINARY_83 : GROUP_BINARY_81;
356 
357  if ((a & SLJIT_IMM) || (a == 0))
358  *buf_ptr = 0;
359 #if (defined SLJIT_SSE2 && SLJIT_SSE2)
360  else if (!(flags & EX86_SSE2))
361  *buf_ptr = reg_map[a] << 3;
362  else
363  *buf_ptr = a << 3;
364 #else
365  else
366  *buf_ptr = reg_map[a] << 3;
367 #endif
368  }
369  else {
370  if (a & SLJIT_IMM) {
371  if (imma == 1)
372  *inst = GROUP_SHIFT_1;
373  else
374  *inst = GROUP_SHIFT_N;
375  } else
376  *inst = GROUP_SHIFT_CL;
377  *buf_ptr = 0;
378  }
379 
380  if (!(b & SLJIT_MEM))
381 #if (defined SLJIT_SSE2 && SLJIT_SSE2)
382  *buf_ptr++ |= MOD_REG + ((!(flags & EX86_SSE2)) ? reg_map[b] : b);
383 #else
384  *buf_ptr++ |= MOD_REG + reg_map[b];
385 #endif
386  else if ((b & 0x0f) != SLJIT_UNUSED) {
387  if ((b & 0xf0) == SLJIT_UNUSED || (b & 0xf0) == (SLJIT_LOCALS_REG << 4)) {
388  if (immb != 0) {
389  if (immb <= 127 && immb >= -128)
390  *buf_ptr |= 0x40;
391  else
392  *buf_ptr |= 0x80;
393  }
394 
395  if ((b & 0xf0) == SLJIT_UNUSED)
396  *buf_ptr++ |= reg_map[b & 0x0f];
397  else {
398  *buf_ptr++ |= 0x04;
399  *buf_ptr++ = reg_map[b & 0x0f] | (reg_map[(b >> 4) & 0x0f] << 3);
400  }
401 
402  if (immb != 0) {
403  if (immb <= 127 && immb >= -128)
404  *buf_ptr++ = immb; /* 8 bit displacement. */
405  else {
406  *(sljit_sw*)buf_ptr = immb; /* 32 bit displacement. */
407  buf_ptr += sizeof(sljit_sw);
408  }
409  }
410  }
411  else {
412  *buf_ptr++ |= 0x04;
413  *buf_ptr++ = reg_map[b & 0x0f] | (reg_map[(b >> 4) & 0x0f] << 3) | (immb << 6);
414  }
415  }
416  else {
417  *buf_ptr++ |= 0x05;
418  *(sljit_sw*)buf_ptr = immb; /* 32 bit displacement. */
419  buf_ptr += sizeof(sljit_sw);
420  }
421 
422  if (a & SLJIT_IMM) {
423  if (flags & EX86_BYTE_ARG)
424  *buf_ptr = imma;
425  else if (flags & EX86_HALF_ARG)
426  *(short*)buf_ptr = imma;
427  else if (!(flags & EX86_SHIFT_INS))
428  *(sljit_sw*)buf_ptr = imma;
429  }
430 
431  return !(flags & EX86_SHIFT_INS) ? inst : (inst + 1);
432 }
433 
434 /* --------------------------------------------------------------------- */
435 /* Call / return instructions */
436 /* --------------------------------------------------------------------- */
437 
438 static SLJIT_INLINE sljit_si call_with_args(struct sljit_compiler *compiler, sljit_si type)
439 {
440  sljit_ub *inst;
441 
442 #if (defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL)
443  inst = (sljit_ub*)ensure_buf(compiler, type >= SLJIT_CALL3 ? 1 + 2 + 1 : 1 + 2);
444  FAIL_IF(!inst);
445  INC_SIZE(type >= SLJIT_CALL3 ? 2 + 1 : 2);
446 
447  if (type >= SLJIT_CALL3)
448  PUSH_REG(reg_map[SLJIT_SCRATCH_REG3]);
449  *inst++ = MOV_r_rm;
450  *inst++ = MOD_REG | (reg_map[SLJIT_SCRATCH_REG3] << 3) | reg_map[SLJIT_SCRATCH_REG1];
451 #else
452  inst = (sljit_ub*)ensure_buf(compiler, 1 + 4 * (type - SLJIT_CALL0));
453  FAIL_IF(!inst);
454  INC_SIZE(4 * (type - SLJIT_CALL0));
455 
456  *inst++ = MOV_rm_r;
457  *inst++ = MOD_DISP8 | (reg_map[SLJIT_SCRATCH_REG1] << 3) | 0x4 /* SIB */;
458  *inst++ = (0x4 /* none*/ << 3) | reg_map[SLJIT_LOCALS_REG];
459  *inst++ = 0;
460  if (type >= SLJIT_CALL2) {
461  *inst++ = MOV_rm_r;
462  *inst++ = MOD_DISP8 | (reg_map[SLJIT_SCRATCH_REG2] << 3) | 0x4 /* SIB */;
463  *inst++ = (0x4 /* none*/ << 3) | reg_map[SLJIT_LOCALS_REG];
464  *inst++ = sizeof(sljit_sw);
465  }
466  if (type >= SLJIT_CALL3) {
467  *inst++ = MOV_rm_r;
468  *inst++ = MOD_DISP8 | (reg_map[SLJIT_SCRATCH_REG3] << 3) | 0x4 /* SIB */;
469  *inst++ = (0x4 /* none*/ << 3) | reg_map[SLJIT_LOCALS_REG];
470  *inst++ = 2 * sizeof(sljit_sw);
471  }
472 #endif
473  return SLJIT_SUCCESS;
474 }
475 
477 {
478  sljit_ub *inst;
479 
480  CHECK_ERROR();
481  check_sljit_emit_fast_enter(compiler, dst, dstw);
482  ADJUST_LOCAL_OFFSET(dst, dstw);
483 
484  CHECK_EXTRA_REGS(dst, dstw, (void)0);
485 
486  /* For UNUSED dst. Uncommon, but possible. */
487  if (dst == SLJIT_UNUSED)
488  dst = TMP_REGISTER;
489 
490  if (dst <= TMP_REGISTER) {
491  /* Unused dest is possible here. */
492  inst = (sljit_ub*)ensure_buf(compiler, 1 + 1);
493  FAIL_IF(!inst);
494 
495  INC_SIZE(1);
496  POP_REG(reg_map[dst]);
497  return SLJIT_SUCCESS;
498  }
499 
500  /* Memory. */
501  inst = emit_x86_instruction(compiler, 1, 0, 0, dst, dstw);
502  FAIL_IF(!inst);
503  *inst++ = POP_rm;
504  return SLJIT_SUCCESS;
505 }
506 
508 {
509  sljit_ub *inst;
510 
511  CHECK_ERROR();
512  check_sljit_emit_fast_return(compiler, src, srcw);
513  ADJUST_LOCAL_OFFSET(src, srcw);
514 
515  CHECK_EXTRA_REGS(src, srcw, (void)0);
516 
517  if (src <= TMP_REGISTER) {
518  inst = (sljit_ub*)ensure_buf(compiler, 1 + 1 + 1);
519  FAIL_IF(!inst);
520 
521  INC_SIZE(1 + 1);
522  PUSH_REG(reg_map[src]);
523  }
524  else if (src & SLJIT_MEM) {
525  inst = emit_x86_instruction(compiler, 1, 0, 0, src, srcw);
526  FAIL_IF(!inst);
527  *inst++ = GROUP_FF;
528  *inst |= PUSH_rm;
529 
530  inst = (sljit_ub*)ensure_buf(compiler, 1 + 1);
531  FAIL_IF(!inst);
532  INC_SIZE(1);
533  }
534  else {
535  /* SLJIT_IMM. */
536  inst = (sljit_ub*)ensure_buf(compiler, 1 + 5 + 1);
537  FAIL_IF(!inst);
538 
539  INC_SIZE(5 + 1);
540  *inst++ = PUSH_i32;
541  *(sljit_sw*)inst = srcw;
542  inst += sizeof(sljit_sw);
543  }
544 
545  RET();
546  return SLJIT_SUCCESS;
547 }