@@ -15,6 +15,7 @@ use rustc_middle::{mir, ty};
1515use rustc_session:: config:: OomStrategy ;
1616use rustc_span:: Symbol ;
1717use rustc_target:: callconv:: FnAbi ;
18+ use rustc_target:: spec:: Arch ;
1819
1920use super :: alloc:: EvalContextExt as _;
2021use super :: backtrace:: EvalContextExt as _;
@@ -799,20 +800,21 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
799800
800801 // Target-specific shims
801802 name if name. starts_with ( "llvm.x86." )
802- && ( this. tcx . sess . target . arch == "x86"
803- || this. tcx . sess . target . arch == "x86_64" ) =>
803+ && matches ! ( this. tcx. sess. target. arch, Arch :: X86 | Arch :: X86_64 ) =>
804804 {
805805 return shims:: x86:: EvalContextExt :: emulate_x86_intrinsic (
806806 this, link_name, abi, args, dest,
807807 ) ;
808808 }
809- name if name. starts_with ( "llvm.aarch64." ) && this. tcx . sess . target . arch == "aarch64" => {
809+ name if name. starts_with ( "llvm.aarch64." )
810+ && this. tcx . sess . target . arch == Arch :: AArch64 =>
811+ {
810812 return shims:: aarch64:: EvalContextExt :: emulate_aarch64_intrinsic (
811813 this, link_name, abi, args, dest,
812814 ) ;
813815 }
814816 // FIXME: Move this to an `arm` submodule.
815- "llvm.arm.hint" if this. tcx . sess . target . arch == "arm" => {
817+ "llvm.arm.hint" if this. tcx . sess . target . arch == Arch :: Arm => {
816818 let [ arg] = this. check_shim_sig_lenient ( abi, CanonAbi :: C , link_name, args) ?;
817819 let arg = this. read_scalar ( arg) ?. to_i32 ( ) ?;
818820 // Note that different arguments might have different target feature requirements.
0 commit comments