From patchwork Sun Oct 8 10:57:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 822993 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-463703-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Wk1WNFvT"; dkim-atps=neutral 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 3y90hJ64CSz9t3t for ; Sun, 8 Oct 2017 21:57:33 +1100 (AEDT) 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:subject:message-id:mime-version:content-type; q=dns; s= default; b=T6+NG3cHK61azSGw8cIaTQk7G0Xrb3Buftubcj6gmSTQwMspcccxy 6k7PzLDGSZslGXpkWNkI0E0aBPWdmRWuiUp6HGkOrN8V213Rr6w2snUHUdapMauI qF9DC5Z7Y4hmAqJa1Fs0wyeAg4FF3pPlee6Rxg4BY/ku1ERDjULK5Q= 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:subject:message-id:mime-version:content-type; s= default; bh=w3emXVVvOxFTKZcu+j4DVDh4UQE=; b=Wk1WNFvTwHLZCrxNi0QD mQvGOMchcYbEv984uPX91Cpq3E69YaLEJBzahPOc3gUagzZqScE8CUzgXYsbyvob +uIE1tghJsUjWIA5U/RMj1U1CIhvQZ2gF788f9a2/BqA+FyIPExEQII+d1Odr96U Sevkkud9NH8Y01Me5mmnLrI= Received: (qmail 98096 invoked by alias); 8 Oct 2017 10:57:22 -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 98077 invoked by uid 89); 8 Oct 2017 10:57:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:1074 X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 08 Oct 2017 10:57:20 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 1F7DF54886F; Sun, 8 Oct 2017 12:57:18 +0200 (CEST) Date: Sun, 8 Oct 2017 12:57:18 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Zen tuning part 4: Avoid 512bit memcpy/memset expansions on AVX128 optimal targets Message-ID: <20171008105717.GA94265@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Hi, ix86_expand_set_or_movmem is trying to use widest possible vector mode available. This does not help for ryzen, because 512 operations are performed by halves. This patch by itself does not affect generated code because memcpy/memset expansion tables needs to be updated. Bootstrapped/regtested x86_64-linux. Honza * i386.c (ix86_expand_set_or_movmem): Disable 512bit loops for targets that preffer 128bit. Index: i386.c =================================================================== --- i386.c (revision 253513) +++ i386.c (working copy) @@ -28947,6 +28947,9 @@ ix86_expand_set_or_movmem (rtx dst, rtx && optab_handler (mov_optab, wider_mode) != CODE_FOR_nothing) move_mode = wider_mode; + if (TARGET_AVX128_OPTIMAL && GET_MODE_BITSIZE (move_mode) > 128) + move_mode = TImode; + /* Find the corresponding vector mode with the same size as MOVE_MODE. MOVE_MODE is an integer mode at the moment (SI, DI, TI, etc.). */ if (GET_MODE_SIZE (move_mode) > GET_MODE_SIZE (word_mode))