summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2015-01-23 23:59:08 +0000
committerTom Stellard <thomas.stellard@amd.com>2015-01-23 23:59:08 +0000
commitedd188c4595bd1e6ee6023db0dec9f38c74fd399 (patch)
treecd7f1c71e8daaab28323145237e314711b9d6198 /llvm/lib
parent3d4638b391f1d3c0bbc3b89f7ddf55ac5dd17ece (diff)
downloadbcm5719-llvm-edd188c4595bd1e6ee6023db0dec9f38c74fd399.tar.gz
bcm5719-llvm-edd188c4595bd1e6ee6023db0dec9f38c74fd399.zip
R600/SI: Emit .hsa.version section for amdhsa OS
llvm-svn: 226970
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp b/llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp
index cae116f4168..8f35f587712 100644
--- a/llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp
+++ b/llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp
@@ -118,7 +118,6 @@ bool AMDGPUAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
const AMDGPUSubtarget &STM = TM.getSubtarget<AMDGPUSubtarget>();
SIProgramInfo KernelInfo;
if (STM.isAmdHsaOS()) {
- OutStreamer.SwitchSection(getObjFileLowering().getTextSection());
getSIProgramInfo(KernelInfo, MF);
EmitAmdKernelCodeT(MF, KernelInfo);
OutStreamer.EmitCodeAlignment(2 << (MF.getAlignment() - 1));
@@ -511,6 +510,19 @@ void AMDGPUAsmPrinter::EmitAmdKernelCodeT(const MachineFunction &MF,
header.wavefront_size = STM.getWavefrontSize();
+ const MCSectionELF *VersionSection = OutContext.getELFSection(".hsa.version",
+ ELF::SHT_PROGBITS, 0, SectionKind::getReadOnly());
+ OutStreamer.SwitchSection(VersionSection);
+ OutStreamer.EmitBytes(Twine("HSA Code Unit:" +
+ Twine(header.hsail_version_major) + "." +
+ Twine(header.hsail_version_minor) + ":" +
+ "AMD:" +
+ Twine(header.amd_code_version_major) + "." +
+ Twine(header.amd_code_version_minor) + ":" +
+ "GFX8.1:0").str());
+
+ OutStreamer.SwitchSection(getObjFileLowering().getTextSection());
+
if (isVerbose()) {
OutStreamer.emitRawComment("amd_code_version_major = " +
Twine(header.amd_code_version_major), false);
OpenPOWER on IntegriCloud