@@ -197,7 +197,9 @@ fn bool_to_zero_or_max_uint<'tcx>(
197197 ty => ty,
198198 } ;
199199
200- let val = fx. bcx . ins ( ) . bint ( int_ty, val) ;
200+ let val = if int_ty == types:: I8 { val } else { fx. bcx . ins ( ) . uextend ( int_ty, val) } ;
201+
202+ // FIXME use bmask instead
201203 let mut res = fx. bcx . ins ( ) . ineg ( val) ;
202204
203205 if ty. is_float ( ) {
@@ -938,8 +940,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
938940 let old = fx. bcx . ins ( ) . atomic_cas ( MemFlags :: trusted ( ) , ptr, test_old, new) ;
939941 let is_eq = fx. bcx . ins ( ) . icmp ( IntCC :: Equal , old, test_old) ;
940942
941- let ret_val =
942- CValue :: by_val_pair ( old, fx. bcx . ins ( ) . bint ( types:: I8 , is_eq) , ret. layout ( ) ) ;
943+ let ret_val = CValue :: by_val_pair ( old, is_eq, ret. layout ( ) ) ;
943944 ret. write_cvalue ( fx, ret_val)
944945 }
945946
@@ -1261,8 +1262,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
12611262 flags. set_notrap ( ) ;
12621263 let lhs_val = fx. bcx . ins ( ) . load ( clty, flags, lhs_ref, 0 ) ;
12631264 let rhs_val = fx. bcx . ins ( ) . load ( clty, flags, rhs_ref, 0 ) ;
1264- let eq = fx. bcx . ins ( ) . icmp ( IntCC :: Equal , lhs_val, rhs_val) ;
1265- fx. bcx . ins ( ) . bint ( types:: I8 , eq)
1265+ fx. bcx . ins ( ) . icmp ( IntCC :: Equal , lhs_val, rhs_val)
12661266 } else {
12671267 // Just call `memcmp` (like slices do in core) when the
12681268 // size is too large or it's not a power-of-two.
@@ -1272,8 +1272,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
12721272 let returns = vec ! [ AbiParam :: new( types:: I32 ) ] ;
12731273 let args = & [ lhs_ref, rhs_ref, bytes_val] ;
12741274 let cmp = fx. lib_call ( "memcmp" , params, returns, args) [ 0 ] ;
1275- let eq = fx. bcx . ins ( ) . icmp_imm ( IntCC :: Equal , cmp, 0 ) ;
1276- fx. bcx . ins ( ) . bint ( types:: I8 , eq)
1275+ fx. bcx . ins ( ) . icmp_imm ( IntCC :: Equal , cmp, 0 )
12771276 } ;
12781277 ret. write_cvalue ( fx, CValue :: by_val ( is_eq_value, ret. layout ( ) ) ) ;
12791278 }
0 commit comments