From patchwork Sat Jan 9 00:05:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 565102 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 4B3FE1402B4 for ; Sat, 9 Jan 2016 11:06:12 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=uvYGNnfQ; dkim-atps=neutral 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:subject:message-id:mime-version:content-type; q=dns; s= default; b=l7a1Fhp6EhwWU6FhDHAjVgf9q+FDRXpiJQBCexWCiSEDh1/9XmYUX L2XBvkuBxOtKJwYG9Wc5WykkFvc00qdozwY62JN2lCnXauEhwnf8/JJZy+hPVG1y SgB4X/uv1yla8Bo4C8DmryLsuzkG8FkMPjRwAGS0gUAsupW5sGC/54= 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:subject:message-id:mime-version:content-type; s= default; bh=eK9QdM6zWv11ZZssldso4qswUi8=; b=uvYGNnfQwwtYk8+Aqa2o 1AqSSjYOauLZeRl6ThMouH7wKb93LmFbOA3vDcyIm3gGb1lF19X14VHW6b2Oxx4q LojWcD7zvTzlrKw2cAjxnia4Pter7/OIA9FDelBHMvbZpIFJ4/maTFSZxxkTtlY9 uljBQDlTLqVIennUCCuF57M= Received: (qmail 76074 invoked by alias); 9 Jan 2016 00:06:02 -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 75481 invoked by uid 89); 9 Jan 2016 00:06:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=no version=3.3.2 spammy=2016-01-09, 20160109, nomips16, v2sf 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; Sat, 09 Jan 2016 00:06:00 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1aHh2a-0002x1-Qt from joseph_myers@mentor.com for gcc-patches@gcc.gnu.org; Fri, 08 Jan 2016 16:05:57 -0800 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.3.224.2; Sat, 9 Jan 2016 00:05:55 +0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.82) (envelope-from ) id 1aHh2X-0005VU-UG for gcc-patches@gcc.gnu.org; Sat, 09 Jan 2016 00:05:54 +0000 Date: Sat, 9 Jan 2016 00:05:53 +0000 From: Joseph Myers To: Subject: Handle Octeon 3 not supporting MIPS paired-single instructions Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 The Octeon 3 processor does not support the MIPS paired-single instructions. This results in illegal instruction errors in the testsuite when vectorization tests try to use those instructions. This patch teaches the compiler about that lack of support, so that warnings are given when -mpaired-single (or something implying it) is used when compiling for such a processor. I chose to test TARGET_OCTEON as the simplest conditional; since the older Octeon processors don't support hard float at all, I don't think the choice matters for them. Tests that then failed with the warning were updated to disable them for Octeon. Tested with no regressions for cross to mips64el-linux-gnu (Octeon 3). OK to commit? gcc: 2016-01-09 Joseph Myers * config/mips/mips.h (ISA_HAS_PAIRED_SINGLE): Require !TARGET_OCTEON. gcc/testsuite: 2016-01-09 Joseph Myers * gcc.target/mips/mips-3d-1.c: Use forbid_cpu=octeon.* in dg-options. * gcc.target/mips/mips-3d-2.c: Likewise. * gcc.target/mips/mips-3d-3.c: Likewise. * gcc.target/mips/mips-3d-4.c: Likewise. * gcc.target/mips/mips-3d-5.c: Likewise. * gcc.target/mips/mips-3d-6.c: Likewise. * gcc.target/mips/mips-3d-7.c: Likewise. * gcc.target/mips/mips-3d-8.c: Likewise. * gcc.target/mips/mips-3d-9.c: Likewise. * gcc.target/mips/mips-ps-1.c: Likewise. * gcc.target/mips/mips-ps-2.c: Likewise. * gcc.target/mips/mips-ps-3.c: Likewise. * gcc.target/mips/mips-ps-4.c: Likewise. * gcc.target/mips/mips-ps-5.c: Likewise. * gcc.target/mips/mips-ps-6.c: Likewise. * gcc.target/mips/mips-ps-7.c: Likewise. * gcc.target/mips/mips-ps-type.c: Likewise. * gcc.target/mips/mips-ps-type-2.c: Likewise. * gcc.target/mips/mips16-attributes-6.c: Likewise. Index: gcc/config/mips/mips.h =================================================================== --- gcc/config/mips/mips.h (revision 232142) +++ gcc/config/mips/mips.h (working copy) @@ -1014,9 +1014,10 @@ #define ISA_HAS_LXC1_SXC1 ISA_HAS_FP4 /* ISA has paired-single instructions. */ -#define ISA_HAS_PAIRED_SINGLE (ISA_MIPS64 \ - || (mips_isa_rev >= 2 \ - && mips_isa_rev <= 5)) +#define ISA_HAS_PAIRED_SINGLE ((ISA_MIPS64 \ + || (mips_isa_rev >= 2 \ + && mips_isa_rev <= 5)) \ + && !TARGET_OCTEON) /* ISA has conditional trap instructions. */ #define ISA_HAS_COND_TRAP (!ISA_MIPS1 \ Index: gcc/testsuite/gcc.target/mips/mips-3d-8.c =================================================================== --- gcc/testsuite/gcc.target/mips/mips-3d-8.c (revision 232142) +++ gcc/testsuite/gcc.target/mips/mips-3d-8.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mips3d" } */ +/* { dg-options "-mips3d forbid_cpu=octeon.*" } */ /* Test MIPS-3D absolute compare and conditional move builtin functions */ #include Index: gcc/testsuite/gcc.target/mips/mips-ps-type-2.c =================================================================== --- gcc/testsuite/gcc.target/mips/mips-ps-type-2.c (revision 232142) +++ gcc/testsuite/gcc.target/mips/mips-ps-type-2.c (working copy) @@ -1,7 +1,7 @@ /* Test v2sf calculations. The nmadd and nmsub patterns need -ffinite-math-only. */ /* { dg-do compile } */ -/* { dg-options "(HAS_MADDPS) -mgp32 -mpaired-single -ffinite-math-only" } */ +/* { dg-options "(HAS_MADDPS) -mgp32 -mpaired-single -ffinite-math-only forbid_cpu=octeon.*" } */ /* { dg-skip-if "nmadd and nmsub need combine" { *-*-* } { "-O0" } { "" } } */ /* { dg-final { scan-assembler "\tcvt.ps.s\t" } } */ /* { dg-final { scan-assembler "\tmov.ps\t" } } */ Index: gcc/testsuite/gcc.target/mips/mips-ps-1.c =================================================================== --- gcc/testsuite/gcc.target/mips/mips-ps-1.c (revision 232142) +++ gcc/testsuite/gcc.target/mips/mips-ps-1.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mpaired-single" } */ +/* { dg-options "-mpaired-single forbid_cpu=octeon.*" } */ /* Test v2sf calculations */ #include Index: gcc/testsuite/gcc.target/mips/mips-3d-1.c =================================================================== --- gcc/testsuite/gcc.target/mips/mips-3d-1.c (revision 232142) +++ gcc/testsuite/gcc.target/mips/mips-3d-1.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mips3d" } */ +/* { dg-options "-mips3d forbid_cpu=octeon.*" } */ /* Test MIPS-3D builtin functions */ #include Index: gcc/testsuite/gcc.target/mips/mips-3d-9.c =================================================================== --- gcc/testsuite/gcc.target/mips/mips-3d-9.c (revision 232142) +++ gcc/testsuite/gcc.target/mips/mips-3d-9.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mips3d" } */ +/* { dg-options "-mips3d forbid_cpu=octeon.*" } */ /* Matrix Multiplications */ #include Index: gcc/testsuite/gcc.target/mips/mips-ps-2.c =================================================================== --- gcc/testsuite/gcc.target/mips/mips-ps-2.c (revision 232142) +++ gcc/testsuite/gcc.target/mips/mips-ps-2.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mpaired-single" } */ +/* { dg-options "-mpaired-single forbid_cpu=octeon.*" } */ /* Test MIPS paired-single builtin functions */ #include Index: gcc/testsuite/gcc.target/mips/mips-3d-2.c =================================================================== --- gcc/testsuite/gcc.target/mips/mips-3d-2.c (revision 232142) +++ gcc/testsuite/gcc.target/mips/mips-3d-2.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mips3d" } */ +/* { dg-options "-mips3d forbid_cpu=octeon.*" } */ /* Test MIPS-3D branch-if-any-two builtin functions */ #include Index: gcc/testsuite/gcc.target/mips/mips-ps-type.c =================================================================== --- gcc/testsuite/gcc.target/mips/mips-ps-type.c (revision 232142) +++ gcc/testsuite/gcc.target/mips/mips-ps-type.c (working copy) @@ -1,7 +1,7 @@ /* Test v2sf calculations. The nmadd and nmsub patterns need -ffinite-math-only. */ /* { dg-do compile } */ -/* { dg-options "-mpaired-single -mgp64 -ffinite-math-only" } */ +/* { dg-options "-mpaired-single -mgp64 -ffinite-math-only forbid_cpu=octeon.*" } */ /* { dg-skip-if "nmadd and nmsub need combine" { *-*-* } { "-O0" } { "" } } */ /* { dg-final { scan-assembler "\tcvt.ps.s\t" } } */ /* { dg-final { scan-assembler "\tmov.ps\t" } } */ Index: gcc/testsuite/gcc.target/mips/mips-ps-3.c =================================================================== --- gcc/testsuite/gcc.target/mips/mips-ps-3.c (revision 232142) +++ gcc/testsuite/gcc.target/mips/mips-ps-3.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mpaired-single" } */ +/* { dg-options "-mpaired-single forbid_cpu=octeon.*" } */ /* Test MIPS paired-single conditional move */ #include Index: gcc/testsuite/gcc.target/mips/mips-3d-3.c =================================================================== --- gcc/testsuite/gcc.target/mips/mips-3d-3.c (revision 232142) +++ gcc/testsuite/gcc.target/mips/mips-3d-3.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mips3d" } */ +/* { dg-options "-mips3d forbid_cpu=octeon.*" } */ /* Test MIPS-3D absolute compare builtin functions */ #include Index: gcc/testsuite/gcc.target/mips/mips-ps-4.c =================================================================== --- gcc/testsuite/gcc.target/mips/mips-ps-4.c (revision 232142) +++ gcc/testsuite/gcc.target/mips/mips-ps-4.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mpaired-single" } */ +/* { dg-options "-mpaired-single forbid_cpu=octeon.*" } */ /* Test MIPS paired-single comparisons */ #include Index: gcc/testsuite/gcc.target/mips/mips-3d-4.c =================================================================== --- gcc/testsuite/gcc.target/mips/mips-3d-4.c (revision 232142) +++ gcc/testsuite/gcc.target/mips/mips-3d-4.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mips3d" } */ +/* { dg-options "-mips3d forbid_cpu=octeon.*" } */ /* Test MIPS-3D branch-if-any-four builtin functions */ #include Index: gcc/testsuite/gcc.target/mips/mips-ps-5.c =================================================================== --- gcc/testsuite/gcc.target/mips/mips-ps-5.c (revision 232142) +++ gcc/testsuite/gcc.target/mips/mips-ps-5.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mpaired-single -mgp64 -ftree-vectorize" } */ +/* { dg-options "-mpaired-single -mgp64 -ftree-vectorize forbid_cpu=octeon.*" } */ /* { dg-skip-if "requires vectorization" { *-*-* } { "-O0" "-Os" } { "" } } */ extern float a[] __attribute__ ((aligned (8))); Index: gcc/testsuite/gcc.target/mips/mips-3d-5.c =================================================================== --- gcc/testsuite/gcc.target/mips/mips-3d-5.c (revision 232142) +++ gcc/testsuite/gcc.target/mips/mips-3d-5.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mips3d" } */ +/* { dg-options "-mips3d forbid_cpu=octeon.*" } */ /* Test MIPS-3D absolute-compare & branch-if-any-four builtin functions */ #include Index: gcc/testsuite/gcc.target/mips/mips-ps-6.c =================================================================== --- gcc/testsuite/gcc.target/mips/mips-ps-6.c (revision 232142) +++ gcc/testsuite/gcc.target/mips/mips-ps-6.c (working copy) @@ -1,7 +1,7 @@ /* mips-ps-2.c with an extra -ffinite-math-only option. This option changes the way that abs.ps is handled. */ /* { dg-do run } */ -/* { dg-options "-mpaired-single -ffinite-math-only" } */ +/* { dg-options "-mpaired-single -ffinite-math-only forbid_cpu=octeon.*" } */ /* Test MIPS paired-single builtin functions */ #include Index: gcc/testsuite/gcc.target/mips/mips-3d-6.c =================================================================== --- gcc/testsuite/gcc.target/mips/mips-3d-6.c (revision 232142) +++ gcc/testsuite/gcc.target/mips/mips-3d-6.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mips3d" } */ +/* { dg-options "-mips3d forbid_cpu=octeon.*" } */ /* Test MIPS-3D absolute compare (floats) builtin functions */ #include Index: gcc/testsuite/gcc.target/mips/mips-ps-7.c =================================================================== --- gcc/testsuite/gcc.target/mips/mips-ps-7.c (revision 232142) +++ gcc/testsuite/gcc.target/mips/mips-ps-7.c (working copy) @@ -1,6 +1,6 @@ /* mips-ps-5.c with -mgp32 instead of -mgp64. */ /* { dg-do compile } */ -/* { dg-options "-mgp32 -mpaired-single -ftree-vectorize" } */ +/* { dg-options "-mgp32 -mpaired-single -ftree-vectorize forbid_cpu=octeon.*" } */ /* { dg-skip-if "requires vectorization" { *-*-* } { "-O0" "-Os" } { "" } } */ extern float a[] __attribute__ ((aligned (8))); Index: gcc/testsuite/gcc.target/mips/mips16-attributes-6.c =================================================================== --- gcc/testsuite/gcc.target/mips/mips16-attributes-6.c (revision 232142) +++ gcc/testsuite/gcc.target/mips/mips16-attributes-6.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mips16 addressing=absolute -mips3d" } */ +/* { dg-options "-mips16 addressing=absolute -mips3d forbid_cpu=octeon.*" } */ static inline NOMIPS16 float i1 (float f) Index: gcc/testsuite/gcc.target/mips/mips-3d-7.c =================================================================== --- gcc/testsuite/gcc.target/mips/mips-3d-7.c (revision 232142) +++ gcc/testsuite/gcc.target/mips/mips-3d-7.c (working copy) @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-mips3d" } */ +/* { dg-options "-mips3d forbid_cpu=octeon.*" } */ /* Test MIPS-3D absolute compare (doubles) builtin functions */ #include