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]

Removal of FUNCTION_ARG_REG_LITTLE_ENDIAN macro


This is one of two patches to change how structure arguments are passed
on HP-UX IA64.  The macro FUNCTION_ARG_REG_LITTLE_ENDIAN was introduced
to handle this but David Anglin did it another way for PA64 and that way
did not require this macro so I would like to remove it and then (in a
seperate patch) use that other method for HP-UX IA64 as well.

2002-12-03  Steve Ellcey  <sje@cup.hp.com>

	* doc/tm.texi (FUNCTION_ARG_REG_LITTLE_ENDIAN): Remove definition.
	* defaults.h (FUNCTION_ARG_REG_LITTLE_ENDIAN): Remove definition.
	* calls.c (store_unaligned_arguments_into_pseudos) Remove
	use of FUNCTION_ARG_REG_LITTLE_ENDIAN.
	* stmt.c (expand_return): Ditto.
	* expr.c (move_block_from_reg): Ditto.
	(copy_blkmode_from_reg): Ditto.
	* expmed.c (store_bit_field): Ditto. 

*** gcc.orig/gcc/doc/tm.texi	Mon Dec  2 15:50:19 2002
--- gcc/gcc/doc/tm.texi	Mon Dec  2 15:50:39 2002
*************** nonzero, the caller does not make a copy
*** 3584,3597 ****
  determined that the value won't be modified, it need not make a copy;
  otherwise a copy must be made.
  
- @findex FUNCTION_ARG_REG_LITTLE_ENDIAN
- @item FUNCTION_ARG_REG_LITTLE_ENDIAN
- If defined TRUE on a big-endian system then structure arguments passed
- (and returned) in registers are passed in a little-endian manner instead of
- the big-endian manner.  On the HP-UX IA64 and PA64 platforms structures are
- aligned differently then integral values and setting this value to true will
- allow for the special handling of structure arguments and return values.
- 
  @findex CUMULATIVE_ARGS
  @item CUMULATIVE_ARGS
  A C type for declaring a variable that is used as the first argument of
--- 3584,3589 ----
*** gcc.orig/gcc/defaults.h	Mon Dec  2 15:55:39 2002
--- gcc/gcc/defaults.h	Mon Dec  2 15:55:49 2002
*************** You Lose!  You must define PREFERRED_DEB
*** 513,528 ****
  #define PREFERRED_DEBUGGING_TYPE NO_DEBUG
  #endif
  
- /* This is set to 1 if BYTES_BIG_ENDIAN is defined but the target uses a
-    little-endian method of passing and returning structures in registers.
-    On the HP-UX IA64 and PA64 platforms structures are aligned differently
-    then integral values and setting this value to 1 will allow for the
-    special handling of structure arguments and return values in regs.  */
- 
- #ifndef FUNCTION_ARG_REG_LITTLE_ENDIAN
- #define FUNCTION_ARG_REG_LITTLE_ENDIAN 0
- #endif
- 
  /* Define codes for all the float formats that we know of.  */
  #define UNKNOWN_FLOAT_FORMAT 0
  #define IEEE_FLOAT_FORMAT 1
--- 513,518 ----
*** gcc.orig/gcc/calls.c	Mon Dec  2 15:49:51 2002
--- gcc/gcc/calls.c	Mon Dec  2 15:51:17 2002
*************** store_unaligned_arguments_into_pseudos (
*** 1071,1077 ****
  	   this means we must skip the empty high order bytes when
  	   calculating the bit offset.  */
  	if (BYTES_BIG_ENDIAN
- 	    && !FUNCTION_ARG_REG_LITTLE_ENDIAN
  	    && bytes < UNITS_PER_WORD)
  	  big_endian_correction = (BITS_PER_WORD  - (bytes * BITS_PER_UNIT));
  
--- 1071,1076 ----
*** gcc.orig/gcc/stmt.c	Mon Dec  2 15:50:00 2002
--- gcc/gcc/stmt.c	Mon Dec  2 15:52:10 2002
*************** expand_return (retval)
*** 3106,3112 ****
  	 machine, this means we must skip the empty high order bytes when
  	 calculating the bit offset.  */
        if (BYTES_BIG_ENDIAN
- 	  && !FUNCTION_ARG_REG_LITTLE_ENDIAN
  	  && bytes % UNITS_PER_WORD)
  	big_endian_correction = (BITS_PER_WORD - ((bytes % UNITS_PER_WORD)
  						  * BITS_PER_UNIT));
--- 3106,3111 ----
*** gcc.orig/gcc/expr.c	Mon Dec  2 15:49:53 2002
--- gcc/gcc/expr.c	Mon Dec  2 15:53:50 2002
*************** move_block_from_reg (regno, x, nregs, si
*** 2147,2154 ****
    /* If SIZE is that of a mode no bigger than a word, just use that
       mode's store operation.  */
    if (size <= UNITS_PER_WORD
!       && (mode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0)) != BLKmode
!       && !FUNCTION_ARG_REG_LITTLE_ENDIAN)
      {
        emit_move_insn (adjust_address (x, mode, 0), gen_rtx_REG (mode, regno));
        return;
--- 2147,2153 ----
    /* If SIZE is that of a mode no bigger than a word, just use that
       mode's store operation.  */
    if (size <= UNITS_PER_WORD
!       && (mode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0)) != BLKmode)
      {
        emit_move_insn (adjust_address (x, mode, 0), gen_rtx_REG (mode, regno));
        return;
*************** move_block_from_reg (regno, x, nregs, si
*** 2157,2165 ****
    /* Blocks smaller than a word on a BYTES_BIG_ENDIAN machine must be aligned
       to the left before storing to memory.  Note that the previous test
       doesn't handle all cases (e.g. SIZE == 3).  */
!   if (size < UNITS_PER_WORD
!       && BYTES_BIG_ENDIAN
!       && !FUNCTION_ARG_REG_LITTLE_ENDIAN)
      {
        rtx tem = operand_subword (x, 0, 1, BLKmode);
        rtx shift;
--- 2156,2162 ----
    /* Blocks smaller than a word on a BYTES_BIG_ENDIAN machine must be aligned
       to the left before storing to memory.  Note that the previous test
       doesn't handle all cases (e.g. SIZE == 3).  */
!   if (size < UNITS_PER_WORD && BYTES_BIG_ENDIAN)
      {
        rtx tem = operand_subword (x, 0, 1, BLKmode);
        rtx shift;
*************** copy_blkmode_from_reg (tgtblk, srcreg, t
*** 2523,2548 ****
      }
  
    /* This code assumes srcreg is at least a full word.  If it isn't, copy it
!      into a new pseudo which is a full word.
  
-      If FUNCTION_ARG_REG_LITTLE_ENDIAN is set and convert_to_mode does a copy,
-      the wrong part of the register gets copied so we fake a type conversion
-      in place.  */
    if (GET_MODE (srcreg) != BLKmode
        && GET_MODE_SIZE (GET_MODE (srcreg)) < UNITS_PER_WORD)
!     {
!       if (FUNCTION_ARG_REG_LITTLE_ENDIAN)
! 	srcreg = simplify_gen_subreg (word_mode, srcreg, GET_MODE (srcreg), 0);
!       else
! 	srcreg = convert_to_mode (word_mode, srcreg, TREE_UNSIGNED (type));
!     }
  
    /* Structures whose size is not a multiple of a word are aligned
       to the least significant byte (to the right).  On a BYTES_BIG_ENDIAN
       machine, this means we must skip the empty high order bytes when
       calculating the bit offset.  */
    if (BYTES_BIG_ENDIAN
-       && !FUNCTION_ARG_REG_LITTLE_ENDIAN
        && bytes % UNITS_PER_WORD)
      big_endian_correction
        = (BITS_PER_WORD - ((bytes % UNITS_PER_WORD) * BITS_PER_UNIT));
--- 2520,2536 ----
      }
  
    /* This code assumes srcreg is at least a full word.  If it isn't, copy it
!      into a new pseudo which is a full word.  */
  
    if (GET_MODE (srcreg) != BLKmode
        && GET_MODE_SIZE (GET_MODE (srcreg)) < UNITS_PER_WORD)
!     srcreg = convert_to_mode (word_mode, srcreg, TREE_UNSIGNED (type));
  
    /* Structures whose size is not a multiple of a word are aligned
       to the least significant byte (to the right).  On a BYTES_BIG_ENDIAN
       machine, this means we must skip the empty high order bytes when
       calculating the bit offset.  */
    if (BYTES_BIG_ENDIAN
        && bytes % UNITS_PER_WORD)
      big_endian_correction
        = (BITS_PER_WORD - ((bytes % UNITS_PER_WORD) * BITS_PER_UNIT));
*** gcc.orig/gcc/expmed.c	Mon Dec  2 15:49:58 2002
--- gcc/gcc/expmed.c	Mon Dec  2 15:51:24 2002
*************** store_bit_field (str_rtx, bitsize, bitnu
*** 404,410 ****
       But as we have it, it counts within whatever size OP0 now has.
       On a bigendian machine, these are not the same, so convert.  */
    if (BYTES_BIG_ENDIAN
-       && !FUNCTION_ARG_REG_LITTLE_ENDIAN
        && GET_CODE (op0) != MEM
        && unit > GET_MODE_BITSIZE (GET_MODE (op0)))
      bitpos += unit - GET_MODE_BITSIZE (GET_MODE (op0));
--- 404,409 ----


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