<div class="gmail_quote">On Wed, May 9, 2012 at 11:22 AM, Roman Divacky <span dir="ltr"><<a href="mailto:rdivacky@freebsd.org" target="_blank">rdivacky@freebsd.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: rdivacky<br>
Date: Wed May  9 13:22:46 2012<br>
New Revision: 156491<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=156491&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=156491&view=rev</a><br>
Log:<br>
Implement PPC64TargetCodeGenInfo.<br></blockquote><div><br></div><div>Testcase?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Modified:<br>
    cfe/trunk/lib/CodeGen/TargetInfo.cpp<br>
<br>
Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=156491&r1=156490&r2=156491&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=156491&r1=156490&r2=156491&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Wed May  9 13:22:46 2012<br>
@@ -2411,6 +2411,64 @@<br>
   return false;<br>
 }<br>
<br>
+// PowerPC-64<br>
+<br>
+namespace {<br>
+class PPC64TargetCodeGenInfo : public DefaultTargetCodeGenInfo {<br>
+public:<br>
+  PPC64TargetCodeGenInfo(CodeGenTypes &CGT) : DefaultTargetCodeGenInfo(CGT) {}<br>
+<br>
+  int getDwarfEHStackPointer(CodeGen::CodeGenModule &M) const {<br>
+    // This is recovered from gcc output.<br>
+    return 1; // r1 is the dedicated stack pointer<br>
+  }<br>
+<br>
+  bool initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,<br>
+                               llvm::Value *Address) const;<br>
+};<br>
+<br>
+}<br>
+<br>
+bool<br>
+PPC64TargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,<br>
+                                                llvm::Value *Address) const {<br>
+  // This is calculated from the LLVM and GCC tables and verified<br>
+  // against gcc output.  AFAIK all ABIs use the same encoding.<br>
+<br>
+  CodeGen::CGBuilderTy &Builder = CGF.Builder;<br>
+<br>
+  llvm::IntegerType *i8 = CGF.Int8Ty;<br>
+  llvm::Value *Four8 = llvm::ConstantInt::get(i8, 4);<br>
+  llvm::Value *Eight8 = llvm::ConstantInt::get(i8, 8);<br>
+  llvm::Value *Sixteen8 = llvm::ConstantInt::get(i8, 16);<br>
+<br>
+  // 0-31: r0-31, the 8-byte general-purpose registers<br>
+  AssignToArrayRange(Builder, Address, Eight8, 0, 31);<br>
+<br>
+  // 32-63: fp0-31, the 8-byte floating-point registers<br>
+  AssignToArrayRange(Builder, Address, Eight8, 32, 63);<br>
+<br>
+  // 64-76 are various 4-byte special-purpose registers:<br>
+  // 64: mq<br>
+  // 65: lr<br>
+  // 66: ctr<br>
+  // 67: ap<br>
+  // 68-75 cr0-7<br>
+  // 76: xer<br>
+  AssignToArrayRange(Builder, Address, Four8, 64, 76);<br>
+<br>
+  // 77-108: v0-31, the 16-byte vector registers<br>
+  AssignToArrayRange(Builder, Address, Sixteen8, 77, 108);<br>
+<br>
+  // 109: vrsave<br>
+  // 110: vscr<br>
+  // 111: spe_acc<br>
+  // 112: spefscr<br>
+  // 113: sfp<br>
+  AssignToArrayRange(Builder, Address, Four8, 109, 113);<br>
+<br>
+  return false;<br>
+}<br>
<br>
 //===----------------------------------------------------------------------===//<br>
 // ARM ABI Implementation<br>
@@ -3634,6 +3692,8 @@<br>
<br>
   case llvm::Triple::ppc:<br>
     return *(TheTargetCodeGenInfo = new PPC32TargetCodeGenInfo(Types));<br>
+  case llvm::Triple::ppc64:<br>
+    return *(TheTargetCodeGenInfo = new PPC64TargetCodeGenInfo(Types));<br>
<br>
   case llvm::Triple::ptx32:<br>
   case llvm::Triple::ptx64:<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br>