On Mon, Aug 25, 2014 at 6:27 PM, Stephen Gutekanst wrote:
I am writing very small SIMD assembly functions, like Vec32Add, Vec64Add, etc.
There was talk somewhere about a potential change allowing assembly functions to be inlined by the compiler to avoid the overhead of a function call, what ever came of this?
Probably it's me. Sadly, there is no plan to do that, and as the compiler
is being migrating to Go, once that's done, it's probably time to
bought this up again
(although it seems to conflict with the cmd/asm plan and it's quite
hard to do generally)
I can use the CPUID instruction to test whether or not an amd64 CPU supports AVX instructions (like this) -- and I know that all (except one?) amd64 CPU's support SSE2 instructions
i think SSE2 is required for all amd64 cpus. 6g unconditionally uses
SSE2 for floating point computation.
. But how can I choose the right code path efficiently? I could do an if statement but it doesn't seem optimal given that these are such small functions.
Either use function pointer or use conditional jump. I guess
conditional jump is probably easier for
branch predictor to get right than call though a function pointer.

e.g. see hash/crc32 for an example.
Any plans to add vector/SIMD instructions to 6a ? (e.g. vmovupd, vaddpd, etc) I can lay them down using the BYTE pseudo-op but it seems like something that the assembler should eventually have anyway?
There are plans to write a pure Go cmd/asm that could handle *ALL*
supported instructions listed in the
latest Intel manual. Not sure when that will come true though (the
encoding will be parsed directly from
the manual).

You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 8 | next ›
Discussion Overview
groupgolang-nuts @
postedAug 25, '14 at 10:27p
activeAug 30, '14 at 11:39a



site design / logo © 2022 Grokbase