ARM: pxa: fix building with clang
Subsystems (3)
PATCH 1/1 ARM: pxa: fix building with clang
From: Arnd Bergmann <[email protected]>
The integrated assembler in clang does not understand the xscale specific mra/mar instructions:
arch/arm/mach-pxa/pxa27x.c:136:15: error: unsupported architectural extension: xscale
asm volatile(".arch_extension xscale\n\t"arch/arm/mach-pxa/pxa27x.c:136:40: error: invalid instruction, did you mean: mcr, mla, mrc, mrs, msr?
mra r2, r3, acc0
Since these are coprocessor features, the same can be expressed using mrrc/mcrr, so use that for builds with IAS.
--- arch/arm/mach-pxa/pxa27x.c | 8 ++++++++ arch/arm/mach-pxa/pxa3xx.c | 16 +++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-)
arch/arm/mach-pxa/pxa27x.c +8 -0
@@ -133,8 +133,12 @@ void pxa27x_cpu_pm_enter(suspend_state_t state)#ifndef CONFIG_IWMMXT u64 acc0; +#ifndef CONFIG_AS_IS_LLVM asmvolatile (".arch_extension xscale\n\t" "mra %Q0, %R0, acc0" :"=r" (acc0)); +#else + asmvolatile ("mrrc p0, 0, %Q0, %R0, c0" :"=r" (acc0)); +#endif #endif /* ensure voltage-change sequencer not initiated, which hangs */
@@ -153,8 +157,12 @@ void pxa27x_cpu_pm_enter(suspend_state_t state)case PM_SUSPEND_MEM :cpu_suspend (pwrmode, pxa27x_finish_suspend);#ifndef CONFIG_IWMMXT +#ifndef CONFIG_AS_IS_LLVM asmvolatile (".arch_extension xscale\n\t" "mar acc0, %Q0, %R0" :"=r" (acc0)); +#else + asmvolatile ("mcrr p0, 0, %Q0, %R0, c0" ::"r" (acc0)); +#endif #endif break ; }
arch/arm/mach-pxa/pxa3xx.c +9 -7
@@ -108,11 +108,12 @@ static void pxa3xx_cpu_pm_suspend(void)#ifndef CONFIG_IWMMXT u64 acc0; - asmvolatile (#ifdef CONFIG_CC_IS_GCC - ".arch_extension xscale\n\t" -#endif + asmvolatile (".arch_extension xscale\n\t" "mra %Q0, %R0, acc0" :"=r" (acc0)); +#else + asmvolatile ("mrrc p0, 0, %Q0, %R0, c0" :"=r" (acc0)); +#endif #endif /* resuming from D2 requires the HSIO2/BOOT/TPM clocks enabled */
@@ -140,11 +141,12 @@ static void pxa3xx_cpu_pm_suspend(void)AD3ER =0 ;#ifndef CONFIG_IWMMXT - asmvolatile ( -#ifdef CONFIG_CC_IS_GCC - ".arch_extension xscale\n\t" -#endif +#ifndef CONFIG_AS_IS_LLVM + asmvolatile (".arch_extension xscale\n\t" "mar acc0, %Q0, %R0" :"=r" (acc0)); +#else + asmvolatile ("mcrr p0, 0, %Q0, %R0, c0" ::"r" (acc0)); +#endif #endif }
Signature · 1 line
2.35.1
Robert Jarzmik
maintainerQuoted 5 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The integrated assembler in clang does not understand the xscale specific mra/mar instructions:
Quoted 7 lines
arch/arm/mach-pxa/pxa27x.c:136:15: error: unsupported architectural extension: xscale
asm volatile(".arch_extension xscale\n\t"arch/arm/mach-pxa/pxa27x.c:136:40: error: invalid instruction, did you mean: mcr, mla, mrc, mrs, msr?mra r2, r3, acc0Since these are coprocessor features, the same can be expressed using mrrc/mcrr, so use that for builds with IAS.
Ok Arnd, but "mrrc" is an ARMv6 instruction if I'm not mistaken. Yet PXA27X is an ARMv5 XScale instruction set IP.
Is that patch correct therefore, or is it just to make clang happy even if it's not correct ?
Cheers.
--
Robert
Quoted 14 lines · Robert Jarzmik
Quoted 12 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The integrated assembler in clang does not understand the xscale specific mra/mar instructions:
arch/arm/mach-pxa/pxa27x.c:136:15: error: unsupported architectural extension: xscale
asm volatile(".arch_extension xscale\n\t"arch/arm/mach-pxa/pxa27x.c:136:40: error: invalid instruction, did you mean: mcr, mla, mrc, mrs, msr?mra r2, r3, acc0
Quoted 8 lines
Quoted 3 lines
Since these are coprocessor features, the same can be expressed using
mrrc/mcrr, so use that for builds with IAS.Ok Arnd, but "mrrc" is an ARMv6 instruction if I'm not mistaken. Yet PXA27X is an ARMv5 XScale instruction set IP.
Is that patch correct therefore, or is it just to make clang happy even if it's not correct ?
According to
"MRRC is available in ARMv6 and above, and E variants of ARMv5 excluding xP variants". I'm not entire sure what "xP variants" means, but we do build for ARMv5E, so I think this is actually correct.
Arnd
Quoted 4 lines · Arnd Bergmann
"MRRC is available in ARMv6 and above, and E variants of ARMv5 excluding xP variants". I'm not entire sure what "xP variants" means, but we do build for ARMv5E, so I think this is actually correct.
Ah yes, and XScale is ARMv5TE.
Cheers.
--
Robert