From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 96859 invoked by alias); 11 Feb 2016 11:22:04 -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 96844 invoked by uid 89); 11 Feb 2016 11:22:03 -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=Hx-languages-length:1338, personal X-HELO: mail-pa0-f68.google.com Received: from mail-pa0-f68.google.com (HELO mail-pa0-f68.google.com) (209.85.220.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 11 Feb 2016 11:22:02 +0000 Received: by mail-pa0-f68.google.com with SMTP id y7so1063322paa.3 for ; Thu, 11 Feb 2016 03:22:02 -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=24+uf0+J5MCTMhvE46hHjJ9g+wvxQd6VYMx9qPzCk24=; b=k32mc5CH8wDzuvYv2kX4/JeRNHlDP4WGZ8ZO3vpBM84+NlIq5YegbC3fvYloQGHn5o yVZeLwG4FM0a6Dd1k72IADhXYR1I8xZ06Fz2Ei0fNnvvrvMTeuBjquDosdckaBoTV63F /6T8O6jpEfnueRsr5Pt12fA3CTvK9QrNqEGDV288fS79lB8F8DYuanyZSu1pQjbxcEbn o6UYoKVcar+q0SudCpXyxXqCdzTJBwWiwxMuUc8grDNedMJOM+l/JFdaIxdfStUqmd5k qeWrLd4+s+FcRvUjBu90jPq2IcAuw9ASg/dfm2dl9QvG/DDClnZahLfP9jpHqaEfpxNg 1DbA== X-Gm-Message-State: AG10YOS6j/+OZ0MdzffGfBOJ9+0LtUZDij8XYVTFmgPbHs6fK6MRz2ZqAJfFZ+SC4TXbZg== X-Received: by 10.66.100.163 with SMTP id ez3mr65973330pab.5.1455189720480; Thu, 11 Feb 2016 03:22:00 -0800 (PST) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id dg12sm11639549pac.47.2016.02.11.03.21.58 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 11 Feb 2016 03:21:59 -0800 (PST) From: Yao Qi To: Simon Marchi Cc: 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> Date: Thu, 11 Feb 2016 11:22:00 -0000 In-Reply-To: <1455121027-27061-2-git-send-email-simon.marchi@ericsson.com> (Simon Marchi's message of "Wed, 10 Feb 2016 11:17:05 -0500") Message-ID: <86oabnpk4r.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/msg00340.txt.bz2 Simon Marchi writes: > - if ((insn & 0xf0000000) =3D=3D 0xf0000000) > - err =3D arm_decode_unconditional (gdbarch, insn, regs, dsc); > - else switch (((insn & 0x10) >> 4) | ((insn & 0xe000000) >> 24)) > + cond =3D bits (insn, 28, 31); Variable 'cond' is only used once, so don't need to define it. This is my personal flavour. > + op1 =3D bits (insn, 25, 27); > + op =3D bit (insn, 4); > + > + if (cond !=3D 0xf) if (bits (insn, 28, 31) !=3D INST_NV) this is consistent with other places in arm-tdep.c > { > - case 0x0: case 0x1: case 0x2: case 0x3: > - err =3D arm_decode_dp_misc (gdbarch, insn, regs, dsc); > - break; > + switch (op1) > + { > + case 0x0: > + case 0x1: > + /* Data-processing and miscellaneous instructions */ > + err =3D arm_decode_dp_misc (gdbarch, insn, regs, dsc); > + break; >=20=20 > - case 0x4: case 0x5: case 0x6: > - err =3D arm_decode_ld_st_word_ubyte (gdbarch, insn, regs, dsc); > - break; > + case 0x2: > + /* Load/store word and unsigned byte */ > + err =3D arm_decode_ld_st_word_ubyte (gdbarch, insn, regs, dsc); > + break; >=20=20 > - case 0x7: > - err =3D arm_decode_media (gdbarch, insn, dsc); > - break; > + case 0x3: > + if (op =3D=3D 0) 'op' is only used here, let us define it in this block, or use 'bit (insn, 4)' instead. --=20 Yao (=E9=BD=90=E5=B0=A7)