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
;
69 #define TMP(i) (&tmps[ntmp - 1 - (i)])
73 long off
; /* used for LOC_SYM; offset from a symbol address */
81 static struct tmp
*regs
[NREGS
];
82 static int tmpregs
[] = {R_RAX
, R_RDI
, R_RSI
, R_RDX
, R_RCX
, R_R8
, R_R9
};
84 #define MAXRET (1 << 8)
86 static long ret
[MAXRET
];
92 static void putint(char *s
, long n
, int l
)
102 static void os(char *s
, int n
)
110 static void oi(long n
, int l
)
118 static long codeaddr(void)
123 static void o_op(int *op
, int nop
, int r1
, int r2
, unsigned bt
)
133 if (rex
|| (bt
& BT_SZMASK
) == 8)
135 if ((bt
& BT_SZMASK
) == 2)
137 if ((bt
& BT_SZMASK
) == 1)
139 for (i
= 0; i
< nop
; i
++)
143 static void memop(int *op
, int nop
, int src
, int base
, int off
, unsigned bt
)
145 int dis
= off
== (char) off
? 1 : 4;
146 int mod
= dis
== 4 ? 2 : 1;
147 o_op(op
, nop
, src
, base
, bt
);
150 oi((mod
<< 6) | ((src
& 0x07) << 3) | (base
& 0x07), 1);
155 static void memop1(int op
, int src
, int base
, int off
, unsigned bt
)
157 memop(&op
, 1, src
, base
, off
, bt
);
160 static void regop(int *op
, int nop
, int src
, int dst
, unsigned bt
)
162 o_op(op
, nop
, src
, dst
, bt
);
163 oi((3 << 6) | (src
<< 3) | (dst
& 0x07), 1);
166 static void regop1(int op
, int src
, int dst
, unsigned bt
)
168 regop(&op
, 1, src
, dst
, bt
);
171 static long sp_push(int size
)
179 #define LOC_NEW(f, l) (((f) & ~LOC_MASK) | (l))
181 static void tmp_mem(struct tmp
*tmp
)
184 if (!(tmp
->flags
& LOC_REG
))
188 tmp
->addr
= -sp_push(8);
189 memop1(MOV_R2X
, src
, R_RBP
, tmp
->addr
, BT_TMPBT(TMP_BT(tmp
)));
191 tmp
->flags
= LOC_NEW(tmp
->flags
, LOC_MEM
);
194 static int *movxx_x2r(int bt
)
196 static int movxx
[2] = {0x0f};
198 movxx
[1] = bt
& BT_SIGNED
? 0xbe : 0xb6;
200 movxx
[1] = bt
& BT_SIGNED
? 0xbf : 0xb7;
206 static void mov_r2r(int r1
, int r2
, unsigned bt1
, unsigned bt2
)
208 int s1
= bt1
& BT_SIGNED
;
209 int s2
= bt2
& BT_SIGNED
;
210 int sz1
= BT_SZ(bt1
);
211 int sz2
= BT_SZ(bt2
);
212 if (sz2
< 4 && (sz1
>= sz2
&& s1
!= s2
)) {
213 regop(movxx_x2r(bt2
), 2, r1
, r2
, 4);
216 if (sz1
== 4 && sz2
== 8) {
217 regop1(MOVSXD
, r2
, r1
, sz2
);
220 if (r1
!= r2
|| sz1
> sz2
)
221 regop1(MOV_R2X
, r1
, r2
, BT_TMPBT(bt2
));
224 static void mov_m2r(int dst
, int base
, int off
, int bt1
, int bt2
)
226 if (BT_SZ(bt1
) < 4) {
227 memop(movxx_x2r(bt1
), 2, dst
, base
, off
,
228 bt1
& BT_SIGNED
&& BT_SZ(bt2
) == 8 ? 8 : 4);
229 mov_r2r(dst
, dst
, bt1
, bt2
);
231 memop1(MOV_M2R
, dst
, base
, off
, bt1
);
232 mov_r2r(dst
, dst
, bt1
, bt2
);
236 static void num_cast(struct tmp
*t
, unsigned bt
)
238 if (!(bt
& BT_SIGNED
) && BT_SZ(bt
) != 8)
239 t
->addr
&= ((1l << (long) (BT_SZ(bt
) * 8)) - 1);
240 if (bt
& BT_SIGNED
&& BT_SZ(bt
) != 8 &&
241 t
->addr
> (1l << (BT_SZ(bt
) * 8 - 1)))
242 t
->addr
= -((1l << (BT_SZ(bt
) * 8)) - t
->addr
);
246 static void num_reg(int reg
, unsigned bt
, long num
)
248 int op
= MOV_I2R
+ (reg
& 7);
249 if (BT_SZ(bt
) == 8 && num
>= 0 && num
== (unsigned) num
)
251 o_op(&op
, 1, 0, reg
, bt
);
255 static void tmp_reg(struct tmp
*tmp
, int dst
, unsigned bt
, int deref
)
257 if (deref
&& tmp
->flags
& TMP_ADDR
)
258 tmp
->flags
&= ~TMP_ADDR
;
261 if (tmp
->flags
& LOC_NUM
) {
263 tmp
->bt
= BT_TMPBT(bt
);
264 num_reg(dst
, tmp
->bt
, tmp
->addr
);
267 tmp
->flags
= LOC_NEW(tmp
->flags
, LOC_REG
);
269 if (tmp
->flags
& LOC_SYM
) {
270 regop1(MOV_I2X
, 0, dst
, TMP_BT(tmp
));
272 out_rela(tmp
->addr
, codeaddr(), 0);
276 tmp
->flags
= LOC_NEW(tmp
->flags
, LOC_REG
);
278 if (tmp
->flags
& LOC_REG
) {
280 mov_m2r(dst
, tmp
->addr
, 0, tmp
->bt
, bt
);
282 mov_r2r(tmp
->addr
, dst
, TMP_BT(tmp
),
283 tmp
->flags
& TMP_ADDR
? 8 : bt
);
284 regs
[tmp
->addr
] = NULL
;
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
= tmp
->flags
& TMP_ADDR
? 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_mv(struct tmp
*t
, int reg
)
326 tmp_reg(t
, reg
, t
->bt
, 0);
329 static void tmp_to(struct tmp
*t
, int reg
, int bt
)
332 tmp_reg(t
, reg
, bt
? bt
: t
->bt
, 1);
335 static void tmp_drop(int n
)
338 for (i
= ntmp
- n
; i
< ntmp
; i
++)
339 if (tmps
[i
].flags
& LOC_REG
)
340 regs
[tmps
[i
].addr
] = NULL
;
345 static int tmp_pop(int reg
, int bt
)
347 struct tmp
*t
= TMP(0);
353 static struct tmp
*tmp_new(void)
356 return &tmps
[ntmp
++];
359 static void tmp_push(int reg
, unsigned bt
)
361 struct tmp
*t
= tmp_new();
368 void o_local(long addr
, unsigned bt
)
370 struct tmp
*t
= tmp_new();
373 t
->flags
= LOC_LOCAL
| TMP_ADDR
;
376 void o_num(long num
, unsigned bt
)
378 struct tmp
*t
= tmp_new();
384 void o_symaddr(long addr
, unsigned bt
)
386 struct tmp
*t
= tmp_new();
389 t
->flags
= LOC_SYM
| TMP_ADDR
;
393 void o_tmpdrop(int n
)
396 if (n
== -1 || n
> ntmp
)
406 #define FORK_REG R_RAX
410 tmp_pop(FORK_REG
, 0);
415 tmp_to(TMP(0), FORK_REG
, 0);
420 struct tmp
*t1
= TMP(0);
421 struct tmp
*t2
= TMP(1);
423 memcpy(&t
, t1
, sizeof(t
));
424 memcpy(t1
, t2
, sizeof(t
));
425 memcpy(t2
, &t
, sizeof(t
));
426 if (t1
->flags
& LOC_REG
)
428 if (t2
->flags
& LOC_REG
)
432 static int reg_get(int mask
)
435 for (i
= 0; i
< ARRAY_SIZE(tmpregs
); i
++)
436 if ((1 << tmpregs
[i
]) & mask
&& !regs
[tmpregs
[i
]])
438 for (i
= 0; i
< ARRAY_SIZE(tmpregs
); i
++)
439 if ((1 << tmpregs
[i
]) & mask
) {
440 reg_free(tmpregs
[i
]);
448 struct tmp
*t1
= TMP(0);
449 struct tmp
*t2
= tmp_new();
450 memcpy(t2
, t1
, sizeof(*t1
));
451 if (!(t1
->flags
& (LOC_REG
| LOC_MEM
)))
453 if (t1
->flags
& LOC_MEM
) {
454 tmp_reg(t2
, reg_get(~0), t2
->bt
, 0);
455 } else if (t1
->flags
& LOC_REG
) {
456 t2
->addr
= reg_get(~(1 << t1
->addr
));
457 regop1(MOV_R2X
, t1
->addr
, t2
->addr
, BT_TMPBT(TMP_BT(t1
)));
460 t2
->flags
= t1
->flags
;
463 void o_cast(unsigned bt
)
465 struct tmp
*t
= TMP(0);
469 if (t
->flags
& LOC_NUM
) {
473 reg
= BT_SZ(bt
) == 1 ? TMP_BYTEREG(t
) : TMP_REG(t
);
477 long o_func_beg(char *name
, int global
)
479 long addr
= out_func_beg(name
, global
);
481 os("\x55", 1); /* push %rbp */
482 os("\x48\x89\xe5", 3); /* mov %rsp, %rbp */
489 memset(regs
, 0, sizeof(regs
));
490 os("\x48\x81\xec", 3); /* sub $xxx, %rsp */
491 spsub_addr
= codeaddr();
496 void o_deref(unsigned bt
)
498 struct tmp
*t
= TMP(0);
499 if (t
->flags
& TMP_ADDR
)
500 tmp_to(t
, TMP_REG(t
), t
->bt
);
502 t
->flags
|= TMP_ADDR
;
507 struct tmp
*t
= TMP(0);
508 tmp_to(t
, TMP_REG(t
), t
->bt
);
511 static unsigned bt_op(unsigned bt1
, unsigned bt2
)
513 unsigned s1
= BT_SZ(bt1
);
514 unsigned s2
= BT_SZ(bt2
);
515 unsigned bt
= (bt1
| bt2
) & BT_SIGNED
| (s1
> s2
? s1
: s2
);
519 #define TMP_CONST(t) ((t)->flags & LOC_NUM && !((t)->flags & TMP_ADDR))
520 #define LOCAL_PTR(t) ((t)->flags & LOC_LOCAL && !((t)->flags & TMP_ADDR))
521 #define SYM_PTR(t) ((t)->flags & LOC_LOCAL && !((t)->flags & TMP_ADDR))
523 int o_popnum(long *c
)
525 struct tmp
*t
= TMP(0);
533 static int c_binop(long (*cop
)(long a
, long b
, unsigned bt
), unsigned bt
)
535 struct tmp
*t1
= TMP(0);
536 struct tmp
*t2
= TMP(1);
537 int locals
= LOCAL_PTR(t1
) + LOCAL_PTR(t2
);
538 int syms
= SYM_PTR(t1
) + SYM_PTR(t2
);
539 int nums
= TMP_CONST(t1
) + TMP_CONST(t2
);
540 if (syms
== 2 || syms
&& locals
|| syms
+ nums
+ locals
!= 2)
544 bt
= syms
? 8 : bt_op(t1
->bt
, t2
->bt
);
551 long o1
= SYM_PTR(t1
) ? t1
->off
: t1
->addr
;
552 long o2
= SYM_PTR(t2
) ? t2
->off
: t2
->addr
;
553 long ret
= cop(o2
, o1
, bt
);
559 long ret
= cop(t2
->addr
, t1
->addr
, locals
? 4 | BT_SIGNED
: bt
);
571 static int c_op(long (*cop
)(long a
, unsigned bt
), unsigned bt
)
573 struct tmp
*t1
= TMP(0);
579 ret
= cop(t1
->addr
, bt
);
585 static void shx(int uop
, int sop
)
587 struct tmp
*t2
= TMP(1);
588 int r2
= TMP_REG2(t2
, R_RCX
);
592 regop1(SHX_REG
, bt
& BT_SIGNED
? sop
: uop
, r2
, BT_TMPBT(bt
));
596 static long c_shl(long a
, long b
, unsigned bt
)
603 if (!c_binop(c_shl
, 0))
608 static long c_shr(long a
, long b
, unsigned bt
)
613 return (unsigned long) a
>> b
;
618 if (!c_binop(c_shr
, 0))
623 static int mulop(int uop
, int sop
, int reg
)
625 struct tmp
*t1
= TMP(0);
626 struct tmp
*t2
= TMP(1);
627 int bt1
= TMP_BT(t1
);
628 int bt2
= TMP_BT(t2
);
629 int bt
= bt_op(bt1
, bt2
);
630 if (t1
->flags
& LOC_REG
&& t1
->addr
!= R_RAX
&& t1
->addr
!= R_RDX
)
633 tmp_to(t2
, R_RAX
, bt
);
638 o_op(&cqo
, 1, R_RAX
, R_RDX
, bt
);
640 regop1(XOR_R2X
, R_RDX
, R_RDX
, bt
);
643 regop1(MUL_A2X
, bt
& BT_SIGNED
? sop
: uop
, reg
, BT_TMPBT(bt2
));
647 static long c_mul(long a
, long b
, unsigned bt
)
655 if (!c_binop(c_mul
, 0))
657 bt
= mulop(4, 5, R_RDX
);
661 static long c_div(long a
, long b
, unsigned bt
)
669 if (!c_binop(c_div
, 0))
671 bt
= mulop(6, 7, R_RCX
);
675 static long c_mod(long a
, long b
, unsigned bt
)
683 if (!c_binop(c_mod
, 0))
685 bt
= mulop(6, 7, R_RCX
);
691 tmps
[ntmp
- 1].flags
&= ~TMP_ADDR
;
692 tmps
[ntmp
- 1].bt
= 8;
695 void o_ret(unsigned bt
)
700 os("\x31\xc0", 2); /* xor %eax, %eax */
701 ret
[nret
++] = o_jmp(0);
704 static int binop(int op
, int *reg
)
706 struct tmp
*t1
= TMP(0);
707 struct tmp
*t2
= TMP(1);
709 unsigned bt
= bt_op(t1
->bt
, t2
->bt
);
711 r2
= TMP_REG2(t2
, r1
);
714 regop1(op
, r2
, r1
, bt
);
719 static long c_add(long a
, long b
, unsigned bt
)
728 if (!c_binop(c_add
, 0))
730 bt
= binop(ADD_R2X
, ®
);
734 static long c_xor(long a
, long b
, unsigned bt
)
743 if (!c_binop(c_xor
, 0))
745 bt
= binop(XOR_R2X
, ®
);
749 static long c_and(long a
, long b
, unsigned bt
)
758 if (!c_binop(c_and
, 0))
760 bt
= binop(AND_R2X
, ®
);
764 static long c_or(long a
, long b
, unsigned bt
)
773 if (!c_binop(c_or
, 0))
775 bt
= binop(OR_R2X
, ®
);
779 static long c_sub(long a
, long b
, unsigned bt
)
788 if (!c_binop(c_sub
, 0))
790 bt
= binop(SUB_R2X
, ®
);
794 static void o_cmp(int uop
, int sop
)
796 struct tmp
*t1
= TMP(0);
797 struct tmp
*t2
= TMP(1);
798 char set
[] = "\x0f\x00\xc0";
801 if (regs
[R_RAX
] && regs
[R_RAX
] != t1
&& regs
[R_RAX
] != t2
)
803 bt
= binop(CMP_R2X
, ®
);
804 set
[1] = bt
& BT_SIGNED
? sop
: uop
;
805 cmp_setl
= codeaddr();
806 os(set
, 3); /* setl %al */
807 os("\x0f\xb6\xc0", 3); /* movzbl %al, %eax */
808 tmp_push(R_RAX
, 4 | BT_SIGNED
);
809 cmp_last
= codeaddr();
812 static long c_lt(long a
, long b
, unsigned bt
)
819 if (!c_binop(c_lt
, 4))
824 static long c_gt(long a
, long b
, unsigned bt
)
831 if (!c_binop(c_gt
, 4))
836 static long c_le(long a
, long b
, unsigned bt
)
843 if (!c_binop(c_le
, 4))
848 static long c_ge(long a
, long b
, unsigned bt
)
855 if (!c_binop(c_ge
, 4))
860 static long c_eq(long a
, long b
, unsigned bt
)
867 if (!c_binop(c_eq
, 4))
872 static long c_neq(long a
, long b
, unsigned bt
)
879 if (!c_binop(c_neq
, 4))
884 static long c_lnot(long a
, unsigned bt
)
891 if (!c_op(c_lnot
, 4))
893 if (cmp_last
== codeaddr()) {
894 buf
[cmp_setl
+ 1] ^= 0x01;
896 o_num(0, 4 | BT_SIGNED
);
901 static long c_neg(long a
, unsigned bt
)
908 struct tmp
*t
= TMP(0);
910 unsigned bt
= BT_TMPBT(t
->bt
);
911 if (!c_op(c_neg
, t
->bt
| BT_SIGNED
))
915 regop1(NEG_REG
, 3, reg
, bt
);
918 static long c_not(long a
, unsigned bt
)
925 struct tmp
*t
= TMP(0);
927 unsigned bt
= BT_TMPBT(t
->bt
);
932 regop1(NOT_REG
, 2, reg
, bt
);
935 void o_func_end(void)
938 for (i
= 0; i
< nret
; i
++)
940 os("\xc9\xc3", 2); /* leave; ret; */
941 putint(buf
+ spsub_addr
, (maxsp
+ 7) & ~0x07, 4);
942 out_func_end(buf
, cur
- buf
);
945 long o_mklocal(int size
)
947 return sp_push((size
+ 7) & ~0x07);
950 void o_rmlocal(long addr
, int sz
)
955 static int arg_regs
[] = {R_RDI
, R_RSI
, R_RDX
, R_RCX
, R_R8
, R_R9
};
957 #define R_NARGS ARRAY_SIZE(arg_regs)
959 long o_arg(int i
, unsigned bt
)
963 addr
= o_mklocal(BT_SZ(bt
));
964 memop1(MOV_R2X
, arg_regs
[i
], R_RBP
, -addr
, bt
);
966 addr
= -8 * (i
- R_NARGS
+ 2);
971 void o_assign(unsigned bt
)
973 struct tmp
*t1
= TMP(0);
974 struct tmp
*t2
= TMP(1);
975 int r1
= BT_SZ(bt
) > 1 ? TMP_REG(t1
) : TMP_BYTEREG(t1
);
978 tmp_to(t1
, r1
, BT_TMPBT(bt
));
979 if (t2
->flags
& LOC_LOCAL
) {
983 reg
= TMP_REG2(t2
, r1
);
988 memop1(MOV_R2X
, r1
, reg
, off
, bt
);
992 void o_memcpy(int sz
)
994 struct tmp
*t0
= TMP(-1);
995 struct tmp
*t1
= TMP(0);
996 struct tmp
*t2
= TMP(1);
998 tmp_to(t0
, R_RCX
, 0);
1001 os("\xf3\xa4", 2); /* rep movs */
1005 void o_memset(int x
, int sz
)
1007 struct tmp
*t0
= TMP(-2);
1008 struct tmp
*t1
= TMP(-1);
1009 struct tmp
*t2
= TMP(0);
1012 tmp_to(t0
, R_RAX
, 0);
1013 tmp_to(t1
, R_RCX
, 0);
1015 os("\xf3\xaa", 2); /* rep stosb */
1019 long o_mklabel(void)
1024 static long jx(int x
, long addr
)
1026 char op
[2] = {0x0f};
1028 os(op
, 2); /* jx $addr */
1029 oi(addr
- codeaddr() - 4, 4);
1030 return codeaddr() - 4;
1033 static long jxtest(int x
, long addr
)
1035 int bt
= tmp_pop(R_RAX
, 0);
1036 regop1(TEST_R2R
, R_RAX
, R_RAX
, bt
);
1040 static long jxcmp(long addr
, int inv
)
1043 if (codeaddr() != cmp_last
)
1046 cur
= buf
+ cmp_setl
;
1047 x
= (unsigned char) buf
[cmp_setl
+ 1];
1048 return jx((inv
? x
: x
^ 0x01) & ~0x10, addr
);
1051 long o_jz(long addr
)
1053 long ret
= jxcmp(addr
, 0);
1054 return ret
!= -1 ? ret
: jxtest(0x84, addr
);
1057 long o_jnz(long addr
)
1059 long ret
= jxcmp(addr
, 1);
1060 return ret
!= -1 ? ret
: jxtest(0x85, addr
);
1063 long o_jmp(long addr
)
1065 os("\xe9", 1); /* jmp $addr */
1066 oi(addr
- codeaddr() - 4, 4);
1067 return codeaddr() - 4;
1070 void o_filljmp2(long addr
, long jmpdst
)
1072 putint(buf
+ addr
, jmpdst
- addr
- 4, 4);
1075 void o_filljmp(long addr
)
1077 o_filljmp2(addr
, codeaddr());
1080 void o_call(int argc
, unsigned *bt
, unsigned ret_bt
)
1084 for (i
= 0; i
< ARRAY_SIZE(tmpregs
); i
++)
1085 if (regs
[tmpregs
[i
]] && regs
[tmpregs
[i
]] - tmps
< ntmp
- argc
)
1086 tmp_mem(regs
[tmpregs
[i
]]);
1087 if (argc
> R_NARGS
) {
1088 long addr
= sp_push(8 * (argc
- R_NARGS
));
1089 for (i
= argc
- 1; i
>= R_NARGS
; --i
) {
1090 int reg
= TMP_REG(TMP(0));
1091 tmp_pop(reg
, bt
[i
]);
1092 memop1(MOV_R2X
, reg
, R_RBP
,
1093 -(addr
- (i
- R_NARGS
) * 8), BT_TMPBT(bt
[i
]));
1096 for (i
= MIN(argc
, R_NARGS
) - 1; i
>= 0; i
--)
1097 tmp_pop(arg_regs
[i
], bt
[i
]);
1099 if (t
->flags
& LOC_SYM
) {
1100 os("\x31\xc0", 2); /* xor %eax, %eax */
1101 os("\xe8", 1); /* call $x */
1103 out_rela(t
->addr
, codeaddr(), 1);
1107 tmp_mv(TMP(0), R_RAX
);
1109 regop1(CALL_REG
, 2, R_RAX
, 4);
1112 tmp_push(R_RAX
, ret_bt
);
1125 void o_datset(long addr
, int off
, unsigned bt
)
1127 struct tmp
*t
= TMP(0);
1128 if (t
->flags
& LOC_NUM
&& !(t
->flags
& TMP_ADDR
)) {
1130 out_datcpy(addr
, off
, (void *) &t
->addr
, BT_SZ(bt
));
1132 if (t
->flags
& LOC_SYM
&& !(t
->flags
& TMP_ADDR
)) {
1133 out_datrela(t
->addr
, addr
, off
);
1134 out_datcpy(addr
, off
, (void *) &t
->off
, BT_SZ(bt
));