2012-08-09 Roland McGrath <roland@hack.frob.com>
+ * sysdeps/arm/arm-features.h: Document ARM_ASSUME_NO_IWMMXT.
+ * sysdeps/arm/setjmp.S: Include <arm-features.h>.
+ [!ARM_ASSUME_NO_IWMMXT || __SOFTFP__]: Conditionalize hwcap
+ fetching bits on this.
+ [!ARM_ASSUME_NO_IWMMXT]: Conditionalize iWMMXt register use on this.
+ * sysdeps/arm/__longjmp.S: Likewise.
+
* sysdeps/arm/__longjmp.S: Use .Lxxx rather than Lxxx for local labels.
[__SOFTFP__]: Conditionalize HWCAP_ARM_VFP check on this.
* sysdeps/arm/setjmp.S: Likewise.
#define _ASM
#include <bits/setjmp.h>
#include <rtld-global-offsets.h>
+#include <arm-features.h>
/* __longjmp(jmpbuf, val) */
cfi_restore (sp)
cfi_restore (lr)
-#ifdef IS_IN_rtld
+#if !defined ARM_ASSUME_NO_IWMMXT || defined __SOFTFP__
+# define NEED_HWCAP 1
+#endif
+
+#ifdef NEED_HWCAP
+# ifdef IS_IN_rtld
ldr a2, 1f
ldr a3, .Lrtld_local_ro
0: add a2, pc, a2
add a2, a2, a3
ldr a2, [a2, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET]
-#else
-#ifdef PIC
+# else
+# ifdef PIC
ldr a2, 1f
ldr a3, .Lrtld_global_ro
0: add a2, pc, a2
ldr a2, [a2, a3]
ldr a2, [a2, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET]
-#else
+# else
ldr a2, .Lhwcap
ldr a2, [a2, #0]
-#endif
+# endif
+# endif
#endif
#ifdef __SOFTFP__
mcr p10, 7, a3, cr1, cr0, 0
.Lno_vfp:
+#ifndef ARM_ASSUME_NO_IWMMXT
tst a2, #HWCAP_ARM_IWMMXT
beq .Lno_iwmmxt
ldcl p1, cr14, [r12], #8
ldcl p1, cr15, [r12], #8
.Lno_iwmmxt:
+#endif
DO_RET(lr)
-#ifdef IS_IN_rtld
+#ifdef NEED_HWCAP
+# ifdef IS_IN_rtld
1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8
.Lrtld_local_ro:
.long C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF)
-#else
-#ifdef PIC
+# else
+# ifdef PIC
1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8
.Lrtld_global_ro:
.long C_SYMBOL_NAME(_rtld_global_ro)(GOT)
-#else
+# else
.Lhwcap:
.long C_SYMBOL_NAME(_dl_hwcap)
-#endif
+# endif
+# endif
#endif
END (__longjmp)
# define ARM_HAVE_VFP 1
#endif
+/* An OS-specific arm-features.h file may define ARM_ASSUME_NO_IWMMXT
+ to indicate at compile time that iWMMXt hardware is never present
+ at runtime (or that we never care about its state) and so need not
+ be checked for. */
+
#endif /* arm-features.h */
#define _ASM
#include <bits/setjmp.h>
#include <rtld-global-offsets.h>
+#include <arm-features.h>
ENTRY (__sigsetjmp)
mov ip, r0
/* Save registers */
stmia ip!, {v1-v6, sl, fp, sp, lr}
+#if !defined ARM_ASSUME_NO_IWMMXT || defined __SOFTFP__
+# define NEED_HWCAP 1
+#endif
+
+#ifdef NEED_HWCAP
/* Check if we have a VFP unit. */
-#ifdef IS_IN_rtld
+# ifdef IS_IN_rtld
ldr a3, 1f
ldr a4, .Lrtld_local_ro
0: add a3, pc, a3
add a3, a3, a4
ldr a3, [a3, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET]
-#else
-#ifdef PIC
+# else
+# ifdef PIC
ldr a3, 1f
ldr a4, .Lrtld_global_ro
0: add a3, pc, a3
ldr a3, [a3, a4]
ldr a3, [a3, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET]
-#else
+# else
ldr a3, .Lhwcap
ldr a3, [a3, #0]
-#endif
+# endif
+# endif
#endif
#ifdef __SOFTFP__
str a4, [ip], #4
.Lno_vfp:
+#ifndef ARM_ASSUME_NO_IWMMXT
tst a3, #HWCAP_ARM_IWMMXT
beq .Lno_iwmmxt
stcl p1, cr14, [r12], #8
stcl p1, cr15, [r12], #8
.Lno_iwmmxt:
+#endif
/* Make a tail call to __sigjmp_save; it takes the same args. */
B PLTJMP(C_SYMBOL_NAME(__sigjmp_save))
-#ifdef IS_IN_rtld
+#ifdef NEED_HWCAP
+# ifdef IS_IN_rtld
1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8
.Lrtld_local_ro:
.long C_SYMBOL_NAME(_rtld_local_ro)(GOTOFF)
-#else
-#ifdef PIC
+# else
+# ifdef PIC
1: .long _GLOBAL_OFFSET_TABLE_ - 0b - 8
.Lrtld_global_ro:
.long C_SYMBOL_NAME(_rtld_global_ro)(GOT)
-#else
+# else
.Lhwcap:
.long C_SYMBOL_NAME(_dl_hwcap)
-#endif
+# endif
+# endif
#endif
END (__sigsetjmp)