This is the mail archive of the gcc@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]

sparc.c changes



Fri Jan 30 20:24:36 1998  John Carr  <jfc@mit.edu>

	* sparc.c (output_move_double): Integer ldd is deprecated in V9.
	(output_function_epilogue): Do not write epilogue if it would never
	be executed.  Use V9 return instruction.
	(registers_ok_for_ldd_peep): Integer ldd is deprecated in V9.
	(print_operand): Do not use b,a on UltraSPARC.

*** /u1/jfc/src/egcs/gcc/config/sparc/sparc.c	Thu Jan 29 16:02:39 1998
--- sparc.c	Fri Jan 30 20:22:14 1998
***************
*** 1258,1262 ****
    src = SET_SRC (pat);
  
!   /* This matches "*return_[qhs]".  */
    if (arith_operand (src, GET_MODE (src)))
      return GET_MODE_SIZE (GET_MODE (src)) <= GET_MODE_SIZE (SImode);
--- 1284,1288 ----
    src = SET_SRC (pat);
  
!   /* This matches "*return_[qhs]i".  */
    if (arith_operand (src, GET_MODE (src)))
      return GET_MODE_SIZE (GET_MODE (src)) <= GET_MODE_SIZE (SImode);
***************
*** 2010,2020 ****
        /* In v9, ldd can be used for word aligned addresses, so technically
  	 some of this logic is unneeded.  We still avoid ldd if the address
! 	 is obviously unaligned though.  */
  
!       if (mem_aligned_8 (mem)
  	  /* If this is a floating point register higher than %f31,
  	     then we *must* use an aligned load, since `ld' will not accept
  	     the register number.  */
! 	  || (TARGET_V9 && REGNO (reg) >= 64))
  	{
  	  if (FP_REG_P (reg) || ! TARGET_ARCH64)
--- 2064,2087 ----
        /* In v9, ldd can be used for word aligned addresses, so technically
  	 some of this logic is unneeded.  We still avoid ldd if the address
! 	 is obviously unaligned though.
  
! 	 Integer ldd/std are deprecated in V9 and are slow on UltraSPARC.
! 	 Use them only if the access is volatile or not offsettable.  */
! 
!       if ((mem_aligned_8 (mem)
! 	   && (REGNO (reg) >= 32
! 	       || MEM_VOLATILE_P (mem)
! 	       || ! ((optype0 == OFFSOP || optype1 == OFFSOP)
! 		     && (sparc_cpu == PROCESSOR_ULTRASPARC
! 			 || sparc_cpu == PROCESSOR_V9))))
  	  /* If this is a floating point register higher than %f31,
  	     then we *must* use an aligned load, since `ld' will not accept
  	     the register number.  */
! 	  || (TARGET_V9 && REGNO (reg) >= 64)
! 	  /* Even if two instructions would otherwise be better than ldd/std,
! 	     if this insn was put in a delay slot because reorg thought it
! 	     was only one machine instruction, make sure it is only one
! 	     instruction.  */
! 	  || dbr_sequence_length () != 0)
  	{
  	  if (FP_REG_P (reg) || ! TARGET_ARCH64)
*** 3505,3508 ****
--- 3569,3582 ----
  #endif
  
+   else if (current_function_epilogue_delay_list == 0)
+     {
+       /* If code does not drop into the epilogue, do nothing.  */
+       rtx insn = get_last_insn ();
+       if (GET_CODE (insn) == NOTE)
+ 	insn = prev_nonnote_insn (insn);
+       if (insn && GET_CODE (insn) == BARRIER)
+ 	return;
+     }
+ 
    /* Restore any call saved registers.  */
    if (num_gfregs)
***************
*** 3558,3561 ****
--- 3632,3637 ----
  	      final_scan_insn (insn, file, 1, 0, 1);
  	    }
+ 	  else if (TARGET_V9 && ! SKIP_CALLERS_UNIMP_P)
+ 	    fputs ("\treturn %i7+8\n\tnop\n", file);
  	  else
  	    fprintf (file, "\t%s\n\trestore\n", ret);
***************
*** 4599,4602 ****
--- 4675,4680 ----
        if (SKIP_CALLERS_UNIMP_P)
  	return "jmp %%i7+12\n\trestore";
+       else if (TARGET_V9)
+ 	return "return %%i7+8\n\tnop";
        else
  	return "ret\n\trestore";
***************
*** 4646,4649 ****
--- 4723,4730 ----
      return 0;
  
+   /* Integer ldd is deprecated in SPARC V9 */
+   if (TARGET_V9 && REGNO (reg1) < 32)
+     return 0;
+ 
    return (REGNO (reg1) == REGNO (reg2) - 1);
  }
***************
*** 4762,4767 ****
  	 are optimizing.  This is always used with '(' below.  */
        /* Sun OS 4.1.1 dbx can't handle an annulled unconditional branch;
! 	 this is a dbx bug.  So, we only do this when optimizing.  */
!       if (dbr_sequence_length () == 0 && optimize)
  	fputs (",a", file);
        return;
--- 4843,4852 ----
  	 are optimizing.  This is always used with '(' below.  */
        /* Sun OS 4.1.1 dbx can't handle an annulled unconditional branch;
! 	 this is a dbx bug.  So, we only do this when optimizing.
! 
! 	 On UltraSPARC, a branch in a delay slot causes a pipeline flush.
! 	 Always emit a nop in case the next instruction is a branch.  */
!       if (dbr_sequence_length () == 0
! 	  && (optimize && (int)sparc_cpu < PROCESSOR_V8PLUS))
  	fputs (",a", file);
        return;
***************
*** 4769,4773 ****
        /* Output a 'nop' if there's nothing for the delay slot and we are
  	 not optimizing.  This is always used with '*' above.  */
!       if (dbr_sequence_length () == 0 && ! optimize)
  	fputs ("\n\tnop", file);
        return;
--- 4854,4859 ----
        /* Output a 'nop' if there's nothing for the delay slot and we are
  	 not optimizing.  This is always used with '*' above.  */
!       if (dbr_sequence_length () == 0
! 	  && ! (optimize && (int)sparc_cpu < PROCESSOR_V8PLUS))
  	fputs ("\n\tnop", file);
        return;


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