If you need to reverse bits, FLEXIO module already has several registers that do it automatically. You write it to one register and can read it from a few others that have different bit flippings... This was very handy for my transputer project where I have to reverse 32bits constantly. FYI.
Code:
// Use FLEXIO3 aliased buffers to flip bits for free :)
// (IMXRT_FLEXIO3_ADDRESS = 4202_0000h)
FLEXIO3_SHIFTBUF0 = x; // d[31:0] 200h + (a * 4h)
x = FLEXIO3_SHIFTBUFBIS0; // returns d[0:31] 280h + (a * 4h)