@@ -971,24 +971,44 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
971971
972972 fn fadd_fast ( & mut self , lhs : RValue < ' gcc > , rhs : RValue < ' gcc > ) -> RValue < ' gcc > {
973973 // NOTE: it seems like we cannot enable fast-mode for a single operation in GCC.
974+ if let Some ( value) =
975+ self . f16_arithmetic_binary_op ( lhs, rhs, |this, lhs, rhs| this. assign_to_var ( lhs + rhs) )
976+ {
977+ return value;
978+ }
974979 let result = set_rvalue_location ( self , lhs + rhs) ;
975980 self . assign_to_var ( result)
976981 }
977982
978983 fn fsub_fast ( & mut self , lhs : RValue < ' gcc > , rhs : RValue < ' gcc > ) -> RValue < ' gcc > {
979984 // NOTE: it seems like we cannot enable fast-mode for a single operation in GCC.
985+ if let Some ( value) =
986+ self . f16_arithmetic_binary_op ( lhs, rhs, |this, lhs, rhs| this. assign_to_var ( lhs - rhs) )
987+ {
988+ return value;
989+ }
980990 let result = set_rvalue_location ( self , lhs - rhs) ;
981991 self . assign_to_var ( result)
982992 }
983993
984994 fn fmul_fast ( & mut self , lhs : RValue < ' gcc > , rhs : RValue < ' gcc > ) -> RValue < ' gcc > {
985995 // NOTE: it seems like we cannot enable fast-mode for a single operation in GCC.
996+ if let Some ( value) =
997+ self . f16_arithmetic_binary_op ( lhs, rhs, |this, lhs, rhs| this. assign_to_var ( lhs * rhs) )
998+ {
999+ return value;
1000+ }
9861001 let result = set_rvalue_location ( self , lhs * rhs) ;
9871002 self . assign_to_var ( result)
9881003 }
9891004
9901005 fn fdiv_fast ( & mut self , lhs : RValue < ' gcc > , rhs : RValue < ' gcc > ) -> RValue < ' gcc > {
9911006 // NOTE: it seems like we cannot enable fast-mode for a single operation in GCC.
1007+ if let Some ( value) =
1008+ self . f16_arithmetic_binary_op ( lhs, rhs, |this, lhs, rhs| this. assign_to_var ( lhs / rhs) )
1009+ {
1010+ return value;
1011+ }
9921012 let result = set_rvalue_location ( self , lhs / rhs) ;
9931013 self . assign_to_var ( result)
9941014 }
0 commit comments