Dummy CPU stress functions.
These functions may be used in test applications to create dummy CPU load. Functions are not highly optimized, as they try to utilize various parts of CPU instruction set (load/store, branch, integer/float arithmetics, vector, etc. instructions).
◆ odph_stress_pow2_u32()
static uint32_t odph_stress_pow2_u32 |
( |
uint32_t |
value | ) |
|
|
inlinestatic |
Returns 'value' raised to the power of 2.
- Parameters
-
- Returns
- The value raised to the power of 2
Definition at line 36 of file stress.h.
◆ odph_stress_log2_u32()
static uint32_t odph_stress_log2_u32 |
( |
uint32_t |
value | ) |
|
|
inlinestatic |
Returns base 2 logarithm of 'value'.
- Parameters
-
value | The value for which the logarithm is being calculated |
- Returns
- Base 2 logarithm of 'value'
Definition at line 54 of file stress.h.
◆ odph_stress_sqrt_u32()
static uint32_t odph_stress_sqrt_u32 |
( |
uint32_t |
value | ) |
|
|
inlinestatic |
Calculates square root of a 32-bit unsigned integer value.
- Parameters
-
value | The value for which the square root is being calculated |
- Returns
- Square root of the value
Definition at line 71 of file stress.h.
◆ odph_stress_sqrt_f32()
static float odph_stress_sqrt_f32 |
( |
float |
value | ) |
|
|
inlinestatic |
Calculates square root of a floating point value, rounded down to the nearest integer.
- Parameters
-
value | The value for which the square root is being calculated |
- Returns
- Square root of the value
Definition at line 156 of file stress.h.