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]

HP-UX IA64 ILP32 prefetch patch


This is a small patch to allow the prefetch builtin to work on systems
that support both 32 and 64 bit modes by defining
POINTERS_EXTEND_UNSIGNED.  HP-UX IA64 supports this (and the prefetch
operand) and this patch allows the existing prefetch tests in the
testsuite to pass in 32 bit mode.

If someone could review it and check it in if it is acceptable I would
appreciate it.

Steve Ellcey
sje@cup.hp.com



2002-04-02  Steve Ellcey  <sje@cup.hp.com>
	* gcc/builtins.c (expand_builtin_prefetch): Force op0 pointer to Pmode
	if POINTERS_EXTEND_UNSIGNED is defined.


*** gcc.orig/gcc/builtins.c	Tue Apr  2 10:55:13 2002
--- gcc/gcc/builtins.c	Tue Apr  2 11:01:22 2002
*************** expand_builtin_prefetch (arglist)
*** 787,796 ****
  #ifdef HAVE_prefetch
    if (HAVE_prefetch)
      {
!       if (! (*insn_data[(int)CODE_FOR_prefetch].operand[0].predicate)
! 	    (op0,
! 	     insn_data[(int)CODE_FOR_prefetch].operand[0].mode))
!         op0 = force_reg (Pmode, op0);
        emit_insn (gen_prefetch (op0, op1, op2));
      }
    else
--- 787,803 ----
  #ifdef HAVE_prefetch
    if (HAVE_prefetch)
      {
!       if ((! (*insn_data[(int)CODE_FOR_prefetch].operand[0].predicate)
! 	     (op0,
! 	      insn_data[(int)CODE_FOR_prefetch].operand[0].mode)) ||
!           (GET_MODE(op0) != Pmode))
!         {
! #ifdef POINTERS_EXTEND_UNSIGNED
! 	  if (GET_MODE(op0) != Pmode)
! 	    op0 = convert_memory_address (Pmode, op0);
! #endif
!           op0 = force_reg (Pmode, op0);
!         }
        emit_insn (gen_prefetch (op0, op1, op2));
      }
    else


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