Skip to content
Commit a51bc4fe authored by Paul Clarke's avatar Paul Clarke Committed by Gabriel F. T. Gomes
Browse files

Use float in e_sqrt.c

The type used within e_sqrt.c(__slow_ieee754_sqrtf) was, unnecessarily and
likely inadvertently, double.  float is not only appropriate, but also
more efficient, avoiding the need for the compiler to emit a
round-to-single-precision instruction.

This is the difference in compiled code:
 0000000000000000 <__ieee754_sqrtf>:
    0:  2c 08 20 ec     fsqrts  f1,f1
-   4:  18 08 20 fc     frsp    f1,f1
-   8:  20 00 80 4e     blr
+   4:  20 00 80 4e     blr

(Found by Anton Blanchard.)
parent fb25b135
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment