From patchwork Fri Jun 14 03:11:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kong, Lingling" X-Patchwork-Id: 1947633 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=jCwwbFMI; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W0kpY1T7Lz20QH for ; Fri, 14 Jun 2024 13:12:02 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B40D13882176 for ; Fri, 14 Jun 2024 03:12:00 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) by sourceware.org (Postfix) with ESMTPS id 112A9388215E for ; Fri, 14 Jun 2024 03:11:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 112A9388215E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 112A9388215E Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=198.175.65.15 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1718334701; cv=pass; b=jUp3DhipVk8d6fOgUPqlstsJYswWiA5yT7MXZmCfMUcxPKaTd30MvNM9Vep03xZ2HxhtFmv84en1Vlu+PR43K8wigUqJb8ojD0BpA48xV4R0sH66r6YoSnClzC+tUkjN8dYY1Cu65vI03Sdg/t9BDsF0wYkvdMW+Bfg62r9lXQQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1718334701; c=relaxed/simple; bh=gNXTksmj1KDe+DpHXG0YGQYhu0H+d+MfxaoTgKj8yP4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=upTRBtBr4vzfz+Uicssom1fRRrfV8TqHzAvlofjCKZaNqP34PHnYl3PO5ogMw2c4A4nLoGi3oppi7KQB+IemyJGFPTC71OccmQjf5FcCfwuJeG8g4UXLXCURGx6K+sSt0JGhezI/H11OisOCWVYpZIyGdghPEdqIy0ENsO0IbNw= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718334697; x=1749870697; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=gNXTksmj1KDe+DpHXG0YGQYhu0H+d+MfxaoTgKj8yP4=; b=jCwwbFMI0z41v7jLoKoYhJF19X0LTe2kk+wFVHC6dGcCo23FOj8PgKBz iC9ZLDglwvSAUr1pQhfrwzITQjwY+kMMgBr8t6JyF+vWz9Re3WL+1MGia fu5SivFjNlLyBcVuIzMYAD4L/e8EQDSrL8CUQhawsXAUX6iGPfSj8gp/L ZufSGVx7C3vkMbx82cos2vL0Un1oH+ckEugfVcPZZFn1mKTqxXHLWwieO kyRVqZJW3fkZzIHtahNNGhOrKCJ+JEvQSsDpX2am92iA9sXTEMOlmqmQY LAnp6YrERtUowlpcCCn7q93KIudw1j0CalBqaEkM4Z64v7QF5qS2q6CEJ A==; X-CSE-ConnectionGUID: e+tRtVHfRHa6Hl8zNf2Ajw== X-CSE-MsgGUID: rTmzMFO5RtOvaewSG/M2ig== X-IronPort-AV: E=McAfee;i="6700,10204,11102"; a="18988333" X-IronPort-AV: E=Sophos;i="6.08,236,1712646000"; d="scan'208";a="18988333" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2024 20:11:35 -0700 X-CSE-ConnectionGUID: XBOElVdLQka2vrrloa3VPw== X-CSE-MsgGUID: iv6Kl3pHQXGx5Yfases8Kg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,236,1712646000"; d="scan'208";a="40215849" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmviesa007.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 13 Jun 2024 20:11:36 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 13 Jun 2024 20:11:35 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Thu, 13 Jun 2024 20:11:35 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.173) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 13 Jun 2024 20:11:35 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Px6qjcsUU+eJ+i2OFouuG0/L3mouNlvzsUWiXr4BT0Cu37uMMCNBnB3Rh8dGukYOuWV1nRuWIzHZEV57KrK2l4H+WsKfA1rmvGRuhW7gn0Kof3iajEpgI62sZSnQjdvL8BxxdsKTYgenek0EGpjOq0x0DkJdSm0bYx1v9TVhcnCRcLNyMhuBVy9MsFKKsWoL61FmfFpzNTikg42UoRpNk+oTJXSTreoKR8BloWbAgmhQON1qJgSWfKbXrHaaoNgbMHqZ81CA0H/+UpWwW/2HIvLcBz7AC5TyH7tvhOSc7aH8WqLsyGD2dRfiktE1484iIHeDxZ8g4iUCXB6s0683LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Y1z6QmoSjlYEORUVFUkhEDdwuydjHSUMvuIBFm9onfk=; b=oQCfLnDXxdrmW2OS2hETMwWA2O1a60N1yGRyo9SMerXsUZ1NIVWurF017jOa/JYWThqagrEc1TXByU3+gaVN+7bKfkNfQXcaG3uTGrAmgaQK1P/laziyktVUj+dBX+Jw5a5GXgfkzuc40ujcc6ECNLgCSjc6WFwZS49MFxpaoDdUawWy1/6jWswzSWzaxIHDQdiXaHQmVQk0DTdFchKVAZVns+kuSTJYuStpjxCtZRDi7gFxHxpvNmHXW6kf+T4E0Tm7rZck617YsoYoQn1/9izVLs6n37ERnLvKpF0v+HNbVH4Jby1F8vBREHpzFc6J8rOwGqkpCtzNgnxhovJIAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM4PR11MB5487.namprd11.prod.outlook.com (2603:10b6:5:39f::22) by DS0PR11MB8668.namprd11.prod.outlook.com (2603:10b6:8:1b6::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.20; Fri, 14 Jun 2024 03:11:32 +0000 Received: from DM4PR11MB5487.namprd11.prod.outlook.com ([fe80::8221:de1b:c203:95d2]) by DM4PR11MB5487.namprd11.prod.outlook.com ([fe80::8221:de1b:c203:95d2%7]) with mapi id 15.20.7677.024; Fri, 14 Jun 2024 03:11:32 +0000 From: "Kong, Lingling" To: "gcc-patches@gcc.gnu.org" CC: "Liu, Hongtao" , "Kong, Lingling" , Uros Bizjak Subject: [PATCH 0/3] [APX CFCMOV] Support APX CFCMOV Thread-Topic: [PATCH 0/3] [APX CFCMOV] Support APX CFCMOV Thread-Index: AQHavgiOTloLbBuFzUKqxRQgr1c76g== Date: Fri, 14 Jun 2024 03:11:32 +0000 Message-ID: References: <20240614025749.743388-1-lingling.kong@intel.com> In-Reply-To: <20240614025749.743388-1-lingling.kong@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR11MB5487:EE_|DS0PR11MB8668:EE_ x-ms-office365-filtering-correlation-id: 78d584f1-f640-4611-0ff0-08dc8c1fb149 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230035|1800799019|366011|376009|38070700013; x-microsoft-antispam-message-info: Yxa6mT7Jd4kXvmrykHKvVh5syw4hrxpZsO1218nECdTdXfTD09SM44J8mu09AB8mevzSTNkebBxVK/Gjs+4+/uCdEXC2oGWBcnhohTHu30I4WU6rRcYic0BfpY2+R5U6a5lsniYRnJKPjE5p+rJKscX0GYM0PHtqtjPOUu/JX0kGtuxdFwVU+mnbpPwfKHWFBmSUcfVz8mEislpbLiwdW7tfEjdDi55Jwu8g/fX2jyS9UXAjvE3H3LBTWcG108vD5liu3kmiByM/h2aXVaG5ybo/siU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fJPyUIsKTSNNj19dYWfd2Iyhs= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5487.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230035)(1800799019)(366011)(376009)(38070700013); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: flpMbiA9BIc3U0dKspIk5Kd2WAVgzyhlu8rsTusdygwd8TLhL46ElxfKLPK/W7MvQ1lxx9qkiz9q1IiCi6bweTAX+eXTIy/1o95qU7vGuwBotwdkG2Cnkq/FoTN8X5dnHkNBs/1ohjGOqdQSxyPndVJfgcnPqZfSAuJ96bJAOY2uR1w+Dt/5LqE7nJOd7bQeuQcdaW29CQPnBGh98E6KaB46JyRGeZ0Dy3PL+OkOK5LBP0pEAWLORMdojAS67xg6L/8hMo1XDn6mdcIFD9yUEBNG/cdQtjqQTVcaOW0l9rSU7sKurQdSlMAVMg1e1PotEl8iIk2a3rnztpdoexUJ78796YQ9Jf9jak/4fly8cm3DPh1BSWCr5jAhHcF5vY0YihVmOOTXYS//uDratDOUOGdPsQoI40HhNz3t1AobCfUPhnijSEj/eXkes7lY+0O1BU+jcPlxhTVGbnfAwIVRNIiepUk+10N3GvZpAe2pZMMxbadrR82iUwa5MXI4eVl6nfpZA9OQ/w6h6j676a++DmAjKkMf5P/qv7o3KMoEqMrTNep4AbNw1katI1VrheieZs/xrl1vilTA0s/RX5m8JXhsvnQBmn4GDbx/VyqyQvKjBTCVXCK6DmXm7tzI15dMhx8xy3PP+o1kzSpYRjoyOPwD0yDc/UTpKA3AiBGsU0k52CcWw+5Tha7qiW6atejJXI41HTpC9gfJQnKjkQw37Ztio7+YDphLS/u47AunF4Fmt1G4ykvo2mwjd+kciFmNGAj9+DQyBFUiLsjX/Wa4ZNrEJoiQG4yILnEeYCZxr/REsZvcLNF1icL4kUkyy/UlpUzyL0+T6Dyb61C0/DRfONLj7O4rVgdgl6nk6D8WQ1AThybJfOwdlQalPYKnxkIeHyzEtgukiOtuymORevt1eZ7RQW7Q3KHBcTsBknyuhei+GYPRfPNCPnujWcsuE7h7JKX+OxqsCKdfX2rZoeAGUc4958KejSHA9uUeBuhQAneJ5LQvnX40VmbXBYqaNYfH/84+W7iiAoKMtk+AgPxSbecFzLgCmXFPsT8QipE2qqWiJh9QBfXiql0848OZBbIW85j6el3rI5CCNb3OOze+Z3scgeZZ/oMbklzlANJRKjxuSSMxyXMdIDY9OA3Xn1iBPshT5yPYQlHrfVdan8rzNsuRcuB7ZWBml34JzjAk+5znDv0fF7l2ggO2wYBHV7P8HnfwWDowvEhSK6sfyxnLyiJ9XA/pqCLDqXva0GTx8GYXHXTxcqszg/MC3XlgLD8EfYXJ7iJRJGHFj6BGJILSpTJro8EMJsKOqnaL7eSVttWnyrAcr7D/ydAtSuDgA8kWbUMHcVA60NscOsSMIso1DlEkQWQVi8INeTG4IDaLjmA6cHKU1QoDrR1lFjLW4f2NwoBHCvvjIvi4ruH9d0C8kXTly+9jSAcr4giZHhhUujGQEq2WPN40xYnitRNUVj5dCZN9vigAKiAM/aiiwrFqdUatQ0D9eJlM+OCO0VWZxBVgrjoSUs9+YoxzV26AieAoHt8s1gw5pOeS98lJid+LRkzt8IGIkWvg8m88Ri+4MUNpobR9ScXEbaQPg+lfE9Wi MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5487.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78d584f1-f640-4611-0ff0-08dc8c1fb149 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jun 2024 03:11:32.5388 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: qTSzKS2OJ04US8yJMy81wsRjm166ajoR4RjoJHTWvnVYCB1H8a7r1tQnkA7A8qul3lg4yb1e4V7Dk2IpqxFPfA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB8668 X-OriginatorOrg: intel.com X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, SPF_HELO_NONE, SPF_NONE, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org APX CFCMOV[1] feature implements conditionally faulting which means that all memory faults are suppressed when the condition code evaluates to false and load or store a memory operand. Now we could load or store a memory operand may trap or fault for conditional move. In middle-end, now we don't support a conditional move if we knew that a load from A or B could trap or fault. To enable CFCMOV, we add a target HOOK TARGET_HAVE_CONDITIONAL_MOVE_MEM_NOTRAP in if-conversion pass to allow convert to cmov. All the changes passed bootstrap & regtest x86-64-pc-linux-gnu. We also tested spec with SDE and passed the runtime test. Ok for trunk? [1].https://www.intel.com/content/www/us/en/developer/articles/technical/advanced-performance-extensions-apx.html Lingling Kong (3): [APX CFCMOV] Add a new target hook: TARGET_HAVE_CONDITIONAL_MOVE_MEM_NOTRAP [APX CFCMOV] Support APX CFCMOV in if_convert pass [APX CFCMOV] Support APX CFCMOV in backend gcc/config/i386/i386-expand.cc | 63 +++++ gcc/config/i386/i386-opts.h | 4 +- gcc/config/i386/i386.cc | 33 ++- gcc/config/i386/i386.h | 1 + gcc/config/i386/i386.md | 53 +++- gcc/config/i386/i386.opt | 3 + gcc/config/i386/predicates.md | 7 + gcc/doc/tm.texi | 6 + gcc/doc/tm.texi.in | 2 + gcc/ifcvt.cc | 247 ++++++++++++++++++- gcc/target.def | 11 + gcc/targhooks.cc | 8 + gcc/targhooks.h | 1 + gcc/testsuite/gcc.target/i386/apx-cfcmov-1.c | 73 ++++++ gcc/testsuite/gcc.target/i386/apx-cfcmov-2.c | 40 +++ 15 files changed, 539 insertions(+), 13 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/apx-cfcmov-1.c create mode 100644 gcc/testsuite/gcc.target/i386/apx-cfcmov-2.c