X86-64: Add dummy memcopy.h and wordcopy.c

Message ID 20160608210059.GA6694@intel.com
State New, archived
Headers

Commit Message

Lu, Hongjiu June 8, 2016, 9 p.m. UTC
  Since x86-64 no longer uses memory copy functions, add dummy memcopy.h
and wordcopy.c to reduce code size.  It reduces the size of libc.so by
about 1 KB.

Tested on x86-64.  I will check it in shortly.

H.J.
---
	* sysdeps/x86_64/memcopy.h: New file.
	* sysdeps/x86_64/wordcopy.c: Likewise.
---
 sysdeps/x86_64/memcopy.h  | 1 +
 sysdeps/x86_64/wordcopy.c | 1 +
 2 files changed, 2 insertions(+)
 create mode 100644 sysdeps/x86_64/memcopy.h
 create mode 100644 sysdeps/x86_64/wordcopy.c
  

Comments

Florian Weimer June 9, 2016, 12:53 p.m. UTC | #1
On 06/08/2016 11:00 PM, H.J. Lu wrote:
> +/* X86-64 doesn't use memory copy functions.  */

> +/* X86-64 doesn't use memory copy functions.  */

Does this mean “any generic memory copying functions”?

Thanks,
Florian
  
H.J. Lu June 9, 2016, 1:12 p.m. UTC | #2
On Thu, Jun 9, 2016 at 5:53 AM, Florian Weimer <fweimer@redhat.com> wrote:
> On 06/08/2016 11:00 PM, H.J. Lu wrote:
>>
>> +/* X86-64 doesn't use memory copy functions.  */
>
>
>> +/* X86-64 doesn't use memory copy functions.  */
>
>
> Does this mean “any generic memory copying functions”?

It means that x86-64 doesn't use string/wordcopy.c nor
sysdeps/generic/memcopy.h.
  
Roland McGrath June 10, 2016, 9:59 p.m. UTC | #3
There's no reason for the header, since sysdeps/generic/memcopy.h is just a
header.  In an x86_64 build, nothing should #include it and so that's fine.

The files outside string/ that #include <memcopy.h> do so for no reason at
all and those lines should just be removed from all of them.

wordcopy.c is probably unused on several architectures.  One approach would
be to just drop it from routines in string/Makefile and add it via
sysdep_routines for machines that actually need it.  That doesn't seem
quite right because generic string/foo.c uses it, but every architecture
having a dummy file seems icky.
  

Patch

diff --git a/sysdeps/x86_64/memcopy.h b/sysdeps/x86_64/memcopy.h
new file mode 100644
index 0000000..590b6cb
--- /dev/null
+++ b/sysdeps/x86_64/memcopy.h
@@ -0,0 +1 @@ 
+/* X86-64 doesn't use memory copy functions.  */
diff --git a/sysdeps/x86_64/wordcopy.c b/sysdeps/x86_64/wordcopy.c
new file mode 100644
index 0000000..590b6cb
--- /dev/null
+++ b/sysdeps/x86_64/wordcopy.c
@@ -0,0 +1 @@ 
+/* X86-64 doesn't use memory copy functions.  */