shr16 function

int shr16(
  1. int x
)

Right-shifts a 32-bit integer by 16 bits and applies a mask to ensure the result fits within 16 bits.

Implementation

int shr16(int x) {
  return (x >> 16) & mask16;
}