FAQ
Hi,

I'm trying to use simd instructions in asm go files to optimize some code.
I'm using *_amd64.s files and the common instructions work fine, but not
those on xmm registers.
For example

APUNPCKLBW X0, X15
APUNPCKLBW (AX), X0
or
APACKUSWB X2, X0 which returns "syntax error, last name: X2"

I've looked briefly at http://golang.org/src/cmd/6l/optab.c and those seems
to be defined, and seem to map to punpcklbw and packuswb respectively.
Those should be able to take to xmm registers as arguments.

Am i missing something or should I revert to *write* the bytecode directly
for those ?
Something like
#define PSHUFD_X0_X3_ BYTE $0x66; BYTE $0x0f; BYTE $0x70; BYTE $0xd8
as seen in http://golang.org/src/pkg/crypto/aes/asm_amd64.s
I'd like to avoid this because it would force me to reinvent the wheel.

--
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/groups/opt_out.

Search Discussions

  • Anthony Martin at Feb 9, 2014 at 5:47 pm

    Benoît Amiaux once said:
    APUNPCKLBW X0, X15
    APUNPCKLBW (AX), X0
    or
    APACKUSWB X2, X0 which returns "syntax error, last name: X2"
    Remove the leading "A" from the instruction names.

       Anthony

    --
    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/groups/opt_out.
  • Benoît Amiaux at Feb 9, 2014 at 6:26 pm
    Huh, why didn't I think of that ? :D

    On Sun, Feb 9, 2014 at 6:42 PM, Anthony Martin wrote:

    Benoît Amiaux <benoit.amiaux@gmail.com> once said:
    APUNPCKLBW X0, X15
    APUNPCKLBW (AX), X0
    or
    APACKUSWB X2, X0 which returns "syntax error, last name: X2"
    Remove the leading "A" from the instruction names.

    Anthony
    --
    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/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedFeb 9, '14 at 5:08p
activeFeb 9, '14 at 6:26p
posts3
users2
websitegolang.org

2 users in discussion

Benoît Amiaux: 2 posts Anthony Martin: 1 post

People

Translate

site design / logo © 2021 Grokbase