Mips.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //===--- Mips.h - Mips-specific Tool Helpers ----------------------*- C++ -*-===//
  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. #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_MIPS_H
  9. #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_MIPS_H
  10. #include "clang/Driver/Driver.h"
  11. #include "llvm/ADT/StringRef.h"
  12. #include "llvm/ADT/Triple.h"
  13. #include "llvm/Option/Option.h"
  14. #include <string>
  15. #include <vector>
  16. namespace clang {
  17. namespace driver {
  18. namespace tools {
  19. namespace mips {
  20. typedef enum { Legacy = 1, Std2008 = 2 } IEEE754Standard;
  21. enum class FloatABI {
  22. Invalid,
  23. Soft,
  24. Hard,
  25. };
  26. IEEE754Standard getIEEE754Standard(StringRef &CPU);
  27. bool hasCompactBranches(StringRef &CPU);
  28. void getMipsCPUAndABI(const llvm::opt::ArgList &Args,
  29. const llvm::Triple &Triple, StringRef &CPUName,
  30. StringRef &ABIName);
  31. void getMIPSTargetFeatures(const Driver &D, const llvm::Triple &Triple,
  32. const llvm::opt::ArgList &Args,
  33. std::vector<StringRef> &Features);
  34. StringRef getGnuCompatibleMipsABIName(StringRef ABI);
  35. mips::FloatABI getMipsFloatABI(const Driver &D, const llvm::opt::ArgList &Args,
  36. const llvm::Triple &Triple);
  37. std::string getMipsABILibSuffix(const llvm::opt::ArgList &Args,
  38. const llvm::Triple &Triple);
  39. bool hasMipsAbiArg(const llvm::opt::ArgList &Args, const char *Value);
  40. bool isUCLibc(const llvm::opt::ArgList &Args);
  41. bool isNaN2008(const Driver &D, const llvm::opt::ArgList &Args,
  42. const llvm::Triple &Triple);
  43. bool isFP64ADefault(const llvm::Triple &Triple, StringRef CPUName);
  44. bool isFPXXDefault(const llvm::Triple &Triple, StringRef CPUName,
  45. StringRef ABIName, mips::FloatABI FloatABI);
  46. bool shouldUseFPXX(const llvm::opt::ArgList &Args, const llvm::Triple &Triple,
  47. StringRef CPUName, StringRef ABIName,
  48. mips::FloatABI FloatABI);
  49. bool supportsIndirectJumpHazardBarrier(StringRef &CPU);
  50. } // end namespace mips
  51. } // end namespace target
  52. } // end namespace driver
  53. } // end namespace clang
  54. #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_ARCH_MIPS_H