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]

PowerPC simd fix


	This patch fixes the simd-2.c and simd-4.c testsuite failures.
When the movMM patterns were converted to use rs6000_emit_move(), the
clobber required by movti was not taken into account.  Only the simd cases
seem to generate TImode moves to catch this bug.

David

        * config/rs6000/rs6000.md (movti_string): Remove clobber.
        * config/rs6000/rs6000.c (rs6000_emit_move, TImode): Explicitly 
        generate PARALLEL with clobber for TARGET_POWER.

Index: rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.414
diff -c -p -r1.414 rs6000.c
*** rs6000.c	15 Jan 2003 16:08:49 -0000	1.414
--- rs6000.c	15 Jan 2003 20:33:04 -0000
*************** rs6000_emit_move (dest, source, mode)
*** 2859,2864 ****
--- 2872,2887 ----
  	operands[1]
  	  = replace_equiv_address (operands[1],
  				   copy_addr_to_reg (XEXP (operands[1], 0)));
+       if (TARGET_POWER)
+ 	{
+ 	  emit_insn (gen_rtx_PARALLEL (VOIDmode,
+ 		       gen_rtvec (2,
+ 				  gen_rtx_SET (VOIDmode,
+ 					       operands[0], operands[1]),
+ 				  gen_rtx_CLOBBER (VOIDmode,
+ 						   gen_rtx_SCRATCH (SImode)))));
+ 	  return;
+ 	}
        break;
  
      default:
Index: rs6000.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.md,v
retrieving revision 1.228
diff -c -p -r1.228 rs6000.md
*** rs6000.md	9 Jan 2003 02:01:57 -0000	1.228
--- rs6000.md	15 Jan 2003 20:28:15 -0000
***************
*** 9346,9353 ****
  
  (define_insn "*movti_string"
    [(set (match_operand:TI 0 "reg_or_mem_operand" "=Q,m,????r,????r,????r")
! 	(match_operand:TI 1 "reg_or_mem_operand" "r,r,r,Q,m"))
!    (clobber (match_scratch:SI 2 "X,X,X,X,X"))]
    "TARGET_STRING && ! TARGET_POWER && ! TARGET_POWERPC64
     && (gpc_reg_operand (operands[0], TImode) || gpc_reg_operand (operands[1], TImode))"
    "*
--- 8648,8654 ----
  
  (define_insn "*movti_string"
    [(set (match_operand:TI 0 "reg_or_mem_operand" "=Q,m,????r,????r,????r")
! 	(match_operand:TI 1 "reg_or_mem_operand" "r,r,r,Q,m"))]
    "TARGET_STRING && ! TARGET_POWER && ! TARGET_POWERPC64
     && (gpc_reg_operand (operands[0], TImode) || gpc_reg_operand (operands[1], TImode))"
    "*


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