Helper Reference Manual  1.7.1
ODPH STRESS

API Description

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).

Functions

static uint32_t odph_stress_pow2_u32 (uint32_t value)
 Returns 'value' raised to the power of 2. More...
 
static uint32_t odph_stress_log2_u32 (uint32_t value)
 Returns base 2 logarithm of 'value'. More...
 
static uint32_t odph_stress_sqrt_u32 (uint32_t value)
 Calculates square root of a 32-bit unsigned integer value. More...
 
static float odph_stress_sqrt_f32 (float value)
 Calculates square root of a floating point value, rounded down to the nearest integer. More...
 

Function Documentation

◆ odph_stress_pow2_u32()

static uint32_t odph_stress_pow2_u32 ( uint32_t  value)
inlinestatic

Returns 'value' raised to the power of 2.

Parameters
valueBase value
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
valueThe 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
valueThe 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
valueThe value for which the square root is being calculated
Returns
Square root of the value

Definition at line 156 of file stress.h.