compiler-intel.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __LINUX_COMPILER_TYPES_H
  3. #error "Please don't include <linux/compiler-intel.h> directly, include <linux/compiler.h> instead."
  4. #endif
  5. #ifdef __ECC
  6. /* Some compiler specific definitions are overwritten here
  7. * for Intel ECC compiler
  8. */
  9. #include <asm/intrinsics.h>
  10. /* Intel ECC compiler doesn't support gcc specific asm stmts.
  11. * It uses intrinsics to do the equivalent things.
  12. */
  13. #undef barrier
  14. #undef barrier_data
  15. #undef RELOC_HIDE
  16. #undef OPTIMIZER_HIDE_VAR
  17. #define barrier() __memory_barrier()
  18. #define barrier_data(ptr) barrier()
  19. #define RELOC_HIDE(ptr, off) \
  20. ({ unsigned long __ptr; \
  21. __ptr = (unsigned long) (ptr); \
  22. (typeof(ptr)) (__ptr + (off)); })
  23. /* This should act as an optimization barrier on var.
  24. * Given that this compiler does not have inline assembly, a compiler barrier
  25. * is the best we can do.
  26. */
  27. #define OPTIMIZER_HIDE_VAR(var) barrier()
  28. /* Intel ECC compiler doesn't support __builtin_types_compatible_p() */
  29. #define __must_be_array(a) 0
  30. #endif
  31. #ifndef __HAVE_BUILTIN_BSWAP16__
  32. /* icc has this, but it's called _bswap16 */
  33. #define __HAVE_BUILTIN_BSWAP16__
  34. #define __builtin_bswap16 _bswap16
  35. #endif
  36. /*
  37. * icc defines __GNUC__, but does not implement the builtin overflow checkers.
  38. */
  39. #undef COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW