@triton.jit
def _floor_log2(x):
    """Helper function to efficiently compute floor(log2(x))

    Args:
        x (Tensor): FP32 Input tensor to operate on.

    Returns:
        Tensor: Floor of log2(x).
    """
    FP32_EXP_MASK: tl.constexpr = 2139095040
    FP32_EXP_OFFSET: tl.constexpr = 23
    FP32_EXP_BIAS: tl.constexpr = 127
    x = x.to(tl.int32, bitcast=True) & FP32_EXP_MASK
    x = x >> FP32_EXP_OFFSET
    return (x - FP32_EXP_BIAS).to(tl.float32)
