Skip to content

Commit

Permalink
riscv: fix extended asm
Browse files Browse the repository at this point in the history
TODO: this error also appears in i386 and arm.
  • Loading branch information
ekaitz-zarraga committed Apr 15, 2024
1 parent 41b326e commit d239a1a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions riscv64-asm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1721,7 +1721,6 @@ ST_FUNC void asm_compute_constraints(ASMOperand *operands,
tcc_error
("asm regvar requests register that's taken already");
reg = op->reg;
goto reg_found;
}
try_next:
c = *str++;
Expand All @@ -1740,7 +1739,9 @@ ST_FUNC void asm_compute_constraints(ASMOperand *operands,
case 'p': // loadable/storable address
/* any general register */
/* From a0 to a7 */
for (reg = 10; reg <= 18; reg++) {
if ((reg = op->reg) >= 0)
goto reg_found;
else for (reg = 10; reg <= 18; reg++) {
if (!is_reg_allocated(reg))
goto reg_found;
}
Expand All @@ -1754,7 +1755,9 @@ ST_FUNC void asm_compute_constraints(ASMOperand *operands,
case 'f': // floating pont register
/* floating point register */
/* From fa0 to fa7 */
for (reg = 42; reg <= 50; reg++) {
if ((reg = op->reg) >= 0)
goto reg_found;
else for (reg = 42; reg <= 50; reg++) {
if (!is_reg_allocated(reg))
goto reg_found;
}
Expand Down

0 comments on commit d239a1a

Please sign in to comment.