BPF List
 help / color / mirror / Atom feed
From: Yonghong Song <yonghong.song@linux.dev>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: bpf <bpf@vger.kernel.org>, Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Kernel Team <kernel-team@fb.com>,
	Martin KaFai Lau <martin.lau@kernel.org>
Subject: Re: [PATCH bpf-next v2 1/2] bpf: Get better reg range with ldsx and 32bit compare
Date: Fri, 12 Jul 2024 14:24:52 -0700	[thread overview]
Message-ID: <753b8b26-db96-4fb9-b96c-c0485a762a4f@linux.dev> (raw)
In-Reply-To: <CAADnVQKhfXg0N-yNOxxmR+Nq_YxG2zHPzpY9BjtBfwvFpQLZ_g@mail.gmail.com>


On 7/12/24 1:30 PM, Alexei Starovoitov wrote:
> On Fri, Jul 12, 2024 at 1:28 PM Yonghong Song <yonghong.song@linux.dev> wrote:
>> +       if (reg->s32_min_value >= 0) {
>> +               if ((reg->smin_value >= S32_MIN && reg->smax_value <= S32_MAX) ||
>> +                   (reg->smin_value >= S16_MIN && reg->smax_value <= S16_MAX) ||
>> +                   (reg->smin_value >= S8_MIN && reg->smax_value <= S8_MAX)) {
> Could you do:
> if (reg->s32_min_value >= 0 &&
>      (reg->smin_value >= S32_MIN ...
>
> to remove one indent below.

Ack. Will make proper change in the next revision.

>
>> +                       reg->smin_value = reg->umin_value = reg->s32_min_value;
>> +                       reg->smax_value = reg->umax_value = reg->s32_max_value;
>> +                       reg->var_off = tnum_intersect(reg->var_off,
>> +                                                     tnum_range(reg->smin_value,
>> +                                                                reg->smax_value));

  reply	other threads:[~2024-07-12 21:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-12 20:28 [PATCH bpf-next v2 1/2] bpf: Get better reg range with ldsx and 32bit compare Yonghong Song
2024-07-12 20:28 ` [PATCH bpf-next v2 2/2] selftests/bpf: Add ldsx selftests for ldsx and subreg compare Yonghong Song
2024-07-12 20:30 ` [PATCH bpf-next v2 1/2] bpf: Get better reg range with ldsx and 32bit compare Alexei Starovoitov
2024-07-12 21:24   ` Yonghong Song [this message]
2024-07-12 20:49 ` Eduard Zingerman
2024-07-12 21:29   ` Yonghong Song
2024-07-12 20:50 ` Eduard Zingerman
2024-07-12 21:30   ` Yonghong Song

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=753b8b26-db96-4fb9-b96c-c0485a762a4f@linux.dev \
    --to=yonghong.song@linux.dev \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=martin.lau@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox