Lines Matching refs:val
101 * Get the bits out of `val`.
103 * \param val The raw value of the whole bit field.
107 static Bits_type get(Shift_type val)
108 { return (val >> Lsb) & Low_mask; }
111 * Get the bits in place out of `val`.
113 * \param val The raw value of the whole bit field.
120 static T get_unshifted(Shift_type val)
121 { return val & Mask; }
124 * Set the bits corresponding to `val`.
127 * \param val The value to set into the bits.
131 * \pre `val` must not contain more than #Bits bits.
133 * \note This function does not mask `val` to the right number of bits.
135 static T set_dirty(T dest, Shift_type val)
137 //assert (!(val & ~Low_mask));
138 return (dest & ~Mask) | (val << Lsb);
142 * Set the bits corresponding to `val`.
145 * \param val The value shifted #Lsb bits to the left that shall be set into
150 * \pre `val` must not contain more than #Bits bits shifted #Lsb bits to the
153 * \note This function does not mask `val` to the right number of bits.
155 static T set_unshifted_dirty(T dest, Shift_type val)
157 //assert (!(val & ~Mask));
158 return (dest & ~Mask) | val;
162 * Set the bits corresponding to `val`.
165 * \param val The value to set into the bits.
169 static T set(T dest, Bits_type val)
170 { return set_dirty(dest, val & Low_mask); }
173 * Set the bits corresponding to `val`.
176 * \param val The value shifted #Lsb bits to the left that shall be set into
181 static T set_unshifted(T dest, Shift_type val)
182 { return set_unshifted_dirty(dest, val & Mask); }
185 * Get the shifted bits for `val`.
187 * \param val The value to set into the bits.
191 * \pre `val` must not contain more than #Bits bits.
193 * \note This function does not mask `val` to the right number of bits.
195 static T val_dirty(Shift_type val) { return val << Lsb; }
198 * Get the shifted bits for `val`.
200 * \param val The value to set into the bits.
204 static T val(Bits_type val) { return val_dirty(val & Low_mask); }
207 * Get the shifted bits for `val`.
209 * \param val The value shifted #Lsb bits to the left that shall be set into
214 static T val_unshifted(Shift_type val) { return val & Mask; }
228 void set(Bits_type val) { v = Bitfield::set(v, val); }
229 void set_dirty(Bits_type val) { v = Bitfield::set_dirty(v, val); }
230 void set_unshifted(Shift_type val) { v = Bitfield::set_unshifted(v, val); }
231 void set_unshifted_dirty(Shift_type val) { v = Bitfield::set_unshifted_dirty(v, val); }
241 Value &operator = (Bits_type val) { this->set(val); return *this; }
252 Value_unshifted &operator = (Shift_type val) { this->set_unshifted(val); return *this; }