| opcodes.h | | opcodes.h | |
| UNARY_SB(absb, "ORC_ABS(%s)") | | UNARY_SB(absb, "ORC_ABS(%s)") | |
| BINARY_SB(addb, "%s + %s") | | BINARY_SB(addb, "%s + %s") | |
| BINARY_SB(addssb, "ORC_CLAMP_SB(%s + %s)") | | BINARY_SB(addssb, "ORC_CLAMP_SB(%s + %s)") | |
|
| BINARY_UB(addusb, "ORC_CLAMP_UB((uint8_t)%s + (uint8_t)%s)") | | BINARY_UB(addusb, "ORC_CLAMP_UB((orc_uint8)%s + (orc_uint8)%s)") | |
| BINARY_SB(andb, "%s & %s") | | BINARY_SB(andb, "%s & %s") | |
| BINARY_SB(andnb, "(~%s) & %s") | | BINARY_SB(andnb, "(~%s) & %s") | |
| BINARY_SB(avgsb, "(%s + %s + 1)>>1") | | BINARY_SB(avgsb, "(%s + %s + 1)>>1") | |
|
| BINARY_UB(avgub, "((uint8_t)%s + (uint8_t)%s + 1)>>1") | | BINARY_UB(avgub, "((orc_uint8)%s + (orc_uint8)%s + 1)>>1") | |
| BINARY_SB(cmpeqb, "(%s == %s) ? (~0) : 0") | | BINARY_SB(cmpeqb, "(%s == %s) ? (~0) : 0") | |
| BINARY_SB(cmpgtsb, "(%s > %s) ? (~0) : 0") | | BINARY_SB(cmpgtsb, "(%s > %s) ? (~0) : 0") | |
| UNARY_SB(copyb, "%s") | | UNARY_SB(copyb, "%s") | |
| BINARY_SB(maxsb, "ORC_MAX(%s, %s)") | | BINARY_SB(maxsb, "ORC_MAX(%s, %s)") | |
|
| BINARY_UB(maxub, "ORC_MAX((uint8_t)%s, (uint8_t)%s)") | | BINARY_UB(maxub, "ORC_MAX((orc_uint8)%s, (orc_uint8)%s)") | |
| BINARY_SB(minsb, "ORC_MIN(%s, %s)") | | BINARY_SB(minsb, "ORC_MIN(%s, %s)") | |
|
| BINARY_UB(minub, "ORC_MIN((uint8_t)%s, (uint8_t)%s)") | | BINARY_UB(minub, "ORC_MIN((orc_uint8)%s, (orc_uint8)%s)") | |
| BINARY_SB(mullb, "(%s * %s) & 0xff") | | BINARY_SB(mullb, "(%s * %s) & 0xff") | |
| BINARY_SB(mulhsb, "(%s * %s) >> 8") | | BINARY_SB(mulhsb, "(%s * %s) >> 8") | |
|
| BINARY_UB(mulhub, "((uint32_t)(uint8_t)%s * (uint32_t)(uint8_t)%s) >> 8") | | BINARY_UB(mulhub, "((orc_uint32)(orc_uint8)%s * (orc_uint32)(orc_uint8)%s)
>> 8") | |
| BINARY_SB(orb, "%s | %s") | | BINARY_SB(orb, "%s | %s") | |
| BINARY_SB(shlb, "%s << %s") | | BINARY_SB(shlb, "%s << %s") | |
| BINARY_SB(shrsb, "%s >> %s") | | BINARY_SB(shrsb, "%s >> %s") | |
|
| BINARY_UB(shrub, "((uint8_t)%s) >> %s") | | BINARY_UB(shrub, "((orc_uint8)%s) >> %s") | |
| UNARY_SB(signb, "ORC_CLAMP(%s,-1,1)") | | UNARY_SB(signb, "ORC_CLAMP(%s,-1,1)") | |
| BINARY_SB(subb, "%s - %s") | | BINARY_SB(subb, "%s - %s") | |
| BINARY_SB(subssb, "ORC_CLAMP_SB(%s - %s)") | | BINARY_SB(subssb, "ORC_CLAMP_SB(%s - %s)") | |
|
| BINARY_UB(subusb, "ORC_CLAMP_UB((uint8_t)%s - (uint8_t)%s)") | | BINARY_UB(subusb, "ORC_CLAMP_UB((orc_uint8)%s - (orc_uint8)%s)") | |
| BINARY_SB(xorb, "%s ^ %s") | | BINARY_SB(xorb, "%s ^ %s") | |
| | | | |
| UNARY_SW(absw, "ORC_ABS(%s)") | | UNARY_SW(absw, "ORC_ABS(%s)") | |
| BINARY_SW(addw, "%s + %s") | | BINARY_SW(addw, "%s + %s") | |
| BINARY_SW(addssw, "ORC_CLAMP_SW(%s + %s)") | | BINARY_SW(addssw, "ORC_CLAMP_SW(%s + %s)") | |
|
| BINARY_UW(addusw, "ORC_CLAMP_UW((uint16_t)%s + (uint16_t)%s)") | | BINARY_UW(addusw, "ORC_CLAMP_UW((orc_uint16)%s + (orc_uint16)%s)") | |
| BINARY_SW(andw, "%s & %s") | | BINARY_SW(andw, "%s & %s") | |
| BINARY_SW(andnw, "(~%s) & %s") | | BINARY_SW(andnw, "(~%s) & %s") | |
| BINARY_SW(avgsw, "(%s + %s + 1)>>1") | | BINARY_SW(avgsw, "(%s + %s + 1)>>1") | |
|
| BINARY_UW(avguw, "((uint16_t)%s + (uint16_t)%s + 1)>>1") | | BINARY_UW(avguw, "((orc_uint16)%s + (orc_uint16)%s + 1)>>1") | |
| BINARY_SW(cmpeqw, "(%s == %s) ? (~0) : 0") | | BINARY_SW(cmpeqw, "(%s == %s) ? (~0) : 0") | |
| BINARY_SW(cmpgtsw, "(%s > %s) ? (~0) : 0") | | BINARY_SW(cmpgtsw, "(%s > %s) ? (~0) : 0") | |
| UNARY_SW(copyw, "%s") | | UNARY_SW(copyw, "%s") | |
| BINARY_SW(maxsw, "ORC_MAX(%s, %s)") | | BINARY_SW(maxsw, "ORC_MAX(%s, %s)") | |
|
| BINARY_UW(maxuw, "ORC_MAX((uint16_t)%s, (uint16_t)%s)") | | BINARY_UW(maxuw, "ORC_MAX((orc_uint16)%s, (orc_uint16)%s)") | |
| BINARY_SW(minsw, "ORC_MIN(%s, %s)") | | BINARY_SW(minsw, "ORC_MIN(%s, %s)") | |
|
| BINARY_UW(minuw, "ORC_MIN((uint16_t)%s, (uint16_t)%s)") | | BINARY_UW(minuw, "ORC_MIN((orc_uint16)%s, (orc_uint16)%s)") | |
| BINARY_SW(mullw, "(%s * %s) & 0xffff") | | BINARY_SW(mullw, "(%s * %s) & 0xffff") | |
| BINARY_SW(mulhsw, "(%s * %s) >> 16") | | BINARY_SW(mulhsw, "(%s * %s) >> 16") | |
|
| BINARY_UW(mulhuw, "((uint32_t)((uint16_t)%s) * (uint32_t)((uint16_t)%s)) >>
16") | | BINARY_UW(mulhuw, "((orc_uint32)((orc_uint16)%s) * (orc_uint32)((orc_uint16
)%s)) >> 16") | |
| BINARY_SW(orw, "%s | %s") | | BINARY_SW(orw, "%s | %s") | |
| BINARY_SW(shlw, "%s << %s") | | BINARY_SW(shlw, "%s << %s") | |
| BINARY_SW(shrsw, "%s >> %s") | | BINARY_SW(shrsw, "%s >> %s") | |
|
| BINARY_UW(shruw, "((uint16_t)%s) >> %s") | | BINARY_UW(shruw, "((orc_uint16)%s) >> %s") | |
| UNARY_SW(signw, "ORC_CLAMP(%s,-1,1)") | | UNARY_SW(signw, "ORC_CLAMP(%s,-1,1)") | |
| BINARY_SW(subw, "%s - %s") | | BINARY_SW(subw, "%s - %s") | |
| BINARY_SW(subssw, "ORC_CLAMP_SW(%s - %s)") | | BINARY_SW(subssw, "ORC_CLAMP_SW(%s - %s)") | |
|
| BINARY_UW(subusw, "ORC_CLAMP_UW((uint16_t)%s - (uint16_t)%s)") | | BINARY_UW(subusw, "ORC_CLAMP_UW((orc_uint16)%s - (orc_uint16)%s)") | |
| BINARY_SW(xorw, "%s ^ %s") | | BINARY_SW(xorw, "%s ^ %s") | |
| | | | |
| UNARY_SL(absl, "ORC_ABS(%s)") | | UNARY_SL(absl, "ORC_ABS(%s)") | |
| BINARY_SL(addl, "%s + %s") | | BINARY_SL(addl, "%s + %s") | |
|
| BINARY_SL(addssl, "ORC_CLAMP_SL((int64_t)%s + (int64_t)%s)") | | BINARY_SL(addssl, "ORC_CLAMP_SL((orc_int64)%s + (orc_int64)%s)") | |
| BINARY_UL(addusl, "ORC_CLAMP_UL((int64_t)(uint32_t)%s + (int64_t)(uint32_t) | | BINARY_UL(addusl, "ORC_CLAMP_UL((orc_int64)(orc_uint32)%s + (orc_int64)(orc | |
| %s)") | | _uint32)%s)") | |
| BINARY_SL(andl, "%s & %s") | | BINARY_SL(andl, "%s & %s") | |
| BINARY_SL(andnl, "(~%s) & %s") | | BINARY_SL(andnl, "(~%s) & %s") | |
|
| BINARY_SL(avgsl, "((int64_t)%s + (int64_t)%s + 1)>>1") | | BINARY_SL(avgsl, "((orc_int64)%s + (orc_int64)%s + 1)>>1") | |
| BINARY_UL(avgul, "((uint64_t)(uint32_t)%s + (uint64_t)(uint32_t)%s + 1)>>1" | | BINARY_UL(avgul, "((orc_uint64)(orc_uint32)%s + (orc_uint64)(orc_uint32)%s | |
| ) | | + 1)>>1") | |
| BINARY_SL(cmpeql, "(%s == %s) ? (~0) : 0") | | BINARY_SL(cmpeql, "(%s == %s) ? (~0) : 0") | |
|
| | | <span class="insert">1)>>1")</span> | |
| BINARY_SL(cmpgtsl, "(%s > %s) ? (~0) : 0") | | BINARY_SL(cmpgtsl, "(%s > %s) ? (~0) : 0") | |
| UNARY_SL(copyl, "%s") | | UNARY_SL(copyl, "%s") | |
| BINARY_SL(maxsl, "ORC_MAX(%s, %s)") | | BINARY_SL(maxsl, "ORC_MAX(%s, %s)") | |
|
| BINARY_UL(maxul, "ORC_MAX((uint32_t)%s, (uint32_t)%s)") | | BINARY_UL(maxul, "ORC_MAX((orc_uint32)%s, (orc_uint32)%s)") | |
| BINARY_SL(minsl, "ORC_MIN(%s, %s)") | | BINARY_SL(minsl, "ORC_MIN(%s, %s)") | |
|
| BINARY_UL(minul, "ORC_MIN((uint32_t)%s, (uint32_t)%s)") | | BINARY_UL(minul, "ORC_MIN((orc_uint32)%s, (orc_uint32)%s)") | |
| BINARY_SL(mulll, "(%s * %s) & 0xffffffff") | | BINARY_SL(mulll, "(%s * %s) & 0xffffffff") | |
|
| BINARY_SL(mulhsl, "((int64_t)%s * (int64_t)%s) >> 32") | | BINARY_SL(mulhsl, "((orc_int64)%s * (orc_int64)%s) >> 32") | |
| BINARY_UL(mulhul, "((uint64_t)%s * (uint64_t)%s) >> 32") | | BINARY_UL(mulhul, "((orc_uint64)%s * (orc_uint64)%s) >> 32") | |
| BINARY_SL(orl, "%s | %s") | | BINARY_SL(orl, "%s | %s") | |
| BINARY_SL(shll, "%s << %s") | | BINARY_SL(shll, "%s << %s") | |
| BINARY_SL(shrsl, "%s >> %s") | | BINARY_SL(shrsl, "%s >> %s") | |
|
| BINARY_UL(shrul, "((uint32_t)%s) >> %s") | | BINARY_UL(shrul, "((orc_uint32)%s) >> %s") | |
| UNARY_SL(signl, "ORC_CLAMP(%s,-1,1)") | | UNARY_SL(signl, "ORC_CLAMP(%s,-1,1)") | |
| BINARY_SL(subl, "%s - %s") | | BINARY_SL(subl, "%s - %s") | |
|
| BINARY_SL(subssl, "ORC_CLAMP_SL((int64_t)%s - (int64_t)%s)") | | BINARY_SL(subssl, "ORC_CLAMP_SL((orc_int64)%s - (orc_int64)%s)") | |
| BINARY_UL(subusl, "ORC_CLAMP_UL((int64_t)(uint32_t)%s - (int64_t)(uint32_t) | | BINARY_UL(subusl, "ORC_CLAMP_UL((orc_int64)(orc_uint32)%s - (orc_int64)(orc | |
| %s)") | | _uint32)%s)") | |
| BINARY_SL(xorl, "%s ^ %s") | | BINARY_SL(xorl, "%s ^ %s") | |
| | | | |
| UNARY_BW(convsbw, "%s") | | UNARY_BW(convsbw, "%s") | |
|
| UNARY_BW(convubw, "(uint8_t)%s") | | UNARY_BW(convubw, "(orc_uint8)%s") | |
| UNARY_WL(convswl, "%s") | | UNARY_WL(convswl, "%s") | |
|
| UNARY_WL(convuwl, "(uint16_t)%s") | | UNARY_WL(convuwl, "(orc_uint16)%s") | |
| UNARY_WB(convwb, "%s") | | UNARY_WB(convwb, "%s") | |
| UNARY_WB(convssswb, "ORC_CLAMP_SB(%s)") | | UNARY_WB(convssswb, "ORC_CLAMP_SB(%s)") | |
| UNARY_WB(convsuswb, "ORC_CLAMP_UB(%s)") | | UNARY_WB(convsuswb, "ORC_CLAMP_UB(%s)") | |
|
| UNARY_WB(convusswb, "ORC_CLAMP_SB((uint16_t)%s)") | | UNARY_WB(convusswb, "ORC_CLAMP_SB((orc_uint16)%s)") | |
| UNARY_WB(convuuswb, "ORC_CLAMP_UB((uint16_t)%s)") | | UNARY_WB(convuuswb, "ORC_CLAMP_UB((orc_uint16)%s)") | |
| UNARY_LW(convlw, "%s") | | UNARY_LW(convlw, "%s") | |
| UNARY_LW(convssslw, "ORC_CLAMP_SW(%s)") | | UNARY_LW(convssslw, "ORC_CLAMP_SW(%s)") | |
| UNARY_LW(convsuslw, "ORC_CLAMP_UW(%s)") | | UNARY_LW(convsuslw, "ORC_CLAMP_UW(%s)") | |
|
| UNARY_LW(convusslw, "ORC_CLAMP_SW((uint32_t)%s)") | | UNARY_LW(convusslw, "ORC_CLAMP_SW((orc_uint32)%s)") | |
| UNARY_LW(convuuslw, "ORC_CLAMP_UW((uint32_t)%s)") | | UNARY_LW(convuuslw, "ORC_CLAMP_UW((orc_uint32)%s)") | |
| | | | |
| BINARY_BW(mulsbw, "%s * %s") | | BINARY_BW(mulsbw, "%s * %s") | |
|
| BINARY_BW(mulubw, "(uint8_t)%s * (uint8_t)%s") | | BINARY_BW(mulubw, "(orc_uint8)%s * (orc_uint8)%s") | |
| BINARY_WL(mulswl, "%s * %s") | | BINARY_WL(mulswl, "%s * %s") | |
|
| BINARY_WL(muluwl, "(uint16_t)%s * (uint16_t)%s") | | BINARY_WL(muluwl, "(orc_uint16)%s * (orc_uint16)%s") | |
| | | | |
|
| BINARY_WL(mergewl, "((uint16_t)%s) | ((uint16_t)%s << 16)") | | BINARY_WL(mergewl, "((orc_uint16)%s) | ((orc_uint16)%s << 16)") | |
| BINARY_BW(mergebw, "((uint8_t)%s) | ((uint8_t)%s << 8)") | | BINARY_BW(mergebw, "((orc_uint8)%s) | ((orc_uint8)%s << 8)") | |
| UNARY_WB(select0wb, "(uint16_t)%s & 0xff") | | UNARY_WB(select0wb, "(orc_uint16)%s & 0xff") | |
| UNARY_WB(select1wb, "((uint16_t)%s >> 8)&0xff") | | UNARY_WB(select1wb, "((orc_uint16)%s >> 8)&0xff") | |
| UNARY_LW(select0lw, "(uint32_t)%s & 0xffff") | | UNARY_LW(select0lw, "(orc_uint32)%s & 0xffff") | |
| UNARY_LW(select1lw, "((uint32_t)%s >> 16)&0xffff") | | UNARY_LW(select1lw, "((orc_uint32)%s >> 16)&0xffff") | |
| UNARY_UW(swapw, "ORC_SWAP_W(%s)") | | UNARY_UW(swapw, "ORC_SWAP_W(%s)") | |
| UNARY_UL(swapl, "ORC_SWAP_L(%s)") | | UNARY_UL(swapl, "ORC_SWAP_L(%s)") | |
| | | | |
| BINARY_F(addf, "%s + %s") | | BINARY_F(addf, "%s + %s") | |
| BINARY_F(subf, "%s - %s") | | BINARY_F(subf, "%s - %s") | |
| BINARY_F(mulf, "%s * %s") | | BINARY_F(mulf, "%s * %s") | |
| BINARY_F(divf, "%s / %s") | | BINARY_F(divf, "%s / %s") | |
| UNARY_F(sqrtf, "sqrt(%s)") | | UNARY_F(sqrtf, "sqrt(%s)") | |
| BINARY_F(maxf, "ORC_MAX(%s,%s)") | | BINARY_F(maxf, "ORC_MAX(%s,%s)") | |
| BINARY_F(minf, "ORC_MIN(%s,%s)") | | BINARY_F(minf, "ORC_MIN(%s,%s)") | |
| | | | |
End of changes. 29 change blocks. |
| 42 lines changed or deleted | | 43 lines changed or added | |
|
| orcarm.h | | orcarm.h | |
| | | | |
| skipping to change at line 70 | | skipping to change at line 70 | |
| ORC_ARM_COND_AL, | | ORC_ARM_COND_AL, | |
| } OrcArmCond; | | } OrcArmCond; | |
| | | | |
| typedef enum { | | typedef enum { | |
| ORC_ARM_LSL, | | ORC_ARM_LSL, | |
| ORC_ARM_LSR, | | ORC_ARM_LSR, | |
| ORC_ARM_ASR, | | ORC_ARM_ASR, | |
| ORC_ARM_ROR | | ORC_ARM_ROR | |
| } OrcArmShift; | | } OrcArmShift; | |
| | | | |
|
| void orc_arm_emit (OrcCompiler *compiler, uint32_t insn); | | unsigned long orc_arm_get_cpu_flags (void); | |
| | | | |
| | | void orc_arm_emit (OrcCompiler *compiler, orc_uint32 insn); | |
| void orc_arm_emit_bx_lr (OrcCompiler *compiler); | | void orc_arm_emit_bx_lr (OrcCompiler *compiler); | |
| const char * orc_arm_reg_name (int reg); | | const char * orc_arm_reg_name (int reg); | |
| const char * orc_arm_cond_name (OrcArmCond cond); | | const char * orc_arm_cond_name (OrcArmCond cond); | |
| void orc_arm_emit_load_imm (OrcCompiler *compiler, int dest, int imm); | | void orc_arm_emit_load_imm (OrcCompiler *compiler, int dest, int imm); | |
| | | | |
| void orc_arm_emit_add (OrcCompiler *compiler, int dest, int src1, int src2)
; | | void orc_arm_emit_add (OrcCompiler *compiler, int dest, int src1, int src2)
; | |
| void orc_arm_emit_sub (OrcCompiler *compiler, int dest, int src1, int src2)
; | | void orc_arm_emit_sub (OrcCompiler *compiler, int dest, int src1, int src2)
; | |
| void orc_arm_emit_add_imm (OrcCompiler *compiler, int dest, int src1, int v
alue); | | void orc_arm_emit_add_imm (OrcCompiler *compiler, int dest, int src1, int v
alue); | |
| void orc_arm_emit_and_imm (OrcCompiler *compiler, int dest, int src1, int v
alue); | | void orc_arm_emit_and_imm (OrcCompiler *compiler, int dest, int src1, int v
alue); | |
|
| void orc_arm_emit_sub_imm (OrcCompiler *compiler, int dest, int src1, int v
alue); | | void orc_arm_emit_sub_imm (OrcCompiler *compiler, int dest, int src1, int v
alue, int record); | |
| void orc_arm_emit_asr_imm (OrcCompiler *compiler, int dest, int src1, int v
alue); | | void orc_arm_emit_asr_imm (OrcCompiler *compiler, int dest, int src1, int v
alue); | |
| void orc_arm_emit_lsl_imm (OrcCompiler *compiler, int dest, int src1, int v
alue); | | void orc_arm_emit_lsl_imm (OrcCompiler *compiler, int dest, int src1, int v
alue); | |
| void orc_arm_emit_cmp_imm (OrcCompiler *compiler, int src1, int value); | | void orc_arm_emit_cmp_imm (OrcCompiler *compiler, int src1, int value); | |
| void orc_arm_emit_cmp (OrcCompiler *compiler, int src1, int src2); | | void orc_arm_emit_cmp (OrcCompiler *compiler, int src1, int src2); | |
| void orc_arm_emit_mov (OrcCompiler *compiler, int dest, int src); | | void orc_arm_emit_mov (OrcCompiler *compiler, int dest, int src); | |
| | | | |
| void orc_arm_emit_align (OrcCompiler *compiler, int align_shift); | | void orc_arm_emit_align (OrcCompiler *compiler, int align_shift); | |
| void orc_arm_emit_label (OrcCompiler *compiler, int label); | | void orc_arm_emit_label (OrcCompiler *compiler, int label); | |
| void orc_arm_emit_push (OrcCompiler *compiler, int regs); | | void orc_arm_emit_push (OrcCompiler *compiler, int regs); | |
| void orc_arm_emit_pop (OrcCompiler *compiler, int regs); | | void orc_arm_emit_pop (OrcCompiler *compiler, int regs); | |
| void orc_arm_emit_branch (OrcCompiler *compiler, int cond, int label); | | void orc_arm_emit_branch (OrcCompiler *compiler, int cond, int label); | |
| | | | |
|
| | | void orc_arm_loadb (OrcCompiler *compiler, int dest, int src1, int offset); | |
| | | void orc_arm_storeb (OrcCompiler *compiler, int dest, int offset, int src1) | |
| | | ; | |
| void orc_arm_loadw (OrcCompiler *compiler, int dest, int src1, int offset); | | void orc_arm_loadw (OrcCompiler *compiler, int dest, int src1, int offset); | |
| void orc_arm_storew (OrcCompiler *compiler, int dest, int offset, int src1)
; | | void orc_arm_storew (OrcCompiler *compiler, int dest, int offset, int src1)
; | |
|
| | | void orc_arm_loadl (OrcCompiler *compiler, int dest, int src1, int offset); | |
| | | void orc_arm_storel (OrcCompiler *compiler, int dest, int offset, int src1) | |
| | | ; | |
| | | | |
| void orc_arm_emit_load_reg (OrcCompiler *compiler, int dest, int src1, int
offset); | | void orc_arm_emit_load_reg (OrcCompiler *compiler, int dest, int src1, int
offset); | |
| void orc_arm_emit_store_reg (OrcCompiler *compiler, int src, int dest, int
offset); | | void orc_arm_emit_store_reg (OrcCompiler *compiler, int src, int dest, int
offset); | |
| | | | |
| void orc_arm_add_fixup (OrcCompiler *compiler, int label, int type); | | void orc_arm_add_fixup (OrcCompiler *compiler, int label, int type); | |
| void orc_arm_do_fixups (OrcCompiler *compiler); | | void orc_arm_do_fixups (OrcCompiler *compiler); | |
| | | | |
| void orc_arm_emit_dp (OrcCompiler *p, int type, OrcArmCond cond, OrcArmDP o
pcode, | | void orc_arm_emit_dp (OrcCompiler *p, int type, OrcArmCond cond, OrcArmDP o
pcode, | |
|
| int S, int Rd, int Rn, int Rm, int shift, uint32_t val); | | int S, int Rd, int Rn, int Rm, int shift, orc_uint32 val); | |
| void orc_arm_emit_par (OrcCompiler *p, int op, int mode, OrcArmCond cond, | | void orc_arm_emit_par (OrcCompiler *p, int op, int mode, OrcArmCond cond, | |
| int Rd, int Rn, int Rm); | | int Rd, int Rn, int Rm); | |
| void orc_arm_emit_xt (OrcCompiler *p, int op, OrcArmCond cond, | | void orc_arm_emit_xt (OrcCompiler *p, int op, OrcArmCond cond, | |
| int Rd, int Rn, int Rm, int r8); | | int Rd, int Rn, int Rm, int r8); | |
| void orc_arm_emit_pkh (OrcCompiler *p, int op, OrcArmCond cond, | | void orc_arm_emit_pkh (OrcCompiler *p, int op, OrcArmCond cond, | |
| int Rd, int Rn, int Rm, int sh); | | int Rd, int Rn, int Rm, int sh); | |
| void orc_arm_emit_sat (OrcCompiler *p, int op, OrcArmCond cond, | | void orc_arm_emit_sat (OrcCompiler *p, int op, OrcArmCond cond, | |
| int Rd, int sat, int Rm, int sh, int asr); | | int Rd, int sat, int Rm, int sh, int asr); | |
| void orc_arm_emit_rv (OrcCompiler *p, int op, OrcArmCond cond, | | void orc_arm_emit_rv (OrcCompiler *p, int op, OrcArmCond cond, | |
| int Rd, int Rm); | | int Rd, int Rm); | |
| | | | |
End of changes. 5 change blocks. |
| 3 lines changed or deleted | | 11 lines changed or added | |
|
| orcprogram.h | | orcprogram.h | |
| | | | |
| #ifndef _ORC_PROGRAM_H_ | | #ifndef _ORC_PROGRAM_H_ | |
| #define _ORC_PROGRAM_H_ | | #define _ORC_PROGRAM_H_ | |
| | | | |
|
| #include <orc/orc-stdint.h> | | | |
| #include <orc/orcutils.h> | | #include <orc/orcutils.h> | |
| | | | |
| typedef struct _OrcOpcodeExecutor OrcOpcodeExecutor; | | typedef struct _OrcOpcodeExecutor OrcOpcodeExecutor; | |
| typedef struct _OrcExecutor OrcExecutor; | | typedef struct _OrcExecutor OrcExecutor; | |
| typedef struct _OrcExecutorAlt OrcExecutorAlt; | | typedef struct _OrcExecutorAlt OrcExecutorAlt; | |
| typedef struct _OrcVariable OrcVariable; | | typedef struct _OrcVariable OrcVariable; | |
| typedef struct _OrcOpcodeSet OrcOpcodeSet; | | typedef struct _OrcOpcodeSet OrcOpcodeSet; | |
| typedef struct _OrcStaticOpcode OrcStaticOpcode; | | typedef struct _OrcStaticOpcode OrcStaticOpcode; | |
| typedef struct _OrcInstruction OrcInstruction; | | typedef struct _OrcInstruction OrcInstruction; | |
| typedef struct _OrcProgram OrcProgram; | | typedef struct _OrcProgram OrcProgram; | |
| | | | |
| skipping to change at line 78 | | skipping to change at line 77 | |
| | | | |
| #define ORC_COMPILER_ERROR(compiler, ...) do { \ | | #define ORC_COMPILER_ERROR(compiler, ...) do { \ | |
| compiler->error = TRUE; \ | | compiler->error = TRUE; \ | |
| compiler->result = ORC_COMPILE_RESULT_UNKNOWN_PARSE; \ | | compiler->result = ORC_COMPILE_RESULT_UNKNOWN_PARSE; \ | |
| orc_debug_print(ORC_DEBUG_WARNING, __FILE__, ORC_FUNCTION, __LINE__, __VA
_ARGS__); \ | | orc_debug_print(ORC_DEBUG_WARNING, __FILE__, ORC_FUNCTION, __LINE__, __VA
_ARGS__); \ | |
| } while (0) | | } while (0) | |
| | | | |
| enum { | | enum { | |
| ORC_TARGET_C_C99 = (1<<0), | | ORC_TARGET_C_C99 = (1<<0), | |
| ORC_TARGET_C_BARE = (1<<1), | | ORC_TARGET_C_BARE = (1<<1), | |
|
| ORC_TARGET_C_NOEXEC = (1<<2) | | ORC_TARGET_C_NOEXEC = (1<<2), | |
| | | ORC_TARGET_FAST_NAN = (1<<30), | |
| | | ORC_TARGET_FAST_DENORMAL = (1<<31) | |
| }; | | }; | |
| | | | |
| enum { | | enum { | |
| ORC_TARGET_ALTIVEC_ALTIVEC = (1<<0) | | ORC_TARGET_ALTIVEC_ALTIVEC = (1<<0) | |
| }; | | }; | |
| | | | |
| enum { | | enum { | |
|
| ORC_TARGET_NEON_CLEAN_COMPILE = (1<<0) | | ORC_TARGET_NEON_CLEAN_COMPILE = (1<<0), | |
| | | ORC_TARGET_NEON_NEON = (1<<1) | |
| }; | | }; | |
| | | | |
| typedef enum { | | typedef enum { | |
| ORC_VAR_TYPE_TEMP, | | ORC_VAR_TYPE_TEMP, | |
| ORC_VAR_TYPE_SRC, | | ORC_VAR_TYPE_SRC, | |
| ORC_VAR_TYPE_DEST, | | ORC_VAR_TYPE_DEST, | |
| ORC_VAR_TYPE_CONST, | | ORC_VAR_TYPE_CONST, | |
| ORC_VAR_TYPE_PARAM, | | ORC_VAR_TYPE_PARAM, | |
| ORC_VAR_TYPE_ACCUMULATOR | | ORC_VAR_TYPE_ACCUMULATOR | |
| } OrcVarType; | | } OrcVarType; | |
| | | | |
| skipping to change at line 209 | | skipping to change at line 211 | |
| int is_chained; | | int is_chained; | |
| int is_aligned; | | int is_aligned; | |
| int is_uncached; | | int is_uncached; | |
| | | | |
| int value; | | int value; | |
| | | | |
| int ptr_register; | | int ptr_register; | |
| int ptr_offset; | | int ptr_offset; | |
| int mask_alloc; | | int mask_alloc; | |
| int aligned_data; | | int aligned_data; | |
|
| int sampling_type; | | int is_float_param; | |
| int load_dest; | | int load_dest; | |
| }; | | }; | |
| | | | |
| /** | | /** | |
| * OrcRule: | | * OrcRule: | |
| * | | * | |
| * The OrcRule structure has no public members | | * The OrcRule structure has no public members | |
| */ | | */ | |
| struct _OrcRule { | | struct _OrcRule { | |
| /*< private >*/ | | /*< private >*/ | |
| | | | |
| skipping to change at line 393 | | skipping to change at line 395 | |
| int tmpreg; | | int tmpreg; | |
| int exec_reg; | | int exec_reg; | |
| int gp_tmpreg; | | int gp_tmpreg; | |
| | | | |
| int insn_index; | | int insn_index; | |
| int need_mask_regs; | | int need_mask_regs; | |
| int unroll_shift; | | int unroll_shift; | |
| | | | |
| int alloc_loop_counter; | | int alloc_loop_counter; | |
| int loop_counter; | | int loop_counter; | |
|
| | | int size_region; | |
| }; | | }; | |
| | | | |
| #define ORC_SRC_ARG(p,i,n) ((p)->vars[(i)->src_args[(n)]].alloc) | | #define ORC_SRC_ARG(p,i,n) ((p)->vars[(i)->src_args[(n)]].alloc) | |
| #define ORC_DEST_ARG(p,i,n) ((p)->vars[(i)->dest_args[(n)]].alloc) | | #define ORC_DEST_ARG(p,i,n) ((p)->vars[(i)->dest_args[(n)]].alloc) | |
| #define ORC_SRC_TYPE(p,i,n) ((p)->vars[(i)->src_args[(n)]].vartype) | | #define ORC_SRC_TYPE(p,i,n) ((p)->vars[(i)->src_args[(n)]].vartype) | |
| #define ORC_DEST_TYPE(p,i,n) ((p)->vars[(i)->dest_args[(n)]].vartype) | | #define ORC_DEST_TYPE(p,i,n) ((p)->vars[(i)->dest_args[(n)]].vartype) | |
| #define ORC_SRC_VAL(p,i,n) ((p)->vars[(i)->src_args[(n)]].value) | | #define ORC_SRC_VAL(p,i,n) ((p)->vars[(i)->src_args[(n)]].value) | |
| #define ORC_DEST_VAL(p,i,n) ((p)->vars[(i)->dest_args[(n)]].value) | | #define ORC_DEST_VAL(p,i,n) ((p)->vars[(i)->dest_args[(n)]].value) | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 482 | | skipping to change at line 485 | |
| | | | |
| unsigned int (*get_default_flags)(void); | | unsigned int (*get_default_flags)(void); | |
| void (*compiler_init)(OrcCompiler *compiler); | | void (*compiler_init)(OrcCompiler *compiler); | |
| void (*compile)(OrcCompiler *compiler); | | void (*compile)(OrcCompiler *compiler); | |
| | | | |
| OrcRuleSet rule_sets[ORC_N_RULE_SETS]; | | OrcRuleSet rule_sets[ORC_N_RULE_SETS]; | |
| int n_rule_sets; | | int n_rule_sets; | |
| | | | |
| const char * (*get_asm_preamble)(void); | | const char * (*get_asm_preamble)(void); | |
| void (*load_constant)(OrcCompiler *compiler, int reg, int size, int value
); | | void (*load_constant)(OrcCompiler *compiler, int reg, int size, int value
); | |
|
| | | const char * (*get_flag_name)(int shift); | |
| | | | |
|
| void *_unused[8]; | | void *_unused[7]; | |
| }; | | }; | |
| | | | |
| void orc_init (void); | | void orc_init (void); | |
| | | | |
| OrcProgram * orc_program_new (void); | | OrcProgram * orc_program_new (void); | |
| OrcProgram * orc_program_new_ds (int size1, int size2); | | OrcProgram * orc_program_new_ds (int size1, int size2); | |
| OrcProgram * orc_program_new_dss (int size1, int size2, int size3); | | OrcProgram * orc_program_new_dss (int size1, int size2, int size3); | |
| OrcProgram * orc_program_new_as (int size1, int size2); | | OrcProgram * orc_program_new_as (int size1, int size2); | |
| OrcProgram * orc_program_new_ass (int size1, int size2, int size3); | | OrcProgram * orc_program_new_ass (int size1, int size2, int size3); | |
| OrcStaticOpcode * orc_opcode_find_by_name (const char *name); | | OrcStaticOpcode * orc_opcode_find_by_name (const char *name); | |
| | | | |
| skipping to change at line 536 | | skipping to change at line 540 | |
| void orc_program_free (OrcProgram *program); | | void orc_program_free (OrcProgram *program); | |
| | | | |
| int orc_program_find_var_by_name (OrcProgram *program, const char *name); | | int orc_program_find_var_by_name (OrcProgram *program, const char *name); | |
| | | | |
| int orc_program_add_temporary (OrcProgram *program, int size, const char *n
ame); | | int orc_program_add_temporary (OrcProgram *program, int size, const char *n
ame); | |
| int orc_program_dup_temporary (OrcProgram *program, int i, int j); | | int orc_program_dup_temporary (OrcProgram *program, int i, int j); | |
| int orc_program_add_source (OrcProgram *program, int size, const char *name
); | | int orc_program_add_source (OrcProgram *program, int size, const char *name
); | |
| int orc_program_add_destination (OrcProgram *program, int size, const char
*name); | | int orc_program_add_destination (OrcProgram *program, int size, const char
*name); | |
| int orc_program_add_constant (OrcProgram *program, int size, int value, con
st char *name); | | int orc_program_add_constant (OrcProgram *program, int size, int value, con
st char *name); | |
| int orc_program_add_parameter (OrcProgram *program, int size, const char *n
ame); | | int orc_program_add_parameter (OrcProgram *program, int size, const char *n
ame); | |
|
| | | int orc_program_add_parameter_float (OrcProgram *program, int size, const c
har *name); | |
| int orc_program_add_accumulator (OrcProgram *program, int size, const char
*name); | | int orc_program_add_accumulator (OrcProgram *program, int size, const char
*name); | |
| void orc_program_set_type_name (OrcProgram *program, int var, const char *t
ype_name); | | void orc_program_set_type_name (OrcProgram *program, int var, const char *t
ype_name); | |
| void orc_program_set_sampling_type (OrcProgram *program, int var, int sampl
ing_type); | | void orc_program_set_sampling_type (OrcProgram *program, int var, int sampl
ing_type); | |
| | | | |
| OrcExecutor * orc_executor_new (OrcProgram *program); | | OrcExecutor * orc_executor_new (OrcProgram *program); | |
| void orc_executor_free (OrcExecutor *ex); | | void orc_executor_free (OrcExecutor *ex); | |
| void orc_executor_set_program (OrcExecutor *ex, OrcProgram *program); | | void orc_executor_set_program (OrcExecutor *ex, OrcProgram *program); | |
| void orc_executor_set_array (OrcExecutor *ex, int var, void *ptr); | | void orc_executor_set_array (OrcExecutor *ex, int var, void *ptr); | |
| void orc_executor_set_stride (OrcExecutor *ex, int var, int stride); | | void orc_executor_set_stride (OrcExecutor *ex, int var, int stride); | |
| void orc_executor_set_array_str (OrcExecutor *ex, const char *name, void *p
tr); | | void orc_executor_set_array_str (OrcExecutor *ex, const char *name, void *p
tr); | |
| | | | |
| skipping to change at line 569 | | skipping to change at line 574 | |
| | | | |
| OrcRuleSet * orc_rule_set_new (OrcOpcodeSet *opcode_set, OrcTarget *target, | | OrcRuleSet * orc_rule_set_new (OrcOpcodeSet *opcode_set, OrcTarget *target, | |
| unsigned int required_flags); | | unsigned int required_flags); | |
| void orc_rule_register (OrcRuleSet *rule_set, const char *opcode_name, | | void orc_rule_register (OrcRuleSet *rule_set, const char *opcode_name, | |
| OrcRuleEmitFunc emit, void *emit_user); | | OrcRuleEmitFunc emit, void *emit_user); | |
| OrcRule * orc_target_get_rule (OrcTarget *target, OrcStaticOpcode *opcode, | | OrcRule * orc_target_get_rule (OrcTarget *target, OrcStaticOpcode *opcode, | |
| unsigned int target_flags); | | unsigned int target_flags); | |
| OrcTarget * orc_target_get_default (void); | | OrcTarget * orc_target_get_default (void); | |
| unsigned int orc_target_get_default_flags (OrcTarget *target); | | unsigned int orc_target_get_default_flags (OrcTarget *target); | |
| const char * orc_target_get_name (OrcTarget *target); | | const char * orc_target_get_name (OrcTarget *target); | |
|
| | | const char * orc_target_get_flag_name (OrcTarget *target, int shift); | |
| | | | |
| int orc_program_allocate_register (OrcProgram *program, int is_data); | | int orc_program_allocate_register (OrcProgram *program, int is_data); | |
| | | | |
| void orc_compiler_allocate_codemem (OrcCompiler *compiler); | | void orc_compiler_allocate_codemem (OrcCompiler *compiler); | |
| int orc_compiler_label_new (OrcCompiler *compiler); | | int orc_compiler_label_new (OrcCompiler *compiler); | |
| int orc_compiler_get_constant (OrcCompiler *compiler, int size, int value); | | int orc_compiler_get_constant (OrcCompiler *compiler, int size, int value); | |
| | | | |
| const char *orc_program_get_asm_code (OrcProgram *program); | | const char *orc_program_get_asm_code (OrcProgram *program); | |
| const char *orc_target_get_asm_preamble (const char *target); | | const char *orc_target_get_asm_preamble (const char *target); | |
| const char * orc_target_get_preamble (OrcTarget *target); | | const char * orc_target_get_preamble (OrcTarget *target); | |
|
| | | const char * orc_target_c_get_typedefs (void); | |
| | | | |
| void orc_compiler_append_code (OrcCompiler *p, const char *fmt, ...) | | void orc_compiler_append_code (OrcCompiler *p, const char *fmt, ...) | |
| ORC_GNU_PRINTF(2,3); | | ORC_GNU_PRINTF(2,3); | |
| | | | |
| void orc_target_register (OrcTarget *target); | | void orc_target_register (OrcTarget *target); | |
| OrcTarget *orc_target_get_by_name (const char *target_name); | | OrcTarget *orc_target_get_by_name (const char *target_name); | |
| int orc_program_get_max_var_size (OrcProgram *program); | | int orc_program_get_max_var_size (OrcProgram *program); | |
| int orc_program_get_max_array_size (OrcProgram *program); | | int orc_program_get_max_array_size (OrcProgram *program); | |
| int orc_program_get_max_accumulator_size (OrcProgram *program); | | int orc_program_get_max_accumulator_size (OrcProgram *program); | |
| | | | |
|
| | | void orc_get_data_cache_sizes (int *level1, int *level2, int *level3); | |
| | | | |
| | | #ifdef ORC_ENABLE_UNSTABLE_API | |
| | | | |
| | | int orc_compiler_flag_check (const char *flag); | |
| | | | |
| | | extern int _orc_data_cache_size_level1; | |
| | | extern int _orc_data_cache_size_level2; | |
| | | extern int _orc_data_cache_size_level3; | |
| | | | |
| | | extern int _orc_compiler_flag_backup; | |
| | | extern int _orc_compiler_flag_debug; | |
| | | | |
| | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 11 change blocks. |
| 5 lines changed or deleted | | 27 lines changed or added | |
|
| orcsse.h | | orcsse.h | |
| | | | |
| skipping to change at line 70 | | skipping to change at line 70 | |
| int src, int dest); | | int src, int dest); | |
| void orc_sse_emit_f30f (OrcCompiler *p, const char *insn_name, int code, | | void orc_sse_emit_f30f (OrcCompiler *p, const char *insn_name, int code, | |
| int src, int dest); | | int src, int dest); | |
| void orc_sse_emit_0f (OrcCompiler *p, const char *insn_name, int code, | | void orc_sse_emit_0f (OrcCompiler *p, const char *insn_name, int code, | |
| int src, int dest); | | int src, int dest); | |
| void orc_sse_emit_pshufd (OrcCompiler *p, int shuf, int src, int dest); | | void orc_sse_emit_pshufd (OrcCompiler *p, int shuf, int src, int dest); | |
| void orc_sse_emit_pshuflw (OrcCompiler *p, int shuf, int src, int dest); | | void orc_sse_emit_pshuflw (OrcCompiler *p, int shuf, int src, int dest); | |
| void orc_sse_emit_shiftimm (OrcCompiler *p, const char *insn_name, | | void orc_sse_emit_shiftimm (OrcCompiler *p, const char *insn_name, | |
| int code, int modrm_code, int shift, int reg); | | int code, int modrm_code, int shift, int reg); | |
| | | | |
|
| | | void orc_sse_set_mxcsr (OrcCompiler *compiler); | |
| | | void orc_sse_restore_mxcsr (OrcCompiler *compiler); | |
| | | | |
| unsigned int orc_sse_get_cpu_flags (void); | | unsigned int orc_sse_get_cpu_flags (void); | |
| | | | |
| /* SSE instructions */ | | /* SSE instructions */ | |
| | | | |
| /* SSE2 instructions */ | | /* SSE2 instructions */ | |
| #define orc_sse_emit_punpcklbw(p,a,b) orc_sse_emit_660f (p, "punpcklbw", 0
x60, a, b) | | #define orc_sse_emit_punpcklbw(p,a,b) orc_sse_emit_660f (p, "punpcklbw", 0
x60, a, b) | |
| #define orc_sse_emit_punpcklwd(p,a,b) orc_sse_emit_660f (p, "punpcklwd", 0
x61, a, b) | | #define orc_sse_emit_punpcklwd(p,a,b) orc_sse_emit_660f (p, "punpcklwd", 0
x61, a, b) | |
| #define orc_sse_emit_punpckldq(p,a,b) orc_sse_emit_660f (p, "punpckldq", 0
x62, a, b) | | #define orc_sse_emit_punpckldq(p,a,b) orc_sse_emit_660f (p, "punpckldq", 0
x62, a, b) | |
| #define orc_sse_emit_packsswb(p,a,b) orc_sse_emit_660f (p, "packsswb", 0x
63, a, b) | | #define orc_sse_emit_packsswb(p,a,b) orc_sse_emit_660f (p, "packsswb", 0x
63, a, b) | |
| #define orc_sse_emit_pcmpgtb(p,a,b) orc_sse_emit_660f (p, "pcmpgtb", 0x6
4, a, b) | | #define orc_sse_emit_pcmpgtb(p,a,b) orc_sse_emit_660f (p, "pcmpgtb", 0x6
4, a, b) | |
| | | | |
End of changes. 1 change blocks. |
| 0 lines changed or deleted | | 3 lines changed or added | |
|
| orcutils.h | | orcutils.h | |
| | | | |
| skipping to change at line 31 | | skipping to change at line 31 | |
| * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
| * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | |
| * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING | |
| * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
| * POSSIBILITY OF SUCH DAMAGE. | | * POSSIBILITY OF SUCH DAMAGE. | |
| */ | | */ | |
| | | | |
| #ifndef _ORC_UTILS_H_ | | #ifndef _ORC_UTILS_H_ | |
| #define _ORC_UTILS_H_ | | #define _ORC_UTILS_H_ | |
| | | | |
|
| #include <orc/orc-stdint.h> | | #ifndef _ORC_INTEGER_TYPEDEFS_ | |
| | | #define _ORC_INTEGER_TYPEDEFS_ | |
| | | #if defined(_x_STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L | |
| | | #include <stdint.h> | |
| | | typedef int8_t orc_int8; | |
| | | typedef int16_t orc_int16; | |
| | | typedef int32_t orc_int32; | |
| | | typedef int64_t orc_int64; | |
| | | typedef uint8_t orc_uint8; | |
| | | typedef uint16_t orc_uint16; | |
| | | typedef uint32_t orc_uint32; | |
| | | typedef uint64_t orc_uint64; | |
| | | #elif defined(_MSC_VER) | |
| | | typedef signed __int8 orc_int8; | |
| | | typedef signed __int16 orc_int16; | |
| | | typedef signed __int32 orc_int32; | |
| | | typedef signed __int64 orc_int64; | |
| | | typedef unsigned __int8 orc_uint8; | |
| | | typedef unsigned __int16 orc_uint16; | |
| | | typedef unsigned __int32 orc_uint32; | |
| | | typedef unsigned __int64 orc_uint64; | |
| | | #else | |
| | | #include <limits.h> | |
| | | typedef signed char orc_int8; | |
| | | typedef short orc_int16; | |
| | | typedef int orc_int32; | |
| | | typedef unsigned char orc_uint8; | |
| | | typedef unsigned short orc_uint16; | |
| | | typedef unsigned int orc_uint32; | |
| | | #if INT_MAX == LONG_MAX | |
| | | typedef long long orc_int64; | |
| | | typedef unsigned long long orc_uint64; | |
| | | #else | |
| | | typedef long orc_int64; | |
| | | typedef unsigned long orc_uint64; | |
| | | #endif | |
| | | #endif | |
| | | typedef union { orc_int32 i; float f; } orc_union32; | |
| | | typedef union { orc_int64 i; double f; } orc_union64; | |
| | | #endif | |
| | | | |
| #ifndef TRUE | | #ifndef TRUE | |
| #define TRUE 1 | | #define TRUE 1 | |
| #endif | | #endif | |
| #ifndef FALSE | | #ifndef FALSE | |
| #define FALSE 0 | | #define FALSE 0 | |
| #endif | | #endif | |
| | | | |
| typedef unsigned int orc_bool; | | typedef unsigned int orc_bool; | |
| | | | |
| | | | |
| skipping to change at line 58 | | skipping to change at line 97 | |
| #ifndef MAX | | #ifndef MAX | |
| #define MAX(a,b) ((a)>(b) ? (a) : (b)) | | #define MAX(a,b) ((a)>(b) ? (a) : (b)) | |
| #endif | | #endif | |
| #ifndef ORC_CLAMP | | #ifndef ORC_CLAMP | |
| #define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x))) | | #define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x))) | |
| #endif | | #endif | |
| #define ORC_PTR_TO_INT(x) ((int)(long)(x)) | | #define ORC_PTR_TO_INT(x) ((int)(long)(x)) | |
| #define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (of
fset))) | | #define ORC_PTR_OFFSET(ptr,offset) ((void *)(((unsigned char *)(ptr)) + (of
fset))) | |
| | | | |
| #define ORC_READ_UINT32_LE(ptr) \ | | #define ORC_READ_UINT32_LE(ptr) \ | |
|
| ((uint32_t)( \ | | ((orc_uint32)( \ | |
| ((uint8_t *)(ptr))[0] | \ | | ((orc_uint8 *)(ptr))[0] | \ | |
| (((uint8_t *)(ptr))[1]<<8) | \ | | (((orc_uint8 *)(ptr))[1]<<8) | \ | |
| (((uint8_t *)(ptr))[2]<<16) | \ | | (((orc_uint8 *)(ptr))[2]<<16) | \ | |
| (((uint8_t *)(ptr))[3]<<24))) | | (((orc_uint8 *)(ptr))[3]<<24))) | |
| | | | |
| #define ORC_WRITE_UINT32_LE(ptr,val) \ | | #define ORC_WRITE_UINT32_LE(ptr,val) \ | |
| do { \ | | do { \ | |
|
| ((uint8_t *)ptr)[0] = ((val)>>0)&0xff; \ | | ((orc_uint8 *)ptr)[0] = ((val)>>0)&0xff; \ | |
| ((uint8_t *)ptr)[1] = ((val)>>8)&0xff; \ | | ((orc_uint8 *)ptr)[1] = ((val)>>8)&0xff; \ | |
| ((uint8_t *)ptr)[2] = ((val)>>16)&0xff; \ | | ((orc_uint8 *)ptr)[2] = ((val)>>16)&0xff; \ | |
| ((uint8_t *)ptr)[3] = ((val)>>24)&0xff; \ | | ((orc_uint8 *)ptr)[3] = ((val)>>24)&0xff; \ | |
| } while(0) | | } while(0) | |
| | | | |
| #endif | | #endif | |
| | | | |
| #if defined(__GNUC__) && defined(__GNUC_MINOR__) | | #if defined(__GNUC__) && defined(__GNUC_MINOR__) | |
| #define ORC_GNUC_PREREQ(maj, min) \ | | #define ORC_GNUC_PREREQ(maj, min) \ | |
| ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) | | ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) | |
| #else | | #else | |
| #define ORC_GNUC_PREREQ(maj, min) 0 | | #define ORC_GNUC_PREREQ(maj, min) 0 | |
| #endif | | #endif | |
| | | | |
| skipping to change at line 119 | | skipping to change at line 158 | |
| #endif | | #endif | |
| | | | |
| ORC_BEGIN_DECLS | | ORC_BEGIN_DECLS | |
| | | | |
| #ifdef ORC_ENABLE_UNSTABLE_API | | #ifdef ORC_ENABLE_UNSTABLE_API | |
| | | | |
| int get_file_int (const char *file, int *value); | | int get_file_int (const char *file, int *value); | |
| char * get_file (const char *file); | | char * get_file (const char *file); | |
| char * get_cpuinfo_line (char *cpuinfo, const char *tag); | | char * get_cpuinfo_line (char *cpuinfo, const char *tag); | |
| char * _strndup (const char *s, int n); | | char * _strndup (const char *s, int n); | |
|
| char ** strsplit (char *s); | | char ** strsplit (const char *s, char delimiter); | |
| char * get_tag_value (char *s, const char *tag); | | char * get_tag_value (char *s, const char *tag); | |
| | | | |
| #endif | | #endif | |
| | | | |
| ORC_END_DECLS | | ORC_END_DECLS | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 4 change blocks. |
| 11 lines changed or deleted | | 50 lines changed or added | |
|
| orcx86.h | | orcx86.h | |
| | | | |
| skipping to change at line 44 | | skipping to change at line 44 | |
| void orc_x86_emit_mov_memoffset_reg (OrcCompiler *compiler, int size, int o
ffset, int reg1, int reg2); | | void orc_x86_emit_mov_memoffset_reg (OrcCompiler *compiler, int size, int o
ffset, int reg1, int reg2); | |
| void orc_x86_emit_mov_reg_memoffset (OrcCompiler *compiler, int size, int r
eg1, int offset, int reg2); | | void orc_x86_emit_mov_reg_memoffset (OrcCompiler *compiler, int size, int r
eg1, int offset, int reg2); | |
| void orc_x86_emit_mov_imm_reg (OrcCompiler *compiler, int size, int value,
int reg1); | | void orc_x86_emit_mov_imm_reg (OrcCompiler *compiler, int size, int value,
int reg1); | |
| void orc_x86_emit_mov_reg_reg (OrcCompiler *compiler, int size, int reg1, i
nt reg2); | | void orc_x86_emit_mov_reg_reg (OrcCompiler *compiler, int size, int reg1, i
nt reg2); | |
| void orc_x86_emit_test_reg_reg (OrcCompiler *compiler, int size, int reg1,
int reg2); | | void orc_x86_emit_test_reg_reg (OrcCompiler *compiler, int size, int reg1,
int reg2); | |
| void orc_x86_emit_sar_imm_reg (OrcCompiler *compiler, int size, int value,
int reg); | | void orc_x86_emit_sar_imm_reg (OrcCompiler *compiler, int size, int value,
int reg); | |
| void orc_x86_emit_dec_memoffset (OrcCompiler *compiler, int size, int offse
t, int reg); | | void orc_x86_emit_dec_memoffset (OrcCompiler *compiler, int size, int offse
t, int reg); | |
| void orc_x86_emit_add_imm_memoffset (OrcCompiler *compiler, int size, int v
alue, int offset, int reg); | | void orc_x86_emit_add_imm_memoffset (OrcCompiler *compiler, int size, int v
alue, int offset, int reg); | |
| void orc_x86_emit_add_reg_memoffset (OrcCompiler *compiler, int size, int r
eg1, int offset, int reg); | | void orc_x86_emit_add_reg_memoffset (OrcCompiler *compiler, int size, int r
eg1, int offset, int reg); | |
| void orc_x86_emit_and_imm_memoffset (OrcCompiler *compiler, int size, int v
alue, int offset, int reg); | | void orc_x86_emit_and_imm_memoffset (OrcCompiler *compiler, int size, int v
alue, int offset, int reg); | |
|
| void orc_x86_emit_add_imm_reg (OrcCompiler *compiler, int size, int value,
int reg); | | void orc_x86_emit_add_imm_reg (OrcCompiler *compiler, int size, int value,
int reg, orc_bool record); | |
| void orc_x86_emit_and_imm_reg (OrcCompiler *compiler, int size, int value,
int reg); | | void orc_x86_emit_and_imm_reg (OrcCompiler *compiler, int size, int value,
int reg); | |
|
| | | void orc_x86_emit_or_imm_reg (OrcCompiler *compiler, int size, int value, i
nt reg); | |
| void orc_x86_emit_add_reg_reg (OrcCompiler *compiler, int size, int reg1, i
nt reg2); | | void orc_x86_emit_add_reg_reg (OrcCompiler *compiler, int size, int reg1, i
nt reg2); | |
| void orc_x86_emit_sub_reg_reg (OrcCompiler *compiler, int size, int reg1, i
nt reg2); | | void orc_x86_emit_sub_reg_reg (OrcCompiler *compiler, int size, int reg1, i
nt reg2); | |
| void orc_x86_emit_imul_memoffset_reg (OrcCompiler *compiler, int size, | | void orc_x86_emit_imul_memoffset_reg (OrcCompiler *compiler, int size, | |
| int offset, int reg, int destreg); | | int offset, int reg, int destreg); | |
| void orc_x86_emit_sub_memoffset_reg (OrcCompiler *compiler, int size, | | void orc_x86_emit_sub_memoffset_reg (OrcCompiler *compiler, int size, | |
| int offset, int reg, int destreg); | | int offset, int reg, int destreg); | |
| void orc_x86_emit_cmp_reg_memoffset (OrcCompiler *compiler, int size, int r
eg1, | | void orc_x86_emit_cmp_reg_memoffset (OrcCompiler *compiler, int size, int r
eg1, | |
| int offset, int reg); | | int offset, int reg); | |
| void orc_x86_emit_cmp_imm_memoffset (OrcCompiler *compiler, int size, int v
alue, | | void orc_x86_emit_cmp_imm_memoffset (OrcCompiler *compiler, int size, int v
alue, | |
| int offset, int reg); | | int offset, int reg); | |
| | | | |
End of changes. 2 change blocks. |
| 1 lines changed or deleted | | 2 lines changed or added | |
|