Skip to content
Closed
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
1 change: 1 addition & 0 deletions crates/stdsimd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#![feature(const_fn, integer_atomics, staged_api, stdsimd)]
#![feature(doc_cfg, allow_internal_unstable)]
#![feature(promotable_const_fn, custom_attributes)]
#![cfg_attr(feature = "cargo-clippy", allow(shadow_reuse))]
#![cfg_attr(target_os = "linux", feature(linkage))]
#![no_std]
Expand Down
2 changes: 2 additions & 0 deletions stdsimd/arch/detect/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ use core::sync::atomic::AtomicU64;
use core::sync::atomic::AtomicU32;

/// Sets the `bit` of `x`.
#[promotable_const_fn]
pub const fn set_bit(x: u64, bit: u32) -> u64 {
x | 1 << bit
}

/// Tests the `bit` of `x`.
#[promotable_const_fn]
pub const fn test_bit(x: u64, bit: u32) -> bool {
x & (1 << bit) != 0
}
Expand Down