@@ -345,6 +345,12 @@
#endif
+/* Define if the assembler supports 'rep bsf' and 'rep bsr'. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_AS_IX86_REP_BSFBSR
+#endif
+
+
/* Define if the assembler supports 'rep <insn>, lock <insn>'. */
#ifndef USED_FOR_TARGET
#undef HAVE_AS_IX86_REP_LOCK_PREFIX
@@ -1,6 +1,6 @@
/* Definitions of target machine for GCC for IA-32.
Copyright (C) 1988, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
This file is part of GCC.
@@ -2030,6 +2030,12 @@ do { \
asm (SECTION_OP "\n\t" \
"call " CRT_MKSTR(__USER_LABEL_PREFIX__) #FUNC "\n" \
TEXT_SECTION_ASM_OP);
+
+#ifdef HAVE_AS_IX86_REP_BSFBSR
+#define REP_BEFORE_BSF "rep "
+#else
+#define REP_BEFORE_BSF "rep; "
+#endif
/* Which processor to tune code generation for. */
@@ -12235,7 +12235,7 @@
;
else if (TARGET_GENERIC)
/* tzcnt expands to rep;bsf and we can use it even if !TARGET_BMI. */
- return "rep; bsf{<imodesuffix>}\t{%1, %0|%0, %1}";
+ return REP_BEFORE_BSF "bsf{<imodesuffix>}\t{%1, %0|%0, %1}";
return "bsf{<imodesuffix>}\t{%1, %0|%0, %1}";
}
@@ -24815,6 +24815,38 @@ $as_echo "#define HAVE_AS_IX86_REP_LOCK_PREFIX 1" >>confdefs.h
fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for rep prefix on bsf/bsr" >&5
+$as_echo_n "checking assembler for rep prefix on bsf/bsr... " >&6; }
+if test "${gcc_cv_as_ix86_rep_bsf+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ gcc_cv_as_ix86_rep_bsf=no
+ if test x$gcc_cv_as != x; then
+ $as_echo 'rep bsf %ecx, %eax
+ rep bsr %ecx, %eax' > conftest.s
+ if { ac_try='$gcc_cv_as $gcc_cv_as_flags -o conftest.o conftest.s >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }
+ then
+ gcc_cv_as_ix86_rep_bsf=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_ix86_rep_bsf" >&5
+$as_echo "$gcc_cv_as_ix86_rep_bsf" >&6; }
+if test $gcc_cv_as_ix86_rep_bsf = yes; then
+
+$as_echo "#define HAVE_AS_IX86_REP_BSFBSR 1" >>confdefs.h
+
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for R_386_TLS_GD_PLT reloc" >&5
$as_echo_n "checking assembler for R_386_TLS_GD_PLT reloc... " >&6; }
if test "${gcc_cv_as_ix86_tlsgdplt+set}" = set; then :
@@ -28698,4 +28730,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
-
@@ -3646,6 +3646,13 @@ foo: nop
[AC_DEFINE(HAVE_AS_IX86_REP_LOCK_PREFIX, 1,
[Define if the assembler supports 'rep <insn>, lock <insn>'.])])
+ gcc_GAS_CHECK_FEATURE([rep prefix on bsf/bsr],
+ gcc_cv_as_ix86_rep_bsf,,,
+ [rep bsf %ecx, %eax
+ rep bsr %ecx, %eax],,
+ [AC_DEFINE(HAVE_AS_IX86_REP_BSFBSR, 1,
+ [Define if the assembler supports 'rep bsf' and 'rep bsr'.])])
+
gcc_GAS_CHECK_FEATURE([R_386_TLS_GD_PLT reloc],
gcc_cv_as_ix86_tlsgdplt,,,
[call tls_gd@tlsgdplt],