Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
math_extras_impl.h File Reference

Inline implementation of functions declared in math_extras.h. More...

#include <zephyr/toolchain.h>

Go to the source code of this file.

Macros

#define use_builtin(x)
 

Functions

static bool u16_add_overflow (uint16_t a, uint16_t b, uint16_t *result)
 
static bool u32_add_overflow (uint32_t a, uint32_t b, uint32_t *result)
 
static bool u64_add_overflow (uint64_t a, uint64_t b, uint64_t *result)
 
static bool size_add_overflow (size_t a, size_t b, size_t *result)
 
static bool u16_mul_overflow (uint16_t a, uint16_t b, uint16_t *result)
 
static bool u32_mul_overflow (uint32_t a, uint32_t b, uint32_t *result)
 
static bool u64_mul_overflow (uint64_t a, uint64_t b, uint64_t *result)
 
static bool size_mul_overflow (size_t a, size_t b, size_t *result)
 
static int u32_count_leading_zeros (uint32_t x)
 
static int u64_count_leading_zeros (uint64_t x)
 
static int u32_count_trailing_zeros (uint32_t x)
 
static int u64_count_trailing_zeros (uint64_t x)
 

Detailed Description

Inline implementation of functions declared in math_extras.h.

Macro Definition Documentation

◆ use_builtin

#define use_builtin ( x)
Value:
#define HAS_BUILTIN(x)
Check if the compiler supports the built-in function x.
Definition toolchain.h:33

Function Documentation

◆ size_add_overflow()

static bool size_add_overflow ( size_t a,
size_t b,
size_t * result )
inlinestatic

◆ size_mul_overflow()

static bool size_mul_overflow ( size_t a,
size_t b,
size_t * result )
inlinestatic

◆ u16_add_overflow()

static bool u16_add_overflow ( uint16_t a,
uint16_t b,
uint16_t * result )
inlinestatic

◆ u16_mul_overflow()

static bool u16_mul_overflow ( uint16_t a,
uint16_t b,
uint16_t * result )
inlinestatic

◆ u32_add_overflow()

static bool u32_add_overflow ( uint32_t a,
uint32_t b,
uint32_t * result )
inlinestatic

◆ u32_count_leading_zeros()

static int u32_count_leading_zeros ( uint32_t x)
inlinestatic

◆ u32_count_trailing_zeros()

static int u32_count_trailing_zeros ( uint32_t x)
inlinestatic

◆ u32_mul_overflow()

static bool u32_mul_overflow ( uint32_t a,
uint32_t b,
uint32_t * result )
inlinestatic

◆ u64_add_overflow()

static bool u64_add_overflow ( uint64_t a,
uint64_t b,
uint64_t * result )
inlinestatic

◆ u64_count_leading_zeros()

static int u64_count_leading_zeros ( uint64_t x)
inlinestatic

◆ u64_count_trailing_zeros()

static int u64_count_trailing_zeros ( uint64_t x)
inlinestatic

◆ u64_mul_overflow()

static bool u64_mul_overflow ( uint64_t a,
uint64_t b,
uint64_t * result )
inlinestatic