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: [PATCH] Complex move by parts (PR rtl-optimization/20306)


>>>>> Richard Henderson writes:

Richard> Very close to what I had in mind.  The only other thing I'd
Richard> change is 

Richard> here, verify that the target has an appropriate fp move:

	Appended is the revised patch.

	Following up on Roger's previous comments, are you satisfied with
the previous move by parts behavior as the new default or are you
expecting someone else to further enhance this with a target hook?

Okay for mainline, 4.0 and 3.4 branch?

Thanks, David


	PR rtl-optimization/20306
	* expr.c (emit_move_complex): Set try_int false if mode is
	MODE_COMPLEX_FLOAT and mov_optab exists for inner mode.  Only try
	emit_block_move if try_int is true. 

Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.781
diff -c -p -r1.781 expr.c
*** expr.c	10 Mar 2005 23:28:01 -0000	1.781
--- expr.c	11 Mar 2005 15:11:44 -0000
*************** emit_move_complex (enum machine_mode mod
*** 2877,2895 ****
    if (push_operand (x, mode))
      return emit_move_complex_push (mode, x, y);
  
-   /* For memory to memory moves, optimal behavior can be had with the
-      existing block move logic.  */
-   if (MEM_P (x) && MEM_P (y))
-     {
-       emit_block_move (x, y, GEN_INT (GET_MODE_SIZE (mode)),
- 		       BLOCK_OP_NO_LIBCALL);
-       return get_last_insn ();
-     }
- 
    /* See if we can coerce the target into moving both values at once.  */
  
    /* Not possible if the values are inherently not adjacent.  */
!   if (GET_CODE (x) == CONCAT || GET_CODE (y) == CONCAT)
      try_int = false;
    /* Is possible if both are registers (or subregs of registers).  */
    else if (register_operand (x, mode) && register_operand (y, mode))
--- 2877,2890 ----
    if (push_operand (x, mode))
      return emit_move_complex_push (mode, x, y);
  
    /* See if we can coerce the target into moving both values at once.  */
  
+   /* Move floating point as parts.  */
+   if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT
+       && mov_optab->handlers[GET_MODE_INNER (mode)].insn_code != CODE_FOR_nothing)
+     try_int = false;
    /* Not possible if the values are inherently not adjacent.  */
!   else if (GET_CODE (x) == CONCAT || GET_CODE (y) == CONCAT)
      try_int = false;
    /* Is possible if both are registers (or subregs of registers).  */
    else if (register_operand (x, mode) && register_operand (y, mode))
*************** emit_move_complex (enum machine_mode mod
*** 2907,2913 ****
  
    if (try_int)
      {
!       rtx ret = emit_move_via_integer (mode, x, y);
        if (ret)
  	return ret;
      }
--- 2902,2919 ----
  
    if (try_int)
      {
!       rtx ret;
! 
!       /* For memory to memory moves, optimal behavior can be had with the
! 	 existing block move logic.  */
!       if (MEM_P (x) && MEM_P (y))
! 	{
! 	  emit_block_move (x, y, GEN_INT (GET_MODE_SIZE (mode)),
! 			   BLOCK_OP_NO_LIBCALL);
! 	  return get_last_insn ();
! 	}
! 
!       ret = emit_move_via_integer (mode, x, y);
        if (ret)
  	return ret;
      }


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