From patchwork Fri Nov 3 15:34:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 833952 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-465866-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="eBME55V6"; 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 3yT5v86tDRz9s7p for ; Sat, 4 Nov 2017 02:47:48 +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 :subject:date:message-id:cc:from:to; q=dns; s=default; b=oMF8Z6H /zrGn9G53Ti4EcP3oTkAg8NRCIL/FKwfzMBfbrHMlU4xPByd4fpTMXJ5OzIhxXo8 n77iu+kPEnMYPAfOIvfe4UW0SMUzkiftsi2N86bw1hdeUbzA8rX8SdsBu1eSfdqn hwrA3RjblYKI0mfuoscnHSyI1mVeI23iJDHQ= 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 :subject:date:message-id:cc:from:to; s=default; bh=WCfX8R5XkvsC1 HFoTkrkqyZJpxg=; b=eBME55V68f4ddIDKVDPxRWxQiKPtgbhHFvJC/z8sN7Qxx kSKY8kIvhQYvR1caF9A8FMearl1ghKBYl8Rp4qTF+vFxvwO7Nh0zvtBOPT2vzyKF Q1nrzPO7Lhp4FucuuZuJgMWs36TKCji2tEhvy7I3gS8y+ednDyJuKN1nr5y9js= Received: (qmail 60024 invoked by alias); 3 Nov 2017 15:47:41 -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 60013 invoked by uid 89); 3 Nov 2017 15:47:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=clark, Clark, chips, Hx-spam-relays-external:74.125.83.67 X-HELO: mail-pg0-f67.google.com Received: from mail-pg0-f67.google.com (HELO mail-pg0-f67.google.com) (74.125.83.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 03 Nov 2017 15:47:39 +0000 Received: by mail-pg0-f67.google.com with SMTP id s75so2811589pgs.0 for ; Fri, 03 Nov 2017 08:47:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:date:message-id:cc:from:to; bh=rxmVTUkuV7CSezDuRVRQpsl6Zo53ttEZQbwclKcVF3k=; b=eAt3TO11WBjH5SlGVaD9GHwtGIM1bwJS7TowOjRE76sISGtl1kaijMiOIJ6Vdd5nMc Zw+vPLqzzZGpUdxlnQ0h6UMRW9s1/TmMtwKVcFuor+FvdgYvM4dlZak0f5NgNkmyMvmA oPb2UjhVrV+wByGF+VuHeizjNkM55Ggkw2e5wodr3BuBOhDvAWwGjgzimhdFq/L9Ru5e qWflnfaRbzEWg27zbBb5amNnndU3U6wmovo45wzXS5HGg1oTPK7LJjZWL8lCZALqXk0O SuJV96px9OsTITsjpB210ikpFPun0EIFG6MtrKU2yRYGUFONK4add2ZaehAu9LE+x4x8 1xNw== X-Gm-Message-State: AMCzsaUKwGR4O/en9o1WkWUYX06K3IeIC35W5JC+s1TKnDO/zG8g0BRW blybPgxMV417a1rhyZrQF7bXDg== X-Google-Smtp-Source: ABhQp+QEfjUgi9CylfYBl0YiWvVZgp45p2n8cVWsipdxmQU7frgRLLhDOYp02HnOvQ5RW56uX2creg== X-Received: by 10.84.128.227 with SMTP id a90mr7281180pla.224.1509724057814; Fri, 03 Nov 2017 08:47:37 -0700 (PDT) Received: from localhost ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id p14sm9523302pgr.51.2017.11.03.08.47.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Nov 2017 08:47:37 -0700 (PDT) Subject: [PATCH] RISC-V: Set SLOW_BYTE_ACCESS=1 Date: Fri, 3 Nov 2017 08:34:38 -0700 Message-Id: <20171103153438.29280-1-palmer@dabbelt.com> Cc: patches@groups.riscv.org, Andrew Waterman From: Palmer Dabbelt To: gcc-patches@gcc.gnu.org, Michael Clark , pinskia@gmail.com X-IsSubscribed: yes From: Andrew Waterman When implementing the RISC-V port, I took the name of this macro at face value. It appears we were mistaken in what this means, here's a quote from the SPARC port that better describes what SLOW_BYTE_ACCESS does /* Nonzero if access to memory by bytes is slow and undesirable. For RISC chips, it means that access to memory by bytes is no better than access by words when possible, so grab a whole word and maybe make use of that. */ I've added the comment to our port as well. See https://gcc.gnu.org/ml/gcc/2017-08/msg00202.html for more discussion. Thanks to Michael Clark and Andrew Pinski for the help! gcc/ChangeLog 2017-10-03 Andrew Waterman * config/riscv/riscv.h (SLOW_BYTE_ACCESS): Change to 1. --- gcc/config/riscv/riscv.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/config/riscv/riscv.h b/gcc/config/riscv/riscv.h index e53555efe82f..a802a3f8cbbb 100644 --- a/gcc/config/riscv/riscv.h +++ b/gcc/config/riscv/riscv.h @@ -615,7 +615,12 @@ typedef struct { #define MOVE_MAX UNITS_PER_WORD #define MAX_MOVE_MAX 8 -#define SLOW_BYTE_ACCESS 0 +/* The SPARC port says: + Nonzero if access to memory by bytes is slow and undesirable. + For RISC chips, it means that access to memory by bytes is no + better than access by words when possible, so grab a whole word + and maybe make use of that. */ +#define SLOW_BYTE_ACCESS 1 #define SHIFT_COUNT_TRUNCATED 1