Currently the host's floating-point control register FPC is stored before calling a helper function and restored afterwards. This causes a measurable slowdown when using helper-heavy tools like memcheck. The host FPC seems to be used only for setting the rounding mode before performing a floating-point operation. This is typically done once per SB. I'm not aware of a helper function that changes the rounding mode. Such a behavior would only be acceptable if the helper was explicitly meant to do this, e.g., if it somehow participated in implementing the rounding-mode behavior. If so, keeping the updated FPC value would obviously be preferable. The same applies to the other FPC bits; if they were used and a helper changed them, keeping the updated values would probably be a more useful general approach.
Created attachment 174534 [details] Patch for dropping the FPC save/restore upon helper call
Pushed this as commit 2b635fd318b6920250338cef6af15011b50a03f2.