From patchwork Fri Mar 28 21:46:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 334895 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id BD3E51400A5 for ; Sat, 29 Mar 2014 08:46:51 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=iXsI5ww0c31EtNKFSqEsxSU80i25fpNfNve2DeKAlRQ7ZseCQN ZXpIr1qT9MVue8gZOq8K+cCpk58ye+9YhHZQsaBu4MeXG9GFKGv5KzN+Ke+1stqx ZuTTc7sH7DmDrngSMWBk1uxO8naXm7dZEtoRDkQGDfwzQ1ikZ123sWb8M= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=bcRjrHBSuTcQrwMKRnpxBLfSjEQ=; b=HQRp8G8KJO6Cg4W3mTho OSz9dz+eRyELXEMIyI6nQUx/gh6RFentVqA/PTjMURQOyLiGKuwW+cgzkRy1uflX vjk4nCcoMdCVYg4+ywcYFVcoaXai503GQxGHIJXF44R/6ob14Wg0iRXovHSKkPwG DiQItuBhUo/Kr4ah45/5T6E= Received: (qmail 15768 invoked by alias); 28 Mar 2014 21:46:44 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 15754 invoked by uid 89); 28 Mar 2014 21:46:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 28 Mar 2014 21:46:41 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1WTebj-0003IJ-Gq from joseph_myers@mentor.com ; Fri, 28 Mar 2014 14:46:35 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 28 Mar 2014 14:46:35 -0700 Received: from digraph.polyomino.org.uk (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Fri, 28 Mar 2014 21:46:33 +0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.76) (envelope-from ) id 1WTebg-0000wM-2T; Fri, 28 Mar 2014 21:46:32 +0000 Date: Fri, 28 Mar 2014 21:46:32 +0000 From: "Joseph S. Myers" To: CC: , , , , , Subject: Fix various x86 tests for --with-arch=bdver3 Message-ID: MIME-Version: 1.0 If you build an x86_64 toolchain with --with-arch enabling various instruction set extensions by default, this causes some tests to fail that aren't expecting those extensions to be enabled. This patch fixes various tests failing like that for an x86_64-linux-gnu toolchain configured --with-arch=bdver3, generally by using appropriate -mno-* options in the tests, or in the case of gcc.dg/pr45416.c by adjusting the scan-assembler to allow the alternative instruction that gets used in this case. It's quite likely other such failures appear for other --with-arch choices. Tested x86_64-linux-gnu. OK to commit? In addition to the failures fixed by this patch, there are many gcc.dg/vect tests where having additional vector extensions enabled breaks their expectations; I'm not sure of the best way to handle those. And you get FAIL: gcc.target/i386/avx512f-vfmaddXXXpd-2.c (test for excess errors) FAIL: gcc.target/i386/avx512f-vfmaddXXXps-2.c (test for excess errors) FAIL: gcc.target/i386/avx512f-vfmaddsubXXXpd-2.c (test for excess errors) FAIL: gcc.target/i386/avx512f-vfmaddsubXXXps-2.c (test for excess errors) FAIL: gcc.target/i386/avx512f-vfmsubXXXpd-2.c (test for excess errors) FAIL: gcc.target/i386/avx512f-vfmsubXXXps-2.c (test for excess errors) FAIL: gcc.target/i386/avx512f-vfmsubaddXXXpd-2.c (test for excess errors) FAIL: gcc.target/i386/avx512f-vfmsubaddXXXps-2.c (test for excess errors) FAIL: gcc.target/i386/avx512f-vfnmaddXXXpd-2.c (test for excess errors) FAIL: gcc.target/i386/avx512f-vfnmaddXXXps-2.c (test for excess errors) FAIL: gcc.target/i386/avx512f-vfnmsubXXXpd-2.c (test for excess errors) FAIL: gcc.target/i386/avx512f-vfnmsubXXXps-2.c (test for excess errors) which are assembler errors such as "operand type mismatch for `vfmaddpd'" - it looks like the compiler isn't really prepared for the -mavx512f -mfma4 combination, but I'm not sure what the best way to handle it is (producing invalid output doesn't seem right, however). If you test with -march=bdver3 in the multilib options (runtest --target_board=unix/-march=bdver3) rather than as the configured default, you get extra failures for the usual reason of multilib options going after the options from dg-options (which I propose to address in the usual way using dg-skip-if for -march= options different from the one present in dg-options). 2014-03-28 Joseph Myers * gcc.dg/pr45416.c: Allow bextr on x86. * gcc.target/i386/fma4-builtin.c, gcc.target/i386/fma4-fma-2.c, gcc.target/i386/fma4-fma.c, gcc.target/i386/fma4-vector-2.c, gcc.target/i386/fma4-vector.c: Use -mno-fma. * gcc.target/i386/l_fma_double_1.c, gcc.target/i386/l_fma_double_2.c, gcc.target/i386/l_fma_double_3.c, gcc.target/i386/l_fma_double_4.c, gcc.target/i386/l_fma_double_5.c, gcc.target/i386/l_fma_double_6.c, gcc.target/i386/l_fma_float_1.c, gcc.target/i386/l_fma_float_2.c, gcc.target/i386/l_fma_float_3.c, gcc.target/i386/l_fma_float_4.c, gcc.target/i386/l_fma_float_5.c, gcc.target/i386/l_fma_float_6.c: Use -mno-fma4. * gcc.target/i386/pr27971.c: Use -mno-tbm. * gcc.target/i386/pr42542-4a.c: Use -mno-avx. * gcc.target/i386/pr59390.c: Use -mno-fma -mno-fma4. Index: gcc/testsuite/gcc.dg/pr45416.c =================================================================== --- gcc/testsuite/gcc.dg/pr45416.c (revision 208882) +++ gcc/testsuite/gcc.dg/pr45416.c (working copy) @@ -9,7 +9,7 @@ return 0; } -/* { dg-final { scan-assembler "andl" { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } } " */ +/* { dg-final { scan-assembler "andl|bextr" { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } } " */ /* { dg-final { scan-assembler-not "setne" { target i?86-*-linux* i?86-*-gnu* x86_64-*-linux* } } }" */ /* { dg-final { scan-assembler "and|ubfx" { target arm*-*-* } } } */ /* { dg-final { scan-assembler-not "moveq" { target arm*-*-* } } }" */ Index: gcc/testsuite/gcc.target/i386/pr27971.c =================================================================== --- gcc/testsuite/gcc.target/i386/pr27971.c (revision 208882) +++ gcc/testsuite/gcc.target/i386/pr27971.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2" } */ +/* { dg-options "-O2 -mno-tbm" } */ unsigned array[4]; Index: gcc/testsuite/gcc.target/i386/l_fma_double_5.c =================================================================== --- gcc/testsuite/gcc.target/i386/l_fma_double_5.c (revision 208882) +++ gcc/testsuite/gcc.target/i386/l_fma_double_5.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic" } */ +/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic -mno-fma4" } */ /* Test that the compiler properly optimizes floating point multiply and add instructions into FMA3 instructions. */ Index: gcc/testsuite/gcc.target/i386/l_fma_float_6.c =================================================================== --- gcc/testsuite/gcc.target/i386/l_fma_float_6.c (revision 208882) +++ gcc/testsuite/gcc.target/i386/l_fma_float_6.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic" } */ +/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic -mno-fma4" } */ /* Test that the compiler properly optimizes floating point multiply and add instructions into FMA3 instructions. */ Index: gcc/testsuite/gcc.target/i386/pr42542-4a.c =================================================================== --- gcc/testsuite/gcc.target/i386/pr42542-4a.c (revision 208882) +++ gcc/testsuite/gcc.target/i386/pr42542-4a.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -msse4.2 -ftree-vectorize" } */ +/* { dg-options "-O1 -msse4.2 -ftree-vectorize -mno-avx" } */ #include "pr42542-4.c" Index: gcc/testsuite/gcc.target/i386/fma4-vector-2.c =================================================================== --- gcc/testsuite/gcc.target/i386/fma4-vector-2.c (revision 208882) +++ gcc/testsuite/gcc.target/i386/fma4-vector-2.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do compile { target { ! { ia32 } } } } */ -/* { dg-options "-O2 -mfma4 -ftree-vectorize -mtune=generic" } */ +/* { dg-options "-O2 -mfma4 -ftree-vectorize -mtune=generic -mno-fma" } */ float r[256], s[256]; float x[256]; Index: gcc/testsuite/gcc.target/i386/fma4-builtin.c =================================================================== --- gcc/testsuite/gcc.target/i386/fma4-builtin.c (revision 208882) +++ gcc/testsuite/gcc.target/i386/fma4-builtin.c (working copy) @@ -2,7 +2,7 @@ and add instructions FMA4 systems. */ /* { dg-do compile { target { ! { ia32 } } } } */ -/* { dg-options "-O2 -mfma4" } */ +/* { dg-options "-O2 -mfma4 -mno-fma" } */ #ifndef __FP_FAST_FMAF # error "__FP_FAST_FMAF should be defined" Index: gcc/testsuite/gcc.target/i386/l_fma_double_2.c =================================================================== --- gcc/testsuite/gcc.target/i386/l_fma_double_2.c (revision 208882) +++ gcc/testsuite/gcc.target/i386/l_fma_double_2.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic" } */ +/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic -mno-fma4" } */ /* Test that the compiler properly optimizes floating point multiply and add instructions into FMA3 instructions. */ Index: gcc/testsuite/gcc.target/i386/l_fma_float_3.c =================================================================== --- gcc/testsuite/gcc.target/i386/l_fma_float_3.c (revision 208882) +++ gcc/testsuite/gcc.target/i386/l_fma_float_3.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic" } */ +/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic -mno-fma4" } */ /* Test that the compiler properly optimizes floating point multiply and add instructions into FMA3 instructions. */ Index: gcc/testsuite/gcc.target/i386/l_fma_double_6.c =================================================================== --- gcc/testsuite/gcc.target/i386/l_fma_double_6.c (revision 208882) +++ gcc/testsuite/gcc.target/i386/l_fma_double_6.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic" } */ +/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic -mno-fma4" } */ /* Test that the compiler properly optimizes floating point multiply and add instructions into FMA3 instructions. */ Index: gcc/testsuite/gcc.target/i386/fma4-fma.c =================================================================== --- gcc/testsuite/gcc.target/i386/fma4-fma.c (revision 208882) +++ gcc/testsuite/gcc.target/i386/fma4-fma.c (working copy) @@ -3,7 +3,7 @@ vfnmsubss on FMA4 systems. */ /* { dg-do compile { target { ! { ia32 } } } } */ -/* { dg-options "-O2 -mfma4" } */ +/* { dg-options "-O2 -mfma4 -mno-fma" } */ extern void exit (int); Index: gcc/testsuite/gcc.target/i386/fma4-fma-2.c =================================================================== --- gcc/testsuite/gcc.target/i386/fma4-fma-2.c (revision 208882) +++ gcc/testsuite/gcc.target/i386/fma4-fma-2.c (working copy) @@ -3,7 +3,7 @@ vfnmsubss on FMA4 systems. */ /* { dg-do compile { target { ! { ia32 } } } } */ -/* { dg-options "-O2 -funsafe-math-optimizations -mfma4" } */ +/* { dg-options "-O2 -funsafe-math-optimizations -mfma4 -mno-fma" } */ extern void exit (int); Index: gcc/testsuite/gcc.target/i386/l_fma_double_3.c =================================================================== --- gcc/testsuite/gcc.target/i386/l_fma_double_3.c (revision 208882) +++ gcc/testsuite/gcc.target/i386/l_fma_double_3.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic" } */ +/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic -mno-fma4" } */ /* Test that the compiler properly optimizes floating point multiply and add instructions into FMA3 instructions. */ Index: gcc/testsuite/gcc.target/i386/l_fma_float_4.c =================================================================== --- gcc/testsuite/gcc.target/i386/l_fma_float_4.c (revision 208882) +++ gcc/testsuite/gcc.target/i386/l_fma_float_4.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic" } */ +/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic -mno-fma4" } */ /* Test that the compiler properly optimizes floating point multiply and add instructions into FMA3 instructions. */ Index: gcc/testsuite/gcc.target/i386/pr59390.c =================================================================== --- gcc/testsuite/gcc.target/i386/pr59390.c (revision 208882) +++ gcc/testsuite/gcc.target/i386/pr59390.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-std=c99 -O3" } */ +/* { dg-options "-std=c99 -O3 -mno-fma -mno-fma4" } */ extern double fma (double, double, double); void fun() __attribute__((target("fma"))); Index: gcc/testsuite/gcc.target/i386/l_fma_float_1.c =================================================================== --- gcc/testsuite/gcc.target/i386/l_fma_float_1.c (revision 208882) +++ gcc/testsuite/gcc.target/i386/l_fma_float_1.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic" } */ +/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic -mno-fma4" } */ /* Test that the compiler properly optimizes floating point multiply and add instructions into FMA3 instructions. */ Index: gcc/testsuite/gcc.target/i386/l_fma_double_4.c =================================================================== --- gcc/testsuite/gcc.target/i386/l_fma_double_4.c (revision 208882) +++ gcc/testsuite/gcc.target/i386/l_fma_double_4.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic" } */ +/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic -mno-fma4" } */ /* Test that the compiler properly optimizes floating point multiply and add instructions into FMA3 instructions. */ Index: gcc/testsuite/gcc.target/i386/l_fma_float_5.c =================================================================== --- gcc/testsuite/gcc.target/i386/l_fma_float_5.c (revision 208882) +++ gcc/testsuite/gcc.target/i386/l_fma_float_5.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic" } */ +/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic -mno-fma4" } */ /* Test that the compiler properly optimizes floating point multiply and add instructions into FMA3 instructions. */ Index: gcc/testsuite/gcc.target/i386/fma4-vector.c =================================================================== --- gcc/testsuite/gcc.target/i386/fma4-vector.c (revision 208882) +++ gcc/testsuite/gcc.target/i386/fma4-vector.c (working copy) @@ -2,7 +2,7 @@ instructions vector into vfmaddps on FMA4 systems. */ /* { dg-do compile { target { ! { ia32 } } } } */ -/* { dg-options "-O2 -mfma4 -ftree-vectorize -mtune=generic" } */ +/* { dg-options "-O2 -mfma4 -ftree-vectorize -mtune=generic -mno-fma" } */ extern void exit (int); Index: gcc/testsuite/gcc.target/i386/l_fma_double_1.c =================================================================== --- gcc/testsuite/gcc.target/i386/l_fma_double_1.c (revision 208882) +++ gcc/testsuite/gcc.target/i386/l_fma_double_1.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic" } */ +/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic -mno-fma4" } */ /* Test that the compiler properly optimizes floating point multiply and add instructions into FMA3 instructions. */ Index: gcc/testsuite/gcc.target/i386/l_fma_float_2.c =================================================================== --- gcc/testsuite/gcc.target/i386/l_fma_float_2.c (revision 208882) +++ gcc/testsuite/gcc.target/i386/l_fma_float_2.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic" } */ +/* { dg-options "-O3 -Wno-attributes -mfpmath=sse -mfma -mtune=generic -mno-fma4" } */ /* Test that the compiler properly optimizes floating point multiply and add instructions into FMA3 instructions. */