~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/alpha/include/uapi/asm/compiler.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2 #ifndef _UAPI__ALPHA_COMPILER_H
  3 #define _UAPI__ALPHA_COMPILER_H
  4 
  5 /* 
  6  * Herein are macros we use when describing various patterns we want to GCC.
  7  * In all cases we can get better schedules out of the compiler if we hide
  8  * as little as possible inside inline assembly.  However, we want to be
  9  * able to know what we'll get out before giving up inline assembly.  Thus
 10  * these tests and macros.
 11  */
 12 
 13 #if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3
 14 # define __kernel_insbl(val, shift)     __builtin_alpha_insbl(val, shift)
 15 # define __kernel_inswl(val, shift)     __builtin_alpha_inswl(val, shift)
 16 # define __kernel_insql(val, shift)     __builtin_alpha_insql(val, shift)
 17 # define __kernel_inslh(val, shift)     __builtin_alpha_inslh(val, shift)
 18 # define __kernel_extbl(val, shift)     __builtin_alpha_extbl(val, shift)
 19 # define __kernel_extwl(val, shift)     __builtin_alpha_extwl(val, shift)
 20 # define __kernel_cmpbge(a, b)          __builtin_alpha_cmpbge(a, b)
 21 #else
 22 # define __kernel_insbl(val, shift)                                     \
 23   ({ unsigned long __kir;                                               \
 24      __asm__("insbl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));   \
 25      __kir; })
 26 # define __kernel_inswl(val, shift)                                     \
 27   ({ unsigned long __kir;                                               \
 28      __asm__("inswl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));   \
 29      __kir; })
 30 # define __kernel_insql(val, shift)                                     \
 31   ({ unsigned long __kir;                                               \
 32      __asm__("insql %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));   \
 33      __kir; })
 34 # define __kernel_inslh(val, shift)                                     \
 35   ({ unsigned long __kir;                                               \
 36      __asm__("inslh %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));   \
 37      __kir; })
 38 # define __kernel_extbl(val, shift)                                     \
 39   ({ unsigned long __kir;                                               \
 40      __asm__("extbl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));   \
 41      __kir; })
 42 # define __kernel_extwl(val, shift)                                     \
 43   ({ unsigned long __kir;                                               \
 44      __asm__("extwl %2,%1,%0" : "=r"(__kir) : "rI"(shift), "r"(val));   \
 45      __kir; })
 46 # define __kernel_cmpbge(a, b)                                          \
 47   ({ unsigned long __kir;                                               \
 48      __asm__("cmpbge %r2,%1,%0" : "=r"(__kir) : "rI"(b), "rJ"(a));      \
 49      __kir; })
 50 #endif
 51 
 52 #ifdef __alpha_cix__
 53 # if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3
 54 #  define __kernel_cttz(x)              __builtin_ctzl(x)
 55 #  define __kernel_ctlz(x)              __builtin_clzl(x)
 56 #  define __kernel_ctpop(x)             __builtin_popcountl(x)
 57 # else
 58 #  define __kernel_cttz(x)                                              \
 59    ({ unsigned long __kir;                                              \
 60       __asm__("cttz %1,%0" : "=r"(__kir) : "r"(x));                     \
 61       __kir; })
 62 #  define __kernel_ctlz(x)                                              \
 63    ({ unsigned long __kir;                                              \
 64       __asm__("ctlz %1,%0" : "=r"(__kir) : "r"(x));                     \
 65       __kir; })
 66 #  define __kernel_ctpop(x)                                             \
 67    ({ unsigned long __kir;                                              \
 68       __asm__("ctpop %1,%0" : "=r"(__kir) : "r"(x));                    \
 69       __kir; })
 70 # endif
 71 #else
 72 # define __kernel_cttz(x)                                               \
 73   ({ unsigned long __kir;                                               \
 74      __asm__(".arch ev67; cttz %1,%0" : "=r"(__kir) : "r"(x));          \
 75      __kir; })
 76 # define __kernel_ctlz(x)                                               \
 77   ({ unsigned long __kir;                                               \
 78      __asm__(".arch ev67; ctlz %1,%0" : "=r"(__kir) : "r"(x));          \
 79      __kir; })
 80 # define __kernel_ctpop(x)                                              \
 81   ({ unsigned long __kir;                                               \
 82      __asm__(".arch ev67; ctpop %1,%0" : "=r"(__kir) : "r"(x));         \
 83      __kir; })
 84 #endif
 85 
 86 
 87 /* 
 88  * Beginning with EGCS 1.1, GCC defines __alpha_bwx__ when the BWX 
 89  * extension is enabled.  Previous versions did not define anything
 90  * we could test during compilation -- too bad, so sad.
 91  */
 92 
 93 #if defined(__alpha_bwx__)
 94 #define __kernel_ldbu(mem)      (mem)
 95 #define __kernel_ldwu(mem)      (mem)
 96 #define __kernel_stb(val,mem)   ((mem) = (val))
 97 #define __kernel_stw(val,mem)   ((mem) = (val))
 98 #endif
 99 
100 #endif /* _UAPI__ALPHA_COMPILER_H */
101 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php