-
Notifications
You must be signed in to change notification settings - Fork 6
Use target pointer width rather than x86 #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
question
Further information is requested
Comments
Basically, the library only supports x64 and x86. Hence it uses just x86 and not(x86) here and there. It was tested for ARM once, but in general ARM is not supported at the moment. |
tgross35
added a commit
to tgross35/astro-float
that referenced
this issue
May 30, 2025
Currently a lot of things are gated on `cfg(target_arch = "x86")`, which is used to indicate systems with 32-bit words. Apply the following changes to make this less specific: * Replace x86-32 configuration with configuration based on `target_pointer_width`. * Where possible, replace `#[cfg]` with `cfg!` or eliminate the check, to increase the percentage of code that gets validated on any platform. * Remove some configuration that was unneeded, for the same reason. This includes things like `#[cfg(target_arch = "x86")]` on comparisons to `EXPONENT_MIN` or `EXPONENT_MAX`. The checks are only useful on 32-bit platforms, but this is a trivial compiler optimization so not much is gained by keeping the config. I have verified that the crate builds on armv7 targets (but have not tested). Fixes: stencillogic#26
tgross35
added a commit
to tgross35/astro-float
that referenced
this issue
May 30, 2025
Currently a lot of things are gated on `cfg(target_arch = "x86")`, which is used to indicate systems with 32-bit words. Apply the following changes to make this less specific: * Replace x86-32 configuration with configuration based on `target_pointer_width`. * Where possible, replace `#[cfg]` with `cfg!` or eliminate the check, to increase the percentage of code that gets validated on any platform. * Remove some configuration that was unneeded, for the same reason. This includes things like `#[cfg(target_arch = "x86")]` on comparisons to `EXPONENT_MIN` or `EXPONENT_MAX`. The checks are only useful on 32-bit platforms, but this is a trivial compiler optimization so not much is gained by keeping the config. I have verified that the crate builds on armv7 targets (but have not tested). Fixes: stencillogic#26
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The code
astro-float/astro-float-num/src/defs.rs
Lines 11 to 33 in 891843d
x86
ornot(x86)
. Is there a reason that x86 is special, or could this instead use#[cfg(target_pointer_width = 64)]
/#[cfg(target_pointer_width = 32)]
?The text was updated successfully, but these errors were encountered: