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
)
100 static void os(char *s
, int n
)
108 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
, 4);
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 int nbt
= deref
? 8 : TMP_BT(tmp
);
294 mov_m2r(dst
, R_RBP
, tmp
->addr
, nbt
, nbt
);
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
408 /* make sure tmps remain intact after a conditional expression */
412 for (i
= 0; i
< ntmp
- 1; i
++)
416 void o_forkpush(void)
421 void o_forkjoin(void)
423 tmp_push(FORK_REG
, 0);
428 struct tmp
*t1
= TMP(0);
429 struct tmp
*t2
= TMP(1);
431 memcpy(&t
, t1
, sizeof(t
));
432 memcpy(t1
, t2
, sizeof(t
));
433 memcpy(t2
, &t
, sizeof(t
));
434 if (t1
->flags
& LOC_REG
)
436 if (t2
->flags
& LOC_REG
)
440 static int reg_get(int mask
)
443 for (i
= 0; i
< ARRAY_SIZE(tmpregs
); i
++)
444 if ((1 << tmpregs
[i
]) & mask
&& !regs
[tmpregs
[i
]])
446 for (i
= 0; i
< ARRAY_SIZE(tmpregs
); i
++)
447 if ((1 << tmpregs
[i
]) & mask
) {
448 reg_free(tmpregs
[i
]);
456 struct tmp
*t1
= TMP(0);
457 struct tmp
*t2
= tmp_new();
458 memcpy(t2
, t1
, sizeof(*t1
));
459 if (!(t1
->flags
& (LOC_REG
| LOC_MEM
)))
461 if (t1
->flags
& LOC_MEM
) {
462 tmp_reg(t2
, reg_get(~0), t2
->bt
, 0);
463 } else if (t1
->flags
& LOC_REG
) {
464 t2
->addr
= reg_get(~(1 << t1
->addr
));
465 regop1(MOV_R2X
, t1
->addr
, t2
->addr
, BT_TMPBT(TMP_BT(t1
)));
468 t2
->flags
= t1
->flags
;
471 void o_cast(unsigned bt
)
473 struct tmp
*t
= TMP(0);
477 if (t
->flags
& LOC_NUM
) {
481 reg
= BT_SZ(bt
) == 1 ? TMP_BYTEREG(t
) : TMP_REG(t
);
485 long o_func_beg(char *name
, int global
)
487 long addr
= out_func_beg(name
, global
);
489 os("\x55", 1); /* push %rbp */
490 os("\x48\x89\xe5", 3); /* mov %rsp, %rbp */
497 memset(regs
, 0, sizeof(regs
));
498 os("\x48\x81\xec", 3); /* sub $xxx, %rsp */
499 spsub_addr
= codeaddr();
504 void o_deref(unsigned bt
)
506 struct tmp
*t
= TMP(0);
507 if (t
->flags
& TMP_ADDR
)
508 tmp_to(t
, TMP_REG(t
), t
->bt
);
510 t
->flags
|= TMP_ADDR
;
515 struct tmp
*t
= TMP(0);
516 tmp_to(t
, TMP_REG(t
), t
->bt
);
519 static unsigned bt_op(unsigned bt1
, unsigned bt2
)
521 unsigned s1
= BT_SZ(bt1
);
522 unsigned s2
= BT_SZ(bt2
);
523 unsigned bt
= (bt1
| bt2
) & BT_SIGNED
| (s1
> s2
? s1
: s2
);
527 #define TMP_CONST(t) ((t)->flags & LOC_NUM && !((t)->flags & TMP_ADDR))
528 #define LOCAL_PTR(t) ((t)->flags & LOC_LOCAL && !((t)->flags & TMP_ADDR))
529 #define SYM_PTR(t) ((t)->flags & LOC_SYM && !((t)->flags & TMP_ADDR))
531 int o_popnum(long *c
)
533 struct tmp
*t
= TMP(0);
541 static int c_binop(long (*cop
)(long a
, long b
, unsigned bt
), unsigned bt
)
543 struct tmp
*t1
= TMP(0);
544 struct tmp
*t2
= TMP(1);
545 int locals
= LOCAL_PTR(t1
) + LOCAL_PTR(t2
);
546 int syms
= SYM_PTR(t1
) + SYM_PTR(t2
);
547 int nums
= TMP_CONST(t1
) + TMP_CONST(t2
);
548 if (syms
== 2 || syms
&& locals
|| syms
+ nums
+ locals
!= 2)
552 bt
= syms
? 8 : bt_op(t1
->bt
, t2
->bt
);
559 long o1
= SYM_PTR(t1
) ? t1
->off
: t1
->addr
;
560 long o2
= SYM_PTR(t2
) ? t2
->off
: t2
->addr
;
561 long ret
= cop(o2
, o1
, bt
);
567 long ret
= cop(t2
->addr
, t1
->addr
, locals
? 4 | BT_SIGNED
: bt
);
579 static int c_op(long (*cop
)(long a
, unsigned bt
), unsigned bt
)
581 struct tmp
*t1
= TMP(0);
587 ret
= cop(t1
->addr
, bt
);
593 static void shx(int uop
, int sop
)
595 struct tmp
*t2
= TMP(1);
596 int r2
= TMP_REG2(t2
, R_RCX
);
600 regop1(SHX_REG
, bt
& BT_SIGNED
? sop
: uop
, r2
, BT_TMPBT(bt
));
604 static long c_shl(long a
, long b
, unsigned bt
)
611 if (!c_binop(c_shl
, 0))
616 static long c_shr(long a
, long b
, unsigned bt
)
621 return (unsigned long) a
>> b
;
626 if (!c_binop(c_shr
, 0))
631 static int mulop(int uop
, int sop
, int reg
)
633 struct tmp
*t1
= TMP(0);
634 struct tmp
*t2
= TMP(1);
635 int bt1
= TMP_BT(t1
);
636 int bt2
= TMP_BT(t2
);
637 int bt
= bt_op(bt1
, bt2
);
638 if (t1
->flags
& LOC_REG
&& t1
->addr
!= R_RAX
&& t1
->addr
!= R_RDX
)
641 tmp_to(t2
, R_RAX
, bt
);
646 o_op(&cqo
, 1, R_RAX
, R_RDX
, bt
);
648 regop1(XOR_R2X
, R_RDX
, R_RDX
, bt
);
651 regop1(MUL_A2X
, bt
& BT_SIGNED
? sop
: uop
, reg
, BT_TMPBT(bt2
));
655 static long c_mul(long a
, long b
, unsigned bt
)
663 if (!c_binop(c_mul
, 0))
665 bt
= mulop(4, 5, R_RDX
);
669 static long c_div(long a
, long b
, unsigned bt
)
677 if (!c_binop(c_div
, 0))
679 bt
= mulop(6, 7, R_RCX
);
683 static long c_mod(long a
, long b
, unsigned bt
)
691 if (!c_binop(c_mod
, 0))
693 bt
= mulop(6, 7, R_RCX
);
699 tmps
[ntmp
- 1].flags
&= ~TMP_ADDR
;
700 tmps
[ntmp
- 1].bt
= 8;
703 void o_ret(unsigned bt
)
708 os("\x31\xc0", 2); /* xor %eax, %eax */
709 ret
[nret
++] = o_jmp(0);
712 static int binop(int op
, int *reg
)
714 struct tmp
*t1
= TMP(0);
715 struct tmp
*t2
= TMP(1);
717 unsigned bt
= bt_op(t1
->bt
, t2
->bt
);
719 r2
= TMP_REG2(t2
, r1
);
722 regop1(op
, r2
, r1
, bt
);
727 static long c_add(long a
, long b
, unsigned bt
)
736 if (!c_binop(c_add
, 0))
738 bt
= binop(ADD_R2X
, ®
);
742 static long c_xor(long a
, long b
, unsigned bt
)
751 if (!c_binop(c_xor
, 0))
753 bt
= binop(XOR_R2X
, ®
);
757 static long c_and(long a
, long b
, unsigned bt
)
766 if (!c_binop(c_and
, 0))
768 bt
= binop(AND_R2X
, ®
);
772 static long c_or(long a
, long b
, unsigned bt
)
781 if (!c_binop(c_or
, 0))
783 bt
= binop(OR_R2X
, ®
);
787 static long c_sub(long a
, long b
, unsigned bt
)
796 if (!c_binop(c_sub
, 0))
798 bt
= binop(SUB_R2X
, ®
);
802 static void o_cmp(int uop
, int sop
)
804 struct tmp
*t1
= TMP(0);
805 struct tmp
*t2
= TMP(1);
806 char set
[] = "\x0f\x00\xc0";
809 if (regs
[R_RAX
] && regs
[R_RAX
] != t1
&& regs
[R_RAX
] != t2
)
811 bt
= binop(CMP_R2X
, ®
);
812 set
[1] = bt
& BT_SIGNED
? sop
: uop
;
813 cmp_setl
= codeaddr();
814 os(set
, 3); /* setl %al */
815 os("\x0f\xb6\xc0", 3); /* movzbl %al, %eax */
816 tmp_push(R_RAX
, 4 | BT_SIGNED
);
817 cmp_last
= codeaddr();
820 static long c_lt(long a
, long b
, unsigned bt
)
827 if (!c_binop(c_lt
, 4))
832 static long c_gt(long a
, long b
, unsigned bt
)
839 if (!c_binop(c_gt
, 4))
844 static long c_le(long a
, long b
, unsigned bt
)
851 if (!c_binop(c_le
, 4))
856 static long c_ge(long a
, long b
, unsigned bt
)
863 if (!c_binop(c_ge
, 4))
868 static long c_eq(long a
, long b
, unsigned bt
)
875 if (!c_binop(c_eq
, 4))
880 static long c_neq(long a
, long b
, unsigned bt
)
887 if (!c_binop(c_neq
, 4))
892 static long c_lnot(long a
, unsigned bt
)
899 if (!c_op(c_lnot
, 4))
901 if (cmp_last
== codeaddr()) {
902 buf
[cmp_setl
+ 1] ^= 0x01;
904 o_num(0, 4 | BT_SIGNED
);
909 static long c_neg(long a
, unsigned bt
)
916 struct tmp
*t
= TMP(0);
918 unsigned bt
= BT_TMPBT(t
->bt
);
919 if (!c_op(c_neg
, t
->bt
| BT_SIGNED
))
923 regop1(NEG_REG
, 3, reg
, bt
);
926 static long c_not(long a
, unsigned bt
)
933 struct tmp
*t
= TMP(0);
935 unsigned bt
= BT_TMPBT(t
->bt
);
940 regop1(NOT_REG
, 2, reg
, bt
);
943 void o_func_end(void)
946 for (i
= 0; i
< nret
; i
++)
948 os("\xc9\xc3", 2); /* leave; ret; */
949 putint(buf
+ spsub_addr
, (maxsp
+ 7) & ~0x07, 4);
950 out_func_end(buf
, cur
- buf
);
953 long o_mklocal(int size
)
955 return sp_push((size
+ 7) & ~0x07);
958 void o_rmlocal(long addr
, int sz
)
963 static int arg_regs
[] = {R_RDI
, R_RSI
, R_RDX
, R_RCX
, R_R8
, R_R9
};
965 #define R_NARGS ARRAY_SIZE(arg_regs)
967 long o_arg(int i
, unsigned bt
)
971 addr
= o_mklocal(BT_SZ(bt
));
972 memop1(MOV_R2X
, arg_regs
[i
], R_RBP
, -addr
, bt
);
974 addr
= -8 * (i
- R_NARGS
+ 2);
979 void o_assign(unsigned bt
)
981 struct tmp
*t1
= TMP(0);
982 struct tmp
*t2
= TMP(1);
983 int r1
= BT_SZ(bt
) > 1 ? TMP_REG(t1
) : TMP_BYTEREG(t1
);
986 tmp_to(t1
, r1
, BT_TMPBT(bt
));
987 if (t2
->flags
& LOC_LOCAL
) {
991 reg
= TMP_REG2(t2
, r1
);
996 memop1(MOV_R2X
, r1
, reg
, off
, bt
);
1000 void o_memcpy(int sz
)
1002 struct tmp
*t0
= TMP(-1);
1003 struct tmp
*t1
= TMP(0);
1004 struct tmp
*t2
= TMP(1);
1006 tmp_to(t0
, R_RCX
, 0);
1009 os("\xf3\xa4", 2); /* rep movs */
1013 void o_memset(int x
, int sz
)
1015 struct tmp
*t0
= TMP(-2);
1016 struct tmp
*t1
= TMP(-1);
1017 struct tmp
*t2
= TMP(0);
1020 tmp_to(t0
, R_RAX
, 0);
1021 tmp_to(t1
, R_RCX
, 0);
1023 os("\xf3\xaa", 2); /* rep stosb */
1027 long o_mklabel(void)
1032 static long jx(int x
, long addr
)
1034 char op
[2] = {0x0f};
1036 os(op
, 2); /* jx $addr */
1037 oi(addr
- codeaddr() - 4, 4);
1038 return codeaddr() - 4;
1041 static long jxtest(int x
, long addr
)
1043 int bt
= tmp_pop(R_RAX
, 0);
1044 regop1(TEST_R2R
, R_RAX
, R_RAX
, bt
);
1048 static long jxcmp(long addr
, int inv
)
1051 if (codeaddr() != cmp_last
)
1054 cur
= buf
+ cmp_setl
;
1055 x
= (unsigned char) buf
[cmp_setl
+ 1];
1056 return jx((inv
? x
: x
^ 0x01) & ~0x10, addr
);
1059 long o_jz(long addr
)
1061 long ret
= jxcmp(addr
, 0);
1062 return ret
!= -1 ? ret
: jxtest(0x84, addr
);
1065 long o_jnz(long addr
)
1067 long ret
= jxcmp(addr
, 1);
1068 return ret
!= -1 ? ret
: jxtest(0x85, addr
);
1071 long o_jmp(long addr
)
1073 os("\xe9", 1); /* jmp $addr */
1074 oi(addr
- codeaddr() - 4, 4);
1075 return codeaddr() - 4;
1078 void o_filljmp2(long addr
, long jmpdst
)
1080 putint(buf
+ addr
, jmpdst
- addr
- 4, 4);
1083 void o_filljmp(long addr
)
1085 o_filljmp2(addr
, codeaddr());
1088 void o_call(int argc
, unsigned *bt
, unsigned ret_bt
)
1092 for (i
= 0; i
< ARRAY_SIZE(tmpregs
); i
++)
1093 if (regs
[tmpregs
[i
]] && regs
[tmpregs
[i
]] - tmps
< ntmp
- argc
)
1094 tmp_mem(regs
[tmpregs
[i
]]);
1095 if (argc
> R_NARGS
) {
1096 long addr
= sp_push(8 * (argc
- R_NARGS
));
1097 for (i
= argc
- 1; i
>= R_NARGS
; --i
) {
1098 int reg
= TMP_REG(TMP(0));
1099 tmp_pop(reg
, bt
[i
]);
1100 memop1(MOV_R2X
, reg
, R_RBP
,
1101 -(addr
- (i
- R_NARGS
) * 8), BT_TMPBT(bt
[i
]));
1104 for (i
= MIN(argc
, R_NARGS
) - 1; i
>= 0; i
--)
1105 tmp_pop(arg_regs
[i
], bt
[i
]);
1107 if (t
->flags
& LOC_SYM
) {
1108 os("\x31\xc0", 2); /* xor %eax, %eax */
1109 os("\xe8", 1); /* call $x */
1111 out_rela(t
->addr
, codeaddr(), 1);
1115 tmp_mv(TMP(0), R_RAX
);
1117 regop1(CALL_REG
, 2, R_RAX
, 4);
1120 tmp_push(R_RAX
, ret_bt
);
1133 void o_datset(long addr
, int off
, unsigned bt
)
1135 struct tmp
*t
= TMP(0);
1136 if (t
->flags
& LOC_NUM
&& !(t
->flags
& TMP_ADDR
)) {
1138 out_datcpy(addr
, off
, (void *) &t
->addr
, BT_SZ(bt
));
1140 if (t
->flags
& LOC_SYM
&& !(t
->flags
& TMP_ADDR
)) {
1141 out_datrela(t
->addr
, addr
, off
);
1142 out_datcpy(addr
, off
, (void *) &t
->off
, BT_SZ(bt
));