public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/40811] New: unsigned int to float isn't vectorized
@ 2009-07-20 22:55 hjl dot tools at gmail dot com
2009-07-20 23:26 ` [Bug target/40811] " ubizjak at gmail dot com
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-07-20 22:55 UTC (permalink / raw)
To: gcc-bugs
[hjl@gnu-6 tmp]$ cat x.c
#define N 4
extern unsigned int u4[N] __attribute__ ((aligned(16)));
extern float f4[N] __attribute__ ((aligned(16)));
void
cvt_u4_f4()
{
int j;
for (j=0; j<N; j++)
f4[j]=u4[j];
}
[hjl@gnu-6 tmp]$ /usr/gcc-4.5/bin/gcc -O3 x.c -S
[hjl@gnu-6 tmp]$ cat x.s
.file "x.c"
.text
.p2align 4,,15
.globl cvt_u4_f4
.type cvt_u4_f4, @function
cvt_u4_f4:
.LFB0:
.cfi_startproc
mov u4(%rip), %eax
cvtsi2ssq %rax, %xmm0
mov u4+4(%rip), %eax
movss %xmm0, f4(%rip)
cvtsi2ssq %rax, %xmm0
mov u4+8(%rip), %eax
movss %xmm0, f4+4(%rip)
cvtsi2ssq %rax, %xmm0
mov u4+12(%rip), %eax
movss %xmm0, f4+8(%rip)
cvtsi2ssq %rax, %xmm0
movss %xmm0, f4+12(%rip)
ret
.cfi_endproc
.LFE0:
.size cvt_u4_f4, .-cvt_u4_f4
Icc 11.1 generates:
.globl cvt_u4_f4
cvt_u4_f4:
..B1.1: # Preds ..B1.0
..___tag_value_cvt_u4_f4.1: #6.1
cvtdq2ps u4(%rip), %xmm2 #9.11
movaps %xmm2, %xmm1 #9.11
pxor %xmm0, %xmm0 #9.11
cmpltps %xmm0, %xmm1 #9.11
andps _2il0floatpacket.1(%rip), %xmm1 #9.11
addps %xmm1, %xmm2 #9.11
movaps %xmm2, f4(%rip) #9.5
ret #10.1
.align 16,0x90
..___tag_value_cvt_u4_f4.2: #
# LOE
# mark_end;
.type cvt_u4_f4,@function
.size cvt_u4_f4,.-cvt_u4_f4
.data
# -- End cvt_u4_f4
.section .rodata, "a"
.align 16
.align 16
_2il0floatpacket.1:
.long 0x4f800000,0x4f800000,0x4f800000,0x4f800000
.type _2il0floatpacket.1,@object
.size _2il0floatpacket.1,16
--
Summary: unsigned int to float isn't vectorized
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hjl dot tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40811
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/40811] unsigned int to float isn't vectorized
2009-07-20 22:55 [Bug target/40811] New: unsigned int to float isn't vectorized hjl dot tools at gmail dot com
@ 2009-07-20 23:26 ` ubizjak at gmail dot com
2009-07-21 2:52 ` hjl dot tools at gmail dot com
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: ubizjak at gmail dot com @ 2009-07-20 23:26 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from ubizjak at gmail dot com 2009-07-20 23:26 -------
What about unsigned int -> double?
--
ubizjak at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2009-07-20 23:26:33
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40811
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/40811] unsigned int to float isn't vectorized
2009-07-20 22:55 [Bug target/40811] New: unsigned int to float isn't vectorized hjl dot tools at gmail dot com
2009-07-20 23:26 ` [Bug target/40811] " ubizjak at gmail dot com
@ 2009-07-21 2:52 ` hjl dot tools at gmail dot com
2009-07-21 6:15 ` ubizjak at gmail dot com
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-07-21 2:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from hjl dot tools at gmail dot com 2009-07-21 02:52 -------
(In reply to comment #1)
> What about unsigned int -> double?
>
We don't even support int -> double.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40811
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/40811] unsigned int to float isn't vectorized
2009-07-20 22:55 [Bug target/40811] New: unsigned int to float isn't vectorized hjl dot tools at gmail dot com
2009-07-20 23:26 ` [Bug target/40811] " ubizjak at gmail dot com
2009-07-21 2:52 ` hjl dot tools at gmail dot com
@ 2009-07-21 6:15 ` ubizjak at gmail dot com
2009-07-21 7:23 ` uros at gcc dot gnu dot org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: ubizjak at gmail dot com @ 2009-07-21 6:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from ubizjak at gmail dot com 2009-07-21 06:15 -------
(In reply to comment #2)
>
> We don't even support int -> double.
Yes, we do. Try:
#define N 16
extern int u4[N] __attribute__ ((aligned(16)));
extern double f4[N] __attribute__ ((aligned(16)));
void
cvt_u4_f4()
{
int j;
for (j=0; j<N; j++)
f4[j]=u4[j];
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40811
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/40811] unsigned int to float isn't vectorized
2009-07-20 22:55 [Bug target/40811] New: unsigned int to float isn't vectorized hjl dot tools at gmail dot com
` (2 preceding siblings ...)
2009-07-21 6:15 ` ubizjak at gmail dot com
@ 2009-07-21 7:23 ` uros at gcc dot gnu dot org
2009-07-21 10:04 ` ubizjak at gmail dot com
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: uros at gcc dot gnu dot org @ 2009-07-21 7:23 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from uros at gcc dot gnu dot org 2009-07-21 07:23 -------
Subject: Bug 40811
Author: uros
Date: Tue Jul 21 07:22:51 2009
New Revision: 149847
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149847
Log:
Backport from mainline:
2009-04-29 Richard Guenther <rguenther@suse.de>
PR target/39943
* config/i386/i386.c (ix86_vectorize_builtin_conversion): Only
allow conversion to signed integers.
testsuite/ChangeLog:
PR target/40811
* gcc.target/i386/pr39943.c: New test.
Backport from mainline:
2009-04-29 Richard Guenther <rguenther@suse.de>
PR target/39943
* lib/target-supports.exp (check_effective_target_vect_uintfloat_cvt):
New.
(check_effective_target_vect_floatuint_cvt): Likewise.
* gcc.dg/vect/slp-10.c: Adjust.
* gcc.dg/vect/slp-11.c: Adjust.
* gcc.dg/vect/slp-12b.c: Adjust.
* gcc.dg/vect/slp-33.c: Adjust.
* gcc.c-torture/compile/pr39943.c: New testcase.
Added:
branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr39943.c
branches/gcc-4_4-branch/gcc/testsuite/gcc.target/i386/pr40811.c
Modified:
branches/gcc-4_4-branch/gcc/ChangeLog
branches/gcc-4_4-branch/gcc/config/i386/i386.c
branches/gcc-4_4-branch/gcc/testsuite/ChangeLog
branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/vect/slp-10.c
branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/vect/slp-11.c
branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/vect/slp-12b.c
branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/vect/slp-33.c
branches/gcc-4_4-branch/gcc/testsuite/lib/target-supports.exp
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40811
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/40811] unsigned int to float isn't vectorized
2009-07-20 22:55 [Bug target/40811] New: unsigned int to float isn't vectorized hjl dot tools at gmail dot com
` (4 preceding siblings ...)
2009-07-21 10:04 ` ubizjak at gmail dot com
@ 2009-07-21 10:04 ` ubizjak at gmail dot com
2009-07-21 11:32 ` ubizjak at gmail dot com
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: ubizjak at gmail dot com @ 2009-07-21 10:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from ubizjak at gmail dot com 2009-07-21 10:04 -------
Taking a bug.
--
ubizjak at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |ubizjak at gmail dot com
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2009-07-20 23:26:33 |2009-07-21 10:04:16
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40811
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/40811] unsigned int to float isn't vectorized
2009-07-20 22:55 [Bug target/40811] New: unsigned int to float isn't vectorized hjl dot tools at gmail dot com
` (3 preceding siblings ...)
2009-07-21 7:23 ` uros at gcc dot gnu dot org
@ 2009-07-21 10:04 ` ubizjak at gmail dot com
2009-07-21 10:04 ` ubizjak at gmail dot com
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: ubizjak at gmail dot com @ 2009-07-21 10:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from ubizjak at gmail dot com 2009-07-21 10:04 -------
(In reply to comment #4)
> Subject: Bug 40811
>
> Author: uros
> Date: Tue Jul 21 07:22:51 2009
> New Revision: 149847
Sorry, wrong PR number.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40811
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/40811] unsigned int to float isn't vectorized
2009-07-20 22:55 [Bug target/40811] New: unsigned int to float isn't vectorized hjl dot tools at gmail dot com
` (5 preceding siblings ...)
2009-07-21 10:04 ` ubizjak at gmail dot com
@ 2009-07-21 11:32 ` ubizjak at gmail dot com
2009-07-21 15:17 ` uros at gcc dot gnu dot org
2009-07-21 15:36 ` ubizjak at gmail dot com
8 siblings, 0 replies; 10+ messages in thread
From: ubizjak at gmail dot com @ 2009-07-21 11:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from ubizjak at gmail dot com 2009-07-21 11:32 -------
Created an attachment (id=18236)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18236&action=view)
implement vectorization of unsigned int -> float
This patch vectorizes unsigned int -> float conversion.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40811
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/40811] unsigned int to float isn't vectorized
2009-07-20 22:55 [Bug target/40811] New: unsigned int to float isn't vectorized hjl dot tools at gmail dot com
` (6 preceding siblings ...)
2009-07-21 11:32 ` ubizjak at gmail dot com
@ 2009-07-21 15:17 ` uros at gcc dot gnu dot org
2009-07-21 15:36 ` ubizjak at gmail dot com
8 siblings, 0 replies; 10+ messages in thread
From: uros at gcc dot gnu dot org @ 2009-07-21 15:17 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from uros at gcc dot gnu dot org 2009-07-21 15:17 -------
Subject: Bug 40811
Author: uros
Date: Tue Jul 21 15:17:23 2009
New Revision: 149861
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149861
Log:
PR target/40811
* config/i386/sse.md (sse2_cvtudq2ps): New expander.
(enum ix86_builtins): Add IX86_BUILTIN_CVTUDQ2PS.
(builtin_description): Add __builtin_ia32_cvtudq2ps.
(ix86_vectorize_builtin_conversion): Handle IX86_BUILTIN_CVTUDQ2PS.
testsuite/ChangeLog:
PR target/40811
* lib/target-supports.exp (check_effective_target_vect_uintfloat_cvt):
Add i?86 and x86_64 targets.
* gcc.target/i386/vectorize7.c: New test.
PR target/40809
* gcc.target/i386/pr40809.c: New test.
Added:
trunk/gcc/testsuite/gcc.target/i386/pr40809.c
trunk/gcc/testsuite/gcc.target/i386/vectorize7.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/i386.c
trunk/gcc/config/i386/sse.md
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/lib/target-supports.exp
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40811
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/40811] unsigned int to float isn't vectorized
2009-07-20 22:55 [Bug target/40811] New: unsigned int to float isn't vectorized hjl dot tools at gmail dot com
` (7 preceding siblings ...)
2009-07-21 15:17 ` uros at gcc dot gnu dot org
@ 2009-07-21 15:36 ` ubizjak at gmail dot com
8 siblings, 0 replies; 10+ messages in thread
From: ubizjak at gmail dot com @ 2009-07-21 15:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from ubizjak at gmail dot com 2009-07-21 15:36 -------
Fixed.
BTW: The patch to vectorize unsigned int -> double is at [1].
[1] http://gcc.gnu.org/ml/gcc-patches/2009-07/msg01170.html
--
ubizjak at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
URL| |http://gcc.gnu.org/ml/gcc-
| |patches/2009-
| |07/msg01164.html
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40811
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-07-21 15:36 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-20 22:55 [Bug target/40811] New: unsigned int to float isn't vectorized hjl dot tools at gmail dot com
2009-07-20 23:26 ` [Bug target/40811] " ubizjak at gmail dot com
2009-07-21 2:52 ` hjl dot tools at gmail dot com
2009-07-21 6:15 ` ubizjak at gmail dot com
2009-07-21 7:23 ` uros at gcc dot gnu dot org
2009-07-21 10:04 ` ubizjak at gmail dot com
2009-07-21 10:04 ` ubizjak at gmail dot com
2009-07-21 11:32 ` ubizjak at gmail dot com
2009-07-21 15:17 ` uros at gcc dot gnu dot org
2009-07-21 15:36 ` ubizjak at gmail dot com
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).