From patchwork Tue Jul 21 18:35:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Uros Bizjak X-Patchwork-Id: 1333294 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=lghRjn61; dkim-atps=neutral Received: from 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BB6k82cY4z9sPf for ; Wed, 22 Jul 2020 04:36:14 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C05F038708DC; Tue, 21 Jul 2020 18:36:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C05F038708DC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1595356571; bh=cnfEsM5Pu2+PPNk1gmgZmxIVvjA6DP6CxMs/wgxmpfI=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=lghRjn61/8WH+3NYPrCTTnfvrIUUNyWnUgpY0mtBzG6E95Dc+n+dPHKE1kwfQjkye ykfhsvAejDcrslx3cjPngQN6Xzjr6wRxIrORDPig6pjVzmpXVUL1xHUa5onrjPeZKo YaMB01AsuprgqprVh35KFXUC4X23iSn8t1O50pTI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) by sourceware.org (Postfix) with ESMTPS id B7AA53842404 for ; Tue, 21 Jul 2020 18:36:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B7AA53842404 Received: by mail-qv1-xf33.google.com with SMTP id el4so9772585qvb.13 for ; Tue, 21 Jul 2020 11:36:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=cnfEsM5Pu2+PPNk1gmgZmxIVvjA6DP6CxMs/wgxmpfI=; b=Mdze9k4WDdAXNN7CiEnq5rA+LAvhyiSx40WG5iWBMsAivyuc4EJm6SbI2tl9XHuEm4 oWpiR87yVuWFiFm1ueQ2CK0G0ccHRIZcx/moRTJtu1SlUBmhYOKfQTZ5M4xOW3arXSJr Ey1YIfjM4+1FvptMnVO/EzPeGovWnUHm3UtYACTYqc5y7ApkUFnFxKWwax+JMPEM0i23 g+xeEB++APBR3gX8ojJA/5OgoEU3lo62CnfDktfW3EMMF7bgbMDkszB1cHDb/Au8J1Wl cCNX4A6S8I/jCtlkwx1VB0An55sOreuYgqifIlvRaj1V73l2mP3WoAY+anfDXRyL49NY siuA== X-Gm-Message-State: AOAM532sVxwuuxviQ6dnK5Ybijbr3RfJuOJicnPxJa4qnLqkCB7PscjF dV2BeiT1NoGeIWc4O648Qm1HsKRmB1NQBXDdQHsuMNQapH4= X-Google-Smtp-Source: ABdhPJxGeruDLiZZS4vQVFOvmnjf/74G0jv4tVsodftXpUMd85IpMw7+edIc8W0gQNKE0MnXUEmIceQxgYjoAzziMpw= X-Received: by 2002:a0c:c787:: with SMTP id k7mr28230586qvj.234.1595356568992; Tue, 21 Jul 2020 11:36:08 -0700 (PDT) MIME-Version: 1.0 Date: Tue, 21 Jul 2020 20:35:57 +0200 Message-ID: Subject: [committed]: i386: Rename TARGET_USE_XCHG_FOR_ATOMIC_STORE to TARGET_AVOID_MFENCE. To: "gcc-patches@gcc.gnu.org" X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, 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: 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-Patchwork-Original-From: Uros Bizjak via Gcc-patches From: Uros Bizjak Reply-To: Uros Bizjak Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" The following is needed to synchronize the tuning flag, new in gcc-10, with the rename in gcc-11. The flag is now named "avoid_mfence" as this is what it really does. No other functional changes on gcc-10 branch, 2020-07-21 Uroš Bizjak gcc/ChangeLog: * config/i386/i386.h (TARGET_AVOID_MFENCE): Rename from TARGET_USE_XCHG_FOR_ATOMIC_STORE. * config/i386/sync.md (atomic_store): Update for rename. * config/i386/x86-tune.def (X86_TUNE_AVOID_MFENCE): Rename from X86_TUNE_USE_XCHG_FOR_ATOMIC_STORE. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}. Uros. diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 23a513d8ffd..4ff8b5e6562 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -592,8 +592,7 @@ extern unsigned char ix86_tune_features[X86_TUNE_LAST]; ix86_tune_features[X86_TUNE_AVOID_FALSE_DEP_FOR_BMI] #define TARGET_ONE_IF_CONV_INSN \ ix86_tune_features[X86_TUNE_ONE_IF_CONV_INSN] -#define TARGET_USE_XCHG_FOR_ATOMIC_STORE \ - ix86_tune_features[X86_TUNE_USE_XCHG_FOR_ATOMIC_STORE] +#define TARGET_AVOID_MFENCE ix86_tune_features[X86_TUNE_AVOID_MFENCE] #define TARGET_EMIT_VZEROUPPER \ ix86_tune_features[X86_TUNE_EMIT_VZEROUPPER] #define TARGET_EXPAND_ABS \ diff --git a/gcc/config/i386/sync.md b/gcc/config/i386/sync.md index 9ab5456b227..502d5673789 100644 --- a/gcc/config/i386/sync.md +++ b/gcc/config/i386/sync.md @@ -306,11 +306,10 @@ { operands[1] = force_reg (mode, operands[1]); - /* For seq-cst stores, use XCHG when we lack MFENCE - or when target prefers XCHG. */ + /* For seq-cst stores, use XCHG when we lack MFENCE. */ if (is_mm_seq_cst (model) && (!(TARGET_64BIT || TARGET_SSE2) - || TARGET_USE_XCHG_FOR_ATOMIC_STORE)) + || TARGET_AVOID_MFENCE)) { emit_insn (gen_atomic_exchange (gen_reg_rtx (mode), operands[0], operands[1], diff --git a/gcc/config/i386/x86-tune.def b/gcc/config/i386/x86-tune.def index 1776aba2d17..6eff8256897 100644 --- a/gcc/config/i386/x86-tune.def +++ b/gcc/config/i386/x86-tune.def @@ -313,8 +313,8 @@ DEF_TUNE (X86_TUNE_ONE_IF_CONV_INSN, "one_if_conv_insn", m_SILVERMONT | m_KNL | m_KNM | m_INTEL | m_CORE_ALL | m_GOLDMONT | m_GOLDMONT_PLUS | m_TREMONT | m_GENERIC) -/* X86_TUNE_USE_XCHG_FOR_ATOMIC_STORE: Use xchg instead of mov+mfence. */ -DEF_TUNE (X86_TUNE_USE_XCHG_FOR_ATOMIC_STORE, "use_xchg_for_atomic_store", +/* X86_TUNE_AVOID_MFENCE: Use lock prefixed instructions instead of mfence. */ +DEF_TUNE (X86_TUNE_AVOID_MFENCE, "avoid_mfence", m_CORE_ALL | m_BDVER | m_ZNVER | m_GENERIC) /* X86_TUNE_EXPAND_ABS: This enables a new abs pattern by