Re: [PATCH 1/2] lib: int_sqrt: add int64_sqrt routine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 24 Jun 2014 08:15:55 +0200 (CEST) Peter Meerwald <pmeerw@xxxxxxxxxx> wrote:

> > > maybe the code could be #MACRO()'d to avoid duplication
> > 
> > Do you mean to define int64_sqrt() directly as int_sqrt() on a 64 bit 
> > platform where sizeof(long) == sizeof(long long)?
> 
> something along the lines of
> 
> #define INT_SQRT(name, type) \
>    type name(type x) \ 
>       type m, y = 0, b; \
> ...
> 
> INT_SQRT(int_sqrt, unsigned long);
> INT_SQRT(int64_sqrt, unsigned long long);
> 
> not sure if it is worth it

We have made smaller optimisations in the past ;)

But not a macro, please:

#ifdef CONFIG_64BIT
static inline unsigned long long int64_sqrt(unsigned long long x)
{
	return int_sqrt(x);
}
#else
unsigned long long int64_sqrt(unsigned long long x);
#endif


--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux