Re: [PATCH v2 bpf-next] bpf: improve the general precision of tnum_mul

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux