From 02361de23a3698d964dd36b1b792f8a9dbbc74ca Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 11 Feb 2022 12:50:18 -0800 Subject: [PATCH] Use the new asm! in the unstable primal_sieve::b We should re-evaluate if this is still useful, because it made no consistent difference on my machine, but at least this compiles. --- primal-sieve/src/lib.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/primal-sieve/src/lib.rs b/primal-sieve/src/lib.rs index 1fde8fef..e19eb5a1 100755 --- a/primal-sieve/src/lib.rs +++ b/primal-sieve/src/lib.rs @@ -2,14 +2,12 @@ //! //! This is designed to be used via the `primal` crate. -#![cfg_attr(feature = "unstable", feature(llvm_asm))] - // black boxes for pointers; LLVM isn't so happy without -// them. Unfortunately only usable with unstable, but the code isn't +// them. Unfortunately only usable with 1.59+ asm!, but the code isn't // *too* much slower without them. #[cfg(feature = "unstable")] #[inline(always)] -fn b(mut p: *mut T) -> *mut T { unsafe { llvm_asm!("": "+r"(p)) } p } +fn b(mut p: *mut T) -> *mut T { unsafe { core::arch::asm!("/* {0} */", inout(reg) p) } p } #[cfg(not(feature = "unstable"))] #[inline(always)] fn b(p: *mut T) -> *mut T { p }