call_apsr.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //todo check license
  2. //===-- call_apsr.h - Helpers for ARM EABI floating point tests -----------===//
  3. //
  4. // The LLVM Compiler Infrastructure
  5. //
  6. // This file is dual licensed under the MIT and the University of Illinois Open
  7. // Source Licenses. See LICENSE.TXT for details.
  8. //
  9. //===----------------------------------------------------------------------===//
  10. //
  11. // This file declares helpers for ARM EABI floating point tests for the
  12. // compiler_rt library.
  13. //
  14. //===----------------------------------------------------------------------===//
  15. #ifndef CALL_APSR_H
  16. #define CALL_APSR_H
  17. #if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
  18. #error big endian support not implemented
  19. #endif
  20. union cpsr {
  21. struct {
  22. uint32_t filler: 28;
  23. uint32_t v: 1;
  24. uint32_t c: 1;
  25. uint32_t z: 1;
  26. uint32_t n: 1;
  27. } flags;
  28. uint32_t value;
  29. };
  30. extern __attribute__((pcs("aapcs")))
  31. uint32_t call_apsr_f(float a, float b, __attribute__((pcs("aapcs"))) void (*fn)(float, float));
  32. extern __attribute__((pcs("aapcs")))
  33. uint32_t call_apsr_d(double a, double b, __attribute__((pcs("aapcs"))) void (*fn)(double, double));
  34. #endif // CALL_APSR_H