public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: Use sqrt instruction on mips32 and mips64.
@ 2013-10-03 18:18 Steve Ellcey 
  2013-10-03 19:34 ` Joseph S. Myers
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Ellcey  @ 2013-10-03 18:18 UTC (permalink / raw)
  To: libc-ports

This is a fix for PR 15632.  The mips32 and mips64 glibc builds are not
using the sqrt instruction in the sqrt libm functions.  Each of the new files
is a single line to include mips/fpu/e_sqrt.c (or e_sqrtf.c).  I initially
tried to create mips64/fpu but that did not work so I had to create both
mips64/n32/fpu and mips64/n64/fpu instead.

I did not see any sqrt tests in the glibc performance benchmarks, so I just
ran a test of my own that did a bunch of sqrt operations and compiled it
with -O2 -fno-builtins.  It went from 61 seconds to 17 seconds on my 74k
board.

I also ran the glibc testsuite with the o32, n32, and n64 ABI's to verify
there were no regressions in the testsuite.

Ok to checkin?
	

2013-10-03  Steve Ellcey  <sellcey@mips.com>

	* sysdeps/mips/mips32/fpu/e_sqrt.c: New.
	* sysdeps/mips/mips32/fpu/e_sqrtf.c: New.
	* sysdeps/mips/mips64/n32/fpu/e_sqrt.c: New.
	* sysdeps/mips/mips64/n32/fpu/e_sqrtf.c: New.
	* sysdeps/mips/mips64/n64/fpu/e_sqrt.c: New.
	* sysdeps/mips/mips64/n64/fpu/e_sqrtf.c: New.


diff --git a/ports/sysdeps/mips/mips32/fpu/e_sqrt.c b/ports/sysdeps/mips/mips32/fpu/e_sqrt.c
new file mode 100644
index 0000000..81f4e77
--- /dev/null
+++ b/ports/sysdeps/mips/mips32/fpu/e_sqrt.c
@@ -0,0 +1 @@
+#include <sysdeps/mips/fpu/e_sqrt.c>
diff --git a/ports/sysdeps/mips/mips32/fpu/e_sqrtf.c b/ports/sysdeps/mips/mips32/fpu/e_sqrtf.c
new file mode 100644
index 0000000..fb0700d
--- /dev/null
+++ b/ports/sysdeps/mips/mips32/fpu/e_sqrtf.c
@@ -0,0 +1 @@
+#include <sysdeps/mips/fpu/e_sqrtf.c>
diff --git a/ports/sysdeps/mips/mips64/n32/fpu/e_sqrt.c b/ports/sysdeps/mips/mips64/n32/fpu/e_sqrt.c
new file mode 100644
index 0000000..81f4e77
--- /dev/null
+++ b/ports/sysdeps/mips/mips64/n32/fpu/e_sqrt.c
@@ -0,0 +1 @@
+#include <sysdeps/mips/fpu/e_sqrt.c>
diff --git a/ports/sysdeps/mips/mips64/n32/fpu/e_sqrtf.c b/ports/sysdeps/mips/mips64/n32/fpu/e_sqrtf.c
new file mode 100644
index 0000000..fb0700d
--- /dev/null
+++ b/ports/sysdeps/mips/mips64/n32/fpu/e_sqrtf.c
@@ -0,0 +1 @@
+#include <sysdeps/mips/fpu/e_sqrtf.c>
diff --git a/ports/sysdeps/mips/mips64/n64/fpu/e_sqrt.c b/ports/sysdeps/mips/mips64/n64/fpu/e_sqrt.c
new file mode 100644
index 0000000..81f4e77
--- /dev/null
+++ b/ports/sysdeps/mips/mips64/n64/fpu/e_sqrt.c
@@ -0,0 +1 @@
+#include <sysdeps/mips/fpu/e_sqrt.c>
diff --git a/ports/sysdeps/mips/mips64/n64/fpu/e_sqrtf.c b/ports/sysdeps/mips/mips64/n64/fpu/e_sqrtf.c
new file mode 100644
index 0000000..fb0700d
--- /dev/null
+++ b/ports/sysdeps/mips/mips64/n64/fpu/e_sqrtf.c
@@ -0,0 +1 @@
+#include <sysdeps/mips/fpu/e_sqrtf.c>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] MIPS: Use sqrt instruction on mips32 and mips64.
  2013-10-03 18:18 [PATCH] MIPS: Use sqrt instruction on mips32 and mips64 Steve Ellcey 
@ 2013-10-03 19:34 ` Joseph S. Myers
  0 siblings, 0 replies; 2+ messages in thread
From: Joseph S. Myers @ 2013-10-03 19:34 UTC (permalink / raw)
  To: Steve Ellcey; +Cc: libc-ports

On Thu, 3 Oct 2013, Steve Ellcey  wrote:

> This is a fix for PR 15632.  The mips32 and mips64 glibc builds are not
> using the sqrt instruction in the sqrt libm functions.  Each of the new files
> is a single line to include mips/fpu/e_sqrt.c (or e_sqrtf.c).  I initially
> tried to create mips64/fpu but that did not work so I had to create both
> mips64/n32/fpu and mips64/n64/fpu instead.
> 
> I did not see any sqrt tests in the glibc performance benchmarks, so I just
> ran a test of my own that did a bunch of sqrt operations and compiled it
> with -O2 -fno-builtins.  It went from 61 seconds to 17 seconds on my 74k
> board.
> 
> I also ran the glibc testsuite with the o32, n32, and n64 ABI's to verify
> there were no regressions in the testsuite.
> 
> Ok to checkin?

OK (with of course [BZ #15632] in the ChangeLog.mips entry, and that bug 
number added to the list of fixed bugs in the NEWS file).  It would be a 
good idea to add an architecture-independent sqrt performance test, 
though.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-03 19:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-03 18:18 [PATCH] MIPS: Use sqrt instruction on mips32 and mips64 Steve Ellcey 
2013-10-03 19:34 ` Joseph S. Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).