Commit 7bf779f3 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

vcomp: Implement 32-bit atomic integer functions.

parent 3009244d
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
*/ */
#include "config.h" #include "config.h"
#include "wine/port.h"
#include <stdarg.h> #include <stdarg.h>
#include <assert.h> #include <assert.h>
...@@ -221,6 +222,70 @@ static void vcomp_free_thread_data(void) ...@@ -221,6 +222,70 @@ static void vcomp_free_thread_data(void)
vcomp_set_thread_data(NULL); vcomp_set_thread_data(NULL);
} }
void CDECL _vcomp_atomic_add_i4(int *dest, int val)
{
interlocked_xchg_add(dest, val);
}
void CDECL _vcomp_atomic_and_i4(int *dest, int val)
{
int old;
do old = *dest; while (interlocked_cmpxchg(dest, old & val, old) != old);
}
void CDECL _vcomp_atomic_div_i4(int *dest, int val)
{
int old;
do old = *dest; while (interlocked_cmpxchg(dest, old / val, old) != old);
}
void CDECL _vcomp_atomic_div_ui4(unsigned int *dest, unsigned int val)
{
unsigned int old;
do old = *dest; while (interlocked_cmpxchg((int *)dest, old / val, old) != old);
}
void CDECL _vcomp_atomic_mul_i4(int *dest, int val)
{
int old;
do old = *dest; while (interlocked_cmpxchg(dest, old * val, old) != old);
}
void CDECL _vcomp_atomic_or_i4(int *dest, int val)
{
int old;
do old = *dest; while (interlocked_cmpxchg(dest, old | val, old) != old);
}
void CDECL _vcomp_atomic_shl_i4(int *dest, int val)
{
int old;
do old = *dest; while (interlocked_cmpxchg(dest, old << val, old) != old);
}
void CDECL _vcomp_atomic_shr_i4(int *dest, int val)
{
int old;
do old = *dest; while (interlocked_cmpxchg(dest, old >> val, old) != old);
}
void CDECL _vcomp_atomic_shr_ui4(unsigned int *dest, unsigned int val)
{
unsigned int old;
do old = *dest; while (interlocked_cmpxchg((int *)dest, old >> val, old) != old);
}
void CDECL _vcomp_atomic_sub_i4(int *dest, int val)
{
interlocked_xchg_add(dest, -val);
}
void CDECL _vcomp_atomic_xor_i4(int *dest, int val)
{
int old;
do old = *dest; while (interlocked_cmpxchg(dest, old ^ val, old) != old);
}
int CDECL omp_get_dynamic(void) int CDECL omp_get_dynamic(void)
{ {
TRACE("stub\n"); TRACE("stub\n");
......
@ stub _vcomp_atomic_add_i1 @ stub _vcomp_atomic_add_i1
@ stub _vcomp_atomic_add_i2 @ stub _vcomp_atomic_add_i2
@ stub _vcomp_atomic_add_i4 @ cdecl _vcomp_atomic_add_i4(ptr long)
@ stub _vcomp_atomic_add_i8 @ stub _vcomp_atomic_add_i8
@ stub _vcomp_atomic_add_r4 @ stub _vcomp_atomic_add_r4
@ stub _vcomp_atomic_add_r8 @ stub _vcomp_atomic_add_r8
@ stub _vcomp_atomic_and_i1 @ stub _vcomp_atomic_and_i1
@ stub _vcomp_atomic_and_i2 @ stub _vcomp_atomic_and_i2
@ stub _vcomp_atomic_and_i4 @ cdecl _vcomp_atomic_and_i4(ptr long)
@ stub _vcomp_atomic_and_i8 @ stub _vcomp_atomic_and_i8
@ stub _vcomp_atomic_div_i1 @ stub _vcomp_atomic_div_i1
@ stub _vcomp_atomic_div_i2 @ stub _vcomp_atomic_div_i2
@ stub _vcomp_atomic_div_i4 @ cdecl _vcomp_atomic_div_i4(ptr long)
@ stub _vcomp_atomic_div_i8 @ stub _vcomp_atomic_div_i8
@ stub _vcomp_atomic_div_r4 @ stub _vcomp_atomic_div_r4
@ stub _vcomp_atomic_div_r8 @ stub _vcomp_atomic_div_r8
@ stub _vcomp_atomic_div_ui1 @ stub _vcomp_atomic_div_ui1
@ stub _vcomp_atomic_div_ui2 @ stub _vcomp_atomic_div_ui2
@ stub _vcomp_atomic_div_ui4 @ cdecl _vcomp_atomic_div_ui4(ptr long)
@ stub _vcomp_atomic_div_ui8 @ stub _vcomp_atomic_div_ui8
@ stub _vcomp_atomic_mul_i1 @ stub _vcomp_atomic_mul_i1
@ stub _vcomp_atomic_mul_i2 @ stub _vcomp_atomic_mul_i2
@ stub _vcomp_atomic_mul_i4 @ cdecl _vcomp_atomic_mul_i4(ptr long)
@ stub _vcomp_atomic_mul_i8 @ stub _vcomp_atomic_mul_i8
@ stub _vcomp_atomic_mul_r4 @ stub _vcomp_atomic_mul_r4
@ stub _vcomp_atomic_mul_r8 @ stub _vcomp_atomic_mul_r8
@ stub _vcomp_atomic_or_i1 @ stub _vcomp_atomic_or_i1
@ stub _vcomp_atomic_or_i2 @ stub _vcomp_atomic_or_i2
@ stub _vcomp_atomic_or_i4 @ cdecl _vcomp_atomic_or_i4(ptr long)
@ stub _vcomp_atomic_or_i8 @ stub _vcomp_atomic_or_i8
@ stub _vcomp_atomic_shl_i1 @ stub _vcomp_atomic_shl_i1
@ stub _vcomp_atomic_shl_i2 @ stub _vcomp_atomic_shl_i2
@ stub _vcomp_atomic_shl_i4 @ cdecl _vcomp_atomic_shl_i4(ptr long)
@ stub _vcomp_atomic_shl_i8 @ stub _vcomp_atomic_shl_i8
@ stub _vcomp_atomic_shr_i1 @ stub _vcomp_atomic_shr_i1
@ stub _vcomp_atomic_shr_i2 @ stub _vcomp_atomic_shr_i2
@ stub _vcomp_atomic_shr_i4 @ cdecl _vcomp_atomic_shr_i4(ptr long)
@ stub _vcomp_atomic_shr_i8 @ stub _vcomp_atomic_shr_i8
@ stub _vcomp_atomic_shr_ui1 @ stub _vcomp_atomic_shr_ui1
@ stub _vcomp_atomic_shr_ui2 @ stub _vcomp_atomic_shr_ui2
@ stub _vcomp_atomic_shr_ui4 @ cdecl _vcomp_atomic_shr_ui4(ptr long)
@ stub _vcomp_atomic_shr_ui8 @ stub _vcomp_atomic_shr_ui8
@ stub _vcomp_atomic_sub_i1 @ stub _vcomp_atomic_sub_i1
@ stub _vcomp_atomic_sub_i2 @ stub _vcomp_atomic_sub_i2
@ stub _vcomp_atomic_sub_i4 @ cdecl _vcomp_atomic_sub_i4(ptr long)
@ stub _vcomp_atomic_sub_i8 @ stub _vcomp_atomic_sub_i8
@ stub _vcomp_atomic_sub_r4 @ stub _vcomp_atomic_sub_r4
@ stub _vcomp_atomic_sub_r8 @ stub _vcomp_atomic_sub_r8
@ stub _vcomp_atomic_xor_i1 @ stub _vcomp_atomic_xor_i1
@ stub _vcomp_atomic_xor_i2 @ stub _vcomp_atomic_xor_i2
@ stub _vcomp_atomic_xor_i4 @ cdecl _vcomp_atomic_xor_i4(ptr long)
@ stub _vcomp_atomic_xor_i8 @ stub _vcomp_atomic_xor_i8
@ cdecl _vcomp_barrier() @ cdecl _vcomp_barrier()
@ stub _vcomp_copyprivate_broadcast @ stub _vcomp_copyprivate_broadcast
......
@ stub _vcomp_atomic_add_i1 @ stub _vcomp_atomic_add_i1
@ stub _vcomp_atomic_add_i2 @ stub _vcomp_atomic_add_i2
@ stub _vcomp_atomic_add_i4 @ cdecl _vcomp_atomic_add_i4(ptr long) vcomp._vcomp_atomic_add_i4
@ stub _vcomp_atomic_add_i8 @ stub _vcomp_atomic_add_i8
@ stub _vcomp_atomic_add_r4 @ stub _vcomp_atomic_add_r4
@ stub _vcomp_atomic_add_r8 @ stub _vcomp_atomic_add_r8
@ stub _vcomp_atomic_and_i1 @ stub _vcomp_atomic_and_i1
@ stub _vcomp_atomic_and_i2 @ stub _vcomp_atomic_and_i2
@ stub _vcomp_atomic_and_i4 @ cdecl _vcomp_atomic_and_i4(ptr long) vcomp._vcomp_atomic_and_i4
@ stub _vcomp_atomic_and_i8 @ stub _vcomp_atomic_and_i8
@ stub _vcomp_atomic_div_i1 @ stub _vcomp_atomic_div_i1
@ stub _vcomp_atomic_div_i2 @ stub _vcomp_atomic_div_i2
@ stub _vcomp_atomic_div_i4 @ cdecl _vcomp_atomic_div_i4(ptr long) vcomp._vcomp_atomic_div_i4
@ stub _vcomp_atomic_div_i8 @ stub _vcomp_atomic_div_i8
@ stub _vcomp_atomic_div_r4 @ stub _vcomp_atomic_div_r4
@ stub _vcomp_atomic_div_r8 @ stub _vcomp_atomic_div_r8
@ stub _vcomp_atomic_div_ui1 @ stub _vcomp_atomic_div_ui1
@ stub _vcomp_atomic_div_ui2 @ stub _vcomp_atomic_div_ui2
@ stub _vcomp_atomic_div_ui4 @ cdecl _vcomp_atomic_div_ui4(ptr long) vcomp._vcomp_atomic_div_ui4
@ stub _vcomp_atomic_div_ui8 @ stub _vcomp_atomic_div_ui8
@ stub _vcomp_atomic_mul_i1 @ stub _vcomp_atomic_mul_i1
@ stub _vcomp_atomic_mul_i2 @ stub _vcomp_atomic_mul_i2
@ stub _vcomp_atomic_mul_i4 @ cdecl _vcomp_atomic_mul_i4(ptr long) vcomp._vcomp_atomic_mul_i4
@ stub _vcomp_atomic_mul_i8 @ stub _vcomp_atomic_mul_i8
@ stub _vcomp_atomic_mul_r4 @ stub _vcomp_atomic_mul_r4
@ stub _vcomp_atomic_mul_r8 @ stub _vcomp_atomic_mul_r8
@ stub _vcomp_atomic_or_i1 @ stub _vcomp_atomic_or_i1
@ stub _vcomp_atomic_or_i2 @ stub _vcomp_atomic_or_i2
@ stub _vcomp_atomic_or_i4 @ cdecl _vcomp_atomic_or_i4(ptr long) vcomp._vcomp_atomic_or_i4
@ stub _vcomp_atomic_or_i8 @ stub _vcomp_atomic_or_i8
@ stub _vcomp_atomic_shl_i1 @ stub _vcomp_atomic_shl_i1
@ stub _vcomp_atomic_shl_i2 @ stub _vcomp_atomic_shl_i2
@ stub _vcomp_atomic_shl_i4 @ cdecl _vcomp_atomic_shl_i4(ptr long) vcomp._vcomp_atomic_shl_i4
@ stub _vcomp_atomic_shl_i8 @ stub _vcomp_atomic_shl_i8
@ stub _vcomp_atomic_shr_i1 @ stub _vcomp_atomic_shr_i1
@ stub _vcomp_atomic_shr_i2 @ stub _vcomp_atomic_shr_i2
@ stub _vcomp_atomic_shr_i4 @ cdecl _vcomp_atomic_shr_i4(ptr long) vcomp._vcomp_atomic_shr_i4
@ stub _vcomp_atomic_shr_i8 @ stub _vcomp_atomic_shr_i8
@ stub _vcomp_atomic_shr_ui1 @ stub _vcomp_atomic_shr_ui1
@ stub _vcomp_atomic_shr_ui2 @ stub _vcomp_atomic_shr_ui2
@ stub _vcomp_atomic_shr_ui4 @ cdecl _vcomp_atomic_shr_ui4(ptr long) vcomp._vcomp_atomic_shr_ui4
@ stub _vcomp_atomic_shr_ui8 @ stub _vcomp_atomic_shr_ui8
@ stub _vcomp_atomic_sub_i1 @ stub _vcomp_atomic_sub_i1
@ stub _vcomp_atomic_sub_i2 @ stub _vcomp_atomic_sub_i2
@ stub _vcomp_atomic_sub_i4 @ cdecl _vcomp_atomic_sub_i4(ptr long) vcomp._vcomp_atomic_sub_i4
@ stub _vcomp_atomic_sub_i8 @ stub _vcomp_atomic_sub_i8
@ stub _vcomp_atomic_sub_r4 @ stub _vcomp_atomic_sub_r4
@ stub _vcomp_atomic_sub_r8 @ stub _vcomp_atomic_sub_r8
@ stub _vcomp_atomic_xor_i1 @ stub _vcomp_atomic_xor_i1
@ stub _vcomp_atomic_xor_i2 @ stub _vcomp_atomic_xor_i2
@ stub _vcomp_atomic_xor_i4 @ cdecl _vcomp_atomic_xor_i4(ptr long) vcomp._vcomp_atomic_xor_i4
@ stub _vcomp_atomic_xor_i8 @ stub _vcomp_atomic_xor_i8
@ cdecl _vcomp_barrier() vcomp._vcomp_barrier @ cdecl _vcomp_barrier() vcomp._vcomp_barrier
@ stub _vcomp_copyprivate_broadcast @ stub _vcomp_copyprivate_broadcast
......
@ stub _vcomp_atomic_add_i1 @ stub _vcomp_atomic_add_i1
@ stub _vcomp_atomic_add_i2 @ stub _vcomp_atomic_add_i2
@ stub _vcomp_atomic_add_i4 @ cdecl _vcomp_atomic_add_i4(ptr long) vcomp._vcomp_atomic_add_i4
@ stub _vcomp_atomic_add_i8 @ stub _vcomp_atomic_add_i8
@ stub _vcomp_atomic_add_r4 @ stub _vcomp_atomic_add_r4
@ stub _vcomp_atomic_add_r8 @ stub _vcomp_atomic_add_r8
@ stub _vcomp_atomic_and_i1 @ stub _vcomp_atomic_and_i1
@ stub _vcomp_atomic_and_i2 @ stub _vcomp_atomic_and_i2
@ stub _vcomp_atomic_and_i4 @ cdecl _vcomp_atomic_and_i4(ptr long) vcomp._vcomp_atomic_and_i4
@ stub _vcomp_atomic_and_i8 @ stub _vcomp_atomic_and_i8
@ stub _vcomp_atomic_div_i1 @ stub _vcomp_atomic_div_i1
@ stub _vcomp_atomic_div_i2 @ stub _vcomp_atomic_div_i2
@ stub _vcomp_atomic_div_i4 @ cdecl _vcomp_atomic_div_i4(ptr long) vcomp._vcomp_atomic_div_i4
@ stub _vcomp_atomic_div_i8 @ stub _vcomp_atomic_div_i8
@ stub _vcomp_atomic_div_r4 @ stub _vcomp_atomic_div_r4
@ stub _vcomp_atomic_div_r8 @ stub _vcomp_atomic_div_r8
@ stub _vcomp_atomic_div_ui1 @ stub _vcomp_atomic_div_ui1
@ stub _vcomp_atomic_div_ui2 @ stub _vcomp_atomic_div_ui2
@ stub _vcomp_atomic_div_ui4 @ cdecl _vcomp_atomic_div_ui4(ptr long) vcomp._vcomp_atomic_div_ui4
@ stub _vcomp_atomic_div_ui8 @ stub _vcomp_atomic_div_ui8
@ stub _vcomp_atomic_mul_i1 @ stub _vcomp_atomic_mul_i1
@ stub _vcomp_atomic_mul_i2 @ stub _vcomp_atomic_mul_i2
@ stub _vcomp_atomic_mul_i4 @ cdecl _vcomp_atomic_mul_i4(ptr long) vcomp._vcomp_atomic_mul_i4
@ stub _vcomp_atomic_mul_i8 @ stub _vcomp_atomic_mul_i8
@ stub _vcomp_atomic_mul_r4 @ stub _vcomp_atomic_mul_r4
@ stub _vcomp_atomic_mul_r8 @ stub _vcomp_atomic_mul_r8
@ stub _vcomp_atomic_or_i1 @ stub _vcomp_atomic_or_i1
@ stub _vcomp_atomic_or_i2 @ stub _vcomp_atomic_or_i2
@ stub _vcomp_atomic_or_i4 @ cdecl _vcomp_atomic_or_i4(ptr long) vcomp._vcomp_atomic_or_i4
@ stub _vcomp_atomic_or_i8 @ stub _vcomp_atomic_or_i8
@ stub _vcomp_atomic_shl_i1 @ stub _vcomp_atomic_shl_i1
@ stub _vcomp_atomic_shl_i2 @ stub _vcomp_atomic_shl_i2
@ stub _vcomp_atomic_shl_i4 @ cdecl _vcomp_atomic_shl_i4(ptr long) vcomp._vcomp_atomic_shl_i4
@ stub _vcomp_atomic_shl_i8 @ stub _vcomp_atomic_shl_i8
@ stub _vcomp_atomic_shr_i1 @ stub _vcomp_atomic_shr_i1
@ stub _vcomp_atomic_shr_i2 @ stub _vcomp_atomic_shr_i2
@ stub _vcomp_atomic_shr_i4 @ cdecl _vcomp_atomic_shr_i4(ptr long) vcomp._vcomp_atomic_shr_i4
@ stub _vcomp_atomic_shr_i8 @ stub _vcomp_atomic_shr_i8
@ stub _vcomp_atomic_shr_ui1 @ stub _vcomp_atomic_shr_ui1
@ stub _vcomp_atomic_shr_ui2 @ stub _vcomp_atomic_shr_ui2
@ stub _vcomp_atomic_shr_ui4 @ cdecl _vcomp_atomic_shr_ui4(ptr long) vcomp._vcomp_atomic_shr_ui4
@ stub _vcomp_atomic_shr_ui8 @ stub _vcomp_atomic_shr_ui8
@ stub _vcomp_atomic_sub_i1 @ stub _vcomp_atomic_sub_i1
@ stub _vcomp_atomic_sub_i2 @ stub _vcomp_atomic_sub_i2
@ stub _vcomp_atomic_sub_i4 @ cdecl _vcomp_atomic_sub_i4(ptr long) vcomp._vcomp_atomic_sub_i4
@ stub _vcomp_atomic_sub_i8 @ stub _vcomp_atomic_sub_i8
@ stub _vcomp_atomic_sub_r4 @ stub _vcomp_atomic_sub_r4
@ stub _vcomp_atomic_sub_r8 @ stub _vcomp_atomic_sub_r8
@ stub _vcomp_atomic_xor_i1 @ stub _vcomp_atomic_xor_i1
@ stub _vcomp_atomic_xor_i2 @ stub _vcomp_atomic_xor_i2
@ stub _vcomp_atomic_xor_i4 @ cdecl _vcomp_atomic_xor_i4(ptr long) vcomp._vcomp_atomic_xor_i4
@ stub _vcomp_atomic_xor_i8 @ stub _vcomp_atomic_xor_i8
@ cdecl _vcomp_barrier() vcomp._vcomp_barrier @ cdecl _vcomp_barrier() vcomp._vcomp_barrier
@ stub _vcomp_copyprivate_broadcast @ stub _vcomp_copyprivate_broadcast
......
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