[LLVMdev] Problems with 64-bit register operands of inline asm on ARM

Jakob Stoklund Olesen stoklund at 2pi.dk
Fri Jun 21 16:43:22 PDT 2013


On Jun 21, 2013, at 3:42 PM, Renato Golin <renato.golin at linaro.org> wrote:

> Folks,
> 
> Sorry for resurrecting an old thread, but this patch is really getting in the way of building Linux with LLVM.
> 
> Can anyone that knows more about the inline asm issue review it? It looks good to me, but I might be missing something.
> 
> Attaching the last known patch again, just in case someone missed it.

I am fine with the part that constrains all i64 asm operands to GPRPair.

I don’t understand the issues around the %0 syntax well enough to have an opinion.

/jakob



> 
> cheers,
> --renato
> 
> 
> On 28 March 2013 17:35, Weiming Zhao <weimingz at codeaurora.org> wrote:
> 
> 
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
> 
> 
> -----Original Message-----
> From: Måns Rullgård [mailto:mans at mansr.com]
> Sent: Wednesday, March 27, 2013 6:41 PM
> To: weimingz at codeaurora.org
> Cc: 'Måns Rullgård'; 'Jim Grosbach'; 'Renato Golin'; 'Kristof Beyls'; 'Eric Christopher'; 'Jakob Stoklund Olesen'; 'LLVM Commits'
> Subject: Re: [LLVMdev] Problems with 64-bit register operands of inline asm on ARM
> 
> "Weiming Zhao" <weimingz at codeaurora.org> writes:
> 
> > Hi Måns,
> >
> > If you try my patch, it supports "ldrd %0, [%1]" although my test case
> > doesn't include that.
> >
> > The current logic is, for inline asm, LLVM just emits one reg for %x
> > place holders.
> > For a GPRPair, when it sees %0, it emits the first sub reg.
> > When it sees %H0, it emits the second sub reg.
> 
> That matches the gcc behaviour and is what people would expect.
> 
> > On the other side, it's hard for LLVM to give a warning diagnose for
> > your test because LLVM doesn’t even parse the instruction string
> > inside the inline asm.
> 
> It currently fails if using the integrated assembler.  When using gas it obviously works exactly as with gcc.
> 
> [Weiming] Exactly. But if we decide to fix it, it should be fixed by integrated assembler. From inline asm part, we can't simply expand %0 to (Rt, Rt+1) because it will break other cases (ldrexd/strexd) as I mentioned before. It is also hard to specialize for ldrd/strd cse because we don't parse the inline asm string.
> 
> Thanks,
> Weiming
> --
> Måns Rullgård
> mans at mansr.com
> 
> 
> <0002-Enable-GPRPair-for-all-i64-operands-for-ARM-mode.patch>





More information about the llvm-commits mailing list