public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Disable *vsx_reduc_<VEC_reduc_name>_v2df_scalar on little endian (PR target/87064)
@ 2019-01-22 16:32 Jakub Jelinek
  2019-01-22 19:01 ` Segher Boessenkool
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2019-01-22 16:32 UTC (permalink / raw)
  To: Segher Boessenkool, David Edelsohn; +Cc: gcc-patches

Hi!

The following patch disables *vsx_reduc_<VEC_reduc_name>_v2df_scalar
define_insn_and_split for little endian, because it both generates
wrong code there (fixable), but also even if fixed, emit much worse code
than when it is not present at all.
The comment on the pattern says:
;; Combiner patterns with the vector reduction patterns that knows we can get
;; to the top element of the V2DF array without doing an extract.
but for little endian that is not the case, the end result is that a vector
is unnecessarily forced into memory.

Fixed thusly, bootstrapped/regtested on powerpc64le-linux, fixes
FAIL: libgomp.oacc-fortran/reduction-3.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1  -O1  execution test
, ok for trunk?

2019-01-22  Jakub Jelinek  <jakub@redhat.com>

	PR target/87064
	* config/rs6000/vsx.md (*vsx_reduc_<VEC_reduc_name>_v2df_scalar):
	Disable for little endian.

--- gcc/config/rs6000/vsx.md.jj	2019-01-19 09:39:13.224924063 +0100
+++ gcc/config/rs6000/vsx.md	2019-01-21 23:39:27.527774247 +0100
@@ -4351,7 +4351,7 @@ (define_insn_and_split "*vsx_reduc_<VEC_
 	  (match_dup 1))
 	 (parallel [(const_int 1)])))
    (clobber (match_scratch:DF 2 "=0,0,&wd,&wa"))]
-  "VECTOR_UNIT_VSX_P (V2DFmode)"
+  "BYTES_BIG_ENDIAN && VECTOR_UNIT_VSX_P (V2DFmode)"
   "#"
   ""
   [(const_int 0)]

	Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Disable *vsx_reduc_<VEC_reduc_name>_v2df_scalar on little endian (PR target/87064)
  2019-01-22 16:32 [PATCH] Disable *vsx_reduc_<VEC_reduc_name>_v2df_scalar on little endian (PR target/87064) Jakub Jelinek
@ 2019-01-22 19:01 ` Segher Boessenkool
  2019-01-22 20:59   ` Segher Boessenkool
  0 siblings, 1 reply; 3+ messages in thread
From: Segher Boessenkool @ 2019-01-22 19:01 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: David Edelsohn, gcc-patches

Hi Jakub,

On Tue, Jan 22, 2019 at 05:31:58PM +0100, Jakub Jelinek wrote:
> The following patch disables *vsx_reduc_<VEC_reduc_name>_v2df_scalar
> define_insn_and_split for little endian, because it both generates
> wrong code there (fixable), but also even if fixed, emit much worse code
> than when it is not present at all.
> The comment on the pattern says:
> ;; Combiner patterns with the vector reduction patterns that knows we can get
> ;; to the top element of the V2DF array without doing an extract.
> but for little endian that is not the case, the end result is that a vector
> is unnecessarily forced into memory.
> 
> Fixed thusly, bootstrapped/regtested on powerpc64le-linux, fixes
> FAIL: libgomp.oacc-fortran/reduction-3.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1  -O1  execution test
> , ok for trunk?

Okay.  Thanks!  Also okay for backports.


Segher


> 2019-01-22  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR target/87064
> 	* config/rs6000/vsx.md (*vsx_reduc_<VEC_reduc_name>_v2df_scalar):
> 	Disable for little endian.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Disable *vsx_reduc_<VEC_reduc_name>_v2df_scalar on little endian (PR target/87064)
  2019-01-22 19:01 ` Segher Boessenkool
@ 2019-01-22 20:59   ` Segher Boessenkool
  0 siblings, 0 replies; 3+ messages in thread
From: Segher Boessenkool @ 2019-01-22 20:59 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: David Edelsohn, gcc-patches

Hi Jakub,

On Tue, Jan 22, 2019 at 05:31:58PM +0100, Jakub Jelinek wrote:
> The following patch disables *vsx_reduc_<VEC_reduc_name>_v2df_scalar
> define_insn_and_split for little endian, because it both generates
> wrong code there (fixable), but also even if fixed, emit much worse code
> than when it is not present at all.
> The comment on the pattern says:
> ;; Combiner patterns with the vector reduction patterns that knows we can get
> ;; to the top element of the V2DF array without doing an extract.
> but for little endian that is not the case, the end result is that a vector
> is unnecessarily forced into memory.
> 
> Fixed thusly, bootstrapped/regtested on powerpc64le-linux, fixes
> FAIL: libgomp.oacc-fortran/reduction-3.f90 -DACC_DEVICE_TYPE_host=1 -DACC_MEM_SHARED=1  -O1  execution test
> , ok for trunk?

Okay.  Thanks!  Also okay for backports.


Segher


> 2019-01-22  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR target/87064
> 	* config/rs6000/vsx.md (*vsx_reduc_<VEC_reduc_name>_v2df_scalar):
> 	Disable for little endian.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-22 20:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-22 16:32 [PATCH] Disable *vsx_reduc_<VEC_reduc_name>_v2df_scalar on little endian (PR target/87064) Jakub Jelinek
2019-01-22 19:01 ` Segher Boessenkool
2019-01-22 20:59   ` Segher Boessenkool

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).