This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/63673] VSX intrinsic vec_vsx_ld fails to compile with double, maps to wrong instructions with float
- From: "wschmidt at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 20 Nov 2014 21:14:33 +0000
- Subject: [Bug target/63673] VSX intrinsic vec_vsx_ld fails to compile with double, maps to wrong instructions with float
- Auto-submitted: auto-generated
- References: <bug-63673-4 at http dot gcc dot gnu dot org/bugzilla/>
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).