Merge pull request #3228 from rtfeldman/illegal_instruction_PENTIUM_N3700

WIP don't require avx, avx2, sse, sse4.2 on all x86-64
This commit is contained in:
Richard Feldman 2022-06-20 08:32:14 -04:00 committed by GitHub
commit 033efe33e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 51 additions and 9 deletions

View file

@ -254,7 +254,12 @@ fn fast_eat_spaces(state: &State) -> FastSpaceState {
index += 1;
// try to use SIMD instructions explicitly
#[cfg(target_arch = "x86_64")]
// run with RUSTFLAGS="-C target-cpu=native" to enable
#[cfg(all(
target_arch = "x86_64",
target_feature = "sse2",
target_feature = "sse4.2"
))]
{
use std::arch::x86_64::*;
@ -287,7 +292,11 @@ fn fast_eat_spaces(state: &State) -> FastSpaceState {
}
}
#[cfg(not(target_arch = "x86_64"))]
#[cfg(not(all(
target_arch = "x86_64",
target_feature = "sse2",
target_feature = "sse4.2"
)))]
{
while index < length {
match bytes[index] {
@ -431,7 +440,11 @@ fn eat_line_comment<'a>(
let loop_start = index;
#[cfg(target_arch = "x86_64")]
#[cfg(all(
target_arch = "x86_64",
target_feature = "sse2",
target_feature = "sse4.2"
))]
{
use std::arch::x86_64::*;
@ -519,7 +532,11 @@ fn eat_line_comment<'a>(
}
}
#[cfg(not(target_arch = "x86_64"))]
#[cfg(not(all(
target_arch = "x86_64",
target_feature = "sse2",
target_feature = "sse4.2"
)))]
while index < length {
match bytes[index] {
b'\t' => unreachable!(),