$darkmode
Suckless OGL 1.0.0
A lean, high-performance C11 PBR Renderer
simd_utils.h File Reference
#include <stddef.h>
#include <stdint.h>
Include dependency graph for simd_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void convert_float_to_half_simd (const float *src, uint16_t *dst, size_t count)
 Converts an array of 32-bit floats to 16-bit half-floats using SIMD (AVX2/F16C). More...
 

Function Documentation

◆ convert_float_to_half_simd()

void convert_float_to_half_simd ( const float *  src,
uint16_t *  dst,
size_t  count 
)

Converts an array of 32-bit floats to 16-bit half-floats using SIMD (AVX2/F16C).

This function utilizes hardware acceleration to perform the conversion significantly faster than a scalar implementation. It falls back to a scalar loop for the remaining elements (tail) or if SIMD is completely unavailable at compile time.

Parameters
srcPointer to the source array of floats.
dstPointer to the destination array of half-floats (uint16_t storage).
countNumber of elements to convert.
Here is the call graph for this function: