<div><div class="gmail_quote">On 22 October 2010 11:23, Evan Cheng <span dir="ltr"><<a href="mailto:evan.cheng@apple.com">evan.cheng@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Author: evancheng<br>
Date: Fri Oct 22 13:23:05 2010<br>
New Revision: 117119<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=117119&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=117119&view=rev</a><br>
Log:<br>
Add fastcc cc: pass and return VFP / NEON values in registers. Controlled by -arm-fastcc for now.<br></blockquote><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8">Hi Evan,<div><br></div>
<div>This is causing a few new warnings:</div></div><div><br></div><div><div>llvm/lib/Target/ARM/ARMGenCallingConv.inc.h:289: error: 'bool FastCC_ARM_APCS(unsigned int, llvm::EVT, llvm::EVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)' defined but not used [-Wunused-function]</div>
<div>llvm/lib/Target/ARM/ARMGenCallingConv.inc.h:538: error: 'bool RetFastCC_ARM_APCS(unsigned int, llvm::EVT, llvm::EVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)' defined but not used [-Wunused-function]</div>
<div>llvm/lib/Target/ARM/ARMGenCallingConv.inc.h:289: error: 'bool FastCC_ARM_APCS(unsigned int, llvm::EVT, llvm::EVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)' defined but not used [-Wunused-function]</div>
<div>llvm/lib/Target/ARM/ARMGenCallingConv.inc.h:538: error: 'bool RetFastCC_ARM_APCS(unsigned int, llvm::EVT, llvm::EVT, llvm::CCValAssign::LocInfo, llvm::ISD::ArgFlagsTy, llvm::CCState&)' defined but not used [-Wunused-function]</div>
</div><div><br></div><div>I realize that the code to make use of them is coming soon, but is there something you can do about these in the mean time? We build with -Werror.</div><div><br></div><div>Nick</div><div><br></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Modified:<br>
llvm/trunk/lib/Target/ARM/ARMCallingConv.td<br>
llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp<br>
<br>
Modified: llvm/trunk/lib/Target/ARM/ARMCallingConv.td<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCallingConv.td?rev=117119&r1=117118&r2=117119&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCallingConv.td?rev=117119&r1=117118&r2=117119&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/ARM/ARMCallingConv.td (original)<br>
+++ llvm/trunk/lib/Target/ARM/ARMCallingConv.td Fri Oct 22 13:23:05 2010<br>
@@ -53,6 +53,34 @@<br>
]>;<br>
<br>
//===----------------------------------------------------------------------===//<br>
+// ARM APCS Calling Convention for FastCC (when VFP2 or later is available)<br>
+//===----------------------------------------------------------------------===//<br>
+def FastCC_ARM_APCS : CallingConv<[<br>
+ // Handle all vector types as either f64 or v2f64.<br>
+ CCIfType<[v1i64, v2i32, v4i16, v8i8, v2f32], CCBitConvertToType<f64>>,<br>
+ CCIfType<[v2i64, v4i32, v8i16, v16i8, v4f32], CCBitConvertToType<v2f64>>,<br>
+<br>
+ CCIfType<[v2f64], CCAssignToReg<[Q0, Q1, Q2, Q3]>>,<br>
+ CCIfType<[f64], CCAssignToReg<[D0, D1, D2, D3, D4, D5, D6, D7]>>,<br>
+ CCIfType<[f32], CCAssignToReg<[S0, S1, S2, S3, S4, S5, S6, S7, S8,<br>
+ S9, S10, S11, S12, S13, S14, S15]>>,<br>
+ CCDelegateTo<CC_ARM_APCS><br>
+]>;<br>
+<br>
+def RetFastCC_ARM_APCS : CallingConv<[<br>
+ // Handle all vector types as either f64 or v2f64.<br>
+ CCIfType<[v1i64, v2i32, v4i16, v8i8, v2f32], CCBitConvertToType<f64>>,<br>
+ CCIfType<[v2i64, v4i32, v8i16, v16i8, v4f32], CCBitConvertToType<v2f64>>,<br>
+<br>
+ CCIfType<[v2f64], CCAssignToReg<[Q0, Q1, Q2, Q3]>>,<br>
+ CCIfType<[f64], CCAssignToReg<[D0, D1, D2, D3, D4, D5, D6, D7]>>,<br>
+ CCIfType<[f32], CCAssignToReg<[S0, S1, S2, S3, S4, S5, S6, S7, S8,<br>
+ S9, S10, S11, S12, S13, S14, S15]>>,<br>
+ CCDelegateTo<RetCC_ARM_APCS><br>
+]>;<br>
+<br>
+<br>
+//===----------------------------------------------------------------------===//<br>
// ARM AAPCS (EABI) Calling Convention, common parts<br>
//===----------------------------------------------------------------------===//<br>
<br>
@@ -105,6 +133,7 @@<br>
<br>
//===----------------------------------------------------------------------===//<br>
// ARM AAPCS-VFP (EABI) Calling Convention<br>
+// Also used for FastCC (when VFP2 or later is available)<br>
//===----------------------------------------------------------------------===//<br>
<br>
def CC_ARM_AAPCS_VFP : CallingConv<[<br>
<br>
Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=117119&r1=117118&r2=117119&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=117119&r1=117118&r2=117119&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)<br>
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Fri Oct 22 13:23:05 2010<br>
@@ -69,6 +69,10 @@<br>
cl::desc("Enable / disable ARM interworking (for debugging only)"),<br>
cl::init(true));<br>
<br>
+static cl::opt<bool><br>
+ARMFastCC("arm-fastcc", cl::Hidden,<br>
+ cl::desc("Use AAPCS / AAPCS-VFP calling conventions for fastcc"));<br>
+<br>
void ARMTargetLowering::addTypeForNEON(EVT VT, EVT PromotedLdStVT,<br>
EVT PromotedBitwiseVT) {<br>
if (VT != PromotedLdStVT) {<br>
@@ -955,23 +959,29 @@<br>
switch (CC) {<br>
default:<br>
llvm_unreachable("Unsupported calling convention");<br>
- case CallingConv::C:<br>
case CallingConv::Fast:<br>
+ if (ARMFastCC && Subtarget->hasVFP2() && !isVarArg) {<br>
+ if (!Subtarget->isAAPCS_ABI())<br>
+ return (Return ? RetFastCC_ARM_APCS : FastCC_ARM_APCS);<br>
+ // For AAPCS ABI targets, just use VFP variant of the calling convention.<br>
+ return (Return ? RetCC_ARM_AAPCS_VFP : CC_ARM_AAPCS_VFP);<br>
+ }<br>
+ // Fallthrough<br>
+ case CallingConv::C: {<br>
// Use target triple & subtarget features to do actual dispatch.<br>
- if (Subtarget->isAAPCS_ABI()) {<br>
- if (Subtarget->hasVFP2() &&<br>
- FloatABIType == FloatABI::Hard && !isVarArg)<br>
- return (Return ? RetCC_ARM_AAPCS_VFP: CC_ARM_AAPCS_VFP);<br>
- else<br>
- return (Return ? RetCC_ARM_AAPCS: CC_ARM_AAPCS);<br>
- } else<br>
- return (Return ? RetCC_ARM_APCS: CC_ARM_APCS);<br>
+ if (!Subtarget->isAAPCS_ABI())<br>
+ return (Return ? RetCC_ARM_APCS : CC_ARM_APCS);<br>
+ else if (Subtarget->hasVFP2() &&<br>
+ FloatABIType == FloatABI::Hard && !isVarArg)<br>
+ return (Return ? RetCC_ARM_AAPCS_VFP : CC_ARM_AAPCS_VFP);<br>
+ return (Return ? RetCC_ARM_AAPCS : CC_ARM_AAPCS);<br>
+ }<br>
case CallingConv::ARM_AAPCS_VFP:<br>
- return (Return ? RetCC_ARM_AAPCS_VFP: CC_ARM_AAPCS_VFP);<br>
+ return (Return ? RetCC_ARM_AAPCS_VFP : CC_ARM_AAPCS_VFP);<br>
case CallingConv::ARM_AAPCS:<br>
- return (Return ? RetCC_ARM_AAPCS: CC_ARM_AAPCS);<br>
+ return (Return ? RetCC_ARM_AAPCS : CC_ARM_AAPCS);<br>
case CallingConv::ARM_APCS:<br>
- return (Return ? RetCC_ARM_APCS: CC_ARM_APCS);<br>
+ return (Return ? RetCC_ARM_APCS : CC_ARM_APCS);<br>
}<br>
}<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>