- Test m_pkthdr.fw_flags against DUMMYNET_MBUF_TAGGED before trying to locate
[dragonfly/netmp.git] / test / sysperf / cld1.c
blob7b3a751d3177090c5d19de90eab6ef481ab191a8
1 /*
2 * cld1.c
4 * $DragonFly: src/test/sysperf/cld1.c,v 1.1 2008/05/09 15:49:42 dillon Exp $
5 */
7 #include "blib.h"
9 static __attribute__ ((noinline)) void dummy_with_cld(void);
10 static __attribute__ ((noinline)) void dummy_without_cld(void);
12 int
13 main(int ac, char **av)
15 long long count = 0;
16 long long max;
17 char c;
18 int j;
20 printf("timing the cld instruction\n");
22 start_timing();
23 while (stop_timing(0, NULL) == 0) {
24 for (j = 0; j < 100; ++j)
25 getuid();
26 count += 100;
28 max = count;
29 start_timing();
30 for (count = 0; count < max; count += 100) {
31 for (j = 0; j < 100; ++j)
32 dummy_without_cld();
34 stop_timing(count, "dummy() - without cld");
36 start_timing();
37 for (count = 0; count < max; count += 100) {
38 for (j = 0; j < 100; ++j)
39 dummy_with_cld();
41 stop_timing(count, "dummy() - with cld");
42 return(0);
45 static
46 __attribute__ ((noinline))
47 void
48 dummy_with_cld(void)
50 volatile int i, j, k;
52 i = 0;
53 j = 0;
54 k = 0;
55 __asm __volatile("cld"::);
58 static
59 __attribute__ ((noinline))
60 void
61 dummy_without_cld(void)
63 volatile int i, j, k;
65 i = 0;
66 j = 0;
67 k = 0;