Behavior of u64 Usage in Rust Programs on 32-bit vs. 64-bit Operating Systems

Hi,

If I use u64 in the program code, and the program get compiled and run on a 32 bit OS, and vice versa.

What would happen in these cases, please?

Thank you and best regards,

...behai.

If the target architecture has instructions for manipulating 64-bit values, they will be used. (32-bit addressing, and even a 32-bit bus width, doesn't necessarily mean there are no such operations.) If not, they will be emulated “in software” by using pairs of 32-bit operations.

(The same principle applies often to u128 on 64-bit systems.)

5 Likes