mirror of
				https://sourceware.org/git/glibc.git
				synced 2025-11-03 20:53:13 +03:00 
			
		
		
		
	math: Optimize fma call on acospif
The fma is required only for inputs less than 0x1.0fd288p-127. Also only add the extra check for !__FP_FAST_FMA targets. Checked on x86_64-linux-gnu and aarch64-linux-gnu. Reviewed-by: Paul Zimmermann <Paul.Zimmermann@inria.fr>
This commit is contained in:
		@@ -67,7 +67,12 @@ __acospif (float x)
 | 
				
			|||||||
      /* For |x| <= 0x1.0fd288p-127, c0 += c4*(z4*z4) would raise a spurious
 | 
					      /* For |x| <= 0x1.0fd288p-127, c0 += c4*(z4*z4) would raise a spurious
 | 
				
			||||||
	 underflow exception, we use an FMA instead, where c4 * z4 does not
 | 
						 underflow exception, we use an FMA instead, where c4 * z4 does not
 | 
				
			||||||
	 underflow. */
 | 
						 underflow. */
 | 
				
			||||||
      c0 = fma (c4 * z4, z4, c0);
 | 
					#ifndef __FP_FAST_FMA
 | 
				
			||||||
 | 
					      if (__glibc_likely (ax > 0x1.0fd288p-127))
 | 
				
			||||||
 | 
						c0 = (c4 * z4) * z4 + c0;
 | 
				
			||||||
 | 
					      else
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
						c0 = fma (c4 * z4, z4, c0);
 | 
				
			||||||
      return 0.5 - z * c0;
 | 
					      return 0.5 - z * c0;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  else
 | 
					  else
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user