From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by sourceware.org (Postfix) with ESMTPS id CB572385DC22 for ; Mon, 7 Jun 2021 18:40:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CB572385DC22 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sifive.com Received: by mail-lj1-x229.google.com with SMTP id o8so23609578ljp.0 for ; Mon, 07 Jun 2021 11:40:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=T5R2Ro4rEnKFBMDhDhKJ272UgtQl6UR4UzeWHF3h0cw=; b=GyujNoTrOWWSp1C4bxmp+grEH6kfWNpdzW/WXEyab4HmaShRHDP6opwLyTinTpqtJ0 ZQwmVNwJd04nSeo7x78RFfQLXa9rUUmcJCAb8PVK6ucbPrK4HYa2iUgbBNJKNHWCd1hz Tq444/7ECWPwPZ5E9uy9h+9YmF3bTb05wZBOfLE3kXm3bXQP6YYZuFlaf+01gX1vRicM aCkD/yGgkBOO13N3/c2epgZMoJDkpcLsVFJMzND6j7Lnm0E2w7oPIppL/p7bu4AteiUN l7GpdygBIq4Ew8ons2BiOIGZO2fngLlsERGTySiVhSSzO/DRJcQfi/Uvif8WRpiVFicv L9zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=T5R2Ro4rEnKFBMDhDhKJ272UgtQl6UR4UzeWHF3h0cw=; b=fXdNzacpzhJl5VBlIWYbA+lM1EyHSyV+ASaUEor1v3ylQtlpVJkc6fxNUwCUPkprXE Ge76BLW+kB0+JLW0DXSrVjJ4+pd0VUM4BelbSRNZ7w+bVQnagqN1hFanCU4SaEY7kNPk wxaPkwN7Gx6VvpIiL4kyJN15HMnwo0uId6HX6ozH+NVZlpdRpnlTwp5i6XRtqsYiKMXO ccZD8MIHLSWFNFWNw6HYIWPFTHqZB3I0S2i6pFu937gBSA+XKb9m53k9VMXlbRIFMUrg x5I3s9nLI3DtE1C/WQmVJVuRZSNq9lNKdEWo3OXzIaniU5u9kW9BSNksgb18spO7IrZt bLoQ== X-Gm-Message-State: AOAM533hLYuXRzJMh1PQT3vd0zbUgBPDWyB1ekUmHyhLpAkOg0fPnEqg O92AwPT+idIofpmgYyZ/qNIdU/4/X7qpUQtK/nBkpQ== X-Google-Smtp-Source: ABdhPJw0M1D6UH+4WBhDSD/K5s6mRS1nl+ZW5bdEXR9d3hq/+eSGgiTm7w0NQahhu2zpgHt3Pj5fLanCgAyx5Qb++4I= X-Received: by 2002:a2e:924b:: with SMTP id v11mr16220640ljg.504.1623091216486; Mon, 07 Jun 2021 11:40:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jim Wilson Date: Mon, 7 Jun 2021 11:40:05 -0700 Message-ID: Subject: Re: Help needed - to add custom instruction to binutils-gdb To: salianvk@gmail.com Cc: Binutils X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jun 2021 18:40:19 -0000 On Sat, Jun 5, 2021 at 6:34 PM Vijay Kumar Salian via Binutils < binutils@sourceware.org> wrote: > I tried adding a new instruction to binutils-gdb. I was able to add the > instruction to assembler and could even assemble the assembly code with new > instructions. But then I tried to disassemble the ELF file to see the > instruction, which displayed some other name for the instruction mnemonic. > Can you please let me know where I can get the details on adding the new > instructions for risc-v? > It would help if you showed your patch, or at least explained what your patch is doing. Without the patch, all we can do is guess. Perhaps you accidentally used the same encoding as another instruction? There is no guide for how to add an instruction, and the exact process sometimes changes as the binutils sources continue to evolve. The basic process doesn't change though. An example of a discussion can be found here https://github.com/riscv/riscv-binutils-gdb/issues/250 Jim