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