This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

search/search_n vs find/find_if


Hi everyone, hi Chris,

I'm working on the search_n issue (among other things, a dispatcher for random access iterators is neeeded, in order to do proper testing ;) and noticed something weird, in the v7-branch: in the unified implementation we have always local search loops also where, originally, std::find was called (non-predicated versions). Therefore, it looks like we are giving away an optimization (in the non-predicated case) when the iterators are random access. What should we do? Can you see anything wrong with calling find_if, instead? Actually, first blush, I don't understand why find_if was not exploited also in the original HP/SGI code...

By the way, Chris, about the "unrolling by hand" in std::find/std::find_if, which is the current situation, to your best knowledge?? Has -funroll-loops improved to the point that soon we can clean-up that ugliness and obtain well optimized code for a variety of targets?

Paolo.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]