From patchwork Wed Nov 23 21:14:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 698530 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 3tPFVP2LGxz9t3K for ; Thu, 24 Nov 2016 08:15:24 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="QjDiyHTR"; 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:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=UUcKMk9V6RzniweDb6IM+GLIGyVaJ72bcXG/FjFTUO5oVF5gCZ 69N9xiErtMjg5/RVHdyRKnvpDD193HXGJNI4dZsvjETr/P3fuxQx+1bCeyV2ryOI QULnBfbrgZB2yHtVIsbySWs3tQRPVCMNRZwoZavG0nwfIIK91tKRax0Kg= 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=AF3OlJ5ZtcBFoYNPeeqzpjIvcJ0=; b=QjDiyHTRGDSHD6R2381A YR1HrFOGyFIU/VwBGzsi0wK/doLhytfFR8UpANBJEFzCSC66KxsN9JniA237ta2P EjoMgnsxigBwBlM8jhK/HhG4qndJWES2onBKTkwgo0mZ5ECn4WRz8/CLYUzUuhww EJrXB/Ub/xKE7Jaq3S3dtsQ= Received: (qmail 122881 invoked by alias); 23 Nov 2016 21:15:15 -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 122764 invoked by uid 89); 23 Nov 2016 21:15:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL, BAYES_00, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=no version=3.3.2 spammy=UD:20161123-1.c, 20161123-1.c, 201611231c, ud 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; Wed, 23 Nov 2016 21:14:57 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1c9esW-0004Kw-AM from joseph_myers@mentor.com ; Wed, 23 Nov 2016 13:14:52 -0800 Received: from digraph.polyomino.org.uk (137.202.0.87) by svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Wed, 23 Nov 2016 21:14:49 +0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.86_2) (envelope-from ) id 1c9esP-0002up-0g; Wed, 23 Nov 2016 21:14:45 +0000 Date: Wed, 23 Nov 2016 21:14:44 +0000 From: Joseph Myers To: CC: , Subject: Add another e500 subreg pattern Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) Building glibc for powerpc-linux-gnuspe --enable-e500-double, given the patch applied, fails with errors such as: ../sysdeps/ieee754/ldbl-128ibm/s_modfl.c: In function '__modfl': ../sysdeps/ieee754/ldbl-128ibm/s_modfl.c:91:1: error: unrecognizable insn: } ^ (insn 31 30 32 2 (set (reg:DF 203) (subreg:DF (reg:TI 202) 8)) "../sysdeps/ieee754/ldbl-128ibm/s_modfl.c":44 -1 (nil)) ../sysdeps/ieee754/ldbl-128ibm/s_modfl.c:91:1: internal compiler error: in extract_insn, at recog.c:2311 This patch adds an insn pattern similar to various patterns already present to handle extracting such a subreg. This allows the glibc build to get further, until it runs into an assembler error for which I have another patch. OK to commit? gcc: 2016-11-23 Joseph Myers * config/rs6000/spe.md (*frob__ti_8): New insn pattern. gcc/testsuite: 2016-11-23 Joseph Myers * gcc.c-torture/compile/20161123-1.c: New test. Index: gcc/config/rs6000/spe.md =================================================================== --- gcc/config/rs6000/spe.md (revision 242751) +++ gcc/config/rs6000/spe.md (working copy) @@ -2314,6 +2314,18 @@ } }) +(define_insn "*frob__ti_8" + [(set (match_operand:SPE64 0 "nonimmediate_operand" "=r") + (subreg:SPE64 (match_operand:TI 1 "input_operand" "r") 8))] + "(TARGET_E500_DOUBLE && mode == DFmode) + || (TARGET_SPE && mode != DFmode)" +{ + if (WORDS_BIG_ENDIAN) + return "evmergelo %0,%Y1,%Z1"; + else + return "evmergelo %0,%Z1,%Y1"; +}) + (define_insn "*frob_tf_ti" [(set (match_operand:TF 0 "gpc_reg_operand" "=r") (subreg:TF (match_operand:TI 1 "gpc_reg_operand" "r") 0))] Index: gcc/testsuite/gcc.c-torture/compile/20161123-1.c =================================================================== --- gcc/testsuite/gcc.c-torture/compile/20161123-1.c (nonexistent) +++ gcc/testsuite/gcc.c-torture/compile/20161123-1.c (working copy) @@ -0,0 +1,7 @@ +double +f (long double x) +{ + union { long double ld; double d[2]; } u; + u.ld = x; + return u.d[1]; +}