From patchwork Thu Feb 28 18:04:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 1049666 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=synopsys.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WZ6pb0/s"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.b="O2rOlp77"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 449L6h2k6wz9s2R for ; Fri, 1 Mar 2019 05:04:43 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=LNvfS8V+Ybf94fwK2sU4OYtzTA9aGRzx7BCkKQHCD3U=; b=WZ6pb0/sa3tErd E8/T6irv6QGS6PwpS8KPnsqd4MEyDBI53gxbD7ITPpEmsvplobu3g5HNABoQ6lUFoH9fXe+FHHe6v R6NJ4MfBMLopQv44zfEvoweTfxN44zw7HyOFchR5cdfGvqidJNVoBlMGD1qZbGoBKoE7dmxVDaCeo FjJmXLoW/tuUbhHc5J4jt6wV1W8wRIbX+TQp2xmnRxoiECxTFwj4XQpTob4sAk7hCbCx10H8+DxrO XCtPSoeHr2iXyLiIQaeRQCl+Dr9GPDjeYBQULw8TT7C70UCL3Xw94nuoBSxTC4tukJMogRA/3+8aP FWvd3lvZ+3Oku2930dwA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzQ2z-0001ks-NL; Thu, 28 Feb 2019 18:04:41 +0000 Received: from smtprelay2.synopsys.com ([198.182.60.111] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gzQ2x-0001kX-43 for linux-snps-arc@lists.infradead.org; Thu, 28 Feb 2019 18:04:40 +0000 Received: from mailhost.synopsys.com (dc8-mailhost1.synopsys.com [10.13.135.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtprelay.synopsys.com (Postfix) with ESMTPS id 12C7810C0C57; Thu, 28 Feb 2019 10:04:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1551377078; bh=OeNMw1NDC48ErIoU3xe2VUY1gNONmlDVnzlxnIl7XZI=; h=From:To:CC:Subject:Date:From; b=O2rOlp77VBldp70NSp5AZEIqjBDdmr95A4/QsMj5cV7j1+ivcyDIbouLvznX3aLWj L2m6RzD78Rf7SDOPt2ZMDADu+mI1TI8h11HQcFIIoLvXzLWNgGDszfw8TzLxLaEqvk Wo65+1HeVL4eC0tI+ZxBBcR8axdHEQNsM688bzJL+AopTfVsUgI/B0VuPpsM+3S/g+ vPK9aYzDEO7cVqTGqd+mSUHLkNjKit5COlMCAiUjhIBK9GkZiwVO7UKA88/8/FIH7/ sAZXooumxZD03a7bhqizPwY2OHbEh8LsfubuqvYvV3ugbShB4Y45jmCoGTZKsmqv0k xCgnS9xbwfDcw== Received: from US01WEHTC2.internal.synopsys.com (us01wehtc2.internal.synopsys.com [10.12.239.237]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mailhost.synopsys.com (Postfix) with ESMTPS id B297EA0074; Thu, 28 Feb 2019 18:04:35 +0000 (UTC) Received: from IN01WEHTCA.internal.synopsys.com (10.144.199.104) by US01WEHTC2.internal.synopsys.com (10.12.239.237) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 28 Feb 2019 10:04:35 -0800 Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.105) by IN01WEHTCA.internal.synopsys.com (10.144.199.103) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 28 Feb 2019 23:34:39 +0530 Received: from vineetg-Latitude-E7450.internal.synopsys.com (10.10.161.59) by IN01WEHTCB.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 28 Feb 2019 23:34:39 +0530 From: Vineet Gupta To: Subject: [PATCH] [ARC] Fix logic set UNALIGNED_ACCESS Date: Thu, 28 Feb 2019 10:04:24 -0800 Message-ID: <1551377064-30400-1-git-send-email-vgupta@synopsys.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.10.161.59] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190228_100439_185500_B3D705C7 X-CRM114-Status: GOOD ( 13.24 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.182.60.111 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vineet Gupta , linux-snps-arc@lists.infradead.org, andrew.burgess@embecosm.com, Claudiu Zissulescu , Claudiu Zissulescu Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Claudiu Zissulescu gcc/ xxxx-xx-xx Claudiu Zissulescu * config/arc/arc-c.def (__ARC_UNALIGNED__): Set it on unaligned_access variable. * config/arc/arc.c (arc_override_options): Set unaligned access default on for HS CPUs. * config/arc/arc.h (STRICT_ALIGNMENT): Fix logic. Signed-off-by: Vineet Gupta --- gcc/config/arc/arc-c.def | 2 +- gcc/config/arc/arc.c | 4 ++++ gcc/config/arc/arc.h | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/config/arc/arc-c.def b/gcc/config/arc/arc-c.def index 9c0ba2c9c294..9472b48aa7bc 100644 --- a/gcc/config/arc/arc-c.def +++ b/gcc/config/arc/arc-c.def @@ -29,7 +29,7 @@ ARC_C_DEF ("__ARC_MUL64__", TARGET_MUL64_SET) ARC_C_DEF ("__ARC_MUL32BY16__", TARGET_MULMAC_32BY16_SET) ARC_C_DEF ("__ARC_SIMD__", TARGET_SIMD_SET) ARC_C_DEF ("__ARC_RF16__", TARGET_RF16) -ARC_C_DEF ("__ARC_UNALIGNED__", !STRICT_ALIGNMENT) +ARC_C_DEF ("__ARC_UNALIGNED__", unaligned_access) ARC_C_DEF ("__ARC_BARREL_SHIFTER__", TARGET_BARREL_SHIFTER) diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index de2c8d5df9cf..3b8c29981b9a 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -1313,6 +1313,10 @@ arc_override_options (void) if (TARGET_LONG_CALLS_SET) target_flags &= ~MASK_MILLICODE_THUNK_SET; + /* Set unaligned to all HS cpus. */ + if (!global_options_set.x_unaligned_access && TARGET_HS) + unaligned_access = 1; + /* These need to be done at start up. It's convenient to do them here. */ arc_init (); } diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h index 12b4b62bba7b..894eb3946000 100644 --- a/gcc/config/arc/arc.h +++ b/gcc/config/arc/arc.h @@ -285,7 +285,7 @@ if (GET_MODE_CLASS (MODE) == MODE_INT \ /* On the ARC the lower address bits are masked to 0 as necessary. The chip won't croak when given an unaligned address, but the insn will still fail to produce the correct result. */ -#define STRICT_ALIGNMENT (!unaligned_access && !TARGET_HS) +#define STRICT_ALIGNMENT (!unaligned_access) /* Layout of source language data types. */