Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / usr / src / linux-headers-3.13.0-24 / include / linux / | server ip : 172.67.156.115 your ip : 172.69.7.177 H O M E |
Filename | /usr/src/linux-headers-3.13.0-24/include/linux/reciprocal_div.h |
Size | 846 |
Permission | rw-r--r-- |
Owner | root : root |
Create time | 27-Apr-2025 09:50 |
Last modified | 20-Jan-2014 10:40 |
Last accessed | 06-Jul-2025 05:50 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
#ifndef _LINUX_RECIPROCAL_DIV_H
#define _LINUX_RECIPROCAL_DIV_H
#include <linux/types.h>
/*
* This file describes reciprocical division.
*
* This optimizes the (A/B) problem, when A and B are two u32
* and B is a known value (but not known at compile time)
*
* The math principle used is :
* Let RECIPROCAL_VALUE(B) be (((1LL << 32) + (B - 1))/ B)
* Then A / B = (u32)(((u64)(A) * (R)) >> 32)
*
* This replaces a divide by a multiply (and a shift), and
* is generally less expensive in CPU cycles.
*/
/*
* Computes the reciprocal value (R) for the value B of the divisor.
* Should not be called before each reciprocal_divide(),
* or else the performance is slower than a normal divide.
*/
extern u32 reciprocal_value(u32 B);
static inline u32 reciprocal_divide(u32 A, u32 R)
{
return (u32)(((u64)A * R) >> 32);
}
#endif
#define _LINUX_RECIPROCAL_DIV_H
#include <linux/types.h>
/*
* This file describes reciprocical division.
*
* This optimizes the (A/B) problem, when A and B are two u32
* and B is a known value (but not known at compile time)
*
* The math principle used is :
* Let RECIPROCAL_VALUE(B) be (((1LL << 32) + (B - 1))/ B)
* Then A / B = (u32)(((u64)(A) * (R)) >> 32)
*
* This replaces a divide by a multiply (and a shift), and
* is generally less expensive in CPU cycles.
*/
/*
* Computes the reciprocal value (R) for the value B of the divisor.
* Should not be called before each reciprocal_divide(),
* or else the performance is slower than a normal divide.
*/
extern u32 reciprocal_value(u32 B);
static inline u32 reciprocal_divide(u32 A, u32 R)
{
return (u32)(((u64)A * R) >> 32);
}
#endif