This is the mail archive of the gcc-patches@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]

[Patch, microblaze]: Fix bswaphi2 implementation


MicroBlaze insn swaph swaps the contents of register rA as two
halfwords placing result in rD;

(rD)[0:15]  <- (rA)[16:31]
(rD)[16:31] <- (rA)[0:15]

gcc bswaphi2 is intended to reverse the order of the bytes in the
half integer in rA

(rD)[8:15]  <- (rA)[0:7]
(rD)[7:0]   <- (rA)[8:15]
(rD)[24:31] <- (rA)[16:23]
(rD)[16:23] <- (rA)[24:31]

Correct the microblaze bswaphi2 insn pattern to be a swapb followed
by swaph

Changelog entry would be:

2013-07-15  David Holsgrove <david.holsgrove@xilinx.com>

 * gcc/config/microblaze/microblaze.md: Fix bswaphi2


Can this also be backported to the gcc-4_8-branch?

thanks,
David

Attachment: 0002-Patch-microblaze-Fix-bswaphi2-implementation.patch
Description: Binary data


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