llvm.org GIT mirror llvm / 1eaeee8
Merging r226970: ------------------------------------------------------------------------ r226970 | thomas.stellard | 2015-01-23 18:59:08 -0500 (Fri, 23 Jan 2015) | 2 lines R600/SI: Emit .hsa.version section for amdhsa OS ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_36@227365 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 4 years ago
2 changed file(s) with 15 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
115115 const AMDGPUSubtarget &STM = TM.getSubtarget();
116116 SIProgramInfo KernelInfo;
117117 if (STM.isAmdHsaOS()) {
118 OutStreamer.SwitchSection(getObjFileLowering().getTextSection());
119118 getSIProgramInfo(KernelInfo, MF);
120119 EmitAmdKernelCodeT(MF, KernelInfo);
121120 OutStreamer.EmitCodeAlignment(2 << (MF.getAlignment() - 1));
507506 header.code_type = 1; // HSA_EXT_CODE_KERNEL
508507
509508 header.wavefront_size = STM.getWavefrontSize();
509
510 const MCSectionELF *VersionSection = OutContext.getELFSection(".hsa.version",
511 ELF::SHT_PROGBITS, 0, SectionKind::getReadOnly());
512 OutStreamer.SwitchSection(VersionSection);
513 OutStreamer.EmitBytes(Twine("HSA Code Unit:" +
514 Twine(header.hsail_version_major) + "." +
515 Twine(header.hsail_version_minor) + ":" +
516 "AMD:" +
517 Twine(header.amd_code_version_major) + "." +
518 Twine(header.amd_code_version_minor) + ":" +
519 "GFX8.1:0").str());
520
521 OutStreamer.SwitchSection(getObjFileLowering().getTextSection());
510522
511523 if (isVerbose()) {
512524 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