From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by sourceware.org (Postfix) with ESMTPS id CF7BB3858C78 for ; Tue, 28 May 2024 03:52:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CF7BB3858C78 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CF7BB3858C78 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::529 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716868369; cv=none; b=L2GW47aGy8ksYD1lqZ7v2i1BC3OPdNbrnyXE+o7nq8zRIHrMjlAc5Ht4yAr3vmexaG4iPBKNHxBEE/3xVjOiNeBkTfgAC68cCK6idOFu57kWmieR+dTPj8coKUlbeMwgpAyvypZoV0MPDTScd2fXJajkM9LBGuiWHBPU0UpfL0I= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716868369; c=relaxed/simple; bh=OGUU52YDQATDh50Zq9DNpIcRfpovqWy9YHiqKY/Zygg=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=t0wW3RkjBbHAc/JJdVBkL4nJKioQXzNeoXxnspp/cJMUJAOmve1kPiebsv4dIWH/TUMd5CkyzqNuB3IJNkgJ5j9g/gBN0xSDu1eBSr0lUZoCCi2fzWr2F6bD58iG5IMyu7yoIdXxHGwkLpN+HZyRhhpJxn9pNT0QEJKEgE2bwGQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5789733769dso3726360a12.1 for ; Mon, 27 May 2024 20:52:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1716868365; x=1717473165; darn=sourceware.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=CcHH4SWbjt66UijG2inT6LxYKiPCGWPD+KvQ8w1+1/U=; b=ojEldxMpp3fz4vYwcEjK4IV4lqamQ1sd/8sZTWiJF6yI/+V6+QZMXzTuNOEHv1u7Rq A3ZiaOcWI5aYQbQhg/ySCa6yAKyUcq+Pg8hRuSyhYkiriMRHjEabJNxzfHmwpTOcNLYb dtd4YtjwvqwL90sKwPFQSIwMpb4j6d2jBlLHQ0VOgImDJiL3yQmkS2f7D/JtBgETt91I ifOcq3v9cNTFHjN+ayEvN7GXXIH4/8hXF2HNJOs9KWESi8yQqzfbifVBreyGeat29Egq qdgZHlG2wfMSQs2vIEnRQEAfkHHMg3nTU1Jag74UsLV4RT8siNCDF1kM9QZeaJk6qan6 tZ/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716868365; x=1717473165; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CcHH4SWbjt66UijG2inT6LxYKiPCGWPD+KvQ8w1+1/U=; b=O0kd2xA9O5QMFw/AFmXpS8JJmRtRzkFqaJAQsnrw6ENiwnsaJ0vSKp8xQSfQfRRENG kztgQ12Ohbfcjl2tLRwAaKaqPrRTNc93EPTqog+cc/BZOVd/CwxBUOoWs9Rx+GjuHuR2 WElbVl312voHkbBLm110YkNZmwTrBgVrYa/dIOKqSfA0CTwWp//nd3ONgjCIMa49Y49h VyvfXVUtT3RpeDu4SMo8QVJ3qeu7nUm8Vk9C/DjMYJYonp0KjyRLhC5uCU259FPruFTX LAj6oQFsp4rSFbzb8/lzq0nt12f9BdVNnTZCIMlpaBEnW4JcWmZWfY1o34f5+u1xRJIR MDLw== X-Gm-Message-State: AOJu0YwNYYomuMBNB7d5GnDIOZ/sGwWcC/+eTuOhaY7Lk8Bih1cl2UQU S/asKtAafQsWCqVm2dQFm2ZqNP/ToKlgPjzf7O73InR2xb3kNSMdX+nmwUhjcQ6t5gUgFpAwnuk 86XFaPdsmkSABCoTKbci6bTTOZU7TlECx8foNVg== X-Google-Smtp-Source: AGHT+IGtj+e1/eazzH/ohCaEKA8shPfLezQgGwKDAWLzf1cgXISyamPtvt0peY12tpiN1FG6cunG2DhvzxulvsOIpEM= X-Received: by 2002:a17:907:cb14:b0:a5a:8673:cccd with SMTP id a640c23a62f3a-a626250e1camr897884866b.30.1716868364982; Mon, 27 May 2024 20:52:44 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Nelson Chu Date: Tue, 28 May 2024 11:52:33 +0800 Message-ID: Subject: Re: [PATCH v2] gas/doc: RISC-V: Fix Type U instruction To: Javier Mora Cc: binutils@sourceware.org Content-Type: multipart/alternative; boundary="00000000000005772806197b9188" X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --00000000000005772806197b9188 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, This fix looks good and reasonable. Besides, since it looks quite an institute and a small document fix, I think it should be fine to commit for now. If you are interesting in further contributions, then it would be great and convenient if you have the GNU copyright assignment. Please see the details as follow, https://git.savannah.gnu.org/gitweb/?p=3Dgnulib.git;a=3Dtree;f=3Ddoc/Copyri= ght You can fill one of them (probably, seem like all three look the same ), and then send it to assign@gnu.org, to get your copyright assignment. Thanks Nelson On Mon, May 27, 2024 at 1:45=E2=80=AFAM Javier Mora wrote: > On second thought, I just realized that all the simmN/uimmN > instructions use the bit range explicitly, even when it's contiguous > (e.g. `simm12[11:0]`, not just `simm12`). I guess this makes sense > because certain immediates don't take the range [N-1:0] but [N:1], and > one might even think that this .insn would get bits [31:12] of the > immediate value passed in the assembly instruction, when it's actually > bits [19:0] (e.g., `.insn u CUSTOM_0, a0, 0x00042000` will actually > become `0x4200050B`, not `0x0004250B`). > > Sending amended patch with the correct `simm20[19:0]`. The simm20[19:0] is correct if the immediate is a constant. If the immediate is symbol/label, then with the use of %hi/%pcrel_hi/%got_pcrel_hi/... will give you simm[31:12] of the symbol, but that will also generate the corresponding relocation R_RISCV_HI20/PCREL_HI20/GOT_PCREL_HI20/... for the instruction. > > As a side note, and speaking of off-by-one errors, I don't quite like > > the bit numbering in the instructions: the numbers appear in the ASCII > > box diagrams directly under the field boundaries; they should either > > appear slightly to the left (indicating that they refer to the first > > bit of the next field) or to the right in the case of the leftmost 31; > > otherwise it becomes a little confusing (especially since the leftmost > > field appears to have one bit less). > > Alternatively, you may go full "Python style limits" and > > systematically write the index of the bit to the left of the boundary > > -- i.e., replace all those 31 with 32 (and the 30 in Type J with 31). > > Otherwise the leftmost field is "different". > > A third, more explicit but maybe too verbose option is to include both > > boundaries in every field. > I can just apply the patch, not sure what happened. --00000000000005772806197b9188--