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

            Bug ID: 61744
           Summary: misleading documentation about cast of extended
                    vectors
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: web
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vincenzo.innocente at cern dot ch

At the very bottom of https://gcc.gnu.org/onlinedocs/gcc/Vector-Extensions.html
one reads
"It is possible to cast from one vector type to another, provided they are of
the same size (in fact, you can also cast vectors to and from other datatypes
of the same size)."

I find this misleading as the reader can think that the result of such a cast
is similar to a C-style cast of each element, while instead is a simple
"reinterpretation" of the bit content (as "memcpy").

I suggest to add 
"The result is a vector of the new type with the same bit-content of the
original."
One can even add
", not what expected from a C-style cast".

Of course adding a proper conversion builtin (see PR61731) would definitively
solve the issue ;-)

Reply via email to