diff mbox

[v2,01/16] Parameterize op_t from memcopy.h

Message ID 20161221230605.28638-2-rth@twiddle.net
State New
Headers show

Commit Message

Richard Henderson Dec. 21, 2016, 11:05 p.m. UTC
* sysdeps/generic/string-optype.h: New file.
	* sysdeps/generic/memcopy.h: Include it.
---
 sysdeps/generic/memcopy.h       |  7 +++----
 sysdeps/generic/string-optype.h | 31 +++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 4 deletions(-)
 create mode 100644 sysdeps/generic/string-optype.h
diff mbox

Patch

diff --git a/sysdeps/generic/memcopy.h b/sysdeps/generic/memcopy.h
index fe9aa60..38f27a8 100644
--- a/sysdeps/generic/memcopy.h
+++ b/sysdeps/generic/memcopy.h
@@ -56,10 +56,9 @@ 
      [I fail to understand.  I feel stupid.  --roland]
 */
 
-/* Type to use for aligned memory operations.
-   This should normally be the biggest type supported by a single load
-   and store.  */
-#define	op_t	unsigned long int
+/* Type to use for aligned memory operations.  */
+#include <string-optype.h>
+
 #define OPSIZ	(sizeof(op_t))
 
 /* Type to use for unaligned operations.  */
diff --git a/sysdeps/generic/string-optype.h b/sysdeps/generic/string-optype.h
new file mode 100644
index 0000000..63e5b09
--- /dev/null
+++ b/sysdeps/generic/string-optype.h
@@ -0,0 +1,31 @@ 
+/* string-optype.h -- Define a type to use for word access.  Generic version.
+   Copyright (C) 2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef STRING_OPTYPE_H
+#define STRING_OPTYPE_H 1
+
+/* Use the existing parameterization from gmp as a default.  */
+#include <gmp-mparam.h>
+
+#ifdef _LONG_LONG_LIMB
+typedef unsigned long long int  op_t;
+#else
+typedef unsigned long int       op_t;
+#endif
+
+#endif /* string-optype.h */