/[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 839 by zherczeg, Fri Dec 30 13:22:28 2011 UTC revision 847 by zherczeg, Tue Jan 3 17:49:03 2012 UTC
# Line 54  SLJIT_API_FUNC_ATTRIBUTE SLJIT_CONST cha Line 54  SLJIT_API_FUNC_ATTRIBUTE SLJIT_CONST cha
54  #define MAX_DIFFERENCE(max_diff) \  #define MAX_DIFFERENCE(max_diff) \
55          (((max_diff) / (int)sizeof(sljit_uw)) - (CONST_POOL_ALIGNMENT - 1))          (((max_diff) / (int)sizeof(sljit_uw)) - (CONST_POOL_ALIGNMENT - 1))
56    
57  /* See sljit_emit_enter if you want to change them. */  /* See sljit_emit_enter and sljit_emit_op0 if you want to change them. */
58  static SLJIT_CONST sljit_ub reg_map[SLJIT_NO_REGISTERS + 5] = {  static SLJIT_CONST sljit_ub reg_map[SLJIT_NO_REGISTERS + 5] = {
59    0, 0, 1, 2, 10, 11, 4, 5, 6, 7, 8, 13, 3, 12, 14, 15    0, 0, 1, 2, 10, 11, 4, 5, 6, 7, 8, 13, 3, 12, 14, 15
60  };  };
# Line 84  static SLJIT_CONST sljit_ub reg_map[SLJI Line 84  static SLJIT_CONST sljit_ub reg_map[SLJI
84  #define BX              0xe12fff10  #define BX              0xe12fff10
85  #define CLZ             0xe16f0f10  #define CLZ             0xe16f0f10
86  #define CMP_DP          0xa  #define CMP_DP          0xa
87  #define DEBUGGER        0xe1200070  #define BKPT            0xe1200070
88  #define EOR_DP          0x1  #define EOR_DP          0x1
89  #define MOV_DP          0xd  #define MOV_DP          0xd
90  #define MUL             0xe0000090  #define MUL             0xe0000090
# Line 98  static SLJIT_CONST sljit_ub reg_map[SLJI Line 98  static SLJIT_CONST sljit_ub reg_map[SLJI
98  #define SBC_DP          0x6  #define SBC_DP          0x6
99  #define SMULL           0xe0c00090  #define SMULL           0xe0c00090
100  #define SUB_DP          0x2  #define SUB_DP          0x2
101    #define UMULL           0xe0800090
102  #define VABS_F64        0xeeb00bc0  #define VABS_F64        0xeeb00bc0
103  #define VADD_F64        0xee300b00  #define VADD_F64        0xee300b00
104  #define VCMP_F64        0xeeb40b40  #define VCMP_F64        0xeeb40b40
# Line 1755  static int emit_op(struct sljit_compiler Line 1756  static int emit_op(struct sljit_compiler
1756          return SLJIT_SUCCESS;          return SLJIT_SUCCESS;
1757  }  }
1758    
1759    #ifdef __cplusplus
1760    extern "C" {
1761    #endif
1762    
1763    #if defined(__GNUC__)
1764    extern unsigned int __aeabi_uidivmod(unsigned numerator, unsigned denominator);
1765    extern unsigned int __aeabi_idivmod(unsigned numerator, unsigned denominator);
1766    #else
1767    #error "Software divmod functions are needed"
1768    #endif
1769    
1770    #ifdef __cplusplus
1771    }
1772    #endif
1773    
1774  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op0(struct sljit_compiler *compiler, int op)  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op0(struct sljit_compiler *compiler, int op)
1775  {  {
1776          CHECK_ERROR();          CHECK_ERROR();
# Line 1763  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_ Line 1779  SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_
1779          op = GET_OPCODE(op);          op = GET_OPCODE(op);
1780          switch (op) {          switch (op) {
1781          case SLJIT_BREAKPOINT:          case SLJIT_BREAKPOINT:
1782                  EMIT_INSTRUCTION(DEBUGGER);                  EMIT_INSTRUCTION(BKPT);
1783                  break;                  break;
1784          case SLJIT_NOP:          case SLJIT_NOP:
1785                  EMIT_INSTRUCTION(NOP);                  EMIT_INSTRUCTION(NOP);
1786                  break;                  break;
1787            case SLJIT_UMUL:
1788            case SLJIT_SMUL:
1789    #if (defined SLJIT_CONFIG_ARM_V7 && SLJIT_CONFIG_ARM_V7)
1790                    return push_inst(compiler, (op == SLJIT_UMUL ? UMULL : SMULL)
1791                            | (reg_map[SLJIT_TEMPORARY_REG2] << 16)
1792                            | (reg_map[SLJIT_TEMPORARY_REG1] << 12)
1793                            | (reg_map[SLJIT_TEMPORARY_REG1] << 8)
1794                            | reg_map[SLJIT_TEMPORARY_REG2]);
1795    #else
1796                    EMIT_INSTRUCTION(EMIT_DATA_PROCESS_INS(MOV_DP, 0, TMP_REG1, SLJIT_UNUSED, RM(SLJIT_TEMPORARY_REG2)));
1797                    return push_inst(compiler, (op == SLJIT_UMUL ? UMULL : SMULL)
1798                            | (reg_map[SLJIT_TEMPORARY_REG2] << 16)
1799                            | (reg_map[SLJIT_TEMPORARY_REG1] << 12)
1800                            | (reg_map[SLJIT_TEMPORARY_REG1] << 8)
1801                            | reg_map[TMP_REG1]);
1802    #endif
1803            case SLJIT_UDIV:
1804            case SLJIT_SDIV:
1805                    EMIT_INSTRUCTION(0xe52d2008 /* str r2, [sp, #-8]! */);
1806    #if defined(__GNUC__)
1807                    FAIL_IF(sljit_emit_ijump(compiler, SLJIT_FAST_CALL, SLJIT_IMM,
1808                            (op == SLJIT_UDIV ? SLJIT_FUNC_OFFSET(__aeabi_uidivmod) : SLJIT_FUNC_OFFSET(__aeabi_idivmod))));
1809    #else
1810    #error "Software divmod functions are needed"
1811    #endif
1812                    return push_inst(compiler, 0xe49d2008 /* ldr r2, [sp], #8 */);
1813          }          }
1814    
1815          return SLJIT_SUCCESS;          return SLJIT_SUCCESS;

Legend:
Removed from v.839  
changed lines
  Added in v.847

  ViewVC Help
Powered by ViewVC 1.1.5