162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#ifndef __ASM_ARM_COMPILER_H
362306a36Sopenharmony_ci#define __ASM_ARM_COMPILER_H
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci/*
662306a36Sopenharmony_ci * This is used to ensure the compiler did actually allocate the register we
762306a36Sopenharmony_ci * asked it for some inline assembly sequences.  Apparently we can't trust
862306a36Sopenharmony_ci * the compiler from one version to another so a bit of paranoia won't hurt.
962306a36Sopenharmony_ci * This string is meant to be concatenated with the inline asm string and
1062306a36Sopenharmony_ci * will cause compilation to stop on mismatch.
1162306a36Sopenharmony_ci * (for details, see gcc PR 15089)
1262306a36Sopenharmony_ci * For compatibility with clang, we have to specifically take the equivalence
1362306a36Sopenharmony_ci * of 'r11' <-> 'fp' and 'r12' <-> 'ip' into account as well.
1462306a36Sopenharmony_ci */
1562306a36Sopenharmony_ci#define __asmeq(x, y)				\
1662306a36Sopenharmony_ci	".ifnc " x "," y "; "			\
1762306a36Sopenharmony_ci	  ".ifnc " x y ",fpr11; " 		\
1862306a36Sopenharmony_ci	    ".ifnc " x y ",r11fp; "		\
1962306a36Sopenharmony_ci	      ".ifnc " x y ",ipr12; " 		\
2062306a36Sopenharmony_ci	        ".ifnc " x y ",r12ip; "		\
2162306a36Sopenharmony_ci	          ".err; "			\
2262306a36Sopenharmony_ci	        ".endif; "			\
2362306a36Sopenharmony_ci	      ".endif; "			\
2462306a36Sopenharmony_ci	    ".endif; "				\
2562306a36Sopenharmony_ci	  ".endif; "				\
2662306a36Sopenharmony_ci	".endif\n\t"
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ci#endif /* __ASM_ARM_COMPILER_H */
30