Patchwork [libgcc] : Use __builtin_expect when checking for soft-fp exceptions

login
register
mail settings
Submitter Uros Bizjak
Date June 17, 2012, 1:54 p.m.
Message ID <CAFULd4Yx_+==EPzamRhk1E3=NcNvjWFw18wKABFSrjzsfpWXBw@mail.gmail.com>
Download mbox | patch
Permalink /patch/165341/
State New
Headers show

Comments

Uros Bizjak - June 17, 2012, 1:54 p.m.
Hello!

2012-06-17  Uros Bizjak  <ubizjak@gmail.com>

	* config/i386/sfp-machine.h (FP_HANDLE_EXCEPTIONS): Use
	__builtin_expect when checking for exceptions.
	* config/ia64/sfp-machine.h (FP_HANDLE_EXCEPTIONS): Ditto.

Tested on x86_64-pc-linux-gnu {,-m32} and ia64-unknown-linux-gnu,
committed to mainline SVN.

Uros.

Patch

Index: config/ia64/sfp-machine.h
===================================================================
--- config/ia64/sfp-machine.h	(revision 188696)
+++ config/ia64/sfp-machine.h	(working copy)
@@ -60,7 +60,7 @@ 
 
 #define FP_HANDLE_EXCEPTIONS			\
   do {						\
-    if (_fex)					\
+    if (__builtin_expect (_fex, 0))		\
       __sfp_handle_exceptions (_fex);		\
   } while (0);
 
Index: config/i386/sfp-machine.h
===================================================================
--- config/i386/sfp-machine.h	(revision 188696)
+++ config/i386/sfp-machine.h	(working copy)
@@ -51,7 +51,7 @@ 
 
 #define FP_HANDLE_EXCEPTIONS			\
   do {						\
-    if (_fex)					\
+    if (__builtin_expect (_fex, 0))		\
       __sfp_handle_exceptions (_fex);		\
   } while (0);