From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id 5B1B33857C45 for ; Mon, 28 Sep 2020 22:47:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5B1B33857C45 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=segher@kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 08SMkhXJ026249; Mon, 28 Sep 2020 17:46:43 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 08SMkhgs026248; Mon, 28 Sep 2020 17:46:43 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 28 Sep 2020 17:46:42 -0500 From: Segher Boessenkool To: HAO CHEN GUI Cc: gcc-patches , wschmidt@linux.ibm.com Subject: Re: [PATCH, rs6000] Add non-relative jump table support on Power Linux Message-ID: <20200928224642.GR28786@gate.crashing.org> References: <20200820001420.GY28786@gate.crashing.org> <06184808-e0a2-ea80-9e6a-dc3c41fd33cf@linux.ibm.com> <20200907214633.GT28786@gate.crashing.org> <3c2e3bb1-f34a-60ad-5c8b-e2eb83c2d532@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3c2e3bb1-f34a-60ad-5c8b-e2eb83c2d532@linux.ibm.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, TXREP, T_SPF_HELO_PERMERROR, T_SPF_PERMERROR autolearn=no 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-List-Received-Date: Mon, 28 Sep 2020 22:47:45 -0000 Hi hao Chen, On Wed, Sep 09, 2020 at 04:55:29PM +0800, HAO CHEN GUI wrote: >     Thanks for your advice. I removed macros defined in linux64.h and > linux.h. So they take relative jump tables by default. When > no-relative-jumptables is set, the absolute jump tables are taken. All > things relevant to section relocations are put in another patch. Thanks > again. [ Please do not insert patches into discussions ] > +/* Implement TARGET_ASM_GENERATE_PIC_ADDR_DIFF_VEC. > + Return true if rs6000_relative_jumptables is set. */ Don't just say what the code does (we can see that ;-) ); say *why*. Of course it is terribly simple in this case, so maybe just that first line is plenty. > +/* Specify the machine mode that this machine uses > + for the index in the tablejump instruction. */ > +#define CASE_VECTOR_MODE \ > + (TARGET_32BIT || rs6000_relative_jumptables ? SImode : Pmode) If TARGET_32BIT is true, SImode and Pmode are the same, so this is simpler said as #define CASE_VECTOR_MODE (rs6000_relative_jumptables ? SImode : Pmode) I'll have the tablejump* patterns converted to paremeterized names hopefully tonight or tomorrow, which will make your patch much easier to read. It looks like it will be fine, thanks :-) Segher