Either restrict MO_S_MulMayOflo to platform word size or expose sized variants of the primop.
Summary
I believe we should restrict MO_S_MulMayOflo
to target platform word size and remove support for other widths for simplicitly.
There is generally little benefit to sub-word variants of this operation, and it already doesn't support operations above word size.
If others believe there is utility to providing this operation at other widths than platform word size then it should be exposed in the surface language.
Details
!10768 (closed) claims that this primop can actually appear for sizes of W8 and W16.
But I believe this is currently only true for Cmm source files and was never intended to be supported.
In Cmm if we write a machop the parser simply takes a combination of width and machop. So nothing prevents us from writing non-sensical machops/width combinations.
However it seems @bgamari added tests for this primop at other sizes to test-primops at other widths. It's unclear to me if this was a decision or just cargo culting of code in place for other primops.
As a result !10768 (closed) actually fixed the primop for subword widths on x86-64.
This means currently:
- There is to my knowledge no way to make use of sub-word MO_S_MulMayOflo operations from Haskell.
- The x86-64 backend supports the operations at widths 8-64.
- The x86 backend supports the operation at widths 8-32
It's unclear to me if other backends support the operation at non-word widths. I assume if they do it's mostly accidental.
Proposal
I believe it would be simplest to restrict the operation to platform word-width and call it a day since there is currently no way to use the operation at other widths from haskell.
Alternative
If we think other widths of this operation are desirable then surely we would want to expose them to haskell through sized primops.