rems-project / sail

Sail architecture definition language
Other
590 stars 103 forks source link

64-bit system-specific C runtime libraries #562

Closed soomin-kim closed 4 months ago

soomin-kim commented 4 months ago

Hi,

I'm trying to use Sail for my research project. While converting the Sail specifications to C files using Sail, I found that the C runtime libraries have 64-bit system-specific implementations. For example, the mpz_get_ui function, which is frequently used in lib/sail.c, has the following prototype:

unsigned long int mpz_get_ui (const mpz_t op)

The unsigned long int type has a size of 8 bytes on a 64-bit system, but only 4 bytes on a 32-bit system. So, it returns different values depending on the system, leading to different execution results. I'm wondering if there are any plans to modify the Sail C runtime libraries to work correctly on a 32-bit system as well. Thank you!

Alasdair commented 4 months ago

There might be an argument to modify these functions because what we are really depending on here is that unsigned long is 64-bits (which it is on 64-bit Linux and Arm macOS). There are platforms like Windows where that is not true.

I don't think we want to support actual 32-bit hardware though. That seems very niche, and we have no ability to test on it.

soomin-kim commented 4 months ago

Ok, I understand. Thank you for the quick response!