Module Name:    src
Committed By:   bouyer
Date:           Wed May 21 21:00:43 UTC 2014

Modified Files:
        src/usr.bin/nbperf [netbsd-6]: nbperf-bdz.c

Log Message:
Pull up following revision(s) (requested by joerg in ticket #1059):
        usr.bin/nbperf/nbperf-bdz.c: revision 1.9 via patch
Most CPUs implement shifts modulo the width, but ARM doesn't. Don't
depend on this UB.


To generate a diff of this commit:
cvs rdiff -u -r1.4.4.2 -r1.4.4.3 src/usr.bin/nbperf/nbperf-bdz.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/nbperf/nbperf-bdz.c
diff -u src/usr.bin/nbperf/nbperf-bdz.c:1.4.4.2 src/usr.bin/nbperf/nbperf-bdz.c:1.4.4.3
--- src/usr.bin/nbperf/nbperf-bdz.c:1.4.4.2	Thu Feb 14 22:06:18 2013
+++ src/usr.bin/nbperf/nbperf-bdz.c	Wed May 21 21:00:43 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: nbperf-bdz.c,v 1.4.4.2 2013/02/14 22:06:18 jdc Exp $	*/
+/*	$NetBSD: nbperf-bdz.c,v 1.4.4.3 2014/05/21 21:00:43 bouyer Exp $	*/
 /*-
  * Copyright (c) 2009, 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -36,7 +36,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: nbperf-bdz.c,v 1.4.4.2 2013/02/14 22:06:18 jdc Exp $");
+__RCSID("$NetBSD: nbperf-bdz.c,v 1.4.4.3 2014/05/21 21:00:43 bouyer Exp $");
 
 #include <err.h>
 #include <inttypes.h>
@@ -240,7 +240,7 @@ print_hash(struct nbperf *nbperf, struct
 	fprintf(nbperf->output,
 	    "\tidx2 = idx - holes64[idx >> 6] - holes64k[idx >> 16];\n"
 	    "\tidx2 -= popcount64(g1[idx >> 6] & g2[idx >> 6]\n"
-	    "\t                   & (((uint64_t)1 << idx) - 1));\n"
+	    "\t                   & (((uint64_t)1 << (idx & 63)) - 1));\n"
 	    "\treturn idx2;");
 
 	fprintf(nbperf->output, "}\n");

Reply via email to