From patchwork Tue Aug 13 12:41:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Do Nascimento X-Patchwork-Id: 1971939 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=rEmnPbit; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=rEmnPbit; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; 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 [8.43.85.97]) (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 4WjrdM3gdWz1yYl for ; Tue, 13 Aug 2024 22:42:46 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5D759385AC29 for ; Tue, 13 Aug 2024 12:42:44 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on20600.outbound.protection.outlook.com [IPv6:2a01:111:f403:2607::600]) by sourceware.org (Postfix) with ESMTPS id A98273858D20; Tue, 13 Aug 2024 12:42:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A98273858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A98273858D20 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2607::600 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1723552932; cv=pass; b=LczAH+o+j/U3CEE/U8e2HC3sgnwkJUUY7W/aBbNVFCKFN0TFl9bFzK+miJvljFgVWY98mlPEFdKLwjxnlfxxXEAnp8kuPi3gd5YWw/ajRIFGfqSvjjZGLHQQFA7ix1Ha7EB2NyeiNFnofLEpzRMnwG8E2GE5ClQDYwfJAtSaO5g= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1723552932; c=relaxed/simple; bh=7jRELCjJBD04cRsJUp6F8sl+V2WJ91J6qXxdtvIqLMI=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=XwwEdQbm/qoK5lSjxsHd304VxvhzpKwcQ5HwCVSfQ8OSUQNZLXZOvF/uasz/MF2rlVLMZZSAl/+2dIg+mUgBO9IXeKewFrqH7itJm2d5JMst1OcIMAMgGRyfh2+PejA1Dr+G3nlxR3v8q+Lz71scVqSaR2zX533LCPHjLvZcGwE= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=BqeMg9F5phOt0ZY6G9KhCw7++FnPgjFB7YwNZv6QeI9t+x+O/jRaMJCzjK6QZIJcS5ueQqjn3glm2aRQ+j0SdKe8oF1fSlYZAB+wUdixAK8rZTkesLJKeBxOBF5EFJv2kS/i0wPR6GjgU8TFCWNTO2tqxZgvXT3OoRHlJosEJdcIt93NxL5lHfYhUgJ1Fhmp4mNPl3G60WEpxrldgUG9L+KskwvzXDB1oyYKKJCsXxBI6euYzqx0w3MG+qZ4MviiNFVkE/89MMDXeGeRtcxo75FBZ9SZQAIY64Y9lWd69ipYhzoEZOi19bpdVFT2j1I3qSTH5fHCahK01Ud7/A+YNw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=iqP4MMnTo1VYLZnqEGZAb3XA6OUJaDnNshqbw133OFg=; b=oRzR7PVkD86rSrpVtq16HMHtcX72IV3sxaSMvEtCOnKOf1m/7SXkd6ufL+aRHXQqQdJyzSv4+h/ZmVJ6vhbnV5lMwWkf57cyVQ5MHVwphttHSVOTGWCL2X5SCJ7YpM5qSKiWuOyRmn/F7tTFA245aI/IgYYy6gg62sa9gMDI0VMh0pt4Td9kHr//6LuoCxT0yaglsjZBf01mxJQ6976oMivjhtoV44BvYVeuUZ7dvHOC3iiz8TLzFUCdLuiQRn2W2LdMfr97lML6t6S9COj9D+rzNI2suBP2ZzCzig2NAXCHhl912keO3iScc4O8qL6btKrE+NA29yY3e2ve7H7CzQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iqP4MMnTo1VYLZnqEGZAb3XA6OUJaDnNshqbw133OFg=; b=rEmnPbitjcH1rdTGVfAFdPcVXSEAswRAKNjyogLTvK2muEYdfN6qO/QpPZ3z6bRvGq9mMMYFVP97xrAwLH8LcVhn70y0vX28GGCJp3USdTK/10FFE9mrXJiMPYfFIkO2Ekov64gUEyTficMwh0/ZDZL+wpaHDm2z8DAqOVpy+Go= Received: from DBBPR09CA0017.eurprd09.prod.outlook.com (2603:10a6:10:c0::29) by DU5PR08MB10823.eurprd08.prod.outlook.com (2603:10a6:10:528::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.13; Tue, 13 Aug 2024 12:42:06 +0000 Received: from DB1PEPF000509FA.eurprd03.prod.outlook.com (2603:10a6:10:c0:cafe::af) by DBBPR09CA0017.outlook.office365.com (2603:10a6:10:c0::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend Transport; Tue, 13 Aug 2024 12:42:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB1PEPF000509FA.mail.protection.outlook.com (10.167.242.36) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7849.8 via Frontend Transport; Tue, 13 Aug 2024 12:42:05 +0000 Received: ("Tessian outbound 4a25380d73a2:v403"); Tue, 13 Aug 2024 12:42:05 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 62546943c6631e12 X-CR-MTA-TID: 64aa7808 Received: from Laaf977970ba9.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B4E2C45E-AA3B-4528-B448-82A4FBA5F502.1; Tue, 13 Aug 2024 12:41:58 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id Laaf977970ba9.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 13 Aug 2024 12:41:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VsU2jSsnJrgc21DKjVYPZ5TtGU06elve92SKw4/s3k7aqbxIDTHYTeMonOOhjLcIkfHo8E6kfHRxUcvuQ9ouefrqb4DR1CHEry89EmgeHv3Edolwb1YpcEEcElMq4XtWVF8jbRfTZrkTaUG51/X7iXiILX0XUSOsEAbuEeyHBHGcV+kMPTGFX59eR28BZzcHL2/ki6Y9N1nR1GlPLXDU45MFCcTNA8b2E31WvBsf0FhJVO6ED7W1oSnpoEJLOTkXOqwsy5q1+amcBAJG1GphbulUvLDZzHSqSU3uGZ7AYJPOPziQ9XLZ2vYdidxFUvdSYjiLbv37Jv8tjs2RznDB/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=iqP4MMnTo1VYLZnqEGZAb3XA6OUJaDnNshqbw133OFg=; b=qylG9d1nnErfzO37FYXtjzsoTNLt7JaA9G5Uf4kElsimPHLHUGmOwgLcvBBv625xV+LTL9bg6NXYqDgyf64/8fxZAq/W1nVTDpHcBENwZJKBuMgQOmKaK5CuXdegJ7e9YwbilogdE0IFFXZfvZpqoJH6P67pcy8nW0azOFaNldsvSJVdKC67xW8/lt7fm7NU3LcGoaj+PtwEreiASidqj33d0DfCbPYKX7h22c84bWb5dLJBfyZKpjv/Mbw72TrDw6IGxRIqgXkuGvLtZd2/pcN/uM/LyQkE1xMZoa5cSMSf+03vY460vLB9XjOBoERYH36ES4o3/R9RO//rECJENA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iqP4MMnTo1VYLZnqEGZAb3XA6OUJaDnNshqbw133OFg=; b=rEmnPbitjcH1rdTGVfAFdPcVXSEAswRAKNjyogLTvK2muEYdfN6qO/QpPZ3z6bRvGq9mMMYFVP97xrAwLH8LcVhn70y0vX28GGCJp3USdTK/10FFE9mrXJiMPYfFIkO2Ekov64gUEyTficMwh0/ZDZL+wpaHDm2z8DAqOVpy+Go= Received: from AM9P195CA0008.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:21f::13) by DB9PR08MB8412.eurprd08.prod.outlook.com (2603:10a6:10:3d4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.13; Tue, 13 Aug 2024 12:41:56 +0000 Received: from AM4PEPF00027A67.eurprd04.prod.outlook.com (2603:10a6:20b:21f:cafe::bb) by AM9P195CA0008.outlook.office365.com (2603:10a6:20b:21f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend Transport; Tue, 13 Aug 2024 12:41:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM4PEPF00027A67.mail.protection.outlook.com (10.167.16.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7849.8 via Frontend Transport; Tue, 13 Aug 2024 12:41:56 +0000 Received: from AZ-NEU-EX06.Arm.com (10.240.25.134) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 13 Aug 2024 12:41:54 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX06.Arm.com (10.240.25.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 13 Aug 2024 12:41:53 +0000 Received: from e133397.cambridge.arm.com (10.1.36.172) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Tue, 13 Aug 2024 12:41:53 +0000 From: Victor Do Nascimento To: CC: , , , , , , "Victor Do Nascimento" Subject: [PATCH V2 02/10] autovectorizer: Add basic support for convert optabs Date: Tue, 13 Aug 2024 13:41:42 +0100 Message-ID: <20240813124150.1168825-3-victor.donascimento@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240813124150.1168825-1-victor.donascimento@arm.com> References: <20240813124150.1168825-1-victor.donascimento@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM4PEPF00027A67:EE_|DB9PR08MB8412:EE_|DB1PEPF000509FA:EE_|DU5PR08MB10823:EE_ X-MS-Office365-Filtering-Correlation-Id: f64f4488-ba29-4252-7724-08dcbb9556e0 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|82310400026|36860700013|1800799024|376014; X-Microsoft-Antispam-Message-Info-Original: R9blfxtd980NeAowTYbrna9y6eM6cweH9bPQtDcOxrcYPxBp9rPiYB31qvvFsgis5gwqvJ4fx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at6HN1+t9cPzMk+8DphMcKt+xeY6Yt0h/UoUNnmxPBCiodr7hHzDxhoz5r9W0FGRJZpzu9JPA8oF8i+dmSdKc+vt1vMotjAeDnI1Mj3k+6y8y+UaSDYDHl9MyILOF5+Tb/nJnv4lSW8sUnm2CHr9fWi8iyPIcZN2vjpuDVS38CiqOgnYGzjrkssSRBxeB5xYe48KlSjIwyIGJy67zoyQ6onDzmymxMLq9771Y6E+ssqku+gH1fD00PbzYAtZKf09LXt6knAltQjh8gy4T8lClyIE0og+h06iL9/N1E3a+haoXO/G X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(36860700013)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB8412 X-MS-Exchange-SkipListedInternetSender: ip=[2603:10a6:20b:21f::13]; domain=AM9P195CA0008.EURP195.PROD.OUTLOOK.COM X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB1PEPF000509FA.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 3e5b0680-e700-48e6-9841-08dcbb95513e X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|35042699022|376014|1800799024; X-Microsoft-Antispam-Message-Info: CRJNYsR9Iuu8j/OwBmwM0PDmfCf85fIu6wg5qlqOqvbsSg/KcnHTbaX5+qQs4sTRr/1AW/W7EOJXoK8Zc2fqOwAzNcUD49mv1Z0ERTBVq3ZTzgSG6fkFoqeEys0TZgJYJIrkwVA+g8F4S169ZpIhENRNUrwkdpesRmPb5dZPgxkvdd4QxdDu/Y36dbVbzxI2YO/FpITtsw6OAiHvFELVLCtomq71HNlqk9e/9WQCzWGFTqBhStqpMdyolcovytewd8Gs6U8sU28PYFqOCj2e9LLVI7Xfi4K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ensjoXWCqPGrbBCzRdg3cC+cBlp6VcRriAhQIVCa7SnSc7pzjozOE3sNdzNzb4m5HBxHLiUdQJXzLR/iVWaqKB8/FinrCZET7NgtpUITP+U5FF X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230040)(36860700013)(82310400026)(35042699022)(376014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2024 12:42:05.8403 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f64f4488-ba29-4252-7724-08dcbb9556e0 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB1PEPF000509FA.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU5PR08MB10823 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY 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 Given the shift from modeling dot products as direct optabs to treating them as conversion optabs, we make necessary changes to the autovectorizer code to ensure that given the relevant tree code, together with the input and output data modes, we can retrieve the relevant optab and subsequently the insn_code for it. gcc/ChangeLog: * gimple-match-exports.cc (directly_supported_p): Add overload for conversion-type optabs. * gimple-match.h (directly_supported_p): Add new function prototype. * optabs.cc (expand_widen_pattern_expr): Make the DOT_PROD_EXPR tree code use `find_widening_optab_handler' to retrieve icode. * tree-vect-loop.cc (vect_is_emulated_mixed_dot_prod): make it call conversion-type overloaded `directly_supported_p'. * tree-vect-patterns.cc (vect_supportable_conv_optab_p): New. (vect_recog_dot_prod_pattern): s/direct/conv/ in call to `vect_supportable_direct_optab_p'. --- gcc/gimple-match-exports.cc | 23 ++++++++++++++++++++ gcc/gimple-match.h | 2 ++ gcc/optabs.cc | 3 ++- gcc/tree-vect-loop.cc | 1 + gcc/tree-vect-patterns.cc | 43 +++++++++++++++++++++++++++++++++++-- 5 files changed, 69 insertions(+), 3 deletions(-) diff --git a/gcc/gimple-match-exports.cc b/gcc/gimple-match-exports.cc index aacf3ff0414..d18497e7c83 100644 --- a/gcc/gimple-match-exports.cc +++ b/gcc/gimple-match-exports.cc @@ -1381,6 +1381,29 @@ directly_supported_p (code_helper code, tree type, optab_subtype query_type) && direct_internal_fn_supported_p (ifn, type, OPTIMIZE_FOR_SPEED)); } +/* As above, overloading the function for conversion-type optabs. */ +bool +directly_supported_p (code_helper code, tree type_out, tree type_in, + optab_subtype query_type) +{ + if (code.is_tree_code ()) + { + convert_optab optab = optab_for_tree_code (tree_code (code), type_in, + query_type); + return (optab != unknown_optab + && convert_optab_handler (optab, TYPE_MODE (type_out), + TYPE_MODE (type_in)) != CODE_FOR_nothing); + } + gcc_assert (query_type == optab_default + || (query_type == optab_vector && VECTOR_TYPE_P (type_in)) + || (query_type == optab_scalar && !VECTOR_TYPE_P (type_in))); + internal_fn ifn = associated_internal_fn (combined_fn (code), type_in); + return (direct_internal_fn_p (ifn) + && direct_internal_fn_supported_p (ifn, tree_pair (type_out, type_in), + OPTIMIZE_FOR_SPEED)); +} + + /* A wrapper around the internal-fn.cc versions of get_conditional_internal_fn for a code_helper CODE operating on type TYPE. */ diff --git a/gcc/gimple-match.h b/gcc/gimple-match.h index d710fcbace2..0333a5db00a 100644 --- a/gcc/gimple-match.h +++ b/gcc/gimple-match.h @@ -419,6 +419,8 @@ code_helper canonicalize_code (code_helper, tree); #ifdef GCC_OPTABS_TREE_H bool directly_supported_p (code_helper, tree, optab_subtype = optab_default); +bool directly_supported_p (code_helper, tree, tree, + optab_subtype = optab_default); #endif internal_fn get_conditional_internal_fn (code_helper, tree); diff --git a/gcc/optabs.cc b/gcc/optabs.cc index 185c5b1a705..32737fb80e8 100644 --- a/gcc/optabs.cc +++ b/gcc/optabs.cc @@ -317,7 +317,8 @@ expand_widen_pattern_expr (const_sepops ops, rtx op0, rtx op1, rtx wide_op, widen_pattern_optab = optab_for_tree_code (ops->code, TREE_TYPE (oprnd0), optab_default); if (ops->code == WIDEN_MULT_PLUS_EXPR - || ops->code == WIDEN_MULT_MINUS_EXPR) + || ops->code == WIDEN_MULT_MINUS_EXPR + || ops->code == DOT_PROD_EXPR) icode = find_widening_optab_handler (widen_pattern_optab, TYPE_MODE (TREE_TYPE (ops->op2)), tmode0); diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index 6456220cdc9..5f3de7b72a8 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -5289,6 +5289,7 @@ vect_is_emulated_mixed_dot_prod (stmt_vec_info stmt_info) gcc_assert (STMT_VINFO_REDUC_VECTYPE_IN (stmt_info)); return !directly_supported_p (DOT_PROD_EXPR, + STMT_VINFO_VECTYPE (stmt_info), STMT_VINFO_REDUC_VECTYPE_IN (stmt_info), optab_vector_mixed_sign); } diff --git a/gcc/tree-vect-patterns.cc b/gcc/tree-vect-patterns.cc index f52de2b6972..3afedc9199b 100644 --- a/gcc/tree-vect-patterns.cc +++ b/gcc/tree-vect-patterns.cc @@ -250,6 +250,45 @@ vect_supportable_direct_optab_p (vec_info *vinfo, tree otype, tree_code code, return true; } +/* Return true if the target supports a vector version of CODE, + where CODE is known to map to a conversion optab with the given SUBTYPE. + ITYPE specifies the type of (some of) the scalar inputs and OTYPE + specifies the type of the scalar result. + + When returning true, set *VECOTYPE_OUT to the vector version of OTYPE. + Also set *VECITYPE_OUT to the vector version of ITYPE if VECITYPE_OUT + is nonnull. */ + +static bool +vect_supportable_conv_optab_p (vec_info *vinfo, tree otype, tree_code code, + tree itype, tree *vecotype_out, + tree *vecitype_out = NULL, + enum optab_subtype subtype = optab_default) +{ + tree vecitype = get_vectype_for_scalar_type (vinfo, itype); + tree vecotype = get_vectype_for_scalar_type (vinfo, otype); + if (!vecitype || !vecotype) + return false; + + optab optab = optab_for_tree_code (code, vecitype, subtype); + if (!optab) + return false; + + insn_code icode = convert_optab_handler (optab, TYPE_MODE (vecotype), + TYPE_MODE (vecitype)); + + if (icode == CODE_FOR_nothing + || insn_data[icode].operand[0].mode != TYPE_MODE (vecotype) + || insn_data[icode].operand[1].mode != TYPE_MODE (vecitype)) + return false; + + *vecotype_out = vecotype; + if (vecitype_out) + *vecitype_out = vecitype; + return true; +} + + /* Round bit precision PRECISION up to a full element. */ static unsigned int @@ -1270,13 +1309,13 @@ vect_recog_dot_prod_pattern (vec_info *vinfo, half_type = signed_type_for (half_type); tree half_vectype; - if (!vect_supportable_direct_optab_p (vinfo, type, DOT_PROD_EXPR, half_type, + if (!vect_supportable_conv_optab_p (vinfo, type, DOT_PROD_EXPR, half_type, type_out, &half_vectype, subtype)) { /* We can emulate a mixed-sign dot-product using a sequence of signed dot-products; see vect_emulate_mixed_dot_prod for details. */ if (subtype != optab_vector_mixed_sign - || !vect_supportable_direct_optab_p (vinfo, signed_type_for (type), + || !vect_supportable_conv_optab_p (vinfo, signed_type_for (type), DOT_PROD_EXPR, half_type, type_out, &half_vectype, optab_vector))