From d6e97a1da05c1be8ac4cc2f735a98181c457d90b Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 9 Jan 2012 18:59:04 -0500 Subject: Some branch prediction for log1p --- sysdeps/ieee754/dbl-64/s_log1p.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sysdeps') diff --git a/sysdeps/ieee754/dbl-64/s_log1p.c b/sysdeps/ieee754/dbl-64/s_log1p.c index dc79a02..f82048f 100644 --- a/sysdeps/ieee754/dbl-64/s_log1p.c +++ b/sysdeps/ieee754/dbl-64/s_log1p.c @@ -106,11 +106,11 @@ __log1p(double x) k = 1; if (hx < 0x3FDA827A) { /* x < 0.41422 */ - if(ax>=0x3ff00000) { /* x <= -1.0 */ + if(__builtin_expect(ax>=0x3ff00000, 0)) { /* x <= -1.0 */ if(x==-1.0) return -two54/(x-x);/* log1p(-1)=+inf */ else return (x-x)/(x-x); /* log1p(x<-1)=NaN */ } - if(ax<0x3e200000) { /* |x| < 2**-29 */ + if(__builtin_expect(ax<0x3e200000, 0)) { /* |x| < 2**-29 */ math_force_eval(two54+x); /* raise inexact */ if (ax<0x3c900000) /* |x| < 2**-54 */ return x; @@ -120,7 +120,7 @@ __log1p(double x) if(hx>0||hx<=((int32_t)0xbfd2bec3)) { k=0;f=x;hu=1;} /* -0.2929= 0x7ff00000) return x+x; + else if (__builtin_expect(hx >= 0x7ff00000, 0)) return x+x; if(k!=0) { if(hx<0x43400000) { u = 1.0+x; -- cgit v1.1