This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: inline asm and multi-alternative constraints


On 10/27/2015 02:05 PM, Jeff Law wrote:
> On 10/25/2015 09:41 PM, David Wohlferd wrote:
>> Does gcc's inline asm support multi-alternative constraints?  Or are
>> they only supported for md?
>>
>> The fact that it is doc'ed with the other constraints
>> (https://gcc.gnu.org/onlinedocs/gcc/Constraints.html) says it works for
>> inline.  But https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10396#c17 says
>> it only works for md.
>>
>> I've got a patch ready to remove this section from the non-md docs
>> (attached).  But there probably needs to be more support than a 11 year
>> old comment to approve it.
>>
>> Dropping a supported feature is always controversial.  But if it doesn't
>> work, perhaps less so.  After all, doc'ing something that doesn't work
>> is just as bad.
>>
>> dw
>>
>> PS If it *is* supported, then the docs need some work.
> I think Richard corrected me last I spoke on this topic :-)  They *are*
> supported.  ie, something like this should work on a ciscy target.
> 
>   asm("add %0,%1" : "=r,m"(x) : "rim,ri"(y))

Correct.

They are supported, so long as the assembly can use the same text for all
alternatives.  Thus multiple alternatives in inline asm is basically useless
for RISC targets, but occasionally useful for CISC targets.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]