6 #define TMP_ADDR 0x0001
10 #define LOC_SYM 0x0800
11 #define LOC_LOCAL 0x1000
12 #define LOC_MASK 0xff00
50 #define MIN(a, b) ((a) < (b) ? (a) : (b))
52 #define R_BYTEMASK (1 << R_RAX | 1 << R_RDX | 1 << R_RCX)
53 #define TMP_BT(t) ((t)->flags & TMP_ADDR ? 8 : (t)->bt)
54 #define TMP_REG(t) ((t)->flags & LOC_REG ? (t)->addr : reg_get(~0))
55 #define TMP_REG2(t, r) ((t)->flags & LOC_REG && (t)->addr != r ? \
56 (t)->addr : reg_get(~(1 << r)))
57 #define TMP_BYTEREG(t) ((t)->flags & LOC_REG && \
58 (1 << (t)->addr) & R_BYTEMASK ? \
59 (t)->addr : reg_get(R_BYTEMASK))
60 #define BT_TMPBT(bt) (BT_SZ(bt) >= 4 ? (bt) : (bt) & BT_SIGNED | 4)
62 static char buf
[SECSIZE
];
66 static long spsub_addr
;
78 static struct tmp
*regs
[NREGS
];
79 static int tmpregs
[] = {R_RAX
, R_RDI
, R_RSI
, R_RDX
, R_RCX
, R_R8
, R_R9
};
81 #define MAXRET (1 << 8)
83 static long ret
[MAXRET
];
89 static void putint(char *s
, long n
, int l
)
99 static void os(char *s
, int n
)
107 static void oi(long n
, int l
)
115 static long codeaddr(void)
120 static void o_op(int *op
, int nop
, int r1
, int r2
, unsigned bt
)
130 if (rex
|| (bt
& BT_SZMASK
) == 8)
132 if ((bt
& BT_SZMASK
) == 2)
134 if ((bt
& BT_SZMASK
) == 1)
136 for (i
= 0; i
< nop
; i
++)
140 static void memop(int *op
, int nop
, int src
, int base
, int off
, unsigned bt
)
142 int dis
= off
== (char) off
? 1 : 4;
143 int mod
= dis
== 4 ? 2 : 1;
144 o_op(op
, nop
, src
, base
, bt
);
147 oi((mod
<< 6) | ((src
& 0x07) << 3) | (base
& 0x07), 1);
152 static void memop1(int op
, int src
, int base
, int off
, unsigned bt
)
154 memop(&op
, 1, src
, base
, off
, bt
);
157 static void regop(int *op
, int nop
, int src
, int dst
, unsigned bt
)
159 o_op(op
, nop
, src
, dst
, bt
);
160 oi((3 << 6) | (src
<< 3) | (dst
& 0x07), 1);
163 static void regop1(int op
, int src
, int dst
, unsigned bt
)
165 regop(&op
, 1, src
, dst
, bt
);
168 static long sp_push(int size
)
176 #define LOC_NEW(f, l) (((f) & ~LOC_MASK) | (l))
178 static void tmp_mem(struct tmp
*tmp
)
181 if (!(tmp
->flags
& LOC_REG
))
185 tmp
->addr
= -sp_push(8);
186 memop1(MOV_R2X
, src
, R_RBP
, tmp
->addr
, BT_TMPBT(TMP_BT(tmp
)));
188 tmp
->flags
= LOC_NEW(tmp
->flags
, LOC_MEM
);
191 static int *movxx_x2r(int bt
)
193 static int movxx
[2] = {0x0f};
195 movxx
[1] = bt
& BT_SIGNED
? 0xbe : 0xb6;
197 movxx
[1] = bt
& BT_SIGNED
? 0xbf : 0xb7;
203 static void mov_r2r(int r1
, int r2
, unsigned bt1
, unsigned bt2
)
205 int s1
= bt1
& BT_SIGNED
;
206 int s2
= bt2
& BT_SIGNED
;
207 int sz1
= BT_SZ(bt1
);
208 int sz2
= BT_SZ(bt2
);
209 if (sz2
< 4 && (sz1
>= sz2
&& s1
!= s2
)) {
210 regop(movxx_x2r(bt2
), 2, r1
, r2
, 4);
213 if (sz1
== 4 && sz2
== 8) {
214 regop1(MOVSXD
, r1
, r2
, sz2
);
217 if (r1
!= r2
|| sz1
> sz2
)
218 regop1(MOV_R2X
, r1
, r2
, BT_TMPBT(bt2
));
221 static void mov_m2r(int dst
, int base
, int off
, int bt1
, int bt2
)
223 if (BT_SZ(bt1
) < 4) {
224 memop(movxx_x2r(bt1
), 2, dst
, base
, off
,
225 bt1
& BT_SIGNED
&& BT_SZ(bt2
) == 8 ? 8 : 4);
226 mov_r2r(dst
, dst
, bt1
, bt2
);
228 memop1(MOV_M2R
, dst
, base
, off
, bt1
);
229 mov_r2r(dst
, dst
, bt1
, bt2
);
233 static void num_cast(struct tmp
*t
, unsigned bt
)
235 if (!(bt
& BT_SIGNED
) && BT_SZ(bt
) != 8)
236 t
->addr
&= ((1l << (long) (BT_SZ(bt
) * 8)) - 1);
237 if (bt
& BT_SIGNED
&& BT_SZ(bt
) != 8 &&
238 t
->addr
> (1l << (BT_SZ(bt
) * 8 - 1)))
239 t
->addr
= -((1l << (BT_SZ(bt
) * 8)) - t
->addr
);
243 static void num_reg(int reg
, unsigned bt
, long num
)
245 int op
= MOV_I2R
+ (reg
& 7);
246 if (BT_SZ(bt
) == 8 && num
>= 0 && num
== (unsigned) num
)
248 o_op(&op
, 1, 0, reg
, bt
);
252 static void tmp_reg(struct tmp
*tmp
, int dst
, unsigned bt
, int deref
)
254 if (!(tmp
->flags
& TMP_ADDR
))
257 tmp
->flags
&= ~TMP_ADDR
;
258 if (tmp
->flags
& LOC_NUM
) {
260 tmp
->bt
= BT_TMPBT(bt
);
261 num_reg(dst
, tmp
->bt
, tmp
->addr
);
264 tmp
->flags
= LOC_NEW(tmp
->flags
, LOC_REG
);
266 if (tmp
->flags
& LOC_SYM
) {
267 regop1(MOV_I2X
, 0, dst
, TMP_BT(tmp
));
269 out_rela(tmp
->addr
, codeaddr(), 0);
273 tmp
->flags
= LOC_NEW(tmp
->flags
, LOC_REG
);
275 if (tmp
->flags
& LOC_REG
) {
277 mov_m2r(dst
, tmp
->addr
, 0, tmp
->bt
, bt
);
279 mov_r2r(tmp
->addr
, dst
, TMP_BT(tmp
), bt
);
280 regs
[tmp
->addr
] = NULL
;
282 tmp
->bt
= BT_TMPBT(bt
);
286 if (tmp
->flags
& LOC_LOCAL
) {
288 mov_m2r(dst
, R_RBP
, tmp
->addr
, tmp
->bt
, bt
);
290 memop1(LEA_M2R
, dst
, R_RBP
, tmp
->addr
, 8);
292 if (tmp
->flags
& LOC_MEM
) {
293 mov_m2r(dst
, R_RBP
, tmp
->addr
,
294 deref
? 8 : TMP_BT(tmp
), deref
? 8 : bt
);
296 mov_m2r(dst
, dst
, 0, tmp
->bt
, bt
);
299 tmp
->bt
= BT_TMPBT(bt
);
301 tmp
->flags
= LOC_NEW(tmp
->flags
, LOC_REG
);
304 static void reg_free(int reg
)
309 for (i
= 0; i
< ARRAY_SIZE(tmpregs
); i
++)
310 if (!regs
[tmpregs
[i
]]) {
311 tmp_reg(regs
[reg
], tmpregs
[i
], regs
[reg
]->bt
, 0);
317 static void reg_for(int reg
, struct tmp
*t
)
319 if (regs
[reg
] && regs
[reg
] != t
)
323 static void tmp_pop_bt(unsigned bt
, int reg
)
325 struct tmp
*t
= &tmp
[--ntmp
];
327 tmp_reg(t
, reg
, bt
, 1);
331 static unsigned tmp_pop(int deref
, int reg
)
333 struct tmp
*t
= &tmp
[--ntmp
];
335 tmp_reg(t
, reg
, deref
? t
->bt
: TMP_BT(t
), deref
);
340 static void tmp_push_reg(unsigned bt
, unsigned reg
)
342 struct tmp
*t
= &tmp
[ntmp
++];
349 void o_local(long addr
, unsigned bt
)
351 struct tmp
*t
= &tmp
[ntmp
++];
354 t
->flags
= LOC_LOCAL
| TMP_ADDR
;
357 void o_num(long num
, unsigned bt
)
359 struct tmp
*t
= &tmp
[ntmp
++];
365 void o_symaddr(long addr
, unsigned bt
)
367 struct tmp
*t
= &tmp
[ntmp
++];
370 t
->flags
= LOC_SYM
| TMP_ADDR
;
373 void o_tmpdrop(int n
)
376 if (n
== -1 || n
> ntmp
)
379 for (i
= ntmp
; i
< ntmp
+ n
; i
++)
380 if (tmp
[i
].flags
& LOC_REG
)
381 regs
[tmp
[i
].addr
] = NULL
;
389 #define FORK_REG R_RAX
393 struct tmp
*t
= &tmp
[ntmp
- 1];
394 reg_for(FORK_REG
, t
);
395 tmp_reg(t
, FORK_REG
, t
->bt
, 0);
401 struct tmp
*t
= &tmp
[ntmp
- 1];
402 reg_for(FORK_REG
, t
);
403 tmp_reg(t
, FORK_REG
, t
->bt
, 0);
408 struct tmp
*t1
= &tmp
[ntmp
- 1];
409 struct tmp
*t2
= &tmp
[ntmp
- 2];
411 memcpy(&t
, t1
, sizeof(t
));
412 memcpy(t1
, t2
, sizeof(t
));
413 memcpy(t2
, &t
, sizeof(t
));
416 static int reg_get(int mask
)
419 for (i
= 0; i
< ARRAY_SIZE(tmpregs
); i
++)
420 if ((1 << tmpregs
[i
]) & mask
&& !regs
[tmpregs
[i
]])
422 for (i
= 0; i
< ARRAY_SIZE(tmpregs
); i
++)
423 if ((1 << tmpregs
[i
]) & mask
) {
424 reg_free(tmpregs
[i
]);
432 struct tmp
*t1
= &tmp
[ntmp
- 1];
433 struct tmp
*t2
= &tmp
[ntmp
++];
434 memcpy(t2
, t1
, sizeof(*t1
));
435 if (!(t1
->flags
& (LOC_REG
| LOC_MEM
)))
437 if (t1
->flags
& LOC_MEM
) {
438 tmp_reg(t2
, reg_get(~0), t2
->bt
, 0);
439 } else if (t1
->flags
& LOC_REG
) {
440 t2
->addr
= reg_get(~t1
->addr
);
441 regop1(MOV_R2X
, t1
->addr
, t2
->addr
, BT_TMPBT(TMP_BT(tmp
)));
443 t2
->flags
= t1
->flags
;
446 void o_cast(unsigned bt
)
448 struct tmp
*t
= &tmp
[ntmp
- 1];
452 if (t
->flags
& LOC_NUM
) {
456 reg
= BT_SZ(bt
) == 1 ? TMP_BYTEREG(t
) : TMP_REG(t
);
458 tmp_push_reg(bt
, reg
);
461 long o_func_beg(char *name
, int global
)
463 long addr
= out_func_beg(name
, global
);
465 os("\x55", 1); /* push %rbp */
466 os("\x48\x89\xe5", 3); /* mov %rsp, %rbp */
473 memset(regs
, 0, sizeof(regs
));
474 os("\x48\x81\xec", 3); /* sub $xxx, %rsp */
475 spsub_addr
= codeaddr();
480 void o_deref(unsigned bt
)
482 struct tmp
*t
= &tmp
[ntmp
- 1];
483 if (t
->flags
& TMP_ADDR
)
484 tmp_reg(t
, TMP_REG(t
), 8, 1);
486 t
->flags
|= TMP_ADDR
;
491 struct tmp
*t
= &tmp
[ntmp
- 1];
492 tmp_reg(t
, TMP_REG(t
), t
->bt
, 1);
495 static unsigned bt_op(unsigned bt1
, unsigned bt2
)
497 unsigned s1
= BT_SZ(bt1
);
498 unsigned s2
= BT_SZ(bt2
);
499 unsigned bt
= (bt1
| bt2
) & BT_SIGNED
| (s1
> s2
? s1
: s2
);
503 #define TMP_CONST(t) ((t)->flags & LOC_NUM && !((t)->flags & TMP_ADDR))
505 int o_popnum(long *c
)
507 struct tmp
*t
= &tmp
[ntmp
- 1];
515 #define LOCAL_PTR(t) ((t)->flags & LOC_LOCAL && !((t)->flags & TMP_ADDR))
517 static int c_binop(long (*cop
)(long a
, long b
, unsigned bt
), unsigned bt
)
519 struct tmp
*t1
= &tmp
[ntmp
- 1];
520 struct tmp
*t2
= &tmp
[ntmp
- 2];
521 int locals
= LOCAL_PTR(t1
) + LOCAL_PTR(t2
);
523 if (!TMP_CONST(t1
) && !LOCAL_PTR(t1
) || !TMP_CONST(t2
) && !LOCAL_PTR(t2
))
527 bt
= bt_op(t1
->bt
, t2
->bt
);
533 ret
= cop(t2
->addr
, t1
->addr
, locals
? 4 | BT_SIGNED
: bt
);
544 static int c_op(long (*cop
)(long a
, unsigned bt
), unsigned bt
)
546 struct tmp
*t1
= &tmp
[ntmp
- 1];
552 ret
= cop(t1
->addr
, bt
);
558 static void shx(int uop
, int sop
)
560 struct tmp
*t
= &tmp
[ntmp
- 2];
562 unsigned reg
= TMP_REG2(t
, R_RCX
);
564 bt
= tmp_pop(1, reg
);
565 regop1(SHX_REG
, bt
& BT_SIGNED
? sop
: uop
, reg
, BT_TMPBT(bt
));
566 tmp_push_reg(bt
, reg
);
569 static long c_shl(long a
, long b
, unsigned bt
)
576 if (!c_binop(c_shl
, 0))
581 static long c_shr(long a
, long b
, unsigned bt
)
586 return (unsigned long) a
>> b
;
591 if (!c_binop(c_shr
, 0))
596 static int mulop(int uop
, int sop
, int reg
)
598 struct tmp
*t1
= &tmp
[ntmp
- 1];
599 struct tmp
*t2
= &tmp
[ntmp
- 2];
600 int bt1
= TMP_BT(t1
);
601 int bt2
= TMP_BT(t2
);
602 int bt
= bt_op(bt1
, bt2
);
603 if (t1
->flags
& LOC_REG
&& t1
->addr
!= R_RAX
&& t1
->addr
!= R_RDX
)
606 tmp_reg(t1
, reg
, bt
, 1);
608 tmp_reg(t2
, R_RAX
, bt
, 1);
612 regop1(MUL_A2X
, bt
& BT_SIGNED
? sop
: uop
, reg
, BT_TMPBT(bt2
));
616 static long c_mul(long a
, long b
, unsigned bt
)
624 if (!c_binop(c_mul
, 0))
626 bt
= mulop(4, 5, R_RDX
);
627 tmp_push_reg(bt
, R_RAX
);
630 static long c_div(long a
, long b
, unsigned bt
)
638 if (!c_binop(c_div
, 0))
640 bt
= mulop(6, 7, R_RCX
);
641 tmp_push_reg(bt
, R_RAX
);
644 static long c_mod(long a
, long b
, unsigned bt
)
652 if (!c_binop(c_mod
, 0))
654 bt
= mulop(6, 7, R_RCX
);
655 tmp_push_reg(bt
, R_RDX
);
660 tmp
[ntmp
- 1].flags
&= ~TMP_ADDR
;
661 tmp
[ntmp
- 1].bt
= 8;
664 void o_ret(unsigned bt
)
667 tmp_pop_bt(bt
, R_RAX
);
669 os("\x31\xc0", 2); /* xor %eax, %eax */
670 ret
[nret
++] = o_jmp(0);
673 static int binop(int op
, int *reg
)
675 struct tmp
*t1
= &tmp
[ntmp
- 1];
676 struct tmp
*t2
= &tmp
[ntmp
- 2];
680 *reg
= TMP_REG2(t2
, r1
);
681 bt
= bt_op(t1
->bt
, t2
->bt
);
683 tmp_pop_bt(bt
, *reg
);
684 regop1(op
, *reg
, r1
, bt
);
688 static long c_add(long a
, long b
, unsigned bt
)
697 if (!c_binop(c_add
, 0))
699 bt
= binop(ADD_R2X
, ®
);
700 tmp_push_reg(bt
, reg
);
703 static long c_xor(long a
, long b
, unsigned bt
)
712 if (!c_binop(c_xor
, 0))
714 bt
= binop(XOR_R2X
, ®
);
715 tmp_push_reg(bt
, reg
);
718 static long c_and(long a
, long b
, unsigned bt
)
727 if (!c_binop(c_and
, 0))
729 bt
= binop(AND_R2X
, ®
);
730 tmp_push_reg(bt
, reg
);
733 static long c_or(long a
, long b
, unsigned bt
)
742 if (!c_binop(c_or
, 0))
744 bt
= binop(OR_R2X
, ®
);
745 tmp_push_reg(bt
, reg
);
748 static long c_sub(long a
, long b
, unsigned bt
)
757 if (!c_binop(c_sub
, 0))
759 bt
= binop(SUB_R2X
, ®
);
760 tmp_push_reg(bt
, reg
);
763 static void o_cmp(int uop
, int sop
)
765 char set
[] = "\x0f\x00\xc0";
767 int bt
= binop(CMP_R2X
, ®
);
768 set
[1] = bt
& BT_SIGNED
? sop
: uop
;
770 cmp_setl
= codeaddr();
771 os(set
, 3); /* setl %al */
772 os("\x0f\xb6\xc0", 3); /* movzbl %al, %eax */
773 tmp_push_reg(4 | BT_SIGNED
, R_RAX
);
774 cmp_last
= codeaddr();
777 static long c_lt(long a
, long b
, unsigned bt
)
784 if (!c_binop(c_lt
, 4))
789 static long c_gt(long a
, long b
, unsigned bt
)
796 if (!c_binop(c_gt
, 4))
801 static long c_le(long a
, long b
, unsigned bt
)
808 if (!c_binop(c_le
, 4))
813 static long c_ge(long a
, long b
, unsigned bt
)
820 if (!c_binop(c_ge
, 4))
825 static long c_eq(long a
, long b
, unsigned bt
)
832 if (!c_binop(c_eq
, 4))
837 static long c_neq(long a
, long b
, unsigned bt
)
844 if (!c_binop(c_neq
, 4))
849 static long c_lnot(long a
, unsigned bt
)
856 if (!c_op(c_lnot
, 4))
858 if (cmp_last
== codeaddr()) {
859 buf
[cmp_setl
+ 1] ^= 0x10;
861 o_num(0, 4 | BT_SIGNED
);
866 static long c_neg(long a
, unsigned bt
)
873 struct tmp
*t
= &tmp
[ntmp
- 1];
875 unsigned bt
= BT_TMPBT(t
->bt
);
876 if (!c_op(c_neg
, t
->bt
| BT_SIGNED
))
880 regop1(NEG_REG
, 3, reg
, bt
);
881 tmp_push_reg(bt
, reg
);
884 static long c_not(long a
, unsigned bt
)
891 struct tmp
*t
= &tmp
[ntmp
- 1];
893 unsigned bt
= BT_TMPBT(t
->bt
);
898 regop1(NOT_REG
, 2, reg
, bt
);
899 tmp_push_reg(t
->bt
, reg
);
902 void o_func_end(void)
905 for (i
= 0; i
< nret
; i
++)
907 os("\xc9\xc3", 2); /* leave; ret; */
908 putint(buf
+ spsub_addr
, (maxsp
+ 7) & ~0x07, 4);
909 out_func_end(buf
, cur
- buf
);
912 long o_mklocal(int size
)
914 return sp_push((size
+ 7) & ~0x07);
917 void o_rmlocal(long addr
, int sz
)
922 static int arg_regs
[] = {R_RDI
, R_RSI
, R_RDX
, R_RCX
, R_R8
, R_R9
};
924 #define R_NARGS ARRAY_SIZE(arg_regs)
926 long o_arg(int i
, unsigned bt
)
930 addr
= o_mklocal(BT_SZ(bt
));
931 memop1(MOV_R2X
, arg_regs
[i
], R_RBP
, -addr
, bt
);
933 addr
= -8 * (i
- R_NARGS
+ 2);
938 void o_assign(unsigned bt
)
940 struct tmp
*t1
= &tmp
[ntmp
- 1];
941 struct tmp
*t2
= &tmp
[ntmp
- 2];
942 int r1
= BT_SZ(bt
) > 1 ? TMP_REG(t1
) : TMP_BYTEREG(t1
);
945 tmp_pop_bt(BT_TMPBT(bt
), r1
);
946 if (t2
->flags
& LOC_LOCAL
) {
951 reg
= TMP_REG2(t2
, r1
);
955 memop1(MOV_R2X
, r1
, reg
, off
, bt
);
956 tmp_push_reg(bt
, r1
);
959 static void tmp_to(struct tmp
*t
, int reg
)
962 tmp_reg(t
, reg
, t
->bt
, 0);
965 void o_memcpy(int sz
)
967 struct tmp
*t0
= &tmp
[ntmp
];
968 struct tmp
*t1
= &tmp
[ntmp
- 1];
969 struct tmp
*t2
= &tmp
[ntmp
- 2];
974 os("\xf3\xa4", 2); /* rep movs */
978 void o_memset(int x
, int sz
)
980 struct tmp
*t0
= &tmp
[ntmp
+ 1];
981 struct tmp
*t1
= &tmp
[ntmp
];
982 struct tmp
*t2
= &tmp
[ntmp
- 1];
988 os("\xf3\xaa", 2); /* rep stosb */
997 static long jx(int x
, long addr
)
1001 os(op
, 2); /* jx $addr */
1002 oi(addr
- codeaddr() - 4, 4);
1003 return codeaddr() - 4;
1006 static long jxtest(int x
, long addr
)
1008 int bt
= tmp_pop(1, R_RAX
);
1009 regop1(TEST_R2R
, R_RAX
, R_RAX
, bt
);
1013 static long jxcmp(long addr
, int inv
)
1016 if (codeaddr() != cmp_last
)
1019 cur
= buf
+ cmp_setl
;
1020 x
= (unsigned char) buf
[cmp_setl
+ 1];
1021 return jx((inv
? x
: x
^ 0x01) & ~0x10, addr
);
1024 long o_jz(long addr
)
1026 long ret
= jxcmp(addr
, 0);
1027 return ret
!= -1 ? ret
: jxtest(0x84, addr
);
1030 long o_jnz(long addr
)
1032 long ret
= jxcmp(addr
, 1);
1033 return ret
!= -1 ? ret
: jxtest(0x85, addr
);
1036 long o_jmp(long addr
)
1038 os("\xe9", 1); /* jmp $addr */
1039 oi(addr
- codeaddr() - 4, 4);
1040 return codeaddr() - 4;
1043 void o_filljmp2(long addr
, long jmpdst
)
1045 putint(buf
+ addr
, jmpdst
- addr
- 4, 4);
1048 void o_filljmp(long addr
)
1050 o_filljmp2(addr
, codeaddr());
1053 void o_call(int argc
, unsigned *bt
, unsigned ret_bt
)
1057 for (i
= 0; i
< ARRAY_SIZE(tmpregs
); i
++)
1058 if (regs
[i
] && (tmp
- regs
[i
]) < ntmp
- argc
)
1060 if (argc
> R_NARGS
) {
1061 long addr
= sp_push(8 * (argc
- R_NARGS
));
1062 for (i
= argc
- 1; i
>= R_NARGS
; --i
) {
1063 int reg
= TMP_REG(&tmp
[ntmp
- 1]);
1064 tmp_pop_bt(bt
[i
], reg
);
1065 memop1(MOV_R2X
, reg
, R_RBP
,
1066 -(addr
- (i
- R_NARGS
) * 8), BT_TMPBT(bt
[i
]));
1069 for (i
= MIN(argc
, R_NARGS
) - 1; i
>= 0; i
--)
1070 tmp_pop_bt(bt
[i
], arg_regs
[i
]);
1072 if (t
->flags
& LOC_SYM
) {
1073 os("\x31\xc0", 2); /* xor %eax, %eax */
1074 os("\xe8", 1); /* call $x */
1076 out_rela(t
->addr
, codeaddr(), 1);
1081 regop1(CALL_REG
, 2, R_RAX
, 4);
1084 tmp_push_reg(ret_bt
, R_RAX
);