Use of IsProcessorFeaturePresent() to detect specialized hardware

I came across a bug report (FDBK26623) that mentioned the removal of compiler switches to enable intrinsics. I thought I'd follow up.

You can use the IsProcessorFeaturePresent() API to determine the architecture or the existence of specialized hardware, such as DSP. e.g. IsProcessorFeaturePresent( PF_ARM_DSP ). This allows an executable to take code paths on the condition of this call.

In response to the original bug report, the problem with preventing the use of certain intrinsics during compilation is that: 1. it doesn't prevent the symptom from occuring (you can still run the executable on incompatible hardware), 2. it is not ideal in scenarios where you want to be able to run a single build on multiple hardware, and 3. it complicates the compiler switch set (which for Microsoft adds more test dimensions.)

With OEMs spinning out variations of devices that are not all the same, you lose a clean mapping from platforms (e.g. "SmartPhone 2003") to actual devices. IsProcessorFeaturePresent() is the best route for maximum compatibility.

Brian

[1074 byte] By [Brian_Kramer] at [2008-2-25]
# 1
Thanks for this information Brian.
Amit
AmitChopra at 2007-9-9 > top of Msdn Tech,Smart Device Development,Smart Devices Native C++ Development...