harder better faster stronger

This commit is contained in:
nora 2024-12-04 21:55:29 +01:00
parent 2c93270971
commit f55e51c955
4 changed files with 478 additions and 5 deletions

View file

@ -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 {
(