Re: [PATCH] PR target/52137 - bdver2 scheduler needs to be added to bdver1 insn reservations

2012-02-21 Thread Quentin Neill
On Tue, Feb 21, 2012 at 2:46 AM, Jakub Jelinek ja...@redhat.com wrote:
 On Tue, Feb 21, 2012 at 08:49:13AM +0100, Uros Bizjak wrote:
  2012-02-20  Quentin Neill  quentin.ne...@amd.com
 
      PR target/52137
      * gcc/config/i386/bdver1.md (bdver1_call, bdver1_push,

 Please leave out gcc/ prefix from the ChangeLog entry though.

        Jakub

Hi,

Committed with update to ChangeLog entry.  Thanks for your
consideration for this patch.
-- 
Quentin


Re: PATCH: Add capability to contrib/compare_tests to handle directories

2012-02-16 Thread Quentin Neill
On Thu, Feb 16, 2012 at 8:18 AM, Quentin Neill
quentin.neill@gmail.com wrote:
 On Tue, Feb 14, 2012 at 9:01 PM, Mike Stump mikest...@comcast.net wrote:
 On Feb 14, 2012, at 8:39 AM, Quentin Neill wrote:
 Thanks for the fix.  This seemed familiar, and upon review it looks
 like I never committed this fix:
 http://gcc.gnu.org/ml/gcc-patches/2011-11/msg01194.html

 Ah, ok, let's go with your version, it is much better.  Thanks.

 Committed.
 --
 Quentin

While working on this, I realized errors detected in directories with
more than one sum file don't show the sum file with the problem
(instead they show the sum1/sum2 files).  Patch below iterates over
sum files instead of concatenating.  Okay to commit?

(output before the patch)

$ compare_tests -strict /d/qneill/tst.w[io].zeroshift.*
# Comparing directories
## Dir1=/d/qneill/tst.wi.zeroshift.192188f71c30: 2 sum files
## Dir2=/d/qneill/tst.wo.zeroshift.bdcd46972d7d: 2 sum files

# Comparing 2 common sum files
## /bin/sh /d/paqa/gcc/compare_tests -strict /tmp/gxx-sum1.4434
/tmp/gxx-sum2.4434
Old tests that passed, that have disappeared: (Eeek!)

gcc.target/x86_64/abi/callabi/vaarg-5b.c (test for excess errors)
Strict test fails


(output after the patch)
$ ./compare_tests -strict /d/qneill/tst.w[io].zeroshift.*
# Comparing directories
## Dir1=/d/qneill/tst.wi.zeroshift.192188f71c30: 2 sum files
## Dir2=/d/qneill/tst.wo.zeroshift.bdcd46972d7d: 2 sum files

# Comparing 2 common sum files
## /bin/sh ./compare_tests -strict
/d/qneill/tst.wi.zeroshift.192188f71c30/bld/gcc/testsuite/gcc/gcc.sum
/d/qneill/tst.wo.zeroshift.bdcd46972d7d/bld/gcc/testsuite/gcc/gcc.sum
Old tests that passed, that have disappeared: (Eeek!)

gcc.target/x86_64/abi/callabi/vaarg-5b.c (test for excess errors)
Strict test fails

## Differences found: bld/gcc/testsuite/gcc/gcc.sum
## /bin/sh ./compare_tests -strict
/d/qneill/tst.wi.zeroshift.192188f71c30/bld/gcc/testsuite/gcc/g++.sum
/d/qneill/tst.wo.zeroshift.bdcd46972d7d/bld/gcc/testsuite/gcc/g++.sum
# 1 differences in 2 common sum files found



diff --git a/contrib/compare_tests b/contrib/compare_tests
index 2fc6e05..611faab 100755
--- a/contrib/compare_tests
+++ b/contrib/compare_tests
@@ -43,9 +43,7 @@ lst2=/tmp/$tool-lst2.$$
 lst3=/tmp/$tool-lst3.$$
 lst4=/tmp/$tool-lst4.$$
 lst5=/tmp/$tool-lst5.$$
-sum1=/tmp/$tool-sum1.$$
-sum2=/tmp/$tool-sum2.$$
-tmps=$tmp1 $tmp2 $now_s $before_s $lst1 $lst2 $lst3 $lst4 $lst5 $sum1 $sum2
+tmps=$tmp1 $tmp2 $now_s $before_s $lst1 $lst2 $lst3 $lst4 $lst5

 [ $1 = -strict ]  strict=$1  shift
 [ $1 = -? ]  usage
@@ -86,15 +84,16 @@ if [ -d $1 -a -d $2 ] ; then
fi
cmnsums=`cat $lst5 | wc -l`
echo # Comparing $cmnsums common sum files
-   ( for fname in `cat $lst5`; do cat $1/$fname; done ) $sum1
-   ( for fname in `cat $lst5`; do cat $2/$fname; done ) $sum2
-   echo ## ${CONFIG_SHELL-/bin/sh} $0 $strict $sum1 $sum2
-   ${CONFIG_SHELL-/bin/sh} $0 $strict $sum1 $sum2
-   ret=$?
-   if [ $ret -ne 0 ]; then
-   exit_status=`expr $exit_status + 1`
-   echo ## Differences found: $fname
-   fi
+   for fname in `cat $lst5`
+   do
+   echo ## ${CONFIG_SHELL-/bin/sh} $0 $strict $1/$fname $2/$fname
+   ${CONFIG_SHELL-/bin/sh} $0 $strict $1/$fname $2/$fname
+   ret=$?
+   if [ $ret -ne 0 ]; then
+   exit_status=`expr $exit_status + 1`
+   echo ## Differences found: $fname
+   fi
+   done
if [ $exit_status -ne 0 ]; then
echo # $exit_status differences in $cmnsums common
sum files found
else




-- 
Quentin


Re: PATCH: Add capability to contrib/compare_tests to handle directories

2012-02-14 Thread Quentin Neill
On Sat, Feb 11, 2012 at 8:13 AM, Mike Stump mikest...@comcast.net wrote:
 On Nov 4, 2011, at 8:23 PM, Quentin Neill wrote:
 My scenario about ANY test results changed is what I added with -strict.
 This patch concatenates the common .sum files before comparing.

 So, how exactly does this work for you:

 +       ( for fname in `cat $lst5`; do cat $1/$fname; done ) $sum1
 +       ( for fname in `cat $lst5`; do cat $2/$fname; done ) $sum2
 +       echo ## ${CONFIG_SHELL-/bin/sh} $0 $strict $sum1 $sum2
 +       ${CONFIG_SHELL-/bin/sh} $0 $strict $sum1 $sum2

 sum1 and sum2 appear to be variables that aren't set.

Hi Mike,

Thanks for the fix.  This seemed familiar, and upon review it looks
like I never committed this fix:
http://gcc.gnu.org/ml/gcc-patches/2011-11/msg01194.html


Do you prefer this patch with my original intent (declaring sum1/sum2
with other tmps and removing the trap on line 52):

--- a/contrib/compare_tests
+++ b/contrib/compare_tests
@@ -43,7 +43,9 @@ lst2=/tmp/$tool-lst2.$$
 lst3=/tmp/$tool-lst3.$$
 lst4=/tmp/$tool-lst4.$$
 lst5=/tmp/$tool-lst5.$$
-tmps=$tmp1 $tmp2 $now_s $before_s $lst1 $lst2 $lst3 $lst4 $lst5
+sum1=/tmp/$tool-sum1.$$
+sum2=/tmp/$tool-sum2.$$
+tmps=$tmp1 $tmp2 $now_s $before_s $lst1 $lst2 $lst3 $lst4 $lst5 $sum1 $sum2


 [ $1 = -strict ]  strict=$1  shift
 [ $1 = -? ]  usage
@@ -60,8 +62,8 @@ if [ -d $1 -a -d $2 ] ; then
echo ## Dir2=$2: `cat $lst2 | wc -l` sum files
echo
# remove leading directory components to compare
-   sed -e s|^$1/|| $lst1 | sort $lst3
-   sed -e s|^$2/|| $lst2 | sort $lst4
+   sed -e s|^$1[/]*|| $lst1 | sort $lst3
+   sed -e s|^$2[/]*|| $lst2 | sort $lst4
comm -23 $lst3 $lst4 $lst5
if [ -s $lst5 ] ; then
echo # Extra sum files in Dir1=$1
@@ -83,14 +85,11 @@ if [ -d $1 -a -d $2 ] ; then
exit $exit_status
fi
cmnsums=`cat $lst5 | wc -l`
-   sum1=/tmp/$tool-sum-1
-   sum2=/tmp/$tool-sum-2
echo # Comparing $cmnsums common sum files
( for fname in `cat $lst5`; do cat $1/$fname; done ) $sum1
( for fname in `cat $lst5`; do cat $2/$fname; done ) $sum2
echo ## ${CONFIG_SHELL-/bin/sh} $0 $strict $sum1 $sum2
${CONFIG_SHELL-/bin/sh} $0 $strict $sum1 $sum2
-   rm -f $sum1 $sum2
ret=$?
if [ $ret -ne 0 ]; then
exit_status=`expr $exit_status + 1`



Or would you prefer this minimal fix (to remove trailing directory slashes)?

@@ -60,8 +60,8 @@ if [ -d $1 -a -d $2 ] ; then
echo ## Dir2=$2: `cat $lst2 | wc -l` sum files
echo
# remove leading directory components to compare
-   sed -e s|^$1/|| $lst1 | sort $lst3
-   sed -e s|^$2/|| $lst2 | sort $lst4
+   sed -e s|^$1[/]*|| $lst1 | sort $lst3
+   sed -e s|^$2[/]*|| $lst2 | sort $lst4
comm -23 $lst3 $lst4 $lst5
if [ -s $lst5 ] ; then
echo # Extra sum files in Dir1=$1


And if so, okay to commit?
-- 
Quentin


Re: [PATCH] enable fma4 for bdver2

2012-02-06 Thread Quentin Neill
On Mon, Feb 6, 2012 at 9:32 AM, Quentin Neill
quentin.neill@gmail.com wrote:
 On Tue, Nov 8, 2011 at 3:53 PM, Richard Henderson r...@redhat.com wrote:

 On 11/07/2011 07:28 PM, Quentin Neill wrote:
  +       Add FMA4 to bdver2.
  +       * config/i386/i386.c (ix86_option_override_internal): Add FMA4
  to bdver2.

 Ok.


 r~

 This patch was okay'd in stage 3 but was never committed.

 Okay to commit to trunk today?

Actually, it will need to wait for 4.8, nevermind.
-- 
Quentin


Re: adjust installation docs to discourage installing GMP, MPFR and MPC separately

2012-01-27 Thread Quentin Neill
On Fri, Jan 20, 2012 at 6:10 PM, Jonathan Wakely jwakely@gmail.com wrote:
 On 20 January 2012 23:08, Quentin Neill  wrote:

 My 2c - I heartily recommend this patch.

 Thanks. I'm a bit surprised noone else has commented - I hoped this
 would be a no-brainer, or at least get some constructive feedback for
 further improvement.

Another +1 for this patch.  Who can approve?

Seems like this would be okay for stage4 too.

 May I suggest updating
 /cvs/gcc/wwwdocs/htdocs/install/prerequisites.html
 That's exactly the page I'm trying to change, it's generated from the
 texi file my patch changes.

Didn't know that, makes sense.

 And perhaps add a page to the twiki
 http://gcc.gnu.org/wiki/BuildingGCC to catch google searches for
 building gcc?

 I recently added http://gcc.gnu.org/wiki/InstallingGCC
 I chose installing not building because I believe that of the
 people who fail to build GCC and look for support, most of them
 probably should have installed a pre-built package supplied by their
 OS or another third-party packager. Maybe it could be changed to
 attract more search hits.

Yes I saw your InstallingGCC and I like it.  I was thinking a
BuildingGCC would catch searches and could direct to InstallingGCC.
Does MoinMoin have a way to attach keyword data to a page?  Consider
where InstallingGCC appears in these different results from google:

? https://www.google.com/search?q=installing+gcc -surprised me
? http://www.google.com/search?q=building+gcc
? http://www.google.com/search?q=building+gcc+wiki
#2 http://www.google.com/search?q=installing+gcc+wiki
#4 http://www.google.com/search?q=building+installing+gcc

Another suggestion would be to link from one or both of these:
http://gcc.gnu.org/install/index.html
http://gcc.gnu.org/install/build.html
-- 
Quentin


Re: adjust installation docs to discourage installing GMP, MPFR and MPC separately

2012-01-20 Thread Quentin Neill
On Thu, Jan 5, 2012 at 6:17 PM, Jonathan Wakely jwakely@gmail.com wrote:
 Ping.

 I think this is a useful improvement to the docs and could prevent the
 most commonly-encountered bootstrap failure for inexpert users
 building GCC.

 OK for trunk?


 On 30 December 2011 13:29, Jonathan Wakely wrote:
 On 22 December 2011 00:23, Jonathan Wakely wrote:
 The most frequently asked question on gcc-help, and a frequently
 reported bug in bugzilla, is
 http://gcc.gnu.org/wiki/FAQ#configure_suffix

 It is almost always caused by installing libgmp.so etc. in a
 non-standard location and not using ldconfig, DT_RUNPATH,
 $LD_LIBRARY_PATH or some other method to tell the dynamic linker how
 to find them.  The current installation docs mention --with-gmp right
 away, which probably gives the impression that it's the recommended
 method, whereas it actually causes problems for the majority of users
 who don't understand dynamic linker search paths.  I think rewording
 the installation docs to suggest building the support libs as part of
 GCC first, and only using --with-gmp second, might steer people in the
 right direction.

 Separately, I also plan to write an Installing GCC page on the GCC
 wiki which (among other things) discourages installing the support
 libraries by hand, recommending installing prebuilt packages in
 standard system dirs instead, or if that's not an option then using
 contrib/download_prerequisites to get the sources and build them
 in-tree.


        * doc/install.text (Prerequisites): Suggest building GMP, MPFR and
        MPC as part of GCC before describing configuring with --with-gmp etc.

 Tested by running make doc and viewing the resulting .info pages, OK
 for trunk?

 Here's an updated patch which also adjusts the --with-gmp docs in the
 Configuration chapter to mention the option of putting the support lib
 sources under the GCC sources

       * doc/install.texi (Prerequisites): Suggest building GMP, MPFR and
       MPC as part of GCC before describing configuring with --with-gmp etc.
       (Installing GCC: Configuration): State that --with-gmp etc. aren't
       needed if sources are present.

 OK for trunk?

My 2c - I heartily recommend this patch.

May I suggest updating
/cvs/gcc/wwwdocs/htdocs/install/prerequisites.html (or wherever it
lives) with the same wording, since it is a frequent landing page for
people hunting for GCC building/installing information?

And perhaps add a page to the twiki
http://gcc.gnu.org/wiki/BuildingGCC to catch google searches for
building gcc?

-- 
Quentin


Re: [PR48743] cpuid family6 fix for Athlon: okay for trunk?

2011-12-19 Thread Quentin Neill
On Mon, Dec 12, 2011 at 3:00 PM, Uros Bizjak ubiz...@gmail.com wrote:
 Hello!

 I'm testing the patch in
 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48743#c4 against trunk


 --cut here--
 --- gcc-4.7-20110521/gcc/config/i386/driver-i386.c.~1~  2011-01-06
 23:59:46.0 +0100
 +++ gcc-4.7-20110521/gcc/config/i386/driver-i386.c.~1~  2011-05-22
 16:05:41.0 +0200
 @@ -506,7 +506,7 @@ const char *host_detect_local_cpu (int a
        processor = PROCESSOR_AMDFAM10;
       else if (has_sse2 || has_longmode)
        processor = PROCESSOR_K8;
 -      else if (has_3dnowp)
 +      else if (has_3dnowp  family == 6)
        processor = PROCESSOR_ATHLON;
       else if (has_mmx)
        processor = PROCESSOR_K6;
 --cut here--

 The patch looks correct to me.

 Is this considered okay for stage3?

 Yes, since it fixes a bug.

 If so, okay to commit after bootstrap testing on x86_64?

 OK, with a correct ChangeLog.

 Uros.

Fixed in r182489, updated http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48743#c7

I got the correct gcc/ChangeLog ... but looks like I committed with
two date/author lines in the svn log.  G.

I guess if someone has svnadmin permissions on gcc.gnu.org it could be fixed.
-- 
Quentin


[PR48743] cpuid family6 fix for Athlon: okay for trunk?

2011-12-12 Thread Quentin Neill
Hi,

I'm testing the patch in
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48743#c4 against trunk

Is this considered okay for stage3?

If so, okay to commit after bootstrap testing on x86_64?
-- 
Quentin


Re: [PR48743] cpuid family6 fix for Athlon: okay for trunk?

2011-12-12 Thread Quentin Neill
On Mon, Dec 12, 2011 at 3:00 PM, Uros Bizjak ubiz...@gmail.com wrote:
 Hello!

 I'm testing the patch in
 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48743#c4 against trunk


 --cut here--
 --- gcc-4.7-20110521/gcc/config/i386/driver-i386.c.~1~  2011-01-06
 23:59:46.0 +0100
 +++ gcc-4.7-20110521/gcc/config/i386/driver-i386.c.~1~  2011-05-22
 16:05:41.0 +0200
 @@ -506,7 +506,7 @@ const char *host_detect_local_cpu (int a
        processor = PROCESSOR_AMDFAM10;
       else if (has_sse2 || has_longmode)
        processor = PROCESSOR_K8;
 -      else if (has_3dnowp)
 +      else if (has_3dnowp  family == 6)
        processor = PROCESSOR_ATHLON;
       else if (has_mmx)
        processor = PROCESSOR_K6;
 --cut here--

 The patch looks correct to me.

 Is this considered okay for stage3?

 Yes, since it fixes a bug.

 If so, okay to commit after bootstrap testing on x86_64?

 OK, with a correct ChangeLog.

 Uros.

Thanks.

Okay for backport to 4.6 and 4.5 too, after bootstrap tests?
-- 
Quentin


Re: PATCH: Add capability to contrib/compare_tests to handle directories

2011-11-08 Thread Quentin Neill
On Sat, Nov 5, 2011 at 4:26 PM, Mike Stump mikest...@comcast.net wrote:
 On Nov 4, 2011, at 8:23 PM, Quentin Neill wrote:
 This patch concatenates the common .sum files before comparing.

 Okay to commit?

 Ok, thanks for the contribution.


FYI I see my patch was missing these two fixes:
1. fix missing sum1 and sum2 temp variables
2. handle trailing slashes in dir args

Okay to commit?  Should I commit such a patch as trivial?
-- 
Quentin


Index: compare_tests
===
--- compare_tests   (revision 181166)
+++ compare_tests   (working copy)
@@ -43,7 +43,9 @@ lst2=/tmp/$tool-lst2.$$
 lst3=/tmp/$tool-lst3.$$
 lst4=/tmp/$tool-lst4.$$
 lst5=/tmp/$tool-lst5.$$
-tmps=$tmp1 $tmp2 $now_s $before_s $lst1 $lst2 $lst3 $lst4 $lst5
+sum1=/tmp/$tool-sum1.$$
+sum2=/tmp/$tool-sum2.$$
+tmps=$tmp1 $tmp2 $now_s $before_s $lst1 $lst2 $lst3 $lst4 $lst5 $sum1 $sum2

 [ $1 = -strict ]  strict=$1  shift
 [ $1 = -? ]  usage
@@ -60,8 +62,8 @@ if [ -d $1 -a -d $2 ] ; then
echo ## Dir2=$2: `cat $lst2 | wc -l` sum files
echo
# remove leading directory components to compare
-   sed -e s|^$1/|| $lst1 | sort $lst3
-   sed -e s|^$2/|| $lst2 | sort $lst4
+   sed -e s|^$1[/]*|| $lst1 | sort $lst3
+   sed -e s|^$2[/]*|| $lst2 | sort $lst4
comm -23 $lst3 $lst4 $lst5
if [ -s $lst5 ] ; then
echo # Extra sum files in Dir1=$1


Re: Many testsuite failures on x86_64 due recent fix about f16cintrin.h header

2011-11-07 Thread Quentin Neill
On Mon, Nov 7, 2011 at 4:25 AM, Uros Bizjak ubiz...@gmail.com wrote:
 Hello!

 Attached patch fixes all remaining i386 testsuite failures. The header
 did say that we can include it also through immintrin.h ...

 2011-11-07  Uros Bizjak  ubiz...@gmail.com

        * config/i386/f16cintrin: Remove extra _X86INTRIN_H_INCLUDED check.

 Tested on x86_64-pc-linux-gnu {,-m32}, committed to mainline SVN.

 Uros.

Thank you Dominique, Uros, Kai, and Eric.
-- 
Quentin


[PATCH] enable fma4 for bdver2

2011-11-07 Thread Quentin Neill
Hi,

This patch turns on FMA4 for the AMD BDVER2 processor.

Okay for trunk if no regressions?
-- 
Quentin


Index: ChangeLog
===
--- ChangeLog   (revision 181147)
+++ ChangeLog   (working copy)
@@ -1,3 +1,8 @@
+2011-11-07  Quentin Neill  quentin.ne...@amd.com
+
+   Add FMA4 to bdver2.
+   * config/i386/i386.c (ix86_option_override_internal): Add FMA4
to bdver2.
+
 2011-11-07  Richard Henderson  r...@redhat.com

* optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set,
Index: config/i386/i386.c
===
--- config/i386/i386.c  (revision 181147)
+++ config/i386/i386.c  (working copy)
@@ -3044,7 +3044,7 @@ ix86_option_override_internal (bool main
   {bdver2, PROCESSOR_BDVER2, CPU_BDVER2,
PTA_64BIT | PTA_MMX | PTA_SSE | PTA_SSE2 | PTA_SSE3
| PTA_SSE4A | PTA_CX16 | PTA_ABM | PTA_SSSE3 | PTA_SSE4_1
-   | PTA_SSE4_2 | PTA_AES | PTA_PCLMUL | PTA_AVX
+   | PTA_SSE4_2 | PTA_AES | PTA_PCLMUL | PTA_AVX | PTA_FMA4
| PTA_XOP | PTA_LWP | PTA_BMI | PTA_TBM | PTA_F16C
| PTA_FMA},
   {btver1, PROCESSOR_BTVER1, CPU_GENERIC64,


Re: Many testsuite failures on x86_64 due recent fix about f16cintrin.h header

2011-11-06 Thread Quentin Neill
On Sun, Nov 6, 2011 at 2:13 PM, Dominique Dhumieres domi...@lps.ens.fr wrote:
 Following http://gcc.gnu.org/ml/gcc-patches/2011-10/msg02901.html, I have 
 applied
 the following patch on x86_64-apple-darwin10

 --- ../_clean/gcc/config.gcc    2011-11-05 22:25:37.0 +0100
 +++ gcc/config.gcc      2011-11-06 12:35:57.0 +0100
 @@ -350,7 +350,7 @@ i[34567]86-*-*)
                       immintrin.h x86intrin.h avxintrin.h xopintrin.h
                       ia32intrin.h cross-stdarg.h lwpintrin.h popcntintrin.h
                       lzcntintrin.h bmiintrin.h bmi2intrin.h tbmintrin.h
 -                      avx2intrin.h fmaintrin.h
 +                      avx2intrin.h fmaintrin.h f16cintrin.h
        ;;
  x86_64-*-*)
        cpu_type=i386
 @@ -363,7 +363,7 @@ x86_64-*-*)
                       immintrin.h x86intrin.h avxintrin.h xopintrin.h
                       ia32intrin.h cross-stdarg.h lwpintrin.h popcntintrin.h
                       lzcntintrin.h bmiintrin.h tbmintrin.h bmi2intrin.h
 -                      avx2intrin.h fmaintrin.h
 +                      avx2intrin.h fmaintrin.h f16cintrin.h
        need_64bit_hwint=yes
        ;;
  ia64-*-*)
 --- ../_clean/gcc/config/i386/f16cintrin.h      2011-11-05 10:03:10.0 
 +0100
 +++ gcc/config/i386/f16cintrin.h        2011-11-06 16:55:05.0 +0100
 @@ -88,7 +88,8 @@ _mm256_cvtps_ph (__m256 __A, const int _

  #define _mm256_cvtps_ph(A, I) \
   ((__m128i) __builtin_ia32_vcvtps2ph256 ((__v8sf)(__m256) A, (int) (I)))
 -#endif
 +#endif /* __OPTIMIZE__ */
 +#endif /* _F16CINTRIN_H_INCLUDED */

  #endif /* __F16C__ */
  #endif

 (the second part fixes a missing endif). However I still have most of the 
 failures:

 FAIL: gcc.target/i386/sse-14.c
 Excess errors:
 /opt/gcc/work/gcc/testsuite/gcc.target/i386/sse-14.c:95:1: error: implicit 
 declaration of function '_cvtss_sh' [-Werror=implicit-function-declaration]
 /opt/gcc/work/gcc/testsuite/gcc.target/i386/sse-14.c:96:1: error: implicit 
 declaration of function '_mm_cvtps_ph' [-Werror=implicit-function-declaration]
 /opt/gcc/work/gcc/testsuite/gcc.target/i386/sse-14.c:96:1: error: 
 incompatible types when returning type 'int' but '__m128i' was expected
 /opt/gcc/work/gcc/testsuite/gcc.target/i386/sse-14.c:97:1: error: implicit 
 declaration of function '_mm256_cvtps_ph' 
 [-Werror=implicit-function-declaration]
 /opt/gcc/work/gcc/testsuite/gcc.target/i386/sse-14.c:97:1: error: 
 incompatible types when returning type 'int' but '__m128i' was expected
 ...
 FAIL: gcc.target/i386/testimm-1.c (test for excess errors)
 Excess errors:
 /opt/gcc/work/gcc/testsuite/gcc.target/i386/testimm-1.c:36:6: error: 
 incompatible types when assigning to type '__m128i' from type 'int'
 /opt/gcc/work/gcc/testsuite/gcc.target/i386/testimm-1.c:45:6: error: 
 incompatible types when assigning to type '__m128i' from type 'int'

 At this point I have no idea about how to fix those.

 Cheers,

 Dominique

Thanks for the testing.
I committed the changes to add f16cintrin.h to config.gcc and added
the missing endif.
I'm not sure why my testing did not see the missing endif or the failures above.
My first guess would be that the missing endif was causing ifndef
guards to not work across other intrinsics headers, causing some
builtins not to be defined.
My test machine is down right now, but I will post a patch if I can
figure things out tonight.
-- 
Quentin


Re: PATCH: Add capability to contrib/compare_tests to handle directories

2011-11-04 Thread Quentin Neill
On Wed, Nov 2, 2011 at 12:32 PM, Quentin Neill
quentin.neill@gmail.com wrote:
 On Tue, Oct 4, 2011 at 4:57 PM, Mike Stump mikest...@comcast.net wrote:
 On Oct 4, 2011, at 2:37 PM, Quentin Neill wrote:
 Ping?

 The problem with this patch is it reorders the listing so that lower 
 priority things are after higher priority things.  The entire point of the 
 routine is to list the high priority things first, so that a casual user can 
 read the first line or two and not immediately if there is something they 
 care about.

 Now, this property can be preserved simply by concatenating all the .sum 
 files found in a directory into an all.sum file, and then running the script 
 on those two files.  If one does that, then the priority order is preserved.

 Hi Mike,
 Thanks for the feedback.  From the comments, I assumed the usage was
 to compare two .log files not .sum files.
 Maybe it is a new scenario I'm imagining - comparing two builds to see
 if ANY test results changed, regardless of order.
 In any case, I will work on your changes when I get time (after stage1 
 probably)
 --
 Quentin

I got to this anyway.
My scenario about ANY test results changed is what I added with -strict.
This patch concatenates the common .sum files before comparing.

Okay to commit?
-- 
Quentin
From aaac4ffeedf4b3c9641d593de6526b4e872760d5 Mon Sep 17 00:00:00 2001
From: Quentin Neill quentin.ne...@amd.com
Date: Fri, 4 Nov 2011 22:13:07 -0500
Subject: [PATCH] 2011-11-04   Quentin Neill  quentin.ne...@amd.com

* compare_tests: Add ability to compare all .sum
files from two build directories.
---
 contrib/ChangeLog |5 ++
 contrib/compare_tests |  103 -
 2 files changed, 98 insertions(+), 10 deletions(-)

diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index eddf6ec..b0afb27 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-04   Quentin Neill  quentin.ne...@amd.com
+
+   * compare_tests: Add ability to compare all .sum
+   files from two build directories.
+
 2011-09-13   Diego Novillo  dnovi...@google.com
 
* testsuite-management: New.
diff --git a/contrib/compare_tests b/contrib/compare_tests
index bed9742..a23fcf6 100755
--- a/contrib/compare_tests
+++ b/contrib/compare_tests
@@ -2,13 +2,35 @@
 # This script automatically test the given tool with the tool's test cases,
 # reporting anything of interest.
 
-# exits with 0 if there is nothing of interest
-# exits with 1 if there is something interesting
-# exits with 2 if an error occurred
-
-# Give two .sum files to compare them
+usage()
+{
+   if [ -n $1 ] ; then
+   echo $0: Error: $1 2
+   echo 2
+   fi
+   cat 2 EOUSAGE
+Usage: $0 [-strict] PREVIOUS CURRENT
+
+Compare the PREVIOUS and CURRENT test case .sum files, reporting anything of 
interest.
+
+   If PREVIOUS and CURRENT are directories, find and compare any *.sum 
files.
+
+   Unless -strict is given, these discrepancies are not counted as errors:
+   missing/extra .sum files when comparing directories
+   tests that failed in PREVIOUS but pass in CURRENT
+   tests that were not in PREVIOUS but appear in CURRENT
+   tests in PREVIOUS that are missing in CURRENT
+
+   Exit with the following values:
+   0 if there is nothing of interest
+   1 if there are errors when comparing single test case files
+   N for the number of errors found when comparing directories
+EOUSAGE
+   exit 2
+}
 
 # Written by Mike Stump m...@cygnus.com
+# Subdir comparison added by Quentin Neill quentin.ne...@amd.com
 
 tool=gxx
 
@@ -16,10 +38,69 @@ tmp1=/tmp/$tool-testing.$$a
 tmp2=/tmp/$tool-testing.$$b
 now_s=/tmp/$tool-testing.$$d
 before_s=/tmp/$tool-testing.$$e
+lst1=/tmp/$tool-lst1.$$
+lst2=/tmp/$tool-lst2.$$
+lst3=/tmp/$tool-lst3.$$
+lst4=/tmp/$tool-lst4.$$
+lst5=/tmp/$tool-lst5.$$
+tmps=$tmp1 $tmp2 $now_s $before_s $lst1 $lst2 $lst3 $lst4 $lst5
+
+[ $1 = -strict ]  strict=$1  shift
+[ $1 = -? ]  usage
+[ $2 =  ]  usage Must specify both PREVIOUS and CURRENT
+
+trap rm -f $tmps 0 1 2 3 5 9 13 15
+exit_status=0
 
-if [ $2 =  ]; then
-   echo Usage: $0 previous current 2
-   exit 2
+if [ -d $1 -a -d $2 ] ; then
+   find $1 -name '*.sum' $lst1
+   find $2 -name '*.sum' $lst2
+   echo # Comparing directories
+   echo ## Dir1=$1: `cat $lst1 | wc -l` sum files
+   echo ## Dir2=$2: `cat $lst2 | wc -l` sum files
+   echo
+   # remove leading directory components to compare
+   sed -e s|^$1/|| $lst1 | sort $lst3
+   sed -e s|^$2/|| $lst2 | sort $lst4
+   comm -23 $lst3 $lst4 $lst5
+   if [ -s $lst5 ] ; then
+   echo # Extra sum files in Dir1=$1
+   sed -e s|^| $1/| $lst5
+   echo
+   [ -n $strict ]  exit_status=`expr $exit_status + 1`
+   fi
+   comm -13 $lst3 $lst4 $lst5

PATCH: Move f16c intrinsics into f16cintrin.h

2011-10-31 Thread Quentin Neill
Hi,

This patch moves f16c intrinsics out of immintrin.h into their own
header f16cintrin.h

Interested parties should view these threads from three years ago:
http://gcc.gnu.org/ml/gcc-patches/2008-11/threads.html#00145
http://gcc.gnu.org/ml/gcc-patches/2008-12/threads.html#00174

Testing on x86_64, okay to commit if no regressions?
-- 
Quentin Neill
-- 

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index caed12e..5af1c78 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2011-10-31  Quentin Neill  quentin.ne...@amd.com
+
+   Piledriver f16cintrin.h fix.
+   * config/i386/f16cintrin.h: Contents moved from immintrin.h.
+
 2011-10-31  Richard Henderson  r...@redhat.com

* config/i386/sse.md (floatv8siv8sf2): Rename from avx_cvtdq2ps256.
diff --git a/gcc/config/i386/f16cintrin.h b/gcc/config/i386/f16cintrin.h
new file mode 100644
index 000..5ff836b
--- /dev/null
+++ b/gcc/config/i386/f16cintrin.h
@@ -0,0 +1,94 @@
+/* Copyright (C) 2011
+   Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   GCC is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   http://www.gnu.org/licenses/.  */
+
+#ifndef _X86INTRIN_H_INCLUDED
+#if (!defined(_X86INTRIN_H_INCLUDED)  !defined(_IMMINTRIN_H_INCLUDED))
+# error Never use f16intrin.h directly; include x86intrin.h or
immintrin.h instead.
+#endif
+
+#ifndef __F16C__
+# error F16C instruction set not enabled
+#else
+
+#ifndef _F16CINTRIN_H_INCLUDED
+#define _F16CINTRIN_H_INCLUDED
+
+extern __inline float __attribute__((__gnu_inline__,
__always_inline__, __artificial__))
+_cvtsh_ss (unsigned short __S)
+{
+  __v8hi __H = __extension__ (__v8hi){ __S, 0, 0, 0, 0, 0, 0, 0 };
+  __v4sf __A = __builtin_ia32_vcvtph2ps (__H);
+  return __builtin_ia32_vec_ext_v4sf (__A, 0);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__,
__always_inline__, __artificial__))
+_mm_cvtph_ps (__m128i __A)
+{
+  return (__m128) __builtin_ia32_vcvtph2ps ((__v8hi) __A);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__,
__always_inline__, __artificial__))
+_mm256_cvtph_ps (__m128i __A)
+{
+  return (__m256) __builtin_ia32_vcvtph2ps256 ((__v8hi) __A);
+}
+
+#ifdef __OPTIMIZE__
+extern __inline unsigned short __attribute__((__gnu_inline__,
__always_inline__, __artificial__))
+_cvtss_sh (float __F, const int __I)
+{
+  __v4sf __A =  __extension__ (__v4sf){ __F, 0, 0, 0 };
+  __v8hi __H = __builtin_ia32_vcvtps2ph (__A, __I);
+  return (unsigned short) __builtin_ia32_vec_ext_v8hi (__H, 0);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__,
__always_inline__, __artificial__))
+_mm_cvtps_ph (__m128 __A, const int __I)
+{
+  return (__m128i) __builtin_ia32_vcvtps2ph ((__v4sf) __A, __I);
+}
+
+extern __inline __m128i __attribute__((__gnu_inline__,
__always_inline__, __artificial__))
+_mm256_cvtps_ph (__m256 __A, const int __I)
+{
+  return (__m128i) __builtin_ia32_vcvtps2ph256 ((__v8sf) __A, __I);
+}
+#else
+#define _cvtss_sh(__F, __I)\
+  (__extension__   \
+   ({  \
+  __v4sf __A =  __extension__ (__v4sf){ __F, 0, 0, 0 };\
+  __v8hi __H = __builtin_ia32_vcvtps2ph (__A, __I);
\
+  (unsigned short) __builtin_ia32_vec_ext_v8hi (__H, 0);   \
+}))
+
+#define _mm_cvtps_ph(A, I) \
+  ((__m128i) __builtin_ia32_vcvtps2ph ((__v4sf)(__m128) A, (int) (I)))
+
+#define _mm256_cvtps_ph(A, I) \
+  ((__m128i) __builtin_ia32_vcvtps2ph256 ((__v8sf)(__m256) A, (int) (I)))
+#endif
+
+#endif /* __F16C__ */
+#endif
diff --git a/gcc/config/i386/immintrin.h b/gcc/config/i386/immintrin.h
index 102814e..986a573 100644
--- a/gcc/config/i386/immintrin.h
+++ b/gcc/config/i386/immintrin.h
@@ -76,6 +76,10 @@
 #include fmaintrin.h
 #endif

+#ifdef __F16C__
+#include f16cintrin.h
+#endif
+
 #ifdef __RDRND__
 extern __inline int
 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
@@ -161,63 +165,4 @@ _rdrand64_step (unsigned long long *__P)
 #endif /* __RDRND__ */
 #endif /* __x86_64__  */

-#ifdef __F16C__
-extern __inline

Re: PATCH: Move f16c intrinsics into f16cintrin.h

2011-10-31 Thread Quentin Neill
On Mon, Oct 31, 2011 at 5:31 PM, Jakub Jelinek ja...@redhat.com wrote:
 On Mon, Oct 31, 2011 at 05:23:58PM -0500, Quentin Neill wrote:
 Interested parties should view these threads from three years ago:
 http://gcc.gnu.org/ml/gcc-patches/2008-11/threads.html#00145
 http://gcc.gnu.org/ml/gcc-patches/2008-12/threads.html#00174

 Testing on x86_64, okay to commit if no regressions?

 You aren't installing the header, so it will cause regressions.
 config.gcc needs to be adjusted for it.

Arggh.  Thanks, my tests found that too.

Reposting, okay to commit after testing on x86_64 if no regressions?
--
Quentin Neill
From c0379bf7dacbe457813893cdaf381ae7206566c7 Mon Sep 17 00:00:00 2001
From: Quentin Neill quentin.ne...@amd.com
Date: Mon, 31 Oct 2011 16:54:18 -0500
Subject: [PATCH] 2011-10-31  Quentin Neill  quentin.ne...@amd.com

Piledriver f16cintrin.h fix.
* config/i386/f16cintrin.h: Contents moved from immintrin.h.
* config/config.gcc: Add f16cintrin.h.
---
 gcc/ChangeLog|6 +++
 gcc/config.gcc   |4 +-
 gcc/config/i386/f16cintrin.h |   94 ++
 gcc/config/i386/immintrin.h  |   63 ++--
 4 files changed, 106 insertions(+), 61 deletions(-)
 create mode 100644 gcc/config/i386/f16cintrin.h

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index caed12e..14a4392 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2011-10-31  Quentin Neill  quentin.ne...@amd.com
+
+   Piledriver f16cintrin.h fix.
+   * config/i386/f16cintrin.h: Contents moved from immintrin.h.
+   * config/config.gcc: Add f16cintrin.h.
+
 2011-10-31  Richard Henderson  r...@redhat.com
 
* config/i386/sse.md (floatv8siv8sf2): Rename from avx_cvtdq2ps256.
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 2c18655..2b60e77 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -361,7 +361,7 @@ i[34567]86-*-*)
   immintrin.h x86intrin.h avxintrin.h xopintrin.h
   ia32intrin.h cross-stdarg.h lwpintrin.h popcntintrin.h
   lzcntintrin.h bmiintrin.h bmi2intrin.h tbmintrin.h
-  avx2intrin.h fmaintrin.h
+  avx2intrin.h fmaintrin.h f16cintrin.h
;;
 x86_64-*-*)
cpu_type=i386
@@ -374,7 +374,7 @@ x86_64-*-*)
   immintrin.h x86intrin.h avxintrin.h xopintrin.h
   ia32intrin.h cross-stdarg.h lwpintrin.h popcntintrin.h
   lzcntintrin.h bmiintrin.h tbmintrin.h bmi2intrin.h
-  avx2intrin.h fmaintrin.h
+  avx2intrin.h fmaintrin.h f16cintrin.h
need_64bit_hwint=yes
;;
 ia64-*-*)
diff --git a/gcc/config/i386/f16cintrin.h b/gcc/config/i386/f16cintrin.h
new file mode 100644
index 000..5ff836b
--- /dev/null
+++ b/gcc/config/i386/f16cintrin.h
@@ -0,0 +1,94 @@
+/* Copyright (C) 2011
+   Free Software Foundation, Inc.
+
+   This file is part of GCC.
+
+   GCC is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   GCC is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   Under Section 7 of GPL version 3, you are granted additional
+   permissions described in the GCC Runtime Library Exception, version
+   3.1, as published by the Free Software Foundation.
+
+   You should have received a copy of the GNU General Public License and
+   a copy of the GCC Runtime Library Exception along with this program;
+   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+   http://www.gnu.org/licenses/.  */
+
+#ifndef _X86INTRIN_H_INCLUDED
+#if (!defined(_X86INTRIN_H_INCLUDED)  !defined(_IMMINTRIN_H_INCLUDED))
+# error Never use f16intrin.h directly; include x86intrin.h or 
immintrin.h instead.
+#endif
+
+#ifndef __F16C__
+# error F16C instruction set not enabled
+#else
+
+#ifndef _F16CINTRIN_H_INCLUDED
+#define _F16CINTRIN_H_INCLUDED
+
+extern __inline float __attribute__((__gnu_inline__, __always_inline__, 
__artificial__))
+_cvtsh_ss (unsigned short __S)
+{
+  __v8hi __H = __extension__ (__v8hi){ __S, 0, 0, 0, 0, 0, 0, 0 };
+  __v4sf __A = __builtin_ia32_vcvtph2ps (__H);
+  return __builtin_ia32_vec_ext_v4sf (__A, 0);
+}
+
+extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, 
__artificial__))
+_mm_cvtph_ps (__m128i __A)
+{
+  return (__m128) __builtin_ia32_vcvtph2ps ((__v8hi) __A);
+}
+
+extern __inline __m256 __attribute__((__gnu_inline__, __always_inline__, 
__artificial__))
+_mm256_cvtph_ps (__m128i __A)
+{
+  return (__m256) __builtin_ia32_vcvtph2ps256 ((__v8hi) __A);
+}
+
+#ifdef __OPTIMIZE__
+extern __inline unsigned

Re: PATCH: Add capability to contrib/compare_tests to handle directories

2011-10-04 Thread Quentin Neill
Ping?

On Wed, Sep 7, 2011 at 12:21 PM, Quentin Neill
quentin.neill@gmail.com wrote:
 Hi,

 Should not change behavior for comparing two files (expect for usage
 output), and also should be POSIX compliant.

 Tested on x86_64 tests logs and test directories, would be interested
 in help testing on other platforms.

 Ok to commit?
 --
 Quentin Neill


 From 4d4fa9d094745ace0b6e51faadb2f3ea40cb7c7f Mon Sep 17 00:00:00 2001
 From: Quentin Neill quentin.ne...@amd.com
 Date: Wed, 7 Sep 2011 12:04:35 -0500
 Subject: [PATCH] Add capability to compare test log directories.

 ---
  contrib/ChangeLog     |    4 ++
  contrib/compare_tests |  107 
 -
  2 files changed, 101 insertions(+), 10 deletions(-)

 diff --git a/contrib/ChangeLog b/contrib/ChangeLog
 index 07adb58..e2007e7 100644
 --- a/contrib/ChangeLog
 +++ b/contrib/ChangeLog
 @@ -1,3 +1,7 @@
 +2011-09-07  Quentin Neill  quentin.ne...@amd.com
 +
 +       * compare_tests: Add capability to compare test log directories.
 +
  2011-08-25  Rainer Orth  r...@cebitec.uni-bielefeld.de

        * gcc_update: Determine svn branch from hg convert_revision.
 diff --git a/contrib/compare_tests b/contrib/compare_tests
 index bed9742..b0e3321 100755
 --- a/contrib/compare_tests
 +++ b/contrib/compare_tests
 @@ -2,13 +2,36 @@
  # This script automatically test the given tool with the tool's test cases,
  # reporting anything of interest.

 -# exits with 0 if there is nothing of interest
 -# exits with 1 if there is something interesting
 -# exits with 2 if an error occurred
 -
 -# Give two .sum files to compare them
 +usage()
 +{
 +       if [ -n $1 ] ; then
 +               echo $0: Error: $1 2
 +               echo 2
 +       fi
 +       cat 2 EOUSAGE
 +Usage: $0 [-strict] PREVIOUS CURRENT
 +
 +       Compare the PREVIOUS and CURRENT test case logs, reporting anything
 of interest.
 +
 +       If PREVIOUS and CURRENT are directories, find and compare any *.log 
 files
 +       therein (except config.log files).
 +
 +       Unless -strict is given, these discrepancies are not counted as 
 errors:
 +               missing/extra log files when comparing directories
 +               tests that failed in PREVIOUS but pass in CURRENT
 +               tests that were not in PREVIOUS but appear in CURRENT
 +               tests in PREVIOUS that are missing in CURRENT
 +
 +       Exit with the following values:
 +               0 if there is nothing of interest
 +               1 if there are errors when comparing single test case files
 +               N for the number of errors found when comparing directories
 +EOUSAGE
 +       exit 2
 +}

  # Written by Mike Stump m...@cygnus.com
 +# Subdir comparison added by Quentin Neill quentin.ne...@amd.com

  tool=gxx

 @@ -16,10 +39,72 @@ tmp1=/tmp/$tool-testing.$$a
  tmp2=/tmp/$tool-testing.$$b
  now_s=/tmp/$tool-testing.$$d
  before_s=/tmp/$tool-testing.$$e
 +lst1=/tmp/$tool-lst1.$$
 +lst2=/tmp/$tool-lst2.$$
 +lst3=/tmp/$tool-lst3.$$
 +lst4=/tmp/$tool-lst4.$$
 +lst5=/tmp/$tool-lst5.$$
 +tmps=$tmp1 $tmp2 $now_s $before_s $lst1 $lst2 $lst3 $lst4 $lst5
 +
 +[ $1 = -strict ]  strict=$1  shift
 +[ $1 = -? ]  usage
 +[ $2 =  ]  usage Must specify both PREVIOUS and CURRENT
 +
 +trap rm -f $tmps 0 1 2 3 5 9 13 15
 +exit_status=0

 -if [ $2 =  ]; then
 -       echo Usage: $0 previous current 2
 -       exit 2
 +if [ -d $1 -a -d $2 ] ; then
 +       find $1 \( ! -name config.log \) -name '*.log' $lst1
 +       find $2 \( ! -name config.log \) -name '*.log' $lst2
 +       echo # Comparing directories
 +       echo ## Dir1=$1: `cat $lst1 | wc -l` log files
 +       echo ## Dir2=$2: `cat $lst2 | wc -l` log files
 +       echo
 +       # remove leading directory components to compare
 +       sed -e s|^$1/|| $lst1 | sort $lst3
 +       sed -e s|^$2/|| $lst2 | sort $lst4
 +       comm -23 $lst3 $lst4 $lst5
 +       if [ -s $lst5 ] ; then
 +               echo # Extra log files in Dir1=$1
 +               sed -e s|^| $1/| $lst5
 +               echo
 +               [ -n $strict ]  exit_status=`expr $exit_status + 1`
 +       fi
 +       comm -13 $lst3 $lst4 $lst5
 +       if [ -s $lst5 ] ; then
 +               echo # Extra log files in Dir2=$2
 +               sed -e s|^| $2/| $lst5
 +               echo
 +               [ -n $strict ]  exit_status=`expr $exit_status + 1`
 +       fi
 +       comm -12 $lst3 $lst4 | sort -u $lst5
 +       if [ ! -s $lst5 ] ; then
 +               echo # No common log files
 +               exit_status=`expr $exit_status + 1`
 +               exit $exit_status
 +       fi
 +       cmnlogs=`cat $lst5 | wc -l`
 +       echo # Comparing $cmnlogs common log files
 +       for fname in `cat $lst5`
 +       do
 +               f1=$1/$fname
 +               f2=$2/$fname
 +               echo ## ${CONFIG_SHELL-/bin/sh} $0 $strict $f1 $f2
 +               ${CONFIG_SHELL-/bin/sh} $0 $strict $f1 $f2
 +               ret=$?
 +               if [ $ret -ne 0

PATCH: Add capability to contrib/compare_tests to handle directories

2011-09-07 Thread Quentin Neill
Hi,

Should not change behavior for comparing two files (expect for usage
output), and also should be POSIX compliant.

Tested on x86_64 tests logs and test directories, would be interested
in help testing on other platforms.

Ok to commit?
-- 
Quentin Neill


From 4d4fa9d094745ace0b6e51faadb2f3ea40cb7c7f Mon Sep 17 00:00:00 2001
From: Quentin Neill quentin.ne...@amd.com
Date: Wed, 7 Sep 2011 12:04:35 -0500
Subject: [PATCH] Add capability to compare test log directories.

---
 contrib/ChangeLog |4 ++
 contrib/compare_tests |  107 -
 2 files changed, 101 insertions(+), 10 deletions(-)

diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index 07adb58..e2007e7 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,7 @@
+2011-09-07  Quentin Neill  quentin.ne...@amd.com
+
+   * compare_tests: Add capability to compare test log directories.
+
 2011-08-25  Rainer Orth  r...@cebitec.uni-bielefeld.de

* gcc_update: Determine svn branch from hg convert_revision.
diff --git a/contrib/compare_tests b/contrib/compare_tests
index bed9742..b0e3321 100755
--- a/contrib/compare_tests
+++ b/contrib/compare_tests
@@ -2,13 +2,36 @@
 # This script automatically test the given tool with the tool's test cases,
 # reporting anything of interest.

-# exits with 0 if there is nothing of interest
-# exits with 1 if there is something interesting
-# exits with 2 if an error occurred
-
-# Give two .sum files to compare them
+usage()
+{
+   if [ -n $1 ] ; then
+   echo $0: Error: $1 2
+   echo 2
+   fi
+   cat 2 EOUSAGE
+Usage: $0 [-strict] PREVIOUS CURRENT
+
+   Compare the PREVIOUS and CURRENT test case logs, reporting anything
of interest.
+
+   If PREVIOUS and CURRENT are directories, find and compare any *.log 
files
+   therein (except config.log files).
+
+   Unless -strict is given, these discrepancies are not counted as errors:
+   missing/extra log files when comparing directories
+   tests that failed in PREVIOUS but pass in CURRENT
+   tests that were not in PREVIOUS but appear in CURRENT
+   tests in PREVIOUS that are missing in CURRENT
+
+   Exit with the following values:
+   0 if there is nothing of interest
+   1 if there are errors when comparing single test case files
+   N for the number of errors found when comparing directories
+EOUSAGE
+   exit 2
+}

 # Written by Mike Stump m...@cygnus.com
+# Subdir comparison added by Quentin Neill quentin.ne...@amd.com

 tool=gxx

@@ -16,10 +39,72 @@ tmp1=/tmp/$tool-testing.$$a
 tmp2=/tmp/$tool-testing.$$b
 now_s=/tmp/$tool-testing.$$d
 before_s=/tmp/$tool-testing.$$e
+lst1=/tmp/$tool-lst1.$$
+lst2=/tmp/$tool-lst2.$$
+lst3=/tmp/$tool-lst3.$$
+lst4=/tmp/$tool-lst4.$$
+lst5=/tmp/$tool-lst5.$$
+tmps=$tmp1 $tmp2 $now_s $before_s $lst1 $lst2 $lst3 $lst4 $lst5
+
+[ $1 = -strict ]  strict=$1  shift
+[ $1 = -? ]  usage
+[ $2 =  ]  usage Must specify both PREVIOUS and CURRENT
+
+trap rm -f $tmps 0 1 2 3 5 9 13 15
+exit_status=0

-if [ $2 =  ]; then
-   echo Usage: $0 previous current 2
-   exit 2
+if [ -d $1 -a -d $2 ] ; then
+   find $1 \( ! -name config.log \) -name '*.log' $lst1
+   find $2 \( ! -name config.log \) -name '*.log' $lst2
+   echo # Comparing directories
+   echo ## Dir1=$1: `cat $lst1 | wc -l` log files
+   echo ## Dir2=$2: `cat $lst2 | wc -l` log files
+   echo
+   # remove leading directory components to compare
+   sed -e s|^$1/|| $lst1 | sort $lst3
+   sed -e s|^$2/|| $lst2 | sort $lst4
+   comm -23 $lst3 $lst4 $lst5
+   if [ -s $lst5 ] ; then
+   echo # Extra log files in Dir1=$1
+   sed -e s|^| $1/| $lst5
+   echo
+   [ -n $strict ]  exit_status=`expr $exit_status + 1`
+   fi
+   comm -13 $lst3 $lst4 $lst5
+   if [ -s $lst5 ] ; then
+   echo # Extra log files in Dir2=$2
+   sed -e s|^| $2/| $lst5
+   echo
+   [ -n $strict ]  exit_status=`expr $exit_status + 1`
+   fi
+   comm -12 $lst3 $lst4 | sort -u $lst5
+   if [ ! -s $lst5 ] ; then
+   echo # No common log files
+   exit_status=`expr $exit_status + 1`
+   exit $exit_status
+   fi
+   cmnlogs=`cat $lst5 | wc -l`
+   echo # Comparing $cmnlogs common log files
+   for fname in `cat $lst5`
+   do
+   f1=$1/$fname
+   f2=$2/$fname
+   echo ## ${CONFIG_SHELL-/bin/sh} $0 $strict $f1 $f2
+   ${CONFIG_SHELL-/bin/sh} $0 $strict $f1 $f2
+   ret=$?
+   if [ $ret -ne 0 ]; then
+   exit_status=`expr $exit_status + 1`
+   echo ## Differences found: $fname
+   fi
+   done
+   if [ $exit_status -ne 0 ]; then
+   echo # $exit_status

[PATCH] fix vfmsubaddpd/vfmaddsubpd generation

2011-05-17 Thread Quentin Neill
This patch fixes an obvious problem: the fma4_fmsubadd/fma4_fmaddsub
instruction templates don't generate vfmsubaddpd/vfmaddsubpd because
they don't use ssemodesuffix

This passes bootstrap on x86_64 on trunk.  Okay to commit?

BTW, I'm testing on gcc-4_6-branch.  Should I post a different patch
thread, or just use this one?
-- 
Quentin
From aa70d4f6180f1c6712888b7328723232b5da8bdc Mon Sep 17 00:00:00 2001
From: Quentin Neill quentin.ne...@amd.com
Date: Tue, 17 May 2011 10:24:17 -0500
Subject: [PATCH] 2011-05-17  Harsha Jagasia  harsha.jaga...@amd.com

* config/i386/sse.md (fma4_fmsubadd): Use ssemodesuffix.
(fma4_fmaddsub): Likewise
---
 gcc/ChangeLog  |5 +
 gcc/config/i386/sse.md |4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3625d9b..e86ea4e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2011-05-17  Harsha Jagasia  harsha.jaga...@amd.com
+
+   * config/i386/sse.md (fma4_fmsubadd): Use ssemodesuffix.
+   (fma4_fmaddsub): Likewise
+
 2011-05-17  Richard Guenther  rguent...@suse.de
 
* gimple.c (iterative_hash_gimple_type): Simplify singleton
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 291bffb..7c4e6dd 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -1663,7 +1663,7 @@
   (match_operand:VF 3 nonimmediate_operand xm,x)]
  UNSPEC_FMADDSUB))]
   TARGET_FMA4
-  vfmaddsubps\t{%3, %2, %1, %0|%0, %1, %2, %3}
+  vfmaddsubpssemodesuffix\t{%3, %2, %1, %0|%0, %1, %2, %3}
   [(set_attr type ssemuladd)
(set_attr mode MODE)])
 
@@ -1676,7 +1676,7 @@
 (match_operand:VF 3 nonimmediate_operand xm,x))]
  UNSPEC_FMADDSUB))]
   TARGET_FMA4
-  vfmsubaddps\t{%3, %2, %1, %0|%0, %1, %2, %3}
+  vfmsubaddpssemodesuffix\t{%3, %2, %1, %0|%0, %1, %2, %3}
   [(set_attr type ssemuladd)
(set_attr mode MODE)])
 
-- 
1.7.1