From: "Jose E. Marchesi" <jemarch@gnu.org>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Will Hawkins <hawkinsw@obs.cr>, bpf <bpf@vger.kernel.org>,
bpf@ietf.org
Subject: Re: [Bpf] [PATCH 1/1] bpf, docs: Specify twos complement as format for signed integers
Date: Tue, 11 Jul 2023 16:04:11 +0200 [thread overview]
Message-ID: <871qhe7des.fsf@gnu.org> (raw)
In-Reply-To: <CAADnVQ+F5VT72LzONEo79ksqaRj=c7mJDd_Ebb87767v01Nosw@mail.gmail.com> (Alexei Starovoitov's message of "Mon, 10 Jul 2023 20:00:31 -0700")
> On Mon, Jul 10, 2023 at 2:58 PM Will Hawkins <hawkinsw@obs.cr> wrote:
>>
>> In the documentation of the eBPF ISA it is unspecified how integers are
>> represented. Specify that twos complement is used.
>>
>> Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
>> ---
>> Documentation/bpf/instruction-set.rst | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/Documentation/bpf/instruction-set.rst b/Documentation/bpf/instruction-set.rst
>> index 751e657973f0..63dfcba5eb9a 100644
>> --- a/Documentation/bpf/instruction-set.rst
>> +++ b/Documentation/bpf/instruction-set.rst
>> @@ -173,6 +173,11 @@ BPF_ARSH 0xc0 sign extending dst >>= (src & mask)
>> BPF_END 0xd0 byte swap operations (see `Byte swap instructions`_ below)
>> ======== ===== ==========================================================
>>
>> +eBPF supports 32- and 64-bit signed and unsigned integers. It does
>> +not support floating-point data types. All signed integers are represented in
>> +twos-complement format where the sign bit is stored in the most-significant
>> +bit.
>
> Could you point to another ISA document (like x86, arm, ...) that
> talks about signed and unsigned integers?
AFAIK the only signedness encoding aspect that is always found in ISA
specifications and should be specified is how numerical immediates are
encoded in stored instructions.
But that has nothing to do with "data types".
WARNING: multiple messages have this Message-ID (diff)
From: "Jose E. Marchesi" <jemarch@gnu.org>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Will Hawkins <hawkinsw@obs.cr>, bpf <bpf@vger.kernel.org>,
bpf@ietf.org
Subject: Re: [Bpf] [PATCH 1/1] bpf, docs: Specify twos complement as format for signed integers
Date: Tue, 11 Jul 2023 16:04:11 +0200 [thread overview]
Message-ID: <871qhe7des.fsf@gnu.org> (raw)
Message-ID: <20230711140411.S25BdFwF2w1A2SYlG-stWL6nnMJ6QeQE825cCMHZL40@z> (raw)
In-Reply-To: <CAADnVQ+F5VT72LzONEo79ksqaRj=c7mJDd_Ebb87767v01Nosw@mail.gmail.com> (Alexei Starovoitov's message of "Mon, 10 Jul 2023 20:00:31 -0700")
> On Mon, Jul 10, 2023 at 2:58 PM Will Hawkins <hawkinsw@obs.cr> wrote:
>>
>> In the documentation of the eBPF ISA it is unspecified how integers are
>> represented. Specify that twos complement is used.
>>
>> Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
>> ---
>> Documentation/bpf/instruction-set.rst | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/Documentation/bpf/instruction-set.rst b/Documentation/bpf/instruction-set.rst
>> index 751e657973f0..63dfcba5eb9a 100644
>> --- a/Documentation/bpf/instruction-set.rst
>> +++ b/Documentation/bpf/instruction-set.rst
>> @@ -173,6 +173,11 @@ BPF_ARSH 0xc0 sign extending dst >>= (src & mask)
>> BPF_END 0xd0 byte swap operations (see `Byte swap instructions`_ below)
>> ======== ===== ==========================================================
>>
>> +eBPF supports 32- and 64-bit signed and unsigned integers. It does
>> +not support floating-point data types. All signed integers are represented in
>> +twos-complement format where the sign bit is stored in the most-significant
>> +bit.
>
> Could you point to another ISA document (like x86, arm, ...) that
> talks about signed and unsigned integers?
AFAIK the only signedness encoding aspect that is always found in ISA
specifications and should be specified is how numerical immediates are
encoded in stored instructions.
But that has nothing to do with "data types".
--
Bpf mailing list
Bpf@ietf.org
https://www.ietf.org/mailman/listinfo/bpf
next prev parent reply other threads:[~2023-07-11 14:04 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-10 21:58 [PATCH 0/1] Specify twos complement format for signed integers Will Hawkins
2023-07-10 21:58 ` [Bpf] " Will Hawkins
2023-07-10 21:58 ` [PATCH 1/1] bpf, docs: Specify twos complement as " Will Hawkins
2023-07-10 21:58 ` [Bpf] " Will Hawkins
2023-07-11 3:00 ` Alexei Starovoitov
2023-07-11 3:00 ` Alexei Starovoitov
2023-07-11 3:19 ` Will Hawkins
2023-07-11 3:19 ` [Bpf] " Will Hawkins
2023-07-11 3:24 ` Will Hawkins
2023-07-11 3:24 ` [Bpf] " Will Hawkins
2023-07-11 3:28 ` Will Hawkins
2023-07-11 3:28 ` [Bpf] " Will Hawkins
2023-07-11 4:46 ` Alexei Starovoitov
2023-07-11 4:46 ` [Bpf] " Alexei Starovoitov
2023-07-11 5:34 ` Will Hawkins
2023-07-11 5:34 ` [Bpf] " Will Hawkins
2023-07-11 14:04 ` Jose E. Marchesi [this message]
2023-07-11 14:04 ` Jose E. Marchesi
2023-07-11 19:56 ` Alexei Starovoitov
2023-07-11 19:56 ` Alexei Starovoitov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871qhe7des.fsf@gnu.org \
--to=jemarch@gnu.org \
--cc=alexei.starovoitov@gmail.com \
--cc=bpf@ietf.org \
--cc=bpf@vger.kernel.org \
--cc=hawkinsw@obs.cr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.