- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Title says it all.
I know "#pragma optimize("",on/off)", but these turn on/off all optimization per function or per file. I want to control only prec-div option only in a few lines in a function. How can I do it?
"Making a non-optimized function outside" is out of the question.
TIA.
I know "#pragma optimize("",on/off)", but these turn on/off all optimization per function or per file. I want to control only prec-div option only in a few lines in a function. How can I do it?
"Making a non-optimized function outside" is out of the question.
TIA.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ever get a solution to this one? Is it possible to use #pragma optimize or optimization_level in conjunction with an inline or forceinline function to achieve this?
- Rhys
- Rhys
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could use ipo with some functions built with -prec-div and others not. More common, particularly in the last 4 years, when most CPUs have efficient dividers, is to use -prec-div always and write out explicitly where optimizations on divide are wanted:
float tmp = 1/denom;
a *= tmp;
b *= tmp;
float tmp = 1/denom;
a *= tmp;
b *= tmp;
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page