[llvm-commits] CVS: llvm/include/llvm/Intrinsics.td

Chris Lattner lattner at cs.uiuc.edu
Mon Mar 13 14:38:44 PST 2006



Changes in directory llvm/include/llvm:

Intrinsics.td updated: 1.6 -> 1.7
---
Log message:

Add a first ppc altivec intrinsic.  Add packed type support.


---
Diffs of the changes:  (+30 -0)

 Intrinsics.td |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+)


Index: llvm/include/llvm/Intrinsics.td
diff -u llvm/include/llvm/Intrinsics.td:1.6 llvm/include/llvm/Intrinsics.td:1.7
--- llvm/include/llvm/Intrinsics.td:1.6	Mon Mar 13 07:07:37 2006
+++ llvm/include/llvm/Intrinsics.td	Mon Mar 13 16:38:32 2006
@@ -54,6 +54,11 @@
   string TypeVal = typeval;
 }
 
+class LLVMPackedType<int numelts, LLVMType elty> : LLVMType<"Type::PackedTyID">{
+  int NumElts = numelts;
+  LLVMType ElTy = elty;
+} 
+
 def llvm_void_ty       : LLVMType<"Type::VoidTyID">;
 def llvm_bool_ty       : LLVMType<"Type::BoolTyID">;
 def llvm_sbyte_ty      : LLVMType<"Type::SByteTyID">;
@@ -71,6 +76,10 @@
 def llvm_anchor_ty     : LLVMType<"Type::PointerTyID">;     // {}*
 def llvm_descriptor_ty : LLVMType<"Type::PointerTyID">;     // global*
 
+def llvm_v4i32_ty      : LLVMPackedType<4, llvm_int_ty>;    // 4 x int
+def llvm_v4f32_ty      : LLVMPackedType<4, llvm_float_ty>;  // 4 x float
+def llvm_v2f64_ty      : LLVMPackedType<4, llvm_float_ty>;  // 2 x double
+
 //===----------------------------------------------------------------------===//
 // Intrinsic Definitions.
 //===----------------------------------------------------------------------===//
@@ -88,10 +97,18 @@
                 list<IntrinsicProperty> properties = [],
                 string name = ""> {
   string LLVMName = name;
+  string GCCBuiltinName = "";
   list<LLVMType> Types = types;
   list<IntrinsicProperty> Properties = properties;
 }
 
+/// GCCBuiltin - If this intrinsic exactly corresponds to a GCC builtin, this
+/// specifies the name of the builtin.  This provides automatic CBE and CFE
+/// support.
+class GCCBuiltin<string name> {
+  string GCCBuiltinName = name;
+}
+
 
 //===--------------- Variable Argument Handling Intrinsics ----------------===//
 //  
@@ -189,3 +206,16 @@
 def int_dbg_func_start   : Intrinsic<[llvm_void_ty, llvm_descriptor_ty]>;
 //    dbg_declare,      // Declare a local object
 
+
+
+//===----------------------------------------------------------------------===//
+// Target-specific intrinsics
+//===----------------------------------------------------------------------===//
+
+//===----------------------------------------------------------------------===//
+// PowerPC Intrinsics
+
+def int_ppc_altivec_lvx : Intrinsic<[llvm_v4i32_ty, llvm_int_ty, llvm_ptr_ty],
+                                    [IntrReadMem]>,
+                          GCCBuiltin<"__builtin_altivec_lvx">;
+






More information about the llvm-commits mailing list