xref: /OK3568_Linux_fs/kernel/arch/arm/include/asm/compiler.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun #ifndef __ASM_ARM_COMPILER_H
3*4882a593Smuzhiyun #define __ASM_ARM_COMPILER_H
4*4882a593Smuzhiyun 
5*4882a593Smuzhiyun /*
6*4882a593Smuzhiyun  * This is used to ensure the compiler did actually allocate the register we
7*4882a593Smuzhiyun  * asked it for some inline assembly sequences.  Apparently we can't trust
8*4882a593Smuzhiyun  * the compiler from one version to another so a bit of paranoia won't hurt.
9*4882a593Smuzhiyun  * This string is meant to be concatenated with the inline asm string and
10*4882a593Smuzhiyun  * will cause compilation to stop on mismatch.
11*4882a593Smuzhiyun  * (for details, see gcc PR 15089)
12*4882a593Smuzhiyun  * For compatibility with clang, we have to specifically take the equivalence
13*4882a593Smuzhiyun  * of 'r11' <-> 'fp' and 'r12' <-> 'ip' into account as well.
14*4882a593Smuzhiyun  */
15*4882a593Smuzhiyun #define __asmeq(x, y)				\
16*4882a593Smuzhiyun 	".ifnc " x "," y "; "			\
17*4882a593Smuzhiyun 	  ".ifnc " x y ",fpr11; " 		\
18*4882a593Smuzhiyun 	    ".ifnc " x y ",r11fp; "		\
19*4882a593Smuzhiyun 	      ".ifnc " x y ",ipr12; " 		\
20*4882a593Smuzhiyun 	        ".ifnc " x y ",r12ip; "		\
21*4882a593Smuzhiyun 	          ".err; "			\
22*4882a593Smuzhiyun 	        ".endif; "			\
23*4882a593Smuzhiyun 	      ".endif; "			\
24*4882a593Smuzhiyun 	    ".endif; "				\
25*4882a593Smuzhiyun 	  ".endif; "				\
26*4882a593Smuzhiyun 	".endif\n\t"
27*4882a593Smuzhiyun 
28*4882a593Smuzhiyun 
29*4882a593Smuzhiyun #endif /* __ASM_ARM_COMPILER_H */
30