FAQ
Two quick questions:

-I want to align a label to 16 bytes, is this possible?
-How do I define a data (byte array) in assembly? (I believe using DATA,
though 6a/6l keeps giving errors)

I couldn't find answers in http://plan9.bell-labs.com/sys/doc/asm.html

Fingers crossed for the upcoming assembler doc (finally :)).

--
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

  • R at Nov 8, 2013 at 12:59 pm
    Also, I'm wondering: how do I translate this (clang) line
    lea -0x100(%rsi),%rcx
    into 6a input?

    Folowing "When in doubt" section, I checked gc's objdump, which says
    LEAQ $0xffffff00(SI),CX
    resulting in the cryptic error:
    "syntax error, last name: 0EAQ"

    --
    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.
  • Minux at Nov 8, 2013 at 8:38 pm

    On Fri, Nov 8, 2013 at 7:47 AM, r wrote:

    Two quick questions:

    -I want to align a label to 16 bytes, is this possible?
    you can't control the alignment of a lable, however, TEXT (function)
    entries are aligned to 16-byte boundary
    (this is for both amd64 and 386; for ARM, the function alignment is 4-byte).
    -How do I define a data (byte array) in assembly? (I believe using DATA,
    though 6a/6l keeps giving errors)
    the general format is:
    DATA name(SB)/offset, initialization-data
    followed by GLOBL:
    GLOBL name(SB),$size
    however, if you only want to declare BSS data, just GLOBL suffices.
    (See the asm doc link below for details).
    I couldn't find answers in http://plan9.bell-labs.com/sys/doc/asm.html

    Fingers crossed for the upcoming assembler doc (finally :)).
    You can preview it here: https://codereview.appspot.com/20930043
    On Fri, Nov 8, 2013 at 7:58 AM, r wrote:

    Also, I'm wondering: how do I translate this (clang) line
    lea -0x100(%rsi),%rcx
    into 6a input?

    Folowing "When in doubt" section, I checked gc's objdump, which says
    LEAQ $0xffffff00(SI),CX
    LEAQ -0x100(SI), CX
    (No $ needed.)

    --
    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.
  • R at Nov 11, 2013 at 2:01 pm
    Thanks a bunch!

    So, my understanding is, to align instructions, we must define and call a
    new function.
    How about the alignment of data? Can we define 128-bit or 256-bit aligned
    data (SSE/AVX/AVX2) (512-bit alignment will matter once AVX-512 is out too)
    On Saturday, November 9, 2013 5:38:23 AM UTC+9, minux wrote:


    On Fri, Nov 8, 2013 at 7:47 AM, r <rayneo...@yahoo.com <javascript:>>wrote:
    Two quick questions:

    -I want to align a label to 16 bytes, is this possible?
    you can't control the alignment of a lable, however, TEXT (function)
    entries are aligned to 16-byte boundary
    (this is for both amd64 and 386; for ARM, the function alignment is
    4-byte).
    -How do I define a data (byte array) in assembly? (I believe using DATA,
    though 6a/6l keeps giving errors)
    the general format is:
    DATA name(SB)/offset, initialization-data
    followed by GLOBL:
    GLOBL name(SB),$size
    however, if you only want to declare BSS data, just GLOBL suffices.
    (See the asm doc link below for details).
    I couldn't find answers in http://plan9.bell-labs.com/sys/doc/asm.html

    Fingers crossed for the upcoming assembler doc (finally :)).
    You can preview it here: https://codereview.appspot.com/20930043

    On Fri, Nov 8, 2013 at 7:58 AM, r <rayneo...@yahoo.com <javascript:>>
    wrote:
    Also, I'm wondering: how do I translate this (clang) line
    lea -0x100(%rsi),%rcx
    into 6a input?

    Folowing "When in doubt" section, I checked gc's objdump, which says
    LEAQ $0xffffff00(SI),CX
    LEAQ -0x100(SI), CX
    (No $ needed.)
    --
    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.
  • Minux at Nov 11, 2013 at 2:11 pm

    On Mon, Nov 11, 2013 at 9:01 AM, r wrote:

    So, my understanding is, to align instructions, we must define and call a
    new function.
    Right. Technically, TEXT is just a entry, it could be the start address of
    a function or even some random data.
    How about the alignment of data? Can we define 128-bit or 256-bit aligned
    data (SSE/AVX/AVX2) (512-bit alignment will matter once AVX-512 is out too)
    your best bet is allocate the data dynamically, the runtime will maintain
    the maximum required alignment
    for the allocated data.

    --
    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.
  • R at Nov 11, 2013 at 3:39 pm
    This is a bit deal-breaker for my case. Actually, it is a deal-breaker in
    general, considering that many specialized instructions require 128/256 bit
    alignment, and given that you can't access these instructions from Go,
    having such a support in the assembler at least is a must. In fact, this is
    the first assembler I've ever used that doesn't let you specify alignment.
    I in particular need to have a (global) 128-bit aligned data for use with
    SSE instructions.

    Any chances we can get the assembler(s) fixed so that we can use SSE/AVX
    without performance penalties?
    On Monday, November 11, 2013 11:11:09 PM UTC+9, minux wrote:


    On Mon, Nov 11, 2013 at 9:01 AM, r <rayneo...@yahoo.com <javascript:>>wrote:
    So, my understanding is, to align instructions, we must define and call a
    new function.
    Right. Technically, TEXT is just a entry, it could be the start address of
    a function or even some random data.
    How about the alignment of data? Can we define 128-bit or 256-bit aligned
    data (SSE/AVX/AVX2) (512-bit alignment will matter once AVX-512 is out too)
    your best bet is allocate the data dynamically, the runtime will maintain
    the maximum required alignment
    for the allocated data.
    --
    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.
  • Ian Lance Taylor at Nov 11, 2013 at 4:29 pm

    On Mon, Nov 11, 2013 at 7:39 AM, r wrote:
    Any chances we can get the assembler(s) fixed so that we can use SSE/AVX
    without performance penalties?
    Probably, though I don't know what the best approach would be. Open
    an issue requesting a way to align variables. I think it would be
    good if we do this in Go, too, though that might have to rely on a
    (yet another) magic comment.

    Ian

    --
    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.
  • R at Nov 12, 2013 at 1:18 am
    Thanks, I'll open an issue right away!
    Wow, I never actually hoped to achieve such a thing on Go side as well!
    Just hoping :)
    On Tuesday, November 12, 2013 1:29:32 AM UTC+9, Ian Lance Taylor wrote:

    On Mon, Nov 11, 2013 at 7:39 AM, r <rayneo...@yahoo.com <javascript:>>
    wrote:
    Any chances we can get the assembler(s) fixed so that we can use SSE/AVX
    without performance penalties?
    Probably, though I don't know what the best approach would be. Open
    an issue requesting a way to align variables. I think it would be
    good if we do this in Go, too, though that might have to rely on a
    (yet another) magic comment.

    Ian
    --
    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.
  • R at Nov 12, 2013 at 3:00 am
    Done!
    As always, thanks so much!
    https://code.google.com/p/go/issues/detail?id=6752&thanks=6752&ts=1384225198

    --
    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.
  • Dave Cheney at Nov 11, 2013 at 9:57 pm

    On 12 Nov 2013, at 2:39, r wrote:

    This is a bit deal-breaker for my case.
    How would you do this in (insert other language here)? Please do not condemn Go just because it may continue a common tradition of not proving this feature out of the box.

    Actually, it is a deal-breaker in general, considering that many specialized instructions require 128/256 bit alignment, and given that you can't access these instructions from Go, having such a support in the assembler at least is a must. In fact, this is the first assembler I've ever used that doesn't let you specify alignment.
    I in particular need to have a (global) 128-bit aligned data for use with SSE instructions.

    Any chances we can get the assembler(s) fixed so that we can use SSE/AVX without performance penalties?
    On Monday, November 11, 2013 11:11:09 PM UTC+9, minux wrote:

    On Mon, Nov 11, 2013 at 9:01 AM, r wrote:
    So, my understanding is, to align instructions, we must define and call a new function.
    Right. Technically, TEXT is just a entry, it could be the start address of a function or even some random data.
    How about the alignment of data? Can we define 128-bit or 256-bit aligned data (SSE/AVX/AVX2) (512-bit alignment will matter once AVX-512 is out too)
    your best bet is allocate the data dynamically, the runtime will maintain the maximum required alignment
    for the allocated data.
    --
    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.
    --
    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.
  • R at Nov 12, 2013 at 1:16 am
    I'm sorry if it sounded that way.
    What I refer to is just the Plan 9 assembler however, not Go.

    With language X, I normally use GNU as. I can do that with gccgo, but as it
    is now, it under-performs in our benchmarks and uses much more memory in
    various cases, so I'm stuck with the (legacy?) Plan 9 toolchain (cgo calls
    wash away the gains from assembly routines in many cases).
    I'm hoping that gccgo with takeover someday, but it doesn't look like it's
    going to happen soon.
    On Tuesday, November 12, 2013 6:56:56 AM UTC+9, Dave Cheney wrote:



    On 12 Nov 2013, at 2:39, r <rayneo...@yahoo.com <javascript:>> wrote:

    This is a bit deal-breaker for my case.


    How would you do this in (insert other language here)? Please do not
    condemn Go just because it may continue a common tradition of not proving
    this feature out of the box.


    Actually, it is a deal-breaker in general, considering that many
    specialized instructions require 128/256 bit alignment, and given that you
    can't access these instructions from Go, having such a support in the
    assembler at least is a must. In fact, this is the first assembler I've
    ever used that doesn't let you specify alignment.
    I in particular need to have a (global) 128-bit aligned data for use with
    SSE instructions.

    Any chances we can get the assembler(s) fixed so that we can use SSE/AVX
    without performance penalties?
    On Monday, November 11, 2013 11:11:09 PM UTC+9, minux wrote:

    On Mon, Nov 11, 2013 at 9:01 AM, r wrote:

    So, my understanding is, to align instructions, we must define and call
    a new function.
    Right. Technically, TEXT is just a entry, it could be the start address
    of a function or even some random data.
    How about the alignment of data? Can we define 128-bit or 256-bit
    aligned data (SSE/AVX/AVX2) (512-bit alignment will matter once AVX-512 is
    out too)
    your best bet is allocate the data dynamically, the runtime will maintain
    the maximum required alignment
    for the allocated data.
    --
    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...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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
postedNov 8, '13 at 12:47p
activeNov 12, '13 at 3:00a
posts11
users4
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase