@@ -2275,6 +2275,7 @@ TOOLCHAIN_FEATURES="
symver_gnu_asm
vfp_args
xform_asm
+ mmx_clobbers
xmm_clobbers
"
@@ -5907,6 +5908,9 @@ EOF
check_inline_asm ebx_available '""::"b"(0)' &&
check_inline_asm ebx_available '"":::"%ebx"'
+ # check whether mmx clobbers are supported
+ check_inline_asm mmx_clobbers '"":::"%mm0"'
+
# check whether xmm clobbers are supported
check_inline_asm xmm_clobbers '"":::"%xmm0"'
@@ -79,6 +79,26 @@ typedef int x86_reg;
# define BROKEN_RELOCATIONS 1
#endif
+/*
+ * If gcc is not set to support mmx (-mmmx) it will not accept mmx registers
+ * in the clobber list for inline asm. MMX_CLOBBERS takes a list of mmx
+ * registers to be marked as clobbered and evaluates to nothing if they are
+ * not supported, or to the list itself if they are supported. Since a clobber
+ * list may not be empty, XMM_CLOBBERS_ONLY should be used if the mmx
+ * registers are the only in the clobber list.
+ * For example a list with "eax" and "mm0" as clobbers should become:
+ * : MMX_CLOBBERS("mm0",) "eax"
+ * and a list with only "mm0" should become:
+ * MMX_CLOBBERS_ONLY("mm0")
+ */
+#if HAVE_MMX_CLOBBERS
+# define MMX_CLOBBERS(...) __VA_ARGS__
+# define MMX_CLOBBERS_ONLY(...) : __VA_ARGS__
+#else
+# define MMX_CLOBBERS(...)
+# define MMX_CLOBBERS_ONLY(...)
+#endif
+
/*
* If gcc is not set to support sse (-msse) it will not accept xmm registers
* in the clobber list for inline asm. XMM_CLOBBERS takes a list of xmm