about summary refs log tree commit diff
path: root/sysdeps/powerpc/fpu/feholdexcpt.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>2014-04-28 14:38:24 -0500
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>2014-04-29 07:05:39 -0500
commit18f2945ae9216cfcd53a162080a73e3d719de9e6 (patch)
tree8d529fe01c41f0d3c6dd290aa69dbf4e5d6e083f /sysdeps/powerpc/fpu/feholdexcpt.c
parent5abebba403181de898bbea4ee1bcce5f088c663b (diff)
downloadglibc-18f2945ae9216cfcd53a162080a73e3d719de9e6.tar.gz
glibc-18f2945ae9216cfcd53a162080a73e3d719de9e6.tar.xz
glibc-18f2945ae9216cfcd53a162080a73e3d719de9e6.zip
PowerPC: Suppress unnecessary FPSCR write
This patch optimizes the FPSCR update on exception and rounding change
functions by just updating its value if new value if different from
current one.  It also optimizes fedisableexcept and feenableexcept by
removing an unecessary FPSCR read.
Diffstat (limited to 'sysdeps/powerpc/fpu/feholdexcpt.c')
-rw-r--r--sysdeps/powerpc/fpu/feholdexcpt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sysdeps/powerpc/fpu/feholdexcpt.c b/sysdeps/powerpc/fpu/feholdexcpt.c
index 1375a2f5ad..764dd38f3d 100644
--- a/sysdeps/powerpc/fpu/feholdexcpt.c
+++ b/sysdeps/powerpc/fpu/feholdexcpt.c
@@ -32,6 +32,9 @@ feholdexcept (fenv_t *envp)
      flag.  */
   new.l = old.l & 0xffffffff00000007LL;
 
+  if (new.l == old.l)
+    return 0;
+
   /* If the old env had any enabled exceptions, then mask SIGFPE in the
      MSR FE0/FE1 bits.  This may allow the FPU to run faster because it
      always takes the default action and can not generate SIGFPE. */