arm: Enable thumb2 mode in assembly files
authorRichard Henderson <rth@twiddle.net>
Thu, 14 Feb 2013 18:32:04 +0000 (10:32 -0800)
committerRichard Henderson <rth@twiddle.net>
Wed, 6 Mar 2013 15:46:44 +0000 (07:46 -0800)
The preceeding patches have allowed for the few incompatibilities
between arm and thumb2 mode, or have marked the file as not wanting
to use thumb2 mode.

ports/ChangeLog.arm
ports/sysdeps/arm/sysdep.h

index 3ad5704..6458a75 100644 (file)
@@ -1,5 +1,8 @@
 2013-03-06  Richard Henderson <rth@redhat.com>
 
+       * sysdeps/arm/sysdep.h [__ASSEMBLER__]: Enable thumb2 if __thumb2__.
+       (PC_OFS): Respect __thumb__ if __ASSEMBLER__.
+
        * sysdeps/arm/sysdep.h (GET_TLS): New macro.
        * sysdeps/arm/dl-tlsdesc.S (_dl_tlsdesc_undefweak): Use it.
        (_dl_tlsdesc_dynamic): Likewise.
index c525d5b..d855ceb 100644 (file)
    the caller.  */
        .eabi_attribute 24, 1
 
+/* The thumb2 encoding is reasonably complete.  Unless suppressed, use it.  */
+       .syntax unified
+# if defined(__thumb2__) && !defined(NO_THUMB)
+       .thumb
+#else
+#  undef __thumb__
+#  undef __thumb2__
+       .arm
+# endif
+
 /* Load or store to/from a pc-relative EXPR into/from R, using T.  */
 # ifdef __thumb2__
 #  define LDST_PCREL(OP, R, T, EXPR) \
 #endif /* __ASSEMBLER__ */
 
 /* This number is the offset from the pc at the current location.  */
-/* ??? At the moment we're not turning on thumb mode in assembly.  */
-#if defined(__thumb__) && !defined(__ASSEMBLER__)
+#ifdef __thumb__
 # define PC_OFS  4
 #else
 # define PC_OFS  8