# define _DECOR_mem_q(addr) qword ptr addr
#endif
+#define _DECOR_imm_b(imm) byte imm
+#define _DECOR_imm_w(imm) word imm
+#define _DECOR_imm_d(imm) dword imm
+#if CPUFAM_AMD64
+# define _DECOR_imm_q(imm) qword imm
+#endif
+
#if CPUFAM_X86
# define _DECOR_abcd_r(reg) e##reg##x
# define _DECOR_xp_r(reg) e##reg
# define _DECOR_ip_r(reg) e##reg
# define _DECOR_mem_r(addr) dword ptr addr
+# define _DECOR_imm_r(imm) dword imm
#endif
#if CPUFAM_AMD64
# define _DECOR_abcd_r(reg) r##reg##x
# define _DECOR_xp_r(reg) r##reg
# define _DECOR_ip_r(reg) r##reg
# define _DECOR_mem_r(addr) qword ptr addr
+# define _DECOR_imm_r(imm) qword imm
#endif
// R_r(decor) applies decoration decor to register r, which is an internal
// address addr (which should supply its own square-brackets).
#define MEM(decor, addr) _DECOR(mem, decor, addr)
+// Refer to an immediate datum of the type implied by decor.
+#define IMM(decor, imm) _DECOR(mem, decor, imm)
+
// Applies decoration decor to assembler-level register name reg.
#define _REGFORM(reg, decor) _GLUE(_REGFORM_, reg)(decor)
#define WHOLE(reg) _REGFORM(reg, r)
// Stack management and unwinding.
-.macro setfp fp, offset = 0
+.macro setfp fp, offset=0
.if \offset == 0
mov \fp, R_sp(r)
#if __ELF__
.macro dropfp; _dropfp \fp, \offset; .endm
.endm
-.macro _dropfp fp, offset = 0
+.macro _dropfp fp, offset=0
.if \offset == 0
mov R_sp(r), \fp
#if __ELF__
#if WANT_PIC
ldr\cond \reg, .L$_leaextq$\@
.L$_leaextq_pc$\@:
- .if .L$_pcoff == 8
+ .if .L$_pcoff == 8
ldr\cond \reg, [pc, \reg]
- .else
+ .else
add\cond \reg, pc
ldr\cond \reg, [\reg]
- .endif
+ .endif
_LIT
.balign 4
.L$_leaextq$\@:
#define QQ(qlo, qhi) D0(qlo)-D1(qhi)
// Stack management and unwinding.
-.macro setfp fp, offset = 0
+.macro setfp fp, offset=0
.if \offset == 0
mov \fp, sp
.setfp \fp, sp
.L$_frameptr_p = -1
.endm
-.macro _dropfp fp, offset = 0
+.macro _dropfp fp, offset=0
.if \offset == 0
mov sp, \fp
.else
.endm
// Stack management and unwinding.
-.macro setfp fp, offset = 0
+.macro setfp fp, offset=0
// If you're just going through the motions with a fixed-size stack frame,
// then you want to say `add x29, sp, #OFFSET' directly, which will avoid
// pointlessly restoring sp later.
.L$_frameptr_p = -1
.endm
-.macro _dropfp fp, offset = 0
+.macro _dropfp fp, offset=0
.if \offset == 0
mov sp, \fp
.cfi_def_cfa_register sp