In the testsuite, distinguish between arm targets that prefer LDRD/STRD and
arm targets that prefer LDM/STM. This patch adds a new effective target test
and updates documentation accordingly.
Ok for trunk?
Thanks,
Greta
ChangeLog
gcc/testsuite/
2012-09-13 Greta Yorsh <greta.yo...@arm.com>
* gcc.target/arm/target-supports.exp
(check_effective_target_arm_prefer_ldrd_strd): New procedure.
gcc/
2012-09-13 Greta Yorsh <greta.yo...@arm.com>
* doc/sourcebuild.texi: Document new effective target keyword
arm_prefer_ldrd_strd.
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 055567b..b80ee02 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -1552,6 +1552,11 @@ ARM target generates Thumb-2 code for @code{-mthumb}.
@item arm_vfp_ok
ARM target supports @code{-mfpu=vfp -mfloat-abi=softfp}.
Some multilibs may be incompatible with these options.
+
+@item arm_prefer_ldrd_strd
+ARM target prefers @code{LDRD} and @code{STRD} instructions over
+@code{LDM} and @code{STM} instructions.
+
@end table
@subsubsection MIPS-specific attributes
diff --git a/gcc/testsuite/lib/target-supports.exp
b/gcc/testsuite/lib/target-supports.exp
index 8f793b7..4bf2424 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2462,6 +2462,18 @@ proc check_effective_target_arm_iwmmxt_ok { } {
}
}
+# Return true if LDRD/STRD instructions are prefered over LDM/STM instructions
+# for an ARM target.
+proc check_effective_target_arm_prefer_ldrd_strd { } {
+ if { ![check_effective_target_arm32] } {
+ return 0;
+ }
+
+ return [check_no_messages_and_pattern arm_prefer_ldrd_strd "strd\tr"
assembly {
+ void foo (int *p) { p[0] = 1; p[1] = 0;}
+ } "-O2 -mthumb" ]
+}
+
# Return 1 if this is a PowerPC target with floating-point registers.
proc check_effective_target_powerpc_fprs { } {