blob: d4c71132d07f0bd03b22766310455b8c133b6070 [file] [log] [blame]
Masahiro Yamadafb8ffd72014-09-04 02:40:58 +09001#ifndef __LINUX_COMPILER_H
2#error "Please don't include <linux/compiler-intel.h> directly, include <linux/compiler.h> instead."
3#endif
4
5#ifdef __ECC
6
7/* Some compiler specific definitions are overwritten here
8 * for Intel ECC compiler
9 */
10
11#include <asm/intrinsics.h>
12
13/* Intel ECC compiler doesn't support gcc specific asm stmts.
14 * It uses intrinsics to do the equivalent things.
15 */
Tom Rini9b2c2822016-02-29 11:34:15 -050016#undef barrier
17#undef barrier_data
Masahiro Yamadafb8ffd72014-09-04 02:40:58 +090018#undef RELOC_HIDE
19#undef OPTIMIZER_HIDE_VAR
20
Tom Rini9b2c2822016-02-29 11:34:15 -050021#define barrier() __memory_barrier()
22#define barrier_data(ptr) barrier()
23
Masahiro Yamadafb8ffd72014-09-04 02:40:58 +090024#define RELOC_HIDE(ptr, off) \
25 ({ unsigned long __ptr; \
26 __ptr = (unsigned long) (ptr); \
27 (typeof(ptr)) (__ptr + (off)); })
28
29/* This should act as an optimization barrier on var.
30 * Given that this compiler does not have inline assembly, a compiler barrier
31 * is the best we can do.
32 */
33#define OPTIMIZER_HIDE_VAR(var) barrier()
34
35/* Intel ECC compiler doesn't support __builtin_types_compatible_p() */
36#define __must_be_array(a) 0
37
38#endif
39
40#ifndef __HAVE_BUILTIN_BSWAP16__
41/* icc has this, but it's called _bswap16 */
42#define __HAVE_BUILTIN_BSWAP16__
43#define __builtin_bswap16 _bswap16
44#endif
45