79132029

Date: 2024-10-28 04:12:12
Score: 0.5
Natty:
Report link

I'm sure the problem has something to do with the overhead of calling and running a function, but not specifically sure.

However, by reimplementing the ReadBits function as a #define macro the problem is fixed, and the code is just as easy to use. It looks like this:

#define ReadBits(REG, MASK) (((REG) & (MASK)) >> __builtin_ctz(MASK))
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: ezra_vdj