Displaying 2 results from an estimated 2 matches for "d82058".
2020 Jun 23
2
[RFC] Small Bitfield utilities
...age = 0;
> using Amount = Bitfield<unsigned, 0, 4>;
>
> setField<Amount>(Storage, true);
> unsigned Value = getField<Amount>(Storage);
> bool Cond = testField<Amount>(Storage);
>
> 2. A more Object Oriented API
> code: https://reviews.llvm.org/D82058
>
> uint8_t Storage = 0;
> using Amount = Bitfield<unsigned, 0, 4>;
>
> bitfield<Amount>(Storage) = true;
> unsigned Value = bitfield<Amount>(Storage);
> bool Cond = bitfield<Amount>(Storage).isSet();
>
> 3. In between
> code: https://...
2020 Jun 11
2
[RFC] Small Bitfield utilities
TL;DR: Have support in ADT for typed values packing into opaque scalar types
- Code & design choices: https://reviews.llvm.org/D81580
- Usage:
https://reviews.llvm.org/differential/changeset/?ref=2005337&whitespace=ignore-most
- Example of rewrite: https://reviews.llvm.org/D81662
*CONTEXT*
There are places in LLVM where we need to pack typed fields into opaque
values.
For instance,