compiler.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (C) 2004, 2007 Maciej W. Rozycki
  3. *
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file "COPYING" in the main directory of this archive
  6. * for more details.
  7. */
  8. #ifndef _ASM_COMPILER_H
  9. #define _ASM_COMPILER_H
  10. #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
  11. #define GCC_IMM_ASM() "n"
  12. #define GCC_REG_ACCUM "$0"
  13. #else
  14. #define GCC_IMM_ASM() "rn"
  15. #define GCC_REG_ACCUM "accum"
  16. #endif
  17. #ifdef CONFIG_CPU_MIPSR6
  18. /* All MIPS R6 toolchains support the ZC constrain */
  19. #define GCC_OFF_SMALL_ASM() "ZC"
  20. #else
  21. #ifndef CONFIG_CPU_MICROMIPS
  22. #define GCC_OFF_SMALL_ASM() "R"
  23. #elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)
  24. #define GCC_OFF_SMALL_ASM() "ZC"
  25. #else
  26. #error "microMIPS compilation unsupported with GCC older than 4.9"
  27. #endif /* CONFIG_CPU_MICROMIPS */
  28. #endif /* CONFIG_CPU_MIPSR6 */
  29. #ifdef CONFIG_CPU_MIPSR6
  30. #define MIPS_ISA_LEVEL "mips64r6"
  31. #define MIPS_ISA_ARCH_LEVEL MIPS_ISA_LEVEL
  32. #define MIPS_ISA_LEVEL_RAW mips64r6
  33. #define MIPS_ISA_ARCH_LEVEL_RAW MIPS_ISA_LEVEL_RAW
  34. #else
  35. /* MIPS64 is a superset of MIPS32 */
  36. #define MIPS_ISA_LEVEL "mips64r2"
  37. #define MIPS_ISA_ARCH_LEVEL "arch=r4000"
  38. #define MIPS_ISA_LEVEL_RAW mips64r2
  39. #define MIPS_ISA_ARCH_LEVEL_RAW MIPS_ISA_LEVEL_RAW
  40. #endif /* CONFIG_CPU_MIPSR6 */
  41. #endif /* _ASM_COMPILER_H */