Just came across this http://stackoverflow.com/questions/9314 ... nce-by-10x. I wasn't aware there was a performance hit with nearly zero numbers.
Are we currently using the optimization? I am unsure if we should or not but though I would post before I forget about it
_MM_SET_FLUSH_ZERO_MODE
- Zonder
- Ogre Magi
- Posts: 1168
- Joined: Mon Aug 04, 2008 7:51 pm
- Location: Manchester - England
- x 73
_MM_SET_FLUSH_ZERO_MODE
There are 10 types of people in the world: Those who understand binary, and those who don't...
-
- Orc Shaman
- Posts: 788
- Joined: Mon Jan 18, 2010 6:06 pm
- Location: Costa Mesa, California
- x 24
Re: _MM_SET_FLUSH_ZERO_MODE
Wow. i never knew this existed either. does anyone with more knowledge have a better response to zonder?
- dark_sylinc
- OGRE Team Member
- Posts: 5299
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1280
- Contact:
Re: _MM_SET_FLUSH_ZERO_MODE
Hi, like the link says, denormals are actually very rare, so statistically they don't impact framerate (unless you're doing something extremely wrong or prone to denormals that forces to hit denormals too often per frame).
This specific test bench shows because it keeps dividing by the same number 9000000 times. This is not a realistic scenario.
We can't set the flush mode because it's a thread-wide operation, making it a bold move if the user linking against Ogre expects denormals to behave as denormals.
If you don't care for denormals becoming zero (which is common for most games) set the flush to zero mode at the beginning of each thread you spawn in your own program.
I suggest you read the great Floating Point article series from Bruce Dawson for more information.
This specific test bench shows because it keeps dividing by the same number 9000000 times. This is not a realistic scenario.
We can't set the flush mode because it's a thread-wide operation, making it a bold move if the user linking against Ogre expects denormals to behave as denormals.
If you don't care for denormals becoming zero (which is common for most games) set the flush to zero mode at the beginning of each thread you spawn in your own program.
I suggest you read the great Floating Point article series from Bruce Dawson for more information.