#include "codex86.h" typedef struct RegAlloc RegAlloc; RegAlloc *reg_alloc_new (Asm *a); void reg_alloc_normalize (RegAlloc *ra); op_t reg_alloc_get_register (RegAlloc *ra, op_t op); op_t reg_alloc_alloc_gp (RegAlloc *ra); op_t reg_alloc_alloc_mmx (RegAlloc *ra); op_t reg_alloc_alloc_sse (RegAlloc *ra); op_t reg_alloc_alloc_gp_force (RegAlloc *ra, reg_t reg); op_t reg_alloc_get_register_or_memory (RegAlloc *ra, op_t); /* It is allowed to read a variable immediately after * deallocating it. New variables may be allocated in * the same slot, but this is fine because instructions * work when both operands are the same register. In * other words, a decallocated register remains usable until * someone has written into a newly allocated variable. */ void reg_alloc_dealloc (RegAlloc *ra, op_t var);