Subversion Repositories HelenOS

Rev

Rev 1882 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1882 Rev 2020
Line 36... Line 36...
36
#include <proc/thread.h>
36
#include <proc/thread.h>
37
 
37
 
38
#include <arch.h>
38
#include <arch.h>
39
#include <arch/arch.h>
39
#include <arch/arch.h>
40
 
40
 
-
 
41
#ifdef CONFIG_BENCH
-
 
42
#include <arch/cycle.h>
-
 
43
#endif
-
 
44
 
-
 
45
#if (defined(ia32) || defined(amd64) || defined(ia64) || defined(ia32xen))
-
 
46
 
41
#define THREADS     150*2
47
#define THREADS     150*2
42
#define ATTEMPTS    100
48
#define ATTEMPTS    100
43
 
49
 
44
#define E_10e8  271828182
50
#define E_10e8  271828182
45
#define PI_10e8 314159265
51
#define PI_10e8 314159265
Line 146... Line 152...
146
 
152
 
147
    printf("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000*pi),(unative_t) PI_10e8);
153
    printf("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000*pi),(unative_t) PI_10e8);
148
    atomic_inc(&threads_ok);
154
    atomic_inc(&threads_ok);
149
}
155
}
150
 
156
 
151
void test(void)
157
void test_fpu1(void)
152
{
158
{
-
 
159
#ifdef CONFIG_BENCH
-
 
160
    uint64_t t0 = get_cycle();
-
 
161
#endif
153
    thread_t *t;
162
    thread_t *t;
154
    int i;
163
    int i;
155
 
164
 
156
    waitq_initialize(&can_start);
165
    waitq_initialize(&can_start);
157
 
166
 
Line 173... Line 182...
173
 
182
 
174
    while (atomic_get(&threads_ok) != THREADS)
183
    while (atomic_get(&threads_ok) != THREADS)
175
        ;
184
        ;
176
       
185
       
177
    printf("Test passed.\n");
186
    printf("Test passed.\n");
-
 
187
#ifdef CONFIG_BENCH
-
 
188
    uint64_t dt = get_cycle() - t0;
-
 
189
    printf("Time: %.*d cycles\n", sizeof(dt) * 2, dt);
-
 
190
#endif
-
 
191
}
-
 
192
 
-
 
193
#else
-
 
194
 
-
 
195
void test_fpu1(void)
-
 
196
{
-
 
197
    printf("This test is available only on Intel/AMD platforms.");
178
}
198
}
-
 
199
 
-
 
200
#endif