Scope of MXCSR control register?

2019-02-16 22:01发布

问题:

I'm wondering what is the lifetime of the value stored in the MXCSR control register (including FTZ and DAZ config for denormal floating-point numbers): is it in the scope of the thread, or is it common for all processing on the CPU/FPU?

What I want to know is if I need to set it (MXCSR) at my needs at the beginning of each thread of a thread pool, or once in the app, or would it impact everything else in the app and/or the system?

Thanks for any help!

回答1:

Yes of course, you must set the MXCSR register at the beginning of each thread. Any thread can have own MXCSR settings, so this is essential feature.