riscv64-asm: Implement asm_clobber

This commit is contained in:
Danny Milosavljevic 2021-04-07 11:56:06 +02:00
parent 468f338e23
commit 9b76a64f96

View File

@ -694,7 +694,19 @@ ST_FUNC void asm_compute_constraints(ASMOperand *operands,
ST_FUNC void asm_clobber(uint8_t *clobber_regs, const char *str)
{
tcc_error("RISCV64 asm not implemented.");
int reg;
TokenSym *ts;
if (!strcmp(str, "memory") ||
!strcmp(str, "cc") ||
!strcmp(str, "flags"))
return;
ts = tok_alloc(str, strlen(str));
reg = asm_parse_regvar(ts->tok);
if (reg == -1) {
tcc_error("invalid clobber register '%s'", str);
}
clobber_regs[reg] = 1;
}
ST_FUNC int asm_parse_regvar (int t)