arch: arm: aarch32: Allow selecting compiler instruction set
This commit introduces the `COMPILER_ISA_THUMB2` symbol to allow choosing either the ARM or Thumb instruction set for C code compilation. In addition, this commit introduces the `ASSEMBLER_ISA_THUMB2` helper symbol to specify the default target instruction set for the assembler. Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit is contained in:
parent
e89881f532
commit
0bd86f3604
4 changed files with 55 additions and 22 deletions
|
@ -232,28 +232,24 @@ do { \
|
|||
|
||||
#if defined(CONFIG_ARM) && !defined(CONFIG_ARM64)
|
||||
|
||||
#if defined(CONFIG_ISA_THUMB2)
|
||||
#if defined(CONFIG_ASSEMBLER_ISA_THUMB2)
|
||||
|
||||
#define FUNC_CODE() .thumb;
|
||||
#define FUNC_INSTR(a)
|
||||
|
||||
#elif defined(CONFIG_ISA_ARM)
|
||||
#else
|
||||
|
||||
#define FUNC_CODE() .code 32
|
||||
#define FUNC_INSTR(a)
|
||||
|
||||
#else
|
||||
|
||||
#error unknown instruction set
|
||||
|
||||
#endif /* ISA */
|
||||
#endif /* CONFIG_ASSEMBLER_ISA_THUMB2 */
|
||||
|
||||
#else
|
||||
|
||||
#define FUNC_CODE()
|
||||
#define FUNC_INSTR(a)
|
||||
|
||||
#endif /* !CONFIG_ARM */
|
||||
#endif /* CONFIG_ARM && !CONFIG_ARM64 */
|
||||
|
||||
#endif /* _ASMLANGUAGE */
|
||||
|
||||
|
@ -359,14 +355,16 @@ do { \
|
|||
|
||||
#endif /* _ASMLANGUAGE */
|
||||
|
||||
#if defined(CONFIG_ARM) && defined(_ASMLANGUAGE)
|
||||
#if defined(CONFIG_ISA_THUMB2)
|
||||
#if defined(_ASMLANGUAGE)
|
||||
#if defined(CONFIG_ARM) && !defined(CONFIG_ARM64)
|
||||
#if defined(CONFIG_ASSEMBLER_ISA_THUMB2)
|
||||
/* '.syntax unified' is a gcc-ism used in thumb-2 asm files */
|
||||
#define _ASM_FILE_PROLOGUE .text; .syntax unified; .thumb
|
||||
#else
|
||||
#define _ASM_FILE_PROLOGUE .text; .code 32
|
||||
#endif
|
||||
#endif
|
||||
#endif /* CONFIG_ASSEMBLER_ISA_THUMB2 */
|
||||
#endif /* CONFIG_ARM && !CONFIG_ARM64 */
|
||||
#endif /* _ASMLANGUAGE */
|
||||
|
||||
/*
|
||||
* These macros generate absolute symbols for GCC
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue