This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: prefetch pointer mode patch


> There are similar uses of Pmode in expand_builtin_prefetch in 
> builtins.c;
> they should change as well.
>

thanks.  done.

2002-01-24  Aldy Hernandez  <aldyh@redhat.com>

	* loop.c (emit_prefetch_instructions): Use the prefetch insn's
	mode, not Pmode.

	* builtins.c (expand_builtin_prefetch): Same.

Index: builtins.c
===================================================================
RCS file: /cvs/uberbaum/gcc/builtins.c,v
retrieving revision 1.139
diff -c -p -r1.139 builtins.c
*** builtins.c	2002/01/03 16:05:51	1.139
--- builtins.c	2002/01/24 17:51:13
*************** expand_builtin_prefetch (arglist)
*** 785,791 ****
     if (HAVE_prefetch)
       {
         if (! (*insn_data[(int)CODE_FOR_prefetch].operand[0].predicate)
! 	    (op0, Pmode))
           op0 = force_reg (Pmode, op0);
         emit_insn (gen_prefetch (op0, op1, op2));
       }
--- 785,792 ----
     if (HAVE_prefetch)
       {
         if (! (*insn_data[(int)CODE_FOR_prefetch].operand[0].predicate)
! 	    (op0,
! 	     insn_data[(int)CODE_FOR_prefetch].operand[0].mode))
           op0 = force_reg (Pmode, op0);
         emit_insn (gen_prefetch (op0, op1, op2));
       }
Index: loop.c
===================================================================
RCS file: /cvs/uberbaum/gcc/loop.c,v
retrieving revision 1.380
diff -c -p -r1.380 loop.c
*** loop.c	2002/01/23 09:50:39	1.380
--- loop.c	2002/01/24 17:51:38
*************** emit_prefetch_instructions (loop)
*** 4023,4029 ****

   	      /* Make sure the address operand is valid for prefetch.  */
   	      if (! (*insn_data[(int)CODE_FOR_prefetch].operand[0].predicate)
! 		    (loc, Pmode))
   		loc = force_reg (Pmode, loc);
   	      emit_insn_before (gen_prefetch (loc, GEN_INT (info[i].write),
   		                              GEN_INT (3)),
--- 4023,4030 ----

   	      /* Make sure the address operand is valid for prefetch.  */
   	      if (! (*insn_data[(int)CODE_FOR_prefetch].operand[0].predicate)
! 		    (loc,
! 		     insn_data[(int)CODE_FOR_prefetch].operand[0].mode))
   		loc = force_reg (Pmode, loc);
   	      emit_insn_before (gen_prefetch (loc, GEN_INT (info[i].write),
   		                              GEN_INT (3)),
*************** emit_prefetch_instructions (loop)
*** 4051,4061 ****
   	       (!info[i].prefetch_in_loop || y < ahead)
   	       && y * PREFETCH_BLOCK < (int) info[i].total_bytes; y ++)
   	    {
! 	      rtx reg = gen_reg_rtx (Pmode);
   	      rtx loop_start = loop->start;
   	      rtx add_val = simplify_gen_binary (PLUS, Pmode,
   						 info[i].giv->add_val,
   						 GEN_INT (y * PREFETCH_BLOCK));

   	      loop_iv_add_mult_emit_before (loop, 
info[i].class->initial_value,
   					    info[i].giv->mult_val,
--- 4052,4064 ----
   	       (!info[i].prefetch_in_loop || y < ahead)
   	       && y * PREFETCH_BLOCK < (int) info[i].total_bytes; y ++)
   	    {
! 	      rtx reg;
   	      rtx loop_start = loop->start;
   	      rtx add_val = simplify_gen_binary (PLUS, Pmode,
   						 info[i].giv->add_val,
   						 GEN_INT (y * PREFETCH_BLOCK));
+
+ 	      reg = gen_reg_rtx 
(insn_data[(int)CODE_FOR_prefetch].operand[0].mode);

   	      loop_iv_add_mult_emit_before (loop, 
info[i].class->initial_value,
   					    info[i].giv->mult_val,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]