@@ -20,6 +20,7 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
20
20
dest : & PlaceTy < ' tcx , Provenance > ,
21
21
) -> InterpResult < ' tcx , EmulateForeignItemResult > {
22
22
let this = self . eval_context_mut ( ) ;
23
+ this. expect_target_feature_for_intrinsic ( link_name, "sse2" ) ?;
23
24
// Prefix should have already been checked.
24
25
let unprefixed_name = link_name. as_str ( ) . strip_prefix ( "llvm.x86.sse2." ) . unwrap ( ) ;
25
26
@@ -473,10 +474,8 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
473
474
let [ left, right, imm] =
474
475
this. check_shim ( abi, Abi :: C { unwind : false } , link_name, args) ?;
475
476
476
- let which = FloatBinOp :: cmp_from_imm (
477
- this. read_scalar ( imm) ?. to_i8 ( ) ?,
478
- "llvm.x86.sse2.cmp.sd" ,
479
- ) ?;
477
+ let which =
478
+ FloatBinOp :: cmp_from_imm ( this, this. read_scalar ( imm) ?. to_i8 ( ) ?, link_name) ?;
480
479
481
480
bin_op_simd_float_first :: < Double > ( this, which, left, right, dest) ?;
482
481
}
@@ -492,10 +491,8 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
492
491
let [ left, right, imm] =
493
492
this. check_shim ( abi, Abi :: C { unwind : false } , link_name, args) ?;
494
493
495
- let which = FloatBinOp :: cmp_from_imm (
496
- this. read_scalar ( imm) ?. to_i8 ( ) ?,
497
- "llvm.x86.sse2.cmp.pd" ,
498
- ) ?;
494
+ let which =
495
+ FloatBinOp :: cmp_from_imm ( this, this. read_scalar ( imm) ?. to_i8 ( ) ?, link_name) ?;
499
496
500
497
bin_op_simd_float_all :: < Double > ( this, which, left, right, dest) ?;
501
498
}
0 commit comments