<div><br><div class="gmail_quote"><div dir="auto">On Sat, Oct 14, 2017 at 11:46 AM Paul Barker <<a href="mailto:pbarker@toganlabs.com">pbarker@toganlabs.com</a>> 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 <<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>> wrote:<br>
> On Fri, Oct 13, 2017 at 12:25 PM, Paul Barker <<a href="mailto:pbarker@toganlabs.com" target="_blank">pbarker@toganlabs.com</a>> wrote:<br>
>> These variables are used to control the floating-point instructions emitted by<br>
>> the go compiler for x86 architectures.<br>
>><br>
>> The default is '387' which disables the use of sse/sse2 instructions and is safe<br>
>> to use on all x86 processors from the i486 onwards.<br>
>><br>
>> If TUNE_FEATURES contains a feature set which is known to support sse/sse2<br>
>> instructions then they are set to 'sse2' to enable the use of these<br>
>> instructions. This is suitable for most processors from Pentium 4 onwards.<br>
>><br>
>> Only the 'core2' and 'corei7' TUNE_FEATURES are defined in the oe-core layer and<br>
>> are known to support ss2 instructions. Other layers may introduce additional<br>
>> tunings which support sse2 instructions and for these layers, TARGET_GO386<br>
>> or go_map_386 should be overridden as needed.<br>
>><br>
>> Signed-off-by: Paul Barker <<a href="mailto:pbarker@toganlabs.com" target="_blank">pbarker@toganlabs.com</a>><br>
>> ---<br>
>> meta/classes/goarch.bbclass | 11 +++++++++++<br>
>> 1 file changed, 11 insertions(+)<br>
>><br>
>> diff --git a/meta/classes/goarch.bbclass b/meta/classes/goarch.bbclass<br>
>> index 659b26a..653f035 100644<br>
>> --- a/meta/classes/goarch.bbclass<br>
>> +++ b/meta/classes/goarch.bbclass<br>
>> @@ -4,10 +4,12 @@ BUILD_GOTUPLE = "${BUILD_GOOS}_${BUILD_GOARCH}"<br>
>> HOST_GOOS = "${@go_map_os(d.getVar('HOST_OS'), d)}"<br>
>> HOST_GOARCH = "${@go_map_arch(d.getVar('HOST_ARCH'), d)}"<br>
>> HOST_GOARM = "${@go_map_arm(d.getVar('HOST_ARCH'), d.getVar('TUNE_FEATURES'), d)}"<br>
>> +HOST_GO386 = "${@go_map_386(d.getVar('HOST_ARCH'), d.getVar('TUNE_FEATURES'), d)}"<br>
>> HOST_GOTUPLE = "${HOST_GOOS}_${HOST_GOARCH}"<br>
>> TARGET_GOOS = "${@go_map_os(d.getVar('TARGET_OS'), d)}"<br>
>> TARGET_GOARCH = "${@go_map_arch(d.getVar('TARGET_ARCH'), d)}"<br>
>> TARGET_GOARM = "${@go_map_arm(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}"<br>
>> +TARGET_GO386 = "${@go_map_386(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}"<br>
>> TARGET_GOTUPLE = "${TARGET_GOOS}_${TARGET_GOARCH}"<br>
>> GO_BUILD_BINDIR = "${@['bin/${HOST_GOTUPLE}','bin'][d.getVar('BUILD_GOTUPLE') == d.getVar('HOST_GOTUPLE')]}"<br>
>><br>
>> @@ -66,6 +68,15 @@ def go_map_arm(a, f, d):<br>
>> return '5'<br>
>> return ''<br>
>><br>
>> +def go_map_386(a, f, d):<br>
>> + import re<br>
>> + if re.match('i.86', a):<br>
>> + if ('core2' in f) or ('corei7' in f):<br>
>> + return 'sse2'<br>
>> + else:<br>
>> + return '387'<br>
>> + return ''<br>
>> +<br>
><br>
><br>
> This is too conservative IMO, e.g. anything above i586 is able to handle sse2<br>
> with this patch i686 will use x87 for FPU,<br>
><br>
<br>
The Go documentation says "Pentium 4/Opteron/Athlon 64 or later"</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>