This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[power7-meissner] Add __builtin_bswap{16,64} support to powerpc
- From: Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 11 Jun 2009 17:40:44 -0400
- Subject: [power7-meissner] Add __builtin_bswap{16,64} support to powerpc
This patch adds a builtin (__builtin_bswap16) which generates the lhbrx and
sthbrx instructions for 16-bit swaps to/from memory, and supports the
__builtin_bswap64 builtin as well. If ISA 2.06 is available on 64-bit systems,
then ldbrx and stbrx are generated, if not, then two ldwbrx/stwbrx's are used.
--
Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
meissner@linux.vnet.ibm.com