From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31519 invoked by alias); 8 Nov 2011 10:45:33 -0000 Received: (qmail 31508 invoked by uid 22791); 8 Nov 2011 10:45:32 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_SB X-Spam-Check-By: sourceware.org Received: from mail-wy0-f169.google.com (HELO mail-wy0-f169.google.com) (74.125.82.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 08 Nov 2011 10:45:16 +0000 Received: by wyg24 with SMTP id 24so387623wyg.0 for ; Tue, 08 Nov 2011 02:45:15 -0800 (PST) MIME-Version: 1.0 Received: by 10.180.82.68 with SMTP id g4mr12112635wiy.11.1320749114957; Tue, 08 Nov 2011 02:45:14 -0800 (PST) Received: by 10.180.102.133 with HTTP; Tue, 8 Nov 2011 02:45:14 -0800 (PST) In-Reply-To: <4EB90188.40009@codesourcery.com> References: <998639.46560.qm@web112516.mail.gq1.yahoo.com> <321260.58442.qm@web112504.mail.gq1.yahoo.com> <1316327455.23344.YahooMailNeo@web112509.mail.gq1.yahoo.com> <1316404058.27177.YahooMailNeo@web112502.mail.gq1.yahoo.com> <1318650316.91503.YahooMailNeo@web112508.mail.gq1.yahoo.com> <4EB90188.40009@codesourcery.com> Date: Tue, 08 Nov 2011 10:45:00 -0000 Message-ID: Subject: Re: [PATCH] arm reversible : From: oza Pawandeep To: Yao Qi Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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 X-SW-Source: 2011-11/txt/msg00187.txt.bz2 Hi Yao, the function sbo_sbz is generic function, which checks whether alll the bits are 1 or all are 0 ? the position of starting bit could be anything and ending bit could be anyt= hing. this function accepts any position (between 0-31) and any length. I looked at the functions which you suggested; they seem to be working on specific insns. I could not find a better way other than ANDing all the bits to find out whether they all are 1 or 0. I could be easily wrong here or still might not be getting the angle which you are trying to bring in. Regards, Oza. On Tue, Nov 8, 2011 at 3:46 PM, Yao Qi wrote: > On 11/08/2011 02:01 PM, oza Pawandeep wrote: >> Yao >> This function is used to match opcode for instructions. =C2=A0Why= don't >> you use bit operation (AND and OR) and logic operation to match >> instruction? =C2=A0Bit operation and logic operation are widely used in >> gdb. =C2=A0It is efficient and easy to read. =C2=A0I suggest to replace >> sbo_sbz by bit/logical operation when matching instruction. >> >> >> Oza >> I am not sure what you meant by re-writting sbo_sbz function. >> as there is already '&' and '!' and '>>' which all are bit operators. > > I suggested to remove sbo_sbz function, to decode instructions with > macros bits/bit, and to match using if/else/switch etc. > > Please reference arm_get_next_pc_raw, arm_process_displaced_insn and > thumb_process_displaced_insn to see how instructions are decoded and > matched. > > -- > Yao (=E9=BD=90=E5=B0=A7) >