Composite operations on signed long integers for non-i386 architectures. More...
#include <linux/types.h>
Go to the source code of this file.
Defines | |
#define | l_shl_div(num, SHF, den) ((__s32) ((((__s64) ((__s32)(num))) << (SHF)) / ((__s32)(den)))) |
Computes '(num << SHF) / den' as __s32. | |
#define | l_mul_div(x, num, den) ((__s32) (((__s64) ((__s32)(x))) * ((__s32)(num)) / ((__s32)(den)))) |
Computes '(x * num) / den' as __s32 (32 bits). | |
#define | l_mul_shr(x, y, SHF) ((__s32) ((((__s64) ((__s32)(x))) * ((__s32)(y))) >> (SHF))) |
Computes '(x * y) >> SHF' as __s32 (32 bits). |
Composite operations on signed long integers for non-i386 architectures.
Definition in file qos_l_other.h.
#define l_mul_div | ( | x, | |||
num, | |||||
den | ) | ((__s32) (((__s64) ((__s32)(x))) * ((__s32)(num)) / ((__s32)(den)))) |
Computes '(x * num) / den' as __s32 (32 bits).
Computation is carried on with intermediate result (x * num) on 64 bits.
x | an __s32 integer (32 bits) | |
num | an __s32 integer (32 bits) | |
den | an __s32 integer (32 bits) |
Definition at line 55 of file qos_l_other.h.
#define l_mul_shr | ( | x, | |||
y, | |||||
SHF | ) | ((__s32) ((((__s64) ((__s32)(x))) * ((__s32)(y))) >> (SHF))) |
Computes '(x * y) >> SHF' as __s32 (32 bits).
The computation is carried on with intermediate result (x*y) on 64 bits.
This macro is useful for multiplying two integers where one of them represents a real in fixed precision with SHF decimal bits (i.e. 1.0 is represented as 1ul<<SHF).
x | an __s32 integer (32 bits) | |
y | an __s32 integer (32 bits) | |
SHF | a macro which evaluates to an integer within 1 and 31 |
Definition at line 83 of file qos_l_other.h.
#define l_shl_div | ( | num, | |||
SHF, | |||||
den | ) | ((__s32) ((((__s64) ((__s32)(num))) << (SHF)) / ((__s32)(den)))) |
Computes '(num << SHF) / den' as __s32.
Computation is carried on with intermediate result (num << SHF) on 64 bits. This macro is useful for representing the result of the division num/dev as a real in fixed precision with SHF decimal bits (i.e. 1.0 is represented as 1ul<<SHF).
num | an __s32 integer (32 bits) | |
SHF | a macro which evaluates to an integer within 1 and 31 | |
den | an __s32 integer (32 bits) |
Definition at line 30 of file qos_l_other.h.