Re: r201440 - in /branches/gcc-4_8-branch: gcc/Chan...

2014-04-14 Thread Andreas Krebbel
On Fri, Apr 11, 2014 at 09:53:58PM +0200, Harald van Dijk wrote:
> Hi,
> 
> This commit added LIBITM_CHECK_AS_HTM to libitm/configure.ac, but did
> not add it to acinclude.m4, so configure complains about an unrecognised
> command (4.8 only). I don't know if LIBITM_CHECK_AS_HTM is supposed to
> check anything that needs checking on 4.8, I just got confused by the
> message.

Hi,

when applying the backport the s390 case apparently went to the wrong
switch statement.  It became part of the RTM check for x86 instead of
the HTM check.

I've applied the attached patch to fix this.

Thanks for reporting it!

Bye,

-Andreas-

2014-04-14  Andreas Krebbel  

* acinclude.m4: Move s390* case from RTM to HTM check.
* configure: Regenerate.

Index: libitm/configure
===
--- libitm/configure(revision 209369)
+++ libitm/configure(working copy)
@@ -17368,22 +17368,23 @@
 
   fi
   ;;
-s390*)
+esac
+
+case "${target_cpu}" in
+powerpc*)
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the assembler supports 
HTM" >&5
 $as_echo_n "checking if the assembler supports HTM... " >&6; }
 if test "${libitm_cv_as_htm+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
 
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -march=zEC12"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
 main ()
 {
-asm("tbegin 0,0; tend");
+asm("tbegin. 0; tend. 0");
   ;
   return 0;
 }
@@ -17394,7 +17395,7 @@
   libitm_cv_as_htm=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-CFLAGS="$save_CFLAGS"
+
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libitm_cv_as_htm" >&5
 $as_echo "$libitm_cv_as_htm" >&6; }
@@ -17404,24 +17405,22 @@
 
   fi
   ;;
-esac
-LIBITM_CHECK_AS_HTM
-
-case "${target_cpu}" in
-powerpc*)
+s390*)
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the assembler supports 
HTM" >&5
 $as_echo_n "checking if the assembler supports HTM... " >&6; }
 if test "${libitm_cv_as_htm+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
 
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -march=zEC12"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
 main ()
 {
-asm("tbegin. 0; tend. 0");
+asm("tbegin 0,0; tend");
   ;
   return 0;
 }
@@ -17432,7 +17431,7 @@
   libitm_cv_as_htm=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
+CFLAGS="$save_CFLAGS"
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libitm_cv_as_htm" >&5
 $as_echo "$libitm_cv_as_htm" >&6; }
Index: libitm/acinclude.m4
===
--- libitm/acinclude.m4 (revision 209369)
+++ libitm/acinclude.m4 (working copy)
@@ -121,17 +121,6 @@
 AC_DEFINE(HAVE_AS_RTM, 1, [Define to 1 if the assembler supports RTM.])
   fi
   ;;
-s390*)
-  AC_CACHE_CHECK([if the assembler supports HTM], libitm_cv_as_htm, [
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -march=zEC12"
-AC_TRY_COMPILE([], [asm("tbegin 0,0; tend");],
-  [libitm_cv_as_htm=yes], [libitm_cv_as_htm=no])
-CFLAGS="$save_CFLAGS"])
-  if test x$libitm_cv_as_htm = xyes; then
-AC_DEFINE(HAVE_AS_HTM, 1, [Define to 1 if the assembler supports HTM.])
-  fi
-  ;;
 esac])
 
 dnl Check if as supports HTM instructions.
@@ -146,6 +135,17 @@
 AC_DEFINE(HAVE_AS_HTM, 1, [Define to 1 if the assembler supports HTM.])
   fi
   ;;
+s390*)
+  AC_CACHE_CHECK([if the assembler supports HTM], libitm_cv_as_htm, [
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -march=zEC12"
+AC_TRY_COMPILE([], [asm("tbegin 0,0; tend");],
+   [libitm_cv_as_htm=yes], [libitm_cv_as_htm=no])
+CFLAGS="$save_CFLAGS"])
+  if test x$libitm_cv_as_htm = xyes; then
+AC_DEFINE(HAVE_AS_HTM, 1, [Define to 1 if the assembler supports HTM.])
+  fi
+  ;;
 esac])
 
 sinclude(../libtool.m4)



Re: r201440 - in /branches/gcc-4_8-branch: gcc/Chan...

2014-04-11 Thread Harald van Dijk
Hi,

This commit added LIBITM_CHECK_AS_HTM to libitm/configure.ac, but did
not add it to acinclude.m4, so configure complains about an unrecognised
command (4.8 only). I don't know if LIBITM_CHECK_AS_HTM is supposed to
check anything that needs checking on 4.8, I just got confused by the
message.

Cheers,
Harald van Dijk

On 02/08/13 17:41, kreb...@gcc.gnu.org wrote:
> Author: krebbel
> Date: Fri Aug  2 15:41:10 2013
> New Revision: 201440
> 
> URL: http://gcc.gnu.org/viewcvs?rev=201440&root=gcc&view=rev
> Log:
> 2013-08-02  Andreas Krebbel  
> 
>   Backports from mainline:
>   2013-06-27  Andreas Krebbel  
> 
>   * config/s390/s390.c: Rename UNSPEC_CCU_TO_INT to
>   UNSPEC_STRCMPCC_TO_INT and UNSPEC_CCZ_TO_INT to UNSPEC_CC_TO_INT.
>   (struct machine_function): Add tbegin_p.
>   (s390_canonicalize_comparison): Fold CC mode compares to
>   conditional jump if possible.
>   (s390_emit_jump): Return the emitted jump.
>   (s390_branch_condition_mask, s390_branch_condition_mnemonic):
>   Handle CCRAWmode compares.
>   (s390_option_override): Default to -mhtm if available.
>   (s390_reg_clobbered_rtx): Handle floating point regs as well.
>   (s390_regs_ever_clobbered): Use s390_regs_ever_clobbered also for
>   FPRs instead of df_regs_ever_live_p.
>   (s390_optimize_nonescaping_tx): New function.
>   (s390_init_frame_layout): Extend clobbered_regs array to cover
>   FPRs as well.
>   (s390_emit_prologue): Call s390_optimize_nonescaping_tx.
>   (s390_expand_tbegin): New function.
>   (enum s390_builtin): New enum definition.
>   (code_for_builtin): New array definition.
>   (s390_init_builtins): New function.
>   (s390_expand_builtin): New function.
>   (TARGET_INIT_BUILTINS): Define.
>   (TARGET_EXPAND_BUILTIN): Define.
>   * common/config/s390/s390-common.c (processor_flags_table): Add
>   PF_TX.
>   * config/s390/predicates.md (s390_comparison): Handle CCRAWmode.
>   (s390_alc_comparison): Likewise.
>   * config/s390/s390-modes.def: Add CCRAWmode.
>   * config/s390/s390.h (processor_flags): Add PF_TX.
>   (TARGET_CPU_HTM): Define macro.
>   (TARGET_HTM): Define macro.
>   (TARGET_CPU_CPP_BUILTINS): Define __HTM__ for htm.
>   * config/s390/s390.md: Rename UNSPEC_CCU_TO_INT to
>   UNSPEC_STRCMPCC_TO_INT and UNSPEC_CCZ_TO_INT to UNSPEC_CC_TO_INT.
>   (UNSPECV_TBEGIN, UNSPECV_TBEGINC, UNSPECV_TEND, UNSPECV_TABORT)
>   (UNSPECV_ETND, UNSPECV_NTSTG, UNSPECV_PPA): New unspecv enum
>   values.
>   (TBEGIN_MASK, TBEGINC_MASK): New constants.
>   ("*cc_to_int"): Move up.
>   ("*movcc", "*cjump_64", "*cjump_31"): Accept integer
>   constants other than 0.
>   ("*ccraw_to_int"): New insn and splitter definition.
>   ("tbegin", "tbegin_nofloat", "tbegin_retry")
>   ("tbegin_retry_nofloat", "tbeginc", "tend", "tabort")
>   ("tx_assist"): New expander.
>   ("tbegin_1", "tbegin_nofloat_1", "*tbeginc_1", "*tend_1")
>   ("*tabort_1", "etnd", "ntstg", "*ppa"): New insn definition.
>   * config/s390/s390.opt: Add -mhtm option.
>   * config/s390/s390-protos.h (s390_emit_jump): Add return type.
>   * config/s390/htmxlintrin.h: New file.
>   * config/s390/htmintrin.h: New file.
>   * config/s390/s390intrin.h: New file.
>   * doc/extend.texi: Document htm builtins.
>   * config.gcc: Add the new header files to extra_headers.
> 
>   2013-07-17  Andreas Krebbel  
> 
>   * config/s390/s390.c: (s390_expand_builtin): Allow -mhtm to be
>   enabled without -march=zEC12.
>   * config/s390/s390.h (TARGET_HTM): Do not require EC12 machine
>   flags to be set.
> 
> 2013-08-02  Andreas Krebbel  
> 
>   Backports from mainline:
>   2013-04-23  Andreas Krebbel  
> 
>   * config/s390/sjlj.S: New file.
>   * config/s390/target.h: New file.
>   * configure.tgt: Set options for S/390.
> 
>   2013-06-27  Andreas Krebbel  
> 
>   * config/s390/target.h: Include htmintrin.h.
>   (_HTM_ITM_RETRIES): New macro definition.
>   (htm_available, htm_init, htm_begin, htm_begin_success)
>   (htm_commit, htm_abort, htm_abort_should_retry): New functions.
> 
>   2013-07-17  Andreas Krebbel  
> 
>   * acinclude.m4: Add htm asm check for s390.
>   * configure.tgt: Add -mhtm and -Wa,-march=zEC12 to the
>   options.
>   * configure: Regenerate.
>   * config/s390/target.h: Remove __HTM__ check.
>   (htm_available): Call getauxval to get hwcaps and check
>   whether HTM is available or not.
> 
>   2013-07-29  Andreas Krebbel  
> 
>   * config/s390/target.h (htm_begin, htm_commit, htm_abort)
>   (htm_transaction_active): Enable zEC12 instructions in the
>   assembler.
>   * configure.tgt: Remove -Wa,-march=zEC12 from XCFLAGS.
> 
>   2013-08-02  Andreas Krebbel  
> 
>   * configure.tgt: Add -msoft-float to XCFLAGS.
> 
> 2013-08-02  A