| 1 |
# Partial-Element Setter |
| 2 |
|
| 3 |
This function inserts a portion of an integer value into a [`PartialElement`]. |
| 4 |
The `BitField` implementations call it as they disassemble a complete integer. |
| 5 |
It performs the following steps: |
| 6 |
|
| 7 |
1. the value is `resize`d into a `T::Mem`, |
| 8 |
1. shifted up from LSedge as needed to fit in the governed region of the partial |
| 9 |
element, |
| 10 |
1. and then stored (after masking away excess bits) through the `PartialElement` |
| 11 |
into memory. |
| 12 |
|
| 13 |
## Type Parameters |
| 14 |
|
| 15 |
- `O` and `T` are the type parameters of the `PartialElement` argument. |
| 16 |
- `U` is the source integer type. |
| 17 |
|
| 18 |
## Parameters |
| 19 |
|
| 20 |
- `elem`: A `PartialElement` into which a value segment will be written. |
| 21 |
- `value`: A value, whose least-significant bits will be written into `elem`. |
| 22 |
- `shamt`: The shift distance from the storage location’s LSedge to its live |
| 23 |
bits. |
| 24 |
|
| 25 |
[`PartialElement`]: crate::domain::PartialElement |