Re: 8-bit and 16-bit arithmetic

2021-10-29 Thread Norman Ramsey
> Norman Ramsey writes: > > > On x86, GHC can translate 8-bit and 16-bit operations directly > > into the 8-bit and 16-bit machine instructions that the hardware > > supports. But there are other platforms on which the smallest > > unit of arithmetic may be 32 or even 64 bits. Is there a

Re: 8-bit and 16-bit arithmetic

2021-10-28 Thread Carter Schonwald
yeah, like, currently the XOR for setting registers to zero trick / code optimization (first implemented in ghc backend by reid barton) is done as part of the pretty printer on X86/AMD_64 targets this and a lot of other easy win peephole optimizations that are platform /target dependent happen in

Re: 8-bit and 16-bit arithmetic

2021-10-28 Thread Ben Gamari
Norman Ramsey writes: > On x86, GHC can translate 8-bit and 16-bit operations directly > into the 8-bit and 16-bit machine instructions that the hardware > supports. But there are other platforms on which the smallest > unit of arithmetic may be 32 or even 64 bits. Is there a central > module

Re: 8-bit and 16-bit arithmetic

2021-10-28 Thread Andreas Klebinger
I think carter has it still right that it happens in the backends. If a new backend doesn't support these we could move this up into Cmm though without much issue I think. Am 28/10/2021 um 23:12 schrieb Carter Schonwald: I think thats done on a per backend basis (though theres been a lot of

Re: 8-bit and 16-bit arithmetic

2021-10-28 Thread Carter Schonwald
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) On Thu, Oct 28, 2021 at 4:59 PM Norman Ramsey wrote: > On x86,

8-bit and 16-bit arithmetic

2021-10-28 Thread Norman Ramsey
On x86, GHC can translate 8-bit and 16-bit operations directly into the 8-bit and 16-bit machine instructions that the hardware supports. But there are other platforms on which the smallest unit of arithmetic may be 32 or even 64 bits. Is there a central module in GHC that can take care of