File: wrapped-string.c

package info (click to toggle)
indent 2.2.13-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,696 kB
  • sloc: ansic: 20,903; sh: 5,035; makefile: 165; sed: 16; cpp: 5
file content (49 lines) | stat: -rw-r--r-- 879 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <stdio.h>
int
main ()
{
  char *format = "\
%c %c %c
%c %c %c
%c %c %c\n";

  printf (format, '1', '2', '3', '4', '5', '6', '7', '8', '9');
}

static inline void
__generic_memcpy_fromfs (void *to, const void *from, unsigned long n)
{
  __asm__ volatile ("	cld
		cmpl $3,%0
		jbe 1f
		movl %%edi,%%ecx
		negl %%ecx
		andl $3,%%ecx
		subl %%ecx,%0
		fs; rep; movsb
		movl %0,%%ecx
		shrl $2,%%ecx
		fs; rep; movsl
		andl $3,%0
	1:	movl %0,%%ecx
		fs; rep; movsb");
}

static inline void
__generic_memcpy_fromfs (void *to, const void *from, unsigned long n)
{
  __asm__ volatile ("	cld
		cmpl $3,%0
		jbe 1f
		movl %%edi,%%ecx
		negl %%ecx
		andl $3,%%ecx
		subl %%ecx,%0
		fs; rep; movsb
		movl %0,%%ecx
		shrl $2,%%ecx
		fs; rep; movsl
		andl $3,%0
	1:	movl %0,%%ecx
		fs; rep; movsb":"=abd" (n):"0" (n), "D" ((long) to), "S" ((long) from):"cx", "di", "si", "memory");
}