[PATCH] AAPCS-VFP: Do not use any more VFP registers after allocating a CPRC to the stack

James Molloy james.molloy at arm.com
Fri Feb 7 02:08:26 PST 2014


Hi Oliver,

 

I'm mainly unsure about this hunk:

 

-  CCIfType<[i32], CCIfAlign<"8", CCAssignToStackWithShadow<4, 8, R3>>>,

-  CCIfType<[i32, f32], CCAssignToStack<4, 4>>,

-  CCIfType<[f64], CCAssignToStack<8, 8>>,

-  CCIfType<[v2f64], CCAssignToStack<16, 8>>

+  CCIfType<[i32], CCIfAlign<"8", CCAssignToStackWithShadow<4, 8, [R0, R1,
R2, R3]>>>,

+  CCIfType<[i32], CCAssignToStackWithShadow<4, 4, [R0, R1, R2, R3]>>,

+  CCIfType<[f32], CCAssignToStackWithShadow<4, 4, [Q0, Q1, Q2, Q3]>>,

+  CCIfType<[f64], CCAssignToStackWithShadow<8, 8, [Q0, Q1, Q2, Q3]>>,

+  CCIfType<[v2f64], CCAssignToStackWithShadow<16, 8, [Q0, Q1, Q2, Q3]>>

 

The first line did shadow just R3 but now shadows all registers. I suspect
that actually this was a bug, which you have now fixed incidentally? Your
patch description only mentions coprocessor registers so can you just
confirm this is deliberate?

 

The second line has changed behaviour - previously in the i32 case no
registers were shadowed - now R0-R3 are shadowed. Why is this correct? (not
saying it's not, but some justification would be good).

 

The other lines seem fine.

 

+  /// Version of AllocateStack with list of extra registers to be shadowed.

+  /// Note that, unlike AllocateReg, this shadows ALL if the shadow
registers.

+  unsigned AllocateStack(unsigned Size, unsigned Align,

+                     const uint16_t *ShadowRegs, unsigned NumShadowRegs) {

 

Typo "ALL if the registers" -> s/if/of/. Also tabbing/alignment error.

 

Cheers,

 

James 

 

From: llvm-commits-bounces at cs.uiuc.edu
[mailto:llvm-commits-bounces at cs.uiuc.edu] On Behalf Of Renato Golin
Sent: 06 February 2014 22:27
To: Oliver Stannard
Cc: LLVM Commits
Subject: Re: [PATCH] AAPCS-VFP: Do not use any more VFP registers after
allocating a CPRC to the stack

 

Hi Oliver,

 

The patch looks good to me, though I'm not sure about the CallingConvEmitter
part.  It also looks correct, but I'll let other people review that more
thoroughly (Molloy?).

 

cheers,

--renato

 

 

 

On 6 February 2014 17:33, Oliver Stannard <oliver.stannard at arm.com> wrote:

Hi,

 

According the the AAPCS, if an argument is a CPRC (co-processor register
candidate) but cannot be allocated to a co-processor register, the argument
must be allocated on the stack and all co-processor registers of that class
must be marked as unavailable (AAPCS, rule C.2.cp). However, llvm does not
currently mark the VFP registers as unavailable, so can allocate a later
CPRC to a register after an earlier one has been allocated to the stack.

 

The attached patch corrects this.

 

Oliver


_______________________________________________
llvm-commits mailing list
llvm-commits at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140207/4fa409c0/attachment.html>


More information about the llvm-commits mailing list