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]

X86_64 merger part 31 - ix86_force_to_memory



Mon Mar 26 17:12:18 CEST 2001  Jan Hubicka  <jh@suse.cz>

	* i386.c (ix86_force_to_memory, ix86_free_from_memory): Update.

*** /home/hubicka/egcs/gcc/config/i386/i386.c	Mon Mar 26 16:14:42 2001
--- i386.c	Mon Mar 26 16:42:59 2001
*************** ix86_force_to_memory (mode, operand)
*** 10086,10130 ****
       enum machine_mode mode;
       rtx operand;
  {
    if (!reload_completed)
      abort ();
!   switch (mode)
      {
!       case DImode:
  	{
! 	  rtx operands[2];
! 	  split_di (&operand, 1, operands, operands+1);
  	  emit_insn (
! 	    gen_rtx_SET (VOIDmode,
! 			 gen_rtx_MEM (SImode,
! 				      gen_rtx_PRE_DEC (Pmode,
! 						       stack_pointer_rtx)),
! 			 operands[1]));
  	  emit_insn (
! 	    gen_rtx_SET (VOIDmode,
! 			 gen_rtx_MEM (SImode,
! 				      gen_rtx_PRE_DEC (Pmode,
! 						       stack_pointer_rtx)),
! 			 operands[0]));
  	}
! 	break;
!       case HImode:
! 	/* It is better to store HImodes as SImodes.  */
! 	if (!TARGET_PARTIAL_REG_STALL)
! 	  operand = gen_lowpart (SImode, operand);
! 	/* FALLTHRU */
!       case SImode:
! 	emit_insn (
! 	  gen_rtx_SET (VOIDmode,
! 		       gen_rtx_MEM (GET_MODE (operand),
! 				    gen_rtx_PRE_DEC (SImode,
! 						     stack_pointer_rtx)),
! 		       operand));
! 	break;
!       default:
! 	abort();
      }
!   return gen_rtx_MEM (mode, stack_pointer_rtx);
  }
  
  /* Free operand from the memory.  */
--- 11275,11354 ----
       enum machine_mode mode;
       rtx operand;
  {
+   rtx result;
    if (!reload_completed)
      abort ();
!   if (TARGET_64BIT && TARGET_RED_ZONE)
      {
!       result = gen_rtx_MEM (mode,
! 			    gen_rtx_PLUS (Pmode,
! 					  stack_pointer_rtx,
! 					  GEN_INT (-RED_ZONE_SIZE)));
!       emit_move_insn (result, operand);
!     }
!   else if (TARGET_64BIT && !TARGET_RED_ZONE)
!     {
!       switch (mode)
  	{
! 	case HImode:
! 	case SImode:
! 	  /* It is better to store HImodes as SImodes.  */
! 	  operand = gen_lowpart (DImode, operand);
! 	  /* FALLTHRU */
! 	case DImode:
  	  emit_insn (
! 		      gen_rtx_SET (VOIDmode,
! 				   gen_rtx_MEM (DImode,
! 						gen_rtx_PRE_DEC (DImode,
! 							stack_pointer_rtx)),
! 				   operand));
! 	  break;
! 	default:
! 	  abort ();
! 	}
!       result = gen_rtx_MEM (mode, stack_pointer_rtx);
!     }
!   else
!     {
!       switch (mode)
! 	{
! 	case DImode:
! 	  {
! 	    rtx operands[2];
! 	    split_di (&operand, 1, operands, operands + 1);
! 	    emit_insn (
! 			gen_rtx_SET (VOIDmode,
! 				     gen_rtx_MEM (SImode,
! 						  gen_rtx_PRE_DEC (Pmode,
! 							stack_pointer_rtx)),
! 				     operands[1]));
! 	    emit_insn (
! 			gen_rtx_SET (VOIDmode,
! 				     gen_rtx_MEM (SImode,
! 						  gen_rtx_PRE_DEC (Pmode,
! 							stack_pointer_rtx)),
! 				     operands[0]));
! 	  }
! 	  break;
! 	case HImode:
! 	  /* It is better to store HImodes as SImodes.  */
! 	  if (!TARGET_PARTIAL_REG_STALL)
! 	    operand = gen_lowpart (SImode, operand);
! 	  /* FALLTHRU */
! 	case SImode:
  	  emit_insn (
! 		      gen_rtx_SET (VOIDmode,
! 				   gen_rtx_MEM (GET_MODE (operand),
! 						gen_rtx_PRE_DEC (SImode,
! 							stack_pointer_rtx)),
! 				   operand));
! 	  break;
! 	default:
! 	  abort ();
  	}
!       result = gen_rtx_MEM (mode, stack_pointer_rtx);
      }
!   return result;
  }
  
  /* Free operand from the memory.  */
*************** void
*** 10132,10146 ****
  ix86_free_from_memory (mode)
       enum machine_mode mode;
  {
!   /* Use LEA to deallocate stack space.  In peephole2 it will be converted
!      to pop or add instruction if registers are available.  */
!   emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx,
! 			  gen_rtx_PLUS (Pmode, stack_pointer_rtx,
! 					GEN_INT (mode == DImode
! 						 ? 8
! 						 : mode == HImode && TARGET_PARTIAL_REG_STALL
! 						 ? 2
! 						 : 4))));
  }
  
  /* Put float CONST_DOUBLE in the constant pool instead of fp regs.
--- 11356,11374 ----
  ix86_free_from_memory (mode)
       enum machine_mode mode;
  {
!   if (!TARGET_64BIT || !TARGET_RED_ZONE)
!     {
!       /* Use LEA to deallocate stack space.  In peephole2 it will be converted
!          to pop or add instruction if registers are available.  */
!       emit_insn (gen_rtx_SET (VOIDmode, stack_pointer_rtx,
! 			      gen_rtx_PLUS (Pmode, stack_pointer_rtx,
! 					    GEN_INT (mode == DImode
! 						     || TARGET_64BIT
! 						     ? 8
! 						     : mode == HImode && TARGET_PARTIAL_REG_STALL
! 						     ? 2
! 						     : 4))));
!     }
  }
  
  /* Put float CONST_DOUBLE in the constant pool instead of fp regs.


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