|
From: <sv...@va...> - 2005-07-06 20:23:19
|
Author: sewardj
Date: 2005-07-06 21:22:16 +0100 (Wed, 06 Jul 2005)
New Revision: 4120
Log:
This is x86 specific; re-home accordingly.
Added:
trunk/none/tests/x86/yield.c
trunk/none/tests/x86/yield.stderr.exp
trunk/none/tests/x86/yield.stdout.exp
trunk/none/tests/x86/yield.vgtest
Removed:
trunk/none/tests/yield.c
trunk/none/tests/yield.stderr.exp
trunk/none/tests/yield.stdout.exp
trunk/none/tests/yield.vgtest
Modified:
trunk/none/tests/Makefile.am
trunk/none/tests/x86/Makefile.am
Modified: trunk/none/tests/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/Makefile.am 2005-07-06 20:03:43 UTC (rev 4119)
+++ trunk/none/tests/Makefile.am 2005-07-06 20:22:16 UTC (rev 4120)
@@ -96,8 +96,7 @@
threadederrno.stderr.exp threadederrno.stdout.exp \
threadederrno.vgtest \
tls.stderr.exp tls.stdout.exp \
- vgprintf.stderr.exp vgprintf.stdout.exp vgprintf.vgtest \
- yield.stderr.exp yield.stdout.exp yield.vgtest
+ vgprintf.stderr.exp vgprintf.stdout.exp vgprintf.vgtest
=20
check_PROGRAMS =3D \
ansi args as_mmap as_shm \
@@ -117,7 +116,7 @@
shortpush shorts stackgrowth sigstackgrowth susphello \
syscall-restart1 syscall-restart2 system \
thread-exits threaded-fork threadederrno \
- tls tls.so tls2.so yield vgprintf \
+ tls tls.so tls2.so vgprintf \
coolo_sigaction gxx304
=20
AM_CFLAGS =3D $(WERROR) -Winline -Wall -Wshadow -g
@@ -158,8 +157,6 @@
tls_so_CFLAGS =3D -fPIC
tls2_so_SOURCES =3D tls2_so.c
tls2_so_LDFLAGS =3D -shared
-yield_CFLAGS =3D $(AM_CFLAGS) -D__$(VG_ARCH)__
-yield_LDADD =3D -lpthread
=20
# C++ tests
coolo_sigaction_SOURCES =3D coolo_sigaction.cpp
Modified: trunk/none/tests/x86/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/x86/Makefile.am 2005-07-06 20:03:43 UTC (rev 4119)
+++ trunk/none/tests/x86/Makefile.am 2005-07-06 20:22:16 UTC (rev 4120)
@@ -18,12 +18,13 @@
pushpopseg.stderr.exp pushpopseg.stdout.exp pushpopseg.vgtest \
seg_override.stderr.exp seg_override.stdout.exp seg_override.vgtest \
sigcontext.stdout.exp sigcontext.stderr.exp sigcontext.vgtest \
- smc1.stderr.exp smc1.stdout.exp smc1.vgtest
+ smc1.stderr.exp smc1.stdout.exp smc1.vgtest \
+ yield.stderr.exp yield.stdout.exp yield.vgtest
=20
check_PROGRAMS =3D \
badseg bt_everything bt_literal cpuid fpu_lazy_eflags \
getseg $(INSN_TESTS) \
- int pushpopseg seg_override sigcontext smc1
+ int pushpopseg seg_override sigcontext smc1 yield
=20
AM_CFLAGS =3D $(WERROR) -Winline -Wall -Wshadow \
-g -I$(top_srcdir)/include \
@@ -49,6 +50,8 @@
insn_sse_LDADD =3D -lm
insn_sse2_SOURCES =3D insn_sse2.def
insn_sse2_LDADD =3D -lm
+yield_CFLAGS =3D $(AM_CFLAGS) -D__$(VG_ARCH)__
+yield_LDADD =3D -lpthread
=20
.def.c: $(srcdir)/gen_insn_test.pl
$(PERL) $(srcdir)/gen_insn_test.pl < $< > $@
Copied: trunk/none/tests/x86/yield.c (from rev 4114, trunk/none/tests/yie=
ld.c)
Copied: trunk/none/tests/x86/yield.stderr.exp (from rev 4114, trunk/none/=
tests/yield.stderr.exp)
Copied: trunk/none/tests/x86/yield.stdout.exp (from rev 4114, trunk/none/=
tests/yield.stdout.exp)
Copied: trunk/none/tests/x86/yield.vgtest (from rev 4114, trunk/none/test=
s/yield.vgtest)
Deleted: trunk/none/tests/yield.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/yield.c 2005-07-06 20:03:43 UTC (rev 4119)
+++ trunk/none/tests/yield.c 2005-07-06 20:22:16 UTC (rev 4120)
@@ -1,93 +0,0 @@
-/*=20
- Check that a thread which yields with pause (rep;nop) makes less
- progress against a pure spinner.
- */
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-static pthread_mutex_t m_go =3D PTHREAD_MUTEX_INITIALIZER;
-static pthread_cond_t c_go =3D PTHREAD_COND_INITIALIZER;
-static pthread_cond_t c_running =3D PTHREAD_COND_INITIALIZER;
-
-static volatile int alive, running;
-
-static int spin;
-static int rep_nop;
-
-static void *spinner(void *v)
-{
- pthread_mutex_lock(&m_go);
- while(!alive)
- pthread_cond_wait(&c_go, &m_go);
- running++;
- pthread_cond_signal(&c_running);
- pthread_mutex_unlock(&m_go);
-
- while(alive)
- spin++;
-
- return 0;
-}
-
-static void *rep_nopper(void *v)
-{
- pthread_mutex_lock(&m_go);
- while(!alive)
- pthread_cond_wait(&c_go, &m_go);
- running++;
- pthread_cond_signal(&c_running);
- pthread_mutex_unlock(&m_go);
-
- while(alive) {
- rep_nop++;
-#ifdef __x86__
- // This gives a hint to a P4, telling it to pause=20
- // (ie. we're in a spin-wait loop)
- asm volatile ("rep; nop" : : : "memory");
-#endif
- }
-
- return 0;
-}
-
-int main()
-{
-#if defined(__powerpc__)
- printf("PASS\n");
-#else
- pthread_t a, b;
-
- pthread_create(&a, NULL, spinner, NULL);
- pthread_create(&b, NULL, rep_nopper, NULL);
-
- /* make sure both threads start at the same time */
- pthread_mutex_lock(&m_go);
- alive =3D 1;
- pthread_cond_broadcast(&c_go);
-
- /* make sure they both get started */
- while(running < 2)
- pthread_cond_wait(&c_running, &m_go);
- pthread_mutex_unlock(&m_go);
-
- sleep(2);
-
- alive =3D 0;
- pthread_join(a, NULL);
- pthread_join(b, NULL);
-
- if (0)
- printf("spin=3D%d rep_nop=3D%d rep_nop:spin ratio: %g\n",=20
- spin, rep_nop, (float)rep_nop / spin);
-
- if (spin > rep_nop)
- printf("PASS\n");
- else
- printf("FAIL spin=3D%d rep_nop=3D%d rep_nop:spin ratio: %g\n",=20
- spin, rep_nop, (float)rep_nop / spin);
-#endif
-
- return 0;
-}
Deleted: trunk/none/tests/yield.stderr.exp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/yield.stderr.exp 2005-07-06 20:03:43 UTC (rev 4119)
+++ trunk/none/tests/yield.stderr.exp 2005-07-06 20:22:16 UTC (rev 4120)
@@ -1,2 +0,0 @@
-
-
Deleted: trunk/none/tests/yield.stdout.exp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/yield.stdout.exp 2005-07-06 20:03:43 UTC (rev 4119)
+++ trunk/none/tests/yield.stdout.exp 2005-07-06 20:22:16 UTC (rev 4120)
@@ -1 +0,0 @@
-PASS
Deleted: trunk/none/tests/yield.vgtest
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/yield.vgtest 2005-07-06 20:03:43 UTC (rev 4119)
+++ trunk/none/tests/yield.vgtest 2005-07-06 20:22:16 UTC (rev 4120)
@@ -1 +0,0 @@
-prog: yield
|