<div><br><div class="gmail_quote"><div dir="auto">On Sat, Oct 14, 2017 at 11:46 AM Paul Barker &lt;<a href="mailto:pbarker@toganlabs.com">pbarker@toganlabs.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sat, Oct 14, 2017 at 2:22 AM, Khem Raj &lt;<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>&gt; wrote:<br>
&gt; On Fri, Oct 13, 2017 at 12:25 PM, Paul Barker &lt;<a href="mailto:pbarker@toganlabs.com" target="_blank">pbarker@toganlabs.com</a>&gt; wrote:<br>
&gt;&gt; These variables are used to control the floating-point instructions emitted by<br>
&gt;&gt; the go compiler for x86 architectures.<br>
&gt;&gt;<br>
&gt;&gt; The default is &#39;387&#39; which disables the use of sse/sse2 instructions and is safe<br>
&gt;&gt; to use on all x86 processors from the i486 onwards.<br>
&gt;&gt;<br>
&gt;&gt; If TUNE_FEATURES contains a feature set which is known to support sse/sse2<br>
&gt;&gt; instructions then they are set to &#39;sse2&#39; to enable the use of these<br>
&gt;&gt; instructions. This is suitable for most processors from Pentium 4 onwards.<br>
&gt;&gt;<br>
&gt;&gt; Only the &#39;core2&#39; and &#39;corei7&#39; TUNE_FEATURES are defined in the oe-core layer and<br>
&gt;&gt; are known to support ss2 instructions. Other layers may introduce additional<br>
&gt;&gt; tunings which support sse2 instructions and for these layers, TARGET_GO386<br>
&gt;&gt; or go_map_386 should be overridden as needed.<br>
&gt;&gt;<br>
&gt;&gt; Signed-off-by: Paul Barker &lt;<a href="mailto:pbarker@toganlabs.com" target="_blank">pbarker@toganlabs.com</a>&gt;<br>
&gt;&gt; ---<br>
&gt;&gt;  meta/classes/goarch.bbclass | 11 +++++++++++<br>
&gt;&gt;  1 file changed, 11 insertions(+)<br>
&gt;&gt;<br>
&gt;&gt; diff --git a/meta/classes/goarch.bbclass b/meta/classes/goarch.bbclass<br>
&gt;&gt; index 659b26a..653f035 100644<br>
&gt;&gt; --- a/meta/classes/goarch.bbclass<br>
&gt;&gt; +++ b/meta/classes/goarch.bbclass<br>
&gt;&gt; @@ -4,10 +4,12 @@ BUILD_GOTUPLE = &quot;${BUILD_GOOS}_${BUILD_GOARCH}&quot;<br>
&gt;&gt;  HOST_GOOS = &quot;${@go_map_os(d.getVar(&#39;HOST_OS&#39;), d)}&quot;<br>
&gt;&gt;  HOST_GOARCH = &quot;${@go_map_arch(d.getVar(&#39;HOST_ARCH&#39;), d)}&quot;<br>
&gt;&gt;  HOST_GOARM = &quot;${@go_map_arm(d.getVar(&#39;HOST_ARCH&#39;), d.getVar(&#39;TUNE_FEATURES&#39;), d)}&quot;<br>
&gt;&gt; +HOST_GO386 = &quot;${@go_map_386(d.getVar(&#39;HOST_ARCH&#39;), d.getVar(&#39;TUNE_FEATURES&#39;), d)}&quot;<br>
&gt;&gt;  HOST_GOTUPLE = &quot;${HOST_GOOS}_${HOST_GOARCH}&quot;<br>
&gt;&gt;  TARGET_GOOS = &quot;${@go_map_os(d.getVar(&#39;TARGET_OS&#39;), d)}&quot;<br>
&gt;&gt;  TARGET_GOARCH = &quot;${@go_map_arch(d.getVar(&#39;TARGET_ARCH&#39;), d)}&quot;<br>
&gt;&gt;  TARGET_GOARM = &quot;${@go_map_arm(d.getVar(&#39;TARGET_ARCH&#39;), d.getVar(&#39;TUNE_FEATURES&#39;), d)}&quot;<br>
&gt;&gt; +TARGET_GO386 = &quot;${@go_map_386(d.getVar(&#39;TARGET_ARCH&#39;), d.getVar(&#39;TUNE_FEATURES&#39;), d)}&quot;<br>
&gt;&gt;  TARGET_GOTUPLE = &quot;${TARGET_GOOS}_${TARGET_GOARCH}&quot;<br>
&gt;&gt;  GO_BUILD_BINDIR = &quot;${@[&#39;bin/${HOST_GOTUPLE}&#39;,&#39;bin&#39;][d.getVar(&#39;BUILD_GOTUPLE&#39;) == d.getVar(&#39;HOST_GOTUPLE&#39;)]}&quot;<br>
&gt;&gt;<br>
&gt;&gt; @@ -66,6 +68,15 @@ def go_map_arm(a, f, d):<br>
&gt;&gt;              return &#39;5&#39;<br>
&gt;&gt;      return &#39;&#39;<br>
&gt;&gt;<br>
&gt;&gt; +def go_map_386(a, f, d):<br>
&gt;&gt; +    import re<br>
&gt;&gt; +    if re.match(&#39;i.86&#39;, a):<br>
&gt;&gt; +        if (&#39;core2&#39; in f) or (&#39;corei7&#39; in f):<br>
&gt;&gt; +            return &#39;sse2&#39;<br>
&gt;&gt; +        else:<br>
&gt;&gt; +            return &#39;387&#39;<br>
&gt;&gt; +    return &#39;&#39;<br>
&gt;&gt; +<br>
&gt;<br>
&gt;<br>
&gt; This is too conservative IMO, e.g. anything above i586 is able to handle sse2<br>
&gt; with this patch i686 will use x87 for FPU,<br>
&gt;<br>
<br>
The Go documentation says &quot;Pentium 4/Opteron/Athlon 64 or later&quot;</blockquote><div dir="auto"><br></div><div dir="auto">Ok if it needs p4 then lets keep it so</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
(<a href="https://golang.org/doc/install/source" rel="noreferrer" target="_blank">https://golang.org/doc/install/source</a>). GCC documentation also<br>
suggests that i686 is too early to support SSE2:<br>
<a href="https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html#x86-Options" rel="noreferrer" target="_blank">https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html#x86-Options</a>. So I<br>
think i686 should be using the old-style FPU instructions.<br>
<br>
Cheers,<br>
<br>
--<br>
Paul Barker<br>
Togán Labs Ltd<br>
</blockquote></div></div>