prefetch pointer mode patch

Aldy Hernandez aldyh@redhat.com
Thu Jan 24 02:38:00 GMT 2002


the mode for prefetch is wrong.  it should look in the prefetch's mode,
not set the mode arbitrarily to Pmode.

this way, what david is trying to do with the V4SI mode for prefetch
will work (with some other tweaks ;-)):

         [(prefetch (match_operand:V4SI 0 "address_operand" "p")

ok?

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

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

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 08:13:49
*************** 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,



More information about the Gcc-patches mailing list