/[pcre]/code/trunk/sljit/sljitLir.c
ViewVC logotype

Diff of /code/trunk/sljit/sljitLir.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 722 by zherczeg, Fri Oct 7 19:18:55 2011 UTC revision 1182 by zherczeg, Sun Oct 28 05:22:32 2012 UTC
# Line 1  Line 1 
1  /*  /*
2   *    Stack-less Just-In-Time compiler   *    Stack-less Just-In-Time compiler
3   *   *
4   *    Copyright 2009-2010 Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.   *    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   * Redistribution and use in source and binary forms, with or without modification, are
7   * permitted provided that the following conditions are met:   * permitted provided that the following conditions are met:
# Line 122  Line 122 
122  #endif  #endif
123    
124  #if (defined SLJIT_CONFIG_ARM_THUMB2 && SLJIT_CONFIG_ARM_THUMB2)  #if (defined SLJIT_CONFIG_ARM_THUMB2 && SLJIT_CONFIG_ARM_THUMB2)
125          #define IS_CONDITIONAL  0x04          #define IS_COND         0x04
126          #define IS_BL           0x08          #define IS_BL           0x08
127          /* cannot be encoded as branch */          /* cannot be encoded as branch */
128          #define B_TYPE0         0x00          #define B_TYPE0         0x00
# Line 159  Line 159 
159          #define PATCH_J         0x80          #define PATCH_J         0x80
160    
161          /* instruction types */          /* instruction types */
162          #define UNMOVABLE_INS   0          #define MOVABLE_INS     0
163          /* 1 - 31 last destination register */          /* 1 - 31 last destination register */
         #define FCSR_FCC        32  
164          /* no destination (i.e: store) */          /* no destination (i.e: store) */
165          #define MOVABLE_INS     33          #define UNMOVABLE_INS   32
166            /* FPU status register */
167            #define FCSR_FCC        33
168    #endif
169    
170    #if (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32)
171            #define IS_MOVABLE      0x04
172            #define IS_COND         0x08
173            #define IS_CALL         0x10
174    
175            #define PATCH_B         0x20
176            #define PATCH_CALL      0x40
177    
178            /* instruction types */
179            #define MOVABLE_INS     0
180            /* 1 - 31 last destination register */
181            /* no destination (i.e: store) */
182            #define UNMOVABLE_INS   32
183    
184            #define DST_INS_MASK    0xff
185    
186            /* ICC_SET is the same as SET_FLAGS. */
187            #define ICC_IS_SET      (1 << 23)
188            #define FCC_IS_SET      (1 << 24)
189    #endif
190    
191    #if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
192    #define SLJIT_HAS_VARIABLE_LOCALS_OFFSET 1
193    #endif
194    
195    #if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
196    #define SLJIT_HAS_FIXED_LOCALS_OFFSET 1
197    #ifdef _WIN64
198    #define FIXED_LOCALS_OFFSET (4 * sizeof(sljit_w))
199    #else
200    #define FIXED_LOCALS_OFFSET (sizeof(sljit_w))
201    #endif
202    #endif
203    
204    #if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32)
205    #define SLJIT_HAS_FIXED_LOCALS_OFFSET 1
206    #if (defined SLJIT_INDIRECT_CALL && SLJIT_INDIRECT_CALL)
207    #define FIXED_LOCALS_OFFSET ((6 + 8) * sizeof(sljit_w))
208    #else
209    #define FIXED_LOCALS_OFFSET (2 * sizeof(sljit_w))
210    #endif
211    #endif
212    
213    #if (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
214    #define SLJIT_HAS_FIXED_LOCALS_OFFSET 1
215    #define FIXED_LOCALS_OFFSET ((6 + 8) * sizeof(sljit_w))
216    #endif
217    
218    #if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
219    #define SLJIT_HAS_FIXED_LOCALS_OFFSET 1
220    #define FIXED_LOCALS_OFFSET (4 * sizeof(sljit_w))
221    #endif
222    
223    #if (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32)
224    #define SLJIT_HAS_FIXED_LOCALS_OFFSET 1
225    #define FIXED_LOCALS_OFFSET (23 * sizeof(sljit_w))
226    #endif
227    
228    #if (defined SLJIT_HAS_VARIABLE_LOCALS_OFFSET && SLJIT_HAS_VARIABLE_LOCALS_OFFSET)
229    
230    #define ADJUST_LOCAL_OFFSET(p, i) \
231            if ((p) == (SLJIT_MEM1(SLJIT_LOCALS_REG))) \
232                    (i) += compiler->locals_offset;
233    
234    #elif (defined SLJIT_HAS_FIXED_LOCALS_OFFSET && SLJIT_HAS_FIXED_LOCALS_OFFSET)
235    
236    #define ADJUST_LOCAL_OFFSET(p, i) \
237            if ((p) == (SLJIT_MEM1(SLJIT_LOCALS_REG))) \
238                    (i) += FIXED_LOCALS_OFFSET;
239    
240    #else
241    
242    #define ADJUST_LOCAL_OFFSET(p, i)
243    
244  #endif  #endif
245    
246  #endif /* !(defined SLJIT_CONFIG_UNSUPPORTED && SLJIT_CONFIG_UNSUPPORTED) */  #endif /* !(defined SLJIT_CONFIG_UNSUPPORTED && SLJIT_CONFIG_UNSUPPORTED) */
# Line 192  static int compiler_initialized = 0; Line 269  static int compiler_initialized = 0;
269  static void init_compiler(void);  static void init_compiler(void);
270  #endif  #endif
271    
272  struct sljit_compiler* sljit_create_compiler(void)  SLJIT_API_FUNC_ATTRIBUTE struct sljit_compiler* sljit_create_compiler(void)
273  {  {
274          struct sljit_compiler *compiler = (struct sljit_compiler*)SLJIT_MALLOC(sizeof(struct sljit_compiler));          struct sljit_compiler *compiler = (struct sljit_compiler*)SLJIT_MALLOC(sizeof(struct sljit_compiler));
         /* Compile time assert. */  
         SLJIT_CONST int minus1[sizeof(sljit_b) == 1 && sizeof(sljit_h) == 2 &&  
                 sizeof(sljit_i) == 4 && (sizeof(sljit_w) == 4 || sizeof(sljit_w) == 8) ? 1 : -1] = { -1 };  
   
275          if (!compiler)          if (!compiler)
276                  return NULL;                  return NULL;
277            SLJIT_ZEROMEM(compiler, sizeof(struct sljit_compiler));
278    
279          compiler->error = SLJIT_SUCCESS;          SLJIT_COMPILE_ASSERT(
280                    sizeof(sljit_b) == 1 && sizeof(sljit_ub) == 1
281                    && sizeof(sljit_h) == 2 && sizeof(sljit_uh) == 2
282                    && sizeof(sljit_i) == 4 && sizeof(sljit_ui) == 4
283                    && (sizeof(sljit_p) == 4 || sizeof(sljit_p) == 8)
284                    && (sizeof(sljit_w) == 4 || sizeof(sljit_w) == 8)
285                    && (sizeof(sljit_uw) == 4 || sizeof(sljit_uw) == 8),
286                    invalid_integer_types);
287    
288          compiler->labels = NULL;          /* Only the non-zero members must be set. */
289          compiler->jumps = NULL;          compiler->error = SLJIT_SUCCESS;
         compiler->consts = NULL;  
         compiler->last_label = NULL;  
         compiler->last_jump = NULL;  
         compiler->last_const = NULL;  
290    
291          compiler->buf = (struct sljit_memory_fragment*)SLJIT_MALLOC(BUF_SIZE);          compiler->buf = (struct sljit_memory_fragment*)SLJIT_MALLOC(BUF_SIZE);
292          compiler->abuf = (struct sljit_memory_fragment*)SLJIT_MALLOC(ABUF_SIZE);          compiler->abuf = (struct sljit_memory_fragment*)SLJIT_MALLOC(ABUF_SIZE);
# Line 228  struct sljit_compiler* sljit_create_comp Line 305  struct sljit_compiler* sljit_create_comp
305          compiler->abuf->next = NULL;          compiler->abuf->next = NULL;
306          compiler->abuf->used_size = 0;          compiler->abuf->used_size = 0;
307    
308          compiler->temporaries = minus1[0];          compiler->temporaries = -1;
309          compiler->generals = minus1[0];          compiler->saveds = -1;
         compiler->local_size = 0;  
         compiler->size = 0;  
310    
311  #if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)  #if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
312          compiler->args = -1;          compiler->args = -1;
313  #endif  #endif
314    
 #if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) || (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)  
         compiler->flags_saved = 0;  
 #endif  
   
315  #if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)  #if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)
316          compiler->cpool = (sljit_uw*)SLJIT_MALLOC(CPOOL_SIZE * sizeof(sljit_uw) + CPOOL_SIZE * sizeof(sljit_ub));          compiler->cpool = (sljit_uw*)SLJIT_MALLOC(CPOOL_SIZE * sizeof(sljit_uw) + CPOOL_SIZE * sizeof(sljit_ub));
317          if (!compiler->cpool) {          if (!compiler->cpool) {
# Line 251  struct sljit_compiler* sljit_create_comp Line 322  struct sljit_compiler* sljit_create_comp
322          }          }
323          compiler->cpool_unique = (sljit_ub*)(compiler->cpool + CPOOL_SIZE);          compiler->cpool_unique = (sljit_ub*)(compiler->cpool + CPOOL_SIZE);
324          compiler->cpool_diff = 0xffffffff;          compiler->cpool_diff = 0xffffffff;
         compiler->cpool_fill = 0;  
         compiler->patches = 0;  
325  #endif  #endif
326    
327  #if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)  #if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
         compiler->has_locals = 0;  
328          compiler->delay_slot = UNMOVABLE_INS;          compiler->delay_slot = UNMOVABLE_INS;
329  #endif  #endif
330    
331  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)  #if (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32)
332          compiler->verbose = NULL;          compiler->delay_slot = UNMOVABLE_INS;
 #endif  
   
 #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) || (defined SLJIT_DEBUG && SLJIT_DEBUG)  
         compiler->skip_checks = 0;  
333  #endif  #endif
334    
335  #if (defined SLJIT_NEEDS_COMPILER_INIT && SLJIT_NEEDS_COMPILER_INIT)  #if (defined SLJIT_NEEDS_COMPILER_INIT && SLJIT_NEEDS_COMPILER_INIT)
# Line 278  struct sljit_compiler* sljit_create_comp Line 342  struct sljit_compiler* sljit_create_comp
342          return compiler;          return compiler;
343  }  }
344    
345  void sljit_free_compiler(struct sljit_compiler *compiler)  SLJIT_API_FUNC_ATTRIBUTE void sljit_free_compiler(struct sljit_compiler *compiler)
346  {  {
347          struct sljit_memory_fragment *buf;          struct sljit_memory_fragment *buf;
348          struct sljit_memory_fragment *curr;          struct sljit_memory_fragment *curr;
# Line 304  void sljit_free_compiler(struct sljit_co Line 368  void sljit_free_compiler(struct sljit_co
368  }  }
369    
370  #if (defined SLJIT_CONFIG_ARM_THUMB2 && SLJIT_CONFIG_ARM_THUMB2)  #if (defined SLJIT_CONFIG_ARM_THUMB2 && SLJIT_CONFIG_ARM_THUMB2)
371  void sljit_free_code(void* code)  SLJIT_API_FUNC_ATTRIBUTE void sljit_free_code(void* code)
372  {  {
373          /* Remove thumb mode flag. */          /* Remove thumb mode flag. */
374          SLJIT_FREE_EXEC((void*)((sljit_uw)code & ~0x1));          SLJIT_FREE_EXEC((void*)((sljit_uw)code & ~0x1));
375  }  }
376  #elif (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)  #elif (defined SLJIT_INDIRECT_CALL && SLJIT_INDIRECT_CALL)
377  void sljit_free_code(void* code)  SLJIT_API_FUNC_ATTRIBUTE void sljit_free_code(void* code)
378  {  {
379          /* Resolve indirection. */          /* Resolve indirection. */
380          code = (void*)(*(sljit_uw*)code);          code = (void*)(*(sljit_uw*)code);
381          SLJIT_FREE_EXEC(code);          SLJIT_FREE_EXEC(code);
382  }  }
383  #else  #else
384  void sljit_free_code(void* code)  SLJIT_API_FUNC_ATTRIBUTE void sljit_free_code(void* code)
385  {  {
386          SLJIT_FREE_EXEC(code);          SLJIT_FREE_EXEC(code);
387  }  }
388  #endif  #endif
389    
390  void sljit_set_label(struct sljit_jump *jump, struct sljit_label* label)  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_label(struct sljit_jump *jump, struct sljit_label* label)
391  {  {
392          if (SLJIT_LIKELY(!!jump) && SLJIT_LIKELY(!!label)) {          if (SLJIT_LIKELY(!!jump) && SLJIT_LIKELY(!!label)) {
393                  jump->flags &= ~JUMP_ADDR;                  jump->flags &= ~JUMP_ADDR;
# Line 332  void sljit_set_label(struct sljit_jump * Line 396  void sljit_set_label(struct sljit_jump *
396          }          }
397  }  }
398    
399  void sljit_set_target(struct sljit_jump *jump, sljit_uw target)  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_target(struct sljit_jump *jump, sljit_uw target)
400  {  {
401          if (SLJIT_LIKELY(!!jump)) {          if (SLJIT_LIKELY(!!jump)) {
402                  SLJIT_ASSERT(jump->flags & SLJIT_REWRITABLE_JUMP);                  SLJIT_ASSERT(jump->flags & SLJIT_REWRITABLE_JUMP);
# Line 383  static void* ensure_abuf(struct sljit_co Line 447  static void* ensure_abuf(struct sljit_co
447          return new_frag->memory;          return new_frag->memory;
448  }  }
449    
450  void* sljit_alloc_memory(struct sljit_compiler *compiler, int size)  SLJIT_API_FUNC_ATTRIBUTE void* sljit_alloc_memory(struct sljit_compiler *compiler, int size)
451  {  {
452          CHECK_ERROR_PTR();          CHECK_ERROR_PTR();
453    
# Line 448  static SLJIT_INLINE void set_const(struc Line 512  static SLJIT_INLINE void set_const(struc
512          compiler->last_const = const_;          compiler->last_const = const_;
513  }  }
514    
515  #define depends_on(exp, reg) \  #define ADDRESSING_DEPENDS_ON(exp, reg) \
516          (((exp) & SLJIT_MEM) && (((exp) & 0xf) == reg || (((exp) >> 4) & 0xf) == reg))          (((exp) & SLJIT_MEM) && (((exp) & 0xf) == reg || (((exp) >> 4) & 0xf) == reg))
517    
518  #if (defined SLJIT_DEBUG && SLJIT_DEBUG)  #if (defined SLJIT_DEBUG && SLJIT_DEBUG)
# Line 491  static SLJIT_INLINE void set_const(struc Line 555  static SLJIT_INLINE void set_const(struc
555          }          }
556    
557  #define FUNCTION_CHECK_IS_REG(r) \  #define FUNCTION_CHECK_IS_REG(r) \
558          ((r) == SLJIT_UNUSED || (r) == SLJIT_LOCALS_REG || \          ((r) == SLJIT_UNUSED || \
559          ((r) >= SLJIT_TEMPORARY_REG1 && (r) <= SLJIT_TEMPORARY_REG3 && (r) <= SLJIT_TEMPORARY_REG1 - 1 + compiler->temporaries) || \          ((r) >= SLJIT_TEMPORARY_REG1 && (r) <= SLJIT_TEMPORARY_REG1 - 1 + compiler->temporaries) || \
560          ((r) >= SLJIT_GENERAL_REG1 && (r) <= SLJIT_GENERAL_REG3 && (r) <= SLJIT_GENERAL_REG1 - 1 + compiler->generals)) \          ((r) >= SLJIT_SAVED_REG1 && (r) <= SLJIT_SAVED_REG1 - 1 + compiler->saveds))
561    
562  #define FUNCTION_CHECK_SRC(p, i) \  #define FUNCTION_CHECK_SRC(p, i) \
563          SLJIT_ASSERT(compiler->temporaries != -1 && compiler->generals != -1); \          SLJIT_ASSERT(compiler->temporaries != -1 && compiler->saveds != -1); \
564          if (((p) >= SLJIT_TEMPORARY_REG1 && (p) <= SLJIT_TEMPORARY_REG1 - 1 + compiler->temporaries) || \          if (FUNCTION_CHECK_IS_REG(p)) \
565                          ((p) >= SLJIT_GENERAL_REG1 && (p) <= SLJIT_GENERAL_REG1 - 1 + compiler->generals) || \                  SLJIT_ASSERT((i) == 0 && (p) != SLJIT_UNUSED); \
                         (p) == SLJIT_LOCALS_REG) \  
                 SLJIT_ASSERT(i == 0); \  
566          else if ((p) == SLJIT_IMM) \          else if ((p) == SLJIT_IMM) \
567                  ; \                  ; \
568            else if ((p) == (SLJIT_MEM1(SLJIT_LOCALS_REG))) \
569                    SLJIT_ASSERT((i) >= 0 && (i) < compiler->logical_local_size); \
570          else if ((p) & SLJIT_MEM) { \          else if ((p) & SLJIT_MEM) { \
571                  SLJIT_ASSERT(FUNCTION_CHECK_IS_REG((p) & 0xf)); \                  SLJIT_ASSERT(FUNCTION_CHECK_IS_REG((p) & 0xf)); \
572                  if ((p) & 0xf0) { \                  if ((p) & 0xf0) { \
573                          SLJIT_ASSERT(FUNCTION_CHECK_IS_REG(((p) >> 4) & 0xf)); \                          SLJIT_ASSERT(FUNCTION_CHECK_IS_REG(((p) >> 4) & 0xf)); \
574                          SLJIT_ASSERT(((p) & 0xf0) != (SLJIT_LOCALS_REG << 4) && !(i & ~0x3)); \                          SLJIT_ASSERT(!((i) & ~0x3)); \
575                  } else \                  } \
                         SLJIT_ASSERT((((p) >> 4) & 0xf) == 0); \  
576                  SLJIT_ASSERT(((p) >> 9) == 0); \                  SLJIT_ASSERT(((p) >> 9) == 0); \
577          } \          } \
578          else \          else \
579                  SLJIT_ASSERT_STOP();                  SLJIT_ASSERT_STOP();
580    
581  #define FUNCTION_CHECK_DST(p, i) \  #define FUNCTION_CHECK_DST(p, i) \
582          SLJIT_ASSERT(compiler->temporaries != -1 && compiler->generals != -1); \          SLJIT_ASSERT(compiler->temporaries != -1 && compiler->saveds != -1); \
583          if (((p) >= SLJIT_TEMPORARY_REG1 && (p) <= SLJIT_TEMPORARY_REG1 - 1 + compiler->temporaries) || \          if (FUNCTION_CHECK_IS_REG(p)) \
584                          ((p) >= SLJIT_GENERAL_REG1 && (p) <= SLJIT_GENERAL_REG1 - 1 + compiler->generals) || \                  SLJIT_ASSERT((i) == 0); \
585                          (p) == SLJIT_UNUSED) \          else if ((p) == (SLJIT_MEM1(SLJIT_LOCALS_REG))) \
586                  SLJIT_ASSERT(i == 0); \                  SLJIT_ASSERT((i) >= 0 && (i) < compiler->logical_local_size); \
587          else if ((p) & SLJIT_MEM) { \          else if ((p) & SLJIT_MEM) { \
588                  SLJIT_ASSERT(FUNCTION_CHECK_IS_REG((p) & 0xf)); \                  SLJIT_ASSERT(FUNCTION_CHECK_IS_REG((p) & 0xf)); \
589                  if ((p) & 0xf0) { \                  if ((p) & 0xf0) { \
590                          SLJIT_ASSERT(FUNCTION_CHECK_IS_REG(((p) >> 4) & 0xf)); \                          SLJIT_ASSERT(FUNCTION_CHECK_IS_REG(((p) >> 4) & 0xf)); \
591                          SLJIT_ASSERT(((p) & 0xf0) != (SLJIT_LOCALS_REG << 4) && !(i & ~0x3)); \                          SLJIT_ASSERT(!((i) & ~0x3)); \
592                  } else \                  } \
                         SLJIT_ASSERT((((p) >> 4) & 0xf) == 0); \  
593                  SLJIT_ASSERT(((p) >> 9) == 0); \                  SLJIT_ASSERT(((p) >> 9) == 0); \
594          } \          } \
595          else \          else \
# Line 549  static SLJIT_INLINE void set_const(struc Line 611  static SLJIT_INLINE void set_const(struc
611                  SLJIT_ASSERT_STOP();                  SLJIT_ASSERT_STOP();
612    
613  #define FUNCTION_CHECK_OP1() \  #define FUNCTION_CHECK_OP1() \
614          if (GET_OPCODE(op) >= SLJIT_MOV && GET_OPCODE(op) <= SLJIT_MOVU_SI) { \          if (GET_OPCODE(op) >= SLJIT_MOV && GET_OPCODE(op) <= SLJIT_MOVU_P) { \
615                  SLJIT_ASSERT(!GET_ALL_FLAGS(op)); \                  SLJIT_ASSERT(!GET_ALL_FLAGS(op)); \
616          } \          } \
617          if (GET_OPCODE(op) >= SLJIT_MOVU && GET_OPCODE(op) <= SLJIT_MOVU_SI) { \          if (GET_OPCODE(op) >= SLJIT_MOVU && GET_OPCODE(op) <= SLJIT_MOVU_P) { \
618                  SLJIT_ASSERT(!(src & SLJIT_MEM) || (src & 0xf) != SLJIT_LOCALS_REG); \                  SLJIT_ASSERT(!(src & SLJIT_MEM) || (src & 0xf) != SLJIT_LOCALS_REG); \
619                  SLJIT_ASSERT(!(dst & SLJIT_MEM) || (dst & 0xf) != SLJIT_LOCALS_REG); \                  SLJIT_ASSERT(!(dst & SLJIT_MEM) || (dst & 0xf) != SLJIT_LOCALS_REG); \
620                  if ((src & SLJIT_MEM) && (src & 0xf)) \                  if ((src & SLJIT_MEM) && (src & 0xf)) \
# Line 563  static SLJIT_INLINE void set_const(struc Line 625  static SLJIT_INLINE void set_const(struc
625    
626  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
627    
628  void sljit_compiler_verbose(struct sljit_compiler *compiler, FILE* verbose)  SLJIT_API_FUNC_ATTRIBUTE void sljit_compiler_verbose(struct sljit_compiler *compiler, FILE* verbose)
629  {  {
630          compiler->verbose = verbose;          compiler->verbose = verbose;
631  }  }
632    
633  static char* reg_names[] = {  static char* reg_names[] = {
634          (char*)"<noreg>", (char*)"tmp_r1", (char*)"tmp_r2", (char*)"tmp_r3",          (char*)"<noreg>", (char*)"t1", (char*)"t2", (char*)"t3",
635          (char*)"tmp_er1", (char*)"tmp_er2", (char*)"gen_r1", (char*)"gen_r2",          (char*)"te1", (char*)"te2", (char*)"s1", (char*)"s2",
636          (char*)"gen_r3", (char*)"gen_er1", (char*)"gen_er2", (char*)"stack_r"          (char*)"s3", (char*)"se1", (char*)"se2", (char*)"lcr"
637  };  };
638    
639  static char* freg_names[] = {  static char* freg_names[] = {
# Line 590  static char* freg_names[] = { Line 652  static char* freg_names[] = {
652    
653  #define sljit_verbose_param(p, i) \  #define sljit_verbose_param(p, i) \
654          if ((p) & SLJIT_IMM) \          if ((p) & SLJIT_IMM) \
655                  fprintf(compiler->verbose, "#%"SLJIT_PRINT_D"d", (i)); \                  fprintf(compiler->verbose, "#%" SLJIT_PRINT_D "d", (i)); \
656          else if ((p) & SLJIT_MEM) { \          else if ((p) & SLJIT_MEM) { \
657                  if ((p) & 0xf) { \                  if ((p) & 0xf) { \
658                          if (i) { \                          if (i) { \
659                                  if (((p) >> 4) & 0xf) \                                  if (((p) >> 4) & 0xf) \
660                                          fprintf(compiler->verbose, "[%s + %s * %d]", reg_names[(p) & 0xF], reg_names[((p) >> 4)& 0xF], 1 << (i)); \                                          fprintf(compiler->verbose, "[%s + %s * %d]", reg_names[(p) & 0xF], reg_names[((p) >> 4)& 0xF], 1 << (i)); \
661                                  else \                                  else \
662                                          fprintf(compiler->verbose, "[%s + #%"SLJIT_PRINT_D"d]", reg_names[(p) & 0xF], (i)); \                                          fprintf(compiler->verbose, "[%s + #%" SLJIT_PRINT_D "d]", reg_names[(p) & 0xF], (i)); \
663                          } \                          } \
664                          else { \                          else { \
665                                  if (((p) >> 4) & 0xf) \                                  if (((p) >> 4) & 0xf) \
# Line 607  static char* freg_names[] = { Line 669  static char* freg_names[] = {
669                          } \                          } \
670                  } \                  } \
671                  else \                  else \
672                          fprintf(compiler->verbose, "[#%"SLJIT_PRINT_D"d]", (i)); \                          fprintf(compiler->verbose, "[#%" SLJIT_PRINT_D "d]", (i)); \
673          } else \          } else \
674                  fprintf(compiler->verbose, "%s", reg_names[p]);                  fprintf(compiler->verbose, "%s", reg_names[p]);
675  #define sljit_verbose_fparam(p, i) \  #define sljit_verbose_fparam(p, i) \
# Line 617  static char* freg_names[] = { Line 679  static char* freg_names[] = {
679                                  if (((p) >> 4) & 0xf) \                                  if (((p) >> 4) & 0xf) \
680                                          fprintf(compiler->verbose, "[%s + %s * %d]", reg_names[(p) & 0xF], reg_names[((p) >> 4)& 0xF], 1 << (i)); \                                          fprintf(compiler->verbose, "[%s + %s * %d]", reg_names[(p) & 0xF], reg_names[((p) >> 4)& 0xF], 1 << (i)); \
681                                  else \                                  else \
682                                          fprintf(compiler->verbose, "[%s + #%"SLJIT_PRINT_D"d]", reg_names[(p) & 0xF], (i)); \                                          fprintf(compiler->verbose, "[%s + #%" SLJIT_PRINT_D "d]", reg_names[(p) & 0xF], (i)); \
683                          } \                          } \
684                          else { \                          else { \
685                                  if (((p) >> 4) & 0xF) \                                  if (((p) >> 4) & 0xF) \
# Line 627  static char* freg_names[] = { Line 689  static char* freg_names[] = {
689                          } \                          } \
690                  } \                  } \
691                  else \                  else \
692                          fprintf(compiler->verbose, "[#%"SLJIT_PRINT_D"d]", (i)); \                          fprintf(compiler->verbose, "[#%" SLJIT_PRINT_D "d]", (i)); \
693          } else \          } else \
694                  fprintf(compiler->verbose, "%s", freg_names[p]);                  fprintf(compiler->verbose, "%s", freg_names[p]);
695    
696  static SLJIT_CONST char* op_names[] = {  static SLJIT_CONST char* op_names[] = {
697          /* op0 */          /* op0 */
698          (char*)"breakpoint", (char*)"nop",          (char*)"breakpoint", (char*)"nop",
699            (char*)"umul", (char*)"smul", (char*)"udiv", (char*)"sdiv",
700          /* op1 */          /* op1 */
701          (char*)"mov", (char*)"mov.ub", (char*)"mov.sb", (char*)"mov.uh",          (char*)"mov", (char*)"mov.ub", (char*)"mov.sb", (char*)"mov.uh",
702          (char*)"mov.sh", (char*)"mov.ui", (char*)"mov.si", (char*)"movu",          (char*)"mov.sh", (char*)"mov.ui", (char*)"mov.si", (char*)"mov.p",
703          (char*)"movu.ub", (char*)"movu.sb", (char*)"movu.uh", (char*)"movu.sh",          (char*)"movu", (char*)"movu.ub", (char*)"movu.sb", (char*)"movu.uh",
704          (char*)"movu.ui", (char*)"movu.si", (char*)"not", (char*)"neg",          (char*)"movu.sh", (char*)"movu.ui", (char*)"movu.si", (char*)"movu.p",
705          (char*)"clz",          (char*)"not", (char*)"neg", (char*)"clz",
706          /* op2 */          /* op2 */
707          (char*)"add", (char*)"addc", (char*)"sub", (char*)"subc",          (char*)"add", (char*)"addc", (char*)"sub", (char*)"subc",
708          (char*)"mul", (char*)"and", (char*)"or", (char*)"xor",          (char*)"mul", (char*)"and", (char*)"or", (char*)"xor",
# Line 691  static SLJIT_INLINE void check_sljit_gen Line 754  static SLJIT_INLINE void check_sljit_gen
754  #endif  #endif
755  }  }
756    
757  static SLJIT_INLINE void check_sljit_emit_enter(struct sljit_compiler *compiler, int args, int temporaries, int generals, int local_size)  static SLJIT_INLINE void check_sljit_emit_enter(struct sljit_compiler *compiler, int args, int temporaries, int saveds, int local_size)
758  {  {
759          /* If debug and verbose are disabled, all arguments are unused. */          /* If debug and verbose are disabled, all arguments are unused. */
760          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
761          SLJIT_UNUSED_ARG(args);          SLJIT_UNUSED_ARG(args);
762          SLJIT_UNUSED_ARG(temporaries);          SLJIT_UNUSED_ARG(temporaries);
763          SLJIT_UNUSED_ARG(generals);          SLJIT_UNUSED_ARG(saveds);
764          SLJIT_UNUSED_ARG(local_size);          SLJIT_UNUSED_ARG(local_size);
765    
766          SLJIT_ASSERT(args >= 0 && args <= 3);          SLJIT_ASSERT(args >= 0 && args <= 3);
767          SLJIT_ASSERT(temporaries >= 0 && temporaries <= SLJIT_NO_TMP_REGISTERS);          SLJIT_ASSERT(temporaries >= 0 && temporaries <= SLJIT_NO_TMP_REGISTERS);
768          SLJIT_ASSERT(generals >= 0 && generals <= SLJIT_NO_GEN_REGISTERS);          SLJIT_ASSERT(saveds >= 0 && saveds <= SLJIT_NO_GEN_REGISTERS);
769          SLJIT_ASSERT(args <= generals);          SLJIT_ASSERT(args <= saveds);
770          SLJIT_ASSERT(local_size >= 0 && local_size <= SLJIT_MAX_LOCAL_SIZE);          SLJIT_ASSERT(local_size >= 0 && local_size <= SLJIT_MAX_LOCAL_SIZE);
771  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
772          if (SLJIT_UNLIKELY(!!compiler->verbose))          if (SLJIT_UNLIKELY(!!compiler->verbose))
773                  fprintf(compiler->verbose, "  enter args=%d temporaries=%d generals=%d local_size=%d\n", args, temporaries, generals, local_size);                  fprintf(compiler->verbose, "  enter args=%d temporaries=%d saveds=%d local_size=%d\n", args, temporaries, saveds, local_size);
774  #endif  #endif
775  }  }
776    
777  static SLJIT_INLINE void check_sljit_fake_enter(struct sljit_compiler *compiler, int args, int temporaries, int generals, int local_size)  static SLJIT_INLINE void check_sljit_set_context(struct sljit_compiler *compiler, int args, int temporaries, int saveds, int local_size)
778  {  {
779          /* If debug and verbose are disabled, all arguments are unused. */          /* If debug and verbose are disabled, all arguments are unused. */
780          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
781          SLJIT_UNUSED_ARG(args);          SLJIT_UNUSED_ARG(args);
782          SLJIT_UNUSED_ARG(temporaries);          SLJIT_UNUSED_ARG(temporaries);
783          SLJIT_UNUSED_ARG(generals);          SLJIT_UNUSED_ARG(saveds);
784          SLJIT_UNUSED_ARG(local_size);          SLJIT_UNUSED_ARG(local_size);
785    
786    #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) || (defined SLJIT_DEBUG && SLJIT_DEBUG)
787            if (SLJIT_UNLIKELY(compiler->skip_checks)) {
788                    compiler->skip_checks = 0;
789                    return;
790            }
791    #endif
792    
793          SLJIT_ASSERT(args >= 0 && args <= 3);          SLJIT_ASSERT(args >= 0 && args <= 3);
794          SLJIT_ASSERT(temporaries >= 0 && temporaries <= SLJIT_NO_TMP_REGISTERS);          SLJIT_ASSERT(temporaries >= 0 && temporaries <= SLJIT_NO_TMP_REGISTERS);
795          SLJIT_ASSERT(generals >= 0 && generals <= SLJIT_NO_GEN_REGISTERS);          SLJIT_ASSERT(saveds >= 0 && saveds <= SLJIT_NO_GEN_REGISTERS);
796          SLJIT_ASSERT(args <= generals);          SLJIT_ASSERT(args <= saveds);
797          SLJIT_ASSERT(local_size >= 0 && local_size <= SLJIT_MAX_LOCAL_SIZE);          SLJIT_ASSERT(local_size >= 0 && local_size <= SLJIT_MAX_LOCAL_SIZE);
798  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
799          if (SLJIT_UNLIKELY(!!compiler->verbose))          if (SLJIT_UNLIKELY(!!compiler->verbose))
800                  fprintf(compiler->verbose, "  fake_enter args=%d temporaries=%d generals=%d local_size=%d\n", args, temporaries, generals, local_size);                  fprintf(compiler->verbose, "  set_context args=%d temporaries=%d saveds=%d local_size=%d\n", args, temporaries, saveds, local_size);
801  #endif  #endif
802  }  }
803    
804  static SLJIT_INLINE void check_sljit_emit_return(struct sljit_compiler *compiler, int src, sljit_w srcw)  static SLJIT_INLINE void check_sljit_emit_return(struct sljit_compiler *compiler, int op, int src, sljit_w srcw)
805  {  {
806          /* If debug and verbose are disabled, all arguments are unused. */          /* If debug and verbose are disabled, all arguments are unused. */
807          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
808            SLJIT_UNUSED_ARG(op);
809          SLJIT_UNUSED_ARG(src);          SLJIT_UNUSED_ARG(src);
810          SLJIT_UNUSED_ARG(srcw);          SLJIT_UNUSED_ARG(srcw);
811    
812  #if (defined SLJIT_DEBUG && SLJIT_DEBUG)  #if (defined SLJIT_DEBUG && SLJIT_DEBUG)
813          if (src != SLJIT_UNUSED) {          if (op != SLJIT_UNUSED) {
814                    SLJIT_ASSERT(op >= SLJIT_MOV && op <= SLJIT_MOV_P);
815                  FUNCTION_CHECK_SRC(src, srcw);                  FUNCTION_CHECK_SRC(src, srcw);
816          }          }
817          else          else
818                  SLJIT_ASSERT(srcw == 0);                  SLJIT_ASSERT(src == 0 && srcw == 0);
819  #endif  #endif
820  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
821          if (SLJIT_UNLIKELY(!!compiler->verbose)) {          if (SLJIT_UNLIKELY(!!compiler->verbose)) {
822                  fprintf(compiler->verbose, "  return ");                  if (op == SLJIT_UNUSED)
823                  sljit_verbose_param(src, srcw);                          fprintf(compiler->verbose, "  return\n");
824                  fprintf(compiler->verbose, "\n");                  else {
825                            fprintf(compiler->verbose, "  return %s ", op_names[op]);
826                            sljit_verbose_param(src, srcw);
827                            fprintf(compiler->verbose, "\n");
828                    }
829          }          }
830  #endif  #endif
831  }  }
832    
833  static SLJIT_INLINE void check_sljit_emit_fast_enter(struct sljit_compiler *compiler, int dst, sljit_w dstw, int args, int temporaries, int generals, int local_size)  static SLJIT_INLINE void check_sljit_emit_fast_enter(struct sljit_compiler *compiler, int dst, sljit_w dstw)
834  {  {
835          /* If debug and verbose are disabled, all arguments are unused. */          /* If debug and verbose are disabled, all arguments are unused. */
836          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
837          SLJIT_UNUSED_ARG(dst);          SLJIT_UNUSED_ARG(dst);
838          SLJIT_UNUSED_ARG(dstw);          SLJIT_UNUSED_ARG(dstw);
         SLJIT_UNUSED_ARG(args);  
         SLJIT_UNUSED_ARG(temporaries);  
         SLJIT_UNUSED_ARG(generals);  
         SLJIT_UNUSED_ARG(local_size);  
839    
         SLJIT_ASSERT(args >= 0 && args <= 3);  
         SLJIT_ASSERT(temporaries >= 0 && temporaries <= SLJIT_NO_TMP_REGISTERS);  
         SLJIT_ASSERT(generals >= 0 && generals <= SLJIT_NO_GEN_REGISTERS);  
         SLJIT_ASSERT(args <= generals);  
         SLJIT_ASSERT(local_size >= 0 && local_size <= SLJIT_MAX_LOCAL_SIZE);  
840  #if (defined SLJIT_DEBUG && SLJIT_DEBUG)  #if (defined SLJIT_DEBUG && SLJIT_DEBUG)
         compiler->temporaries = temporaries;  
         compiler->generals = generals;  
841          FUNCTION_CHECK_DST(dst, dstw);          FUNCTION_CHECK_DST(dst, dstw);
         compiler->temporaries = -1;  
         compiler->generals = -1;  
842  #endif  #endif
843  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
844          if (SLJIT_UNLIKELY(!!compiler->verbose)) {          if (SLJIT_UNLIKELY(!!compiler->verbose)) {
845                  fprintf(compiler->verbose, "  fast_enter ");                  fprintf(compiler->verbose, "  fast_enter ");
846                  sljit_verbose_param(dst, dstw);                  sljit_verbose_param(dst, dstw);
847                  fprintf(compiler->verbose, " args=%d temporaries=%d generals=%d local_size=%d\n", args, temporaries, generals, local_size);                  fprintf(compiler->verbose, "\n");
848          }          }
849  #endif  #endif
850  }  }
# Line 811  static SLJIT_INLINE void check_sljit_emi Line 874  static SLJIT_INLINE void check_sljit_emi
874          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
875          SLJIT_UNUSED_ARG(op);          SLJIT_UNUSED_ARG(op);
876    
877          SLJIT_ASSERT(op >= SLJIT_BREAKPOINT && op <= SLJIT_NOP);          SLJIT_ASSERT((op >= SLJIT_BREAKPOINT && op <= SLJIT_SMUL)
878                    || ((op & ~SLJIT_INT_OP) >= SLJIT_UDIV && (op & ~SLJIT_INT_OP) <= SLJIT_SDIV));
879  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
880          if (SLJIT_UNLIKELY(!!compiler->verbose))          if (SLJIT_UNLIKELY(!!compiler->verbose))
881                  fprintf(compiler->verbose, "  %s\n", op_names[op]);                  fprintf(compiler->verbose, "  %s%s\n", !(op & SLJIT_INT_OP) ? "" : "i", op_names[GET_OPCODE(op)]);
882  #endif  #endif
883  }  }
884    
# Line 830  static SLJIT_INLINE void check_sljit_emi Line 894  static SLJIT_INLINE void check_sljit_emi
894          SLJIT_UNUSED_ARG(src);          SLJIT_UNUSED_ARG(src);
895          SLJIT_UNUSED_ARG(srcw);          SLJIT_UNUSED_ARG(srcw);
896    
897    #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) || (defined SLJIT_DEBUG && SLJIT_DEBUG)
898            if (SLJIT_UNLIKELY(compiler->skip_checks)) {
899                    compiler->skip_checks = 0;
900                    return;
901            }
902    #endif
903    
904          SLJIT_ASSERT(GET_OPCODE(op) >= SLJIT_MOV && GET_OPCODE(op) <= SLJIT_CLZ);          SLJIT_ASSERT(GET_OPCODE(op) >= SLJIT_MOV && GET_OPCODE(op) <= SLJIT_CLZ);
905  #if (defined SLJIT_DEBUG && SLJIT_DEBUG)  #if (defined SLJIT_DEBUG && SLJIT_DEBUG)
906          FUNCTION_CHECK_OP();          FUNCTION_CHECK_OP();
# Line 892  static SLJIT_INLINE void check_sljit_emi Line 963  static SLJIT_INLINE void check_sljit_emi
963  #endif  #endif
964  }  }
965    
966    static SLJIT_INLINE void check_sljit_get_register_index(int reg)
967    {
968            SLJIT_UNUSED_ARG(reg);
969            SLJIT_ASSERT(reg > 0 && reg <= SLJIT_NO_REGISTERS);
970    }
971    
972    static SLJIT_INLINE void check_sljit_emit_op_custom(struct sljit_compiler *compiler,
973            void *instruction, int size)
974    {
975            SLJIT_UNUSED_ARG(compiler);
976            SLJIT_UNUSED_ARG(instruction);
977            SLJIT_UNUSED_ARG(size);
978            SLJIT_ASSERT(instruction);
979    }
980    
981  static SLJIT_INLINE void check_sljit_emit_fop1(struct sljit_compiler *compiler, int op,  static SLJIT_INLINE void check_sljit_emit_fop1(struct sljit_compiler *compiler, int op,
982          int dst, sljit_w dstw,          int dst, sljit_w dstw,
983          int src, sljit_w srcw)          int src, sljit_w srcw)
# Line 904  static SLJIT_INLINE void check_sljit_emi Line 990  static SLJIT_INLINE void check_sljit_emi
990          SLJIT_UNUSED_ARG(src);          SLJIT_UNUSED_ARG(src);
991          SLJIT_UNUSED_ARG(srcw);          SLJIT_UNUSED_ARG(srcw);
992    
993    #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) || (defined SLJIT_DEBUG && SLJIT_DEBUG)
994            if (SLJIT_UNLIKELY(compiler->skip_checks)) {
995                    compiler->skip_checks = 0;
996                    return;
997            }
998    #endif
999    
1000          SLJIT_ASSERT(sljit_is_fpu_available());          SLJIT_ASSERT(sljit_is_fpu_available());
1001          SLJIT_ASSERT(GET_OPCODE(op) >= SLJIT_FCMP && GET_OPCODE(op) <= SLJIT_FABS);          SLJIT_ASSERT(GET_OPCODE(op) >= SLJIT_FCMP && GET_OPCODE(op) <= SLJIT_FABS);
1002  #if (defined SLJIT_DEBUG && SLJIT_DEBUG)  #if (defined SLJIT_DEBUG && SLJIT_DEBUG)
# Line 1019  static SLJIT_INLINE void check_sljit_emi Line 1112  static SLJIT_INLINE void check_sljit_emi
1112  #endif  #endif
1113  }  }
1114    
1115    static SLJIT_INLINE void check_sljit_emit_fcmp(struct sljit_compiler *compiler, int type,
1116            int src1, sljit_w src1w,
1117            int src2, sljit_w src2w)
1118    {
1119            SLJIT_UNUSED_ARG(compiler);
1120            SLJIT_UNUSED_ARG(type);
1121            SLJIT_UNUSED_ARG(src1);
1122            SLJIT_UNUSED_ARG(src1w);
1123            SLJIT_UNUSED_ARG(src2);
1124            SLJIT_UNUSED_ARG(src2w);
1125    
1126            SLJIT_ASSERT(sljit_is_fpu_available());
1127            SLJIT_ASSERT(!(type & ~(0xff | SLJIT_REWRITABLE_JUMP)));
1128            SLJIT_ASSERT((type & 0xff) >= SLJIT_C_FLOAT_EQUAL && (type & 0xff) <= SLJIT_C_FLOAT_ORDERED);
1129    #if (defined SLJIT_DEBUG && SLJIT_DEBUG)
1130            FUNCTION_FCHECK(src1, src1w);
1131            FUNCTION_FCHECK(src2, src2w);
1132    #endif
1133    #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
1134            if (SLJIT_UNLIKELY(!!compiler->verbose)) {
1135                    fprintf(compiler->verbose, "  fcmp%s <%s> ", !(type & SLJIT_REWRITABLE_JUMP) ? "" : "R", jump_names[type & 0xff]);
1136                    sljit_verbose_fparam(src1, src1w);
1137                    fprintf(compiler->verbose, ", ");
1138                    sljit_verbose_fparam(src2, src2w);
1139                    fprintf(compiler->verbose, "\n");
1140            }
1141    #endif
1142    }
1143    
1144  static SLJIT_INLINE void check_sljit_emit_ijump(struct sljit_compiler *compiler, int type, int src, sljit_w srcw)  static SLJIT_INLINE void check_sljit_emit_ijump(struct sljit_compiler *compiler, int type, int src, sljit_w srcw)
1145  {  {
1146          /* If debug and verbose are disabled, all arguments are unused. */          /* If debug and verbose are disabled, all arguments are unused. */
# Line 1065  static SLJIT_INLINE void check_sljit_emi Line 1187  static SLJIT_INLINE void check_sljit_emi
1187  #endif  #endif
1188  }  }
1189    
1190    static SLJIT_INLINE void check_sljit_get_local_base(struct sljit_compiler *compiler, int dst, sljit_w dstw, sljit_w offset)
1191    {
1192            SLJIT_UNUSED_ARG(compiler);
1193            SLJIT_UNUSED_ARG(dst);
1194            SLJIT_UNUSED_ARG(dstw);
1195            SLJIT_UNUSED_ARG(offset);
1196    
1197    #if (defined SLJIT_DEBUG && SLJIT_DEBUG)
1198            FUNCTION_CHECK_DST(dst, dstw);
1199    #endif
1200    #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
1201            if (SLJIT_UNLIKELY(!!compiler->verbose)) {
1202                    fprintf(compiler->verbose, "  local_base ");
1203                    sljit_verbose_param(dst, dstw);
1204                    fprintf(compiler->verbose, ", #%" SLJIT_PRINT_D "d\n", offset);
1205            }
1206    #endif
1207    }
1208    
1209  static SLJIT_INLINE void check_sljit_emit_const(struct sljit_compiler *compiler, int dst, sljit_w dstw, sljit_w init_value)  static SLJIT_INLINE void check_sljit_emit_const(struct sljit_compiler *compiler, int dst, sljit_w dstw, sljit_w init_value)
1210  {  {
1211          /* If debug and verbose are disabled, all arguments are unused. */          /* If debug and verbose are disabled, all arguments are unused. */
# Line 1080  static SLJIT_INLINE void check_sljit_emi Line 1221  static SLJIT_INLINE void check_sljit_emi
1221          if (SLJIT_UNLIKELY(!!compiler->verbose)) {          if (SLJIT_UNLIKELY(!!compiler->verbose)) {
1222                  fprintf(compiler->verbose, "  const ");                  fprintf(compiler->verbose, "  const ");
1223                  sljit_verbose_param(dst, dstw);                  sljit_verbose_param(dst, dstw);
1224                  fprintf(compiler->verbose, ", #%"SLJIT_PRINT_D"d\n", init_value);                  fprintf(compiler->verbose, ", #%" SLJIT_PRINT_D "d\n", init_value);
1225          }          }
1226  #endif  #endif
1227  }  }
1228    
1229    static SLJIT_INLINE int emit_mov_before_return(struct sljit_compiler *compiler, int op, int src, sljit_w srcw)
1230    {
1231            /* Return if don't need to do anything. */
1232            if (op == SLJIT_UNUSED)
1233                    return SLJIT_SUCCESS;
1234    
1235    #if (defined SLJIT_64BIT_ARCHITECTURE && SLJIT_64BIT_ARCHITECTURE)
1236            /* At the moment the pointer size is always equal to sljit_w. May be changed in the future. */
1237            if (src == SLJIT_RETURN_REG && (op == SLJIT_MOV || op == SLJIT_MOV_P))
1238                    return SLJIT_SUCCESS;
1239    #else
1240            if (src == SLJIT_RETURN_REG && (op == SLJIT_MOV || op == SLJIT_MOV_UI || op == SLJIT_MOV_SI || op == SLJIT_MOV_P))
1241                    return SLJIT_SUCCESS;
1242    #endif
1243    
1244    #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) || (defined SLJIT_DEBUG && SLJIT_DEBUG)
1245            compiler->skip_checks = 1;
1246    #endif
1247            return sljit_emit_op1(compiler, op, SLJIT_RETURN_REG, 0, src, srcw);
1248    }
1249    
1250    /* CPU description section */
1251    
1252    #if (defined SLJIT_32BIT_ARCHITECTURE && SLJIT_32BIT_ARCHITECTURE)
1253    #define SLJIT_CPUINFO_PART1 " 32bit ("
1254    #elif (defined SLJIT_64BIT_ARCHITECTURE && SLJIT_64BIT_ARCHITECTURE)
1255    #define SLJIT_CPUINFO_PART1 " 64bit ("
1256    #else
1257    #error "Internal error: CPU type info missing"
1258    #endif
1259    
1260    #if (defined SLJIT_LITTLE_ENDIAN && SLJIT_LITTLE_ENDIAN)
1261    #define SLJIT_CPUINFO_PART2 "little endian + "
1262    #elif (defined SLJIT_BIG_ENDIAN && SLJIT_BIG_ENDIAN)
1263    #define SLJIT_CPUINFO_PART2 "big endian + "
1264    #else
1265    #error "Internal error: CPU type info missing"
1266    #endif
1267    
1268    #if (defined SLJIT_UNALIGNED && SLJIT_UNALIGNED)
1269    #define SLJIT_CPUINFO_PART3 "unaligned)"
1270    #else
1271    #define SLJIT_CPUINFO_PART3 "aligned)"
1272    #endif
1273    
1274    #define SLJIT_CPUINFO SLJIT_CPUINFO_PART1 SLJIT_CPUINFO_PART2 SLJIT_CPUINFO_PART3
1275    
1276  #if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)  #if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
1277          #include "sljitNativeX86_common.c"          #include "sljitNativeX86_common.c"
1278  #elif (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)  #elif (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
# Line 1101  static SLJIT_INLINE void check_sljit_emi Line 1289  static SLJIT_INLINE void check_sljit_emi
1289          #include "sljitNativePPC_common.c"          #include "sljitNativePPC_common.c"
1290  #elif (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)  #elif (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
1291          #include "sljitNativeMIPS_common.c"          #include "sljitNativeMIPS_common.c"
1292    #elif (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32)
1293            #include "sljitNativeSPARC_common.c"
1294  #endif  #endif
1295    
1296  #if !(defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)  #if !(defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
1297  struct sljit_jump* sljit_emit_cmp(struct sljit_compiler *compiler, int type,  
1298    SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_cmp(struct sljit_compiler *compiler, int type,
1299          int src1, sljit_w src1w,          int src1, sljit_w src1w,
1300          int src2, sljit_w src2w)          int src2, sljit_w src2w)
1301  {  {
# Line 1170  struct sljit_jump* sljit_emit_cmp(struct Line 1361  struct sljit_jump* sljit_emit_cmp(struct
1361  #endif  #endif
1362          return sljit_emit_jump(compiler, condition | (type & SLJIT_REWRITABLE_JUMP));          return sljit_emit_jump(compiler, condition | (type & SLJIT_REWRITABLE_JUMP));
1363  }  }
1364    
1365    SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_fcmp(struct sljit_compiler *compiler, int type,
1366            int src1, sljit_w src1w,
1367            int src2, sljit_w src2w)
1368    {
1369            int flags, condition;
1370    
1371            check_sljit_emit_fcmp(compiler, type, src1, src1w, src2, src2w);
1372    
1373            condition = type & 0xff;
1374            if (condition <= SLJIT_C_FLOAT_NOT_EQUAL)
1375                    flags = SLJIT_SET_E;
1376            else
1377                    flags = SLJIT_SET_S;
1378    
1379    #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) || (defined SLJIT_DEBUG && SLJIT_DEBUG)
1380            compiler->skip_checks = 1;
1381    #endif
1382            sljit_emit_fop1(compiler, SLJIT_FCMP | flags, src1, src1w, src2, src2w);
1383    
1384    #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) || (defined SLJIT_DEBUG && SLJIT_DEBUG)
1385            compiler->skip_checks = 1;
1386    #endif
1387            return sljit_emit_jump(compiler, condition | (type & SLJIT_REWRITABLE_JUMP));
1388    }
1389    
1390    #endif
1391    
1392    #if !(defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) && !(defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
1393    
1394    SLJIT_API_FUNC_ATTRIBUTE int sljit_get_local_base(struct sljit_compiler *compiler, int dst, sljit_w dstw, sljit_w offset)
1395    {
1396            CHECK_ERROR();
1397            check_sljit_get_local_base(compiler, dst, dstw, offset);
1398    
1399            ADJUST_LOCAL_OFFSET(SLJIT_MEM1(SLJIT_LOCALS_REG), offset);
1400    #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) || (defined SLJIT_DEBUG && SLJIT_DEBUG)
1401            compiler->skip_checks = 1;
1402    #endif
1403            if (offset != 0)
1404                    return sljit_emit_op2(compiler, SLJIT_ADD | SLJIT_KEEP_FLAGS, dst, dstw, SLJIT_LOCALS_REG, 0, SLJIT_IMM, offset);
1405            return sljit_emit_op1(compiler, SLJIT_MOV, dst, dstw, SLJIT_LOCALS_REG, 0);
1406    }
1407    
1408  #endif  #endif
1409    
1410  #else /* SLJIT_CONFIG_UNSUPPORTED */  #else /* SLJIT_CONFIG_UNSUPPORTED */
1411    
1412  /* Empty function bodies for those machines, which are not (yet) supported. */  /* Empty function bodies for those machines, which are not (yet) supported. */
1413    
1414  SLJIT_CONST char* sljit_get_platform_name()  SLJIT_API_FUNC_ATTRIBUTE SLJIT_CONST char* sljit_get_platform_name(void)
1415  {  {
1416          return "unsupported";          return "unsupported";
1417  }  }
1418    
1419  struct sljit_compiler* sljit_create_compiler(void)  SLJIT_API_FUNC_ATTRIBUTE struct sljit_compiler* sljit_create_compiler(void)
1420  {  {
1421          SLJIT_ASSERT_STOP();          SLJIT_ASSERT_STOP();
1422          return NULL;          return NULL;
1423  }  }
1424    
1425  void sljit_free_compiler(struct sljit_compiler *compiler)  SLJIT_API_FUNC_ATTRIBUTE void sljit_free_compiler(struct sljit_compiler *compiler)
1426  {  {
1427          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1428          SLJIT_ASSERT_STOP();          SLJIT_ASSERT_STOP();
1429  }  }
1430    
1431  void* sljit_alloc_memory(struct sljit_compiler *compiler, int size)  SLJIT_API_FUNC_ATTRIBUTE void* sljit_alloc_memory(struct sljit_compiler *compiler, int size)
1432  {  {
1433          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1434          SLJIT_UNUSED_ARG(size);          SLJIT_UNUSED_ARG(size);
# Line 1202  void* sljit_alloc_memory(struct sljit_co Line 1437  void* sljit_alloc_memory(struct sljit_co
1437  }  }
1438    
1439  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
1440  void sljit_compiler_verbose(struct sljit_compiler *compiler, FILE* verbose)  SLJIT_API_FUNC_ATTRIBUTE void sljit_compiler_verbose(struct sljit_compiler *compiler, FILE* verbose)
1441  {  {
1442          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1443          SLJIT_UNUSED_ARG(verbose);          SLJIT_UNUSED_ARG(verbose);
# Line 1210  void sljit_compiler_verbose(struct sljit Line 1445  void sljit_compiler_verbose(struct sljit
1445  }  }
1446  #endif  #endif
1447    
1448  void* sljit_generate_code(struct sljit_compiler *compiler)  SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compiler)
1449  {  {
1450          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1451          SLJIT_ASSERT_STOP();          SLJIT_ASSERT_STOP();
1452          return NULL;          return NULL;
1453  }  }
1454    
1455  void sljit_free_code(void* code)  SLJIT_API_FUNC_ATTRIBUTE void sljit_free_code(void* code)
1456  {  {
1457          SLJIT_UNUSED_ARG(code);          SLJIT_UNUSED_ARG(code);
1458          SLJIT_ASSERT_STOP();          SLJIT_ASSERT_STOP();
1459  }  }
1460    
1461  int sljit_emit_enter(struct sljit_compiler *compiler, int args, int temporaries, int generals, int local_size)  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_enter(struct sljit_compiler *compiler, int args, int temporaries, int saveds, int local_size)
1462  {  {
1463          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1464          SLJIT_UNUSED_ARG(args);          SLJIT_UNUSED_ARG(args);
1465          SLJIT_UNUSED_ARG(temporaries);          SLJIT_UNUSED_ARG(temporaries);
1466          SLJIT_UNUSED_ARG(generals);          SLJIT_UNUSED_ARG(saveds);
1467          SLJIT_UNUSED_ARG(local_size);          SLJIT_UNUSED_ARG(local_size);
1468          SLJIT_ASSERT_STOP();          SLJIT_ASSERT_STOP();
1469          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1470  }  }
1471    
1472  void sljit_fake_enter(struct sljit_compiler *compiler, int args, int temporaries, int generals, int local_size)  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_context(struct sljit_compiler *compiler, int args, int temporaries, int saveds, int local_size)
1473  {  {
1474          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1475          SLJIT_UNUSED_ARG(args);          SLJIT_UNUSED_ARG(args);
1476          SLJIT_UNUSED_ARG(temporaries);          SLJIT_UNUSED_ARG(temporaries);
1477          SLJIT_UNUSED_ARG(generals);          SLJIT_UNUSED_ARG(saveds);
1478          SLJIT_UNUSED_ARG(local_size);          SLJIT_UNUSED_ARG(local_size);
1479          SLJIT_ASSERT_STOP();          SLJIT_ASSERT_STOP();
1480  }  }
1481    
1482  int sljit_emit_return(struct sljit_compiler *compiler, int src, sljit_w srcw)  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_return(struct sljit_compiler *compiler, int op, int src, sljit_w srcw)
1483  {  {
1484          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1485            SLJIT_UNUSED_ARG(op);
1486          SLJIT_UNUSED_ARG(src);          SLJIT_UNUSED_ARG(src);
1487          SLJIT_UNUSED_ARG(srcw);          SLJIT_UNUSED_ARG(srcw);
1488          SLJIT_ASSERT_STOP();          SLJIT_ASSERT_STOP();
1489          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1490  }  }
1491    
1492  int sljit_emit_fast_enter(struct sljit_compiler *compiler, int dst, sljit_w dstw, int args, int temporaries, int generals, int local_size)  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fast_enter(struct sljit_compiler *compiler, int dst, sljit_w dstw, int args, int temporaries, int saveds, int local_size)
1493  {  {
1494          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1495          SLJIT_UNUSED_ARG(dst);          SLJIT_UNUSED_ARG(dst);
1496          SLJIT_UNUSED_ARG(dstw);          SLJIT_UNUSED_ARG(dstw);
1497          SLJIT_UNUSED_ARG(args);          SLJIT_UNUSED_ARG(args);
1498          SLJIT_UNUSED_ARG(temporaries);          SLJIT_UNUSED_ARG(temporaries);
1499          SLJIT_UNUSED_ARG(generals);          SLJIT_UNUSED_ARG(saveds);
1500          SLJIT_UNUSED_ARG(local_size);          SLJIT_UNUSED_ARG(local_size);
1501          SLJIT_ASSERT_STOP();          SLJIT_ASSERT_STOP();
1502          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1503  }  }
1504    
1505  int sljit_emit_fast_return(struct sljit_compiler *compiler, int src, sljit_w srcw)  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fast_return(struct sljit_compiler *compiler, int src, sljit_w srcw)
1506  {  {
1507          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1508          SLJIT_UNUSED_ARG(src);          SLJIT_UNUSED_ARG(src);
# Line 1275  int sljit_emit_fast_return(struct sljit_ Line 1511  int sljit_emit_fast_return(struct sljit_
1511          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1512  }  }
1513    
1514  int sljit_emit_op0(struct sljit_compiler *compiler, int op)  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op0(struct sljit_compiler *compiler, int op)
1515  {  {
1516          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1517          SLJIT_UNUSED_ARG(op);          SLJIT_UNUSED_ARG(op);
# Line 1283  int sljit_emit_op0(struct sljit_compiler Line 1519  int sljit_emit_op0(struct sljit_compiler
1519          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1520  }  }
1521    
1522  int sljit_emit_op1(struct sljit_compiler *compiler, int op,  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op1(struct sljit_compiler *compiler, int op,
1523          int dst, sljit_w dstw,          int dst, sljit_w dstw,
1524          int src, sljit_w srcw)          int src, sljit_w srcw)
1525  {  {
# Line 1297  int sljit_emit_op1(struct sljit_compiler Line 1533  int sljit_emit_op1(struct sljit_compiler
1533          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1534  }  }
1535    
1536  int sljit_emit_op2(struct sljit_compiler *compiler, int op,  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op2(struct sljit_compiler *compiler, int op,
1537          int dst, sljit_w dstw,          int dst, sljit_w dstw,
1538          int src1, sljit_w src1w,          int src1, sljit_w src1w,
1539          int src2, sljit_w src2w)          int src2, sljit_w src2w)
# Line 1314  int sljit_emit_op2(struct sljit_compiler Line 1550  int sljit_emit_op2(struct sljit_compiler
1550          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1551  }  }
1552    
1553  int sljit_is_fpu_available(void)  SLJIT_API_FUNC_ATTRIBUTE int sljit_get_register_index(int reg)
1554    {
1555            SLJIT_ASSERT_STOP();
1556            return reg;
1557    }
1558    
1559    SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op_custom(struct sljit_compiler *compiler,
1560            void *instruction, int size)
1561    {
1562            SLJIT_UNUSED_ARG(compiler);
1563            SLJIT_UNUSED_ARG(instruction);
1564            SLJIT_UNUSED_ARG(size);
1565            SLJIT_ASSERT_STOP();
1566            return SLJIT_ERR_UNSUPPORTED;
1567    }
1568    
1569    SLJIT_API_FUNC_ATTRIBUTE int sljit_is_fpu_available(void)
1570  {  {
1571          SLJIT_ASSERT_STOP();          SLJIT_ASSERT_STOP();
1572          return 0;          return 0;
1573  }  }
1574    
1575  int sljit_emit_fop1(struct sljit_compiler *compiler, int op,  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fop1(struct sljit_compiler *compiler, int op,
1576          int dst, sljit_w dstw,          int dst, sljit_w dstw,
1577          int src, sljit_w srcw)          int src, sljit_w srcw)
1578  {  {
# Line 1334  int sljit_emit_fop1(struct sljit_compile Line 1586  int sljit_emit_fop1(struct sljit_compile
1586          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1587  }  }
1588    
1589  int sljit_emit_fop2(struct sljit_compiler *compiler, int op,  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fop2(struct sljit_compiler *compiler, int op,
1590          int dst, sljit_w dstw,          int dst, sljit_w dstw,
1591          int src1, sljit_w src1w,          int src1, sljit_w src1w,
1592          int src2, sljit_w src2w)          int src2, sljit_w src2w)
# Line 1351  int sljit_emit_fop2(struct sljit_compile Line 1603  int sljit_emit_fop2(struct sljit_compile
1603          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1604  }  }
1605    
1606  struct sljit_label* sljit_emit_label(struct sljit_compiler *compiler)  SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emit_label(struct sljit_compiler *compiler)
1607  {  {
1608          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1609          SLJIT_ASSERT_STOP();          SLJIT_ASSERT_STOP();
1610          return NULL;          return NULL;
1611  }  }
1612    
1613  struct sljit_jump* sljit_emit_jump(struct sljit_compiler *compiler, int type)  SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compiler *compiler, int type)
1614  {  {
1615          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1616          SLJIT_UNUSED_ARG(type);          SLJIT_UNUSED_ARG(type);
# Line 1366  struct sljit_jump* sljit_emit_jump(struc Line 1618  struct sljit_jump* sljit_emit_jump(struc
1618          return NULL;          return NULL;
1619  }  }
1620    
1621  struct sljit_jump* sljit_emit_cmp(struct sljit_compiler *compiler, int type,  SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_cmp(struct sljit_compiler *compiler, int type,
1622          int src1, sljit_w src1w,          int src1, sljit_w src1w,
1623          int src2, sljit_w src2w)          int src2, sljit_w src2w)
1624  {  {
# Line 1380  struct sljit_jump* sljit_emit_cmp(struct Line 1632  struct sljit_jump* sljit_emit_cmp(struct
1632          return NULL;          return NULL;
1633  }  }
1634    
1635  void sljit_set_label(struct sljit_jump *jump, struct sljit_label* label)  SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_fcmp(struct sljit_compiler *compiler, int type,
1636            int src1, sljit_w src1w,
1637            int src2, sljit_w src2w)
1638    {
1639            SLJIT_UNUSED_ARG(compiler);
1640            SLJIT_UNUSED_ARG(type);
1641            SLJIT_UNUSED_ARG(src1);
1642            SLJIT_UNUSED_ARG(src1w);
1643            SLJIT_UNUSED_ARG(src2);
1644            SLJIT_UNUSED_ARG(src2w);
1645            SLJIT_ASSERT_STOP();
1646            return NULL;
1647    }
1648    
1649    SLJIT_API_FUNC_ATTRIBUTE void sljit_set_label(struct sljit_jump *jump, struct sljit_label* label)
1650  {  {
1651          SLJIT_UNUSED_ARG(jump);          SLJIT_UNUSED_ARG(jump);
1652          SLJIT_UNUSED_ARG(label);          SLJIT_UNUSED_ARG(label);
1653          SLJIT_ASSERT_STOP();          SLJIT_ASSERT_STOP();
1654  }  }
1655    
1656  void sljit_set_target(struct sljit_jump *jump, sljit_uw target)  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_target(struct sljit_jump *jump, sljit_uw target)
1657  {  {
1658          SLJIT_UNUSED_ARG(jump);          SLJIT_UNUSED_ARG(jump);
1659          SLJIT_UNUSED_ARG(target);          SLJIT_UNUSED_ARG(target);
1660          SLJIT_ASSERT_STOP();          SLJIT_ASSERT_STOP();
1661  }  }
1662    
1663  int sljit_emit_ijump(struct sljit_compiler *compiler, int type, int src, sljit_w srcw)  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_ijump(struct sljit_compiler *compiler, int type, int src, sljit_w srcw)
1664  {  {
1665          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1666          SLJIT_UNUSED_ARG(type);          SLJIT_UNUSED_ARG(type);
# Line 1404  int sljit_emit_ijump(struct sljit_compil Line 1670  int sljit_emit_ijump(struct sljit_compil
1670          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1671  }  }
1672    
1673  int sljit_emit_cond_value(struct sljit_compiler *compiler, int op, int dst, sljit_w dstw, int type)  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_cond_value(struct sljit_compiler *compiler, int op, int dst, sljit_w dstw, int type)
1674  {  {
1675          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1676          SLJIT_UNUSED_ARG(op);          SLJIT_UNUSED_ARG(op);
# Line 1415  int sljit_emit_cond_value(struct sljit_c Line 1681  int sljit_emit_cond_value(struct sljit_c
1681          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1682  }  }
1683    
1684  struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, int dst, sljit_w dstw, sljit_w initval)  SLJIT_API_FUNC_ATTRIBUTE int sljit_get_local_base(struct sljit_compiler *compiler, int dst, sljit_w dstw, sljit_w offset)
1685    {
1686            SLJIT_UNUSED_ARG(compiler);
1687            SLJIT_UNUSED_ARG(dst);
1688            SLJIT_UNUSED_ARG(dstw);
1689            SLJIT_UNUSED_ARG(offset);
1690            SLJIT_ASSERT_STOP();
1691            return SLJIT_ERR_UNSUPPORTED;
1692    }
1693    
1694    SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, int dst, sljit_w dstw, sljit_w initval)
1695  {  {
1696          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1697          SLJIT_UNUSED_ARG(dst);          SLJIT_UNUSED_ARG(dst);
# Line 1425  struct sljit_const* sljit_emit_const(str Line 1701  struct sljit_const* sljit_emit_const(str
1701          return NULL;          return NULL;
1702  }  }
1703    
1704  void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_addr)  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_addr)
1705  {  {
1706          SLJIT_UNUSED_ARG(addr);          SLJIT_UNUSED_ARG(addr);
1707          SLJIT_UNUSED_ARG(new_addr);          SLJIT_UNUSED_ARG(new_addr);
1708          SLJIT_ASSERT_STOP();          SLJIT_ASSERT_STOP();
1709  }  }
1710    
1711  void sljit_set_const(sljit_uw addr, sljit_w new_constant)  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_w new_constant)
1712  {  {
1713          SLJIT_UNUSED_ARG(addr);          SLJIT_UNUSED_ARG(addr);
1714          SLJIT_UNUSED_ARG(new_constant);          SLJIT_UNUSED_ARG(new_constant);

Legend:
Removed from v.722  
changed lines
  Added in v.1182

  ViewVC Help
Powered by ViewVC 1.1.5