All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Sitnicki <jakub@cloudflare.com>
To: Nandakumar Edamana <nandakumar@nandakumar.co.in>
Cc: Alexei Starovoitov <ast@kernel.org>,
	 Daniel Borkmann <daniel@iogearbox.net>,
	 Andrii Nakryiko <andrii@kernel.org>,
	bpf@vger.kernel.org
Subject: Re: [PATCH v2 bpf-next] bpf: improve the general precision of tnum_mul
Date: Mon, 18 Aug 2025 20:23:31 +0200	[thread overview]
Message-ID: <87tt24zdy4.fsf@cloudflare.com> (raw)
In-Reply-To: <20250815140510.1287598-1-nandakumar@nandakumar.co.in> (Nandakumar Edamana's message of "Fri, 15 Aug 2025 19:35:10 +0530")

On Fri, Aug 15, 2025 at 07:35 PM +0530, Nandakumar Edamana wrote:

[...]

> @@ -155,6 +163,14 @@ struct tnum tnum_intersect(struct tnum a, struct tnum b)
>  	return TNUM(v & ~mu, mu);
>  }
>  
> +struct tnum tnum_union(struct tnum a, struct tnum b)
> +{
> +	u64 v = a.value & b.value;
> +	u64 mu = (a.value ^ b.value) | a.mask | b.mask;
> +
> +	return TNUM(v & ~mu, mu);
> +}
> +

Not sure I follow. So if I have two tnums that represent known contants,
say a=(v=0b1010, m=0) and b=(v=0b0101, m=0), then their union is an
unknown u=(v=0b0000, m=0b1111)?

Full disclosure - I didn't read through the paper. The routine doesn't
seem to appear there, though.

  parent reply	other threads:[~2025-08-18 18:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-15 14:05 [PATCH v2 bpf-next] bpf: improve the general precision of tnum_mul Nandakumar Edamana
2025-08-15 19:10 ` Eduard Zingerman
2025-08-16  4:58   ` Nandakumar Edamana
2025-08-18 22:16     ` Eduard Zingerman
2025-08-18 22:47     ` Eduard Zingerman
2025-08-18 14:24   ` Daniel Borkmann
2025-08-20  6:15   ` Harishankar Vishwanathan
     [not found]     ` <0ba41cd7-adc0-4c65-b1e0-defd8ebc2d64@nandakumar.co.in>
2025-08-20  7:48       ` Fwd: " Nandakumar Edamana
2025-08-21  5:46         ` Harishankar Vishwanathan
2025-08-20 10:31       ` Nandakumar Edamana
2025-08-18 18:23 ` Jakub Sitnicki [this message]
2025-08-18 22:49   ` Eduard Zingerman
2025-08-19  9:20     ` Jakub Sitnicki
2025-08-29  4:04       ` Shung-Hsi Yu
2025-08-18 23:14 ` Eduard Zingerman
     [not found]   ` <3b7b2ed1-bce1-49da-b83c-2ca46850062c@nandakumar.co.in>
2025-08-18 23:31     ` Eduard Zingerman

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=87tt24zdy4.fsf@cloudflare.com \
    --to=jakub@cloudflare.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=nandakumar@nandakumar.co.in \
    /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.