version 1.1.1.3, 2012/10/09 09:19:18
|
version 1.1.1.4, 2013/07/22 08:25:57
|
Line 89
|
Line 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)) |
|
|
#define GET_ALL_FLAGS(op) \ |
#define GET_ALL_FLAGS(op) \ |
((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)) |
|
|
|
#define TYPE_CAST_NEEDED(op) \ |
|
(((op) >= SLJIT_MOV_UB && (op) <= SLJIT_MOV_SH) || ((op) >= SLJIT_MOVU_UB && (op) <= SLJIT_MOVU_SH)) |
|
|
#define BUF_SIZE 4096 |
#define BUF_SIZE 4096 |
|
|
#if (defined SLJIT_32BIT_ARCHITECTURE && SLJIT_32BIT_ARCHITECTURE) |
#if (defined SLJIT_32BIT_ARCHITECTURE && SLJIT_32BIT_ARCHITECTURE) |
Line 105
|
Line 108
|
/* SLJIT_REWRITABLE_JUMP is 0x1000. */ |
/* SLJIT_REWRITABLE_JUMP is 0x1000. */ |
|
|
#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) |
#define PATCH_MB 0x4 | # define PATCH_MB 0x4 |
#define PATCH_MW 0x8 | # define PATCH_MW 0x8 |
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) |
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) |
#define PATCH_MD 0x10 | # define PATCH_MD 0x10 |
#endif |
#endif |
#endif |
#endif |
|
|
#if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5) || (defined SLJIT_CONFIG_ARM_V7 && SLJIT_CONFIG_ARM_V7) |
#if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5) || (defined SLJIT_CONFIG_ARM_V7 && SLJIT_CONFIG_ARM_V7) |
#define IS_BL 0x4 | # define IS_BL 0x4 |
#define PATCH_B 0x8 | # define PATCH_B 0x8 |
#endif |
#endif |
|
|
#if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5) |
#if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5) |
#define CPOOL_SIZE 512 | # define CPOOL_SIZE 512 |
#endif |
#endif |
|
|
#if (defined SLJIT_CONFIG_ARM_THUMB2 && SLJIT_CONFIG_ARM_THUMB2) |
#if (defined SLJIT_CONFIG_ARM_THUMB2 && SLJIT_CONFIG_ARM_THUMB2) |
#define IS_CONDITIONAL 0x04 | # define IS_COND 0x04 |
#define IS_BL 0x08 | # define IS_BL 0x08 |
/* cannot be encoded as branch */ |
/* cannot be encoded as branch */ |
#define B_TYPE0 0x00 | # define B_TYPE0 0x00 |
/* conditional + imm8 */ |
/* conditional + imm8 */ |
#define B_TYPE1 0x10 | # define B_TYPE1 0x10 |
/* conditional + imm20 */ |
/* conditional + imm20 */ |
#define B_TYPE2 0x20 | # define B_TYPE2 0x20 |
/* IT + imm24 */ |
/* IT + imm24 */ |
#define B_TYPE3 0x30 | # define B_TYPE3 0x30 |
/* imm11 */ |
/* imm11 */ |
#define B_TYPE4 0x40 | # define B_TYPE4 0x40 |
/* imm24 */ |
/* imm24 */ |
#define B_TYPE5 0x50 | # define B_TYPE5 0x50 |
/* BL + imm24 */ |
/* BL + imm24 */ |
#define BL_TYPE6 0x60 | # define BL_TYPE6 0x60 |
/* 0xf00 cc code for branches */ |
/* 0xf00 cc code for branches */ |
#endif |
#endif |
|
|
#if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) || (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) |
#if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) || (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) |
#define UNCOND_B 0x04 | # define UNCOND_B 0x04 |
#define PATCH_B 0x08 | # define PATCH_B 0x08 |
#define ABSOLUTE_B 0x10 | # define ABSOLUTE_B 0x10 |
#endif |
#endif |
|
|
#if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32) |
#if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32) |
#define IS_MOVABLE 0x04 | # define IS_MOVABLE 0x04 |
#define IS_JAL 0x08 | # define IS_JAL 0x08 |
#define IS_BIT26_COND 0x10 | # define IS_BIT26_COND 0x10 |
#define IS_BIT16_COND 0x20 | # define IS_BIT16_COND 0x20 |
|
|
#define IS_COND (IS_BIT26_COND | IS_BIT16_COND) | # define IS_COND (IS_BIT26_COND | IS_BIT16_COND) |
|
|
#define PATCH_B 0x40 | # define PATCH_B 0x40 |
#define PATCH_J 0x80 | # define PATCH_J 0x80 |
|
|
/* instruction types */ |
/* instruction types */ |
#define UNMOVABLE_INS 0 | # define MOVABLE_INS 0 |
/* 1 - 31 last destination register */ |
/* 1 - 31 last destination register */ |
#define FCSR_FCC 32 |
|
/* no destination (i.e: store) */ |
/* no destination (i.e: store) */ |
#define MOVABLE_INS 33 | # define UNMOVABLE_INS 32 |
| /* FPU status register */ |
| # define FCSR_FCC 33 |
#endif |
#endif |
|
|
|
#if (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32) |
|
# define IS_MOVABLE 0x04 |
|
# define IS_COND 0x08 |
|
# define IS_CALL 0x10 |
|
|
|
# define PATCH_B 0x20 |
|
# define PATCH_CALL 0x40 |
|
|
|
/* instruction types */ |
|
# define MOVABLE_INS 0 |
|
/* 1 - 31 last destination register */ |
|
/* no destination (i.e: store) */ |
|
# define UNMOVABLE_INS 32 |
|
|
|
# define DST_INS_MASK 0xff |
|
|
|
/* ICC_SET is the same as SET_FLAGS. */ |
|
# define ICC_IS_SET (1 << 23) |
|
# define FCC_IS_SET (1 << 24) |
|
#endif |
|
|
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) |
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) |
#define SLJIT_HAS_VARIABLE_LOCALS_OFFSET 1 |
#define SLJIT_HAS_VARIABLE_LOCALS_OFFSET 1 |
|
#if !(defined SLJIT_X86_32_FASTCALL && SLJIT_X86_32_FASTCALL) |
|
#define FIXED_LOCALS_OFFSET (3 * sizeof(sljit_sw)) |
#endif |
#endif |
|
#endif |
|
|
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) |
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) |
#define SLJIT_HAS_FIXED_LOCALS_OFFSET 1 |
#define SLJIT_HAS_FIXED_LOCALS_OFFSET 1 |
#ifdef _WIN64 |
#ifdef _WIN64 |
#define FIXED_LOCALS_OFFSET (4 * sizeof(sljit_w)) | #define FIXED_LOCALS_OFFSET ((4 + 2) * sizeof(sljit_sw)) |
#else |
#else |
#define FIXED_LOCALS_OFFSET (sizeof(sljit_w)) | #define FIXED_LOCALS_OFFSET (sizeof(sljit_sw)) |
#endif |
#endif |
#endif |
#endif |
|
|
#if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32) | #if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) |
#define SLJIT_HAS_FIXED_LOCALS_OFFSET 1 |
#define SLJIT_HAS_FIXED_LOCALS_OFFSET 1 |
#define FIXED_LOCALS_OFFSET (4 * sizeof(sljit_w)) | #if (defined SLJIT_INDIRECT_CALL && SLJIT_INDIRECT_CALL) |
| #define FIXED_LOCALS_OFFSET ((6 + 8) * sizeof(sljit_sw)) |
| #else |
| #define FIXED_LOCALS_OFFSET (2 * sizeof(sljit_sw)) |
#endif |
#endif |
|
#endif |
|
|
#if (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) | #if (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) |
#define SLJIT_HAS_FIXED_LOCALS_OFFSET 1 |
#define SLJIT_HAS_FIXED_LOCALS_OFFSET 1 |
#define FIXED_LOCALS_OFFSET (2 * sizeof(sljit_w)) | #define FIXED_LOCALS_OFFSET ((6 + 8) * sizeof(sljit_sw)) |
#endif |
#endif |
|
|
#if (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) | #if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32) |
#define SLJIT_HAS_FIXED_LOCALS_OFFSET 1 |
#define SLJIT_HAS_FIXED_LOCALS_OFFSET 1 |
#define FIXED_LOCALS_OFFSET ((7 + 8) * sizeof(sljit_w)) | #define FIXED_LOCALS_OFFSET (4 * sizeof(sljit_sw)) |
#endif |
#endif |
|
|
|
#if (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32) |
|
#define SLJIT_HAS_FIXED_LOCALS_OFFSET 1 |
|
#define FIXED_LOCALS_OFFSET (23 * sizeof(sljit_sw)) |
|
#endif |
|
|
#if (defined SLJIT_HAS_VARIABLE_LOCALS_OFFSET && SLJIT_HAS_VARIABLE_LOCALS_OFFSET) |
#if (defined SLJIT_HAS_VARIABLE_LOCALS_OFFSET && SLJIT_HAS_VARIABLE_LOCALS_OFFSET) |
|
|
#define ADJUST_LOCAL_OFFSET(p, i) \ |
#define ADJUST_LOCAL_OFFSET(p, i) \ |
Line 233
|
Line 270
|
|
|
#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))) |
#define SLJIT_NEEDS_COMPILER_INIT 1 |
#define SLJIT_NEEDS_COMPILER_INIT 1 |
static int compiler_initialized = 0; | static sljit_si compiler_initialized = 0; |
/* A thread safe initialization. */ |
/* A thread safe initialization. */ |
static void init_compiler(void); |
static void init_compiler(void); |
#endif |
#endif |
Line 246 SLJIT_API_FUNC_ATTRIBUTE struct sljit_compiler* sljit_
|
Line 283 SLJIT_API_FUNC_ATTRIBUTE struct sljit_compiler* sljit_
|
SLJIT_ZEROMEM(compiler, sizeof(struct sljit_compiler)); |
SLJIT_ZEROMEM(compiler, sizeof(struct sljit_compiler)); |
|
|
SLJIT_COMPILE_ASSERT( |
SLJIT_COMPILE_ASSERT( |
sizeof(sljit_b) == 1 && sizeof(sljit_ub) == 1 | sizeof(sljit_sb) == 1 && sizeof(sljit_ub) == 1 |
&& sizeof(sljit_h) == 2 && sizeof(sljit_uh) == 2 | && sizeof(sljit_sh) == 2 && sizeof(sljit_uh) == 2 |
&& sizeof(sljit_i) == 4 && sizeof(sljit_ui) == 4 | && sizeof(sljit_si) == 4 && sizeof(sljit_ui) == 4 |
&& ((sizeof(sljit_w) == 4 && sizeof(sljit_uw) == 4) || (sizeof(sljit_w) == 8 && sizeof(sljit_uw) == 8)), | && (sizeof(sljit_p) == 4 || sizeof(sljit_p) == 8) |
| && sizeof(sljit_p) <= sizeof(sljit_sw) |
| && (sizeof(sljit_sw) == 4 || sizeof(sljit_sw) == 8) |
| && (sizeof(sljit_uw) == 4 || sizeof(sljit_uw) == 8), |
invalid_integer_types); |
invalid_integer_types); |
|
SLJIT_COMPILE_ASSERT(SLJIT_INT_OP == SLJIT_SINGLE_OP, |
|
int_op_and_single_op_must_be_the_same); |
|
SLJIT_COMPILE_ASSERT(SLJIT_REWRITABLE_JUMP != SLJIT_SINGLE_OP, |
|
rewritable_jump_and_single_op_must_not_be_the_same); |
|
|
/* Only the non-zero members must be set. */ |
/* Only the non-zero members must be set. */ |
compiler->error = SLJIT_SUCCESS; |
compiler->error = SLJIT_SUCCESS; |
Line 272 SLJIT_API_FUNC_ATTRIBUTE struct sljit_compiler* sljit_
|
Line 316 SLJIT_API_FUNC_ATTRIBUTE struct sljit_compiler* sljit_
|
compiler->abuf->next = NULL; |
compiler->abuf->next = NULL; |
compiler->abuf->used_size = 0; |
compiler->abuf->used_size = 0; |
|
|
compiler->temporaries = -1; | compiler->scratches = -1; |
compiler->saveds = -1; |
compiler->saveds = -1; |
|
|
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) |
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) |
Line 295 SLJIT_API_FUNC_ATTRIBUTE struct sljit_compiler* sljit_
|
Line 339 SLJIT_API_FUNC_ATTRIBUTE struct sljit_compiler* sljit_
|
compiler->delay_slot = UNMOVABLE_INS; |
compiler->delay_slot = UNMOVABLE_INS; |
#endif |
#endif |
|
|
|
#if (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32) |
|
compiler->delay_slot = UNMOVABLE_INS; |
|
#endif |
|
|
#if (defined SLJIT_NEEDS_COMPILER_INIT && SLJIT_NEEDS_COMPILER_INIT) |
#if (defined SLJIT_NEEDS_COMPILER_INIT && SLJIT_NEEDS_COMPILER_INIT) |
if (!compiler_initialized) { |
if (!compiler_initialized) { |
init_compiler(); |
init_compiler(); |
Line 336 SLJIT_API_FUNC_ATTRIBUTE void sljit_free_code(void* co
|
Line 384 SLJIT_API_FUNC_ATTRIBUTE void sljit_free_code(void* co
|
/* Remove thumb mode flag. */ |
/* Remove thumb mode flag. */ |
SLJIT_FREE_EXEC((void*)((sljit_uw)code & ~0x1)); |
SLJIT_FREE_EXEC((void*)((sljit_uw)code & ~0x1)); |
} |
} |
#elif (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) | #elif (defined SLJIT_INDIRECT_CALL && SLJIT_INDIRECT_CALL) |
SLJIT_API_FUNC_ATTRIBUTE void sljit_free_code(void* code) |
SLJIT_API_FUNC_ATTRIBUTE void sljit_free_code(void* code) |
{ |
{ |
/* Resolve indirection. */ |
/* Resolve indirection. */ |
Line 374 SLJIT_API_FUNC_ATTRIBUTE void sljit_set_target(struct
|
Line 422 SLJIT_API_FUNC_ATTRIBUTE void sljit_set_target(struct
|
/* Private functions */ |
/* Private functions */ |
/* --------------------------------------------------------------------- */ |
/* --------------------------------------------------------------------- */ |
|
|
static void* ensure_buf(struct sljit_compiler *compiler, int size) | static void* ensure_buf(struct sljit_compiler *compiler, sljit_uw size) |
{ |
{ |
sljit_ub *ret; |
sljit_ub *ret; |
struct sljit_memory_fragment *new_frag; |
struct sljit_memory_fragment *new_frag; |
|
|
if (compiler->buf->used_size + size <= (int)(BUF_SIZE - sizeof(sljit_uw) - sizeof(void*))) { | SLJIT_ASSERT(size <= 256); |
| if (compiler->buf->used_size + size <= (BUF_SIZE - (sljit_uw)SLJIT_OFFSETOF(struct sljit_memory_fragment, memory))) { |
ret = compiler->buf->memory + compiler->buf->used_size; |
ret = compiler->buf->memory + compiler->buf->used_size; |
compiler->buf->used_size += size; |
compiler->buf->used_size += size; |
return ret; |
return ret; |
Line 392 static void* ensure_buf(struct sljit_compiler *compile
|
Line 441 static void* ensure_buf(struct sljit_compiler *compile
|
return new_frag->memory; |
return new_frag->memory; |
} |
} |
|
|
static void* ensure_abuf(struct sljit_compiler *compiler, int size) | static void* ensure_abuf(struct sljit_compiler *compiler, sljit_uw size) |
{ |
{ |
sljit_ub *ret; |
sljit_ub *ret; |
struct sljit_memory_fragment *new_frag; |
struct sljit_memory_fragment *new_frag; |
|
|
if (compiler->abuf->used_size + size <= (int)(ABUF_SIZE - sizeof(sljit_uw) - sizeof(void*))) { | SLJIT_ASSERT(size <= 256); |
| if (compiler->abuf->used_size + size <= (ABUF_SIZE - (sljit_uw)SLJIT_OFFSETOF(struct sljit_memory_fragment, memory))) { |
ret = compiler->abuf->memory + compiler->abuf->used_size; |
ret = compiler->abuf->memory + compiler->abuf->used_size; |
compiler->abuf->used_size += size; |
compiler->abuf->used_size += size; |
return ret; |
return ret; |
Line 410 static void* ensure_abuf(struct sljit_compiler *compil
|
Line 460 static void* ensure_abuf(struct sljit_compiler *compil
|
return new_frag->memory; |
return new_frag->memory; |
} |
} |
|
|
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) |
{ |
{ |
CHECK_ERROR_PTR(); |
CHECK_ERROR_PTR(); |
|
|
Line 453 static SLJIT_INLINE void set_label(struct sljit_label
|
Line 503 static SLJIT_INLINE void set_label(struct sljit_label
|
compiler->last_label = label; |
compiler->last_label = label; |
} |
} |
|
|
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) |
{ |
{ |
jump->next = NULL; |
jump->next = NULL; |
jump->flags = flags; |
jump->flags = flags; |
Line 498 static SLJIT_INLINE void set_const(struct sljit_const
|
Line 548 static SLJIT_INLINE void set_const(struct sljit_const
|
case SLJIT_MUL: \ |
case SLJIT_MUL: \ |
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))); \ |
break; \ |
break; \ |
case SLJIT_FCMP: \ | case SLJIT_CMPD: \ |
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))); \ |
SLJIT_ASSERT((op & (SLJIT_SET_E | SLJIT_SET_S))); \ |
SLJIT_ASSERT((op & (SLJIT_SET_E | SLJIT_SET_S))); \ |
break; \ |
break; \ |
case SLJIT_ADD: \ |
case SLJIT_ADD: \ |
Line 511 static SLJIT_INLINE void set_const(struct sljit_const
|
Line 561 static SLJIT_INLINE void set_const(struct sljit_const
|
case SLJIT_SUBC: \ |
case SLJIT_SUBC: \ |
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))); \ |
break; \ |
break; \ |
default: \ | case SLJIT_BREAKPOINT: \ |
| case SLJIT_NOP: \ |
| case SLJIT_UMUL: \ |
| case SLJIT_SMUL: \ |
| case SLJIT_MOV: \ |
| case SLJIT_MOV_P: \ |
| case SLJIT_MOVU: \ |
| case SLJIT_MOVU_P: \ |
/* Nothing allowed */ \ |
/* Nothing allowed */ \ |
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))); \ |
break; \ |
break; \ |
|
default: \ |
|
/* Only SLJIT_INT_OP or SLJIT_SINGLE_OP is allowed. */ \ |
|
SLJIT_ASSERT(!(op & (SLJIT_SET_E | SLJIT_SET_S | SLJIT_SET_U | SLJIT_SET_O | SLJIT_SET_C | SLJIT_KEEP_FLAGS))); \ |
|
break; \ |
} |
} |
|
|
#define FUNCTION_CHECK_IS_REG(r) \ |
#define FUNCTION_CHECK_IS_REG(r) \ |
((r) == SLJIT_UNUSED || \ |
((r) == SLJIT_UNUSED || \ |
((r) >= SLJIT_TEMPORARY_REG1 && (r) <= SLJIT_TEMPORARY_REG1 - 1 + compiler->temporaries) || \ | ((r) >= SLJIT_SCRATCH_REG1 && (r) <= SLJIT_SCRATCH_REG1 - 1 + compiler->scratches) || \ |
((r) >= SLJIT_SAVED_REG1 && (r) <= SLJIT_SAVED_REG1 - 1 + compiler->saveds)) |
((r) >= SLJIT_SAVED_REG1 && (r) <= SLJIT_SAVED_REG1 - 1 + compiler->saveds)) |
|
|
#define FUNCTION_CHECK_SRC(p, i) \ |
#define FUNCTION_CHECK_SRC(p, i) \ |
SLJIT_ASSERT(compiler->temporaries != -1 && compiler->saveds != -1); \ | SLJIT_ASSERT(compiler->scratches != -1 && compiler->saveds != -1); \ |
if (FUNCTION_CHECK_IS_REG(p)) \ |
if (FUNCTION_CHECK_IS_REG(p)) \ |
SLJIT_ASSERT((i) == 0 && (p) != SLJIT_UNUSED); \ |
SLJIT_ASSERT((i) == 0 && (p) != SLJIT_UNUSED); \ |
else if ((p) == SLJIT_IMM) \ |
else if ((p) == SLJIT_IMM) \ |
Line 542 static SLJIT_INLINE void set_const(struct sljit_const
|
Line 603 static SLJIT_INLINE void set_const(struct sljit_const
|
SLJIT_ASSERT_STOP(); |
SLJIT_ASSERT_STOP(); |
|
|
#define FUNCTION_CHECK_DST(p, i) \ |
#define FUNCTION_CHECK_DST(p, i) \ |
SLJIT_ASSERT(compiler->temporaries != -1 && compiler->saveds != -1); \ | SLJIT_ASSERT(compiler->scratches != -1 && compiler->saveds != -1); \ |
if (FUNCTION_CHECK_IS_REG(p)) \ |
if (FUNCTION_CHECK_IS_REG(p)) \ |
SLJIT_ASSERT((i) == 0); \ |
SLJIT_ASSERT((i) == 0); \ |
else if ((p) == (SLJIT_MEM1(SLJIT_LOCALS_REG))) \ |
else if ((p) == (SLJIT_MEM1(SLJIT_LOCALS_REG))) \ |
Line 559 static SLJIT_INLINE void set_const(struct sljit_const
|
Line 620 static SLJIT_INLINE void set_const(struct sljit_const
|
SLJIT_ASSERT_STOP(); |
SLJIT_ASSERT_STOP(); |
|
|
#define FUNCTION_FCHECK(p, i) \ |
#define FUNCTION_FCHECK(p, i) \ |
if ((p) >= SLJIT_FLOAT_REG1 && (p) <= SLJIT_FLOAT_REG4) \ | if ((p) >= SLJIT_FLOAT_REG1 && (p) <= SLJIT_FLOAT_REG6) \ |
SLJIT_ASSERT(i == 0); \ |
SLJIT_ASSERT(i == 0); \ |
else if ((p) & SLJIT_MEM) { \ |
else if ((p) & SLJIT_MEM) { \ |
SLJIT_ASSERT(FUNCTION_CHECK_IS_REG((p) & 0xf)); \ |
SLJIT_ASSERT(FUNCTION_CHECK_IS_REG((p) & 0xf)); \ |
Line 574 static SLJIT_INLINE void set_const(struct sljit_const
|
Line 635 static SLJIT_INLINE void set_const(struct sljit_const
|
SLJIT_ASSERT_STOP(); |
SLJIT_ASSERT_STOP(); |
|
|
#define FUNCTION_CHECK_OP1() \ |
#define FUNCTION_CHECK_OP1() \ |
if (GET_OPCODE(op) >= SLJIT_MOV && GET_OPCODE(op) <= SLJIT_MOVU_SI) { \ | 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_SI) { \ | |
SLJIT_ASSERT(!(src & SLJIT_MEM) || (src & 0xf) != SLJIT_LOCALS_REG); \ |
SLJIT_ASSERT(!(src & SLJIT_MEM) || (src & 0xf) != SLJIT_LOCALS_REG); \ |
SLJIT_ASSERT(!(dst & SLJIT_MEM) || (dst & 0xf) != SLJIT_LOCALS_REG); \ |
SLJIT_ASSERT(!(dst & SLJIT_MEM) || (dst & 0xf) != SLJIT_LOCALS_REG); \ |
if ((src & SLJIT_MEM) && (src & 0xf)) \ |
if ((src & SLJIT_MEM) && (src & 0xf)) \ |
Line 594 SLJIT_API_FUNC_ATTRIBUTE void sljit_compiler_verbose(s
|
Line 652 SLJIT_API_FUNC_ATTRIBUTE void sljit_compiler_verbose(s
|
} |
} |
|
|
static char* reg_names[] = { |
static char* reg_names[] = { |
(char*)"<noreg>", (char*)"t1", (char*)"t2", (char*)"t3", | (char*)"unused", (char*)"s1", (char*)"s2", (char*)"s3", |
(char*)"te1", (char*)"te2", (char*)"s1", (char*)"s2", | (char*)"se1", (char*)"se2", (char*)"p1", (char*)"p2", |
(char*)"s3", (char*)"se1", (char*)"se2", (char*)"lcr" | (char*)"p3", (char*)"pe1", (char*)"pe2", (char*)"lc" |
}; |
}; |
|
|
static char* freg_names[] = { |
static char* freg_names[] = { |
(char*)"<noreg>", (char*)"float_r1", (char*)"float_r2", (char*)"float_r3", (char*)"float_r4" | (char*)"unused", (char*)"f1", (char*)"f2", (char*)"f3", |
| (char*)"f4", (char*)"f5", (char*)"f6" |
}; |
}; |
|
|
#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) |
#ifdef _WIN64 |
#ifdef _WIN64 |
#define SLJIT_PRINT_D "I64" | # define SLJIT_PRINT_D "I64" |
#else |
#else |
#define SLJIT_PRINT_D "l" | # define SLJIT_PRINT_D "l" |
#endif |
#endif |
#else |
#else |
#define SLJIT_PRINT_D "" | # define SLJIT_PRINT_D "" |
#endif |
#endif |
|
|
#define sljit_verbose_param(p, i) \ |
#define sljit_verbose_param(p, i) \ |
Line 662 static SLJIT_CONST char* op_names[] = {
|
Line 721 static SLJIT_CONST char* op_names[] = {
|
(char*)"umul", (char*)"smul", (char*)"udiv", (char*)"sdiv", |
(char*)"umul", (char*)"smul", (char*)"udiv", (char*)"sdiv", |
/* op1 */ |
/* op1 */ |
(char*)"mov", (char*)"mov.ub", (char*)"mov.sb", (char*)"mov.uh", |
(char*)"mov", (char*)"mov.ub", (char*)"mov.sb", (char*)"mov.uh", |
(char*)"mov.sh", (char*)"mov.ui", (char*)"mov.si", (char*)"movu", | (char*)"mov.sh", (char*)"mov.ui", (char*)"mov.si", (char*)"mov.p", |
(char*)"movu.ub", (char*)"movu.sb", (char*)"movu.uh", (char*)"movu.sh", | (char*)"movu", (char*)"movu.ub", (char*)"movu.sb", (char*)"movu.uh", |
(char*)"movu.ui", (char*)"movu.si", (char*)"not", (char*)"neg", | (char*)"movu.sh", (char*)"movu.ui", (char*)"movu.si", (char*)"movu.p", |
(char*)"clz", | (char*)"not", (char*)"neg", (char*)"clz", |
/* op2 */ |
/* op2 */ |
(char*)"add", (char*)"addc", (char*)"sub", (char*)"subc", |
(char*)"add", (char*)"addc", (char*)"sub", (char*)"subc", |
(char*)"mul", (char*)"and", (char*)"or", (char*)"xor", |
(char*)"mul", (char*)"and", (char*)"or", (char*)"xor", |
(char*)"shl", (char*)"lshr", (char*)"ashr", |
(char*)"shl", (char*)"lshr", (char*)"ashr", |
/* fop1 */ |
/* fop1 */ |
(char*)"fcmp", (char*)"fmov", (char*)"fneg", (char*)"fabs", | (char*)"cmp", (char*)"mov", (char*)"neg", (char*)"abs", |
/* fop2 */ |
/* fop2 */ |
(char*)"fadd", (char*)"fsub", (char*)"fmul", (char*)"fdiv" | (char*)"add", (char*)"sub", (char*)"mul", (char*)"div" |
}; |
}; |
|
|
static char* jump_names[] = { |
static char* jump_names[] = { |
(char*)"c_equal", (char*)"c_not_equal", | (char*)"equal", (char*)"not_equal", |
(char*)"c_less", (char*)"c_greater_equal", | (char*)"less", (char*)"greater_equal", |
(char*)"c_greater", (char*)"c_less_equal", | (char*)"greater", (char*)"less_equal", |
(char*)"c_sig_less", (char*)"c_sig_greater_equal", | (char*)"sig_less", (char*)"sig_greater_equal", |
(char*)"c_sig_greater", (char*)"c_sig_less_equal", | (char*)"sig_greater", (char*)"sig_less_equal", |
(char*)"c_overflow", (char*)"c_not_overflow", | (char*)"overflow", (char*)"not_overflow", |
(char*)"c_mul_overflow", (char*)"c_mul_not_overflow", | (char*)"mul_overflow", (char*)"mul_not_overflow", |
(char*)"c_float_equal", (char*)"c_float_not_equal", | (char*)"float_equal", (char*)"float_not_equal", |
(char*)"c_float_less", (char*)"c_float_greater_equal", | (char*)"float_less", (char*)"float_greater_equal", |
(char*)"c_float_greater", (char*)"c_float_less_equal", | (char*)"float_greater", (char*)"float_less_equal", |
(char*)"c_float_nan", (char*)"c_float_not_nan", | (char*)"float_unordered", (char*)"float_ordered", |
(char*)"jump", (char*)"fast_call", |
(char*)"jump", (char*)"fast_call", |
(char*)"call0", (char*)"call1", (char*)"call2", (char*)"call3" |
(char*)"call0", (char*)"call1", (char*)"call2", (char*)"call3" |
}; |
}; |
Line 717 static SLJIT_INLINE void check_sljit_generate_code(str
|
Line 776 static SLJIT_INLINE void check_sljit_generate_code(str
|
#endif |
#endif |
} |
} |
|
|
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 scratches, sljit_si saveds, sljit_si local_size) |
{ |
{ |
/* If debug and verbose are disabled, all arguments are unused. */ |
/* If debug and verbose are disabled, all arguments are unused. */ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(args); |
SLJIT_UNUSED_ARG(args); |
SLJIT_UNUSED_ARG(temporaries); | SLJIT_UNUSED_ARG(scratches); |
SLJIT_UNUSED_ARG(saveds); |
SLJIT_UNUSED_ARG(saveds); |
SLJIT_UNUSED_ARG(local_size); |
SLJIT_UNUSED_ARG(local_size); |
|
|
SLJIT_ASSERT(args >= 0 && args <= 3); |
SLJIT_ASSERT(args >= 0 && args <= 3); |
SLJIT_ASSERT(temporaries >= 0 && temporaries <= SLJIT_NO_TMP_REGISTERS); | SLJIT_ASSERT(scratches >= 0 && scratches <= SLJIT_NO_TMP_REGISTERS); |
SLJIT_ASSERT(saveds >= 0 && saveds <= SLJIT_NO_GEN_REGISTERS); |
SLJIT_ASSERT(saveds >= 0 && saveds <= SLJIT_NO_GEN_REGISTERS); |
SLJIT_ASSERT(args <= saveds); |
SLJIT_ASSERT(args <= saveds); |
SLJIT_ASSERT(local_size >= 0 && local_size <= SLJIT_MAX_LOCAL_SIZE); |
SLJIT_ASSERT(local_size >= 0 && local_size <= SLJIT_MAX_LOCAL_SIZE); |
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) |
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) |
if (SLJIT_UNLIKELY(!!compiler->verbose)) |
if (SLJIT_UNLIKELY(!!compiler->verbose)) |
fprintf(compiler->verbose, " enter args=%d temporaries=%d saveds=%d local_size=%d\n", args, temporaries, saveds, local_size); | fprintf(compiler->verbose, " enter args=%d scratches=%d saveds=%d local_size=%d\n", args, scratches, saveds, local_size); |
#endif |
#endif |
} |
} |
|
|
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 scratches, sljit_si saveds, sljit_si local_size) |
{ |
{ |
/* If debug and verbose are disabled, all arguments are unused. */ |
/* If debug and verbose are disabled, all arguments are unused. */ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(args); |
SLJIT_UNUSED_ARG(args); |
SLJIT_UNUSED_ARG(temporaries); | SLJIT_UNUSED_ARG(scratches); |
SLJIT_UNUSED_ARG(saveds); |
SLJIT_UNUSED_ARG(saveds); |
SLJIT_UNUSED_ARG(local_size); |
SLJIT_UNUSED_ARG(local_size); |
|
|
Line 754 static SLJIT_INLINE void check_sljit_set_context(struc
|
Line 813 static SLJIT_INLINE void check_sljit_set_context(struc
|
#endif |
#endif |
|
|
SLJIT_ASSERT(args >= 0 && args <= 3); |
SLJIT_ASSERT(args >= 0 && args <= 3); |
SLJIT_ASSERT(temporaries >= 0 && temporaries <= SLJIT_NO_TMP_REGISTERS); | SLJIT_ASSERT(scratches >= 0 && scratches <= SLJIT_NO_TMP_REGISTERS); |
SLJIT_ASSERT(saveds >= 0 && saveds <= SLJIT_NO_GEN_REGISTERS); |
SLJIT_ASSERT(saveds >= 0 && saveds <= SLJIT_NO_GEN_REGISTERS); |
SLJIT_ASSERT(args <= saveds); |
SLJIT_ASSERT(args <= saveds); |
SLJIT_ASSERT(local_size >= 0 && local_size <= SLJIT_MAX_LOCAL_SIZE); |
SLJIT_ASSERT(local_size >= 0 && local_size <= SLJIT_MAX_LOCAL_SIZE); |
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) |
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) |
if (SLJIT_UNLIKELY(!!compiler->verbose)) |
if (SLJIT_UNLIKELY(!!compiler->verbose)) |
fprintf(compiler->verbose, " set_context args=%d temporaries=%d saveds=%d local_size=%d\n", args, temporaries, saveds, local_size); | fprintf(compiler->verbose, " set_context args=%d scratches=%d saveds=%d local_size=%d\n", args, scratches, saveds, local_size); |
#endif |
#endif |
} |
} |
|
|
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) |
{ |
{ |
/* If debug and verbose are disabled, all arguments are unused. */ |
/* If debug and verbose are disabled, all arguments are unused. */ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
Line 774 static SLJIT_INLINE void check_sljit_emit_return(struc
|
Line 833 static SLJIT_INLINE void check_sljit_emit_return(struc
|
|
|
#if (defined SLJIT_DEBUG && SLJIT_DEBUG) |
#if (defined SLJIT_DEBUG && SLJIT_DEBUG) |
if (op != SLJIT_UNUSED) { |
if (op != SLJIT_UNUSED) { |
SLJIT_ASSERT(op >= SLJIT_MOV && op <= SLJIT_MOV_SI); | SLJIT_ASSERT(op >= SLJIT_MOV && op <= SLJIT_MOV_P); |
FUNCTION_CHECK_SRC(src, srcw); |
FUNCTION_CHECK_SRC(src, srcw); |
} |
} |
else |
else |
Line 793 static SLJIT_INLINE void check_sljit_emit_return(struc
|
Line 852 static SLJIT_INLINE void check_sljit_emit_return(struc
|
#endif |
#endif |
} |
} |
|
|
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) |
{ |
{ |
/* If debug and verbose are disabled, all arguments are unused. */ |
/* If debug and verbose are disabled, all arguments are unused. */ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
Line 812 static SLJIT_INLINE void check_sljit_emit_fast_enter(s
|
Line 871 static SLJIT_INLINE void check_sljit_emit_fast_enter(s
|
#endif |
#endif |
} |
} |
|
|
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) |
{ |
{ |
/* If debug and verbose are disabled, all arguments are unused. */ |
/* If debug and verbose are disabled, all arguments are unused. */ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
Line 831 static SLJIT_INLINE void check_sljit_emit_fast_return(
|
Line 890 static SLJIT_INLINE void check_sljit_emit_fast_return(
|
#endif |
#endif |
} |
} |
|
|
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) |
{ |
{ |
/* If debug and verbose are disabled, all arguments are unused. */ |
/* If debug and verbose are disabled, all arguments are unused. */ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
Line 845 static SLJIT_INLINE void check_sljit_emit_op0(struct s
|
Line 904 static SLJIT_INLINE void check_sljit_emit_op0(struct s
|
#endif |
#endif |
} |
} |
|
|
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, |
int dst, sljit_w dstw, | sljit_si dst, sljit_sw dstw, |
int src, sljit_w srcw) | sljit_si src, sljit_sw srcw) |
{ |
{ |
/* If debug and verbose are disabled, all arguments are unused. */ |
/* If debug and verbose are disabled, all arguments are unused. */ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
Line 874 static SLJIT_INLINE void check_sljit_emit_op1(struct s
|
Line 933 static SLJIT_INLINE void check_sljit_emit_op1(struct s
|
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) |
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) |
if (SLJIT_UNLIKELY(!!compiler->verbose)) { |
if (SLJIT_UNLIKELY(!!compiler->verbose)) { |
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)], |
!(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", |
| !(op & SLJIT_SET_O) ? "" : ".o", !(op & SLJIT_SET_C) ? "" : ".c", !(op & SLJIT_KEEP_FLAGS) ? "" : ".k"); |
sljit_verbose_param(dst, dstw); |
sljit_verbose_param(dst, dstw); |
fprintf(compiler->verbose, ", "); |
fprintf(compiler->verbose, ", "); |
sljit_verbose_param(src, srcw); |
sljit_verbose_param(src, srcw); |
Line 883 static SLJIT_INLINE void check_sljit_emit_op1(struct s
|
Line 943 static SLJIT_INLINE void check_sljit_emit_op1(struct s
|
#endif |
#endif |
} |
} |
|
|
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, |
int dst, sljit_w dstw, | sljit_si dst, sljit_sw dstw, |
int src1, sljit_w src1w, | sljit_si src1, sljit_sw src1w, |
int src2, sljit_w src2w) | sljit_si src2, sljit_sw src2w) |
{ |
{ |
/* If debug and verbose are disabled, all arguments are unused. */ |
/* If debug and verbose are disabled, all arguments are unused. */ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
Line 915 static SLJIT_INLINE void check_sljit_emit_op2(struct s
|
Line 975 static SLJIT_INLINE void check_sljit_emit_op2(struct s
|
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) |
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) |
if (SLJIT_UNLIKELY(!!compiler->verbose)) { |
if (SLJIT_UNLIKELY(!!compiler->verbose)) { |
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)], |
!(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", |
| !(op & SLJIT_SET_O) ? "" : ".o", !(op & SLJIT_SET_C) ? "" : ".c", !(op & SLJIT_KEEP_FLAGS) ? "" : ".k"); |
sljit_verbose_param(dst, dstw); |
sljit_verbose_param(dst, dstw); |
fprintf(compiler->verbose, ", "); |
fprintf(compiler->verbose, ", "); |
sljit_verbose_param(src1, src1w); |
sljit_verbose_param(src1, src1w); |
Line 926 static SLJIT_INLINE void check_sljit_emit_op2(struct s
|
Line 987 static SLJIT_INLINE void check_sljit_emit_op2(struct s
|
#endif |
#endif |
} |
} |
|
|
static SLJIT_INLINE void check_sljit_get_register_index(int reg) | static SLJIT_INLINE void check_sljit_get_register_index(sljit_si reg) |
{ |
{ |
SLJIT_UNUSED_ARG(reg); |
SLJIT_UNUSED_ARG(reg); |
SLJIT_ASSERT(reg > 0 && reg <= SLJIT_NO_REGISTERS); |
SLJIT_ASSERT(reg > 0 && reg <= SLJIT_NO_REGISTERS); |
} |
} |
|
|
|
static SLJIT_INLINE void check_sljit_get_float_register_index(sljit_si reg) |
|
{ |
|
SLJIT_UNUSED_ARG(reg); |
|
SLJIT_ASSERT(reg > 0 && reg <= SLJIT_NO_FLOAT_REGISTERS); |
|
} |
|
|
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, |
void *instruction, int size) | void *instruction, sljit_si size) |
{ |
{ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(instruction); |
SLJIT_UNUSED_ARG(instruction); |
Line 941 static SLJIT_INLINE void check_sljit_emit_op_custom(st
|
Line 1008 static SLJIT_INLINE void check_sljit_emit_op_custom(st
|
SLJIT_ASSERT(instruction); |
SLJIT_ASSERT(instruction); |
} |
} |
|
|
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, |
int dst, sljit_w dstw, | sljit_si dst, sljit_sw dstw, |
int src, sljit_w srcw) | sljit_si src, sljit_sw srcw) |
{ |
{ |
/* If debug and verbose are disabled, all arguments are unused. */ |
/* If debug and verbose are disabled, all arguments are unused. */ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
Line 961 static SLJIT_INLINE void check_sljit_emit_fop1(struct
|
Line 1028 static SLJIT_INLINE void check_sljit_emit_fop1(struct
|
#endif |
#endif |
|
|
SLJIT_ASSERT(sljit_is_fpu_available()); |
SLJIT_ASSERT(sljit_is_fpu_available()); |
SLJIT_ASSERT(GET_OPCODE(op) >= SLJIT_FCMP && GET_OPCODE(op) <= SLJIT_FABS); | SLJIT_ASSERT(GET_OPCODE(op) >= SLJIT_CMPD && GET_OPCODE(op) <= SLJIT_ABSD); |
#if (defined SLJIT_DEBUG && SLJIT_DEBUG) |
#if (defined SLJIT_DEBUG && SLJIT_DEBUG) |
FUNCTION_CHECK_OP(); |
FUNCTION_CHECK_OP(); |
FUNCTION_FCHECK(src, srcw); |
FUNCTION_FCHECK(src, srcw); |
Line 969 static SLJIT_INLINE void check_sljit_emit_fop1(struct
|
Line 1036 static SLJIT_INLINE void check_sljit_emit_fop1(struct
|
#endif |
#endif |
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) |
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) |
if (SLJIT_UNLIKELY(!!compiler->verbose)) { |
if (SLJIT_UNLIKELY(!!compiler->verbose)) { |
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", |
!(op & SLJIT_SET_E) ? "" : "E", !(op & SLJIT_SET_S) ? "" : "S"); | !(op & SLJIT_SET_E) ? "" : ".e", !(op & SLJIT_SET_S) ? "" : ".s"); |
sljit_verbose_fparam(dst, dstw); |
sljit_verbose_fparam(dst, dstw); |
fprintf(compiler->verbose, ", "); |
fprintf(compiler->verbose, ", "); |
sljit_verbose_fparam(src, srcw); |
sljit_verbose_fparam(src, srcw); |
Line 979 static SLJIT_INLINE void check_sljit_emit_fop1(struct
|
Line 1046 static SLJIT_INLINE void check_sljit_emit_fop1(struct
|
#endif |
#endif |
} |
} |
|
|
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, |
int dst, sljit_w dstw, | sljit_si dst, sljit_sw dstw, |
int src1, sljit_w src1w, | sljit_si src1, sljit_sw src1w, |
int src2, sljit_w src2w) | sljit_si src2, sljit_sw src2w) |
{ |
{ |
/* If debug and verbose are disabled, all arguments are unused. */ |
/* If debug and verbose are disabled, all arguments are unused. */ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
Line 995 static SLJIT_INLINE void check_sljit_emit_fop2(struct
|
Line 1062 static SLJIT_INLINE void check_sljit_emit_fop2(struct
|
SLJIT_UNUSED_ARG(src2w); |
SLJIT_UNUSED_ARG(src2w); |
|
|
SLJIT_ASSERT(sljit_is_fpu_available()); |
SLJIT_ASSERT(sljit_is_fpu_available()); |
SLJIT_ASSERT(GET_OPCODE(op) >= SLJIT_FADD && GET_OPCODE(op) <= SLJIT_FDIV); | SLJIT_ASSERT(GET_OPCODE(op) >= SLJIT_ADDD && GET_OPCODE(op) <= SLJIT_DIVD); |
#if (defined SLJIT_DEBUG && SLJIT_DEBUG) |
#if (defined SLJIT_DEBUG && SLJIT_DEBUG) |
FUNCTION_CHECK_OP(); |
FUNCTION_CHECK_OP(); |
FUNCTION_FCHECK(src1, src1w); |
FUNCTION_FCHECK(src1, src1w); |
Line 1004 static SLJIT_INLINE void check_sljit_emit_fop2(struct
|
Line 1071 static SLJIT_INLINE void check_sljit_emit_fop2(struct
|
#endif |
#endif |
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) |
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) |
if (SLJIT_UNLIKELY(!!compiler->verbose)) { |
if (SLJIT_UNLIKELY(!!compiler->verbose)) { |
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"); |
sljit_verbose_fparam(dst, dstw); |
sljit_verbose_fparam(dst, dstw); |
fprintf(compiler->verbose, ", "); |
fprintf(compiler->verbose, ", "); |
sljit_verbose_fparam(src1, src1w); |
sljit_verbose_fparam(src1, src1w); |
Line 1026 static SLJIT_INLINE void check_sljit_emit_label(struct
|
Line 1093 static SLJIT_INLINE void check_sljit_emit_label(struct
|
#endif |
#endif |
} |
} |
|
|
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) |
{ |
{ |
/* If debug and verbose are disabled, all arguments are unused. */ |
/* If debug and verbose are disabled, all arguments are unused. */ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
Line 1043 static SLJIT_INLINE void check_sljit_emit_jump(struct
|
Line 1110 static SLJIT_INLINE void check_sljit_emit_jump(struct
|
SLJIT_ASSERT((type & 0xff) >= SLJIT_C_EQUAL && (type & 0xff) <= SLJIT_CALL3); |
SLJIT_ASSERT((type & 0xff) >= SLJIT_C_EQUAL && (type & 0xff) <= SLJIT_CALL3); |
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) |
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) |
if (SLJIT_UNLIKELY(!!compiler->verbose)) |
if (SLJIT_UNLIKELY(!!compiler->verbose)) |
fprintf(compiler->verbose, " jump%s <%s>\n", !(type & SLJIT_REWRITABLE_JUMP) ? "" : "R", jump_names[type & 0xff]); | fprintf(compiler->verbose, " jump%s.%s\n", !(type & SLJIT_REWRITABLE_JUMP) ? "" : ".r", jump_names[type & 0xff]); |
#endif |
#endif |
} |
} |
|
|
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, |
int src1, sljit_w src1w, | sljit_si src1, sljit_sw src1w, |
int src2, sljit_w src2w) | sljit_si src2, sljit_sw src2w) |
{ |
{ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(type); |
SLJIT_UNUSED_ARG(type); |
Line 1058 static SLJIT_INLINE void check_sljit_emit_cmp(struct s
|
Line 1125 static SLJIT_INLINE void check_sljit_emit_cmp(struct s
|
SLJIT_UNUSED_ARG(src2); |
SLJIT_UNUSED_ARG(src2); |
SLJIT_UNUSED_ARG(src2w); |
SLJIT_UNUSED_ARG(src2w); |
|
|
SLJIT_ASSERT(!(type & ~(0xff | SLJIT_INT_OP | SLJIT_REWRITABLE_JUMP))); | SLJIT_ASSERT(!(type & ~(0xff | SLJIT_REWRITABLE_JUMP | SLJIT_INT_OP))); |
SLJIT_ASSERT((type & 0xff) >= SLJIT_C_EQUAL && (type & 0xff) <= SLJIT_C_SIG_LESS_EQUAL); |
SLJIT_ASSERT((type & 0xff) >= SLJIT_C_EQUAL && (type & 0xff) <= SLJIT_C_SIG_LESS_EQUAL); |
#if (defined SLJIT_DEBUG && SLJIT_DEBUG) |
#if (defined SLJIT_DEBUG && SLJIT_DEBUG) |
FUNCTION_CHECK_SRC(src1, src1w); |
FUNCTION_CHECK_SRC(src1, src1w); |
Line 1066 static SLJIT_INLINE void check_sljit_emit_cmp(struct s
|
Line 1133 static SLJIT_INLINE void check_sljit_emit_cmp(struct s
|
#endif |
#endif |
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) |
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) |
if (SLJIT_UNLIKELY(!!compiler->verbose)) { |
if (SLJIT_UNLIKELY(!!compiler->verbose)) { |
fprintf(compiler->verbose, " %scmp%s <%s> ", !(type & SLJIT_INT_OP) ? "" : "i", !(type & SLJIT_REWRITABLE_JUMP) ? "" : "R", jump_names[type & 0xff]); | fprintf(compiler->verbose, " %scmp%s.%s ", !(type & SLJIT_INT_OP) ? "" : "i", !(type & SLJIT_REWRITABLE_JUMP) ? "" : ".r", jump_names[type & 0xff]); |
sljit_verbose_param(src1, src1w); |
sljit_verbose_param(src1, src1w); |
fprintf(compiler->verbose, ", "); |
fprintf(compiler->verbose, ", "); |
sljit_verbose_param(src2, src2w); |
sljit_verbose_param(src2, src2w); |
Line 1075 static SLJIT_INLINE void check_sljit_emit_cmp(struct s
|
Line 1142 static SLJIT_INLINE void check_sljit_emit_cmp(struct s
|
#endif |
#endif |
} |
} |
|
|
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, |
int src1, sljit_w src1w, | sljit_si src1, sljit_sw src1w, |
int src2, sljit_w src2w) | sljit_si src2, sljit_sw src2w) |
{ |
{ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(type); |
SLJIT_UNUSED_ARG(type); |
Line 1087 static SLJIT_INLINE void check_sljit_emit_fcmp(struct
|
Line 1154 static SLJIT_INLINE void check_sljit_emit_fcmp(struct
|
SLJIT_UNUSED_ARG(src2w); |
SLJIT_UNUSED_ARG(src2w); |
|
|
SLJIT_ASSERT(sljit_is_fpu_available()); |
SLJIT_ASSERT(sljit_is_fpu_available()); |
SLJIT_ASSERT(!(type & ~(0xff | SLJIT_REWRITABLE_JUMP))); | SLJIT_ASSERT(!(type & ~(0xff | SLJIT_REWRITABLE_JUMP | SLJIT_SINGLE_OP))); |
SLJIT_ASSERT((type & 0xff) >= SLJIT_C_FLOAT_EQUAL && (type & 0xff) <= SLJIT_C_FLOAT_NOT_NAN); | SLJIT_ASSERT((type & 0xff) >= SLJIT_C_FLOAT_EQUAL && (type & 0xff) <= SLJIT_C_FLOAT_ORDERED); |
#if (defined SLJIT_DEBUG && SLJIT_DEBUG) |
#if (defined SLJIT_DEBUG && SLJIT_DEBUG) |
FUNCTION_FCHECK(src1, src1w); |
FUNCTION_FCHECK(src1, src1w); |
FUNCTION_FCHECK(src2, src2w); |
FUNCTION_FCHECK(src2, src2w); |
#endif |
#endif |
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) |
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) |
if (SLJIT_UNLIKELY(!!compiler->verbose)) { |
if (SLJIT_UNLIKELY(!!compiler->verbose)) { |
fprintf(compiler->verbose, " fcmp%s <%s> ", !(type & SLJIT_REWRITABLE_JUMP) ? "" : "R", jump_names[type & 0xff]); | fprintf(compiler->verbose, " %scmp%s.%s ", (type & SLJIT_SINGLE_OP) ? "s" : "d", |
| !(type & SLJIT_REWRITABLE_JUMP) ? "" : ".r", jump_names[type & 0xff]); |
sljit_verbose_fparam(src1, src1w); |
sljit_verbose_fparam(src1, src1w); |
fprintf(compiler->verbose, ", "); |
fprintf(compiler->verbose, ", "); |
sljit_verbose_fparam(src2, src2w); |
sljit_verbose_fparam(src2, src2w); |
Line 1104 static SLJIT_INLINE void check_sljit_emit_fcmp(struct
|
Line 1172 static SLJIT_INLINE void check_sljit_emit_fcmp(struct
|
#endif |
#endif |
} |
} |
|
|
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) |
{ |
{ |
/* If debug and verbose are disabled, all arguments are unused. */ |
/* If debug and verbose are disabled, all arguments are unused. */ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
Line 1112 static SLJIT_INLINE void check_sljit_emit_ijump(struct
|
Line 1180 static SLJIT_INLINE void check_sljit_emit_ijump(struct
|
SLJIT_UNUSED_ARG(src); |
SLJIT_UNUSED_ARG(src); |
SLJIT_UNUSED_ARG(srcw); |
SLJIT_UNUSED_ARG(srcw); |
|
|
|
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) || (defined SLJIT_DEBUG && SLJIT_DEBUG) |
|
if (SLJIT_UNLIKELY(compiler->skip_checks)) { |
|
compiler->skip_checks = 0; |
|
return; |
|
} |
|
#endif |
|
|
SLJIT_ASSERT(type >= SLJIT_JUMP && type <= SLJIT_CALL3); |
SLJIT_ASSERT(type >= SLJIT_JUMP && type <= SLJIT_CALL3); |
#if (defined SLJIT_DEBUG && SLJIT_DEBUG) |
#if (defined SLJIT_DEBUG && SLJIT_DEBUG) |
FUNCTION_CHECK_SRC(src, srcw); |
FUNCTION_CHECK_SRC(src, srcw); |
#endif |
#endif |
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) |
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) |
if (SLJIT_UNLIKELY(!!compiler->verbose)) { |
if (SLJIT_UNLIKELY(!!compiler->verbose)) { |
fprintf(compiler->verbose, " ijump <%s> ", jump_names[type]); | fprintf(compiler->verbose, " ijump.%s ", jump_names[type]); |
sljit_verbose_param(src, srcw); |
sljit_verbose_param(src, srcw); |
fprintf(compiler->verbose, "\n"); |
fprintf(compiler->verbose, "\n"); |
} |
} |
#endif |
#endif |
} |
} |
|
|
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_op_flags(struct sljit_compiler *compiler, sljit_si op, |
| sljit_si dst, sljit_sw dstw, |
| sljit_si src, sljit_sw srcw, |
| sljit_si type) |
{ |
{ |
/* If debug and verbose are disabled, all arguments are unused. */ |
/* If debug and verbose are disabled, all arguments are unused. */ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(op); |
SLJIT_UNUSED_ARG(op); |
SLJIT_UNUSED_ARG(dst); |
SLJIT_UNUSED_ARG(dst); |
SLJIT_UNUSED_ARG(dstw); |
SLJIT_UNUSED_ARG(dstw); |
|
SLJIT_UNUSED_ARG(src); |
|
SLJIT_UNUSED_ARG(srcw); |
SLJIT_UNUSED_ARG(type); |
SLJIT_UNUSED_ARG(type); |
|
|
SLJIT_ASSERT(type >= SLJIT_C_EQUAL && type < SLJIT_JUMP); |
SLJIT_ASSERT(type >= SLJIT_C_EQUAL && type < SLJIT_JUMP); |
SLJIT_ASSERT(op == SLJIT_MOV || GET_OPCODE(op) == SLJIT_OR); | SLJIT_ASSERT(op == SLJIT_MOV || GET_OPCODE(op) == SLJIT_MOV_UI || GET_OPCODE(op) == SLJIT_MOV_SI |
SLJIT_ASSERT(GET_ALL_FLAGS(op) == 0 || GET_ALL_FLAGS(op) == SLJIT_SET_E || GET_ALL_FLAGS(op) == SLJIT_KEEP_FLAGS); | || (GET_OPCODE(op) >= SLJIT_AND && GET_OPCODE(op) <= SLJIT_XOR)); |
| SLJIT_ASSERT((op & (SLJIT_SET_S | SLJIT_SET_U | SLJIT_SET_O | SLJIT_SET_C)) == 0); |
| SLJIT_ASSERT((op & (SLJIT_SET_E | SLJIT_KEEP_FLAGS)) != (SLJIT_SET_E | SLJIT_KEEP_FLAGS)); |
#if (defined SLJIT_DEBUG && SLJIT_DEBUG) |
#if (defined SLJIT_DEBUG && SLJIT_DEBUG) |
|
if (GET_OPCODE(op) < SLJIT_ADD) { |
|
SLJIT_ASSERT(src == SLJIT_UNUSED && srcw == 0); |
|
} else { |
|
SLJIT_ASSERT(src == dst && srcw == dstw); |
|
} |
FUNCTION_CHECK_DST(dst, dstw); |
FUNCTION_CHECK_DST(dst, dstw); |
#endif |
#endif |
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) |
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) |
if (SLJIT_UNLIKELY(!!compiler->verbose)) { |
if (SLJIT_UNLIKELY(!!compiler->verbose)) { |
fprintf(compiler->verbose, " cond_set%s%s <%s> ", !(op & SLJIT_SET_E) ? "" : "E", | fprintf(compiler->verbose, " %sflags.%s%s%s ", !(op & SLJIT_INT_OP) ? "" : "i", |
!(op & SLJIT_KEEP_FLAGS) ? "" : "K", op_names[GET_OPCODE(op)]); | op_names[GET_OPCODE(op)], !(op & SLJIT_SET_E) ? "" : ".e", !(op & SLJIT_KEEP_FLAGS) ? "" : ".k"); |
sljit_verbose_param(dst, dstw); |
sljit_verbose_param(dst, dstw); |
fprintf(compiler->verbose, ", <%s>\n", jump_names[type]); | if (src != SLJIT_UNUSED) { |
| fprintf(compiler->verbose, ", "); |
| sljit_verbose_param(src, srcw); |
| } |
| fprintf(compiler->verbose, ", %s\n", jump_names[type]); |
} |
} |
#endif |
#endif |
} |
} |
|
|
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) |
{ |
{ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(dst); |
SLJIT_UNUSED_ARG(dst); |
Line 1169 static SLJIT_INLINE void check_sljit_get_local_base(st
|
Line 1260 static SLJIT_INLINE void check_sljit_get_local_base(st
|
#endif |
#endif |
} |
} |
|
|
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) |
{ |
{ |
/* If debug and verbose are disabled, all arguments are unused. */ |
/* If debug and verbose are disabled, all arguments are unused. */ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
Line 1189 static SLJIT_INLINE void check_sljit_emit_const(struct
|
Line 1280 static SLJIT_INLINE void check_sljit_emit_const(struct
|
#endif |
#endif |
} |
} |
|
|
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) |
{ |
{ |
/* Return if don't need to do anything. */ |
/* Return if don't need to do anything. */ |
if (op == SLJIT_UNUSED) |
if (op == SLJIT_UNUSED) |
return SLJIT_SUCCESS; |
return SLJIT_SUCCESS; |
|
|
#if (defined SLJIT_64BIT_ARCHITECTURE && SLJIT_64BIT_ARCHITECTURE) |
#if (defined SLJIT_64BIT_ARCHITECTURE && SLJIT_64BIT_ARCHITECTURE) |
if (src == SLJIT_RETURN_REG && op == SLJIT_MOV) | /* At the moment the pointer size is always equal to sljit_sw. May be changed in the future. */ |
| if (src == SLJIT_RETURN_REG && (op == SLJIT_MOV || op == SLJIT_MOV_P)) |
return SLJIT_SUCCESS; |
return SLJIT_SUCCESS; |
#else |
#else |
if (src == SLJIT_RETURN_REG && (op == SLJIT_MOV || op == SLJIT_MOV_UI || op == SLJIT_MOV_SI)) | if (src == SLJIT_RETURN_REG && (op == SLJIT_MOV || op == SLJIT_MOV_UI || op == SLJIT_MOV_SI || op == SLJIT_MOV_P)) |
return SLJIT_SUCCESS; |
return SLJIT_SUCCESS; |
#endif |
#endif |
|
|
Line 1236 static SLJIT_INLINE int emit_mov_before_return(struct
|
Line 1328 static SLJIT_INLINE int emit_mov_before_return(struct
|
#define SLJIT_CPUINFO SLJIT_CPUINFO_PART1 SLJIT_CPUINFO_PART2 SLJIT_CPUINFO_PART3 |
#define SLJIT_CPUINFO SLJIT_CPUINFO_PART1 SLJIT_CPUINFO_PART2 SLJIT_CPUINFO_PART3 |
|
|
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) |
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32) |
#include "sljitNativeX86_common.c" | # include "sljitNativeX86_common.c" |
#elif (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) |
#elif (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) |
#include "sljitNativeX86_common.c" | # include "sljitNativeX86_common.c" |
#elif (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5) |
#elif (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5) |
#include "sljitNativeARM_v5.c" | # include "sljitNativeARM_v5.c" |
#elif (defined SLJIT_CONFIG_ARM_V7 && SLJIT_CONFIG_ARM_V7) |
#elif (defined SLJIT_CONFIG_ARM_V7 && SLJIT_CONFIG_ARM_V7) |
#include "sljitNativeARM_v5.c" | # include "sljitNativeARM_v5.c" |
#elif (defined SLJIT_CONFIG_ARM_THUMB2 && SLJIT_CONFIG_ARM_THUMB2) |
#elif (defined SLJIT_CONFIG_ARM_THUMB2 && SLJIT_CONFIG_ARM_THUMB2) |
#include "sljitNativeARM_Thumb2.c" | # include "sljitNativeARM_Thumb2.c" |
#elif (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) |
#elif (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) |
#include "sljitNativePPC_common.c" | # include "sljitNativePPC_common.c" |
#elif (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) |
#elif (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) |
#include "sljitNativePPC_common.c" | # include "sljitNativePPC_common.c" |
#elif (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32) |
#elif (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32) |
#include "sljitNativeMIPS_common.c" | # include "sljitNativeMIPS_common.c" |
| #elif (defined SLJIT_CONFIG_SPARC_32 && SLJIT_CONFIG_SPARC_32) |
| # include "sljitNativeSPARC_common.c" |
#endif |
#endif |
|
|
#if !(defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32) |
#if !(defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32) |
|
|
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, |
int src1, sljit_w src1w, | sljit_si src1, sljit_sw src1w, |
int src2, sljit_w src2w) | sljit_si src2, sljit_sw src2w) |
{ |
{ |
/* Default compare for most architectures. */ |
/* Default compare for most architectures. */ |
int flags, tmp_src, condition; | sljit_si flags, tmp_src, condition; |
sljit_w tmp_srcw; | sljit_sw tmp_srcw; |
|
|
CHECK_ERROR_PTR(); |
CHECK_ERROR_PTR(); |
check_sljit_emit_cmp(compiler, type, src1, src1w, src2, src2w); |
check_sljit_emit_cmp(compiler, type, src1, src1w, src2, src2w); |
Line 1322 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit
|
Line 1416 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit
|
return sljit_emit_jump(compiler, condition | (type & SLJIT_REWRITABLE_JUMP)); |
return sljit_emit_jump(compiler, condition | (type & SLJIT_REWRITABLE_JUMP)); |
} |
} |
|
|
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, |
int src1, sljit_w src1w, | sljit_si src1, sljit_sw src1w, |
int src2, sljit_w src2w) | sljit_si src2, sljit_sw src2w) |
{ |
{ |
int flags, condition; | sljit_si flags, condition; |
|
|
check_sljit_emit_fcmp(compiler, type, src1, src1w, src2, src2w); |
check_sljit_emit_fcmp(compiler, type, src1, src1w, src2, src2w); |
|
|
condition = type & 0xff; |
condition = type & 0xff; |
if (condition <= SLJIT_C_FLOAT_NOT_EQUAL) | flags = (condition <= SLJIT_C_FLOAT_NOT_EQUAL) ? SLJIT_SET_E : SLJIT_SET_S; |
flags = SLJIT_SET_E; | if (type & SLJIT_SINGLE_OP) |
else | flags |= SLJIT_SINGLE_OP; |
flags = SLJIT_SET_S; | |
|
|
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) || (defined SLJIT_DEBUG && SLJIT_DEBUG) |
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) || (defined SLJIT_DEBUG && SLJIT_DEBUG) |
compiler->skip_checks = 1; |
compiler->skip_checks = 1; |
#endif |
#endif |
sljit_emit_fop1(compiler, SLJIT_FCMP | flags, src1, src1w, src2, src2w); | sljit_emit_fop1(compiler, SLJIT_CMPD | flags, src1, src1w, src2, src2w); |
|
|
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) || (defined SLJIT_DEBUG && SLJIT_DEBUG) |
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) || (defined SLJIT_DEBUG && SLJIT_DEBUG) |
compiler->skip_checks = 1; |
compiler->skip_checks = 1; |
Line 1351 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit
|
Line 1444 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit
|
|
|
#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) |
|
|
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) |
{ |
{ |
CHECK_ERROR(); |
CHECK_ERROR(); |
check_sljit_get_local_base(compiler, dst, dstw, offset); |
check_sljit_get_local_base(compiler, dst, dstw, offset); |
Line 1371 SLJIT_API_FUNC_ATTRIBUTE int sljit_get_local_base(stru
|
Line 1464 SLJIT_API_FUNC_ATTRIBUTE int sljit_get_local_base(stru
|
|
|
/* Empty function bodies for those machines, which are not (yet) supported. */ |
/* Empty function bodies for those machines, which are not (yet) supported. */ |
|
|
SLJIT_API_FUNC_ATTRIBUTE SLJIT_CONST char* sljit_get_platform_name() | SLJIT_API_FUNC_ATTRIBUTE SLJIT_CONST char* sljit_get_platform_name(void) |
{ |
{ |
return "unsupported"; |
return "unsupported"; |
} |
} |
Line 1388 SLJIT_API_FUNC_ATTRIBUTE void sljit_free_compiler(stru
|
Line 1481 SLJIT_API_FUNC_ATTRIBUTE void sljit_free_compiler(stru
|
SLJIT_ASSERT_STOP(); |
SLJIT_ASSERT_STOP(); |
} |
} |
|
|
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) |
{ |
{ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(size); |
SLJIT_UNUSED_ARG(size); |
Line 1418 SLJIT_API_FUNC_ATTRIBUTE void sljit_free_code(void* co
|
Line 1511 SLJIT_API_FUNC_ATTRIBUTE void sljit_free_code(void* co
|
SLJIT_ASSERT_STOP(); |
SLJIT_ASSERT_STOP(); |
} |
} |
|
|
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 scratches, sljit_si saveds, sljit_si local_size) |
{ |
{ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(args); |
SLJIT_UNUSED_ARG(args); |
SLJIT_UNUSED_ARG(temporaries); | SLJIT_UNUSED_ARG(scratches); |
SLJIT_UNUSED_ARG(saveds); |
SLJIT_UNUSED_ARG(saveds); |
SLJIT_UNUSED_ARG(local_size); |
SLJIT_UNUSED_ARG(local_size); |
SLJIT_ASSERT_STOP(); |
SLJIT_ASSERT_STOP(); |
return SLJIT_ERR_UNSUPPORTED; |
return SLJIT_ERR_UNSUPPORTED; |
} |
} |
|
|
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 scratches, sljit_si saveds, sljit_si local_size) |
{ |
{ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(args); |
SLJIT_UNUSED_ARG(args); |
SLJIT_UNUSED_ARG(temporaries); | SLJIT_UNUSED_ARG(scratches); |
SLJIT_UNUSED_ARG(saveds); |
SLJIT_UNUSED_ARG(saveds); |
SLJIT_UNUSED_ARG(local_size); |
SLJIT_UNUSED_ARG(local_size); |
SLJIT_ASSERT_STOP(); |
SLJIT_ASSERT_STOP(); |
} |
} |
|
|
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) |
{ |
{ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(op); |
SLJIT_UNUSED_ARG(op); |
Line 1449 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_return(struct
|
Line 1542 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_return(struct
|
return SLJIT_ERR_UNSUPPORTED; |
return SLJIT_ERR_UNSUPPORTED; |
} |
} |
|
|
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_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(dst); |
SLJIT_UNUSED_ARG(dst); |
SLJIT_UNUSED_ARG(dstw); |
SLJIT_UNUSED_ARG(dstw); |
SLJIT_UNUSED_ARG(args); |
|
SLJIT_UNUSED_ARG(temporaries); |
|
SLJIT_UNUSED_ARG(saveds); |
|
SLJIT_UNUSED_ARG(local_size); |
|
SLJIT_ASSERT_STOP(); |
SLJIT_ASSERT_STOP(); |
return SLJIT_ERR_UNSUPPORTED; |
return SLJIT_ERR_UNSUPPORTED; |
} |
} |
|
|
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) |
{ |
{ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(src); |
SLJIT_UNUSED_ARG(src); |
Line 1471 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fast_return(st
|
Line 1560 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fast_return(st
|
return SLJIT_ERR_UNSUPPORTED; |
return SLJIT_ERR_UNSUPPORTED; |
} |
} |
|
|
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) |
{ |
{ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(op); |
SLJIT_UNUSED_ARG(op); |
Line 1479 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op0(struct slj
|
Line 1568 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op0(struct slj
|
return SLJIT_ERR_UNSUPPORTED; |
return SLJIT_ERR_UNSUPPORTED; |
} |
} |
|
|
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, |
int dst, sljit_w dstw, | sljit_si dst, sljit_sw dstw, |
int src, sljit_w srcw) | sljit_si src, sljit_sw srcw) |
{ |
{ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(op); |
SLJIT_UNUSED_ARG(op); |
Line 1493 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op1(struct slj
|
Line 1582 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op1(struct slj
|
return SLJIT_ERR_UNSUPPORTED; |
return SLJIT_ERR_UNSUPPORTED; |
} |
} |
|
|
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, |
int dst, sljit_w dstw, | sljit_si dst, sljit_sw dstw, |
int src1, sljit_w src1w, | sljit_si src1, sljit_sw src1w, |
int src2, sljit_w src2w) | sljit_si src2, sljit_sw src2w) |
{ |
{ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(op); |
SLJIT_UNUSED_ARG(op); |
Line 1510 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op2(struct slj
|
Line 1599 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op2(struct slj
|
return SLJIT_ERR_UNSUPPORTED; |
return SLJIT_ERR_UNSUPPORTED; |
} |
} |
|
|
SLJIT_API_FUNC_ATTRIBUTE int sljit_get_register_index(int reg) | SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_register_index(sljit_si reg) |
{ |
{ |
SLJIT_ASSERT_STOP(); |
SLJIT_ASSERT_STOP(); |
return reg; |
return reg; |
} |
} |
|
|
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, |
void *instruction, int size) | void *instruction, sljit_si size) |
{ |
{ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(instruction); |
SLJIT_UNUSED_ARG(instruction); |
Line 1526 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op_custom(stru
|
Line 1615 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op_custom(stru
|
return SLJIT_ERR_UNSUPPORTED; |
return SLJIT_ERR_UNSUPPORTED; |
} |
} |
|
|
SLJIT_API_FUNC_ATTRIBUTE int sljit_is_fpu_available(void) | SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_is_fpu_available(void) |
{ |
{ |
SLJIT_ASSERT_STOP(); |
SLJIT_ASSERT_STOP(); |
return 0; |
return 0; |
} |
} |
|
|
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, |
int dst, sljit_w dstw, | sljit_si dst, sljit_sw dstw, |
int src, sljit_w srcw) | sljit_si src, sljit_sw srcw) |
{ |
{ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(op); |
SLJIT_UNUSED_ARG(op); |
Line 1546 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fop1(struct sl
|
Line 1635 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fop1(struct sl
|
return SLJIT_ERR_UNSUPPORTED; |
return SLJIT_ERR_UNSUPPORTED; |
} |
} |
|
|
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, |
int dst, sljit_w dstw, | sljit_si dst, sljit_sw dstw, |
int src1, sljit_w src1w, | sljit_si src1, sljit_sw src1w, |
int src2, sljit_w src2w) | sljit_si src2, sljit_sw src2w) |
{ |
{ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(op); |
SLJIT_UNUSED_ARG(op); |
Line 1570 SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emi
|
Line 1659 SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emi
|
return NULL; |
return NULL; |
} |
} |
|
|
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) |
{ |
{ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(type); |
SLJIT_UNUSED_ARG(type); |
Line 1578 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit
|
Line 1667 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit
|
return NULL; |
return NULL; |
} |
} |
|
|
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, |
int src1, sljit_w src1w, | sljit_si src1, sljit_sw src1w, |
int src2, sljit_w src2w) | sljit_si src2, sljit_sw src2w) |
{ |
{ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(type); |
SLJIT_UNUSED_ARG(type); |
Line 1592 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit
|
Line 1681 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit
|
return NULL; |
return NULL; |
} |
} |
|
|
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, |
int src1, sljit_w src1w, | sljit_si src1, sljit_sw src1w, |
int src2, sljit_w src2w) | sljit_si src2, sljit_sw src2w) |
{ |
{ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(type); |
SLJIT_UNUSED_ARG(type); |
Line 1620 SLJIT_API_FUNC_ATTRIBUTE void sljit_set_target(struct
|
Line 1709 SLJIT_API_FUNC_ATTRIBUTE void sljit_set_target(struct
|
SLJIT_ASSERT_STOP(); |
SLJIT_ASSERT_STOP(); |
} |
} |
|
|
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) |
{ |
{ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(type); |
SLJIT_UNUSED_ARG(type); |
Line 1630 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_ijump(struct s
|
Line 1719 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_ijump(struct s
|
return SLJIT_ERR_UNSUPPORTED; |
return SLJIT_ERR_UNSUPPORTED; |
} |
} |
|
|
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_op_flags(struct sljit_compiler *compiler, sljit_si op, |
| sljit_si dst, sljit_sw dstw, |
| sljit_si src, sljit_sw srcw, |
| sljit_si type) |
{ |
{ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(op); |
SLJIT_UNUSED_ARG(op); |
SLJIT_UNUSED_ARG(dst); |
SLJIT_UNUSED_ARG(dst); |
SLJIT_UNUSED_ARG(dstw); |
SLJIT_UNUSED_ARG(dstw); |
|
SLJIT_UNUSED_ARG(src); |
|
SLJIT_UNUSED_ARG(srcw); |
SLJIT_UNUSED_ARG(type); |
SLJIT_UNUSED_ARG(type); |
SLJIT_ASSERT_STOP(); |
SLJIT_ASSERT_STOP(); |
return SLJIT_ERR_UNSUPPORTED; |
return SLJIT_ERR_UNSUPPORTED; |
} |
} |
|
|
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) |
{ |
{ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(dst); |
SLJIT_UNUSED_ARG(dst); |
Line 1651 SLJIT_API_FUNC_ATTRIBUTE int sljit_get_local_base(stru
|
Line 1745 SLJIT_API_FUNC_ATTRIBUTE int sljit_get_local_base(stru
|
return SLJIT_ERR_UNSUPPORTED; |
return SLJIT_ERR_UNSUPPORTED; |
} |
} |
|
|
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) |
{ |
{ |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(compiler); |
SLJIT_UNUSED_ARG(dst); |
SLJIT_UNUSED_ARG(dst); |
Line 1668 SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(slji
|
Line 1762 SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(slji
|
SLJIT_ASSERT_STOP(); |
SLJIT_ASSERT_STOP(); |
} |
} |
|
|
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) |
{ |
{ |
SLJIT_UNUSED_ARG(addr); |
SLJIT_UNUSED_ARG(addr); |
SLJIT_UNUSED_ARG(new_constant); |
SLJIT_UNUSED_ARG(new_constant); |