public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Carl Love <cel@us.ibm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: gcc-patches@gcc.gnu.org, David Edelsohn <dje.gcc@gmail.com>,
	       Bill Schmidt <wschmidt@linux.vnet.ibm.com>
Subject: Re: [PATCH, rs6000] Fix AIX test case failures
Date: Mon, 25 Jun 2018 16:53:00 -0000	[thread overview]
Message-ID: <1529945597.6530.4.camel@us.ibm.com> (raw)
In-Reply-To: <20180625094450.GD16221@gate.crashing.org>

On Mon, 2018-06-25 at 04:44 -0500, Segher Boessenkool wrote:
> Hi Carl,
> 
> On Fri, Jun 22, 2018 at 02:55:44PM -0700, Carl Love wrote:
> > --- a/gcc/testsuite/gcc.target/powerpc/divkc3-2.c
> > +++ b/gcc/testsuite/gcc.target/powerpc/divkc3-2.c
> > @@ -13,4 +13,5 @@ divide (cld_t *p, cld_t *q, cld_t *r)
> >    *p = *q / *r;
> >  }
> >  
> > -/* { dg-final { scan-assembler "bl __divkc3" } } */
> > +/* { dg-final { scan-assembler "bl __divkc3" { target { powerpc*-
> > *-linux* } } } } */
> > +/* { dg-final { scan-assembler "bl .__divdc3" { target { powerpc*-
> > *-aix* } } } } */
> 
> Should it be calling __divdc3 on AIX, is that correct?

I was a bit surprised that it wasn't calling divkc3.  I am guessing
these are library routines we are calling?  I couldn't find the source
code for them and don't really know what the difference is between
divkc3 and divdc3.

The source for divkc3-2.c is:

    /* { dg-do compile { target { powerpc*-*-* } } } */
    /* { dg-require-effective-target powerpc_p8vector_ok } */
    /* { dg-options "-O2 -mpower8-vector -mabi=ieeelongdouble -Wno-psabi" } */

    /* Check that complex multiply generates the right call when long double is     
       IEEE 128-bit floating point.  */

    typedef _Complex long double cld_t;

    void
    divide (cld_t *p, cld_t *q, cld_t *r)
    {
      *p = *q / *r;
    }

    /* { dg-final { scan-assembler "bl __divkc3" { target { powerpc*-*-linux* } } } } */
    /* { dg-final { scan-assembler "bl .__divdc3" { target { powerpc*-*-aix* } } } } */

When compiled as:

gcc -S -c -O2 -mpower8-vector -mabi=ieeelongdouble -Wno-psabi divkc3-.c

I get:

        .file   "divkc3-2.c"
        .toc
        .csect .text[PR]
        .align 2
        .align 4
        .globl divide
        .globl .divide
        .csect divide[DS]
divide:
        .long .divide, TOC[tc0], 0
        .csect .text[PR]
.divide:
        mflr 0
        stw 31,-4(1)
        lfd 4,8(5)
        stw 0,8(1)
        lfd 3,0(5)
        mr 31,3
        stwu 1,-80(1)
        lfd 2,8(4)
        lfd 1,0(4)
        bl .__divdc3
        nop
        addi 1,1,80
        lwz 0,8(1)
        stfd 1,0(31)
        stfd 2,8(31)
        lwz 31,-4(1)
        mtlr 0
        blr
LT..divide:
        .long 0
        .byte 0,0,32,65,128,1,3,0
        .long 0
        .long LT..divide-.divide
        .short 6
        .byte "divide"
        .align 2
_section_.text:
        .csect .data[RW],4
        .long _section_.text

Again, running the regression test, the test passes with the AIX value.
 
So, not sure why AIX and Linux are not calling the name for the
function or if what is being called is functionally equivalent?
> 
> > --- a/gcc/testsuite/gcc.target/powerpc/divkc3-3.c
> > +++ b/gcc/testsuite/gcc.target/powerpc/divkc3-3.c
> > @@ -13,4 +13,5 @@ divide (cld_t *p, cld_t *q, cld_t *r)
> >    *p = *q / *r;
> >  }
> >  
> > -/* { dg-final { scan-assembler "bl __divtc3" } } */
> > +/* { dg-final { scan-assembler "bl __divtc3" { target { powerpc*-
> > *-linux* } } } } */
> > +/* { dg-final { scan-assembler "bl .__divdc3" { target { powerpc*-
> > *-aix* } } } } */
> 
> Same question here.  If the AIX port cannot handle
> -mabi=ieeelongdouble
> it shouldn't silently accept it, etc.

Ditto above comments, don't know about the -mabi=ieeelongdouble.  

I will play around with and without the mabi=ieeelongdouble on AIX and
Linux to see what happens.  
> 
> > diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-mergehl-
> > double.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-mergehl-
> > double.c
> > index 25f4bc6..403876d 100644
> > --- a/gcc/testsuite/gcc.target/powerpc/fold-vec-mergehl-double.c
> > +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-mergehl-double.c
> > @@ -19,7 +19,6 @@ testd_h (vector double vd2, vector double vd3)
> >    return vec_mergeh (vd2, vd3);
> >  }
> >  
> > -/* vec_merge with doubles tend to just use xxpermdi (3 ea for BE,
> > 1 ea for LE).  */
> > -/* { dg-final { scan-assembler-times "xxpermdi" 2  { target {
> > powerpc*le-*-* } }    } } */
> > -/* { dg-final { scan-assembler-times "xxpermdi" 6  { target {
> > powerpc-*-* } }     } } */
> > +/* { dg-final { scan-assembler-times "xxpermdi" 2 } } */
> > +
> >  
> 
> Is this change correct?  The test didn't fail on BE Linux (neither
> 32-bit
> nor 64-bit) as far as I know.

As I recall, my testing on the various systems did give me an error
without the change.  I was using Willow 8 (P8 BE), genoa (P8 LE) and
gcc119 for AIX.  I will go back and re-verify.

                    Carl Love

  reply	other threads:[~2018-06-25 16:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-22 21:55 Carl Love
2018-06-25  9:44 ` Segher Boessenkool
2018-06-25 16:53   ` Carl Love [this message]
2018-06-25 17:04     ` Segher Boessenkool
2018-07-13 14:51       ` David Edelsohn
2018-07-13 21:00         ` Segher Boessenkool
2018-07-13 23:16           ` Carl Love
2018-07-14  3:08             ` David Edelsohn
2018-07-16 19:59             ` Segher Boessenkool
2018-07-17 23:40             ` Carl Love
2018-07-18 21:51               ` Segher Boessenkool

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1529945597.6530.4.camel@us.ibm.com \
    --to=cel@us.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    --cc=wschmidt@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).