Lines Matching full:a
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 /* A value that's unknown except that @min <= value <= @max */
28 /* Shift a tnum left (by a fixed shift) */
29 struct tnum tnum_lshift(struct tnum a, u8 shift);
30 /* Shift (rsh) a tnum right (by a fixed shift) */
31 struct tnum tnum_rshift(struct tnum a, u8 shift);
32 /* Shift (arsh) a tnum right (by a fixed min_shift) */
33 struct tnum tnum_arshift(struct tnum a, u8 min_shift, u8 insn_bitness);
34 /* Add two tnums, return @a + @b */
35 struct tnum tnum_add(struct tnum a, struct tnum b);
36 /* Subtract two tnums, return @a - @b */
37 struct tnum tnum_sub(struct tnum a, struct tnum b);
38 /* Bitwise-AND, return @a & @b */
39 struct tnum tnum_and(struct tnum a, struct tnum b);
40 /* Bitwise-OR, return @a | @b */
41 struct tnum tnum_or(struct tnum a, struct tnum b);
42 /* Bitwise-XOR, return @a ^ @b */
43 struct tnum tnum_xor(struct tnum a, struct tnum b);
44 /* Multiply two tnums, return @a * @b */
45 struct tnum tnum_mul(struct tnum a, struct tnum b);
47 /* Return a tnum representing numbers satisfying both @a and @b */
48 struct tnum tnum_intersect(struct tnum a, struct tnum b);
50 /* Return @a with all but the lowest @size bytes cleared */
51 struct tnum tnum_cast(struct tnum a, u8 size);
53 /* Returns true if @a is a known constant */
54 static inline bool tnum_is_const(struct tnum a) in tnum_is_const() argument
56 return !a.mask; in tnum_is_const()
59 /* Returns true if @a == tnum_const(@b) */
60 static inline bool tnum_equals_const(struct tnum a, u64 b) in tnum_equals_const() argument
62 return tnum_is_const(a) && a.value == b; in tnum_equals_const()
65 /* Returns true if @a is completely unknown */
66 static inline bool tnum_is_unknown(struct tnum a) in tnum_is_unknown() argument
68 return !~a.mask; in tnum_is_unknown()
71 /* Returns true if @a is known to be a multiple of @size.
72 * @size must be a power of two.
74 bool tnum_is_aligned(struct tnum a, u64 size);
76 /* Returns true if @b represents a subset of @a. */
77 bool tnum_in(struct tnum a, struct tnum b);
84 /* Format a tnum as a pair of hex numbers (value; mask) */
85 int tnum_strn(char *str, size_t size, struct tnum a);
86 /* Format a tnum as tristate binary expansion */
87 int tnum_sbin(char *str, size_t size, struct tnum a);
90 struct tnum tnum_subreg(struct tnum a);
92 struct tnum tnum_clear_subreg(struct tnum a);
94 struct tnum tnum_const_subreg(struct tnum a, u32 value);
95 /* Returns true if 32-bit subreg @a is a known constant*/
96 static inline bool tnum_subreg_is_const(struct tnum a) in tnum_subreg_is_const() argument
98 return !(tnum_subreg(a)).mask; in tnum_subreg_is_const()