This is the mail archive of the gcc-patches@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: [RFC 0/6] Flags outputs for asms


On 05/07/2015 06:20 PM, H. Peter Anvin wrote:
> This is a separate issue which really shouldn't have anything to do with
> this, but is there a specific reason why:
> 
> void good1(int x, int y)
> {
>   _Bool pf;
> 
>   asm("cmpl %2,%1"
>       : "=@ccp" (pf)
>       : "r" (x), "g" (y));
> 
>   if (pf)
>     beta();
> }
> 
> ... ends up generating a jump to a jump?
> 
> 0000000000000000 <good1>:
>    0:   39 f7                   cmp    %esi,%edi
>    2:   7a 0c                   jp     10 <good1+0x10>
>    4:   f3 c3                   repz retq
>    6:   66 2e 0f 1f 84 00 00    nopw   %cs:0x0(%rax,%rax,1)
>    d:   00 00 00
>   10:   e9 00 00 00 00          jmpq   15 <good1+0x15>
>                         11: R_X86_64_PC32       beta-0x4
>   15:   66 66 2e 0f 1f 84 00    data32 nopw %cs:0x0(%rax,%rax,1)
>   1c:   00 00 00 00
> 

Yes, the i386 backend has not implemented conditional sibcalls.  AFAIK the only
targets that have done that are ones with predication: ia64 and maybe arm32.

It could certainly be done; I've no idea off hand how difficult it might be.  I
suspect that some new code has to be written generically in order to enable it.


r~


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