asm.h (1096B)
1 #ifndef KIT_ARCH_X64_ASM_H 2 #define KIT_ARCH_X64_ASM_H 3 4 #include "arch/arch.h" 5 6 /* Private pseudo operand used by the x64 inline-asm binder. Semantic CG 7 * operands never expose physical registers, so native.c lowers register 8 * constraints into this arch-private shape before template substitution: 9 * Operand.kind = X64_INLINE_OPK_REG, Operand.v.local carries the 4-bit 10 * physical register number, Operand.pad[0] carries X64_INLINE_OPCLS_*. 11 * Memory operands reuse OPK_INDIRECT with v.ind.base holding the physical 12 * base register and v.ind.index == CG_LOCAL_NONE. */ 13 enum { 14 X64_INLINE_OPK_REG = 0xf0u, 15 X64_INLINE_OPCLS_INT = 0u, 16 X64_INLINE_OPCLS_FP = 1u, 17 }; 18 19 typedef struct X64Asm X64Asm; 20 21 X64Asm* x64_asm_open(Compiler*); 22 void x64_asm_close(X64Asm*); 23 ArchAsm* x64_arch_asm_new(Compiler*); 24 void x64_inline_bind(X64Asm*, const AsmConstraint* outs, u32 nout, 25 Operand* out_ops, const AsmConstraint* ins, u32 nin, 26 const Operand* in_ops, const Sym* clobbers, u32 nclob); 27 void x64_asm_run_template(X64Asm*, MCEmitter* mc, const char* tmpl); 28 29 #endif