This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
HP-UX IA64 ILP32 prefetch patch
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 2 Apr 2002 11:10:47 -0800 (PST)
- Subject: HP-UX IA64 ILP32 prefetch patch
- Reply-to: sje at cup dot hp dot com
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