public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/53024] New: Power of 2 requirement on vector_size not documented
@ 2012-04-17 20:40 marc.glisse at normalesup dot org
  2012-04-18 10:16 ` [Bug c/53024] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: marc.glisse at normalesup dot org @ 2012-04-17 20:40 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53024
           Summary: Power of 2 requirement on vector_size not documented
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: marc.glisse@normalesup.org


Hello,

typedef float VEC __attribute__ ((__vector_size__ (12)));

fails to compile with the message:
error: number of components of the vector not a power of two

This is quite clear, and I guess it makes sense. However,
http://gcc.gnu.org/onlinedocs/gcc/Vector-Extensions.html says:

"Specifying a combination that is not valid for the current architecture will
cause GCC to synthesize the instructions using a narrower mode."

so I was expecting gcc to handle it somehow. Could we add a sentence, anywhere
in that page, that makes the requirement that the size is a power of 2
explicit? Or if the requirement can be lifted... (I don't care so much about 3
float, I can just store 4 and ignore the last, but I do care about 12 double
and don't want to store 16 until we get 512bit vectors)


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

* [Bug c/53024] Power of 2 requirement on vector_size not documented
  2012-04-17 20:40 [Bug c/53024] New: Power of 2 requirement on vector_size not documented marc.glisse at normalesup dot org
@ 2012-04-18 10:16 ` rguenth at gcc dot gnu.org
  2012-09-27 10:06 ` glisse at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-04-18 10:16 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |documentation
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-04-18
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-04-18 10:15:29 UTC ---
Confirmed as documentation issue.  We can't easily lift this restriction
because we have

/* For a VECTOR_TYPE, this is the number of sub-parts of the vector.  */
#define TYPE_VECTOR_SUBPARTS(VECTOR_TYPE) \
  (((unsigned HOST_WIDE_INT) 1) \
   << VECTOR_TYPE_CHECK (VECTOR_TYPE)->type_common.precision)

and

struct GTY(()) tree_type_common {
...
  unsigned int precision : 10;

10 bits of precision would limit us to vectors with 1024 elements if we'd
not have the power-of-two restriction.  (not sure what a sane limit would be,
but 1024 byte vectors do not look too far off).


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

* [Bug c/53024] Power of 2 requirement on vector_size not documented
  2012-04-17 20:40 [Bug c/53024] New: Power of 2 requirement on vector_size not documented marc.glisse at normalesup dot org
  2012-04-18 10:16 ` [Bug c/53024] " rguenth at gcc dot gnu.org
@ 2012-09-27 10:06 ` glisse at gcc dot gnu.org
  2012-09-27 10:14 ` glisse at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: glisse at gcc dot gnu.org @ 2012-09-27 10:06 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> 2012-09-27 10:06:29 UTC ---
Author: glisse
Date: Thu Sep 27 10:06:23 2012
New Revision: 191800

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191800
Log:
2012-09-27  Marc Glisse  <marc.glisse@inria.fr>

    PR c/53024
    PR c++/54427
    * gcc/doc/extend.texi (Vector Extensions): C++ improvements.
    Power of 2 size requirement.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/doc/extend.texi


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

* [Bug c/53024] Power of 2 requirement on vector_size not documented
  2012-04-17 20:40 [Bug c/53024] New: Power of 2 requirement on vector_size not documented marc.glisse at normalesup dot org
  2012-04-18 10:16 ` [Bug c/53024] " rguenth at gcc dot gnu.org
  2012-09-27 10:06 ` glisse at gcc dot gnu.org
@ 2012-09-27 10:14 ` glisse at gcc dot gnu.org
  2012-11-16 16:06 ` [Bug middle-end/53024] Support vector_size that is not a power of 2 glisse at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: glisse at gcc dot gnu.org @ 2012-09-27 10:14 UTC (permalink / raw)
  To: gcc-bugs


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

Marc Glisse <glisse at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |glisse at gcc dot gnu.org

--- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> 2012-09-27 10:14:38 UTC ---
Documentation fixed.

It might make sense to keep it open as a RFE to support non-powers of 2 some
time in the distant future. I'll retitle the bug in a few days if there are no
comments.


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

* [Bug middle-end/53024] Support vector_size that is not a power of 2
  2012-04-17 20:40 [Bug c/53024] New: Power of 2 requirement on vector_size not documented marc.glisse at normalesup dot org
                   ` (2 preceding siblings ...)
  2012-09-27 10:14 ` glisse at gcc dot gnu.org
@ 2012-11-16 16:06 ` glisse at gcc dot gnu.org
  2012-11-16 18:18 ` pinskia at gcc dot gnu.org
  2012-11-16 20:03 ` glisse at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: glisse at gcc dot gnu.org @ 2012-11-16 16:06 UTC (permalink / raw)
  To: gcc-bugs


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

Marc Glisse <glisse at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |middle-end
            Summary|Power of 2 requirement on   |Support vector_size that is
                   |vector_size not documented  |not a power of 2
           Severity|normal                      |enhancement

--- Comment #4 from Marc Glisse <glisse at gcc dot gnu.org> 2012-11-16 16:06:28 UTC ---
Not a priority.


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

* [Bug middle-end/53024] Support vector_size that is not a power of 2
  2012-04-17 20:40 [Bug c/53024] New: Power of 2 requirement on vector_size not documented marc.glisse at normalesup dot org
                   ` (3 preceding siblings ...)
  2012-11-16 16:06 ` [Bug middle-end/53024] Support vector_size that is not a power of 2 glisse at gcc dot gnu.org
@ 2012-11-16 18:18 ` pinskia at gcc dot gnu.org
  2012-11-16 20:03 ` glisse at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-11-16 18:18 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-11-16 18:18:16 UTC ---
I don't think we can ever support vector size of non power 2 size.


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

* [Bug middle-end/53024] Support vector_size that is not a power of 2
  2012-04-17 20:40 [Bug c/53024] New: Power of 2 requirement on vector_size not documented marc.glisse at normalesup dot org
                   ` (4 preceding siblings ...)
  2012-11-16 18:18 ` pinskia at gcc dot gnu.org
@ 2012-11-16 20:03 ` glisse at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: glisse at gcc dot gnu.org @ 2012-11-16 20:03 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #6 from Marc Glisse <glisse at gcc dot gnu.org> 2012-11-16 20:03:05 UTC ---
(In reply to comment #5)
> I don't think we can ever support vector size of non power 2 size.

I don't think we *will* ever support them (too much work, too little benefit),
but I am not sure why we couldn't in principle.


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

end of thread, other threads:[~2012-11-16 20:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-17 20:40 [Bug c/53024] New: Power of 2 requirement on vector_size not documented marc.glisse at normalesup dot org
2012-04-18 10:16 ` [Bug c/53024] " rguenth at gcc dot gnu.org
2012-09-27 10:06 ` glisse at gcc dot gnu.org
2012-09-27 10:14 ` glisse at gcc dot gnu.org
2012-11-16 16:06 ` [Bug middle-end/53024] Support vector_size that is not a power of 2 glisse at gcc dot gnu.org
2012-11-16 18:18 ` pinskia at gcc dot gnu.org
2012-11-16 20:03 ` glisse at gcc dot gnu.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).