/[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 1194 by zherczeg, Sun Oct 28 05:22:32 2012 UTC revision 1195 by zherczeg, Thu Nov 1 15:21:27 2012 UTC
# Line 89  Line 89 
89          ((op) & (SLJIT_SET_E | SLJIT_SET_S | SLJIT_SET_U | SLJIT_SET_O | SLJIT_SET_C))          ((op) & (SLJIT_SET_E | SLJIT_SET_S | SLJIT_SET_U | SLJIT_SET_O | SLJIT_SET_C))
90    
91  #define GET_ALL_FLAGS(op) \  #define GET_ALL_FLAGS(op) \
92          ((op) & (SLJIT_SET_E | SLJIT_SET_S | SLJIT_SET_U | SLJIT_SET_O | SLJIT_SET_C | SLJIT_KEEP_FLAGS))          ((op) & (SLJIT_INT_OP | SLJIT_SET_E | SLJIT_SET_S | SLJIT_SET_U | SLJIT_SET_O | SLJIT_SET_C | SLJIT_KEEP_FLAGS))
93    
94    #define TYPE_CAST_NEEDED(op) \
95            (((op) >= SLJIT_MOV_UB && (op) <= SLJIT_MOV_SH) || ((op) >= SLJIT_MOVU_UB && (op) <= SLJIT_MOVU_SH))
96    
97  #define BUF_SIZE        4096  #define BUF_SIZE        4096
98    
# Line 195  Line 198 
198  #if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)  #if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
199  #define SLJIT_HAS_FIXED_LOCALS_OFFSET 1  #define SLJIT_HAS_FIXED_LOCALS_OFFSET 1
200  #ifdef _WIN64  #ifdef _WIN64
201  #define FIXED_LOCALS_OFFSET (4 * sizeof(sljit_w))  #define FIXED_LOCALS_OFFSET (4 * sizeof(sljit_sw))
202  #else  #else
203  #define FIXED_LOCALS_OFFSET (sizeof(sljit_w))  #define FIXED_LOCALS_OFFSET (sizeof(sljit_sw))
204  #endif  #endif
205  #endif  #endif
206    
207  #if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32)  #if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32)
208  #define SLJIT_HAS_FIXED_LOCALS_OFFSET 1  #define SLJIT_HAS_FIXED_LOCALS_OFFSET 1
209  #if (defined SLJIT_INDIRECT_CALL && SLJIT_INDIRECT_CALL)  #if (defined SLJIT_INDIRECT_CALL && SLJIT_INDIRECT_CALL)
210  #define FIXED_LOCALS_OFFSET ((6 + 8) * sizeof(sljit_w))  #define FIXED_LOCALS_OFFSET ((6 + 8) * sizeof(sljit_sw))
211  #else  #else
212  #define FIXED_LOCALS_OFFSET (2 * sizeof(sljit_w))  #define FIXED_LOCALS_OFFSET (2 * sizeof(sljit_sw))
213  #endif  #endif
214  #endif  #endif
215    
216  #if (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)  #if (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
217  #define SLJIT_HAS_FIXED_LOCALS_OFFSET 1  #define SLJIT_HAS_FIXED_LOCALS_OFFSET 1
218  #define FIXED_LOCALS_OFFSET ((6 + 8) * sizeof(sljit_w))  #define FIXED_LOCALS_OFFSET ((6 + 8) * sizeof(sljit_sw))
219  #endif  #endif
220    
221  #if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)  #if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
222  #define SLJIT_HAS_FIXED_LOCALS_OFFSET 1  #define SLJIT_HAS_FIXED_LOCALS_OFFSET 1
223  #define FIXED_LOCALS_OFFSET (4 * sizeof(sljit_w))  #define FIXED_LOCALS_OFFSET (4 * sizeof(sljit_sw))
224  #endif  #endif
225    
226  #if (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32)  #if (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32)
227  #define SLJIT_HAS_FIXED_LOCALS_OFFSET 1  #define SLJIT_HAS_FIXED_LOCALS_OFFSET 1
228  #define FIXED_LOCALS_OFFSET (23 * sizeof(sljit_w))  #define FIXED_LOCALS_OFFSET (23 * sizeof(sljit_sw))
229  #endif  #endif
230    
231  #if (defined SLJIT_HAS_VARIABLE_LOCALS_OFFSET && SLJIT_HAS_VARIABLE_LOCALS_OFFSET)  #if (defined SLJIT_HAS_VARIABLE_LOCALS_OFFSET && SLJIT_HAS_VARIABLE_LOCALS_OFFSET)
# Line 264  Line 267 
267    
268  #if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5) || ((defined SLJIT_SSE2 && SLJIT_SSE2) && ((defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) || (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)))  #if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5) || ((defined SLJIT_SSE2 && SLJIT_SSE2) && ((defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) || (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)))
269  #define SLJIT_NEEDS_COMPILER_INIT 1  #define SLJIT_NEEDS_COMPILER_INIT 1
270  static int compiler_initialized = 0;  static sljit_si compiler_initialized = 0;
271  /* A thread safe initialization. */  /* A thread safe initialization. */
272  static void init_compiler(void);  static void init_compiler(void);
273  #endif  #endif
# Line 277  SLJIT_API_FUNC_ATTRIBUTE struct sljit_co Line 280  SLJIT_API_FUNC_ATTRIBUTE struct sljit_co
280          SLJIT_ZEROMEM(compiler, sizeof(struct sljit_compiler));          SLJIT_ZEROMEM(compiler, sizeof(struct sljit_compiler));
281    
282          SLJIT_COMPILE_ASSERT(          SLJIT_COMPILE_ASSERT(
283                  sizeof(sljit_b) == 1 && sizeof(sljit_ub) == 1                  sizeof(sljit_sb) == 1 && sizeof(sljit_ub) == 1
284                  && sizeof(sljit_h) == 2 && sizeof(sljit_uh) == 2                  && sizeof(sljit_sh) == 2 && sizeof(sljit_uh) == 2
285                  && sizeof(sljit_i) == 4 && sizeof(sljit_ui) == 4                  && sizeof(sljit_si) == 4 && sizeof(sljit_ui) == 4
286                  && (sizeof(sljit_p) == 4 || sizeof(sljit_p) == 8)                  && (sizeof(sljit_p) == 4 || sizeof(sljit_p) == 8)
287                  && (sizeof(sljit_w) == 4 || sizeof(sljit_w) == 8)                  && sizeof(sljit_p) <= sizeof(sljit_sw)
288                    && (sizeof(sljit_sw) == 4 || sizeof(sljit_sw) == 8)
289                  && (sizeof(sljit_uw) == 4 || sizeof(sljit_uw) == 8),                  && (sizeof(sljit_uw) == 4 || sizeof(sljit_uw) == 8),
290                  invalid_integer_types);                  invalid_integer_types);
291            SLJIT_COMPILE_ASSERT(SLJIT_INT_OP == SLJIT_SINGLE_OP,
292                    int_op_and_single_op_must_be_the_same);
293            SLJIT_COMPILE_ASSERT(SLJIT_REWRITABLE_JUMP != SLJIT_SINGLE_OP,
294                    rewritable_jump_and_single_op_must_not_be_the_same);
295    
296          /* Only the non-zero members must be set. */          /* Only the non-zero members must be set. */
297          compiler->error = SLJIT_SUCCESS;          compiler->error = SLJIT_SUCCESS;
# Line 411  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_ Line 419  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_
419  /*  Private functions                                                    */  /*  Private functions                                                    */
420  /* --------------------------------------------------------------------- */  /* --------------------------------------------------------------------- */
421    
422  static void* ensure_buf(struct sljit_compiler *compiler, int size)  static void* ensure_buf(struct sljit_compiler *compiler, sljit_uw size)
423  {  {
424          sljit_ub *ret;          sljit_ub *ret;
425          struct sljit_memory_fragment *new_frag;          struct sljit_memory_fragment *new_frag;
426    
427          if (compiler->buf->used_size + size <= (int)(BUF_SIZE - sizeof(sljit_uw) - sizeof(void*))) {          SLJIT_ASSERT(size <= 256);
428            if (compiler->buf->used_size + size <= (BUF_SIZE - (sljit_uw)SLJIT_OFFSETOF(struct sljit_memory_fragment, memory))) {
429                  ret = compiler->buf->memory + compiler->buf->used_size;                  ret = compiler->buf->memory + compiler->buf->used_size;
430                  compiler->buf->used_size += size;                  compiler->buf->used_size += size;
431                  return ret;                  return ret;
# Line 429  static void* ensure_buf(struct sljit_com Line 438  static void* ensure_buf(struct sljit_com
438          return new_frag->memory;          return new_frag->memory;
439  }  }
440    
441  static void* ensure_abuf(struct sljit_compiler *compiler, int size)  static void* ensure_abuf(struct sljit_compiler *compiler, sljit_uw size)
442  {  {
443          sljit_ub *ret;          sljit_ub *ret;
444          struct sljit_memory_fragment *new_frag;          struct sljit_memory_fragment *new_frag;
445    
446          if (compiler->abuf->used_size + size <= (int)(ABUF_SIZE - sizeof(sljit_uw) - sizeof(void*))) {          SLJIT_ASSERT(size <= 256);
447            if (compiler->abuf->used_size + size <= (ABUF_SIZE - (sljit_uw)SLJIT_OFFSETOF(struct sljit_memory_fragment, memory))) {
448                  ret = compiler->abuf->memory + compiler->abuf->used_size;                  ret = compiler->abuf->memory + compiler->abuf->used_size;
449                  compiler->abuf->used_size += size;                  compiler->abuf->used_size += size;
450                  return ret;                  return ret;
# Line 447  static void* ensure_abuf(struct sljit_co Line 457  static void* ensure_abuf(struct sljit_co
457          return new_frag->memory;          return new_frag->memory;
458  }  }
459    
460  SLJIT_API_FUNC_ATTRIBUTE void* sljit_alloc_memory(struct sljit_compiler *compiler, int size)  SLJIT_API_FUNC_ATTRIBUTE void* sljit_alloc_memory(struct sljit_compiler *compiler, sljit_si size)
461  {  {
462          CHECK_ERROR_PTR();          CHECK_ERROR_PTR();
463    
# Line 490  static SLJIT_INLINE void set_label(struc Line 500  static SLJIT_INLINE void set_label(struc
500          compiler->last_label = label;          compiler->last_label = label;
501  }  }
502    
503  static SLJIT_INLINE void set_jump(struct sljit_jump *jump, struct sljit_compiler *compiler, int flags)  static SLJIT_INLINE void set_jump(struct sljit_jump *jump, struct sljit_compiler *compiler, sljit_si flags)
504  {  {
505          jump->next = NULL;          jump->next = NULL;
506          jump->flags = flags;          jump->flags = flags;
# Line 535  static SLJIT_INLINE void set_const(struc Line 545  static SLJIT_INLINE void set_const(struc
545          case SLJIT_MUL: \          case SLJIT_MUL: \
546                  SLJIT_ASSERT(!(op & (SLJIT_SET_E | SLJIT_SET_S | SLJIT_SET_U | SLJIT_SET_C))); \                  SLJIT_ASSERT(!(op & (SLJIT_SET_E | SLJIT_SET_S | SLJIT_SET_U | SLJIT_SET_C))); \
547                  break; \                  break; \
548          case SLJIT_FCMP: \          case SLJIT_CMPD: \
549                  SLJIT_ASSERT(!(op & (SLJIT_INT_OP | SLJIT_SET_U | SLJIT_SET_O | SLJIT_SET_C | SLJIT_KEEP_FLAGS))); \                  SLJIT_ASSERT(!(op & (SLJIT_SET_U | SLJIT_SET_O | SLJIT_SET_C | SLJIT_KEEP_FLAGS))); \
550                  SLJIT_ASSERT((op & (SLJIT_SET_E | SLJIT_SET_S))); \                  SLJIT_ASSERT((op & (SLJIT_SET_E | SLJIT_SET_S))); \
551                  break; \                  break; \
552          case SLJIT_ADD: \          case SLJIT_ADD: \
# Line 548  static SLJIT_INLINE void set_const(struc Line 558  static SLJIT_INLINE void set_const(struc
558          case SLJIT_SUBC: \          case SLJIT_SUBC: \
559                  SLJIT_ASSERT(!(op & (SLJIT_SET_E | SLJIT_SET_S | SLJIT_SET_U | SLJIT_SET_O))); \                  SLJIT_ASSERT(!(op & (SLJIT_SET_E | SLJIT_SET_S | SLJIT_SET_U | SLJIT_SET_O))); \
560                  break; \                  break; \
561          default: \          case SLJIT_BREAKPOINT: \
562            case SLJIT_NOP: \
563            case SLJIT_UMUL: \
564            case SLJIT_SMUL: \
565            case SLJIT_MOV: \
566            case SLJIT_MOV_P: \
567            case SLJIT_MOVU: \
568            case SLJIT_MOVU_P: \
569                  /* Nothing allowed */ \                  /* Nothing allowed */ \
570                  SLJIT_ASSERT(!(op & (SLJIT_INT_OP | SLJIT_SET_E | SLJIT_SET_S | SLJIT_SET_U | SLJIT_SET_O | SLJIT_SET_C | SLJIT_KEEP_FLAGS))); \                  SLJIT_ASSERT(!(op & (SLJIT_INT_OP | SLJIT_SET_E | SLJIT_SET_S | SLJIT_SET_U | SLJIT_SET_O | SLJIT_SET_C | SLJIT_KEEP_FLAGS))); \
571                  break; \                  break; \
572            default: \
573                    /* Only SLJIT_INT_OP or SLJIT_SINGLE_OP is allowed. */ \
574                    SLJIT_ASSERT(!(op & (SLJIT_SET_E | SLJIT_SET_S | SLJIT_SET_U | SLJIT_SET_O | SLJIT_SET_C | SLJIT_KEEP_FLAGS))); \
575                    break; \
576          }          }
577    
578  #define FUNCTION_CHECK_IS_REG(r) \  #define FUNCTION_CHECK_IS_REG(r) \
# Line 596  static SLJIT_INLINE void set_const(struc Line 617  static SLJIT_INLINE void set_const(struc
617                  SLJIT_ASSERT_STOP();                  SLJIT_ASSERT_STOP();
618    
619  #define FUNCTION_FCHECK(p, i) \  #define FUNCTION_FCHECK(p, i) \
620          if ((p) >= SLJIT_FLOAT_REG1 && (p) <= SLJIT_FLOAT_REG4) \          if ((p) >= SLJIT_FLOAT_REG1 && (p) <= SLJIT_FLOAT_REG6) \
621                  SLJIT_ASSERT(i == 0); \                  SLJIT_ASSERT(i == 0); \
622          else if ((p) & SLJIT_MEM) { \          else if ((p) & SLJIT_MEM) { \
623                  SLJIT_ASSERT(FUNCTION_CHECK_IS_REG((p) & 0xf)); \                  SLJIT_ASSERT(FUNCTION_CHECK_IS_REG((p) & 0xf)); \
# Line 611  static SLJIT_INLINE void set_const(struc Line 632  static SLJIT_INLINE void set_const(struc
632                  SLJIT_ASSERT_STOP();                  SLJIT_ASSERT_STOP();
633    
634  #define FUNCTION_CHECK_OP1() \  #define FUNCTION_CHECK_OP1() \
635          if (GET_OPCODE(op) >= SLJIT_MOV && GET_OPCODE(op) <= SLJIT_MOVU_P) { \          if (GET_OPCODE(op) >= SLJIT_MOVU && GET_OPCODE(op) <= SLJIT_MOVU_P) { \
                 SLJIT_ASSERT(!GET_ALL_FLAGS(op)); \  
         } \  
         if (GET_OPCODE(op) >= SLJIT_MOVU && GET_OPCODE(op) <= SLJIT_MOVU_P) { \  
636                  SLJIT_ASSERT(!(src & SLJIT_MEM) || (src & 0xf) != SLJIT_LOCALS_REG); \                  SLJIT_ASSERT(!(src & SLJIT_MEM) || (src & 0xf) != SLJIT_LOCALS_REG); \
637                  SLJIT_ASSERT(!(dst & SLJIT_MEM) || (dst & 0xf) != SLJIT_LOCALS_REG); \                  SLJIT_ASSERT(!(dst & SLJIT_MEM) || (dst & 0xf) != SLJIT_LOCALS_REG); \
638                  if ((src & SLJIT_MEM) && (src & 0xf)) \                  if ((src & SLJIT_MEM) && (src & 0xf)) \
# Line 637  static char* reg_names[] = { Line 655  static char* reg_names[] = {
655  };  };
656    
657  static char* freg_names[] = {  static char* freg_names[] = {
658          (char*)"<noreg>", (char*)"float_r1", (char*)"float_r2", (char*)"float_r3", (char*)"float_r4"          (char*)"<noreg>", (char*)"float_r1", (char*)"float_r2", (char*)"float_r3",
659            (char*)"float_r4", (char*)"float_r5", (char*)"float_r6"
660  };  };
661    
662  #if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) || (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)  #if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) || (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64)
# Line 708  static SLJIT_CONST char* op_names[] = { Line 727  static SLJIT_CONST char* op_names[] = {
727          (char*)"mul", (char*)"and", (char*)"or", (char*)"xor",          (char*)"mul", (char*)"and", (char*)"or", (char*)"xor",
728          (char*)"shl", (char*)"lshr", (char*)"ashr",          (char*)"shl", (char*)"lshr", (char*)"ashr",
729          /* fop1 */          /* fop1 */
730          (char*)"fcmp", (char*)"fmov", (char*)"fneg", (char*)"fabs",          (char*)"cmp", (char*)"mov", (char*)"neg", (char*)"abs",
731          /* fop2 */          /* fop2 */
732          (char*)"fadd", (char*)"fsub", (char*)"fmul", (char*)"fdiv"          (char*)"add", (char*)"sub", (char*)"mul", (char*)"div"
733  };  };
734    
735  static char* jump_names[] = {  static char* jump_names[] = {
# Line 754  static SLJIT_INLINE void check_sljit_gen Line 773  static SLJIT_INLINE void check_sljit_gen
773  #endif  #endif
774  }  }
775    
776  static SLJIT_INLINE void check_sljit_emit_enter(struct sljit_compiler *compiler, int args, int temporaries, int saveds, int local_size)  static SLJIT_INLINE void check_sljit_emit_enter(struct sljit_compiler *compiler, sljit_si args, sljit_si temporaries, sljit_si saveds, sljit_si local_size)
777  {  {
778          /* If debug and verbose are disabled, all arguments are unused. */          /* If debug and verbose are disabled, all arguments are unused. */
779          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
# Line 774  static SLJIT_INLINE void check_sljit_emi Line 793  static SLJIT_INLINE void check_sljit_emi
793  #endif  #endif
794  }  }
795    
796  static SLJIT_INLINE void check_sljit_set_context(struct sljit_compiler *compiler, int args, int temporaries, int saveds, int local_size)  static SLJIT_INLINE void check_sljit_set_context(struct sljit_compiler *compiler, sljit_si args, sljit_si temporaries, sljit_si saveds, sljit_si local_size)
797  {  {
798          /* If debug and verbose are disabled, all arguments are unused. */          /* If debug and verbose are disabled, all arguments are unused. */
799          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
# Line 801  static SLJIT_INLINE void check_sljit_set Line 820  static SLJIT_INLINE void check_sljit_set
820  #endif  #endif
821  }  }
822    
823  static SLJIT_INLINE void check_sljit_emit_return(struct sljit_compiler *compiler, int op, int src, sljit_w srcw)  static SLJIT_INLINE void check_sljit_emit_return(struct sljit_compiler *compiler, sljit_si op, sljit_si src, sljit_sw srcw)
824  {  {
825          /* If debug and verbose are disabled, all arguments are unused. */          /* If debug and verbose are disabled, all arguments are unused. */
826          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
# Line 830  static SLJIT_INLINE void check_sljit_emi Line 849  static SLJIT_INLINE void check_sljit_emi
849  #endif  #endif
850  }  }
851    
852  static SLJIT_INLINE void check_sljit_emit_fast_enter(struct sljit_compiler *compiler, int dst, sljit_w dstw)  static SLJIT_INLINE void check_sljit_emit_fast_enter(struct sljit_compiler *compiler, sljit_si dst, sljit_sw dstw)
853  {  {
854          /* If debug and verbose are disabled, all arguments are unused. */          /* If debug and verbose are disabled, all arguments are unused. */
855          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
# Line 849  static SLJIT_INLINE void check_sljit_emi Line 868  static SLJIT_INLINE void check_sljit_emi
868  #endif  #endif
869  }  }
870    
871  static SLJIT_INLINE void check_sljit_emit_fast_return(struct sljit_compiler *compiler, int src, sljit_w srcw)  static SLJIT_INLINE void check_sljit_emit_fast_return(struct sljit_compiler *compiler, sljit_si src, sljit_sw srcw)
872  {  {
873          /* If debug and verbose are disabled, all arguments are unused. */          /* If debug and verbose are disabled, all arguments are unused. */
874          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
# Line 868  static SLJIT_INLINE void check_sljit_emi Line 887  static SLJIT_INLINE void check_sljit_emi
887  #endif  #endif
888  }  }
889    
890  static SLJIT_INLINE void check_sljit_emit_op0(struct sljit_compiler *compiler, int op)  static SLJIT_INLINE void check_sljit_emit_op0(struct sljit_compiler *compiler, sljit_si op)
891  {  {
892          /* If debug and verbose are disabled, all arguments are unused. */          /* If debug and verbose are disabled, all arguments are unused. */
893          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
# Line 882  static SLJIT_INLINE void check_sljit_emi Line 901  static SLJIT_INLINE void check_sljit_emi
901  #endif  #endif
902  }  }
903    
904  static SLJIT_INLINE void check_sljit_emit_op1(struct sljit_compiler *compiler, int op,  static SLJIT_INLINE void check_sljit_emit_op1(struct sljit_compiler *compiler, sljit_si op,
905          int dst, sljit_w dstw,          sljit_si dst, sljit_sw dstw,
906          int src, sljit_w srcw)          sljit_si src, sljit_sw srcw)
907  {  {
908          /* If debug and verbose are disabled, all arguments are unused. */          /* If debug and verbose are disabled, all arguments are unused. */
909          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
# Line 920  static SLJIT_INLINE void check_sljit_emi Line 939  static SLJIT_INLINE void check_sljit_emi
939  #endif  #endif
940  }  }
941    
942  static SLJIT_INLINE void check_sljit_emit_op2(struct sljit_compiler *compiler, int op,  static SLJIT_INLINE void check_sljit_emit_op2(struct sljit_compiler *compiler, sljit_si op,
943          int dst, sljit_w dstw,          sljit_si dst, sljit_sw dstw,
944          int src1, sljit_w src1w,          sljit_si src1, sljit_sw src1w,
945          int src2, sljit_w src2w)          sljit_si src2, sljit_sw src2w)
946  {  {
947          /* If debug and verbose are disabled, all arguments are unused. */          /* If debug and verbose are disabled, all arguments are unused. */
948          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
# Line 952  static SLJIT_INLINE void check_sljit_emi Line 971  static SLJIT_INLINE void check_sljit_emi
971  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
972          if (SLJIT_UNLIKELY(!!compiler->verbose)) {          if (SLJIT_UNLIKELY(!!compiler->verbose)) {
973                  fprintf(compiler->verbose, "  %s%s%s%s%s%s%s%s ", !(op & SLJIT_INT_OP) ? "" : "i", op_names[GET_OPCODE(op)],                  fprintf(compiler->verbose, "  %s%s%s%s%s%s%s%s ", !(op & SLJIT_INT_OP) ? "" : "i", op_names[GET_OPCODE(op)],
974                          !(op & SLJIT_SET_E) ? "" : "E", !(op & SLJIT_SET_S) ? "" : "S", !(op & SLJIT_SET_U) ? "" : "U", !(op & SLJIT_SET_O) ? "" : "O", !(op & SLJIT_SET_C) ? "" : "C", !(op & SLJIT_KEEP_FLAGS) ? "" : "K");                          !(op & SLJIT_SET_E) ? "" : "E", !(op & SLJIT_SET_S) ? "" : "S", !(op & SLJIT_SET_U) ? "" : "U",
975                            !(op & SLJIT_SET_O) ? "" : "O", !(op & SLJIT_SET_C) ? "" : "C", !(op & SLJIT_KEEP_FLAGS) ? "" : "K");
976                  sljit_verbose_param(dst, dstw);                  sljit_verbose_param(dst, dstw);
977                  fprintf(compiler->verbose, ", ");                  fprintf(compiler->verbose, ", ");
978                  sljit_verbose_param(src1, src1w);                  sljit_verbose_param(src1, src1w);
# Line 963  static SLJIT_INLINE void check_sljit_emi Line 983  static SLJIT_INLINE void check_sljit_emi
983  #endif  #endif
984  }  }
985    
986  static SLJIT_INLINE void check_sljit_get_register_index(int reg)  static SLJIT_INLINE void check_sljit_get_register_index(sljit_si reg)
987  {  {
988          SLJIT_UNUSED_ARG(reg);          SLJIT_UNUSED_ARG(reg);
989          SLJIT_ASSERT(reg > 0 && reg <= SLJIT_NO_REGISTERS);          SLJIT_ASSERT(reg > 0 && reg <= SLJIT_NO_REGISTERS);
990  }  }
991    
992  static SLJIT_INLINE void check_sljit_emit_op_custom(struct sljit_compiler *compiler,  static SLJIT_INLINE void check_sljit_emit_op_custom(struct sljit_compiler *compiler,
993          void *instruction, int size)          void *instruction, sljit_si size)
994  {  {
995          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
996          SLJIT_UNUSED_ARG(instruction);          SLJIT_UNUSED_ARG(instruction);
# Line 978  static SLJIT_INLINE void check_sljit_emi Line 998  static SLJIT_INLINE void check_sljit_emi
998          SLJIT_ASSERT(instruction);          SLJIT_ASSERT(instruction);
999  }  }
1000    
1001  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, sljit_si op,
1002          int dst, sljit_w dstw,          sljit_si dst, sljit_sw dstw,
1003          int src, sljit_w srcw)          sljit_si src, sljit_sw srcw)
1004  {  {
1005          /* If debug and verbose are disabled, all arguments are unused. */          /* If debug and verbose are disabled, all arguments are unused. */
1006          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
# Line 998  static SLJIT_INLINE void check_sljit_emi Line 1018  static SLJIT_INLINE void check_sljit_emi
1018  #endif  #endif
1019    
1020          SLJIT_ASSERT(sljit_is_fpu_available());          SLJIT_ASSERT(sljit_is_fpu_available());
1021          SLJIT_ASSERT(GET_OPCODE(op) >= SLJIT_FCMP && GET_OPCODE(op) <= SLJIT_FABS);          SLJIT_ASSERT(GET_OPCODE(op) >= SLJIT_CMPD && GET_OPCODE(op) <= SLJIT_ABSD);
1022  #if (defined SLJIT_DEBUG && SLJIT_DEBUG)  #if (defined SLJIT_DEBUG && SLJIT_DEBUG)
1023          FUNCTION_CHECK_OP();          FUNCTION_CHECK_OP();
1024          FUNCTION_FCHECK(src, srcw);          FUNCTION_FCHECK(src, srcw);
# Line 1006  static SLJIT_INLINE void check_sljit_emi Line 1026  static SLJIT_INLINE void check_sljit_emi
1026  #endif  #endif
1027  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
1028          if (SLJIT_UNLIKELY(!!compiler->verbose)) {          if (SLJIT_UNLIKELY(!!compiler->verbose)) {
1029                  fprintf(compiler->verbose, "  %s%s%s ", op_names[GET_OPCODE(op)],                  fprintf(compiler->verbose, "  %s%s%s%s ", op_names[GET_OPCODE(op)], (op & SLJIT_SINGLE_OP) ? "s" : "d",
1030                          !(op & SLJIT_SET_E) ? "" : "E", !(op & SLJIT_SET_S) ? "" : "S");                          !(op & SLJIT_SET_E) ? "" : "E", !(op & SLJIT_SET_S) ? "" : "S");
1031                  sljit_verbose_fparam(dst, dstw);                  sljit_verbose_fparam(dst, dstw);
1032                  fprintf(compiler->verbose, ", ");                  fprintf(compiler->verbose, ", ");
# Line 1016  static SLJIT_INLINE void check_sljit_emi Line 1036  static SLJIT_INLINE void check_sljit_emi
1036  #endif  #endif
1037  }  }
1038    
1039  static SLJIT_INLINE void check_sljit_emit_fop2(struct sljit_compiler *compiler, int op,  static SLJIT_INLINE void check_sljit_emit_fop2(struct sljit_compiler *compiler, sljit_si op,
1040          int dst, sljit_w dstw,          sljit_si dst, sljit_sw dstw,
1041          int src1, sljit_w src1w,          sljit_si src1, sljit_sw src1w,
1042          int src2, sljit_w src2w)          sljit_si src2, sljit_sw src2w)
1043  {  {
1044          /* If debug and verbose are disabled, all arguments are unused. */          /* If debug and verbose are disabled, all arguments are unused. */
1045          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
# Line 1032  static SLJIT_INLINE void check_sljit_emi Line 1052  static SLJIT_INLINE void check_sljit_emi
1052          SLJIT_UNUSED_ARG(src2w);          SLJIT_UNUSED_ARG(src2w);
1053    
1054          SLJIT_ASSERT(sljit_is_fpu_available());          SLJIT_ASSERT(sljit_is_fpu_available());
1055          SLJIT_ASSERT(GET_OPCODE(op) >= SLJIT_FADD && GET_OPCODE(op) <= SLJIT_FDIV);          SLJIT_ASSERT(GET_OPCODE(op) >= SLJIT_ADDD && GET_OPCODE(op) <= SLJIT_DIVD);
1056  #if (defined SLJIT_DEBUG && SLJIT_DEBUG)  #if (defined SLJIT_DEBUG && SLJIT_DEBUG)
1057          FUNCTION_CHECK_OP();          FUNCTION_CHECK_OP();
1058          FUNCTION_FCHECK(src1, src1w);          FUNCTION_FCHECK(src1, src1w);
# Line 1041  static SLJIT_INLINE void check_sljit_emi Line 1061  static SLJIT_INLINE void check_sljit_emi
1061  #endif  #endif
1062  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
1063          if (SLJIT_UNLIKELY(!!compiler->verbose)) {          if (SLJIT_UNLIKELY(!!compiler->verbose)) {
1064                  fprintf(compiler->verbose, "  %s ", op_names[GET_OPCODE(op)]);                  fprintf(compiler->verbose, "  %s%s ", op_names[GET_OPCODE(op)], (op & SLJIT_SINGLE_OP) ? "s" : "d");
1065                  sljit_verbose_fparam(dst, dstw);                  sljit_verbose_fparam(dst, dstw);
1066                  fprintf(compiler->verbose, ", ");                  fprintf(compiler->verbose, ", ");
1067                  sljit_verbose_fparam(src1, src1w);                  sljit_verbose_fparam(src1, src1w);
# Line 1063  static SLJIT_INLINE void check_sljit_emi Line 1083  static SLJIT_INLINE void check_sljit_emi
1083  #endif  #endif
1084  }  }
1085    
1086  static SLJIT_INLINE void check_sljit_emit_jump(struct sljit_compiler *compiler, int type)  static SLJIT_INLINE void check_sljit_emit_jump(struct sljit_compiler *compiler, sljit_si type)
1087  {  {
1088          /* If debug and verbose are disabled, all arguments are unused. */          /* If debug and verbose are disabled, all arguments are unused. */
1089          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
# Line 1084  static SLJIT_INLINE void check_sljit_emi Line 1104  static SLJIT_INLINE void check_sljit_emi
1104  #endif  #endif
1105  }  }
1106    
1107  static SLJIT_INLINE void check_sljit_emit_cmp(struct sljit_compiler *compiler, int type,  static SLJIT_INLINE void check_sljit_emit_cmp(struct sljit_compiler *compiler, sljit_si type,
1108          int src1, sljit_w src1w,          sljit_si src1, sljit_sw src1w,
1109          int src2, sljit_w src2w)          sljit_si src2, sljit_sw src2w)
1110  {  {
1111          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1112          SLJIT_UNUSED_ARG(type);          SLJIT_UNUSED_ARG(type);
# Line 1112  static SLJIT_INLINE void check_sljit_emi Line 1132  static SLJIT_INLINE void check_sljit_emi
1132  #endif  #endif
1133  }  }
1134    
1135  static SLJIT_INLINE void check_sljit_emit_fcmp(struct sljit_compiler *compiler, int type,  static SLJIT_INLINE void check_sljit_emit_fcmp(struct sljit_compiler *compiler, sljit_si type,
1136          int src1, sljit_w src1w,          sljit_si src1, sljit_sw src1w,
1137          int src2, sljit_w src2w)          sljit_si src2, sljit_sw src2w)
1138  {  {
1139          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1140          SLJIT_UNUSED_ARG(type);          SLJIT_UNUSED_ARG(type);
# Line 1124  static SLJIT_INLINE void check_sljit_emi Line 1144  static SLJIT_INLINE void check_sljit_emi
1144          SLJIT_UNUSED_ARG(src2w);          SLJIT_UNUSED_ARG(src2w);
1145    
1146          SLJIT_ASSERT(sljit_is_fpu_available());          SLJIT_ASSERT(sljit_is_fpu_available());
1147          SLJIT_ASSERT(!(type & ~(0xff | SLJIT_REWRITABLE_JUMP)));          SLJIT_ASSERT(!(type & ~(0xff | SLJIT_REWRITABLE_JUMP | SLJIT_SINGLE_OP)));
1148          SLJIT_ASSERT((type & 0xff) >= SLJIT_C_FLOAT_EQUAL && (type & 0xff) <= SLJIT_C_FLOAT_ORDERED);          SLJIT_ASSERT((type & 0xff) >= SLJIT_C_FLOAT_EQUAL && (type & 0xff) <= SLJIT_C_FLOAT_ORDERED);
1149  #if (defined SLJIT_DEBUG && SLJIT_DEBUG)  #if (defined SLJIT_DEBUG && SLJIT_DEBUG)
1150          FUNCTION_FCHECK(src1, src1w);          FUNCTION_FCHECK(src1, src1w);
# Line 1132  static SLJIT_INLINE void check_sljit_emi Line 1152  static SLJIT_INLINE void check_sljit_emi
1152  #endif  #endif
1153  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
1154          if (SLJIT_UNLIKELY(!!compiler->verbose)) {          if (SLJIT_UNLIKELY(!!compiler->verbose)) {
1155                  fprintf(compiler->verbose, "  fcmp%s <%s> ", !(type & SLJIT_REWRITABLE_JUMP) ? "" : "R", jump_names[type & 0xff]);                  fprintf(compiler->verbose, "  %scmpj%s <%s> ", (type & SLJIT_SINGLE_OP) ? "s" : "d",
1156                            !(type & SLJIT_REWRITABLE_JUMP) ? "" : "R", jump_names[type & 0xff]);
1157                  sljit_verbose_fparam(src1, src1w);                  sljit_verbose_fparam(src1, src1w);
1158                  fprintf(compiler->verbose, ", ");                  fprintf(compiler->verbose, ", ");
1159                  sljit_verbose_fparam(src2, src2w);                  sljit_verbose_fparam(src2, src2w);
# Line 1141  static SLJIT_INLINE void check_sljit_emi Line 1162  static SLJIT_INLINE void check_sljit_emi
1162  #endif  #endif
1163  }  }
1164    
1165  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, sljit_si type, sljit_si src, sljit_sw srcw)
1166  {  {
1167          /* If debug and verbose are disabled, all arguments are unused. */          /* If debug and verbose are disabled, all arguments are unused. */
1168          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
# Line 1162  static SLJIT_INLINE void check_sljit_emi Line 1183  static SLJIT_INLINE void check_sljit_emi
1183  #endif  #endif
1184  }  }
1185    
1186  static SLJIT_INLINE void check_sljit_emit_cond_value(struct sljit_compiler *compiler, int op, int dst, sljit_w dstw, int type)  static SLJIT_INLINE void check_sljit_emit_cond_value(struct sljit_compiler *compiler, sljit_si op, sljit_si dst, sljit_sw dstw, sljit_si type)
1187  {  {
1188          /* If debug and verbose are disabled, all arguments are unused. */          /* If debug and verbose are disabled, all arguments are unused. */
1189          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
# Line 1187  static SLJIT_INLINE void check_sljit_emi Line 1208  static SLJIT_INLINE void check_sljit_emi
1208  #endif  #endif
1209  }  }
1210    
1211  static SLJIT_INLINE void check_sljit_get_local_base(struct sljit_compiler *compiler, int dst, sljit_w dstw, sljit_w offset)  static SLJIT_INLINE void check_sljit_get_local_base(struct sljit_compiler *compiler, sljit_si dst, sljit_sw dstw, sljit_sw offset)
1212  {  {
1213          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1214          SLJIT_UNUSED_ARG(dst);          SLJIT_UNUSED_ARG(dst);
# Line 1206  static SLJIT_INLINE void check_sljit_get Line 1227  static SLJIT_INLINE void check_sljit_get
1227  #endif  #endif
1228  }  }
1229    
1230  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, sljit_si dst, sljit_sw dstw, sljit_sw init_value)
1231  {  {
1232          /* If debug and verbose are disabled, all arguments are unused. */          /* If debug and verbose are disabled, all arguments are unused. */
1233          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
# Line 1226  static SLJIT_INLINE void check_sljit_emi Line 1247  static SLJIT_INLINE void check_sljit_emi
1247  #endif  #endif
1248  }  }
1249    
1250  static SLJIT_INLINE int emit_mov_before_return(struct sljit_compiler *compiler, int op, int src, sljit_w srcw)  static SLJIT_INLINE sljit_si emit_mov_before_return(struct sljit_compiler *compiler, sljit_si op, sljit_si src, sljit_sw srcw)
1251  {  {
1252          /* Return if don't need to do anything. */          /* Return if don't need to do anything. */
1253          if (op == SLJIT_UNUSED)          if (op == SLJIT_UNUSED)
1254                  return SLJIT_SUCCESS;                  return SLJIT_SUCCESS;
1255    
1256  #if (defined SLJIT_64BIT_ARCHITECTURE && SLJIT_64BIT_ARCHITECTURE)  #if (defined SLJIT_64BIT_ARCHITECTURE && SLJIT_64BIT_ARCHITECTURE)
1257          /* At the moment the pointer size is always equal to sljit_w. May be changed in the future. */          /* At the moment the pointer size is always equal to sljit_sw. May be changed in the future. */
1258          if (src == SLJIT_RETURN_REG && (op == SLJIT_MOV || op == SLJIT_MOV_P))          if (src == SLJIT_RETURN_REG && (op == SLJIT_MOV || op == SLJIT_MOV_P))
1259                  return SLJIT_SUCCESS;                  return SLJIT_SUCCESS;
1260  #else  #else
# Line 1295  static SLJIT_INLINE int emit_mov_before_ Line 1316  static SLJIT_INLINE int emit_mov_before_
1316    
1317  #if !(defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)  #if !(defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
1318    
1319  SLJIT_API_FUNC_ATTRIBUTE 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, sljit_si type,
1320          int src1, sljit_w src1w,          sljit_si src1, sljit_sw src1w,
1321          int src2, sljit_w src2w)          sljit_si src2, sljit_sw src2w)
1322  {  {
1323          /* Default compare for most architectures. */          /* Default compare for most architectures. */
1324          int flags, tmp_src, condition;          sljit_si flags, tmp_src, condition;
1325          sljit_w tmp_srcw;          sljit_sw tmp_srcw;
1326    
1327          CHECK_ERROR_PTR();          CHECK_ERROR_PTR();
1328          check_sljit_emit_cmp(compiler, type, src1, src1w, src2, src2w);          check_sljit_emit_cmp(compiler, type, src1, src1w, src2, src2w);
# Line 1362  SLJIT_API_FUNC_ATTRIBUTE struct sljit_ju Line 1383  SLJIT_API_FUNC_ATTRIBUTE struct sljit_ju
1383          return sljit_emit_jump(compiler, condition | (type & SLJIT_REWRITABLE_JUMP));          return sljit_emit_jump(compiler, condition | (type & SLJIT_REWRITABLE_JUMP));
1384  }  }
1385    
1386  SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_fcmp(struct sljit_compiler *compiler, int type,  SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_fcmp(struct sljit_compiler *compiler, sljit_si type,
1387          int src1, sljit_w src1w,          sljit_si src1, sljit_sw src1w,
1388          int src2, sljit_w src2w)          sljit_si src2, sljit_sw src2w)
1389  {  {
1390          int flags, condition;          sljit_si flags, condition;
1391    
1392          check_sljit_emit_fcmp(compiler, type, src1, src1w, src2, src2w);          check_sljit_emit_fcmp(compiler, type, src1, src1w, src2, src2w);
1393    
1394          condition = type & 0xff;          condition = type & 0xff;
1395          if (condition <= SLJIT_C_FLOAT_NOT_EQUAL)          flags = (condition <= SLJIT_C_FLOAT_NOT_EQUAL) ? SLJIT_SET_E : SLJIT_SET_S;
1396                  flags = SLJIT_SET_E;          if (type & SLJIT_SINGLE_OP)
1397          else                  flags |= SLJIT_SINGLE_OP;
                 flags = SLJIT_SET_S;  
1398    
1399  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) || (defined SLJIT_DEBUG && SLJIT_DEBUG)  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) || (defined SLJIT_DEBUG && SLJIT_DEBUG)
1400          compiler->skip_checks = 1;          compiler->skip_checks = 1;
1401  #endif  #endif
1402          sljit_emit_fop1(compiler, SLJIT_FCMP | flags, src1, src1w, src2, src2w);          sljit_emit_fop1(compiler, SLJIT_CMPD | flags, src1, src1w, src2, src2w);
1403    
1404  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) || (defined SLJIT_DEBUG && SLJIT_DEBUG)  #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) || (defined SLJIT_DEBUG && SLJIT_DEBUG)
1405          compiler->skip_checks = 1;          compiler->skip_checks = 1;
# Line 1391  SLJIT_API_FUNC_ATTRIBUTE struct sljit_ju Line 1411  SLJIT_API_FUNC_ATTRIBUTE struct sljit_ju
1411    
1412  #if !(defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) && !(defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)  #if !(defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) && !(defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
1413    
1414  SLJIT_API_FUNC_ATTRIBUTE int sljit_get_local_base(struct sljit_compiler *compiler, int dst, sljit_w dstw, sljit_w offset)  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_local_base(struct sljit_compiler *compiler, sljit_si dst, sljit_sw dstw, sljit_sw offset)
1415  {  {
1416          CHECK_ERROR();          CHECK_ERROR();
1417          check_sljit_get_local_base(compiler, dst, dstw, offset);          check_sljit_get_local_base(compiler, dst, dstw, offset);
# Line 1428  SLJIT_API_FUNC_ATTRIBUTE void sljit_free Line 1448  SLJIT_API_FUNC_ATTRIBUTE void sljit_free
1448          SLJIT_ASSERT_STOP();          SLJIT_ASSERT_STOP();
1449  }  }
1450    
1451  SLJIT_API_FUNC_ATTRIBUTE void* sljit_alloc_memory(struct sljit_compiler *compiler, int size)  SLJIT_API_FUNC_ATTRIBUTE void* sljit_alloc_memory(struct sljit_compiler *compiler, sljit_si size)
1452  {  {
1453          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1454          SLJIT_UNUSED_ARG(size);          SLJIT_UNUSED_ARG(size);
# Line 1458  SLJIT_API_FUNC_ATTRIBUTE void sljit_free Line 1478  SLJIT_API_FUNC_ATTRIBUTE void sljit_free
1478          SLJIT_ASSERT_STOP();          SLJIT_ASSERT_STOP();
1479  }  }
1480    
1481  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_enter(struct sljit_compiler *compiler, int args, int temporaries, int saveds, int local_size)  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_enter(struct sljit_compiler *compiler, sljit_si args, sljit_si temporaries, sljit_si saveds, sljit_si local_size)
1482  {  {
1483          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1484          SLJIT_UNUSED_ARG(args);          SLJIT_UNUSED_ARG(args);
# Line 1469  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_ Line 1489  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_
1489          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1490  }  }
1491    
1492  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_context(struct sljit_compiler *compiler, int args, int temporaries, int saveds, int local_size)  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_context(struct sljit_compiler *compiler, sljit_si args, sljit_si temporaries, sljit_si saveds, sljit_si local_size)
1493  {  {
1494          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1495          SLJIT_UNUSED_ARG(args);          SLJIT_UNUSED_ARG(args);
# Line 1479  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_ Line 1499  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_
1499          SLJIT_ASSERT_STOP();          SLJIT_ASSERT_STOP();
1500  }  }
1501    
1502  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_return(struct sljit_compiler *compiler, int op, int src, sljit_w srcw)  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_return(struct sljit_compiler *compiler, sljit_si op, sljit_si src, sljit_sw srcw)
1503  {  {
1504          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1505          SLJIT_UNUSED_ARG(op);          SLJIT_UNUSED_ARG(op);
# Line 1489  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_ Line 1509  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_
1509          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1510  }  }
1511    
1512  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)  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_fast_enter(struct sljit_compiler *compiler, sljit_si dst, sljit_sw dstw, sljit_si args, sljit_si temporaries, sljit_si saveds, sljit_si local_size)
1513  {  {
1514          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1515          SLJIT_UNUSED_ARG(dst);          SLJIT_UNUSED_ARG(dst);
# Line 1502  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_ Line 1522  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_
1522          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1523  }  }
1524    
1525  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fast_return(struct sljit_compiler *compiler, int src, sljit_w srcw)  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_fast_return(struct sljit_compiler *compiler, sljit_si src, sljit_sw srcw)
1526  {  {
1527          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1528          SLJIT_UNUSED_ARG(src);          SLJIT_UNUSED_ARG(src);
# Line 1511  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_ Line 1531  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_
1531          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1532  }  }
1533    
1534  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op0(struct sljit_compiler *compiler, int op)  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op0(struct sljit_compiler *compiler, sljit_si op)
1535  {  {
1536          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1537          SLJIT_UNUSED_ARG(op);          SLJIT_UNUSED_ARG(op);
# Line 1519  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_ Line 1539  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_
1539          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1540  }  }
1541    
1542  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op1(struct sljit_compiler *compiler, int op,  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op1(struct sljit_compiler *compiler, sljit_si op,
1543          int dst, sljit_w dstw,          sljit_si dst, sljit_sw dstw,
1544          int src, sljit_w srcw)          sljit_si src, sljit_sw srcw)
1545  {  {
1546          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1547          SLJIT_UNUSED_ARG(op);          SLJIT_UNUSED_ARG(op);
# Line 1533  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_ Line 1553  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_
1553          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1554  }  }
1555    
1556  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op2(struct sljit_compiler *compiler, int op,  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op2(struct sljit_compiler *compiler, sljit_si op,
1557          int dst, sljit_w dstw,          sljit_si dst, sljit_sw dstw,
1558          int src1, sljit_w src1w,          sljit_si src1, sljit_sw src1w,
1559          int src2, sljit_w src2w)          sljit_si src2, sljit_sw src2w)
1560  {  {
1561          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1562          SLJIT_UNUSED_ARG(op);          SLJIT_UNUSED_ARG(op);
# Line 1550  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_ Line 1570  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_
1570          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1571  }  }
1572    
1573  SLJIT_API_FUNC_ATTRIBUTE int sljit_get_register_index(int reg)  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_register_index(sljit_si reg)
1574  {  {
1575          SLJIT_ASSERT_STOP();          SLJIT_ASSERT_STOP();
1576          return reg;          return reg;
1577  }  }
1578    
1579  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op_custom(struct sljit_compiler *compiler,  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op_custom(struct sljit_compiler *compiler,
1580          void *instruction, int size)          void *instruction, sljit_si size)
1581  {  {
1582          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1583          SLJIT_UNUSED_ARG(instruction);          SLJIT_UNUSED_ARG(instruction);
# Line 1566  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_ Line 1586  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_
1586          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1587  }  }
1588    
1589  SLJIT_API_FUNC_ATTRIBUTE int sljit_is_fpu_available(void)  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_is_fpu_available(void)
1590  {  {
1591          SLJIT_ASSERT_STOP();          SLJIT_ASSERT_STOP();
1592          return 0;          return 0;
1593  }  }
1594    
1595  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fop1(struct sljit_compiler *compiler, int op,  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_fop1(struct sljit_compiler *compiler, sljit_si op,
1596          int dst, sljit_w dstw,          sljit_si dst, sljit_sw dstw,
1597          int src, sljit_w srcw)          sljit_si src, sljit_sw srcw)
1598  {  {
1599          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1600          SLJIT_UNUSED_ARG(op);          SLJIT_UNUSED_ARG(op);
# Line 1586  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_ Line 1606  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_
1606          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1607  }  }
1608    
1609  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fop2(struct sljit_compiler *compiler, int op,  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_fop2(struct sljit_compiler *compiler, sljit_si op,
1610          int dst, sljit_w dstw,          sljit_si dst, sljit_sw dstw,
1611          int src1, sljit_w src1w,          sljit_si src1, sljit_sw src1w,
1612          int src2, sljit_w src2w)          sljit_si src2, sljit_sw src2w)
1613  {  {
1614          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1615          SLJIT_UNUSED_ARG(op);          SLJIT_UNUSED_ARG(op);
# Line 1610  SLJIT_API_FUNC_ATTRIBUTE struct sljit_la Line 1630  SLJIT_API_FUNC_ATTRIBUTE struct sljit_la
1630          return NULL;          return NULL;
1631  }  }
1632    
1633  SLJIT_API_FUNC_ATTRIBUTE 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, sljit_si type)
1634  {  {
1635          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1636          SLJIT_UNUSED_ARG(type);          SLJIT_UNUSED_ARG(type);
# Line 1618  SLJIT_API_FUNC_ATTRIBUTE struct sljit_ju Line 1638  SLJIT_API_FUNC_ATTRIBUTE struct sljit_ju
1638          return NULL;          return NULL;
1639  }  }
1640    
1641  SLJIT_API_FUNC_ATTRIBUTE 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, sljit_si type,
1642          int src1, sljit_w src1w,          sljit_si src1, sljit_sw src1w,
1643          int src2, sljit_w src2w)          sljit_si src2, sljit_sw src2w)
1644  {  {
1645          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1646          SLJIT_UNUSED_ARG(type);          SLJIT_UNUSED_ARG(type);
# Line 1632  SLJIT_API_FUNC_ATTRIBUTE struct sljit_ju Line 1652  SLJIT_API_FUNC_ATTRIBUTE struct sljit_ju
1652          return NULL;          return NULL;
1653  }  }
1654    
1655  SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_fcmp(struct sljit_compiler *compiler, int type,  SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_fcmp(struct sljit_compiler *compiler, sljit_si type,
1656          int src1, sljit_w src1w,          sljit_si src1, sljit_sw src1w,
1657          int src2, sljit_w src2w)          sljit_si src2, sljit_sw src2w)
1658  {  {
1659          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1660          SLJIT_UNUSED_ARG(type);          SLJIT_UNUSED_ARG(type);
# Line 1660  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_ Line 1680  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_
1680          SLJIT_ASSERT_STOP();          SLJIT_ASSERT_STOP();
1681  }  }
1682    
1683  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_ijump(struct sljit_compiler *compiler, int type, int src, sljit_w srcw)  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_ijump(struct sljit_compiler *compiler, sljit_si type, sljit_si src, sljit_sw srcw)
1684  {  {
1685          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1686          SLJIT_UNUSED_ARG(type);          SLJIT_UNUSED_ARG(type);
# Line 1670  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_ Line 1690  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_
1690          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1691  }  }
1692    
1693  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_cond_value(struct sljit_compiler *compiler, int op, int dst, sljit_w dstw, int type)  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_cond_value(struct sljit_compiler *compiler, sljit_si op, sljit_si dst, sljit_sw dstw, sljit_si type)
1694  {  {
1695          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1696          SLJIT_UNUSED_ARG(op);          SLJIT_UNUSED_ARG(op);
# Line 1681  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_ Line 1701  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_
1701          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1702  }  }
1703    
1704  SLJIT_API_FUNC_ATTRIBUTE int sljit_get_local_base(struct sljit_compiler *compiler, int dst, sljit_w dstw, sljit_w offset)  SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_local_base(struct sljit_compiler *compiler, sljit_si dst, sljit_sw dstw, sljit_sw offset)
1705  {  {
1706          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1707          SLJIT_UNUSED_ARG(dst);          SLJIT_UNUSED_ARG(dst);
# Line 1691  SLJIT_API_FUNC_ATTRIBUTE int sljit_get_l Line 1711  SLJIT_API_FUNC_ATTRIBUTE int sljit_get_l
1711          return SLJIT_ERR_UNSUPPORTED;          return SLJIT_ERR_UNSUPPORTED;
1712  }  }
1713    
1714  SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, int dst, sljit_w dstw, sljit_w initval)  SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, sljit_si dst, sljit_sw dstw, sljit_sw initval)
1715  {  {
1716          SLJIT_UNUSED_ARG(compiler);          SLJIT_UNUSED_ARG(compiler);
1717          SLJIT_UNUSED_ARG(dst);          SLJIT_UNUSED_ARG(dst);
# Line 1708  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_ Line 1728  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_
1728          SLJIT_ASSERT_STOP();          SLJIT_ASSERT_STOP();
1729  }  }
1730    
1731  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_w new_constant)  SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant)
1732  {  {
1733          SLJIT_UNUSED_ARG(addr);          SLJIT_UNUSED_ARG(addr);
1734          SLJIT_UNUSED_ARG(new_constant);          SLJIT_UNUSED_ARG(new_constant);

Legend:
Removed from v.1194  
changed lines
  Added in v.1195

  ViewVC Help
Powered by ViewVC 1.1.5