Is it easy/possible to run code with 32 bit pointers on a modern 64 bit OS?

Daniel Poirot dtpoirot at gmail.com
Mon Mar 27 02:09:06 UTC 2017


...and isn't the root of the discussion questioning the use of char,
short, int and long in structures vs the more correct uint8_t,
uint16_t, uint32_t and uint64_t?

Write the code in the most correct ANSI standard as is possible for
portability, maintainability and to let the compiler do what it can.
Specify structures using the most specific type possible to pack
memory or packets.

You want to see some real misery? Run the code through the MISRA
rules. Horrible.

On Sun, Mar 26, 2017 at 8:22 PM, Fred Wright <fw at fwright.net> wrote:
>
> On Sun, 26 Mar 2017, Hal Murray wrote:
>> aac at comcast.net said:
>> > Did you check out Linux' "X32 ABI" support?
>> > https://sites.google.com/site/x32abi/
>>
>> Thanks.  That seems to be what I was looking for.
>>
>> It's not in the Fedora kernels but is in Debian.  I'll poke around more.
>>
>>
>> I guess I'm slightly surprised that there isn't more interest in that area.
>> Aside from memory usage, it also uses cache space which turns into general
>> performance.  So any program with a lot of pointers would probably speed up.
>> I guess there aren't many programs that both fit in 32 bits and are
>> performance critical and use a lot of pointers.
>
> The 32-bit x86 architecture is so register-crippled that C code typically
> runs about 15% faster when compiled for X86_64 than when compiled for
> i386, in spite of the poorer cache locality caused by the larger pointers.
>
> It is, however, useful to make 32-on-64-bit builds work for testing 32-bit
> issues.  This is often more complicated than just adding "-m32" to the
> flags.
>
> Fred Wright
> _______________________________________________
> devel mailing list
> devel at ntpsec.org
> http://lists.ntpsec.org/mailman/listinfo/devel


More information about the devel mailing list