FAQ
My 1.1 assembly go is suddenly broken mysteriously with tip (just pulled).
It's a function for

type Type [2]int64

//go:noescape

func (t Type) Func(arg []float32) float32

I take t[0] at 0(FP), t[1] at 8(FP), arg_base at 16(FP) and return at
40(FP).

The function is purely mathematical and does absolutely no fiddling around
with the heap/memory. It just reads the number from the arg slice.

vet gives completely nonsense output by the way:
-undefined variable t
-when I tried an alternative function with the signature func(t []int64,
arg []float64)), it said "unsupported assembly argument type [2]int64"

I mentioned some in the post "vet asm strangeness (amd64)" in the past (and
yes, I'm talking about the same code here as well) but I didn't get any
replies back then.
Fingers crossed :)

I can say that go vet is buggy with assembly. I'm not sure whether the gc
tool chain has some new bugs though, but my working 1.1 code panics with
1.2.

When I remove //go:noescape, the problem goes away



--
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 6, 2013 at 2:20 pm
    Sounds like a bug in the optimizer, maybe?

    --
    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émy Oudompheng at Nov 7, 2013 at 1:22 am

    2013/11/6 r <rayneolivetti@yahoo.com>:
    Sounds like a bug in the optimizer, maybe?
    As replied on the issue, you are making excessive alignment
    asssumptions on your data. MOVAPS requires 16-byte alignement of
    memory operands.


    Rémy.

    --
    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 7, 2013 at 1:28 am

    On Wed, Nov 6, 2013 at 8:22 PM, Rémy Oudompheng wrote:

    2013/11/6 r <rayneolivetti@yahoo.com>:
    Sounds like a bug in the optimizer, maybe?
    As replied on the issue, you are making excessive alignment
    asssumptions on your data. MOVAPS requires 16-byte alignement of
    memory operands.
    Also, you can allocate a slightly bigger slice on stack, and reslice to get
    the pointer 128-bit aligned.

    --
    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 7, 2013 at 5:27 am
    Thanks so much guys, you saved my day :)
    I also found some other piece of code here that lives under the delusion
    that all data, be it stack or heap, is aligned.

    By the way, @Dave, what do you mean by "not supported"?
    I'm aware of the issue #4978, and it is indeed a problem with pointer
    receivers (assembler doesn't like * in labels), but it seems to be working
    with non-pointer receiver.
    On Thursday, November 7, 2013 10:27:34 AM UTC+9, minux wrote:


    On Wed, Nov 6, 2013 at 8:22 PM, Rémy Oudompheng <remyoud...@gmail.com<javascript:>
    wrote:
    2013/11/6 r <rayneo...@yahoo.com <javascript:>>:
    Sounds like a bug in the optimizer, maybe?
    As replied on the issue, you are making excessive alignment
    asssumptions on your data. MOVAPS requires 16-byte alignement of
    memory operands.
    Also, you can allocate a slightly bigger slice on stack, and reslice to get
    the pointer 128-bit aligned.
    --
    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 7, 2013 at 5:40 am
    Not supported as in, nobody has made it work yet.
    On 7 Nov 2013, at 16:27, r wrote:

    Thanks so much guys, you saved my day :)
    I also found some other piece of code here that lives under the delusion that all data, be it stack or heap, is aligned.

    By the way, @Dave, what do you mean by "not supported"?
    I'm aware of the issue #4978, and it is indeed a problem with pointer receivers (assembler doesn't like * in labels), but it seems to be working with non-pointer receiver.
    On Thursday, November 7, 2013 10:27:34 AM UTC+9, minux wrote:

    On Wed, Nov 6, 2013 at 8:22 PM, Rémy Oudompheng wrote:
    2013/11/6 r <rayneo...@yahoo.com>:
    Sounds like a bug in the optimizer, maybe?
    As replied on the issue, you are making excessive alignment
    asssumptions on your data. MOVAPS requires 16-byte alignement of
    memory operands.
    Also, you can allocate a slightly bigger slice on stack, and reslice to get
    the pointer 128-bit aligned.
    --
    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 7, 2013 at 5:43 am
    ?
    Partially works for me: with value receiver methods only.
    In fact, I've been using it for quite a while.
    On Thursday, November 7, 2013 2:39:52 PM UTC+9, Dave Cheney wrote:

    Not supported as in, nobody has made it work yet.

    On 7 Nov 2013, at 16:27, r <rayneo...@yahoo.com <javascript:>> wrote:

    Thanks so much guys, you saved my day :)
    I also found some other piece of code here that lives under the delusion
    that all data, be it stack or heap, is aligned.

    By the way, @Dave, what do you mean by "not supported"?
    I'm aware of the issue #4978, and it is indeed a problem with pointer
    receivers (assembler doesn't like * in labels), but it seems to be working
    with non-pointer receiver.
    On Thursday, November 7, 2013 10:27:34 AM UTC+9, minux wrote:

    On Wed, Nov 6, 2013 at 8:22 PM, Rémy Oudompheng wrote:

    2013/11/6 r <rayneo...@yahoo.com>:
    Sounds like a bug in the optimizer, maybe?
    As replied on the issue, you are making excessive alignment
    asssumptions on your data. MOVAPS requires 16-byte alignement of
    memory operands.
    Also, you can allocate a slightly bigger slice on stack, and reslice to
    get
    the pointer 128-bit aligned.
    --
    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.
  • Jan Mercl at Nov 6, 2013 at 2:39 pm
    On Wed, Nov 6, 2013 at 3:09 PM, r wrote:

    Code?

    -j

    --
    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 7, 2013 at 1:12 am
    https://code.google.com/p/go/issues/detail?id=6730&thanks=6730&ts=1383786737
    On Wednesday, November 6, 2013 11:38:39 PM UTC+9, Jan Mercl wrote:

    On Wed, Nov 6, 2013 at 3:09 PM, r <rayneo...@yahoo.com <javascript:>>
    wrote:

    Code?

    -j
    --
    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 6, 2013 at 7:36 pm

    On Thu, Nov 7, 2013 at 1:09 AM, r wrote:
    My 1.1 assembly go is suddenly broken mysteriously with tip (just pulled).
    It's a function for

    type Type [2]int64

    //go:noescape

    func (t Type) Func(arg []float32) float32
    There is no support for creating assembly methods on types, only functions.
    I mentioned some in the post "vet asm strangeness (amd64)" in the past (and
    yes, I'm talking about the same code here as well) but I didn't get any
    replies back then.
    If you think the issue is a bug, please raise an issue, golang.org/issue.
    I can say that go vet is buggy with assembly. I'm not sure whether the gc
    tool chain has some new bugs though, but my working 1.1 code panics with
    1.2.
    Please raise the issues you find, we can't fix bugs that aren't reported.
    When I remove //go:noescape, the problem goes away



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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 6, '13 at 2:09p
activeNov 7, '13 at 5:43a
posts10
users5
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase