<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"><base href="x-msg://227/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I didn't see your new patch. But given the original patch only has a minor format issue it's ok to go in.<div><br></div><div>Evan</div><div><br><div><div>On Dec 11, 2012, at 5:39 PM, Hao Liu <<a href="mailto:Hao.Liu@arm.com">Hao.Liu@arm.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="ZH-CN" link="blue" vlink="purple" style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div class="WordSection1" style="page: WordSection1; "><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Is it OK to commit this patch?<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">As it’s my first time to do something about LLVM, I need to be more careful.<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Thanks,<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">-Hao<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span></div><div><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(181, 196, 223); padding: 3pt 0cm 0cm; "><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><b><span lang="EN-US" style="font-size: 10pt; font-family: Tahoma, sans-serif; ">From:</span></b><span lang="EN-US" style="font-size: 10pt; font-family: Tahoma, sans-serif; "><span class="Apple-converted-space"> </span><a href="mailto:llvm-commits-bounces@cs.uiuc.edu" style="color: purple; text-decoration: underline; ">llvm-commits-bounces@cs.uiuc.edu</a><span class="Apple-converted-space"> </span>[mailto:llvm-<a href="mailto:commits-bounces@cs.uiuc.edu" style="color: purple; text-decoration: underline; ">commits-bounces@cs.uiuc.edu</a>]<span class="Apple-converted-space"> </span><b>On Behalf Of<span class="Apple-converted-space"> </span></b>Hao Liu<br><b>Sent:</b><span class="Apple-converted-space"> </span>2012</span><span style="font-size: 10pt; font-family: 宋体; ">年</span><span lang="EN-US" style="font-size: 10pt; font-family: Tahoma, sans-serif; ">12</span><span style="font-size: 10pt; font-family: 宋体; ">月</span><span lang="EN-US" style="font-size: 10pt; font-family: Tahoma, sans-serif; ">11</span><span style="font-size: 10pt; font-family: 宋体; ">日</span><span lang="EN-US" style="font-size: 10pt; font-family: Tahoma, sans-serif; "><span class="Apple-converted-space"> </span>10:15<br><b>To:</b><span class="Apple-converted-space"> </span>'Evan Cheng'<br><b>Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:llvm-commits@cs.uiuc.edu" style="color: purple; text-decoration: underline; ">llvm-commits@cs.uiuc.edu</a><br><b>Subject:</b><span class="Apple-converted-space"> </span>Re: [llvm-commits] [PATCH]Implement getHostCPUFeatures for ARM Linux platform<o:p></o:p></span></div></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US"> </span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Hi,<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Attached is the new reformatted patch.<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">I need to descript why this patch for getHostCPUFeatures is needed and why can’t detect all the features:<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 18pt; text-indent: -18pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><span>1)<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman'; ">      <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">A function getHostCPUName already exists in Host.cpp, it can detect CPU name. The getHostCPUFeatures is also defined in Host.cpp but it is default to do nothing.<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 18pt; text-indent: -18pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><span>2)<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman'; ">      <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">It can’t detect all the features, as /proc/cpuinfo only defines 19 features, which can be found in arch/arm/kernel/setup.c of source code of Linux kernel. LLVM defines it own features for ARM in ARM.td. The features in Linux and features in ARM have differect names, so I map the former to the latter names.<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt 18pt; text-indent: -18pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><span>3)<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-family: 'Times New Roman'; ">      <span class="Apple-converted-space"> </span></span></span></span><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Not all the 19 features in Linux have the corresponding features in LLVM, actually these features we don’t care about or have no use. So I only translate 7 features having corresponding features in LLVM.  As for v6,v7 and thumb2, they are not defined in /pro/cpuinfo, but we can know that information  from CPU name. But some features are optional for a CPU, such as NEON and VFP, it can’t get that information from CPU name, so getHostCPUFeatures is needed.<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Thanks<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">-Hao<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "> </span></div><div><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(181, 196, 223); padding: 3pt 0cm 0cm; "><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><b><span lang="EN-US" style="font-size: 10pt; font-family: Tahoma, sans-serif; ">From:</span></b><span lang="EN-US" style="font-size: 10pt; font-family: Tahoma, sans-serif; "><span class="Apple-converted-space"> </span>Evan Cheng [mailto:evan.cheng@<a href="http://apple.com" style="color: purple; text-decoration: underline; ">apple.com</a>]<span class="Apple-converted-space"> </span><br><b>Sent:</b><span class="Apple-converted-space"> </span>2012</span><span style="font-size: 10pt; font-family: 宋体; ">年</span><span lang="EN-US" style="font-size: 10pt; font-family: Tahoma, sans-serif; ">12</span><span style="font-size: 10pt; font-family: 宋体; ">月</span><span lang="EN-US" style="font-size: 10pt; font-family: Tahoma, sans-serif; ">11</span><span style="font-size: 10pt; font-family: 宋体; ">日</span><span lang="EN-US" style="font-size: 10pt; font-family: Tahoma, sans-serif; "><span class="Apple-converted-space"> </span>3:02<br><b>To:</b><span class="Apple-converted-space"> </span>Hao Liu<br><b>Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:llvm-commits@cs.uiuc.edu" style="color: purple; text-decoration: underline; ">llvm-commits@cs.uiuc.edu</a><br><b>Subject:</b><span class="Apple-converted-space"> </span>Re: [llvm-commits] [PATCH]Implement getHostCPUFeatures for ARM Linux platform<o:p></o:p></span></div></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US"> </span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US">Nitpick:<o:p></o:p></span></div><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US">+  if (Implementer == "0x41"){ // ARM Ltd.<o:p></o:p></span></div></div><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US"> </span></div></div><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US">Please add a space after ')'.<o:p></o:p></span></div></div><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US"> </span></div></div><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US">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?<o:p></o:p></span></div></div><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US"> </span></div></div><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US">Evan<o:p></o:p></span></div></div><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US"> </span></div><div><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US">On Dec 9, 2012, at 6:44 PM, Hao Liu <<a href="mailto:Hao.Liu@arm.com" style="color: purple; text-decoration: underline; ">Hao.Liu@arm.com</a>> wrote:<o:p></o:p></span></div></div><p class="MsoNormal" style="margin: 0cm 0cm 12pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US"> </span></p><div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; text-align: justify; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; ">Hi,<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; text-align: justify; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; "> <o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; text-align: justify; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; ">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.<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; text-align: justify; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; "> <o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; text-align: justify; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; ">The implementation is like getHostCPUName for ARM Linux platform in Host.cpp:<o:p></o:p></span></div><div style="margin-left: 18pt; "><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; text-align: justify; text-indent: -18pt; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; ">1)</span><span lang="EN-US" style="font-size: 7pt; ">      <span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; ">Read /proc/cpuinfo and get the ‘Features’ line.<o:p></o:p></span></div></div><div style="margin-left: 18pt; "><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; text-align: justify; text-indent: -18pt; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; ">2)</span><span lang="EN-US" style="font-size: 7pt; ">      <span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; ">For each feature which has corresponding feature in LLVM, translate the feature name in /proc/cpuinfo to LLVM feature key name in ARM.td .<o:p></o:p></span></div></div><div style="margin-left: 18pt; "><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; text-align: justify; text-indent: -18pt; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; ">3)</span><span lang="EN-US" style="font-size: 7pt; ">      <span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; ">Add all features to StringMap and set value to true.<o:p></o:p></span></div></div><div style="margin-left: 18pt; "><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; text-align: justify; text-indent: -18pt; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; ">4)</span><span lang="EN-US" style="font-size: 7pt; ">      <span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; ">If success, return true, otherwise return false.<o:p></o:p></span></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; text-align: justify; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; "> <o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; text-align: justify; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; "> <o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; text-align: justify; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; ">Thanks,<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; text-align: justify; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; ">-Hao<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US" style="font-size: 13.5pt; font-family: Helvetica, sans-serif; "><ARMLinuxFeatures.patch>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu" style="color: purple; text-decoration: underline; "><span style="color: purple; ">llvm-commits@cs.uiuc.edu</span></a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" style="color: purple; text-decoration: underline; "><span style="color: purple; ">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</span></a><o:p></o:p></span></div></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 'Times New Roman', serif; "><span lang="EN-US"> </span></div></div></div>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu" style="color: purple; text-decoration: underline; ">llvm-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" style="color: purple; text-decoration: underline; ">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br></div></blockquote></div><br></div></body></html>