mirror of
https://github.com/odin-lang/Odin.git
synced 2026-08-29 00:11:34 +00:00
Clobber implicit_wr and implicit_rd
This commit is contained in:
@@ -293,6 +293,22 @@ main :: proc() {
|
||||
return ((side_effects & VOLATILE_SE) != 0);
|
||||
}
|
||||
};
|
||||
|
||||
void clobber_implicit_regs(StringSet *clobber_registers_set, ClobberRegs implicit_regs) {
|
||||
u16 const NAMED =
|
||||
ClobberReg_RAX|ClobberReg_RBX|ClobberReg_RCX|ClobberReg_RDX|
|
||||
ClobberReg_RSI|ClobberReg_RDI|ClobberReg_RBP|ClobberReg_R11|
|
||||
ClobberReg_XMM0;
|
||||
u16 regs = implicit_regs & NAMED;
|
||||
|
||||
for (u16 bit = 1; bit != 0; bit <<= 1) {
|
||||
if ((regs & bit) == 0) {
|
||||
continue;
|
||||
}
|
||||
char const *rname = clobber_reg_bit_name(bit);
|
||||
string_set_update(clobber_registers_set, make_string_c(rname));
|
||||
}
|
||||
}
|
||||
""")
|
||||
strings.write_string(&sb, "\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user