Displaying 2 results from an estimated 2 matches for "d81580".
Did you mean:
d81583
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, the `XXXInst` classes in
`llvm/include/l...
2020 Jun 23
2
[RFC] Small Bitfield utilities
...functions:
> - get: unpacks the value from storage,
> - set: packs the provided value and stores it in storage,
> - test: efficiently returns whether the field is non zero.
>
> Now, the three syntaxes:
>
> 1. Current API, purely functional
> code: https://reviews.llvm.org/D81580
>
> uint8_t Storage = 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:...