Why align all pinned array payloads on 16 bytes?
Alexander Kjeldaas
alexander.kjeldaas at gmail.com
Tue Oct 16 22:50:09 UTC 2018
The SSE types require 16-byte alignment. Most of the original SSE
instructions have versions that accept non-aligned data though.
Alexander
On Tue, Oct 16, 2018 at 11:18 PM Simon Marlow <marlowsd at gmail.com> wrote:
> I vaguely recall that this was because 16 byte alignment is the minimum
> you need for certain foreign types, and it's what malloc() does. Perhaps
> check the FFI spec and the guarantees that mallocForeignPtrBytes and
> friends provide?
>
> Cheers
> Simon
>
> On Thu, 11 Oct 2018 at 18:44, Ömer Sinan Ağacan <omeragacan at gmail.com>
> wrote:
>
>> Hi,
>>
>> I just found out we currently align all pinned array payloads to 16 bytes
>> and
>> I'm wondering why. I don't see any comments/notes on this, and it's also
>> not
>> part of the primop documentation. We also have another primop for aligned
>> allocation: newAlignedPinnedByteArray#. Given that alignment behavior of
>> newPinnedByteArray# is not documented and we have another one for aligned
>> allocation, perhaps we can remove alignment in newPinnedByteArray#.
>>
>> Does anyone remember what was the motivation for always aligning pinned
>> arrays?
>>
>> Thanks
>>
>> Ömer
>> _______________________________________________
>> ghc-devs mailing list
>> ghc-devs at haskell.org
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>>
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20181017/e66b0cef/attachment.html>
More information about the ghc-devs
mailing list