FAQ
(preface: I don't normally use assembly)
I've got a program that I'm running on an ARM and I'm writing one function
of it in assembly. I've made good progress on this, although I've found it
difficult sometimes to figure out exactly how to write certain instructions
for go's assembler, for example, I didn't expect a right shift to be
written like this:

*MOVW R3>>8, R3*

Now I want to do a multiply and accumulate (MLA), according to this doc
<https://golang.org/doc/asm> not all opcodes are supported, so maybe MLA
isn't, but I don't know how to tell if it is or not. I see mentions of MLA
with regards to ARM in the golang repo, but I'm not really sure what to
make of what I see there.

Is there anywhere that documents what instructions are supported and how to
write them? Can anyone give me any useful pointers?

thanks!

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

  • Rob Pike at Sep 23, 2014 at 5:43 pm
    Short answer: No. It's a mess for which there is no excuse aside from
    history. At least the confusion is portable: it's equivalently fuzzy
    for most modern architectures since its roots lie with the National
    32000.

    -rob

    --
    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.
  • Bakul Shah at Sep 23, 2014 at 5:57 pm

    On Tue, 23 Sep 2014 10:42:30 PDT Rob Pike wrote:
    Short answer: No. It's a mess for which there is no excuse aside from
    history. At least the confusion is portable: it's equivalently fuzzy
    for most modern architectures since its roots lie with the National
    32000.
    Would you care to elaborate? Just curious. Thanks.

    --
    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.
  • Rob Pike at Sep 23, 2014 at 6:43 pm
    Nothing to elaborate. The assembler was first written for the National
    32000 and is largely unchanged since, including instruction syntax and
    to a large extent instruction names. It's not a proper assembler, only
    a way to generate the startup object files necessary to get the binary
    running, and is neither clean, complete, nor documented.

    None of that is excusable, only true.

    People have added bits (literally) and pieces since, but it's entirely
    as-needed and uncontrolled.

    -rob

    On Tue, Sep 23, 2014 at 10:57 AM, Bakul Shah wrote:
    On Tue, 23 Sep 2014 10:42:30 PDT Rob Pike wrote:
    Short answer: No. It's a mess for which there is no excuse aside from
    history. At least the confusion is portable: it's equivalently fuzzy
    for most modern architectures since its roots lie with the National
    32000.
    Would you care to elaborate? Just curious. Thanks.
    --
    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.
  • Nick Craig-Wood at Sep 23, 2014 at 8:58 pm

    On 23/09/14 17:46, Running Wild wrote:
    (preface: I don't normally use assembly)
    I've got a program that I'm running on an ARM and I'm writing one
    function of it in assembly. I've made good progress on this, although
    I've found it difficult sometimes to figure out exactly how to write
    certain instructions for go's assembler, for example, I didn't expect a
    right shift to be written like this:
    *
    *
    *MOVW R3>>8, R3*

    Now I want to do a multiply and accumulate (MLA), according to this doc
    <https://golang.org/doc/asm> not all opcodes are supported, so maybe MLA
    isn't, but I don't know how to tell if it is or not. I see mentions of
    MLA with regards to ARM in the golang repo, but I'm not really sure what
    to make of what I see there.

    Is there anywhere that documents what instructions are supported and how
    to write them? Can anyone give me any useful pointers?
    Here is a rather scrappy doc I wrote on how to write ARM assembler in
    Go. (I should really tidy it up, but perhaps it will be useful as is!)

    https://docs.google.com/document/d/1JrxVxcG2JYPO-hTfIV-ZPwvnDetFiKElTj3BIEbHpO8/pub

    I wrote it from the perspective of someone who knows ARM assembler but
    doesn't know how ARM assembler in Go works.


    --
    Nick Craig-Wood <nick@craig-wood.com> -- http://www.craig-wood.com/nick

    --
    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.
  • Jonathan Wills at Sep 24, 2014 at 4:26 am
    Thanks Nick! That was very helpful, I read up on that and some of the
    links therein and finally found what I needed (and more!)

    This was what I needed for MLA R8 := R8 + R4 * R4

    * WORD $0xe0288494;*

    And it came with a pretty solid speedup as well :)

    -Jonathan
    On Tue, Sep 23, 2014 at 1:58 PM, Nick Craig-Wood wrote:
    On 23/09/14 17:46, Running Wild wrote:
    (preface: I don't normally use assembly)
    I've got a program that I'm running on an ARM and I'm writing one
    function of it in assembly. I've made good progress on this, although
    I've found it difficult sometimes to figure out exactly how to write
    certain instructions for go's assembler, for example, I didn't expect a
    right shift to be written like this:
    *
    *
    *MOVW R3>>8, R3*

    Now I want to do a multiply and accumulate (MLA), according to this doc
    <https://golang.org/doc/asm> not all opcodes are supported, so maybe MLA
    isn't, but I don't know how to tell if it is or not. I see mentions of
    MLA with regards to ARM in the golang repo, but I'm not really sure what
    to make of what I see there.

    Is there anywhere that documents what instructions are supported and how
    to write them? Can anyone give me any useful pointers?
    Here is a rather scrappy doc I wrote on how to write ARM assembler in
    Go. (I should really tidy it up, but perhaps it will be useful as is!)


    https://docs.google.com/document/d/1JrxVxcG2JYPO-hTfIV-ZPwvnDetFiKElTj3BIEbHpO8/pub

    I wrote it from the perspective of someone who knows ARM assembler but
    doesn't know how ARM assembler in Go works.


    --
    Nick Craig-Wood <nick@craig-wood.com> -- http://www.craig-wood.com/nick
    --
    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.
  • Nick Craig-Wood at Sep 24, 2014 at 9:17 am
    Glad that was helpful. I should have probably said that when I want to
    find out what exactly the assembler supports I end up looking through
    the assembler source which is reasonably accessible!
    On 24/09/14 05:26, Jonathan Wills wrote:
    Thanks Nick! That was very helpful, I read up on that and some of the
    links therein and finally found what I needed (and more!)

    This was what I needed for MLA R8 := R8 + R4 * R4
    *
    *
    * WORD $0xe0288494;*

    And it came with a pretty solid speedup as well :)

    -Jonathan

    On Tue, Sep 23, 2014 at 1:58 PM, Nick Craig-Wood wrote:
    On 23/09/14 17:46, Running Wild wrote:
    (preface: I don't normally use assembly)
    I've got a program that I'm running on an ARM and I'm writing one
    function of it in assembly. I've made good progress on this, although
    I've found it difficult sometimes to figure out exactly how to write
    certain instructions for go's assembler, for example, I didn't expect a
    right shift to be written like this:
    *
    *
    *MOVW R3>>8, R3*

    Now I want to do a multiply and accumulate (MLA), according to this doc
    <https://golang.org/doc/asm> not all opcodes are supported, so maybe MLA
    isn't, but I don't know how to tell if it is or not. I see mentions of
    MLA with regards to ARM in the golang repo, but I'm not really sure what
    to make of what I see there.

    Is there anywhere that documents what instructions are supported and how
    to write them? Can anyone give me any useful pointers?
    Here is a rather scrappy doc I wrote on how to write ARM assembler in
    Go. (I should really tidy it up, but perhaps it will be useful as is!)

    https://docs.google.com/document/d/1JrxVxcG2JYPO-hTfIV-ZPwvnDetFiKElTj3BIEbHpO8/pub

    I wrote it from the perspective of someone who knows ARM assembler but
    doesn't know how ARM assembler in Go works.


    --
    Nick Craig-Wood <nick@craig-wood.com -- http://www.craig-wood.com/nick

    --
    Nick Craig-Wood <nick@craig-wood.com> -- http://www.craig-wood.com/nick

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedSep 23, '14 at 4:47p
activeSep 24, '14 at 9:17a
posts7
users4
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase