[Bug inline-asm/90181] Feature request: provide a way to explicitly select specific named registers in constraints

segher at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Apr 23 15:57:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90181

--- Comment #7 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to nfxjfg from comment #6)
> Yes, it's clear that that the constraint can't be _just_ the register name,
> since they'll clash with builtin constraints now or with future
> architectures (which may add arbitrary register names). The proposed
> "*registername" is pretty nice, though. Having this would be great.

Hrm, "*" already has a meaning with current GCC (it essentially is ignored
in inline asm)...  It might be better to have some new syntax that gives an
error with older GCC.

> I didn't find a RISC-V builtin for ecall (maybe I looked in the wrong
> place). That wouldbn't be sufficient anyway.

Right, you would need a builtin for every calling convention for syscalls.
The aren't too many of those though?

> Another situation where I
> wanted to specify many fixed register constraints was a piece of inline code
> that did some syscalls without touching the stack (it needed all inputs as
> registers, and in specific registers, and have some registers for free use
> by the asm code itself).

A biggish piece of asm like that might be better as actual assembler code
than as inline asm, you may want to consider that?


More information about the Gcc-bugs mailing list