This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/63673] VSX intrinsic vec_vsx_ld fails to compile with double, maps to wrong instructions with float


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

Bill Schmidt <wschmidt at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|powerpc                     |powerpc64le-unknown-linux-g
                   |                            |nu
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |wschmidt at gcc dot gnu.org
         Resolution|---                         |INVALID

--- Comment #3 from Bill Schmidt <wschmidt at gcc dot gnu.org> ---
The case using doubles is user error.  You have violated the type system.  You
should instead use:

  vector double v = vec_vsx_ld(8, (vector double *)d); // should load {1.0,
2.0\
}

The case using floats is not an error.

You are compiling for little-endian, and the lxvw4x instruction loads the
vector elements in big-endian order (element 0 on the left).  The sequence:

        lxvd2x 0,9,10
        xxpermdi 0,0,0,2

causes the vector elements to be loaded in little-endian order (element 0 on
the right).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]