Esempio n. 1
0
RenderScript32TargetInfo::RenderScript32TargetInfo(const llvm::Triple &Triple,
                                                   const TargetOptions &Opts)
    : ARMleTargetInfo(llvm::Triple("armv7", Triple.getVendorName(),
                                   Triple.getOSName(),
                                   Triple.getEnvironmentName()),
                      Opts) {
  IsRenderScriptTarget = true;
  LongWidth = LongAlign = 64;
}
Esempio n. 2
0
AMDGPUTargetInfo::AMDGPUTargetInfo(const llvm::Triple &Triple,
                                   const TargetOptions &Opts)
    : TargetInfo(Triple),
      GPU(isAMDGCN(Triple) ? GK_GFX6 : parseR600Name(Opts.CPU)),
      hasFP64(false), hasFMAF(false), hasLDEXPF(false),
      AS(isGenericZero(Triple)) {
  if (getTriple().getArch() == llvm::Triple::amdgcn) {
    hasFP64 = true;
    hasFMAF = true;
    hasLDEXPF = true;
  }
  if (getTriple().getArch() == llvm::Triple::r600) {
    if (GPU == GK_EVERGREEN_DOUBLE_OPS || GPU == GK_CAYMAN) {
      hasFMAF = true;
    }
  }
  auto IsGenericZero = isGenericZero(Triple);
  resetDataLayout(getTriple().getArch() == llvm::Triple::amdgcn
                      ? (IsGenericZero ? DataLayoutStringSIGenericIsZero
                                       : DataLayoutStringSIPrivateIsZero)
                      : DataLayoutStringR600);
  assert(DataLayout->getAllocaAddrSpace() == AS.Private);

  setAddressSpaceMap(Triple.getOS() == llvm::Triple::Mesa3D ||
                     Triple.getEnvironment() == llvm::Triple::OpenCL ||
                     Triple.getEnvironmentName() == "amdgizcl" ||
                     !isAMDGCN(Triple));
  UseAddrSpaceMapMangling = true;

  // Set pointer width and alignment for target address space 0.
  PointerWidth = PointerAlign = DataLayout->getPointerSizeInBits();
  if (getMaxPointerWidth() == 64) {
    LongWidth = LongAlign = 64;
    SizeType = UnsignedLong;
    PtrDiffType = SignedLong;
    IntPtrType = SignedLong;
  }

  MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
}