mirror of
https://github.com/Noratrieb/advent-of-code.git
synced 2026-01-14 17:45:02 +01:00
harder better faster stronger
This commit is contained in:
parent
2c93270971
commit
f55e51c955
4 changed files with 478 additions and 5 deletions
|
|
@ -68,6 +68,21 @@ pub fn test_part2<D: Day>(inputs: &[(&str, u64)]) {
|
|||
}
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! only_x86_64_and {
|
||||
($feature:tt => $input:ident, $fast:ident else $fallback:ident) => {
|
||||
#[cfg(not(target_arch = "x86_64"))]
|
||||
return $fallback($input);
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
{
|
||||
if !std::arch::is_x86_feature_detected!($feature) {
|
||||
return $fallback($input);
|
||||
}
|
||||
return unsafe { $fast($input) };
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! define_variants {
|
||||
(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue