Ignore:
Timestamp:
Jan 28, 2018, 9:23:05 AM (23 months ago)
Author:
matszpk
Message:

CLRadeonExtender: AsmROCm: Add '.tripple' to set same LLVM target tripple without device name.
CLRXDocs: add '.tripple' and '.target' descriptions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/amdbin/ROCmBinaries.cpp

    r3669 r3671  
    2020#include <CLRX/Config.h>
    2121#include <cassert>
     22#include <cstdio>
    2223#include <cstdint>
    2324#include <algorithm>
     
    422423                    Elf64Types::nobase, Elf64Types::nobase, 0, 4 });
    423424   
     425    std::string target = input->target.c_str();
     426    if (target.empty() && !input->targetTripple.empty())
     427    {
     428        target = input->targetTripple.c_str();
     429        char dbuf[20];
     430        snprintf(dbuf, 20, "-gfx%u%u%u", amdGpuArchValues.major, amdGpuArchValues.minor,
     431                 amdGpuArchValues.stepping);
     432        target += dbuf;
     433    }
    424434    // elf notes
    425435    elfBinGen64.addNote({"AMD", sizeof noteDescType1, noteDescType1, 1U});
     
    430440    SULEV(*(uint32_t*)(noteBuf.get()+12), amdGpuArchValues.stepping);
    431441    elfBinGen64.addNote({"AMD", 0x1b, noteBuf.get(), 3U});
    432     if (!input->target.empty())
    433         elfBinGen64.addNote({"AMD", input->target.size(),
    434                 (const cxbyte*)input->target.c_str(), 0xbU});
     442    if (!target.empty())
     443        elfBinGen64.addNote({"AMD", target.size(), (const cxbyte*)target.c_str(), 0xbU});
    435444    if (input->metadataSize != 0)
    436445        elfBinGen64.addNote({"AMD", input->metadataSize,
Note: See TracChangeset for help on using the changeset viewer.