Skip to content

Comparison of different methods to reverse bits in byte in C

License

Notifications You must be signed in to change notification settings

avegner/byte-reverse-bench

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Byte Reverse Bench

This is a benchmark comparing different methods of bits reverse in byte in C.

Methods

There are several implemented methods to reverse bits:

  • simple loop over all bits
  • bitfields and union
  • swapping
  • small (reduced) lookup table
  • big (full) lookup table
  • magic with constants
  • clang's builtin method

How to Run

Benchmark measures run times of implementations built by GCC and Clang for every optimization level (Os, O0-O3).

To run:

  • install GCC, Clang, Make
  • run run.sh script

About

Comparison of different methods to reverse bits in byte in C

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published