On Mon, Nov 19, 2018 at 12:59:29PM +0000, Michael Matz wrote:
> Hi,
>
> On Fri, 16 Nov 2018, Segher Boessenkool wrote:
>
> > > I.e. like volatile they can arbitrarily change their value. I don't
> > > know if other peoples mind model is similar, but it certainly is the
> > > model that is implemented in the GIMPLE pipeline (and if memory serves
> > > well of the RTL pipeline as well).
> > >
> > > Copying outof/into pseudos around asms serves no purpose with that
> > > model, it rather makes regvars somewhat "safer" to use, without
> > > actually making them safer (there _is_ nothing safe about them).
> >
> > The only supported case is for inputs and outputs to extended asm.
> > Maybe we should just come up with a syntax so you can specify hard regs
> > for that directly (without needing a separate regclass for every reg).
>
> I would like that, yes. (Of course backward compat would have us support
> the historic usage for some time, but still ...)
Right, or for ten years at least (there are header files that use
register asm!)
I was thinking something like
asm("smth %0,%1" : "=*r0"(x) : "*r1"(y));
where then "*" means the rest of the constraint is just a register name.
I don't know how easy this really is to make work, but do you think this
is a sensible syntax?
Segher