@@ -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 _;
@@ -800,20 +801,24 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
800801
801802 // Target-specific shims
802803 name if name. starts_with ( "llvm.x86." )
803- && ( this. tcx . sess . target . arch == "x86"
804- || this. tcx . sess . target . arch == "x86_64" ) =>
804+ && matches ! (
805+ this. tcx. sess. target. arch,
806+ Arch :: X86 | Arch :: X86_64
807+ ) =>
805808 {
806809 return shims:: x86:: EvalContextExt :: emulate_x86_intrinsic (
807810 this, link_name, abi, args, dest,
808811 ) ;
809812 }
810- name if name. starts_with ( "llvm.aarch64." ) && this. tcx . sess . target . arch == "aarch64" => {
813+ name if name. starts_with ( "llvm.aarch64." )
814+ && this. tcx . sess . target . arch == Arch :: AArch64 =>
815+ {
811816 return shims:: aarch64:: EvalContextExt :: emulate_aarch64_intrinsic (
812817 this, link_name, abi, args, dest,
813818 ) ;
814819 }
815820 // FIXME: Move this to an `arm` submodule.
816- "llvm.arm.hint" if this. tcx . sess . target . arch == "arm" => {
821+ "llvm.arm.hint" if this. tcx . sess . target . arch == Arch :: Arm => {
817822 let [ arg] = this. check_shim_sig_lenient ( abi, CanonAbi :: C , link_name, args) ?;
818823 let arg = this. read_scalar ( arg) ?. to_i32 ( ) ?;
819824 // Note that different arguments might have different target feature requirements.
0 commit comments