From patchwork Tue Sep 4 08:15:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 965828 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-485057-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="rX6RNlTj"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FR5qA1by"; 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 424KRW3Fztz9sBy for ; Tue, 4 Sep 2018 18:16:22 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; q=dns; s=default; b=FsEai13uQQDs bcdA7HxurEpphbDlDnx8guwXZkJkUVkwi3S92ZBhok9+HKoBycYn4k3Hp4oX5bEi KP8Wa/IsWsuiVtVHi6w+SdnDMmqXIxHJr3Z06JRYpKMBgJz8IO3AXcxTG24twcmV ov5KM9ERdP+W4woerVS0w3E0NnMjVDo= 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:from :to:cc:subject:date:message-id; s=default; bh=u0Kv+sUJ3pdC+9SYJt QDsSUz1n4=; b=rX6RNlTjx4oue1pUqX+HcvBjLY0YsSkmuVUIFHxCv4V1qi3fZb VDrfmHgVET/C41+ypc3dPPoS35QulD9bNFQGJl5VVyVLRaQ1B2f6UhYY8dG64TAn YnzhT/bxcsJR9IdYJij9YyW/BnQcny+Yt2GKB/eAxQ/Ow8s6cBPv8sttk= Received: (qmail 4616 invoked by alias); 4 Sep 2018 08:16:14 -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 3951 invoked by uid 89); 4 Sep 2018 08:15:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, FREEMAIL_FROM, FROM_LOCAL_NOVOWEL, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, HK_RANDOM_ENVFROM, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=HX-Received:Tue, Max X-HELO: mail-lj1-f196.google.com Received: from mail-lj1-f196.google.com (HELO mail-lj1-f196.google.com) (209.85.208.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Sep 2018 08:15:49 +0000 Received: by mail-lj1-f196.google.com with SMTP id m84-v6so2346846lje.10 for ; Tue, 04 Sep 2018 01:15:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=gi2RMCudlm3FZufyQ1DCZy1AyNmNQaV73B1myiXHigk=; b=FR5qA1byNai2cI0zL9/BzQnOdLa6AzzF5V6SmlQWYhHwdf9F1pqdGW2Tf6n7CkoD4y XstVN+pfAEtxZQuE8KAfXS3PDLaOWrWPC7PZ13nojuDUON2mNFIg3TJKfbJq4nI/yVF5 pD5Qey0WpCEXdASo6BGHDr1mA1RCvDu18RtOQRso9WNjx8H6BoJkua5pHvvBynmZQbnj J5FKb6CzdnwPj7VD+zApago/ujL7x6nAiwumawZcilXWJ3Ee633wkxgQwOAQ49lUQfGH hiX2d+K2n7FEwxe6+AwYYcIJMKdD+fp0VANVFNl0M4COUcIQEEjLbGyVN3+AMmq9tSHQ SEDA== Received: from octofox.hsd1.ca.comcast.net. (jcmvbkbc-1-pt.tunnel.tserv24.sto1.ipv6.he.net. [2001:470:27:1fa::2]) by smtp.gmail.com with ESMTPSA id a15-v6sm3938730ljf.92.2018.09.04.01.15.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Sep 2018 01:15:46 -0700 (PDT) From: Max Filippov To: gcc-patches@gcc.gnu.org Cc: linux-xtensa@linux-xtensa.org, Sterling Augustine , Max Filippov Subject: [PATCH] gcc: xtensa: fix NAND code in xtensa_expand_atomic Date: Tue, 4 Sep 2018 01:15:28 -0700 Message-Id: <20180904081528.6407-1-jcmvbkbc@gmail.com> X-IsSubscribed: yes NAND is ~(a1 & a2), but xtensa_expand_atomic does ~a1 & a2. That fixes libatomic tests atomic-op-{1,2}. gcc/ 2018-09-04 Max Filippov * config/xtensa/xtensa.c (xtensa_expand_atomic): Reorder AND and XOR operations in NAND case. --- gcc/config/xtensa/xtensa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index 7cfe64d42895..b88556625223 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -1614,10 +1614,10 @@ xtensa_expand_atomic (enum rtx_code code, rtx target, rtx mem, rtx val, break; case MULT: /* NAND */ - tmp = expand_simple_binop (SImode, XOR, old, ac.modemask, - NULL_RTX, 1, OPTAB_DIRECT); - tmp = expand_simple_binop (SImode, AND, tmp, val, + tmp = expand_simple_binop (SImode, AND, old, val, new_rtx, 1, OPTAB_DIRECT); + tmp = expand_simple_binop (SImode, XOR, tmp, ac.modemask, + NULL_RTX, 1, OPTAB_DIRECT); break; default: