File tree 1 file changed +3
-3
lines changed
compiler/rustc_codegen_llvm/src
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -2368,16 +2368,16 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
2368
2368
// byte swap is no-op for i8/u8
2369
2369
sym:: simd_bswap if int_size == 8 => Ok ( args[ 0 ] . immediate ( ) ) ,
2370
2370
sym:: simd_ctlz | sym:: simd_cttz => {
2371
- // this fun bonus i1 arg means "poison if the arg vector contains zero"
2371
+ // for the (int, i1 immediate) pair, the second arg adds `(0, true) => poison`
2372
2372
let fn_ty = bx. type_func ( & [ vec_ty, bx. type_i1 ( ) ] , vec_ty) ;
2373
+ let dont_poison_on_zero = bx. const_int ( bx. type_i1 ( ) , 0 ) ;
2373
2374
let f = bx. declare_cfn ( llvm_intrinsic, llvm:: UnnamedAddr :: No , fn_ty) ;
2374
2375
Ok ( bx. call (
2375
2376
fn_ty,
2376
2377
None ,
2377
2378
None ,
2378
2379
f,
2379
- // simd_ctlz and simd_cttz are exposed to safe code, so let's not poison anything
2380
- & [ args[ 0 ] . immediate ( ) , bx. const_int ( bx. type_i1 ( ) , 0 ) ] ,
2380
+ & [ args[ 0 ] . immediate ( ) , dont_poison_on_zero] ,
2381
2381
None ,
2382
2382
None ,
2383
2383
) )
You can’t perform that action at this time.
0 commit comments