Add helper functions for 32 and 64 bit unsigned to signed integers
conversions.
Details
Details
- Reviewers
mw wma manu - Commits
- rGefa5d3831b0f: sys/libkern.h: Add type conversion helpers
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
I would prefer shorter names. signed_extend32 is really unwieldy. Also, the name does not really explain that the operation is really about extracting from bitfields.
How about mirroring the ARM instructions these are based on? I.e. sbfx32 and sbfx64.
Comment Actions
Change function's names to more self-descriptive, reflecting followed ARM instructions behavior.
Comment Actions
I like the idea but would reduce it to sextract32 and sextract64. Or just leave the underscore out. Alternative: extractl and extractll (with corresponding unsigned functions extractul and extractull).
Comment Actions
I agree with @manu These functions are going to be used extremely rarely and imo the more meaningful name the better.