This is an archive of the discontinued LLVM Phabricator instance.

Fix endianess issue in global variable constant initialization in NVPTX.
ClosedPublic

Authored by sfantao on May 22 2015, 1:46 PM.

Details

Reviewers
jholewinski
Summary

The constant initialization for globals in NVPTX is generated as an array of bytes. The generation of this byte arrays expects the host to be little endian, which prevents big endian hosts to be used in the generation of the PTX code.

This patch fixes the problem by changing the way the bytes are extracted so that it works for either little and big endian.

I identified this issue while crosscompiling for PTX in power7 machines.

Diff Detail

Event Timeline

sfantao updated this revision to Diff 26341.May 22 2015, 1:46 PM
sfantao retitled this revision from to Fix endianess issue in global variable constant initialization in NVPTX..
sfantao updated this object.
sfantao edited the test plan for this revision. (Show Details)
sfantao added a reviewer: jholewinski.
sfantao added a subscriber: Unknown Object (MLST).

Any comments on this patch?

Thanks!
Samuel

jholewinski accepted this revision.Jun 8 2015, 3:47 PM
jholewinski edited edge metadata.

LGTM.

Sorry for the delay. I was out of town when this was posted and completely missed it.

This revision is now accepted and ready to land.Jun 8 2015, 3:47 PM
sfantao closed this revision.Jun 9 2015, 9:36 AM

Thanks for the review! Committed in r239412.

Samuel