@@ -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,24 @@ 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 ! (
804+ this. tcx. sess. target. arch,
805+ Arch :: X86 | Arch :: X86_64
806+ ) =>
804807 {
805808 return shims:: x86:: EvalContextExt :: emulate_x86_intrinsic (
806809 this, link_name, abi, args, dest,
807810 ) ;
808811 }
809- name if name. starts_with ( "llvm.aarch64." ) && this. tcx . sess . target . arch == "aarch64" => {
812+ name if name. starts_with ( "llvm.aarch64." )
813+ && this. tcx . sess . target . arch == Arch :: AArch64 =>
814+ {
810815 return shims:: aarch64:: EvalContextExt :: emulate_aarch64_intrinsic (
811816 this, link_name, abi, args, dest,
812817 ) ;
813818 }
814819 // FIXME: Move this to an `arm` submodule.
815- "llvm.arm.hint" if this. tcx . sess . target . arch == "arm" => {
820+ "llvm.arm.hint" if this. tcx . sess . target . arch == Arch :: Arm => {
816821 let [ arg] = this. check_shim_sig_lenient ( abi, CanonAbi :: C , link_name, args) ?;
817822 let arg = this. read_scalar ( arg) ?. to_i32 ( ) ?;
818823 // Note that different arguments might have different target feature requirements.
0 commit comments