1 /* SPDX-License-Identifier: Apache-2.0 */
2 /*
3  * Copyright (C) 2021 Synopsys, Inc. (www.synopsys.com)
4  *
5  * Author: Vineet Gupta <vgupta@synopsys.com>
6  *
7  * Top level include file providing ISA pseudo-mnemonics for use in assembler
8  * and inline assembly.
9  *
10  *  - Helps code reuse across ARC64/ARC32/ARCv2
11  *    e.g. "LDR" maps to 'LD' on 32-bit ISA, 'LDL' on 64-bit ARCv2/ARC64
12  *
13  *  - Provides emulation with multiple instructions if the case be
14  *    e.g. "DBNZ" implemented using 'SUB' and 'BRNE'
15  *
16  *  - Looks more complex than it really is: mainly because Kconfig defines
17  *    are not "honored" in inline assembly. So each variant is unconditional
18  *    code in a standalone file with Kconfig based #ifdef'ry here. During the
19  *    build process, the "C" preprocessor runs through this file, leaving
20  *    just the final variant include in code fed to compiler/assembler.
21  */
22 
23 #ifndef __ASM_ARC_ASM_H
24 #define __ASM_ARC_ASM_H 1
25 
26 #ifdef _ASMLANGUAGE
27 
28 #if defined(CONFIG_ISA_ARCV3) && defined(CONFIG_64BIT)
29 #define ARC_PTR		.xword
30 #define ARC_REGSZ	8
31 #define ARC_REGSHIFT	3
32 
33 #if defined(__CCAC__)
34 #include "asm-macro-64-bit-mwdt.h"
35 #else
36 #include "asm-macro-64-bit-gnu.h"
37 #endif /* defined(__CCAC__) */
38 
39 #elif defined(CONFIG_ISA_ARCV3) && !defined(CONFIG_64BIT)
40 #define ARC_PTR		.word
41 #define ARC_REGSZ	4
42 #define ARC_REGSHIFT	2
43 
44 #if defined(__CCAC__)
45 #include "asm-macro-32-bit-mwdt.h"
46 #else
47 #include "asm-macro-32-bit-gnu.h"
48 #endif /* defined(__CCAC__) */
49 
50 #else
51 #define ARC_PTR		.word
52 #define ARC_REGSZ	4
53 #define ARC_REGSHIFT	2
54 
55 #if defined(__CCAC__)
56 #include "asm-macro-32-bit-mwdt.h"
57 #else
58 #include "asm-macro-32-bit-gnu.h"
59 #endif /* defined(__CCAC__) */
60 
61 #endif
62 
63 #else	/* !_ASMLANGUAGE */
64 
65 #error "asm-compat macroses used not in assembler code!"
66 
67 #endif	/* _ASMLANGUAGE */
68 
69 #endif
70