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

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

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

revision 721 by zherczeg, Sat Sep 3 18:23:04 2011 UTC revision 722 by zherczeg, Fri Oct 7 19:18:55 2011 UTC
# Line 400  static SLJIT_INLINE int detect_jump_type Line 400  static SLJIT_INLINE int detect_jump_type
400                  diff = ((sljit_w)(code + jump->u.label->size) - (sljit_w)(code_ptr + 2));                  diff = ((sljit_w)(code + jump->u.label->size) - (sljit_w)(code_ptr + 2));
401          }          }
402    
403          /* Branch to Thumb code has not optimized yet. */          /* Branch to Thumb code has not been optimized yet. */
404          if (diff & 0x3)          if (diff & 0x3)
405                  return 0;                  return 0;
406    
# Line 426  static SLJIT_INLINE int detect_jump_type Line 426  static SLJIT_INLINE int detect_jump_type
426                  diff = ((sljit_w)(code + jump->u.label->size) - (sljit_w)code_ptr);                  diff = ((sljit_w)(code + jump->u.label->size) - (sljit_w)code_ptr);
427          }          }
428    
429          /* Branch to Thumb code has not optimized yet. */          /* Branch to Thumb code has not been optimized yet. */
430          if (diff & 0x3)          if (diff & 0x3)
431                  return 0;                  return 0;
432    
# Line 2220  struct sljit_jump* sljit_emit_jump(struc Line 2220  struct sljit_jump* sljit_emit_jump(struc
2220    
2221          /* In ARM, we don't need to touch the arguments. */          /* In ARM, we don't need to touch the arguments. */
2222  #if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)  #if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)
2223          if (type >= SLJIT_CALL0)          if (type >= SLJIT_FAST_CALL)
2224                  PTR_FAIL_IF(prepare_blx(compiler));                  PTR_FAIL_IF(prepare_blx(compiler));
2225          PTR_FAIL_IF(push_inst_with_unique_literal(compiler, ((EMIT_DATA_TRANSFER(WORD_DATA | LOAD_DATA, 1, 0,          PTR_FAIL_IF(push_inst_with_unique_literal(compiler, ((EMIT_DATA_TRANSFER(WORD_DATA | LOAD_DATA, 1, 0,
2226                  type <= SLJIT_JUMP ? TMP_PC : TMP_REG1, TMP_PC, 0)) & ~COND_MASK) | get_cc(type), 0));                  type <= SLJIT_JUMP ? TMP_PC : TMP_REG1, TMP_PC, 0)) & ~COND_MASK) | get_cc(type), 0));
# Line 2230  struct sljit_jump* sljit_emit_jump(struc Line 2230  struct sljit_jump* sljit_emit_jump(struc
2230                  compiler->patches++;                  compiler->patches++;
2231          }          }
2232    
2233          if (type >= SLJIT_CALL0) {          if (type >= SLJIT_FAST_CALL) {
2234                  jump->flags |= IS_BL;                  jump->flags |= IS_BL;
2235                  PTR_FAIL_IF(emit_blx(compiler));                  PTR_FAIL_IF(emit_blx(compiler));
2236          }          }
# Line 2238  struct sljit_jump* sljit_emit_jump(struc Line 2238  struct sljit_jump* sljit_emit_jump(struc
2238          if (!(jump->flags & SLJIT_REWRITABLE_JUMP))          if (!(jump->flags & SLJIT_REWRITABLE_JUMP))
2239                  jump->addr = compiler->size;                  jump->addr = compiler->size;
2240  #else  #else
2241          if (type >= SLJIT_CALL0)          if (type >= SLJIT_FAST_CALL)
2242                  jump->flags |= IS_BL;                  jump->flags |= IS_BL;
2243          PTR_FAIL_IF(emit_imm(compiler, TMP_REG1, 0));          PTR_FAIL_IF(emit_imm(compiler, TMP_REG1, 0));
2244          PTR_FAIL_IF(push_inst(compiler, (((type < SLJIT_CALL0 ? BX : BLX) | RM(TMP_REG1)) & ~COND_MASK) | get_cc(type)));          PTR_FAIL_IF(push_inst(compiler, (((type <= SLJIT_JUMP ? BX : BLX) | RM(TMP_REG1)) & ~COND_MASK) | get_cc(type)));
2245          jump->addr = compiler->size;          jump->addr = compiler->size;
2246  #endif  #endif
2247          return jump;          return jump;
# Line 2258  int sljit_emit_ijump(struct sljit_compil Line 2258  int sljit_emit_ijump(struct sljit_compil
2258          if (src & SLJIT_IMM) {          if (src & SLJIT_IMM) {
2259                  jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump));                  jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump));
2260                  FAIL_IF(!jump);                  FAIL_IF(!jump);
2261                  set_jump(jump, compiler, JUMP_ADDR | ((type >= SLJIT_CALL0) ? IS_BL : 0));                  set_jump(jump, compiler, JUMP_ADDR | ((type >= SLJIT_FAST_CALL) ? IS_BL : 0));
2262                  jump->u.target = srcw;                  jump->u.target = srcw;
2263    
2264  #if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)  #if (defined SLJIT_CONFIG_ARM_V5 && SLJIT_CONFIG_ARM_V5)
2265                  if (type >= SLJIT_CALL0)                  if (type >= SLJIT_FAST_CALL)
2266                          FAIL_IF(prepare_blx(compiler));                          FAIL_IF(prepare_blx(compiler));
2267                  FAIL_IF(push_inst_with_unique_literal(compiler, EMIT_DATA_TRANSFER(WORD_DATA | LOAD_DATA, 1, 0, type <= SLJIT_JUMP ? TMP_PC : TMP_REG1, TMP_PC, 0), 0));                  FAIL_IF(push_inst_with_unique_literal(compiler, EMIT_DATA_TRANSFER(WORD_DATA | LOAD_DATA, 1, 0, type <= SLJIT_JUMP ? TMP_PC : TMP_REG1, TMP_PC, 0), 0));
2268                  if (type >= SLJIT_CALL0)                  if (type >= SLJIT_FAST_CALL)
2269                          FAIL_IF(emit_blx(compiler));                          FAIL_IF(emit_blx(compiler));
2270  #else  #else
2271                  FAIL_IF(emit_imm(compiler, TMP_REG1, 0));                  FAIL_IF(emit_imm(compiler, TMP_REG1, 0));
2272                  FAIL_IF(push_inst(compiler, (type < SLJIT_CALL0 ? BX : BLX) | RM(TMP_REG1)));                  FAIL_IF(push_inst(compiler, (type <= SLJIT_JUMP ? BX : BLX) | RM(TMP_REG1)));
2273  #endif  #endif
2274                  jump->addr = compiler->size;                  jump->addr = compiler->size;
2275          }          }

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

  ViewVC Help
Powered by ViewVC 1.1.5