11 #ifndef ODPH_STRESS_H_
12 #define ODPH_STRESS_H_
38 uint64_t v = (uint64_t)value;
41 if (odp_unlikely(res > UINT32_MAX))
58 while ((value >>= 1) != 0)
76 if (odp_unlikely(value == 0 || value == 1))
79 if (value & 0xffff0000) {
80 if (value & 0xff000000) {
81 if (value & 0xf0000000) {
83 if (value & 0xe0000000)
85 if (value & 0xc0000000)
87 if (value & 0x80000000)
92 if (value & 0x0e000000)
94 if (value & 0x0c000000)
96 if (value & 0x08000000)
100 if (value & 0x00f00000) {
102 if (value & 0x00e00000)
104 if (value & 0x00c00000)
106 if (value & 0x00800000)
111 if (value & 0x000e0000)
113 if (value & 0x000c0000)
115 if (value & 0x00080000)
123 if (value >= 16384) {
141 while (pow <= value) {
146 return (uint32_t)(x - 1);
161 if (odp_unlikely(value < 1.0))
164 if (value >= 65536) {
165 if (value >= 16777215) {
166 if (value >= 268435456) {
168 if (value >= 536870912)
170 if (value >= 1073741824)
172 if (value >= 2147483648)
176 if (value >= 33554432)
178 if (value >= 67108864)
180 if (value >= 134217728)
184 if (value >= 1048576) {
186 if (value >= 2097152)
188 if (value >= 4194304)
190 if (value >= 8388608)
205 if (value >= 16384) {
223 while (pow <= value) {
228 return (
float)(x - 1);
static uint32_t odph_stress_log2_u32(uint32_t value)
Returns base 2 logarithm of 'value'.
static float odph_stress_sqrt_f32(float value)
Calculates square root of a floating point value, rounded down to the nearest integer.
static uint32_t odph_stress_pow2_u32(uint32_t value)
Returns 'value' raised to the power of 2.
static uint32_t odph_stress_sqrt_u32(uint32_t value)
Calculates square root of a 32-bit unsigned integer value.