@@ -22,7 +22,7 @@ use rustc_target::{
22
22
} ;
23
23
24
24
use super :: backtrace:: EvalContextExt as _;
25
- use crate :: helpers:: { convert :: Truncate , target_os_is_unix} ;
25
+ use crate :: helpers:: target_os_is_unix;
26
26
use crate :: * ;
27
27
28
28
/// Returned by `emulate_foreign_item_by_name`.
@@ -981,30 +981,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
981
981
throw_unsup_format ! ( "unsupported `llvm.prefetch` type argument: {}" , ty) ;
982
982
}
983
983
}
984
- "llvm.x86.addcarry.64" if this. tcx . sess . target . arch == "x86_64" => {
985
- // Computes u8+u64+u64, returning tuple (u8,u64) comprising the output carry and truncated sum.
986
- let [ c_in, a, b] = this. check_shim ( abi, Abi :: Unadjusted , link_name, args) ?;
987
- let c_in = this. read_scalar ( c_in) ?. to_u8 ( ) ?;
988
- let a = this. read_scalar ( a) ?. to_u64 ( ) ?;
989
- let b = this. read_scalar ( b) ?. to_u64 ( ) ?;
990
-
991
- #[ allow( clippy:: arithmetic_side_effects) ]
992
- // adding two u64 and a u8 cannot wrap in a u128
993
- let wide_sum = u128:: from ( c_in) + u128:: from ( a) + u128:: from ( b) ;
994
- #[ allow( clippy:: arithmetic_side_effects) ] // it's a u128, we can shift by 64
995
- let ( c_out, sum) = ( ( wide_sum >> 64 ) . truncate :: < u8 > ( ) , wide_sum. truncate :: < u64 > ( ) ) ;
996
-
997
- let c_out_field = this. project_field ( dest, 0 ) ?;
998
- this. write_scalar ( Scalar :: from_u8 ( c_out) , & c_out_field) ?;
999
- let sum_field = this. project_field ( dest, 1 ) ?;
1000
- this. write_scalar ( Scalar :: from_u64 ( sum) , & sum_field) ?;
1001
- }
1002
- "llvm.x86.sse2.pause"
1003
- if this. tcx . sess . target . arch == "x86" || this. tcx . sess . target . arch == "x86_64" =>
1004
- {
1005
- let [ ] = this. check_shim ( abi, Abi :: C { unwind : false } , link_name, args) ?;
1006
- this. yield_active_thread ( ) ;
1007
- }
984
+ // FIXME: Move these to an `arm` submodule.
1008
985
"llvm.aarch64.isb" if this. tcx . sess . target . arch == "aarch64" => {
1009
986
let [ arg] = this. check_shim ( abi, Abi :: Unadjusted , link_name, args) ?;
1010
987
let arg = this. read_scalar ( arg) ?. to_i32 ( ) ?;
@@ -1055,13 +1032,11 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
1055
1032
}
1056
1033
}
1057
1034
1058
- name if name. starts_with ( "llvm.x86.sse." ) => {
1059
- return shims:: x86:: sse:: EvalContextExt :: emulate_x86_sse_intrinsic (
1060
- this, link_name, abi, args, dest,
1061
- ) ;
1062
- }
1063
- name if name. starts_with ( "llvm.x86.sse2." ) => {
1064
- return shims:: x86:: sse2:: EvalContextExt :: emulate_x86_sse2_intrinsic (
1035
+ name if name. starts_with ( "llvm.x86." )
1036
+ && ( this. tcx . sess . target . arch == "x86"
1037
+ || this. tcx . sess . target . arch == "x86_64" ) =>
1038
+ {
1039
+ return shims:: x86:: EvalContextExt :: emulate_x86_intrinsic (
1065
1040
this, link_name, abi, args, dest,
1066
1041
) ;
1067
1042
}
0 commit comments