target-arm.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #include "symbol.h"
  2. #include "target.h"
  3. #include "machine.h"
  4. static void init_arm(const struct target *self)
  5. {
  6. fast16_ctype = &int_ctype;
  7. ufast16_ctype = &uint_ctype;
  8. fast32_ctype = &int_ctype;
  9. ufast32_ctype = &uint_ctype;
  10. if (arch_os == OS_NONE) {
  11. int32_ctype = &long_ctype;
  12. uint32_ctype = &ulong_ctype;
  13. fast8_ctype = &int_ctype;
  14. ufast8_ctype = &uint_ctype;
  15. }
  16. }
  17. static void predefine_arm(const struct target *self)
  18. {
  19. predefine("__arm__", 1, "1");
  20. predefine("__VFP_FP__", 1, "1");
  21. switch (arch_fp_abi) {
  22. case FP_ABI_HARD:
  23. predefine("__ARM_PCS_VFP", 1, "1");
  24. break;
  25. case FP_ABI_SOFT:
  26. predefine("__SOFTFP__", 1, "1");
  27. /* fall-through */
  28. case FP_ABI_HYBRID:
  29. predefine("__ARM_PCS", 1, "1");
  30. break;
  31. }
  32. if (arch_big_endian)
  33. predefine("__ARMEB__", 0, "1");
  34. else
  35. predefine("__ARMEL__", 0, "1");
  36. }
  37. const struct target target_arm = {
  38. .mach = MACH_ARM,
  39. .bitness = ARCH_LP32,
  40. .big_endian = 0,
  41. .unsigned_char = 1,
  42. .wchar = &uint_ctype,
  43. .bits_in_longdouble = 64,
  44. .max_fp_alignment = 8,
  45. .init = init_arm,
  46. .predefine = predefine_arm,
  47. };