public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Xionghu Luo <luoxhu@linux.ibm.com>
Cc: gcc-patches@gcc.gnu.org, dje.gcc@gmail.com,
	wschmidt@linux.ibm.com, guojiufu@linux.ibm.com,
	linkw@gcc.gnu.org
Subject: Re: [PATCH] rs6000: Remove unspecs for vec_mrghl[bhw]
Date: Wed, 9 Jun 2021 06:57:34 -0500	[thread overview]
Message-ID: <20210609115734.GD18427@gate.crashing.org> (raw)
In-Reply-To: <7daea8f2-c0f4-f2e0-eca1-6cfc7496600d@linux.ibm.com>

Hi!

On Wed, Jun 09, 2021 at 04:03:43PM +0800, Xionghu Luo wrote:
> >>--- a/gcc/testsuite/gcc.target/powerpc/builtins-1.c
> >>+++ b/gcc/testsuite/gcc.target/powerpc/builtins-1.c
> >>@@ -317,10 +317,10 @@ int main ()
> >>  /* { dg-final { scan-assembler-times "vctuxs" 2 } } */
> >>  
> >>  /* { dg-final { scan-assembler-times "vmrghb" 4 { target be } } } */
> >>-/* { dg-final { scan-assembler-times "vmrghb" 5 { target le } } } */
> >>+/* { dg-final { scan-assembler-times "vmrghb" 6 { target le } } } */
> >>  /* { dg-final { scan-assembler-times "vmrghh" 8 } } */
> >>-/* { dg-final { scan-assembler-times "xxmrghw" 8 } } */
> >>-/* { dg-final { scan-assembler-times "xxmrglw" 8 } } */
> >>+/* { dg-final { scan-assembler-times "xxmrghw" 4 } } */
> >>+/* { dg-final { scan-assembler-times "xxmrglw" 4 } } */
> >>  /* { dg-final { scan-assembler-times "vmrglh" 8 } } */
> >>  /* { dg-final { scan-assembler-times "xxlnor" 6 } } */
> >>  /* { dg-final { scan-assembler-times {\mvpkudus\M} 1 } } */
> >>@@ -347,7 +347,7 @@ int main ()
> >>  /* { dg-final { scan-assembler-times "vspltb" 6 } } */
> >>  /* { dg-final { scan-assembler-times "vspltw" 0 } } */
> >>  /* { dg-final { scan-assembler-times "vmrgow" 8 } } */
> >>-/* { dg-final { scan-assembler-times "vmrglb" 5 { target le } } } */
> >>+/* { dg-final { scan-assembler-times "vmrglb" 4 { target le } } } */
> >>  /* { dg-final { scan-assembler-times "vmrglb" 6 { target be } } } */
> >>  /* { dg-final { scan-assembler-times "vmrgew" 8 } } */
> >>  /* { dg-final { scan-assembler-times "vsplth" 8 } } */
> >
> >Are those changes correct?  It looks like a vmrglb became a vmrghb, and
> >that 4 each of xxmrghw and xxmrglw disappeared?  Both seem wrong?
> 
> 
> This case is built with "-mdejagnu-cpu=power8 -O0 -mno-fold-gimple -dp"
> and it also counted the generated instruction patterns.
> 
> 1) "vsx_xxmrghw_v4si" is replaced by "altivec_vmrglw_direct_v4si/0", so 
> it decreases from 8 to 4. (Likewise for vsx_xxmrglw_v4si.)
> 
>         li 9,48          # 1282 [c=4 l=4]  *movdi_internal64/3
> -       lxvd2x 0,31,9    # 31   [c=8 l=4]  *vsx_lxvd2x4_le_v4si
> -       xxpermdi 0,0,0,2         # 32   [c=4 l=4]  xxswapd_v4si
> -       xxmrglw 0,0,12   # 33   [c=4 l=4]  vsx_xxmrghw_v4si
> +       lxvd2x 12,31,9   # 31   [c=8 l=4]  *vsx_lxvd2x4_le_v4si
> +       xxpermdi 12,12,12,2      # 32   [c=4 l=4]  xxswapd_v4si
> +       xxmrglw 0,12,0   # 33   [c=4 l=4]  altivec_vmrglw_direct_v4si/0
>         xxpermdi 0,0,0,2         # 35   [c=4 l=4]  xxswapd_v4sf
> 
> Note that v0 and v12 is swapped in lxvd2x, these new 3 instructions
> produces same result than before.

And there was one xxmrglw in this snippet before, and now there still
is only one.

But, the testcase uses -dp, I see.  Please use \m and \M in the scans,
it helps :-)  (And convert more than just the few that hit errors ;-) )

(You may want to do that as a separate patch before this one, to make
counting easier (also for me ;-) ),

(I'll review the new patch later today).


Segher

  reply	other threads:[~2021-06-09 11:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-24  9:02 Xionghu Luo
2021-06-07  5:09 ` Ping: " Xionghu Luo
2021-06-08 23:25 ` Segher Boessenkool
2021-06-09  8:03   ` Xionghu Luo
2021-06-09 11:57     ` Segher Boessenkool [this message]
2021-06-30  1:47     ` Ping: " Xionghu Luo
2021-09-06  0:54       ` Ping ^ 2: " Xionghu Luo
2021-10-12 22:51         ` David Edelsohn
2021-10-13  1:59           ` Xionghu Luo

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=20210609115734.GD18427@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=guojiufu@linux.ibm.com \
    --cc=linkw@gcc.gnu.org \
    --cc=luoxhu@linux.ibm.com \
    --cc=wschmidt@linux.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).