<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Ryan, the comment in GHC.Tuple seems to be misleading today, as suggested by this SO post: <a href="https://stackoverflow.com/questions/46412823/why-are-ghc-tuples-limited-to-size-62" class="">https://stackoverflow.com/questions/46412823/why-are-ghc-tuples-limited-to-size-62</a><div class=""><br class=""></div><div class="">I was going to add it to the comment at some point but was hesitant as I hadn’t verified the information myself.</div><div class=""><br class=""></div><div class="">V</div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 26 Sep 2020, at 14:26, Ryan Scott <<a href="mailto:ryan.gl.scott@gmail.com" class="">ryan.gl.scott@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">I had a feeling that this might be the case. Unfortunately, this technology preview is actively blocking progress on 
!4097, which leaves me at a loss for what to do. I can see two ways forward:</div><div class=""><br class=""></div><div class="">1. Remove
<span class="">unpackInt8X64#</span>

 and friends.</div><div class="">2. Reconsider whether the tuple size limit should apply to unboxed tuples. Perhaps this size limit only makes sense for boxed tuples? This comment [1] suggests that defining a boxed tuple of size greater than 62 induces a segfault, but it's unclear to me if the same thing happens for unboxed tuples.<br class=""></div><div class=""><br class=""></div><div class="">Ryan S.</div><div class="">-----</div><div class="">[1] <a href="https://gitlab.haskell.org/ghc/ghc/-/blob/a1f34d37b47826e86343e368a5c00f1a4b1f2bce/libraries/ghc-prim/GHC/Tuple.hs#L170" class="">https://gitlab.haskell.org/ghc/ghc/-/blob/a1f34d37b47826e86343e368a5c00f1a4b1f2bce/libraries/ghc-prim/GHC/Tuple.hs#L170</a>

</div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Sep 26, 2020 at 7:54 AM Ben Gamari <<a href="mailto:ben@smart-cactus.org" target="_blank" class="">ben@smart-cactus.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On September 25, 2020 6:21:23 PM EDT, Ryan Scott <<a href="mailto:ryan.gl.scott@gmail.com" target="_blank" class="">ryan.gl.scott@gmail.com</a>> wrote:<br class="">
...<br class="">
>However, I discovered recently that there are places where GHC *does*<br class="">
>use<br class="">
>unboxed tuples with arity greater than 62. For example, the<br class="">
>GHC.Prim.unpackInt8X64# [2] function returns an unboxed tuple of size<br class="">
>64. I<br class="">
>was confused for a while about how this was even possible, but I<br class="">
>realized<br class="">
>later than GHC only enforces the tuple size limit in expressions and<br class="">
>patterns [3]. Simply having a type signature with a large unboxed tuple<br class="">
>is<br class="">
>fine in and of itself, and since unpackInt8X64# is implemented as a<br class="">
>primop,<br class="">
>no large unboxed tuples are ever used in the "body" of the function.<br class="">
>(Indeed, primops don't have function bodies in the conventional sense.)<br class="">
>Other functions in GHC.Prim that use unboxed tuples of arity 64 include<br class="">
>unpackWord8X64# [4], packInt8X64# [5], and packWord8X64# [6].<br class="">
><br class="">
>But this makes me wonder: how on earth is it even possible to *use*<br class="">
>unpackInt8X64#? <br class="">
<br class="">
<br class="">
I strongly suspect that the answer here is "you can't yet no one has noticed until now." The SIMD operations were essentially introduced as a technology preview and therefore never had proper tests added. Only a subset of these operations have any tests at all and I doubt anyone has attempted to use the 64-wide operations, which are rather specialized.<br class="">
<br class="">
Cheers,<br class="">
<br class="">
- Ben <br class="">
</blockquote></div>
_______________________________________________<br class="">ghc-devs mailing list<br class=""><a href="mailto:ghc-devs@haskell.org" class="">ghc-devs@haskell.org</a><br class="">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs<br class=""></div></blockquote></div><br class=""></div></body></html>