Merge tag 'gvt-next-2017-12-14' of https://github.com/intel/gvt-linux into drm-intel...
[sfrench/cifs-2.6.git] / include / linux / compiler-intel.h
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
6 #ifdef __ECC
7
8 /* Some compiler specific definitions are overwritten here
9  * for Intel ECC compiler
10  */
11
12 #include <asm/intrinsics.h>
13
14 /* Intel ECC compiler doesn't support gcc specific asm stmts.
15  * It uses intrinsics to do the equivalent things.
16  */
17 #undef barrier
18 #undef barrier_data
19 #undef RELOC_HIDE
20 #undef OPTIMIZER_HIDE_VAR
21
22 #define barrier() __memory_barrier()
23 #define barrier_data(ptr) barrier()
24
25 #define RELOC_HIDE(ptr, off)                                    \
26   ({ unsigned long __ptr;                                       \
27      __ptr = (unsigned long) (ptr);                             \
28     (typeof(ptr)) (__ptr + (off)); })
29
30 /* This should act as an optimization barrier on var.
31  * Given that this compiler does not have inline assembly, a compiler barrier
32  * is the best we can do.
33  */
34 #define OPTIMIZER_HIDE_VAR(var) barrier()
35
36 /* Intel ECC compiler doesn't support __builtin_types_compatible_p() */
37 #define __must_be_array(a) 0
38
39 #endif
40
41 #ifndef __HAVE_BUILTIN_BSWAP16__
42 /* icc has this, but it's called _bswap16 */
43 #define __HAVE_BUILTIN_BSWAP16__
44 #define __builtin_bswap16 _bswap16
45 #endif
46