Module: wine Branch: master Commit: 2a0890fe55945d49ddaebe255a1694388b1bd099 URL: http://source.winehq.org/git/wine.git/?a=commit;h=2a0890fe55945d49ddaebe255a...
Author: Sebastian Lackner sebastian@fds-team.de Date: Mon Jul 27 01:38:03 2015 +0200
vcomp: Implement atomic float functions.
---
dlls/vcomp/main.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ dlls/vcomp/vcomp.spec | 8 ++++---- dlls/vcomp100/vcomp100.spec | 8 ++++---- dlls/vcomp90/vcomp90.spec | 8 ++++---- 4 files changed, 56 insertions(+), 12 deletions(-)
diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c index 6f0caf6..92c8eaf 100644 --- a/dlls/vcomp/main.c +++ b/dlls/vcomp/main.c @@ -286,6 +286,50 @@ void CDECL _vcomp_atomic_xor_i4(int *dest, int val) do old = *dest; while (interlocked_cmpxchg(dest, old ^ val, old) != old); }
+void CDECL _vcomp_atomic_add_r4(float *dest, float val) +{ + int old, new; + do + { + old = *(int *)dest; + *(float *)&new = *(float *)&old + val; + } + while (interlocked_cmpxchg((int *)dest, new, old) != old); +} + +void CDECL _vcomp_atomic_div_r4(float *dest, float val) +{ + int old, new; + do + { + old = *(int *)dest; + *(float *)&new = *(float *)&old / val; + } + while (interlocked_cmpxchg((int *)dest, new, old) != old); +} + +void CDECL _vcomp_atomic_mul_r4(float *dest, float val) +{ + int old, new; + do + { + old = *(int *)dest; + *(float *)&new = *(float *)&old * val; + } + while (interlocked_cmpxchg((int *)dest, new, old) != old); +} + +void CDECL _vcomp_atomic_sub_r4(float *dest, float val) +{ + int old, new; + do + { + old = *(int *)dest; + *(float *)&new = *(float *)&old - val; + } + while (interlocked_cmpxchg((int *)dest, new, old) != old); +} + int CDECL omp_get_dynamic(void) { TRACE("stub\n"); diff --git a/dlls/vcomp/vcomp.spec b/dlls/vcomp/vcomp.spec index 768daef..bc963cb 100644 --- a/dlls/vcomp/vcomp.spec +++ b/dlls/vcomp/vcomp.spec @@ -2,7 +2,7 @@ @ stub _vcomp_atomic_add_i2 @ cdecl _vcomp_atomic_add_i4(ptr long) @ stub _vcomp_atomic_add_i8 -@ stub _vcomp_atomic_add_r4 +@ cdecl _vcomp_atomic_add_r4(ptr float) @ stub _vcomp_atomic_add_r8 @ stub _vcomp_atomic_and_i1 @ stub _vcomp_atomic_and_i2 @@ -12,7 +12,7 @@ @ stub _vcomp_atomic_div_i2 @ cdecl _vcomp_atomic_div_i4(ptr long) @ stub _vcomp_atomic_div_i8 -@ stub _vcomp_atomic_div_r4 +@ cdecl _vcomp_atomic_div_r4(ptr float) @ stub _vcomp_atomic_div_r8 @ stub _vcomp_atomic_div_ui1 @ stub _vcomp_atomic_div_ui2 @@ -22,7 +22,7 @@ @ stub _vcomp_atomic_mul_i2 @ cdecl _vcomp_atomic_mul_i4(ptr long) @ stub _vcomp_atomic_mul_i8 -@ stub _vcomp_atomic_mul_r4 +@ cdecl _vcomp_atomic_mul_r4(ptr float) @ stub _vcomp_atomic_mul_r8 @ stub _vcomp_atomic_or_i1 @ stub _vcomp_atomic_or_i2 @@ -44,7 +44,7 @@ @ stub _vcomp_atomic_sub_i2 @ cdecl _vcomp_atomic_sub_i4(ptr long) @ stub _vcomp_atomic_sub_i8 -@ stub _vcomp_atomic_sub_r4 +@ cdecl _vcomp_atomic_sub_r4(ptr float) @ stub _vcomp_atomic_sub_r8 @ stub _vcomp_atomic_xor_i1 @ stub _vcomp_atomic_xor_i2 diff --git a/dlls/vcomp100/vcomp100.spec b/dlls/vcomp100/vcomp100.spec index 7f77ce1..2f4401e 100644 --- a/dlls/vcomp100/vcomp100.spec +++ b/dlls/vcomp100/vcomp100.spec @@ -2,7 +2,7 @@ @ stub _vcomp_atomic_add_i2 @ cdecl _vcomp_atomic_add_i4(ptr long) vcomp._vcomp_atomic_add_i4 @ stub _vcomp_atomic_add_i8 -@ stub _vcomp_atomic_add_r4 +@ cdecl _vcomp_atomic_add_r4(ptr float) vcomp._vcomp_atomic_add_r4 @ stub _vcomp_atomic_add_r8 @ stub _vcomp_atomic_and_i1 @ stub _vcomp_atomic_and_i2 @@ -12,7 +12,7 @@ @ stub _vcomp_atomic_div_i2 @ cdecl _vcomp_atomic_div_i4(ptr long) vcomp._vcomp_atomic_div_i4 @ stub _vcomp_atomic_div_i8 -@ stub _vcomp_atomic_div_r4 +@ cdecl _vcomp_atomic_div_r4(ptr float) vcomp._vcomp_atomic_div_r4 @ stub _vcomp_atomic_div_r8 @ stub _vcomp_atomic_div_ui1 @ stub _vcomp_atomic_div_ui2 @@ -22,7 +22,7 @@ @ stub _vcomp_atomic_mul_i2 @ cdecl _vcomp_atomic_mul_i4(ptr long) vcomp._vcomp_atomic_mul_i4 @ stub _vcomp_atomic_mul_i8 -@ stub _vcomp_atomic_mul_r4 +@ cdecl _vcomp_atomic_mul_r4(ptr float) vcomp._vcomp_atomic_mul_r4 @ stub _vcomp_atomic_mul_r8 @ stub _vcomp_atomic_or_i1 @ stub _vcomp_atomic_or_i2 @@ -44,7 +44,7 @@ @ stub _vcomp_atomic_sub_i2 @ cdecl _vcomp_atomic_sub_i4(ptr long) vcomp._vcomp_atomic_sub_i4 @ stub _vcomp_atomic_sub_i8 -@ stub _vcomp_atomic_sub_r4 +@ cdecl _vcomp_atomic_sub_r4(ptr float) vcomp._vcomp_atomic_sub_r4 @ stub _vcomp_atomic_sub_r8 @ stub _vcomp_atomic_xor_i1 @ stub _vcomp_atomic_xor_i2 diff --git a/dlls/vcomp90/vcomp90.spec b/dlls/vcomp90/vcomp90.spec index 7f77ce1..2f4401e 100644 --- a/dlls/vcomp90/vcomp90.spec +++ b/dlls/vcomp90/vcomp90.spec @@ -2,7 +2,7 @@ @ stub _vcomp_atomic_add_i2 @ cdecl _vcomp_atomic_add_i4(ptr long) vcomp._vcomp_atomic_add_i4 @ stub _vcomp_atomic_add_i8 -@ stub _vcomp_atomic_add_r4 +@ cdecl _vcomp_atomic_add_r4(ptr float) vcomp._vcomp_atomic_add_r4 @ stub _vcomp_atomic_add_r8 @ stub _vcomp_atomic_and_i1 @ stub _vcomp_atomic_and_i2 @@ -12,7 +12,7 @@ @ stub _vcomp_atomic_div_i2 @ cdecl _vcomp_atomic_div_i4(ptr long) vcomp._vcomp_atomic_div_i4 @ stub _vcomp_atomic_div_i8 -@ stub _vcomp_atomic_div_r4 +@ cdecl _vcomp_atomic_div_r4(ptr float) vcomp._vcomp_atomic_div_r4 @ stub _vcomp_atomic_div_r8 @ stub _vcomp_atomic_div_ui1 @ stub _vcomp_atomic_div_ui2 @@ -22,7 +22,7 @@ @ stub _vcomp_atomic_mul_i2 @ cdecl _vcomp_atomic_mul_i4(ptr long) vcomp._vcomp_atomic_mul_i4 @ stub _vcomp_atomic_mul_i8 -@ stub _vcomp_atomic_mul_r4 +@ cdecl _vcomp_atomic_mul_r4(ptr float) vcomp._vcomp_atomic_mul_r4 @ stub _vcomp_atomic_mul_r8 @ stub _vcomp_atomic_or_i1 @ stub _vcomp_atomic_or_i2 @@ -44,7 +44,7 @@ @ stub _vcomp_atomic_sub_i2 @ cdecl _vcomp_atomic_sub_i4(ptr long) vcomp._vcomp_atomic_sub_i4 @ stub _vcomp_atomic_sub_i8 -@ stub _vcomp_atomic_sub_r4 +@ cdecl _vcomp_atomic_sub_r4(ptr float) vcomp._vcomp_atomic_sub_r4 @ stub _vcomp_atomic_sub_r8 @ stub _vcomp_atomic_xor_i1 @ stub _vcomp_atomic_xor_i2