This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix some issues in the benchmark and adapt PowerPC code to the mpa changes


Hi Siddhesh,

I had to modify the code in order to make the benchmark and libm-mpa changes
work on PowerPC.

Before applying this patch, I also suggest you to cherry-pick ed689c2f as it
fixes a build problem on PowerPC.

8<----

2013-01-30  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>

	* Rules (bench): Fix the evaluation of $(run-bench).
	* benchtests/bench-skeleton.c: Fix uint64_t printing.
	* sysdeps/powerpc/powerpc32/power4/fpu/mpa.c: Use long wherever
	possible.
	* sysdeps/powerpc/powerpc64/power4/fpu/mpa.c: Likewise.
---
 Rules                                      |    2 +-
 benchtests/bench-skeleton.c                |    6 ++++--
 sysdeps/powerpc/powerpc32/power4/fpu/mpa.c |    2 +-
 sysdeps/powerpc/powerpc64/power4/fpu/mpa.c |    2 +-
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/Rules b/Rules
index 22ffe4c..6196548 100644
--- a/Rules
+++ b/Rules
@@ -215,7 +215,7 @@ bench: $(binaries-bench)
 	  mv -f $(objpfx)bench.out $(objpfx)bench.out.old; \
 	fi
 	for run in $^; do \
-	  $(run-bench) >>  $(objpfx)bench.out; \
+	  eval $(run-bench) >>  $(objpfx)bench.out; \
 	done
 
 $(binaries-bench): %: %.o \
diff --git a/benchtests/bench-skeleton.c b/benchtests/bench-skeleton.c
index 1dd1de7..d896ad9 100644
--- a/benchtests/bench-skeleton.c
+++ b/benchtests/bench-skeleton.c
@@ -20,6 +20,7 @@
 #include <stdint.h>
 #include <stdio.h>
 #include <time.h>
+#include <inttypes.h>
 
 int
 main (int argc, char **argv)
@@ -52,6 +53,7 @@ main (int argc, char **argv)
 	}
     }
 
-  printf (FUNCNAME ": TOTAL: %ldns, MAX: %ldns, MIN: %ldns, AVG: %lfns\n",
-	  total, max, min, (double) total / (ITER * NUM_SAMPLES));
+  printf (FUNCNAME ": TOTAL: %"PRId64"ns, MAX: %"PRId64"ns, "
+	  "MIN: %"PRId64"ns, AVG: %lfns\n", total, max, min,
+	  (double) total / (ITER * NUM_SAMPLES));
 }
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c b/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c
index b1784f2..71adbbb 100644
--- a/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c
+++ b/sysdeps/powerpc/powerpc32/power4/fpu/mpa.c
@@ -68,7 +68,7 @@ mcr (const mp_no *x, const mp_no *y, int p)
 }
 
 /* Compare the absolute values of two multiple precision numbers.  */
-int
+long
 __acr (const mp_no *x, const mp_no *y, int p)
 {
   long i;
diff --git a/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c b/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c
index b1784f2..71adbbb 100644
--- a/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c
+++ b/sysdeps/powerpc/powerpc64/power4/fpu/mpa.c
@@ -68,7 +68,7 @@ mcr (const mp_no *x, const mp_no *y, int p)
 }
 
 /* Compare the absolute values of two multiple precision numbers.  */
-int
+long
 __acr (const mp_no *x, const mp_no *y, int p)
 {
   long i;
-- 
1.7.7.6


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]