Re: [go-nuts] Re: About 64bits alignment

2019-02-07 Thread T L
Thanks for the clarification.


On Thursday, February 7, 2019 at 8:57:00 PM UTC-4, Ian Lance Taylor wrote:
>
> On Thu, Feb 7, 2019 at 3:49 PM T L > 
> wrote: 
> > 
> > Is the bug zone outdated now. How about the support on other 32-bit 
> archs? Such as mips? 
>
> The bug description is not out of date. 
>
> Yes, 32-bit MIPS also requires 8 byte alignment for the 64-bit 
> operations.  I sent https://golang.org/cl/161697 to update the docs. 
>
> Ian 
>
>
> > On Wednesday, February 1, 2017 at 12:03:59 PM UTC-4, T L wrote: 
> >> 
> >> the sync/atomic docs, https://golang.org/pkg/sync/atomic/, says in the 
> end of the docs 
> >> 
> >> 
> >>> On x86-32, the 64-bit functions use instructions unavailable before 
> the Pentium MMX. 
> >>> 
> >>> On non-Linux ARM, the 64-bit functions use instructions unavailable 
> before the ARMv6k core. 
> >>> 
> >>> On both ARM and x86-32, it is the caller's responsibility to arrange 
> for 64-bit alignment of 64-bit words accessed atomically. 
> >>> 
> >>> The first word in a global variable or in an allocated struct or slice 
> can be relied upon to be 64-bit aligned. 
> >> 
> >> 
> >> The last line says the first word in a global variable or in an 
> allocated struct or slice is 64-bit aligned for sure. 
> >> But what does an allocated struct or slice means? A struct or slice 
> allocated on heap, not stack? 
> > 
> > -- 
> > 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 . 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: About 64bits alignment

2019-02-07 Thread Ian Lance Taylor
On Thu, Feb 7, 2019 at 3:49 PM T L  wrote:
>
> Is the bug zone outdated now. How about the support on other 32-bit archs? 
> Such as mips?

The bug description is not out of date.

Yes, 32-bit MIPS also requires 8 byte alignment for the 64-bit
operations.  I sent https://golang.org/cl/161697 to update the docs.

Ian


> On Wednesday, February 1, 2017 at 12:03:59 PM UTC-4, T L wrote:
>>
>> the sync/atomic docs, https://golang.org/pkg/sync/atomic/, says in the end 
>> of the docs
>>
>>
>>> On x86-32, the 64-bit functions use instructions unavailable before the 
>>> Pentium MMX.
>>>
>>> On non-Linux ARM, the 64-bit functions use instructions unavailable before 
>>> the ARMv6k core.
>>>
>>> On both ARM and x86-32, it is the caller's responsibility to arrange for 
>>> 64-bit alignment of 64-bit words accessed atomically.
>>>
>>> The first word in a global variable or in an allocated struct or slice can 
>>> be relied upon to be 64-bit aligned.
>>
>>
>> The last line says the first word in a global variable or in an allocated 
>> struct or slice is 64-bit aligned for sure.
>> But what does an allocated struct or slice means? A struct or slice 
>> allocated on heap, not stack?
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: About 64bits alignment

2019-02-07 Thread T L
Is the bug zone outdated now. How about the support on other 32-bit archs? 
Such as mips?

On Wednesday, February 1, 2017 at 12:03:59 PM UTC-4, T L wrote:
>
> the sync/atomic docs, https://golang.org/pkg/sync/atomic/, says in the 
> end of the docs
>
>
> On x86-32, the 64-bit functions use instructions unavailable before the 
>> Pentium MMX. 
>>
> On non-Linux ARM, the 64-bit functions use instructions unavailable before 
>> the ARMv6k core. 
>>
>> On both ARM and x86-32, it is the caller's responsibility to arrange for 
>> 64-bit alignment of 64-bit words accessed atomically. 
>>
> The first word in a global variable or in an allocated struct or slice can 
>> be relied upon to be 64-bit aligned. 
>>
>
> The last line says the first word in a global variable or in an allocated 
> struct or slice is 64-bit aligned for sure.
> But what does an allocated struct or slice means? A struct or slice 
> allocated on heap, not stack?
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: About 64bits alignment

2017-03-28 Thread Dave Cheney
Arm means arm as in linux/arm. 

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] Re: About 64bits alignment

2017-03-28 Thread Michael Hudson-Doyle
On 29 March 2017 at 04:44, T L  wrote:

>
>
> On Thursday, February 2, 2017 at 12:03:59 AM UTC+8, T L wrote:
>>
>> the sync/atomic docs, https://golang.org/pkg/sync/atomic/, says in the
>> end of the docs
>>
>>
>> On x86-32, the 64-bit functions use instructions unavailable before the
>>> Pentium MMX.
>>>
>> On non-Linux ARM, the 64-bit functions use instructions unavailable
>>> before the ARMv6k core.
>>>
>>> On both ARM and x86-32, it is the caller's responsibility to arrange for
>>> 64-bit alignment of 64-bit words accessed atomically.
>>>
>>
> Does the "ARM" here include ARMv8 (64-bit)?
>

On a 64 bit platform, 64-bit integers are naturally aligned on 64 bits so
you shouldn't have to make any extra effort to arrange for it to happen.

Cheers,
mwh

> The first word in a global variable or in an allocated struct or slice can
>>> be relied upon to be 64-bit aligned.
>>>
>>
>> The last line says the first word in a global variable or in an allocated
>> struct or slice is 64-bit aligned for sure.
>> But what does an allocated struct or slice means? A struct or slice
>> allocated on heap, not stack?
>>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: About 64bits alignment

2017-03-28 Thread T L


On Thursday, February 2, 2017 at 12:03:59 AM UTC+8, T L wrote:
>
> the sync/atomic docs, https://golang.org/pkg/sync/atomic/, says in the 
> end of the docs
>
>
> On x86-32, the 64-bit functions use instructions unavailable before the 
>> Pentium MMX. 
>>
> On non-Linux ARM, the 64-bit functions use instructions unavailable before 
>> the ARMv6k core. 
>>
>> On both ARM and x86-32, it is the caller's responsibility to arrange for 
>> 64-bit alignment of 64-bit words accessed atomically. 
>>
>
Does the "ARM" here include ARMv8 (64-bit)?
 

> The first word in a global variable or in an allocated struct or slice can 
>> be relied upon to be 64-bit aligned. 
>>
>
> The last line says the first word in a global variable or in an allocated 
> struct or slice is 64-bit aligned for sure.
> But what does an allocated struct or slice means? A struct or slice 
> allocated on heap, not stack?
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.