[llvm] r215862 - ARM: improve RTABI 4.2 conformance on Linux

Moritz Roth moritz.roth at arm.com
Tue Aug 19 06:38:10 PDT 2014


Hi Renato, Saleem,

Yes, this commit caused quite a few regressions on my Thumb1
arm-linux-gnueabi buildbot. Changing the target triple to
arm-linux-eabi seems to fix that (at least mostly, I'll do a
full test run tonight).

I've attached some disassembly from LNT/misr, one of the failing
tests. In simulate(), the following code:
	// reg_len = 10
	quot = (reg_len - 1) / 31;
	rem  = (reg_len - 1) % 31;
is miscompiled, as quot and rem both end up as 0 (see line ~650 in
the asm). The other regressions look similar.
Compilation flags to reproduce:

clang -DSMALL_PROBLEM_SIZE -O3 -g -target armv6m-none-linux-gnueabi \
-mcpu=cortex-m0 -mthumb --sysroot=~/gcc/arm-linux-gnueabi/libc \
--gcc-toolchain=~/gcc -S misr.c -o misr.s

Cheers
Moritz.

> -----Original Message-----
> From: Renato Golin [mailto:renato.golin at linaro.org]
> Sent: 19 August 2014 12:22
> To: Saleem Abdulrasool
> Cc: LLVM Commits; Moritz Roth; Joey Gouly
> Subject: Re: [llvm] r215862 - ARM: improve RTABI 4.2 conformance on
> Linux
> 
> On 17 August 2014 23:51, Saleem Abdulrasool <compnerd at compnerd.org>
> wrote:
> > Author: compnerd
> > Date: Sun Aug 17 17:51:02 2014
> > New Revision: 215862
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=215862&view=rev
> > Log:
> > ARM: improve RTABI 4.2 conformance on Linux
> >
> > The set of functions defined in the RTABI was separated for no real
> reason.
> > This brings us closer to proper utilisation of the functions defined
> by the
> > RTABI.  It also sets the ground for correctly emitting function calls
> to AEABI
> > functions on all AEABI conforming platforms.
> >
> > The previously existing lie on the behaviour of __ldivmod and
> __uldivmod is
> > propagated as it is beyond the scope of the change.
> >
> > The changes to the test are due to the fact that we now use the
> divmod functions
> > which return both the quotient and remainder and thus we no longer
> need to
> > invoke two functions on Linux (making it closer to EABI's behaviour).
> 
> 
> Hi Saleem,
> 
> 64-bit divmod was broken on ARM and AFAIK hasn't been fixed. Your
> tests seem to remove the [[sum]] dependency, making them a bit weaker
> than they were. I just want to make sure that 64-bit divmod is working
> as it should by making sure the generated code is *really* correct.
> 
> Moritz (cc'd) had some concerns about it, it may be linked.
> 
> cheers,
> --renato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bad.s
Type: application/octet-stream
Size: 139467 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140819/cd57c8e9/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: good.s
Type: application/octet-stream
Size: 137041 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140819/cd57c8e9/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: misr.c
Type: application/octet-stream
Size: 7714 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140819/cd57c8e9/attachment-0002.obj>


More information about the llvm-commits mailing list