metabrush/brush-strokes/cbits/rounding.c

10 lines
319 B
C
Raw Permalink Normal View History

2024-08-28 22:26:19 +00:00
#include <xmmintrin.h>
// Function to set the CSR rounding mode for SSE operations
void set_sse_rounding_mode(unsigned int rounding_mode) {
unsigned int csr = _mm_getcsr();
csr &= ~_MM_ROUND_MASK; // Clear existing rounding mode bits
csr |= rounding_mode; // Set new rounding mode
_mm_setcsr(csr);
}