Lines Matching +full:- +full:a +full:-

3  * A tnum tracks knowledge about the bits of a value.  Each bit can be either
20 /* Represent a known constant as a tnum. */
22 /* A completely unknown value */
24 /* An unknown value that is a superset of @min <= value <= @max.
33 /* Shift a tnum left (by a fixed shift) */
34 struct tnum tnum_lshift(struct tnum a, u8 shift);
35 /* Shift (rsh) a tnum right (by a fixed shift) */
36 struct tnum tnum_rshift(struct tnum a, u8 shift);
37 /* Shift (arsh) a tnum right (by a fixed min_shift) */
38 struct tnum tnum_arshift(struct tnum a, u8 min_shift, u8 insn_bitness);
39 /* Add two tnums, return @a + @b */
40 struct tnum tnum_add(struct tnum a, struct tnum b);
41 /* Subtract two tnums, return @a - @b */
42 struct tnum tnum_sub(struct tnum a, struct tnum b);
43 /* Bitwise-AND, return @a & @b */
44 struct tnum tnum_and(struct tnum a, struct tnum b);
45 /* Bitwise-OR, return @a | @b */
46 struct tnum tnum_or(struct tnum a, struct tnum b);
47 /* Bitwise-XOR, return @a ^ @b */
48 struct tnum tnum_xor(struct tnum a, struct tnum b);
49 /* Multiply two tnums, return @a * @b */
50 struct tnum tnum_mul(struct tnum a, struct tnum b);
52 /* Return a tnum representing numbers satisfying both @a and @b */
53 struct tnum tnum_intersect(struct tnum a, struct tnum b);
55 /* Return @a with all but the lowest @size bytes cleared */
56 struct tnum tnum_cast(struct tnum a, u8 size);
58 /* Returns true if @a is a known constant */
59 static inline bool tnum_is_const(struct tnum a) in tnum_is_const() argument
61 return !a.mask; in tnum_is_const()
64 /* Returns true if @a == tnum_const(@b) */
65 static inline bool tnum_equals_const(struct tnum a, u64 b) in tnum_equals_const() argument
67 return tnum_is_const(a) && a.value == b; in tnum_equals_const()
70 /* Returns true if @a is completely unknown */
71 static inline bool tnum_is_unknown(struct tnum a) in tnum_is_unknown() argument
73 return !~a.mask; in tnum_is_unknown()
76 /* Returns true if @a is known to be a multiple of @size.
77 * @size must be a power of two.
79 bool tnum_is_aligned(struct tnum a, u64 size);
81 /* Returns true if @b represents a subset of @a.
83 * Note that using tnum_range() as @a requires extra cautions as tnum_in() may
89 * As a rule of thumb, if @a is explicitly coded rather than coming from
90 * reg->var_off, it should be in form of tnum_const(), tnum_range(0, 2**n - 1),
91 * or tnum_range(2**n, 2**(n+1) - 1).
93 bool tnum_in(struct tnum a, struct tnum b);
95 /* Formatting functions. These have snprintf-like semantics: they will write
100 /* Format a tnum as a pair of hex numbers (value; mask) */
101 int tnum_strn(char *str, size_t size, struct tnum a);
102 /* Format a tnum as tristate binary expansion */
103 int tnum_sbin(char *str, size_t size, struct tnum a);
105 /* Returns the 32-bit subreg */
106 struct tnum tnum_subreg(struct tnum a);
107 /* Returns the tnum with the lower 32-bit subreg cleared */
108 struct tnum tnum_clear_subreg(struct tnum a);
109 /* Returns the tnum with the lower 32-bit subreg in *reg* set to the lower
110 * 32-bit subreg in *subreg*
113 /* Returns the tnum with the lower 32-bit subreg set to value */
114 struct tnum tnum_const_subreg(struct tnum a, u32 value);
115 /* Returns true if 32-bit subreg @a is a known constant*/
116 static inline bool tnum_subreg_is_const(struct tnum a) in tnum_subreg_is_const() argument
118 return !(tnum_subreg(a)).mask; in tnum_subreg_is_const()