@@ -479,11 +479,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
479
479
let llptr = self . struct_gep ( place. llval , i as u64 ) ;
480
480
let load = self . load ( llptr, align) ;
481
481
scalar_load_metadata ( self , load, scalar) ;
482
- if scalar. is_bool ( ) {
483
- self . trunc ( load, self . type_i1 ( ) )
484
- } else {
485
- load
486
- }
482
+ if scalar. is_bool ( ) { self . trunc ( load, self . type_i1 ( ) ) } else { load }
487
483
} ;
488
484
489
485
OperandValue :: Pair (
@@ -658,6 +654,9 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
658
654
}
659
655
660
656
fn fptoui_sat ( & mut self , val : & ' ll Value , dest_ty : & ' ll Type ) -> Option < & ' ll Value > {
657
+ // WebAssembly has saturating floating point to integer casts if the
658
+ // `nontrapping-fptoint` target feature is activated. We'll use those if
659
+ // they are available.
661
660
if self . sess ( ) . target . target . arch == "wasm32"
662
661
&& self . sess ( ) . target_features . contains ( & sym:: wasm_nontrapping_fptoint)
663
662
{
@@ -680,6 +679,9 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
680
679
}
681
680
682
681
fn fptosi_sat ( & mut self , val : & ' ll Value , dest_ty : & ' ll Type ) -> Option < & ' ll Value > {
682
+ // WebAssembly has saturating floating point to integer casts if the
683
+ // `nontrapping-fptoint` target feature is activated. We'll use those if
684
+ // they are available.
683
685
if self . sess ( ) . target . target . arch == "wasm32"
684
686
&& self . sess ( ) . target_features . contains ( & sym:: wasm_nontrapping_fptoint)
685
687
{
0 commit comments