This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
[PATCH 05/26] arm: Introduce thumb helpers s and pc_ofs
- From: Richard Henderson <rth at twiddle dot net>
- To: libc-ports at sourceware dot org
- Cc: Joseph Myers <joseph at codesourcery dot com>
- Date: Tue, 26 Feb 2013 19:16:05 -0800
- Subject: [PATCH 05/26] arm: Introduce thumb helpers s and pc_ofs
- References: <1361934986-17018-1-git-send-email-rth@twiddle.net>
---
* sysdeps/arm/sysdep.h (s, pc_ofs): New macros.
---
ports/sysdeps/arm/sysdep.h | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/ports/sysdeps/arm/sysdep.h b/ports/sysdeps/arm/sysdep.h
index 0e6f645..4a9f05a 100644
--- a/ports/sysdeps/arm/sysdep.h
+++ b/ports/sysdeps/arm/sysdep.h
@@ -114,4 +114,19 @@
the caller. */
.eabi_attribute 24, 1
+/* We occasionally want to use the S form simply to achieve a smaller
+ instruction form in Thumb mode. Never set the flags in ARM mode. */
+#ifdef __thumb__
+# define s(insn) insn##s
+#else
+# define s(insn) insn
+#endif
+
+/* This number is the offset from the pc at the current location. */
+#ifdef __thumb__
+# define pc_ofs 4
+#else
+# define pc_ofs 8
+#endif
+
#endif /* __ASSEMBLER__ */
--
1.8.1.2