1 /* Various hacks to make code written for a dynamic code generator work
10 static inline int gen_new_qreg(int mode
)
16 if (free_qreg
> MAX_QREGS
) {
17 fprintf(stderr
, "qreg overflow\n");
20 return qreg
+ TARGET_NUM_QREGS
;
23 static inline int gen_im32(uint32_t i
)
25 int qreg
= gen_new_qreg(QMODE_I32
);
26 gen_op_mov32_im(qreg
, i
);
30 static inline void gen_op_ldf32(int dest
, int addr
)
32 gen_op_ld32(dest
, addr
);
35 static inline void gen_op_stf32(int addr
, int dest
)
37 gen_op_st32(addr
, dest
);
40 static inline void gen_op_pack_32_f32(int dest
, int src
)
42 gen_op_mov32(dest
, src
);
45 static inline void gen_op_pack_f32_32(int dest
, int src
)
47 gen_op_mov32(dest
, src
);
50 static inline void gen_op_flags_set(void)
55 static inline void gen_op_shl_im_cc(int val
, int shift
)
57 gen_op_shl_cc(val
, gen_im32(shift
));
60 static inline void gen_op_shr_im_cc(int val
, int shift
)
62 gen_op_shr_cc(val
, gen_im32(shift
));
65 static inline void gen_op_sar_im_cc(int val
, int shift
)
67 gen_op_sar_cc(val
, gen_im32(shift
));
70 #ifdef USE_DIRECT_JUMP
73 #define TBPARAM(x) (long)(x)
76 static inline void gen_op_goto_tb(int dummy
, int n
, long tb
)
79 gen_op_goto_tb0(TBPARAM(tb
));
81 gen_op_goto_tb1(TBPARAM(tb
));