public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/24073] (vector float){a, b, 0, 0} code gen is not good
       [not found] <bug-24073-4@http.gcc.gnu.org/bugzilla/>
@ 2021-08-21 21:28 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-21 21:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24073

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |9.0
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed since GCC 9.
GCC 9 removes the movlhps part.

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

* [Bug target/24073] (vector float){a, b, 0, 0} code gen is not good
       [not found] <bug-24073-6528@http.gcc.gnu.org/bugzilla/>
  2006-08-23 21:24 ` stuart at apple dot com
@ 2006-08-23 21:54 ` stuart at apple dot com
  1 sibling, 0 replies; 10+ messages in thread
From: stuart at apple dot com @ 2006-08-23 21:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from stuart at apple dot com  2006-08-23 21:54 -------
Time has passed, and GCC has improved on this testcase.  Here is what we
generate today (trunk, 23aug2006) for the original testcase:

        movss   b(%rip), %xmm0
        movss   a(%rip), %xmm1
        unpcklps        %xmm0, %xmm1
        movaps  %xmm1, %xmm0
        xorps   %xmm1, %xmm1
        movlhps %xmm1, %xmm0
        ret

This isn't perfect, but it's much better than before.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24073


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

* [Bug target/24073] (vector float){a, b, 0, 0} code gen is not good
       [not found] <bug-24073-6528@http.gcc.gnu.org/bugzilla/>
@ 2006-08-23 21:24 ` stuart at apple dot com
  2006-08-23 21:54 ` stuart at apple dot com
  1 sibling, 0 replies; 10+ messages in thread
From: stuart at apple dot com @ 2006-08-23 21:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from stuart at apple dot com  2006-08-23 21:24 -------
Cloned 28825 from this bug to track the MMX instruction issue.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24073


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

* [Bug target/24073] (vector float){a, b, 0, 0} code gen is not good
  2005-09-27  4:06 [Bug target/24073] New: " pinskia at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2005-09-27 11:41 ` uros at kss-loka dot si
@ 2005-09-27 14:34 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-27 14:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-27 14:33 -------
(In reply to comment #4)
> I think that following example wins the contest:
> 
> vector float f(void) { return (vector float){ a, a, b, b}; }

For this, it is a different bug.  The issue with the above is that ix86_expand_vector_init_duplicate check 
for mmx_okay is bad.
Currently, we have
      if (!mmx_ok && !TARGET_SSE)
but I if I change it to:
      if (!mmx_ok)
we get:
        movss   _a, %xmm0
        movss   _b, %xmm1
        unpcklps        %xmm0, %xmm0
        unpcklps        %xmm1, %xmm1
        movlhps %xmm1, %xmm0
Which looks ok to me.  That testcase should be opened into another bug as it is obviously wrong.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24073


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

* [Bug target/24073] (vector float){a, b, 0, 0} code gen is not good
  2005-09-27  4:06 [Bug target/24073] New: " pinskia at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2005-09-27 11:19 ` uros at kss-loka dot si
@ 2005-09-27 11:41 ` uros at kss-loka dot si
  2005-09-27 14:34 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 10+ messages in thread
From: uros at kss-loka dot si @ 2005-09-27 11:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From uros at kss-loka dot si  2005-09-27 11:41 -------
I think that following example wins the contest:

vector float f(void) { return (vector float){ a, a, b, b}; }

gcc -O2 -msse -fomit-frame-pointer

	subl	$28, %esp
	movss	a, %xmm0
	movss	%xmm0, 4(%esp)
	movss	b, %xmm0
	movd	4(%esp), %mm0
	punpckldq	%mm0, %mm0
	movss	%xmm0, 4(%esp)
	movq	%mm0, 16(%esp)
	movd	4(%esp), %mm0
	punpckldq	%mm0, %mm0
	movq	%mm0, 8(%esp)
	movlps	16(%esp), %xmm1
	movhps	8(%esp), %xmm1
	addl	$28, %esp
	movaps	%xmm1, %xmm0
	ret

Note the usage of MMX registers.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24073


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

* [Bug target/24073] (vector float){a, b, 0, 0} code gen is not good
  2005-09-27  4:06 [Bug target/24073] New: " pinskia at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2005-09-27  5:51 ` belyshev at depni dot sinp dot msu dot ru
@ 2005-09-27 11:19 ` uros at kss-loka dot si
  2005-09-27 11:41 ` uros at kss-loka dot si
  2005-09-27 14:34 ` pinskia at gcc dot gnu dot org
  6 siblings, 0 replies; 10+ messages in thread
From: uros at kss-loka dot si @ 2005-09-27 11:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From uros at kss-loka dot si  2005-09-27 11:19 -------
With a couple of months old mainline gcc (20050716), following asm is produced:
(-O2 -msse2 -fomit-frame-pointer):

	subl	$12, %esp
	movss	b, %xmm0
	movss	a, %xmm1
	unpcklps	%xmm0, %xmm1
	movaps	%xmm1, %xmm0
	xorl	%eax, %eax
	xorl	%edx, %edx
	movl	%eax, (%esp)
	movl	%edx, 4(%esp)
>>>	movlps	(%esp), %xmm1
	addl	$12, %esp
	movlhps	%xmm1, %xmm0
	ret

This explains where all those xor and moves come from. It looks that newer 
compilers somehow fix the damage by using xorps, a bit late in the game, IMO.

This part of bug depends on PR target/22076.

Other than that, the problem is that V4SF vector initialization is decomposed 
to two V2SF initializations (these are MMX insns and this further confuses 
x87/MMX switching patch) that are later concated to V4SF.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |22076


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24073


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

* [Bug target/24073] (vector float){a, b, 0, 0} code gen is not good
  2005-09-27  4:06 [Bug target/24073] New: " pinskia at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-09-27  5:09 ` pinskia at gcc dot gnu dot org
@ 2005-09-27  5:51 ` belyshev at depni dot sinp dot msu dot ru
  2005-09-27 11:19 ` uros at kss-loka dot si
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: belyshev at depni dot sinp dot msu dot ru @ 2005-09-27  5:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From belyshev at depni dot sinp dot msu dot ru  2005-09-27 05:51 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-09-27 05:51:20
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24073


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

* [Bug target/24073] (vector float){a, b, 0, 0} code gen is not good
  2005-09-27  4:06 [Bug target/24073] New: " pinskia at gcc dot gnu dot org
  2005-09-27  4:06 ` [Bug target/24073] " pinskia at gcc dot gnu dot org
  2005-09-27  4:22 ` pinskia at gcc dot gnu dot org
@ 2005-09-27  5:09 ` pinskia at gcc dot gnu dot org
  2005-09-27  5:51 ` belyshev at depni dot sinp dot msu dot ru
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-27  5:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-27 05:07 -------
The issue is in ix86_expand_vector_init.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24073


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

* [Bug target/24073] (vector float){a, b, 0, 0} code gen is not good
  2005-09-27  4:06 [Bug target/24073] New: " pinskia at gcc dot gnu dot org
  2005-09-27  4:06 ` [Bug target/24073] " pinskia at gcc dot gnu dot org
@ 2005-09-27  4:22 ` pinskia at gcc dot gnu dot org
  2005-09-27  5:09 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-27  4:22 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
 GCC target triplet|                            |i786-pc-darwin7.9


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24073


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

* [Bug target/24073] (vector float){a, b, 0, 0} code gen is not good
  2005-09-27  4:06 [Bug target/24073] New: " pinskia at gcc dot gnu dot org
@ 2005-09-27  4:06 ` pinskia at gcc dot gnu dot org
  2005-09-27  4:22 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-27  4:06 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ssemmx


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24073


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

end of thread, other threads:[~2021-08-21 21:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-24073-4@http.gcc.gnu.org/bugzilla/>
2021-08-21 21:28 ` [Bug target/24073] (vector float){a, b, 0, 0} code gen is not good pinskia at gcc dot gnu.org
     [not found] <bug-24073-6528@http.gcc.gnu.org/bugzilla/>
2006-08-23 21:24 ` stuart at apple dot com
2006-08-23 21:54 ` stuart at apple dot com
2005-09-27  4:06 [Bug target/24073] New: " pinskia at gcc dot gnu dot org
2005-09-27  4:06 ` [Bug target/24073] " pinskia at gcc dot gnu dot org
2005-09-27  4:22 ` pinskia at gcc dot gnu dot org
2005-09-27  5:09 ` pinskia at gcc dot gnu dot org
2005-09-27  5:51 ` belyshev at depni dot sinp dot msu dot ru
2005-09-27 11:19 ` uros at kss-loka dot si
2005-09-27 11:41 ` uros at kss-loka dot si
2005-09-27 14:34 ` pinskia at gcc dot gnu dot org

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