Commit 750ef2a5 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

vcomp: Add _vcomp_for_static_init_i8 implementation.

parent a75c1aa7
...@@ -1281,6 +1281,79 @@ void CDECL _vcomp_for_static_init(int first, int last, int step, int chunksize, ...@@ -1281,6 +1281,79 @@ void CDECL _vcomp_for_static_init(int first, int last, int step, int chunksize,
*lastchunk = first + (num_chunks - 1) * chunksize * step; *lastchunk = first + (num_chunks - 1) * chunksize * step;
} }
void CDECL _vcomp_for_static_init_i8(LONG64 first, LONG64 last, LONG64 step, LONG64 chunksize, ULONG64 *loops,
LONG64 *begin, LONG64 *end, LONG64 *next, LONG64 *lastchunk)
{
ULONG64 iterations, num_chunks, per_thread, remaining;
struct vcomp_thread_data *thread_data = vcomp_init_thread_data();
struct vcomp_team_data *team_data = thread_data->team;
int num_threads = team_data ? team_data->num_threads : 1;
int thread_num = thread_data->thread_num;
LONG64 no_begin, no_lastchunk;
TRACE("(%s, %s, %s, %s, %p, %p, %p, %p, %p)\n",
wine_dbgstr_longlong(first), wine_dbgstr_longlong(last),
wine_dbgstr_longlong(step), wine_dbgstr_longlong(chunksize),
loops, begin, end, next, lastchunk);
if (!begin)
{
begin = &no_begin;
lastchunk = &no_lastchunk;
}
if (num_threads == 1 && chunksize != 1)
{
*loops = 1;
*begin = first;
*end = last;
*next = 0;
*lastchunk = first;
return;
}
if (first == last)
{
*loops = !thread_num;
if (!thread_num)
{
*begin = first;
*end = last;
*next = 0;
*lastchunk = first;
}
return;
}
if (step <= 0)
{
*loops = 0;
return;
}
if (first < last)
iterations = 1 + (last - first) / step;
else
{
iterations = 1 + (first - last) / step;
step *= -1;
}
if (chunksize < 1)
chunksize = 1;
num_chunks = iterations / chunksize;
if (iterations % chunksize) num_chunks++;
per_thread = num_chunks / num_threads;
remaining = num_chunks - per_thread * num_threads;
*loops = per_thread + (thread_num < remaining);
*begin = first + thread_num * chunksize * step;
*end = *begin + (chunksize - 1) * step;
*next = chunksize * num_threads * step;
*lastchunk = first + (num_chunks - 1) * chunksize * step;
}
void CDECL _vcomp_for_static_end(void) void CDECL _vcomp_for_static_end(void)
{ {
TRACE("()\n"); TRACE("()\n");
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
@ stub _vcomp_for_dynamic_next_i8 @ stub _vcomp_for_dynamic_next_i8
@ cdecl _vcomp_for_static_end() @ cdecl _vcomp_for_static_end()
@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) @ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr)
@ stub _vcomp_for_static_init_i8 @ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr)
@ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) @ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr)
@ stub _vcomp_for_static_simple_init_i8 @ stub _vcomp_for_static_simple_init_i8
@ varargs _vcomp_fork(long long ptr) @ varargs _vcomp_fork(long long ptr)
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
@ stub _vcomp_for_dynamic_next_i8 @ stub _vcomp_for_dynamic_next_i8
@ cdecl _vcomp_for_static_end() @ cdecl _vcomp_for_static_end()
@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) @ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr)
@ stub _vcomp_for_static_init_i8 @ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr)
@ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) @ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr)
@ stub _vcomp_for_static_simple_init_i8 @ stub _vcomp_for_static_simple_init_i8
@ varargs _vcomp_fork(long long ptr) @ varargs _vcomp_fork(long long ptr)
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
@ stub _vcomp_for_dynamic_next_i8 @ stub _vcomp_for_dynamic_next_i8
@ cdecl _vcomp_for_static_end() @ cdecl _vcomp_for_static_end()
@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) @ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr)
@ stub _vcomp_for_static_init_i8 @ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr)
@ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) @ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr)
@ stub _vcomp_for_static_simple_init_i8 @ stub _vcomp_for_static_simple_init_i8
@ varargs _vcomp_fork(long long ptr) @ varargs _vcomp_fork(long long ptr)
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
@ stub _vcomp_for_dynamic_next_i8 @ stub _vcomp_for_dynamic_next_i8
@ cdecl _vcomp_for_static_end() @ cdecl _vcomp_for_static_end()
@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) @ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr)
@ stub _vcomp_for_static_init_i8 @ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr)
@ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) @ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr)
@ stub _vcomp_for_static_simple_init_i8 @ stub _vcomp_for_static_simple_init_i8
@ varargs _vcomp_fork(long long ptr) @ varargs _vcomp_fork(long long ptr)
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
@ stub _vcomp_for_dynamic_next_i8 @ stub _vcomp_for_dynamic_next_i8
@ cdecl _vcomp_for_static_end() @ cdecl _vcomp_for_static_end()
@ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr) @ cdecl _vcomp_for_static_init(long long long long ptr ptr ptr ptr ptr)
@ stub _vcomp_for_static_init_i8 @ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr)
@ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) @ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr)
@ stub _vcomp_for_static_simple_init_i8 @ stub _vcomp_for_static_simple_init_i8
@ varargs _vcomp_fork(long long ptr) @ varargs _vcomp_fork(long long ptr)
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
@ stub _vcomp_for_dynamic_next_i8 @ stub _vcomp_for_dynamic_next_i8
@ cdecl _vcomp_for_static_end() vcomp._vcomp_for_static_end @ 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(long long long long ptr ptr ptr ptr ptr) vcomp._vcomp_for_static_init
@ stub _vcomp_for_static_init_i8 @ cdecl _vcomp_for_static_init_i8(int64 int64 int64 int64 ptr ptr ptr ptr ptr) vcomp._vcomp_for_static_init_i8
@ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) vcomp._vcomp_for_static_simple_init @ cdecl _vcomp_for_static_simple_init(long long long long ptr ptr) vcomp._vcomp_for_static_simple_init
@ stub _vcomp_for_static_simple_init_i8 @ stub _vcomp_for_static_simple_init_i8
@ varargs _vcomp_fork(long long ptr) vcomp._vcomp_fork @ varargs _vcomp_fork(long long ptr) vcomp._vcomp_fork
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment