Skip to content
Snippets Groups Projects
Commit 696a24e6 authored by ESCOBAR MUNOZ Juan's avatar ESCOBAR MUNOZ Juan
Browse files

Juan 13/09/2022: add new ARCH_SRC/cray_gu/gu.c , for Automatic Gradual Underflow on CPU (like GPU)

parent 069c950b
No related branches found
No related tags found
No related merge requests found
/*
* Copyright -2022 Hewlett Packard Enterprise Development LP
*/
void __cce_floatingpt_gu( void ); // Gradual Underflow.
static void (*p)(void) __attribute__((section(".init_array"))) = __cce_floatingpt_gu;
#define DENORMS_ARE_ZEROS 6
#define FLUSH_TO_ZERO_MASK 15
void __cce_floatingpt_gu( void )
{
unsigned long gu_src = (1 << DENORMS_ARE_ZEROS);
unsigned long gu_dst = (1 << FLUSH_TO_ZERO_MASK);
do {
unsigned long __mxcsr;
__asm__ volatile("stmxcsr %0" : : "m" (__mxcsr));
__mxcsr &= ~(gu_src | gu_dst);
__asm__ volatile("ldmxcsr %0" : : "m" (__mxcsr));
}
while (0);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment