From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 55118 invoked by alias); 12 Feb 2016 16:56:44 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 55104 invoked by uid 89); 12 Feb 2016 16:56:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=UD:png, personal, stand, Never X-HELO: mail-pf0-f193.google.com Received: from mail-pf0-f193.google.com (HELO mail-pf0-f193.google.com) (209.85.192.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 12 Feb 2016 16:56:42 +0000 Received: by mail-pf0-f193.google.com with SMTP id w128so3617726pfb.2 for ; Fri, 12 Feb 2016 08:56:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type :content-transfer-encoding; bh=PAV6h8U2Wq+GTilU0BVRyfvzACsDhe4kJWD+Qd+XBcA=; b=OJ2Xe4nGGd7LnpEOdZlmedqMNuqVMz8oL5wFt2J9ZJOqE+TtYrfFuiGC+gxYZcg7eu rOWLMHINajediIQzbXJChcSaCSSeu7bjnuTuWuzFqmV6RIBjMiLHbLDBW9VyTjeKu0VI Bcv32Pj0HYy5OrLlxyTJNvPopztjwMKAV8g5zewSd4aB4sGZt5gKXXuIK4iRf7NNLUtq UO4Pc+1MvqhyHdTOF68EQJCTYeCt7Z3XvGlAWk5JJqAm/Lia3wJakKOliKQy/xtgsN8K VEC7PS/8Z2pxHYAYmhVpf4Y14tBw+Kt5GtFddtFjNVRuiMga/J9RRXFAlMRcxvDVrvAu UMiQ== X-Gm-Message-State: AG10YOSJE/omtnuw+IohR8R6lb5YKNoYjixqT+wJRN/UvPXe9RVf2xHnIB4XbeIAEkq4yg== X-Received: by 10.98.65.91 with SMTP id o88mr3559711pfa.114.1455296200520; Fri, 12 Feb 2016 08:56:40 -0800 (PST) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id r68sm20655448pfb.51.2016.02.12.08.56.38 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 12 Feb 2016 08:56:39 -0800 (PST) From: Yao Qi To: Simon Marchi Cc: Yao Qi , Subject: Re: [PATCH 1/3] arm-tdep.c: Refactor arm_process_displaced_insn References: <1455121027-27061-1-git-send-email-simon.marchi@ericsson.com> <1455121027-27061-2-git-send-email-simon.marchi@ericsson.com> <86oabnpk4r.fsf@gmail.com> <56BCBDE9.1010106@ericsson.com> Date: Fri, 12 Feb 2016 16:56:00 -0000 In-Reply-To: <56BCBDE9.1010106@ericsson.com> (Simon Marchi's message of "Thu, 11 Feb 2016 11:59:21 -0500") Message-ID: <861t8hoojg.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00420.txt.bz2 Simon Marchi writes: > Well, my goal was to use variables with names that refer to these tables: > > http://nova.polymtl.ca/~simark/ss/fileJVxJNx.png > (ARM Architecture Reference Manual, section A5.1) Yes, I clearly understand your goal, but I don't think the change is necessary. However, I can't see anything harmful or negative in this patch, and looks the patch is useful in terms of helping you reference the doc easily, I am OK. > > If you only use the bits (insn, 28, 31) notation, I think you lose readab= ility, > because the you have to do one more indirection in the doc, to go see wha= t those > bits mean. but if you write code like "if (bits (insn, 28, 31) !=3D INST_NV)", people do understand what those bits mean. >>> + op1 =3D bits (insn, 25, 27); >>> + op =3D bit (insn, 4); >>> + >>> + if (cond !=3D 0xf) >>=20 >> if (bits (insn, 28, 31) !=3D INST_NV) >>=20 >> this is consistent with other places in arm-tdep.c > > I agree, if there is a define for that it should be used. What does _NV = stand > for though? NV means Never. >>=20 >> 'op' is only used here, let us define it in this block, or use >> 'bit (insn, 4)' instead. > > Ok for moving it, but I would suggest keeping the variable op, for > the same reason as cond mentioned above. OK, that is fine, since this is the personal flavour of writing code. --=20 Yao (=E9=BD=90=E5=B0=A7)