-
July 16th, 2016, 09:53 AM
#1
Flexible, portable, performant structures of bit fields in C++
I've written a header file (bitfield.h) that provides structures of bit fields as a template/macro library:
https://github.com/wkaras/C-plus-plu...ary-bit-fields.
It is more portable and flexible, and has comparable performance to the bit field feature of the base language. At least, the code optimization looks good using gcc, I'm not able to check with VC++. For example, to xor 33 into a bitfield:
BITF(My_descriptor, my_target, sub_struct.some_field) ^= 33;
It's possible to directly access bit fields in device registers, including device registers accessed using inp/outp. This works even when device registers are accessed indirectly, via a register address and read/write buffer combo.
Similar Threads
-
By Niclo Iste in forum Windows XP
Replies: 8
Last Post: March 5th, 2008, 01:01 PM
-
By TripleRLtd in forum Tech Lounge & Tales
Replies: 4
Last Post: December 9th, 2005, 12:07 PM
-
By Laptop_problem in forum BIOS/Motherboard Drivers
Replies: 3
Last Post: January 17th, 2005, 01:35 AM
-
By TrackMan in forum Tech-To-Tech
Replies: 3
Last Post: December 14th, 2001, 10:20 AM
-
By rblockmon in forum Certification
Replies: 5
Last Post: February 22nd, 2001, 10:11 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks