NVPTXMCAsmInfo.cpp 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //===-- NVPTXMCAsmInfo.cpp - NVPTX asm properties -------------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This file contains the declarations of the NVPTXMCAsmInfo properties.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. #include "NVPTXMCAsmInfo.h"
  13. #include "llvm/ADT/Triple.h"
  14. using namespace llvm;
  15. void NVPTXMCAsmInfo::anchor() {}
  16. NVPTXMCAsmInfo::NVPTXMCAsmInfo(const Triple &TheTriple,
  17. const MCTargetOptions &Options) {
  18. if (TheTriple.getArch() == Triple::nvptx64) {
  19. CodePointerSize = CalleeSaveStackSlotSize = 8;
  20. }
  21. CommentString = "//";
  22. HasSingleParameterDotFile = false;
  23. InlineAsmStart = " begin inline asm";
  24. InlineAsmEnd = " end inline asm";
  25. SupportsDebugInformation = true;
  26. // PTX does not allow .align on functions.
  27. HasFunctionAlignment = false;
  28. HasDotTypeDotSizeDirective = false;
  29. // PTX does not allow .hidden or .protected
  30. HiddenDeclarationVisibilityAttr = HiddenVisibilityAttr = MCSA_Invalid;
  31. ProtectedVisibilityAttr = MCSA_Invalid;
  32. Data8bitsDirective = ".b8 ";
  33. Data16bitsDirective = nullptr; // not supported
  34. Data32bitsDirective = ".b32 ";
  35. Data64bitsDirective = ".b64 ";
  36. ZeroDirective = ".b8";
  37. AsciiDirective = nullptr; // not supported
  38. AscizDirective = nullptr; // not supported
  39. SupportsQuotedNames = false;
  40. SupportsExtendedDwarfLocDirective = false;
  41. SupportsSignedData = false;
  42. PrivateGlobalPrefix = "$L__";
  43. PrivateLabelPrefix = PrivateGlobalPrefix;
  44. // @TODO: Can we just disable this?
  45. WeakDirective = "\t// .weak\t";
  46. GlobalDirective = "\t// .globl\t";
  47. UseIntegratedAssembler = false;
  48. // Avoid using parens for identifiers starting with $ - ptxas does
  49. // not expect them.
  50. UseParensForDollarSignNames = false;
  51. // ptxas does not support DWARF `.file fileno directory filename'
  52. // syntax as of v11.X.
  53. EnableDwarfFileDirectoryDefault = false;
  54. }