Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,32 @@ jobs:
path: crates/fff-core/tests/fuzz_git_watcher_stress.proptest-regressions
if-no-files-found: ignore

build-i686:
name: Build i686-unknown-linux-gnu
runs-on: ubuntu-latest
# Verifies that fff-search compiles on 32-bit x86, where std::arch::x86_64
# is unavailable. SIMD paths are disabled on this target; only the scalar
# fallback should build. See issue #656.
timeout-minutes: 15
steps:
- uses: actions/checkout@v5

- name: Install cross toolchain
run: |
sudo apt-get update
sudo apt-get install -y gcc-multilib g++-multilib

- name: Install Rust (i686 target)
uses: actions-rust-lang/setup-rust-toolchain@v1.15.4
with:
target: i686-unknown-linux-gnu
cache: true
cache-on-failure: true
cache-key: "v1-rust-i686"

- name: Build fff-search for i686
run: cargo build -p fff-search --target i686-unknown-linux-gnu

fmt:
name: cargo fmt
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions crates/fff-core/src/bigram_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ fn normalize_byte_scalar(b: u8) -> u8 {
#[inline(always)]
fn normalize_bytes(src: &[u8], dst: &mut [u8]) {
debug_assert!(dst.len() >= src.len());
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
#[cfg(target_arch = "x86_64")]
{
if std::is_x86_feature_detected!("avx2") {
unsafe { normalize_bytes_avx2(src, dst) };
Expand All @@ -620,7 +620,7 @@ fn normalize_bytes_scalar(src: &[u8], dst: &mut [u8]) {

/// AVX2 normalize: 32 bytes/iter. AVX2 only has signed cmp, so unsigned
/// range checks use `min(max(v, lo), hi) == v`.
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
#[cfg(target_arch = "x86_64")]
#[target_feature(enable = "avx2")]
unsafe fn normalize_bytes_avx2(src: &[u8], dst: &mut [u8]) {
use std::arch::x86_64::*;
Expand Down
4 changes: 4 additions & 0 deletions crates/fff-core/src/case_insensitive_memmem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,10 @@ pub fn search_packed_pair(haystack: &[u8], needle_lower: &[u8]) -> bool {
return false;
}

#[cfg_attr(
not(any(target_arch = "x86_64", target_arch = "aarch64")),
allow(unused_variables)
)]
let (i1, i2) = select_rare_pair(needle_lower);

#[cfg(target_arch = "x86_64")]
Expand Down
Loading