Add PowerPC intrinsics to support dcbz[l]
authorChris Lattner <sabre@nondot.org>
Tue, 6 Jun 2006 21:29:23 +0000 (21:29 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 6 Jun 2006 21:29:23 +0000 (21:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28696 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IntrinsicsPowerPC.td
lib/Target/PowerPC/PPCInstrFormats.td
lib/Target/PowerPC/PPCInstrInfo.td

index f344f3ebcee1d994d82b41024f4777530a1e23b9..2d128aa556e55f9d00abd08ab58b2e1edf6c7bc3 100644 (file)
 // Definitions for all PowerPC intrinsics.
 //
 
+// Non-altivec intrinsics.
+let TargetPrefix = "ppc" in {  // All intrinsics start with "llvm.ppc.".
+  // dcbz instruction.
+  def int_ppc_dcbz :  Intrinsic<[llvm_void_ty, llvm_ptr_ty], [IntrWriteMem]>;
+  // dcbzl (PPC970) instruction.
+  def int_ppc_dcbzl : Intrinsic<[llvm_void_ty, llvm_ptr_ty], [IntrWriteMem]>;
+}
+
+
 let TargetPrefix = "ppc" in {  // All PPC intrinsics start with "llvm.ppc.".
   /// PowerPC_Vec_Intrinsic - Base class for all altivec intrinsics.
   class PowerPC_Vec_Intrinsic<string GCCIntSuffix, list<LLVMType> types,
index 10ac79b1c2e34eb698ccb75cf07a904b40514f2e..bb0ccf89b0050b5771118936e21769663c3a6793 100644 (file)
@@ -325,6 +325,23 @@ class XForm_28<bits<6> opcode, bits<10> xo, dag OL, string asmstr,
   : XForm_base_r3xo<opcode, xo, OL, asmstr, itin, pattern> {
 }
 
+// DCB_Form - Form X instruction, used for dcb* instructions.
+class DCB_Form<bits<10> xo, bits<5> immfield, dag OL, string asmstr, 
+                      InstrItinClass itin, list<dag> pattern>
+  : I<31, OL, asmstr, itin> {
+  bits<5> A;
+  bits<5> B;
+
+  let Pattern = pattern;
+
+  let Inst{6-10}  = immfield;
+  let Inst{11-15} = A;
+  let Inst{16-20} = B;
+  let Inst{21-30} = xo;
+  let Inst{31}    = 0;
+}
+
+
 // DSS_Form - Form X instruction, used for altivec dss* instructions.
 class DSS_Form<bits<10> xo, dag OL, string asmstr, 
                       InstrItinClass itin, list<dag> pattern>
index d75c7940795e1332df525025776c953b63963a45..c93e0d4d835360024f215347693155e433a831c5 100644 (file)
@@ -318,6 +318,14 @@ let isCall = 1, noResults = 1, PPC970_Unit = 7,
                            [(PPCbctrl)]>;
 }
 
+// DCB* instructions.
+def DCBZ : DCB_Form<1014, 0, (ops memrr:$dst),
+                    "dcbz $dst", LdStDCBF, [(int_ppc_dcbz xoaddr:$dst)]>,
+                    PPC970_DGroup_Single;
+def DCBZL : DCB_Form<1014, 1, (ops memrr:$dst),
+                     "dcbzl $dst", LdStDCBF, [(int_ppc_dcbzl xoaddr:$dst)]>,
+                     PPC970_DGroup_Single;
+                       
 // D-Form instructions.  Most instructions that perform an operation on a
 // register and an immediate are of this type.
 //