This is the mail archive of the
mailing list for the GCC project.
Re: [RFC 0/6] Flags outputs for asms
- From: Richard Henderson <rth at redhat dot com>
- To: "H. Peter Anvin" <hpa at zytor dot com>, gcc-patches at gcc dot gnu dot org
- Cc: law at redhat dot com, peterz at infradead dot org, torvalds at linux-foundation dot org, jakub at redhat dot com
- Date: Fri, 08 May 2015 08:23:59 -0700
- Subject: Re: [RFC 0/6] Flags outputs for asms
- Authentication-results: sourceware.org; auth=none
- References: <1431034740-5375-1-git-send-email-rth at redhat dot com> <554C0E31 dot 5070509 at zytor dot com> <554C0F71 dot 2060802 at zytor dot com>
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)
> ... 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.