A
A
Alexander2015-10-03 13:51:12
C++ / C#
Alexander, 2015-10-03 13:51:12

How to reverse bit fields under x86?

Can you please tell me how can I make the gcc compiler under x86 consider the uppermost bit field in the structure as the high bit, and not the low bit? Conditional compilation is not suitable, because there are a lot of structures with bit fields! An internet search revealed that there was an option to reverse bitfields, but for gcc < 4 versions.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Mirilaczvili, 2015-10-04
@2ord

Change byte order (endianness)
MSB->LSB
LSB->MSB
?
1. There is an x86 machine instruction for changing the order of bytes in a word: bswap
2. Best Algorithm for Bit Reversal

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question