From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 39395 invoked by alias); 20 Nov 2019 22:09:39 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 39386 invoked by uid 89); 20 Nov 2019 22:09:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM,SPF_SOFTFAIL autolearn=no version=3.3.1 spammy=H*r:bug-gdb@gnu.org, H*i:sk:Q@mail., H*f:sk:CAC20JE, H*i:sk:CAC20JE X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 20 Nov 2019 22:09:37 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:49228) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iXYAH-0000b0-EB for gdb@sourceware.org; Wed, 20 Nov 2019 17:09:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41755) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iXYAF-0000V1-H2 for bug-gdb@gnu.org; Wed, 20 Nov 2019 17:09:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iXYAD-0000Zj-3L for bug-gdb@gnu.org; Wed, 20 Nov 2019 17:09:30 -0500 Received: from mail-ua1-x929.google.com ([2607:f8b0:4864:20::929]:40191) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iXYAC-0000ZU-S0 for bug-gdb@gnu.org; Wed, 20 Nov 2019 17:09:29 -0500 Received: by mail-ua1-x929.google.com with SMTP id p18so318106uar.7 for ; Wed, 20 Nov 2019 14:09:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9Ilud7AAOfhpmJQgdWPFnSA/gfgi/qCCVBdFzM2RnBo=; b=buemnwCFHPw4NRS8HS/wmIsGBu20l7OxzwC748oOeYcBc3031RsJvNKJQfKkRCqW51 99eyn7e2d9Cp5ubUKDV4OxcofoUOflFcqEdQ9LKX5yJeuu/3/BZ/0rSZv1v2OypJzizl YaoZ/VfSFMYLiqr66NQXUCZLnG/Ek2K3jYJXbbmOOUCgxG5pzjjAt6fqriWMJkoicBvn aWrjQH4J04hSl68WzOB7daf+agBZvSjEIi7w+16uXDYYJ//gMJQSPmijErRuIw2xy753 j6zKQycBWwN03LEON91JjntwJqFnQJonDNClP0Iiaec651hSUpdz2cdT3Y/tIgwSnbqY SF6A== MIME-Version: 1.0 References: In-Reply-To: From: Andrew Pinski Date: Wed, 20 Nov 2019 22:09:00 -0000 Message-ID: Subject: Re: aarch64 nop instruction To: Eliot Miranda Cc: bug-gdb@gnu.org Content-Type: text/plain; charset="UTF-8" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::929 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-IsSubscribed: yes X-SW-Source: 2019-11/txt/msg00035.txt.bz2 On Wed, Nov 20, 2019 at 1:31 PM Eliot Miranda wrote: > > Hi All, > > I use gdb for processor simulation in a Smalltalk JIT. I am using gdb > 8.3.1 to derive an aarch64 (ARMV8) simulator. I have noticed that 8.3.1 > does not disassemble Arm's "approved" not instruction. > > The approved nop is 2r1101010100000011001000000001111, 0x6a81900f, see Resent out with the attached picture so it would goto the gdb list. Wait I think you are reading the number wrong and the ARM ARM incorrectly. I see (gdb) p/t 0xd503201f $2 = 11010101000000110010000000011111 This is exactly what is written in the ARM ARM as far as I can see. See attached picture. It ends in 5 1's which is 0x1f (you missed the one 1 too). starts with 1101 which is 0xd. I don't see where you get 6a from either. Are you thinking the value in memory; so you are reading it as a little-endian value or something different? Thanks, Andrew Pinski > C6.2.202 on p 252 of > https://developer.arm.com/docs/ddi0487/ea/arm-architecture-reference-manual-armv8-for-armv8-a-architecture-profile. > When I use the 8.3.1 derived system to disassemble that nop I get e.g. > 00000000: .inst 0x6a81900f ; undefined > > > The entry in opcodes/aarch64-tbl.h for the nop that does disassemble is > > CORE_INSN ("nop", 0xd503201f, 0xffffffff, ic_system, 0, OP0 (), {}, F_ALIAS) > > I've tried adding > CORE_INSN ("nop", 0x6a81900f, 0xffffffff, ic_system, 0, OP0 (), {}, F_ALIAS) > which leaves 0xd503201f unaffected but still yields "undefined" for the > :"approved" nop. > > I've tried adding > CORE_INSN ("nop", 0x6a81900f, 0xffffffff, log_shift, 0, OP0 (), {}, > F_HAS_ALIAS), > with the 0ther 0x6a opcodes, e.g. > CORE_INSN ("bics", 0x6a200000, 0x7f200000, log_shift, 0, OP3 (Rd, Rn, > Rm_SFT), QL_I3SAMER, F_SF), > and this breaks the other nop, 0xd503201f, and both forms print as > undefined. > > While I think that not disassembling the official nop is a bug I'm really > more interested in finding out what the minimal change to the table is to > get the "approved" nop to disassemble. Can anyone help? > _,,,^..^,,,_ > best, Eliot