shithub: femtolisp

ref: d5ae75e18d3fd374910432809f062d5cfea5eb21
dir: /builtins_plan9.c/

View raw version
#include "platform.h"

int
fl_clz(uint32_t x)
{
	uint32_t r;
	if(x == 0)
		return 32;
	for(r = 0; (x & (1UL<<31)) == 0; x <<= 1, r++);
	return r;
}