<p dir="ltr"></p>
<p dir="ltr">On Mar 27, 2014 8:16 AM, &quot;Mats Kärrman&quot; &lt;<a href="mailto:Mats.Karrman@tritech.se">Mats.Karrman@tritech.se</a>&gt; wrote:<br>
&gt;<br>
&gt; Hi Khem,<br>
&gt;<br>
&gt; On Friday, March 21, 2014 6:06 PM, Khem Raj wrote:<br>
&gt; &gt; On Fri, Mar 21, 2014 at 9:45 AM, Mark Hatle &lt;<a href="mailto:mark.hatle@windriver.com">mark.hatle@windriver.com</a>&gt; wrote:<br>
&gt; &gt;&gt; On 3/21/14, 7:10 AM, Mats Kärrman wrote:<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; Hi,<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; On: Thursday, March 13, 2014 11:36 AM, Mats Kärrman wrote:<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; My &quot;home made&quot; hard float tune for PowerPC looks like this:<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; ------------------------------------------------------------------<br>
&gt; &gt;&gt;&gt;&gt; # Tune for the e300c3 core<br>
&gt; &gt;&gt;&gt;&gt; require conf/machine/include/tune-ppce300c3.inc<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;&gt; # Use hardware floating point<br>
&gt; &gt;&gt;&gt;&gt; AVAILTUNES += &quot;ppce300c3hf&quot;<br>
&gt; &gt;&gt;&gt;&gt; TUNE_FEATURES_tune-ppce300c3hf = &quot;m32 fpu-hard ppce300c3&quot;<br>
&gt; &gt;&gt;&gt;&gt; TUNE_PKGARCH_tune-ppce300c3hf = &quot;ppce300c3hf&quot;<br>
&gt; &gt;&gt;&gt;&gt; PACKAGE_EXTRA_ARCHS_tune-ppce300c3hf =<br>
&gt; &gt;&gt;&gt;&gt; &quot;${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppce300c3hf&quot;<br>
&gt; &gt;&gt;&gt;&gt; DEFAULTTUNE = &quot;ppce300c3hf&quot;<br>
&gt; &gt;&gt;&gt;&gt; ------------------------------------------------------------------<br>
&gt; &gt;&gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; I found the reason for the error (deviance) in the sqrt function. glibc<br>
&gt; &gt;&gt;&gt; has<br>
&gt; &gt;&gt;&gt; special code for PowerPC 603e core (e300 is an optimized variant of 603e).<br>
&gt; &gt;&gt;&gt; By adding the following line to the tuning I now get the same result as<br>
&gt; &gt;&gt;&gt; for all other environments that I&#39;ve tried:<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; GLIBC_EXTRA_OECONF += &quot;${@bb.utils.contains(&quot;TUNE_FEATURES&quot;, &quot;ppce300c3&quot;,<br>
&gt; &gt;&gt;&gt; &quot;-with-cpu=603e&quot;, &quot;&quot;, d)}&quot;<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; Does anyone know about the reason for having soft-float as the default and<br>
&gt; &gt;&gt;&gt; only available alternative for e300c2/3 tunings?<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; My guess is because e300 e300c2 were both soft-float designs.  And e300c3 is<br>
&gt; &gt;&gt; the first hard float design.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; The e300c3 should inherit and use the 603e directly.  This includes<br>
&gt; &gt;&gt; definiting the TUNE_FEATURES that the 603e does.  If it doesn&#39;t do that, I&#39;d<br>
&gt; &gt;&gt; suggest it&#39;s a mistake.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; The default 603e tune should include:<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; GLIBC_EXTRA_OECONF += &quot;${@bb.utils.contains(&quot;TUNE_FEATURES&quot;, &quot;ppc603e&quot;,<br>
&gt; &gt;&gt; &quot;-with-cpu=603e&quot;, &quot;&quot;, d)}&quot;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; or similar already -- and should already be hard float enabled.  (ppc603e<br>
&gt; &gt;&gt; soft-float should be the alternative -- as it is significantly rarer and the<br>
&gt; &gt;&gt; deviation.)<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; alternatively we should define fpu Iplies in glibc for e300c3,<br>
&gt; &gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;&gt; Would it be worthwhile to send a patch to add the hf tuning to OE-core?<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; As the e300c3 should be hard float, we shouldn&#39;t have the &#39;hf&#39; designation.<br>
&gt; &gt;&gt; Otherwise, we should ensure the e300c3 tune is correctly configured.<br>
&gt; &gt;<br>
&gt; &gt; may be for now controlling it in tune file is a quicker fix.<br>
&gt; &gt;<br>
&gt;<br>
&gt; Adding &quot;-with-cpu=603e&quot; to GLIBC_EXTRA_OECONF proved to be problematic<br>
&gt; as it leads to contradictive --mcpu= args to gcc, both &quot;e300c3&quot; and &quot;603e&quot;.<br>
&gt;<br>
&gt; I solved that by using &quot;-with-cpu=e300c3&quot; and by adding a patch to eglibc:<br>
&gt; ------------------------------------------------------------------------------<br>
&gt; --- libc.orig/ports/sysdeps/powerpc/powerpc32/e300c3/fpu/Implies<br>
&gt; +++ libc/ports/sysdeps/powerpc/powerpc32/e300c3/fpu/Implies<br>
&gt; @@ -0,0 +1,2 @@<br>
&gt; +# e300c3 is a variant of 603e so use the same optimizations for sqrt<br>
&gt; +powerpc/powerpc32/603e/fpu</p>
<p dir="ltr">yes thats ok<br></p>
<p dir="ltr">&gt; ------------------------------------------------------------------------------<br>
&gt; Does this seem correct to you?<br>
&gt;<br>
&gt; Initial tests shows that at least the sqrt test now works. The reason<br>
&gt; I&#39;m holding back on patches to the tune file is that I still have trouble<br>
&gt; with time related syscalls, see [1].<br>
&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;&gt; In that case what tests should be performed before that and what (related)<br>
&gt; &gt;&gt;&gt; tests are performed by the OE auto-builder?<br>
&gt;<br>
&gt; BR // Mats<br>
&gt;<br>
&gt; [1] <a href="http://lists.openembedded.org/pipermail/openembedded-core/2014-March/091011.html">http://lists.openembedded.org/pipermail/openembedded-core/2014-March/091011.html</a><br>
&gt;<br>
</p>