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]

Re: [PATCH] PR target/41331 -- fix powerpc bswap64 with -m32 -mpowerpc64


On Thu, Sep 10, 2009 at 07:25:32PM -0400, David Edelsohn wrote:
> On Thu, Sep 10, 2009 at 4:59 PM, Michael Meissner
> <meissner@linux.vnet.ibm.com> wrote:
> > On Thu, Sep 10, 2009 at 02:00:27PM -0400, David Edelsohn wrote:
> >> On Thu, Sep 10, 2009 at 12:39 PM, Michael Meissner
> >> <meissner@linux.vnet.ibm.com> wrote:
> >> > This patch should fix the problems that I introduced with my changes on July
> >> > 31st in __builtin_bswap64 if -m32 and -mpowerpc64 are used.
> >>
> >> Why should rs6000_emit_add() use the MODE of OP0 instead of
> >> TARGET_32BIT? ?gen_rtx_PLUS uses Pmode, which is based on
> >> TARGET_32BIT. ?Using TARGET_32BIT seems like a self-test that one does
> >> not pass an operand of the wrong MODE for an address.
> >
> > In looking at it further, I see optabs.c provides a gen_add3_insn function which
> > does the same thing that rs6000_emit_add did.
> 
> Yes, I just stumbled on the same function when I saw a patch from
> Jakub.  Neither Segher nor I had remembered that function although I
> thought something like it should exist.  I agree that you should
> revise the patch to use that function.

Here is the revised patch for 41331.  It does the usual bootstrap and make
check with no regressions.  While it wasn't necessary for the PR, I did clean
up the cases in rs6000.c that had the if TARGET_32BIT code to use gen_add3_insn
as well.

Is this ok to apply?

-- 
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
meissner@linux.vnet.ibm.com

Attachment: gcc-power7.patch76
Description: Text document


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