Changeset cb01e1e in mainline for kernel/test/fpu
- Timestamp:
- 2009-04-04T00:26:27Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a85aebd
- Parents:
- 171f9a1
- Location:
- kernel/test/fpu
- Files:
-
- 7 edited
-
fpu1_ia64.c (modified) (8 diffs)
-
fpu1_skip.c (modified) (1 diff)
-
fpu1_x86.c (modified) (8 diffs)
-
mips2.c (modified) (9 diffs)
-
mips2_skip.c (modified) (1 diff)
-
sse1.c (modified) (11 diffs)
-
sse1_skip.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
kernel/test/fpu/fpu1_ia64.c
r171f9a1 rcb01e1e 64 64 static atomic_t threads_fault; 65 65 static waitq_t can_start; 66 static bool sh_quiet;67 66 68 67 static void e(void *data) … … 86 85 87 86 if ((int) (100000000 * e) != E_10e8) { 88 if (!sh_quiet) 89 printf("tid%" PRIu64 ": e*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8); 87 TPRINTF("tid%" PRIu64 ": e*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8); 90 88 atomic_inc(&threads_fault); 91 89 break; … … 120 118 121 119 if ((int) (1000000 * pi) != PI_10e8) { 122 if (!sh_quiet) 123 printf("tid%" PRIu64 ": pi*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (1000000 * pi), (unative_t) (PI_10e8 / 100)); 120 TPRINTF("tid%" PRIu64 ": pi*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (1000000 * pi), (unative_t) (PI_10e8 / 100)); 124 121 atomic_inc(&threads_fault); 125 122 break; … … 129 126 } 130 127 131 char * test_fpu1(bool quiet)128 char *test_fpu1(void) 132 129 { 133 130 unsigned int i, total = 0; 134 sh_quiet = quiet;135 131 136 132 waitq_initialize(&can_start); … … 138 134 atomic_set(&threads_fault, 0); 139 135 140 if (!quiet) 141 printf("Creating %u threads... ", 2 * THREADS); 136 TPRINTF("Creating %u threads... ", 2 * THREADS); 142 137 143 for (i = 0; i < THREADS; i++) { 138 for (i = 0; i < THREADS; i++) { 144 139 thread_t *t; 145 140 146 141 if (!(t = thread_create(e, NULL, TASK, 0, "e", false))) { 147 if (!quiet) 148 printf("could not create thread %u\n", 2 * i); 142 TPRINTF("could not create thread %u\n", 2 * i); 149 143 break; 150 144 } … … 153 147 154 148 if (!(t = thread_create(pi, NULL, TASK, 0, "pi", false))) { 155 if (!quiet) 156 printf("could not create thread %u\n", 2 * i + 1); 149 TPRINTF("could not create thread %u\n", 2 * i + 1); 157 150 break; 158 151 } … … 161 154 } 162 155 163 if (!quiet) 164 printf("ok\n"); 156 TPRINTF("ok\n"); 165 157 166 158 thread_sleep(1); … … 168 160 169 161 while (atomic_get(&threads_ok) != (long) total) { 170 if (!quiet) 171 printf("Threads left: %d\n", total - atomic_get(&threads_ok)); 162 TPRINTF("Threads left: %d\n", total - atomic_get(&threads_ok)); 172 163 thread_sleep(1); 173 164 } -
kernel/test/fpu/fpu1_skip.c
r171f9a1 rcb01e1e 29 29 #include <test.h> 30 30 31 char * test_fpu1(bool quiet)31 char *test_fpu1(void) 32 32 { 33 33 return NULL; -
kernel/test/fpu/fpu1_x86.c
r171f9a1 rcb01e1e 61 61 static atomic_t threads_fault; 62 62 static waitq_t can_start; 63 static bool sh_quiet;64 63 65 64 static void e(void *data) … … 83 82 84 83 if ((int) (100000000 * e) != E_10e8) { 85 if (!sh_quiet) 86 printf("tid%" PRIu64 ": e*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8); 84 TPRINTF("tid%" PRIu64 ": e*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8); 87 85 atomic_inc(&threads_fault); 88 86 break; … … 117 115 118 116 if ((int) (100000000 * pi) != PI_10e8) { 119 if (!sh_quiet) 120 printf("tid%" PRIu64 ": pi*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (100000000 * pi), (unative_t) PI_10e8); 117 TPRINTF("tid%" PRIu64 ": pi*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (100000000 * pi), (unative_t) PI_10e8); 121 118 atomic_inc(&threads_fault); 122 119 break; … … 126 123 } 127 124 128 char * test_fpu1(bool quiet)125 char *test_fpu1(void) 129 126 { 130 127 unsigned int i, total = 0; 131 sh_quiet = quiet;132 128 133 129 waitq_initialize(&can_start); … … 135 131 atomic_set(&threads_fault, 0); 136 132 137 if (!quiet) 138 printf("Creating %u threads... ", 2 * THREADS); 133 TPRINTF("Creating %u threads... ", 2 * THREADS); 139 134 140 for (i = 0; i < THREADS; i++) { 135 for (i = 0; i < THREADS; i++) { 141 136 thread_t *t; 142 137 143 138 if (!(t = thread_create(e, NULL, TASK, 0, "e", false))) { 144 if (!quiet) 145 printf("could not create thread %u\n", 2 * i); 139 TPRINTF("could not create thread %u\n", 2 * i); 146 140 break; 147 141 } … … 150 144 151 145 if (!(t = thread_create(pi, NULL, TASK, 0, "pi", false))) { 152 if (!quiet) 153 printf("could not create thread %u\n", 2 * i + 1); 146 TPRINTF("could not create thread %u\n", 2 * i + 1); 154 147 break; 155 148 } … … 158 151 } 159 152 160 if (!quiet) 161 printf("ok\n"); 153 TPRINTF("ok\n"); 162 154 163 155 thread_sleep(1); … … 165 157 166 158 while (atomic_get(&threads_ok) != (long) total) { 167 if (!quiet) 168 printf("Threads left: %d\n", total - atomic_get(&threads_ok)); 159 TPRINTF("Threads left: %d\n", total - atomic_get(&threads_ok)); 169 160 thread_sleep(1); 170 161 } -
kernel/test/fpu/mips2.c
r171f9a1 rcb01e1e 44 44 static atomic_t threads_fault; 45 45 static waitq_t can_start; 46 static bool sh_quiet;47 46 48 47 static void testit1(void *data) … … 70 69 71 70 if (arg != after_arg) { 72 if (!sh_quiet) 73 printf("General reg tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg); 71 TPRINTF("General reg tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg); 74 72 atomic_inc(&threads_fault); 75 73 break; … … 102 100 103 101 if (arg != after_arg) { 104 if (!sh_quiet) 105 printf("General reg tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg); 102 TPRINTF("General reg tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg); 106 103 atomic_inc(&threads_fault); 107 104 break; … … 112 109 113 110 114 char * test_mips2(bool quiet)111 char *test_mips2(void) 115 112 { 116 113 unsigned int i, total = 0; 117 sh_quiet = quiet;118 114 119 115 waitq_initialize(&can_start); … … 121 117 atomic_set(&threads_fault, 0); 122 118 123 if (!quiet) 124 printf("Creating %u threads... ", 2 * THREADS); 119 TPRINTF("Creating %u threads... ", 2 * THREADS); 125 120 126 121 for (i = 0; i < THREADS; i++) { … … 128 123 129 124 if (!(t = thread_create(testit1, (void *) ((unative_t) 2 * i), TASK, 0, "testit1", false))) { 130 if (!quiet) 131 printf("could not create thread %u\n", 2 * i); 125 TPRINTF("could not create thread %u\n", 2 * i); 132 126 break; 133 127 } … … 136 130 137 131 if (!(t = thread_create(testit2, (void *) ((unative_t) 2 * i + 1), TASK, 0, "testit2", false))) { 138 if (!quiet) 139 printf("could not create thread %u\n", 2 * i + 1); 132 TPRINTF("could not create thread %u\n", 2 * i + 1); 140 133 break; 141 134 } … … 144 137 } 145 138 146 if (!quiet) 147 printf("ok\n"); 139 TPRINTF("ok\n"); 148 140 149 141 thread_sleep(1); … … 151 143 152 144 while (atomic_get(&threads_ok) != (long) total) { 153 if (!quiet) 154 printf("Threads left: %d\n", total - atomic_get(&threads_ok)); 145 TPRINTF("Threads left: %d\n", total - atomic_get(&threads_ok)); 155 146 thread_sleep(1); 156 147 } -
kernel/test/fpu/mips2_skip.c
r171f9a1 rcb01e1e 29 29 #include <test.h> 30 30 31 char * test_mips2(bool quiet)31 char *test_mips2(void) 32 32 { 33 33 return NULL; -
kernel/test/fpu/sse1.c
r171f9a1 rcb01e1e 44 44 static atomic_t threads_fault; 45 45 static waitq_t can_start; 46 static bool sh_quiet;47 48 46 49 47 static void testit1(void *data) … … 52 50 int arg __attribute__((aligned(16))) = (int) ((unative_t) data); 53 51 int after_arg __attribute__((aligned(16))); 54 52 55 53 thread_detach(THREAD); 56 54 57 55 waitq_sleep(&can_start); 58 56 59 57 for (i = 0; i < ATTEMPTS; i++) { 60 58 asm volatile ( … … 62 60 : [arg] "=m" (arg) 63 61 ); 64 62 65 63 delay(DELAY); 66 64 asm volatile ( … … 70 68 71 69 if (arg != after_arg) { 72 if (!sh_quiet) 73 printf("tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg); 70 TPRINTF("tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg); 74 71 atomic_inc(&threads_fault); 75 72 break; … … 88 85 89 86 waitq_sleep(&can_start); 90 87 91 88 for (i = 0; i < ATTEMPTS; i++) { 92 89 asm volatile ( … … 94 91 : [arg] "=m" (arg) 95 92 ); 96 93 97 94 scheduler(); 98 95 asm volatile ( … … 102 99 103 100 if (arg != after_arg) { 104 if (!sh_quiet) 105 printf("tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg); 101 TPRINTF("tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg); 106 102 atomic_inc(&threads_fault); 107 103 break; … … 111 107 } 112 108 113 114 char * test_sse1(bool quiet) 109 char *test_sse1(void) 115 110 { 116 111 unsigned int i, total = 0; 117 sh_quiet = quiet;118 112 119 113 waitq_initialize(&can_start); … … 121 115 atomic_set(&threads_fault, 0); 122 116 123 if (!quiet) 124 printf("Creating %u threads... ", 2 * THREADS); 125 117 TPRINTF("Creating %u threads... ", 2 * THREADS); 118 126 119 for (i = 0; i < THREADS; i++) { 127 120 thread_t *t; 128 121 129 122 if (!(t = thread_create(testit1, (void *) ((unative_t) 2 * i), TASK, 0, "testit1", false))) { 130 if (!quiet) 131 printf("could not create thread %u\n", 2 * i); 123 TPRINTF("could not create thread %u\n", 2 * i); 132 124 break; 133 125 } … … 136 128 137 129 if (!(t = thread_create(testit2, (void *) ((unative_t) 2 * i + 1), TASK, 0, "testit2", false))) { 138 if (!quiet) 139 printf("could not create thread %u\n", 2 * i + 1); 130 TPRINTF("could not create thread %u\n", 2 * i + 1); 140 131 break; 141 132 } … … 144 135 } 145 136 146 if (!quiet) 147 printf("ok\n"); 148 137 TPRINTF("ok\n"); 138 149 139 thread_sleep(1); 150 140 waitq_wakeup(&can_start, WAKEUP_ALL); 151 141 152 142 while (atomic_get(&threads_ok) != (long) total) { 153 if (!quiet) 154 printf("Threads left: %d\n", total - atomic_get(&threads_ok)); 143 TPRINTF("Threads left: %d\n", total - atomic_get(&threads_ok)); 155 144 thread_sleep(1); 156 145 } -
kernel/test/fpu/sse1_skip.c
r171f9a1 rcb01e1e 29 29 #include <test.h> 30 30 31 char * test_sse1(bool quiet)31 char *test_sse1(void) 32 32 { 33 33 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.
