tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Support arm hardfloat calling convention


From: Thomas Preud'homme
Subject: Re: [Tinycc-devel] Support arm hardfloat calling convention
Date: Mon, 4 Jun 2012 22:49:35 +0200
User-agent: KMail/1.13.7 (Linux/3.2.0-2-amd64; KDE/4.7.4; x86_64; ; )

Le lundi 4 juin 2012 21:51:27, Daniel Glöckner a écrit :
> Hi Thomas,
> 
> On Tue, May 22, 2012 at 03:42:47PM +0200, Thomas Preud'homme wrote:
> > I added support for arm hardfloat calling convention (standard variant in
> > AAPCS) and I would appreciate some feedback on the patch.
> 
> there I was thinking that no one (including myself) would ever be able
> to understand (again) what was going on in arm-gen.c's gfunc_call.
> But then you come along adding another ~130 lines to that function.

I tried to minimize the changes but I agree it's still a lot. My plan is to do 
another commit to reorganize in smaller function with proper comment for each 
of them. I didn't do it in this commit so that it's easier to track the 
addition. However, changes are quite important in some places and reading the 
raw code instead of the diff is probably easier.

> 
> So I have reviewed all but gfunc_call and couldn't find anything that
> looked wrong. You also appear to have thought of all corner cases I
> came up with. I even found a bug in clang while doing so (doesn't stop
> back-filling when the stack is touched).
> 
> When I first tried to compile the code, it crashed all the time
> because I added -DTCC_ARM_HARDFLOAT to arm-vfp-tcc while your code
> needs -DTCC_ARM_EABI to function correctly.

Indeed, I considered that when TCC_ARM_HARDFLOAT is defined TCC_ARM_EABI and 
TCC_ARM_VFP are defined. Obviously you need VFP to use the HARDFLOAT 
convention and the HARDFLOAT respect all the rules of EABI + a few more.

> 
> I didn't try to run the code. I don't have a system with hard float
> userland to test on.

I might be able to give you an access to a Debian porterbox. Would you be 
interested?

> 
> In my opinion you should just push it to the mob branch.

Great, thanks for the review. I know the code is a bit dense. I feel 
especially a bit ashamed for the use of vrote to order the stack with args for 
VFP regs first then args for core register and finally arguments for stack. 
Not doing this would mean rewriting entirely the main loop which writes 
argument on the stack. Maybe I'll try another day to think of another design 
but with time I began to fear that code. There is really a lot of corner cases 
and it took me some time to debug everything on my quite scarce spare time.

Again, thanks a lot for the review.

> 
>   Daniel

Thomas

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]