ia64.h (SIMULTANEOUS PREFETCHES): Define.
authorJanis Johnson <janis@gcc.gnu.org>
Tue, 4 Dec 2001 00:42:41 +0000 (00:42 +0000)
committerJanis Johnson <janis@gcc.gnu.org>
Tue, 4 Dec 2001 00:42:41 +0000 (00:42 +0000)
* config/ia64/ia64.h (SIMULTANEOUS PREFETCHES): Define.
  (PREFETCH_BLOCK): Define.
* config/ia64/ia64.md (itanium_class): Add lfetch.
  (prefetch, prefetch_internal): New.

From-SVN: r47579

gcc/config/ia64/ia64.md

index 03cedc0fad044b614d4957be435097e6e8473458..53fa9f3dfd0230fe45112d2e8f9a0e85662267bd 100644 (file)
@@ -99,7 +99,7 @@
 ;; multiple instructions, patterns which emit 0 instructions, and patterns
 ;; which emit instruction that can go in any slot (e.g. nop).
 
-(define_attr "itanium_class" "unknown,ignore,stop_bit,br,fcmp,fcvtfx,fld,fmac,fmisc,frar_i,frar_m,frbr,frfr,frpr,ialu,icmp,ilog,ishf,ld,chk_s,long_i,mmmul,mmshf,mmshfi,rse_m,scall,sem,stf,st,syst_m0,syst_m,tbit,toar_i,toar_m,tobr,tofr,topr,xmpy,xtd,nop_b,nop_f,nop_i,nop_m,nop_x"
+(define_attr "itanium_class" "unknown,ignore,stop_bit,br,fcmp,fcvtfx,fld,fmac,fmisc,frar_i,frar_m,frbr,frfr,frpr,ialu,icmp,ilog,ishf,ld,chk_s,long_i,mmmul,mmshf,mmshfi,rse_m,scall,sem,stf,st,syst_m0,syst_m,tbit,toar_i,toar_m,tobr,tofr,topr,xmpy,xtd,nop_b,nop_f,nop_i,nop_m,nop_x,lfetch"
          (const_string "unknown"))
 
 ;; chk_s has an I and an M form; use type A for convenience.
   (cond [(eq_attr "itanium_class" "ld,st,fld,stf,sem,nop_m") (const_string "M")
         (eq_attr "itanium_class" "rse_m,syst_m,syst_m0") (const_string "M")
         (eq_attr "itanium_class" "frar_m,toar_m,frfr,tofr") (const_string "M")
+        (eq_attr "itanium_class" "lfetch") (const_string "M")
         (eq_attr "itanium_class" "chk_s,ialu,icmp,ilog") (const_string "A")
         (eq_attr "itanium_class" "fmisc,fmac,fcmp,xmpy") (const_string "F")
         (eq_attr "itanium_class" "fcvtfx,nop_f") (const_string "F")
   ""
   "break.f 0"
   [(set_attr "itanium_class" "nop_f")])
+
+(define_insn "prefetch"
+  [(prefetch (match_operand:DI 0 "address_operand" "p")
+            (match_operand:DI 1 "const_int_operand" "n")
+            (match_operand:DI 2 "const_int_operand" "n"))]
+  ""
+{
+  static const char * const alt[2][4] = {
+    "lfetch.nta [%0]",
+    "lfetch.nt1 [%0]",
+    "lfetch.nt2 [%0]",
+    "lfetch [%0]",
+    "lfetch.excl.nta [%0]",
+    "lfetch.excl.nt1 [%0]",
+    "lfetch.excl.nt2 [%0]",
+    "lfetch.excl [%0]"
+  };
+  int i = (INTVAL (operands[1]));
+  int j = (INTVAL (operands[2]));
+
+  if (i != 0 && i != 1)
+    abort ();
+  if (j < 0 || j > 3)
+    abort ();
+  return alt[i][j];
+}
+  [(set_attr "itanium_class" "lfetch")])
 \f
 ;; Non-local goto support.