diff options
-rw-r--r-- | gcc/config/ia64/ia64.md | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md index 03cedc0..53fa9f3 100644 --- a/gcc/config/ia64/ia64.md +++ b/gcc/config/ia64/ia64.md @@ -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. @@ -107,6 +107,7 @@ (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") @@ -5048,6 +5049,33 @@ "" "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")]) ;; Non-local goto support. |