Fix a bunch of SSE/AVX patterns to use v2i64/v4i64 loads since all other integer...
[oota-llvm.git] / docs / CodeGenerator.html
index 8d3b7d9b4b3c364062ae213cb714d6239e6b976f..6d7b2ae59a43a7d33dc41cb91bf981a74960d3f8 100644 (file)
       <li><a href="#ppc_prolog">Prolog/Epilog</a></li>
       <li><a href="#ppc_dynamic">Dynamic Allocation</a></li>
       </ul></li>
+    <li><a href="#ptx">The PTX backend</a></li>
     </ul></li>
 
 </ol>
@@ -1812,6 +1813,8 @@ $ llc -regalloc=pbqp file.bc -o pbqp.s;
   <a name="proepicode">Prolog/Epilog Code Insertion</a>
 </h3>
 
+<div>
+
 <!-- _______________________________________________________________________ -->
 <h4>
   <a name="compact_unwind">Compact Unwind</a>
@@ -1830,7 +1833,7 @@ $ llc -regalloc=pbqp file.bc -o pbqp.s;
 
 <p>The compact unwind encoding is a 32-bit value, which is encoded in an
    architecture-specific way. It specifies which registers to restore and from
-   where, and how to unwind out of the funciton. When the linker creates a final
+   where, and how to unwind out of the function. When the linker creates a final
    linked image, it will create a <code>__TEXT,__unwind_info</code>
    section. This section is a small and fast way for the runtime to access
    unwind info for any given function. If we emit compact unwind info for the
@@ -1926,6 +1929,8 @@ $ llc -regalloc=pbqp file.bc -o pbqp.s;
 
 </div>
 
+</div>
+
 <!-- ======================================================================= -->
 <h3>
   <a name="latemco">Late Machine Code Optimizations</a>
@@ -2207,8 +2212,6 @@ is the key:</p>
   <tr>
     <th>Feature</th>
     <th>ARM</th>
-    <th>Alpha</th>
-    <th>Blackfin</th>
     <th>CellSPU</th>
     <th>MBlaze</th>
     <th>MSP430</th>
@@ -2216,7 +2219,6 @@ is the key:</p>
     <th>PTX</th>
     <th>PowerPC</th>
     <th>Sparc</th>
-    <th>SystemZ</th>
     <th>X86</th>
     <th>XCore</th>
   </tr>
@@ -2224,16 +2226,13 @@ is the key:</p>
 <tr>
   <td><a href="#feat_reliable">is generally reliable</a></td>
   <td class="yes"></td> <!-- ARM -->
-  <td class="unknown"></td> <!-- Alpha -->
-  <td class="no"></td> <!-- Blackfin -->
   <td class="no"></td> <!-- CellSPU -->
   <td class="no"></td> <!-- MBlaze -->
   <td class="unknown"></td> <!-- MSP430 -->
-  <td class="no"></td> <!-- Mips -->
+  <td class="yes"></td> <!-- Mips -->
   <td class="no"></td> <!-- PTX -->
   <td class="yes"></td> <!-- PowerPC -->
   <td class="yes"></td> <!-- Sparc -->
-  <td class="unknown"></td> <!-- SystemZ -->
   <td class="yes"></td> <!-- X86 -->
   <td class="unknown"></td> <!-- XCore -->
 </tr>
@@ -2241,8 +2240,6 @@ is the key:</p>
 <tr>
   <td><a href="#feat_asmparser">assembly parser</a></td>
   <td class="no"></td> <!-- ARM -->
-  <td class="no"></td> <!-- Alpha -->
-  <td class="no"></td> <!-- Blackfin -->
   <td class="no"></td> <!-- CellSPU -->
   <td class="yes"></td> <!-- MBlaze -->
   <td class="no"></td> <!-- MSP430 -->
@@ -2250,7 +2247,6 @@ is the key:</p>
   <td class="no"></td> <!-- PTX -->
   <td class="no"></td> <!-- PowerPC -->
   <td class="no"></td> <!-- Sparc -->
-  <td class="no"></td> <!-- SystemZ -->
   <td class="yes"></td> <!-- X86 -->
   <td class="no"></td> <!-- XCore -->
 </tr>
@@ -2258,8 +2254,6 @@ is the key:</p>
 <tr>
   <td><a href="#feat_disassembler">disassembler</a></td>
   <td class="yes"></td> <!-- ARM -->
-  <td class="no"></td> <!-- Alpha -->
-  <td class="no"></td> <!-- Blackfin -->
   <td class="no"></td> <!-- CellSPU -->
   <td class="yes"></td> <!-- MBlaze -->
   <td class="no"></td> <!-- MSP430 -->
@@ -2267,7 +2261,6 @@ is the key:</p>
   <td class="no"></td> <!-- PTX -->
   <td class="no"></td> <!-- PowerPC -->
   <td class="no"></td> <!-- Sparc -->
-  <td class="no"></td> <!-- SystemZ -->
   <td class="yes"></td> <!-- X86 -->
   <td class="no"></td> <!-- XCore -->
 </tr>
@@ -2275,8 +2268,6 @@ is the key:</p>
 <tr>
   <td><a href="#feat_inlineasm">inline asm</a></td>
   <td class="yes"></td> <!-- ARM -->
-  <td class="unknown"></td> <!-- Alpha -->
-  <td class="yes"></td> <!-- Blackfin -->
   <td class="no"></td> <!-- CellSPU -->
   <td class="yes"></td> <!-- MBlaze -->
   <td class="unknown"></td> <!-- MSP430 -->
@@ -2284,24 +2275,20 @@ is the key:</p>
   <td class="unknown"></td> <!-- PTX -->
   <td class="yes"></td> <!-- PowerPC -->
   <td class="unknown"></td> <!-- Sparc -->
-  <td class="unknown"></td> <!-- SystemZ -->
-  <td class="yes"><a href="#feat_inlineasm_x86">*</a></td> <!-- X86 -->
+  <td class="yes"></td> <!-- X86 -->
   <td class="unknown"></td> <!-- XCore -->
 </tr>
 
 <tr>
   <td><a href="#feat_jit">jit</a></td>
   <td class="partial"><a href="#feat_jit_arm">*</a></td> <!-- ARM -->
-  <td class="no"></td> <!-- Alpha -->
-  <td class="no"></td> <!-- Blackfin -->
   <td class="no"></td> <!-- CellSPU -->
   <td class="no"></td> <!-- MBlaze -->
   <td class="unknown"></td> <!-- MSP430 -->
-  <td class="no"></td> <!-- Mips -->
+  <td class="yes"></td> <!-- Mips -->
   <td class="unknown"></td> <!-- PTX -->
   <td class="yes"></td> <!-- PowerPC -->
   <td class="unknown"></td> <!-- Sparc -->
-  <td class="unknown"></td> <!-- SystemZ -->
   <td class="yes"></td> <!-- X86 -->
   <td class="unknown"></td> <!-- XCore -->
 </tr>
@@ -2309,8 +2296,6 @@ is the key:</p>
 <tr>
   <td><a href="#feat_objectwrite">.o&nbsp;file writing</a></td>
   <td class="no"></td> <!-- ARM -->
-  <td class="no"></td> <!-- Alpha -->
-  <td class="no"></td> <!-- Blackfin -->
   <td class="no"></td> <!-- CellSPU -->
   <td class="yes"></td> <!-- MBlaze -->
   <td class="no"></td> <!-- MSP430 -->
@@ -2318,7 +2303,6 @@ is the key:</p>
   <td class="no"></td> <!-- PTX -->
   <td class="no"></td> <!-- PowerPC -->
   <td class="no"></td> <!-- Sparc -->
-  <td class="no"></td> <!-- SystemZ -->
   <td class="yes"></td> <!-- X86 -->
   <td class="no"></td> <!-- XCore -->
 </tr>
@@ -2326,8 +2310,6 @@ is the key:</p>
 <tr>
   <td><a href="#feat_tailcall">tail calls</a></td>
   <td class="yes"></td> <!-- ARM -->
-  <td class="unknown"></td> <!-- Alpha -->
-  <td class="no"></td> <!-- Blackfin -->
   <td class="no"></td> <!-- CellSPU -->
   <td class="no"></td> <!-- MBlaze -->
   <td class="unknown"></td> <!-- MSP430 -->
@@ -2335,11 +2317,24 @@ is the key:</p>
   <td class="unknown"></td> <!-- PTX -->
   <td class="yes"></td> <!-- PowerPC -->
   <td class="unknown"></td> <!-- Sparc -->
-  <td class="unknown"></td> <!-- SystemZ -->
   <td class="yes"></td> <!-- X86 -->
   <td class="unknown"></td> <!-- XCore -->
 </tr>
 
+<tr>
+  <td><a href="#feat_segstacks">segmented stacks</a></td>
+  <td class="no"></td> <!-- ARM -->
+  <td class="no"></td> <!-- CellSPU -->
+  <td class="no"></td> <!-- MBlaze -->
+  <td class="no"></td> <!-- MSP430 -->
+  <td class="no"></td> <!-- Mips -->
+  <td class="no"></td> <!-- PTX -->
+  <td class="no"></td> <!-- PowerPC -->
+  <td class="no"></td> <!-- Sparc -->
+  <td class="partial"><a href="#feat_segstacks_x86">*</a></td> <!-- X86 -->
+  <td class="no"></td> <!-- XCore -->
+</tr>
+
 
 </table>
 
@@ -2381,9 +2376,6 @@ disassembling machine opcode bytes into MCInst's.</p>
 <p>This box indicates whether the target supports most popular inline assembly
 constraints and modifiers.</p>
 
-<p id="feat_inlineasm_x86">X86 lacks reliable support for inline assembly
-constraints relating to the X86 floating point stack.</p>
-
 </div>
 
 <!-- _______________________________________________________________________ -->
@@ -2426,6 +2418,22 @@ more more details</a>.</p>
 
 </div>
 
+<!-- _______________________________________________________________________ -->
+<h4 id="feat_segstacks">Segmented Stacks</h4>
+
+<div>
+
+<p>This box indicates whether the target supports segmented stacks. This
+replaces the traditional large C stack with many linked segments. It
+is compatible with the <a href="http://gcc.gnu.org/wiki/SplitStacks">gcc
+implementation</a> used by the Go front end.</p>
+
+<p id="feat_segstacks_x86">Basic support exists on the X86 backend. Currently
+vararg doesn't work and the object files are not marked the way the gold
+linker expects, but simple Go programs can be built by dragonegg.</p>
+
+</div>
+
 </div>
 
 <!-- ======================================================================= -->
@@ -2912,6 +2920,70 @@ MOVSX32rm16 -&gt; movsx, 32-bit register, 16-bit memory
 
 </div>
 
+</div>
+
+<!-- ======================================================================= -->
+<h3>
+  <a name="ptx">The PTX backend</a>
+</h3>
+
+<div>
+
+<p>The PTX code generator lives in the lib/Target/PTX directory. It is
+  currently a work-in-progress, but already supports most of the code
+  generation functionality needed to generate correct PTX kernels for
+  CUDA devices.</p>
+
+<p>The code generator can target PTX 2.0+, and shader model 1.0+.  The
+  PTX ISA Reference Manual is used as the primary source of ISA
+  information, though an effort is made to make the output of the code
+  generator match the output of the NVidia nvcc compiler, whenever
+  possible.</p>
+
+<p>Code Generator Options:</p>
+<table border="1" cellspacing="0">
+  <tr>
+    <th>Option</th>
+    <th>Description</th>
+ </tr>
+   <tr>
+     <td><code>double</code></td>
+     <td align="left">If enabled, the map_f64_to_f32 directive is
+       disabled in the PTX output, allowing native double-precision
+       arithmetic</td>
+  </tr>
+  <tr>
+    <td><code>no-fma</code></td>
+    <td align="left">Disable generation of Fused-Multiply Add
+      instructions, which may be beneficial for some devices</td>
+  </tr>
+  <tr>
+    <td><code>smxy / computexy</code></td>
+    <td align="left">Set shader model/compute capability to x.y,
+    e.g. sm20 or compute13</td>
+  </tr>
+</table>
+
+<p>Working:</p>
+<ul>
+  <li>Arithmetic instruction selection (including combo FMA)</li>
+  <li>Bitwise instruction selection</li>
+  <li>Control-flow instruction selection</li>
+  <li>Function calls (only on SM 2.0+ and no return arguments)</li>
+  <li>Addresses spaces (0 = global, 1 = constant, 2 = local, 4 =
+  shared)</li>
+  <li>Thread synchronization (bar.sync)</li>
+  <li>Special register reads ([N]TID, [N]CTAID, PMx, CLOCK, etc.)</li>
+</ul>
+
+<p>In Progress:</p>
+<ul>
+  <li>Robust call instruction selection</li>
+  <li>Stack frame allocation</li>
+  <li>Device-specific instruction scheduling optimizations</li>
+</ul>
+
+
 </div>
 
 </div>