From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from server.nextmovesoftware.com (server.nextmovesoftware.com [162.254.253.69]) by sourceware.org (Postfix) with ESMTPS id 16F3C3857822 for ; Mon, 30 May 2022 13:22:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 16F3C3857822 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=nextmovesoftware.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nextmovesoftware.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nextmovesoftware.com; s=default; h=Content-Type:MIME-Version:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xeRWI2lUmOmgsnNtoChPf1tH2nl8uIUNa9rYMJ1Ij/I=; b=LyYREHbEnrPeys5jpXXyzzbMz8 z5nkcgDx7akUAv5QqhAflOOaypSwbMjmT7oPE+8Pt1QcOLSoKrDnFxiPdc702/AL6YO9rwZgPPmpf edFBGf7ZaA2H4sn7tZ7xtpEFYLeTXAPS+ckrG3dIzXGl50CrXLcVPXxbVRwVoAUjPjogDleoRtd9L OeL/fxWZHFPdrIww9LVmuMsL691pn5dK/BshL0/vsEXIzzqGhMkFFtgghtE4SDybmi2487uv0JVpN 2MPhIUxrPrvGshL1QXe67JvmOoSGp5np6cNuUfcQ4AGvQpuJUM0vviTkcN2vcIATs1ACczAe3rs/m +/m+4E/A==; Received: from [185.62.158.67] (port=54626 helo=Dell) by server.nextmovesoftware.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nvfM4-00053h-EU; Mon, 30 May 2022 09:22:44 -0400 From: "Roger Sayle" To: "'GCC Patches'" Subject: [x86 PATCH] Allow SCmode and DImode to be tieable on TARGET_64BIT. Date: Mon, 30 May 2022 14:22:43 +0100 Message-ID: <001d01d87428$58e9c9a0$0abd5ce0$@nextmovesoftware.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_001E_01D87430.BAAE31A0" X-Mailer: Microsoft Outlook 16.0 Thread-Index: Adh0J/sgYpgq0fHzTZ2Tn+bSiIe0Cg== Content-Language: en-gb X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server.nextmovesoftware.com X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - nextmovesoftware.com X-Get-Message-Sender-Via: server.nextmovesoftware.com: authenticated_id: roger@nextmovesoftware.com X-Authenticated-Sender: server.nextmovesoftware.com: roger@nextmovesoftware.com X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 May 2022 13:22:46 -0000 This is a multipart message in MIME format. ------=_NextPart_000_001E_01D87430.BAAE31A0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit This patch is a form of insurance policy in case my patch for PR 7061 runs into problems on non-x86 targets; the middle-end can add an extra check that the backend is happy placing SCmode and DImode values in the same register, before creating a SUBREG. Unfortunately, ix86_modes_tieable_p currently claims this is not allowed(?), even though the default target hook for modes_tieable_p is to always return true [i.e. false can be used to specifically prohibit bad combinations], and the x86_64 ABI passes SCmode values in DImode registers!. This makes the backend's modes_tiable_p hook a little more forgiving, and additionally enables interconversion between SCmode and V2SFmode, and between DCmode and VD2Fmode, which opens interesting opportunities in the future. I believe there should currently be no code generation differences with this change. This patch has been tested on x86_64-pc-linux-gnu with make bootstrap and make -k check, both with and without --target_board=unix{-m32}, with no new failures. Ok for mainline? 2022-05-30 Roger Sayle gcc/ChangeLog * config/i386/i386.cc (ix86_modes_tieable_p): Allow SCmode to be tieable with DImode on TARGET_64BIT, and SCmode tieable with V2SFmode, and DCmode with V2DFmode. Thanks in advance, Roger -- ------=_NextPart_000_001E_01D87430.BAAE31A0 Content-Type: text/plain; name="patchcx2.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="patchcx2.txt" diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc=0A= index daa60ac..df5c80d 100644=0A= --- a/gcc/config/i386/i386.cc=0A= +++ b/gcc/config/i386/i386.cc=0A= @@ -20141,6 +20141,18 @@ ix86_modes_tieable_p (machine_mode mode1, = machine_mode mode2)=0A= return (GET_MODE_SIZE (mode1) =3D=3D 8=0A= && ix86_hard_regno_mode_ok (FIRST_MMX_REG, mode1));=0A= =0A= + /* SCmode and DImode can be tied. */=0A= + if ((mode1 =3D=3D E_SCmode && mode2 =3D=3D E_DImode)=0A= + || (mode1 =3D=3D E_DImode && mode2 =3D=3D E_SCmode))=0A= + return TARGET_64BIT;=0A= +=0A= + /* [SD]Cmode and V2[SD]Fmode modes can be tied. */=0A= + if ((mode1 =3D=3D E_SCmode && mode2 =3D=3D E_V2SFmode)=0A= + || (mode1 =3D=3D E_V2SFmode && mode2 =3D=3D E_SCmode)=0A= + || (mode1 =3D=3D E_DCmode && mode2 =3D=3D E_V2DFmode)=0A= + || (mode1 =3D=3D E_V2DFmode && mode2 =3D=3D E_DCmode))=0A= + return true;=0A= +=0A= return false;=0A= }=0A= =0A= ------=_NextPart_000_001E_01D87430.BAAE31A0--