Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52012 Signed-off-by: David Koller dk@cs.stanford.edu --- dlls/vcomp/tests/vcomp.c | 247 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 247 insertions(+)
diff --git a/dlls/vcomp/tests/vcomp.c b/dlls/vcomp/tests/vcomp.c index a229e0198f7..19d56820450 100644 --- a/dlls/vcomp/tests/vcomp.c +++ b/dlls/vcomp/tests/vcomp.c @@ -87,7 +87,10 @@ static void (CDECL *p_vcomp_enter_critsect)(CRITICAL_SECTION **critsect); static void (CDECL *p_vcomp_flush)(void); static void (CDECL *p_vcomp_for_dynamic_init)(unsigned int flags, unsigned int first, unsigned int last, int step, unsigned int chunksize); +static void (CDECL *p_vcomp_for_dynamic_init_i8)(unsigned int flags, ULONG64 first, ULONG64 last, + LONG64 step, ULONG64 chunksize); static int (CDECL *p_vcomp_for_dynamic_next)(unsigned int *begin, unsigned int *end); +static int (CDECL *p_vcomp_for_dynamic_next_i8)(ULONG64 *begin, ULONG64 *end); static void (CDECL *p_vcomp_for_static_end)(void); static void (CDECL *p_vcomp_for_static_init)(int first, int last, int step, int chunksize, unsigned int *loops, int *begin, int *end, int *next, int *lastchunk); @@ -329,7 +332,9 @@ static BOOL init_vcomp(void) VCOMP_GET_PROC(_vcomp_enter_critsect); VCOMP_GET_PROC(_vcomp_flush); VCOMP_GET_PROC(_vcomp_for_dynamic_init); + VCOMP_GET_PROC(_vcomp_for_dynamic_init_i8); VCOMP_GET_PROC(_vcomp_for_dynamic_next); + VCOMP_GET_PROC(_vcomp_for_dynamic_next_i8); VCOMP_GET_PROC(_vcomp_for_static_end); VCOMP_GET_PROC(_vcomp_for_static_init); VCOMP_GET_PROC(_vcomp_for_static_init_i8); @@ -1546,6 +1551,60 @@ static void CDECL for_dynamic_static_cb(void) ok(ret == FALSE, "expected ret == FALSE, got %d\n", ret); }
+static void CDECL for_dynamic_static_i8_cb(void) +{ + ULONG64 my_begin, my_end, begin, end; + int ret; + + begin = end = 0xdeadbeef; + my_for_static_simple_init_i8(TRUE, 0, 1000, 7, TRUE, &my_begin, &my_end); + p_vcomp_for_dynamic_init_i8(VCOMP_DYNAMIC_FLAGS_STATIC | VCOMP_DYNAMIC_FLAGS_INCREMENT, 0, 1000, 7, 1); + ret = p_vcomp_for_dynamic_next_i8(&begin, &end); + ok(ret == TRUE, "expected ret == TRUE, got %d\n", ret); + ok(begin == my_begin, "expected begin == %s, got %s\n", wine_dbgstr_longlong(my_begin), + wine_dbgstr_longlong(begin)); + ok(end == my_end, "expected end == %s, got %s\n", wine_dbgstr_longlong(my_end), + wine_dbgstr_longlong(end)); + ret = p_vcomp_for_dynamic_next_i8(&begin, &end); + ok(ret == FALSE, "expected ret == FALSE, got %d\n", ret); + + begin = end = 0xdeadbeef; + my_for_static_simple_init_i8(TRUE, 1000, 0, 7, FALSE, &my_begin, &my_end); + p_vcomp_for_dynamic_init_i8(VCOMP_DYNAMIC_FLAGS_STATIC, 1000, 0, 7, 1); + ret = p_vcomp_for_dynamic_next_i8(&begin, &end); + ok(ret == TRUE, "expected ret == TRUE, got %d\n", ret); + ok(begin == my_begin, "expected begin == %s, got %s\n", wine_dbgstr_longlong(my_begin), + wine_dbgstr_longlong(begin)); + ok(end == my_end, "expected end == %s, got %s\n", wine_dbgstr_longlong(my_end), + wine_dbgstr_longlong(end)); + ret = p_vcomp_for_dynamic_next_i8(&begin, &end); + ok(ret == FALSE, "expected ret == FALSE, got %d\n", ret); + + begin = end = 0xdeadbeef; + my_for_static_simple_init_i8(TRUE, 0, 1000, 7, TRUE, &my_begin, &my_end); + p_vcomp_for_dynamic_init_i8(VCOMP_DYNAMIC_FLAGS_STATIC | VCOMP_DYNAMIC_FLAGS_INCREMENT, 0, 1000, 7, 5); + ret = p_vcomp_for_dynamic_next_i8(&begin, &end); + ok(ret == TRUE, "expected ret == TRUE, got %d\n", ret); + ok(begin == my_begin, "expected begin == %s, got %s\n", wine_dbgstr_longlong(my_begin), + wine_dbgstr_longlong(begin)); + ok(end == my_end, "expected end == %s, got %s\n", wine_dbgstr_longlong(my_end), + wine_dbgstr_longlong(end)); + ret = p_vcomp_for_dynamic_next_i8(&begin, &end); + ok(ret == FALSE, "expected ret == FALSE, got %d\n", ret); + + begin = end = 0xdeadbeef; + my_for_static_simple_init_i8(TRUE, 1000, 0, 7, FALSE, &my_begin, &my_end); + p_vcomp_for_dynamic_init_i8(VCOMP_DYNAMIC_FLAGS_STATIC, 1000, 0, 7, 5); + ret = p_vcomp_for_dynamic_next_i8(&begin, &end); + ok(ret == TRUE, "expected ret == TRUE, got %d\n", ret); + ok(begin == my_begin, "expected begin == %s, got %s\n", wine_dbgstr_longlong(my_begin), + wine_dbgstr_longlong(begin)); + ok(end == my_end, "expected end == %s, got %s\n", wine_dbgstr_longlong(my_end), + wine_dbgstr_longlong(end)); + ret = p_vcomp_for_dynamic_next_i8(&begin, &end); + ok(ret == FALSE, "expected ret == FALSE, got %d\n", ret); +} + static void CDECL for_dynamic_chunked_cb(LONG *a, LONG *b, LONG *c, LONG *d) { unsigned int begin, end; @@ -1583,6 +1642,47 @@ static void CDECL for_dynamic_chunked_cb(LONG *a, LONG *b, LONG *c, LONG *d) } }
+static void CDECL for_dynamic_chunked_i8_cb(LONG64 *a, LONG64 *b, LONG64 *c, LONG64 *d) +{ + ULONG64 begin, end; + + p_vcomp_for_dynamic_init_i8(VCOMP_DYNAMIC_FLAGS_CHUNKED | VCOMP_DYNAMIC_FLAGS_INCREMENT, 0, 1000, 7, 1); + while (p_vcomp_for_dynamic_next_i8(&begin, &end)) + { + if (begin == 994) ok(end == 1000, "expected end == 1000, got %s\n", wine_dbgstr_longlong(end)); + else ok(begin == end, "expected begin == end, got %s and %s\n", wine_dbgstr_longlong(begin), + wine_dbgstr_longlong(end)); + InterlockedExchangeAdd64(a, begin); + } + + p_vcomp_for_dynamic_init_i8(VCOMP_DYNAMIC_FLAGS_CHUNKED, 1000, 0, 7, 1); + while (p_vcomp_for_dynamic_next_i8(&begin, &end)) + { + if (begin == 6) ok(end == 0, "expected end == 0, got %s\n", wine_dbgstr_longlong(end)); + else ok(begin == end, "expected begin == end, got %s and %s\n", wine_dbgstr_longlong(begin), + wine_dbgstr_longlong(end)); + InterlockedExchangeAdd64(b, begin); + } + + p_vcomp_for_dynamic_init_i8(VCOMP_DYNAMIC_FLAGS_CHUNKED | VCOMP_DYNAMIC_FLAGS_INCREMENT, 0, 1000, 7, 5); + while (p_vcomp_for_dynamic_next_i8(&begin, &end)) + { + if (begin == 980) ok(end == 1000, "expected end == 1000, got %s\n", wine_dbgstr_longlong(end)); + else ok(begin + 28 == end, "expected begin + 28 == end, got %s and %s\n", + wine_dbgstr_longlong(begin + 28), wine_dbgstr_longlong(end)); + InterlockedExchangeAdd64(c, begin); + } + + p_vcomp_for_dynamic_init_i8(VCOMP_DYNAMIC_FLAGS_CHUNKED, 1000, 0, 7, 5); + while (p_vcomp_for_dynamic_next_i8(&begin, &end)) + { + if (begin == 20) ok(end == 0, "expected end == 0, got %s\n", wine_dbgstr_longlong(end)); + else ok(begin - 28 == end, "expected begin - 28 == end, got %s and %s\n", + wine_dbgstr_longlong(begin - 28), wine_dbgstr_longlong(end)); + InterlockedExchangeAdd64(d, begin); + } +} + static void CDECL for_dynamic_guided_cb(unsigned int flags, LONG *a, LONG *b, LONG *c, LONG *d) { int num_threads = pomp_get_num_threads(); @@ -1621,6 +1721,48 @@ static void CDECL for_dynamic_guided_cb(unsigned int flags, LONG *a, LONG *b, LO } }
+static void CDECL for_dynamic_guided_i8_cb(unsigned int flags, LONG64 *a, LONG64 *b, LONG64 *c, LONG64 *d) +{ + int num_threads = pomp_get_num_threads(); + ULONG64 begin, end; + + p_vcomp_for_dynamic_init_i8(flags | VCOMP_DYNAMIC_FLAGS_INCREMENT, 0, 1000, 7, 1); + while (p_vcomp_for_dynamic_next_i8(&begin, &end)) + { + ok(num_threads != 1 || (begin == 0 && end == 1000), + "expected begin == 0 and end == 1000, got %s and %s\n", wine_dbgstr_longlong(begin), + wine_dbgstr_longlong(end)); + InterlockedExchangeAdd64(a, begin); + } + + p_vcomp_for_dynamic_init_i8(flags, 1000, 0, 7, 1); + while (p_vcomp_for_dynamic_next_i8(&begin, &end)) + { + ok(num_threads != 1 || (begin == 1000 && end == 0), + "expected begin == 1000 and end == 0, got %s and %s\n", wine_dbgstr_longlong(begin), + wine_dbgstr_longlong(end)); + InterlockedExchangeAdd64(b, begin); + } + + p_vcomp_for_dynamic_init_i8(flags | VCOMP_DYNAMIC_FLAGS_INCREMENT, 0, 1000, 7, 5); + while (p_vcomp_for_dynamic_next_i8(&begin, &end)) + { + ok(num_threads != 1 || (begin == 0 && end == 1000), + "expected begin == 0 and end == 1000, got %s and %s\n", wine_dbgstr_longlong(begin), + wine_dbgstr_longlong(end)); + InterlockedExchangeAdd64(c, begin); + } + + p_vcomp_for_dynamic_init_i8(flags, 1000, 0, 7, 5); + while (p_vcomp_for_dynamic_next_i8(&begin, &end)) + { + ok(num_threads != 1 || (begin == 1000 && end == 0), + "expected begin == 1000 and end == 0, got %s and %s\n", wine_dbgstr_longlong(begin), + wine_dbgstr_longlong(end)); + InterlockedExchangeAdd64(d, begin); + } +} + static void test_vcomp_for_dynamic_init(void) { static const int guided_a[] = {0, 6041, 9072, 11179}; @@ -1725,6 +1867,110 @@ static void test_vcomp_for_dynamic_init(void) pomp_set_num_threads(max_threads); }
+static void test_vcomp_for_dynamic_init_i8(void) +{ + static const int guided_a[] = {0, 6041, 9072, 11179}; + static const int guided_b[] = {1000, 1959, 2928, 3821}; + static const int guided_c[] = {0, 4067, 6139, 7273}; + static const int guided_d[] = {1000, 1933, 2861, 3727}; + LONG64 a, b, c, d; + int max_threads = pomp_get_max_threads(); + int i; + + /* test static scheduling */ + for_dynamic_static_i8_cb(); + + for (i = 1; i <= 4; i++) + { + pomp_set_num_threads(i); + p_vcomp_fork(TRUE, 0, for_dynamic_static_i8_cb); + p_vcomp_fork(FALSE, 0, for_dynamic_static_i8_cb); + } + + /* test chunked scheduling */ + a = b = c = d = 0; + for_dynamic_chunked_i8_cb(&a, &b, &c, &d); + ok(a == 71071, "expected a == 71071, got %s\n", wine_dbgstr_longlong(a)); + ok(b == 71929, "expected b == 71929, got %s\n", wine_dbgstr_longlong(b)); + ok(c == 14210, "expected c == 14210, got %s\n", wine_dbgstr_longlong(c)); + ok(d == 14790, "expected d == 14790, got %s\n", wine_dbgstr_longlong(d)); + + for (i = 1; i <= 4; i++) + { + pomp_set_num_threads(i); + + a = b = c = d = 0; + p_vcomp_fork(TRUE, 4, for_dynamic_chunked_i8_cb, &a, &b, &c, &d); + ok(a == 71071, "expected a == 71071, got %s\n", wine_dbgstr_longlong(a)); + ok(b == 71929, "expected b == 71929, got %s\n", wine_dbgstr_longlong(b)); + ok(c == 14210, "expected c == 14210, got %s\n", wine_dbgstr_longlong(c)); + ok(d == 14790, "expected d == 14790, got %s\n", wine_dbgstr_longlong(d)); + + a = b = c = d = 0; + p_vcomp_fork(FALSE, 4, for_dynamic_chunked_i8_cb, &a, &b, &c, &d); + ok(a == 71071, "expected a == 71071, got %s\n", wine_dbgstr_longlong(a)); + ok(b == 71929, "expected b == 71929, got %s\n", wine_dbgstr_longlong(b)); + ok(c == 14210, "expected c == 14210, got %s\n", wine_dbgstr_longlong(c)); + ok(d == 14790, "expected d == 14790, got %s\n", wine_dbgstr_longlong(d)); + } + + /* test guided scheduling */ + a = b = c = d = 0; + for_dynamic_guided_i8_cb(VCOMP_DYNAMIC_FLAGS_GUIDED, &a, &b, &c, &d); + ok(a == guided_a[0], "expected a == %d, got %s\n", guided_a[0], wine_dbgstr_longlong(a)); + ok(b == guided_b[0], "expected b == %d, got %s\n", guided_b[0], wine_dbgstr_longlong(b)); + ok(c == guided_c[0], "expected c == %d, got %s\n", guided_c[0], wine_dbgstr_longlong(c)); + ok(d == guided_d[0], "expected d == %d, got %s\n", guided_d[0], wine_dbgstr_longlong(d)); + + for (i = 1; i <= 4; i++) + { + pomp_set_num_threads(i); + + a = b = c = d = 0; + p_vcomp_fork(TRUE, 5, for_dynamic_guided_i8_cb, VCOMP_DYNAMIC_FLAGS_GUIDED, &a, &b, &c, &d); + ok(a == guided_a[i - 1], "expected a == %d, got %s\n", guided_a[i - 1], wine_dbgstr_longlong(a)); + ok(b == guided_b[i - 1], "expected b == %d, got %s\n", guided_b[i - 1], wine_dbgstr_longlong(b)); + ok(c == guided_c[i - 1], "expected c == %d, got %s\n", guided_c[i - 1], wine_dbgstr_longlong(c)); + ok(d == guided_d[i - 1], "expected d == %d, got %s\n", guided_d[i - 1], wine_dbgstr_longlong(d)); + + a = b = c = d = 0; + p_vcomp_fork(FALSE, 5, for_dynamic_guided_i8_cb, VCOMP_DYNAMIC_FLAGS_GUIDED, &a, &b, &c, &d); + ok(a == guided_a[0], "expected a == %d, got %s\n", guided_a[0], wine_dbgstr_longlong(a)); + ok(b == guided_b[0], "expected b == %d, got %s\n", guided_b[0], wine_dbgstr_longlong(b)); + ok(c == guided_c[0], "expected c == %d, got %s\n", guided_c[0], wine_dbgstr_longlong(c)); + ok(d == guided_d[0], "expected d == %d, got %s\n", guided_d[0], wine_dbgstr_longlong(d)); + } + + /* test with empty flags */ + a = b = c = d = 0; + for_dynamic_guided_i8_cb(0, &a, &b, &c, &d); + ok(a == guided_a[0], "expected a == %d, got %s\n", guided_a[0], wine_dbgstr_longlong(a)); + ok(b == guided_b[0], "expected b == %d, got %s\n", guided_b[0], wine_dbgstr_longlong(b)); + ok(c == guided_c[0], "expected c == %d, got %s\n", guided_c[0], wine_dbgstr_longlong(c)); + ok(d == guided_d[0], "expected d == %d, got %s\n", guided_d[0], wine_dbgstr_longlong(d)); + + for (i = 1; i <= 4; i++) + { + pomp_set_num_threads(i); + + a = b = c = d = 0; + p_vcomp_fork(TRUE, 5, for_dynamic_guided_i8_cb, 0, &a, &b, &c, &d); + ok(a == guided_a[i - 1], "expected a == %d, got %s\n", guided_a[i - 1], wine_dbgstr_longlong(a)); + ok(b == guided_b[i - 1], "expected b == %d, got %s\n", guided_b[i - 1], wine_dbgstr_longlong(b)); + ok(c == guided_c[i - 1], "expected c == %d, got %s\n", guided_c[i - 1], wine_dbgstr_longlong(c)); + ok(d == guided_d[i - 1], "expected d == %d, got %s\n", guided_d[i - 1], wine_dbgstr_longlong(d)); + + a = b = c = d = 0; + p_vcomp_fork(FALSE, 5, for_dynamic_guided_i8_cb, 0, &a, &b, &c, &d); + ok(a == guided_a[0], "expected a == %d, got %s\n", guided_a[0], wine_dbgstr_longlong(a)); + ok(b == guided_b[0], "expected b == %d, got %s\n", guided_b[0], wine_dbgstr_longlong(b)); + ok(c == guided_c[0], "expected c == %d, got %s\n", guided_c[0], wine_dbgstr_longlong(c)); + ok(d == guided_d[0], "expected d == %d, got %s\n", guided_d[0], wine_dbgstr_longlong(d)); + } + + pomp_set_num_threads(max_threads); +} + static void CDECL master_cb(HANDLE semaphore) { int num_threads = pomp_get_num_threads(); @@ -2644,6 +2890,7 @@ START_TEST(vcomp) test_vcomp_for_static_simple_init(); test_vcomp_for_static_init(); test_vcomp_for_dynamic_init(); + test_vcomp_for_dynamic_init_i8(); test_vcomp_master_begin(); test_vcomp_single_begin(); test_vcomp_enter_critsect();
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52012 Signed-off-by: David Koller dk@cs.stanford.edu --- dlls/vcomp/main.c | 103 +++++++++++++++++++++++++++++++++--- dlls/vcomp/vcomp.spec | 2 +- dlls/vcomp100/vcomp100.spec | 2 +- dlls/vcomp110/vcomp110.spec | 2 +- dlls/vcomp120/vcomp120.spec | 2 +- dlls/vcomp140/vcomp140.spec | 2 +- dlls/vcomp90/vcomp90.spec | 2 +- 7 files changed, 102 insertions(+), 13 deletions(-)
diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c index c4f2572c86a..91c16714ea6 100644 --- a/dlls/vcomp/main.c +++ b/dlls/vcomp/main.c @@ -81,8 +81,14 @@ struct vcomp_thread_data /* dynamic */ unsigned int dynamic; unsigned int dynamic_type; - unsigned int dynamic_begin; - unsigned int dynamic_end; + union { + unsigned int dynamic_begin; + ULONG64 dynamic_begin_i8; + }; + union { + unsigned int dynamic_end; + ULONG64 dynamic_end_i8; + }; };
struct vcomp_team_data @@ -113,11 +119,22 @@ struct vcomp_task_data
/* dynamic */ unsigned int dynamic; - unsigned int dynamic_first; - unsigned int dynamic_last; - unsigned int dynamic_iterations; - int dynamic_step; - unsigned int dynamic_chunksize; + union { + struct { + unsigned int dynamic_first; + unsigned int dynamic_last; + unsigned int dynamic_iterations; + int dynamic_step; + unsigned int dynamic_chunksize; + }; + struct { + ULONG64 dynamic_first_i8; + ULONG64 dynamic_last_i8; + ULONG64 dynamic_iterations_i8; + LONG64 dynamic_step_i8; + ULONG64 dynamic_chunksize_i8; + }; + }; };
static void **ptr_from_va_list(va_list valist) @@ -1483,6 +1500,78 @@ void CDECL _vcomp_for_dynamic_init(unsigned int flags, unsigned int first, unsig } }
+void CDECL _vcomp_for_dynamic_init_i8(unsigned int flags, ULONG64 first, ULONG64 last, + LONG64 step, ULONG64 chunksize) +{ + ULONG64 iterations, per_thread, remaining; + struct vcomp_thread_data *thread_data = vcomp_init_thread_data(); + struct vcomp_team_data *team_data = thread_data->team; + struct vcomp_task_data *task_data = thread_data->task; + int num_threads = team_data ? team_data->num_threads : 1; + int thread_num = thread_data->thread_num; + unsigned int type = flags & ~VCOMP_DYNAMIC_FLAGS_INCREMENT; + + TRACE("(%u, %s, %s, %s, %s)\n", flags, wine_dbgstr_longlong(first), wine_dbgstr_longlong(last), + wine_dbgstr_longlong(step), wine_dbgstr_longlong(chunksize)); + + if (step <= 0) + { + thread_data->dynamic_type = 0; + return; + } + + if (flags & VCOMP_DYNAMIC_FLAGS_INCREMENT) + iterations = 1 + (last - first) / step; + else + { + iterations = 1 + (first - last) / step; + step *= -1; + } + + if (type == VCOMP_DYNAMIC_FLAGS_STATIC) + { + per_thread = iterations / num_threads; + remaining = iterations - per_thread * num_threads; + + if (thread_num < remaining) + per_thread++; + else if (per_thread) + first += remaining * step; + else + { + thread_data->dynamic_type = 0; + return; + } + + thread_data->dynamic_type = VCOMP_DYNAMIC_FLAGS_STATIC; + thread_data->dynamic_begin_i8 = first + per_thread * thread_num * step; + thread_data->dynamic_end_i8 = thread_data->dynamic_begin_i8 + (per_thread - 1) * step; + } + else + { + if (type != VCOMP_DYNAMIC_FLAGS_CHUNKED && + type != VCOMP_DYNAMIC_FLAGS_GUIDED) + { + FIXME("unsupported flags %u\n", flags); + type = VCOMP_DYNAMIC_FLAGS_GUIDED; + } + + EnterCriticalSection(&vcomp_section); + thread_data->dynamic++; + thread_data->dynamic_type = type; + if ((int)(thread_data->dynamic - task_data->dynamic) > 0) + { + task_data->dynamic = thread_data->dynamic; + task_data->dynamic_first_i8 = first; + task_data->dynamic_last_i8 = last; + task_data->dynamic_iterations_i8 = iterations; + task_data->dynamic_step_i8 = step; + task_data->dynamic_chunksize_i8 = chunksize; + } + LeaveCriticalSection(&vcomp_section); + } +} + int CDECL _vcomp_for_dynamic_next(unsigned int *begin, unsigned int *end) { struct vcomp_thread_data *thread_data = vcomp_init_thread_data(); diff --git a/dlls/vcomp/vcomp.spec b/dlls/vcomp/vcomp.spec index fb67146e058..3b87ee11127 100644 --- a/dlls/vcomp/vcomp.spec +++ b/dlls/vcomp/vcomp.spec @@ -56,7 +56,7 @@ @ cdecl _vcomp_enter_critsect(ptr) @ cdecl _vcomp_flush() @ cdecl _vcomp_for_dynamic_init(long long long long long) -@ stub _vcomp_for_dynamic_init_i8 +@ cdecl _vcomp_for_dynamic_init_i8(long int64 int64 int64 int64) @ cdecl _vcomp_for_dynamic_next(ptr ptr) @ stub _vcomp_for_dynamic_next_i8 @ cdecl _vcomp_for_static_end() diff --git a/dlls/vcomp100/vcomp100.spec b/dlls/vcomp100/vcomp100.spec index fb67146e058..3b87ee11127 100644 --- a/dlls/vcomp100/vcomp100.spec +++ b/dlls/vcomp100/vcomp100.spec @@ -56,7 +56,7 @@ @ cdecl _vcomp_enter_critsect(ptr) @ cdecl _vcomp_flush() @ cdecl _vcomp_for_dynamic_init(long long long long long) -@ stub _vcomp_for_dynamic_init_i8 +@ cdecl _vcomp_for_dynamic_init_i8(long int64 int64 int64 int64) @ cdecl _vcomp_for_dynamic_next(ptr ptr) @ stub _vcomp_for_dynamic_next_i8 @ cdecl _vcomp_for_static_end() diff --git a/dlls/vcomp110/vcomp110.spec b/dlls/vcomp110/vcomp110.spec index e1cb8ab9931..9f0d22e273a 100644 --- a/dlls/vcomp110/vcomp110.spec +++ b/dlls/vcomp110/vcomp110.spec @@ -57,7 +57,7 @@ @ cdecl _vcomp_enter_critsect(ptr) @ cdecl _vcomp_flush() @ cdecl _vcomp_for_dynamic_init(long long long long long) -@ stub _vcomp_for_dynamic_init_i8 +@ cdecl _vcomp_for_dynamic_init_i8(long int64 int64 int64 int64) @ cdecl _vcomp_for_dynamic_next(ptr ptr) @ stub _vcomp_for_dynamic_next_i8 @ cdecl _vcomp_for_static_end() diff --git a/dlls/vcomp120/vcomp120.spec b/dlls/vcomp120/vcomp120.spec index e1cb8ab9931..9f0d22e273a 100644 --- a/dlls/vcomp120/vcomp120.spec +++ b/dlls/vcomp120/vcomp120.spec @@ -57,7 +57,7 @@ @ cdecl _vcomp_enter_critsect(ptr) @ cdecl _vcomp_flush() @ cdecl _vcomp_for_dynamic_init(long long long long long) -@ stub _vcomp_for_dynamic_init_i8 +@ cdecl _vcomp_for_dynamic_init_i8(long int64 int64 int64 int64) @ cdecl _vcomp_for_dynamic_next(ptr ptr) @ stub _vcomp_for_dynamic_next_i8 @ cdecl _vcomp_for_static_end() diff --git a/dlls/vcomp140/vcomp140.spec b/dlls/vcomp140/vcomp140.spec index e1cb8ab9931..9f0d22e273a 100644 --- a/dlls/vcomp140/vcomp140.spec +++ b/dlls/vcomp140/vcomp140.spec @@ -57,7 +57,7 @@ @ cdecl _vcomp_enter_critsect(ptr) @ cdecl _vcomp_flush() @ cdecl _vcomp_for_dynamic_init(long long long long long) -@ stub _vcomp_for_dynamic_init_i8 +@ cdecl _vcomp_for_dynamic_init_i8(long int64 int64 int64 int64) @ cdecl _vcomp_for_dynamic_next(ptr ptr) @ stub _vcomp_for_dynamic_next_i8 @ cdecl _vcomp_for_static_end() diff --git a/dlls/vcomp90/vcomp90.spec b/dlls/vcomp90/vcomp90.spec index 9fac400ea0e..b618896c1f4 100644 --- a/dlls/vcomp90/vcomp90.spec +++ b/dlls/vcomp90/vcomp90.spec @@ -56,7 +56,7 @@ @ cdecl _vcomp_enter_critsect(ptr) vcomp._vcomp_enter_critsect @ cdecl _vcomp_flush() vcomp._vcomp_flush @ cdecl _vcomp_for_dynamic_init(long long long long long) vcomp._vcomp_for_dynamic_init -@ stub _vcomp_for_dynamic_init_i8 +@ cdecl _vcomp_for_dynamic_init_i8(long int64 int64 int64 int64) vcomp._vcomp_for_dynamic_init_i8 @ cdecl _vcomp_for_dynamic_next(ptr ptr) vcomp._vcomp_for_dynamic_next @ stub _vcomp_for_dynamic_next_i8 @ cdecl _vcomp_for_static_end() vcomp._vcomp_for_static_end
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=108252
Your paranoid android.
=== debian11 (32 bit report) ===
vcomp: Unhandled exception: unimplemented function vcomp.dll._vcomp_for_dynamic_next_i8 called in 32-bit code (0x7b0111f6).
=== debian11 (32 bit Chinese:China report) ===
vcomp: Unhandled exception: unimplemented function vcomp.dll._vcomp_for_dynamic_next_i8 called in 32-bit code (0x7b0111f6).
=== debian11 (32 bit WoW report) ===
vcomp: Unhandled exception: unimplemented function vcomp.dll._vcomp_for_dynamic_next_i8 called in 32-bit code (0x7b0111f6).
=== debian11 (64 bit WoW report) ===
vcomp: Unhandled exception: unimplemented function vcomp.dll._vcomp_for_dynamic_next_i8 called in 64-bit code (0x000000007b01251e).
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52012 Signed-off-by: David Koller dk@cs.stanford.edu --- dlls/vcomp/main.c | 44 +++++++++++++++++++++++++++++++++++++ dlls/vcomp/vcomp.spec | 2 +- dlls/vcomp100/vcomp100.spec | 2 +- dlls/vcomp110/vcomp110.spec | 2 +- dlls/vcomp120/vcomp120.spec | 2 +- dlls/vcomp140/vcomp140.spec | 2 +- dlls/vcomp90/vcomp90.spec | 2 +- 7 files changed, 50 insertions(+), 6 deletions(-)
diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c index 91c16714ea6..239302eca7b 100644 --- a/dlls/vcomp/main.c +++ b/dlls/vcomp/main.c @@ -1616,6 +1616,50 @@ int CDECL _vcomp_for_dynamic_next(unsigned int *begin, unsigned int *end) return 0; }
+int CDECL _vcomp_for_dynamic_next_i8(ULONG64 *begin, ULONG64 *end) +{ + struct vcomp_thread_data *thread_data = vcomp_init_thread_data(); + struct vcomp_task_data *task_data = thread_data->task; + struct vcomp_team_data *team_data = thread_data->team; + int num_threads = team_data ? team_data->num_threads : 1; + + TRACE("(%p, %p)\n", begin, end); + + if (thread_data->dynamic_type == VCOMP_DYNAMIC_FLAGS_STATIC) + { + *begin = thread_data->dynamic_begin_i8; + *end = thread_data->dynamic_end_i8; + thread_data->dynamic_type = 0; + return 1; + } + else if (thread_data->dynamic_type == VCOMP_DYNAMIC_FLAGS_CHUNKED || + thread_data->dynamic_type == VCOMP_DYNAMIC_FLAGS_GUIDED) + { + ULONG64 iterations = 0; + EnterCriticalSection(&vcomp_section); + if (thread_data->dynamic == task_data->dynamic && + task_data->dynamic_iterations_i8 != 0) + { + iterations = min(task_data->dynamic_iterations_i8, task_data->dynamic_chunksize_i8); + if (thread_data->dynamic_type == VCOMP_DYNAMIC_FLAGS_GUIDED && + task_data->dynamic_iterations_i8 > num_threads * task_data->dynamic_chunksize_i8) + { + iterations = (task_data->dynamic_iterations_i8 + num_threads - 1) / num_threads; + } + *begin = task_data->dynamic_first_i8; + *end = task_data->dynamic_first_i8 + (iterations - 1) * task_data->dynamic_step_i8; + task_data->dynamic_iterations_i8 -= iterations; + task_data->dynamic_first_i8 += iterations * task_data->dynamic_step_i8; + if (!task_data->dynamic_iterations_i8) + *end = task_data->dynamic_last_i8; + } + LeaveCriticalSection(&vcomp_section); + return iterations != 0; + } + + return 0; +} + int CDECL omp_in_parallel(void) { TRACE("()\n"); diff --git a/dlls/vcomp/vcomp.spec b/dlls/vcomp/vcomp.spec index 3b87ee11127..f5fb23d7ad1 100644 --- a/dlls/vcomp/vcomp.spec +++ b/dlls/vcomp/vcomp.spec @@ -58,7 +58,7 @@ @ cdecl _vcomp_for_dynamic_init(long long long long long) @ cdecl _vcomp_for_dynamic_init_i8(long int64 int64 int64 int64) @ cdecl _vcomp_for_dynamic_next(ptr ptr) -@ stub _vcomp_for_dynamic_next_i8 +@ cdecl _vcomp_for_dynamic_next_i8(ptr ptr) @ cdecl _vcomp_for_static_end() @ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) @ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr) diff --git a/dlls/vcomp100/vcomp100.spec b/dlls/vcomp100/vcomp100.spec index 3b87ee11127..f5fb23d7ad1 100644 --- a/dlls/vcomp100/vcomp100.spec +++ b/dlls/vcomp100/vcomp100.spec @@ -58,7 +58,7 @@ @ cdecl _vcomp_for_dynamic_init(long long long long long) @ cdecl _vcomp_for_dynamic_init_i8(long int64 int64 int64 int64) @ cdecl _vcomp_for_dynamic_next(ptr ptr) -@ stub _vcomp_for_dynamic_next_i8 +@ cdecl _vcomp_for_dynamic_next_i8(ptr ptr) @ cdecl _vcomp_for_static_end() @ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) @ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr) diff --git a/dlls/vcomp110/vcomp110.spec b/dlls/vcomp110/vcomp110.spec index 9f0d22e273a..8f3458fa9a2 100644 --- a/dlls/vcomp110/vcomp110.spec +++ b/dlls/vcomp110/vcomp110.spec @@ -59,7 +59,7 @@ @ cdecl _vcomp_for_dynamic_init(long long long long long) @ cdecl _vcomp_for_dynamic_init_i8(long int64 int64 int64 int64) @ cdecl _vcomp_for_dynamic_next(ptr ptr) -@ stub _vcomp_for_dynamic_next_i8 +@ cdecl _vcomp_for_dynamic_next_i8(ptr ptr) @ cdecl _vcomp_for_static_end() @ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) @ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr) diff --git a/dlls/vcomp120/vcomp120.spec b/dlls/vcomp120/vcomp120.spec index 9f0d22e273a..8f3458fa9a2 100644 --- a/dlls/vcomp120/vcomp120.spec +++ b/dlls/vcomp120/vcomp120.spec @@ -59,7 +59,7 @@ @ cdecl _vcomp_for_dynamic_init(long long long long long) @ cdecl _vcomp_for_dynamic_init_i8(long int64 int64 int64 int64) @ cdecl _vcomp_for_dynamic_next(ptr ptr) -@ stub _vcomp_for_dynamic_next_i8 +@ cdecl _vcomp_for_dynamic_next_i8(ptr ptr) @ cdecl _vcomp_for_static_end() @ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) @ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr) diff --git a/dlls/vcomp140/vcomp140.spec b/dlls/vcomp140/vcomp140.spec index 9f0d22e273a..8f3458fa9a2 100644 --- a/dlls/vcomp140/vcomp140.spec +++ b/dlls/vcomp140/vcomp140.spec @@ -59,7 +59,7 @@ @ cdecl _vcomp_for_dynamic_init(long long long long long) @ cdecl _vcomp_for_dynamic_init_i8(long int64 int64 int64 int64) @ cdecl _vcomp_for_dynamic_next(ptr ptr) -@ stub _vcomp_for_dynamic_next_i8 +@ cdecl _vcomp_for_dynamic_next_i8(ptr ptr) @ cdecl _vcomp_for_static_end() @ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) @ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr) diff --git a/dlls/vcomp90/vcomp90.spec b/dlls/vcomp90/vcomp90.spec index b618896c1f4..21bded4cdfd 100644 --- a/dlls/vcomp90/vcomp90.spec +++ b/dlls/vcomp90/vcomp90.spec @@ -58,7 +58,7 @@ @ cdecl _vcomp_for_dynamic_init(long long long long long) vcomp._vcomp_for_dynamic_init @ cdecl _vcomp_for_dynamic_init_i8(long int64 int64 int64 int64) vcomp._vcomp_for_dynamic_init_i8 @ cdecl _vcomp_for_dynamic_next(ptr ptr) vcomp._vcomp_for_dynamic_next -@ stub _vcomp_for_dynamic_next_i8 +@ cdecl _vcomp_for_dynamic_next_i8(ptr ptr) vcomp._vcomp_for_dynamic_next_i8 @ cdecl _vcomp_for_static_end() vcomp._vcomp_for_static_end @ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) vcomp._vcomp_for_static_init @ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr) vcomp._vcomp_for_static_init_i8
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=108251
Your paranoid android.
=== debian11 (32 bit report) ===
vcomp: Unhandled exception: unimplemented function vcomp.dll._vcomp_for_dynamic_init_i8 called in 32-bit code (0x7b0111f6).
=== debian11 (32 bit Arabic:Morocco report) ===
vcomp: Unhandled exception: unimplemented function vcomp.dll._vcomp_for_dynamic_init_i8 called in 32-bit code (0x7b0111f6).
=== debian11 (32 bit German report) ===
vcomp: Unhandled exception: unimplemented function vcomp.dll._vcomp_for_dynamic_init_i8 called in 32-bit code (0x7b0111f6).
=== debian11 (32 bit French report) ===
vcomp: Unhandled exception: unimplemented function vcomp.dll._vcomp_for_dynamic_init_i8 called in 32-bit code (0x7b0111f6).
=== debian11 (32 bit Hebrew:Israel report) ===
vcomp: Unhandled exception: unimplemented function vcomp.dll._vcomp_for_dynamic_init_i8 called in 32-bit code (0x7b0111f6).
=== debian11 (32 bit Hindi:India report) ===
vcomp: Unhandled exception: unimplemented function vcomp.dll._vcomp_for_dynamic_init_i8 called in 32-bit code (0x7b0111f6).
=== debian11 (32 bit Japanese:Japan report) ===
vcomp: Unhandled exception: unimplemented function vcomp.dll._vcomp_for_dynamic_init_i8 called in 32-bit code (0x7b0111f6).
=== debian11 (32 bit Chinese:China report) ===
vcomp: Unhandled exception: unimplemented function vcomp.dll._vcomp_for_dynamic_init_i8 called in 32-bit code (0x7b0111f6).
=== debian11 (32 bit WoW report) ===
vcomp: Unhandled exception: unimplemented function vcomp.dll._vcomp_for_dynamic_init_i8 called in 32-bit code (0x7b0111f6).
=== debian11 (64 bit WoW report) ===
vcomp: Unhandled exception: unimplemented function vcomp.dll._vcomp_for_dynamic_init_i8 called in 64-bit code (0x000000007b01251e).