llvm.org GIT mirror llvm / 5b37a2e
R600/SI: Emit .hsa.version section for amdhsa OS git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226970 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 5 years ago
2 changed file(s) with 15 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
117117 const AMDGPUSubtarget &STM = TM.getSubtarget();
118118 SIProgramInfo KernelInfo;
119119 if (STM.isAmdHsaOS()) {
120 OutStreamer.SwitchSection(getObjFileLowering().getTextSection());
121120 getSIProgramInfo(KernelInfo, MF);
122121 EmitAmdKernelCodeT(MF, KernelInfo);
123122 OutStreamer.EmitCodeAlignment(2 << (MF.getAlignment() - 1));
509508 header.code_type = 1; // HSA_EXT_CODE_KERNEL
510509
511510 header.wavefront_size = STM.getWavefrontSize();
511
512 const MCSectionELF *VersionSection = OutContext.getELFSection(".hsa.version",
513 ELF::SHT_PROGBITS, 0, SectionKind::getReadOnly());
514 OutStreamer.SwitchSection(VersionSection);
515 OutStreamer.EmitBytes(Twine("HSA Code Unit:" +
516 Twine(header.hsail_version_major) + "." +
517 Twine(header.hsail_version_minor) + ":" +
518 "AMD:" +
519 Twine(header.amd_code_version_major) + "." +
520 Twine(header.amd_code_version_minor) + ":" +
521 "GFX8.1:0").str());
522
523 OutStreamer.SwitchSection(getObjFileLowering().getTextSection());
512524
513525 if (isVerbose()) {
514526 OutStreamer.emitRawComment("amd_code_version_major = " +
0 ; RUN: llc < %s -mtriple=r600--amdhsa -mcpu=kaveri | FileCheck --check-prefix=HSA %s
11
22 ; HSA: {{^}}simple:
3 ; HSA: .section .hsa.version
4 ; HSA-NEXT: .ascii "HSA Code Unit:0.0:AMD:0.1:GFX8.1:0"
35 ; Make sure we are setting the ATC bit:
46 ; HSA: s_mov_b32 s[[HI:[0-9]]], 0x100f000
57 ; HSA: buffer_store_dword v{{[0-9]+}}, s[0:[[HI]]], 0