[llvm-commits] [PATCH]Implement getHostCPUFeatures for ARM Linux platform

Evan Cheng evan.cheng at apple.com
Mon Dec 10 11:01:42 PST 2012


Nitpick:
+  if (Implementer == "0x41"){ // ARM Ltd.

Please add a space after ')'.

This is a welcome fix. We need auto-detection since some benchmarking efforts do not specify target cpus. However, I can't help but noticing all the features this patch doesn't detect. Is it possible to detect whether the cpu supports v6, v7, thumb2, etc.? Or better yet, is it possible to detect CPU name?

Evan

On Dec 9, 2012, at 6:44 PM, Hao Liu <Hao.Liu at arm.com> wrote:

> Hi,
>  
> Attached is a patch to define getHostCPUFeatures for ARM Linux platform in Host.cpp. Currently the CPU features have default values. The getHostCPUFeatures function do nothing and only return false.
>  
> The implementation is like getHostCPUName for ARM Linux platform in Host.cpp:
> 1)       Read /proc/cpuinfo and get the ‘Features’ line.
> 2)       For each feature which has corresponding feature in LLVM, translate the feature name in /proc/cpuinfo to LLVM feature key name in ARM.td .
> 3)       Add all features to StringMap and set value to true.
> 4)       If success, return true, otherwise return false.
>  
>  
> Thanks,
> -Hao
> <ARMLinuxFeatures.patch>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121210/86028eeb/attachment.html>


More information about the llvm-commits mailing list