-/* M_RECOMPUTE_PV:
- used to recompute our PV (we use the IP for this) out of the current PC
- ATTENTION: if you change this, you have to look at other functions as well!
- Following things depend on it: md_codegen_get_pv_from_pc();
-*/
-#define M_RECOMPUTE_PV(disp) \
- disp += 8; /* we use PC relative addr. */ \
- assert((disp & 0x03) == 0); \
- assert(disp >= 0 && disp <= 0x03ffffff); \
- if (disp > 0x0003ffff) { \
- M_SUB_IMM(REG_PV, REG_PC, IMM_ROTL(disp >> 18, 9)); \
- M_SUB_IMM(REG_PV, REG_PV, IMM_ROTL(disp >> 10, 5)); \
- M_SUB_IMM(REG_PV, REG_PV, IMM_ROTL(disp >> 2, 1)); \
- } else if (disp > 0x000003ff) { \
- M_SUB_IMM(REG_PV, REG_PC, IMM_ROTL(disp >> 10, 5)); \
- M_SUB_IMM(REG_PV, REG_PV, IMM_ROTL(disp >> 2, 1)); \
- } else { \
- M_SUB_IMM(REG_PV, REG_PC, IMM_ROTL(disp >> 2, 1)); \
- }
-
-/* M_INTMOVE:
- generates an integer-move from register a to b.
- if a and b are the same int-register, no code will be generated.
-*/
-
-#define M_INTMOVE(a,b) \
- do { \
- if ((a) != (b)) \
- M_MOV(b, a); \
- } while (0)
-
-#define M_LNGMOVE(a,b) \
- do { \
- if (GET_HIGH_REG(a) == GET_LOW_REG(b)) { \
- assert((GET_LOW_REG(a) != GET_HIGH_REG(b))); \
- M_INTMOVE(GET_HIGH_REG(a), GET_HIGH_REG(b)); \
- M_INTMOVE(GET_LOW_REG(a), GET_LOW_REG(b)); \
- } else { \
- M_INTMOVE(GET_LOW_REG(a), GET_LOW_REG(b)); \
- M_INTMOVE(GET_HIGH_REG(a), GET_HIGH_REG(b)); \
- } \
- } while (0)
-
-
-/* M_COMPARE:
- generates the compare part of an if-sequece
- uses M_CMP or M_CMP_IMM to do the compare
- ATTENTION: uses REG_ITMP3 as intermediate register
-*/
-#define M_COMPARE(reg, val) \
- if (IS_IMM(val)) { \
- M_CMP_IMM(reg, (val)); \
- } else if(IS_IMM(-(val))) { \
- M_CMN_IMM(reg, -(val)); \
- } else { \
- ICONST(REG_ITMP3, (val)); \
- M_CMP(reg, REG_ITMP3); \
- }
-