-
Notifications
You must be signed in to change notification settings - Fork 85
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
Fix x86 compilation #376
Fix x86 compilation #376
Conversation
The `_mm_cvtsi128_si64` intrinsic is missing on `x86`.
nice catch and good solution. Using the native implementation is fine, 32-bit x86 systems are rare these days so I don't think it'll have a wide impact and with LLVM's optimisations it'll be plenty fast. I suspect that the reason The There are a few issues with the tests since we got a new clippy lints, those are not related to your changes I think. I'm happy to fix those in the main branch and rebase your PR tomorrow if you don't want to deal with them. CI aside, PR looks great 👍 thanks! |
There is one more clippy lint that is reported on nightly: Lines 1253 to 1259 in 83a806f
I am not sure if you want to just ignore the lint here or not, so I have not done anything about them. Properly fixing the lint would probably involve removing the macros and calling |
# Legacy code | ||
'cfg(portable)', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not too sure about the portable
config (i.e. is the config supposed to be "hidden", or is this just remainder from previous code), so I have elected to ignore the warning about it here.
@@ -9,7 +9,7 @@ impl<'tape, 'input> PartialEq for Value<'tape, 'input> { | |||
#[cfg_attr(not(feature = "no-inline"), inline)] | |||
#[must_use] | |||
fn eq(&self, other: &Self) -> bool { | |||
self == other | |||
self.0 == other.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the previous implementation was buggy: the clippy lint indicates that it would have looped infinitely.
I think comparing the wrapped value is what was intended here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's right! Good catch :)
I stumbled about that the other day too, clippy is my secret hero to be honest 😂 it avoids so many issues.
Perfect :) thank you so much! |
Sorry it took me so long to merge this, I thought I had done it and must have forgotten. |
Compiling for the
i686-unknown-linux-gnu
target leads to multiple compilation failures.The first set was easy to solve (akin to #246). The second issue is that
std::arch::x86_64::_mm_cvtsi128_si64
does not seem to have an equivalent forstd::arch::x86
. I think this is an oversight instd::arch::x86
?I am not confident enough in my SIMD knowledge to create a clever workaround, so I copied the "native rust implementation" for
x86
. If there is some workaround without using_mm_cvtsi128_si64
, then feel free to change it.Note
I do not have a
x86
system myself, so I could not test the changes locally. I only checked by runningcargo build --target i686-unknown-linux-gnu