From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cc-smtpout3.netcologne.de (cc-smtpout3.netcologne.de [89.1.8.213]) by sourceware.org (Postfix) with ESMTPS id 937A8385041C for ; Fri, 19 Mar 2021 06:19:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 937A8385041C Received: from cc-smtpin3.netcologne.de (cc-smtpin3.netcologne.de [89.1.8.203]) by cc-smtpout3.netcologne.de (Postfix) with ESMTP id 9360912C01; Fri, 19 Mar 2021 07:19:25 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin3.netcologne.de (Postfix) with ESMTP id 8F36911E60; Fri, 19 Mar 2021 07:19:25 +0100 (CET) Received: from [2001:4dd6:22d3:0:d9ee:f94a:6429:461d] (helo=cc-smtpin3.netcologne.de) by localhost with ESMTP (eXpurgate 4.19.0) (envelope-from ) id 6054426d-4ebb-7f0000012729-7f000001df92-1 for ; Fri, 19 Mar 2021 07:19:25 +0100 Received: from linux-p51k.fritz.box (2001-4dd6-22d3-0-d9ee-f94a-6429-461d.ipv6dyn.netcologne.de [IPv6:2001:4dd6:22d3:0:d9ee:f94a:6429:461d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cc-smtpin3.netcologne.de (Postfix) with ESMTPSA; Fri, 19 Mar 2021 07:19:17 +0100 (CET) Subject: Re: MATMUL broken with frontend optimization. To: Steve Kargl Cc: Richard Biener , Tobias Burnus , "fortran@gcc.gnu.org" References: <20210318074849.GA22541@troutmask.apl.washington.edu> <563cee48-fbcc-09bc-0cd1-f05082e4feb3@codesourcery.com> <20210318161347.GA24201@troutmask.apl.washington.edu> <1780c473-3523-316f-c372-52824d062a01@netcologne.de> <20210318202239.GA25584@troutmask.apl.washington.edu> <367461e9-72b4-0f8d-d04e-878789595942@netcologne.de> <20210318220758.GA26001@troutmask.apl.washington.edu> From: Thomas Koenig Message-ID: <34f8dfc0-c752-c8fb-8f6b-6880b984e69c@netcologne.de> Date: Fri, 19 Mar 2021 07:19:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210318220758.GA26001@troutmask.apl.washington.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Mar 2021 06:19:29 -0000 Hi Steve, > On my old core2 cpu, a quick test with N=1000 and NxN matrix > suggest a cross over near N=1000 for REAL(4). This cpu doesn't > have any AVX* instruction, so YMMV. Program follows .sig Looking at your data with AVX (which I think we can mostly count on now), - The library is always faster for matmul(vector,matrix) for any n >=100 - For matmul(matrix,vector) there is no appreciable difference So, putting in the same inline limits for matmul(vector,matrix) that we have for matmul(matrix,matrix), and leaving mamul(matrix,vector) alone, seems like a reasonable thing to do. I'll work on a patch. Regards Thomas