[AMDGPU] Emit correct kernel descriptor on big-endian hosts
authorScott Linder <Scott.Linder@amd.com>
Mon, 5 Oct 2020 22:45:35 +0000 (22:45 +0000)
committerScott Linder <Scott.Linder@amd.com>
Tue, 6 Oct 2020 17:29:38 +0000 (17:29 +0000)
commite4a9e4ef554a90637c53d4f10326c262df69b76c
treed2c524926f58212cc5120f4d0b4bc584e4a91020
parent92e83afe44fbfd81ffd428bb41b7f760eee712f9
[AMDGPU] Emit correct kernel descriptor on big-endian hosts

Previously we wrote multi-byte values out as-is from host memory. Use
the `emitIntN` helpers in `MCStreamer` to produce a valid descriptor
irrespective of the host endianness.

Reviewed By: arsenm, rochauha

Differential Revision: https://reviews.llvm.org/D88858
llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
llvm/test/MC/AMDGPU/hsa-sgpr-init-bug-v3.s
llvm/test/MC/AMDGPU/hsa-v3.s