<div dir="ltr">I think thats done on a per backend basis (though theres been a lot of changes since i last looked at some of the relevent pieces). (i'm actually based in Cambridge MA for the next 1-2 years if you wanna brain storm IRL sometime)<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 28, 2021 at 4:59 PM Norman Ramsey <<a href="mailto:nr@cs.tufts.edu">nr@cs.tufts.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On x86, GHC can translate 8-bit and 16-bit operations directly<br>
into the 8-bit and 16-bit machine instructions that the hardware<br>
supports. But there are other platforms on which the smallest<br>
unit of arithmetic may be 32 or even 64 bits. Is there a central<br>
module in GHC that can take care of rewriting 8-bit and 16-bit operations<br>
into 32-bit or 64-bit operations? Or is each back end on its own<br>
for this?<br>
<br>
(One of my students did some nice work on implementing this transformation<br>
with a minimal set of sign-extension and zero-extension operations:<br>
<a href="https://www.cs.tufts.edu/~nr/pubs/widen.pdf" rel="noreferrer" target="_blank">https://www.cs.tufts.edu/~nr/pubs/widen.pdf</a>.)<br>
<br>
<br>
Norman<br>
_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
</blockquote></div>