Skip to content

Target Platform Endianness

Motivation

I'm trying to work on some built-in rewrite rules for constant folding primops that indexing into Addr# literals. For any element bigger than an 8-bit word, we need to know the target platform endianness to do this correctly. This information is not currently available.

Proposal

Add a field to GHC.Platform.Platform that tells us the endianness of the target platform. Hopefully this isn't difficult. I'm happy to try as long as no one's aware of anything that makes this impossible.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information