mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-22 00:09:33 +03:00
fmt
This commit is contained in:
parent
47a24ad142
commit
2f08caceee
@ -252,14 +252,26 @@ impl SmallStringInterner {
|
||||
#[allow(dead_code)]
|
||||
fn find_i16_slice(slice: &[i16], key: i16) -> Option<usize> {
|
||||
// run with RUSTFLAGS="-C target-cpu=native" to enable
|
||||
#[cfg(all(target_arch = "x86_64", target_feature = "avx", target_feature = "avx2"))]
|
||||
#[cfg(all(
|
||||
target_arch = "x86_64",
|
||||
target_feature = "avx",
|
||||
target_feature = "avx2"
|
||||
))]
|
||||
return find_i16_slice_x86_64(slice, key);
|
||||
|
||||
#[cfg(not(all(target_arch = "x86_64", target_feature = "avx", target_feature = "avx2")))]
|
||||
#[cfg(not(all(
|
||||
target_arch = "x86_64",
|
||||
target_feature = "avx",
|
||||
target_feature = "avx2"
|
||||
)))]
|
||||
return find_i16_slice_fallback(slice, key);
|
||||
}
|
||||
|
||||
#[cfg(all(target_arch = "x86_64", target_feature = "avx", target_feature = "avx2"))]
|
||||
#[cfg(all(
|
||||
target_arch = "x86_64",
|
||||
target_feature = "avx",
|
||||
target_feature = "avx2"
|
||||
))]
|
||||
fn find_i16_slice_x86_64(slice: &[i16], key: i16) -> Option<usize> {
|
||||
use std::arch::x86_64::*;
|
||||
|
||||
@ -333,7 +345,11 @@ mod test {
|
||||
assert!(interner.find_and_update("c", "cd").is_some());
|
||||
}
|
||||
|
||||
#[cfg(all(target_arch = "x86_64", target_feature = "avx", target_feature = "avx2"))]
|
||||
#[cfg(all(
|
||||
target_arch = "x86_64",
|
||||
target_feature = "avx",
|
||||
target_feature = "avx2"
|
||||
))]
|
||||
#[test]
|
||||
fn find_test_1() {
|
||||
use super::find_i16_slice;
|
||||
|
@ -255,7 +255,11 @@ fn fast_eat_spaces(state: &State) -> FastSpaceState {
|
||||
|
||||
// try to use SIMD instructions explicitly
|
||||
// run with RUSTFLAGS="-C target-cpu=native" to enable
|
||||
#[cfg(all(target_arch = "x86_64", target_feature = "sse2", target_feature = "sse4.2"))]
|
||||
#[cfg(all(
|
||||
target_arch = "x86_64",
|
||||
target_feature = "sse2",
|
||||
target_feature = "sse4.2"
|
||||
))]
|
||||
{
|
||||
use std::arch::x86_64::*;
|
||||
|
||||
@ -288,7 +292,11 @@ fn fast_eat_spaces(state: &State) -> FastSpaceState {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(all(target_arch = "x86_64", target_feature = "sse2", target_feature = "sse4.2")))]
|
||||
#[cfg(not(all(
|
||||
target_arch = "x86_64",
|
||||
target_feature = "sse2",
|
||||
target_feature = "sse4.2"
|
||||
)))]
|
||||
{
|
||||
while index < length {
|
||||
match bytes[index] {
|
||||
@ -432,7 +440,11 @@ fn eat_line_comment<'a>(
|
||||
|
||||
let loop_start = index;
|
||||
|
||||
#[cfg(all(target_arch = "x86_64", target_feature = "sse2", target_feature = "sse4.2"))]
|
||||
#[cfg(all(
|
||||
target_arch = "x86_64",
|
||||
target_feature = "sse2",
|
||||
target_feature = "sse4.2"
|
||||
))]
|
||||
{
|
||||
use std::arch::x86_64::*;
|
||||
|
||||
@ -520,7 +532,11 @@ fn eat_line_comment<'a>(
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(all(target_arch = "x86_64", target_feature = "sse2", target_feature = "sse4.2")))]
|
||||
#[cfg(not(all(
|
||||
target_arch = "x86_64",
|
||||
target_feature = "sse2",
|
||||
target_feature = "sse4.2"
|
||||
)))]
|
||||
while index < length {
|
||||
match bytes[index] {
|
||||
b'\t' => unreachable!(),
|
||||
|
Loading…
Reference in New Issue
Block a user