Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
86dea350
Commit
86dea350
authored
Sep 07, 2016
by
Sebastian Lackner
Committed by
Alexandre Julliard
Sep 07, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vcomp: Implement _vcomp_reduction_{u,i}2 and add tests.
Signed-off-by:
Sebastian Lackner
<
sebastian@fds-team.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
96e0c994
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
91 additions
and
12 deletions
+91
-12
main.c
dlls/vcomp/main.c
+30
-0
vcomp.c
dlls/vcomp/tests/vcomp.c
+49
-0
vcomp.spec
dlls/vcomp/vcomp.spec
+2
-2
vcomp100.spec
dlls/vcomp100/vcomp100.spec
+2
-2
vcomp110.spec
dlls/vcomp110/vcomp110.spec
+2
-2
vcomp120.spec
dlls/vcomp120/vcomp120.spec
+2
-2
vcomp140.spec
dlls/vcomp140/vcomp140.spec
+2
-2
vcomp90.spec
dlls/vcomp90/vcomp90.spec
+2
-2
No files found.
dlls/vcomp/main.c
View file @
86dea350
...
@@ -516,6 +516,36 @@ void CDECL _vcomp_atomic_xor_i2(short *dest, short val)
...
@@ -516,6 +516,36 @@ void CDECL _vcomp_atomic_xor_i2(short *dest, short val)
do
old
=
*
dest
;
while
(
interlocked_cmpxchg16
(
dest
,
old
^
val
,
old
)
!=
old
);
do
old
=
*
dest
;
while
(
interlocked_cmpxchg16
(
dest
,
old
^
val
,
old
)
!=
old
);
}
}
static
void
CDECL
_vcomp_atomic_bool_and_i2
(
short
*
dest
,
short
val
)
{
short
old
;
do
old
=
*
dest
;
while
(
interlocked_cmpxchg16
(
dest
,
old
&&
val
,
old
)
!=
old
);
}
static
void
CDECL
_vcomp_atomic_bool_or_i2
(
short
*
dest
,
short
val
)
{
short
old
;
do
old
=
*
dest
;
while
(
interlocked_cmpxchg16
(
dest
,
old
?
old
:
(
val
!=
0
),
old
)
!=
old
);
}
void
CDECL
_vcomp_reduction_i2
(
unsigned
int
flags
,
short
*
dest
,
short
val
)
{
static
void
(
CDECL
*
const
funcs
[])(
short
*
,
short
)
=
{
_vcomp_atomic_add_i2
,
_vcomp_atomic_add_i2
,
_vcomp_atomic_mul_i2
,
_vcomp_atomic_and_i2
,
_vcomp_atomic_or_i2
,
_vcomp_atomic_xor_i2
,
_vcomp_atomic_bool_and_i2
,
_vcomp_atomic_bool_or_i2
,
};
unsigned
int
op
=
(
flags
>>
8
)
&
0xf
;
op
=
min
(
op
,
sizeof
(
funcs
)
/
sizeof
(
funcs
[
0
])
-
1
);
funcs
[
op
](
dest
,
val
);
}
void
CDECL
_vcomp_atomic_add_i4
(
int
*
dest
,
int
val
)
void
CDECL
_vcomp_atomic_add_i4
(
int
*
dest
,
int
val
)
{
{
interlocked_xchg_add
(
dest
,
val
);
interlocked_xchg_add
(
dest
,
val
);
...
...
dlls/vcomp/tests/vcomp.c
View file @
86dea350
...
@@ -103,7 +103,9 @@ static int (CDECL *p_vcomp_get_thread_num)(void);
...
@@ -103,7 +103,9 @@ static int (CDECL *p_vcomp_get_thread_num)(void);
static
void
(
CDECL
*
p_vcomp_leave_critsect
)(
CRITICAL_SECTION
*
critsect
);
static
void
(
CDECL
*
p_vcomp_leave_critsect
)(
CRITICAL_SECTION
*
critsect
);
static
int
(
CDECL
*
p_vcomp_master_begin
)(
void
);
static
int
(
CDECL
*
p_vcomp_master_begin
)(
void
);
static
void
(
CDECL
*
p_vcomp_master_end
)(
void
);
static
void
(
CDECL
*
p_vcomp_master_end
)(
void
);
static
void
(
CDECL
*
p_vcomp_reduction_i2
)(
unsigned
int
flags
,
short
*
dest
,
short
val
);
static
void
(
CDECL
*
p_vcomp_reduction_i4
)(
unsigned
int
flags
,
int
*
dest
,
int
val
);
static
void
(
CDECL
*
p_vcomp_reduction_i4
)(
unsigned
int
flags
,
int
*
dest
,
int
val
);
static
void
(
CDECL
*
p_vcomp_reduction_u2
)(
unsigned
int
flags
,
unsigned
short
*
dest
,
unsigned
short
val
);
static
void
(
CDECL
*
p_vcomp_reduction_u4
)(
unsigned
int
flags
,
unsigned
int
*
dest
,
unsigned
int
val
);
static
void
(
CDECL
*
p_vcomp_reduction_u4
)(
unsigned
int
flags
,
unsigned
int
*
dest
,
unsigned
int
val
);
static
void
(
CDECL
*
p_vcomp_sections_init
)(
int
n
);
static
void
(
CDECL
*
p_vcomp_sections_init
)(
int
n
);
static
int
(
CDECL
*
p_vcomp_sections_next
)(
void
);
static
int
(
CDECL
*
p_vcomp_sections_next
)(
void
);
...
@@ -346,7 +348,9 @@ static BOOL init_vcomp(void)
...
@@ -346,7 +348,9 @@ static BOOL init_vcomp(void)
VCOMP_GET_PROC
(
_vcomp_leave_critsect
);
VCOMP_GET_PROC
(
_vcomp_leave_critsect
);
VCOMP_GET_PROC
(
_vcomp_master_begin
);
VCOMP_GET_PROC
(
_vcomp_master_begin
);
VCOMP_GET_PROC
(
_vcomp_master_end
);
VCOMP_GET_PROC
(
_vcomp_master_end
);
VCOMP_GET_PROC
(
_vcomp_reduction_i2
);
VCOMP_GET_PROC
(
_vcomp_reduction_i4
);
VCOMP_GET_PROC
(
_vcomp_reduction_i4
);
VCOMP_GET_PROC
(
_vcomp_reduction_u2
);
VCOMP_GET_PROC
(
_vcomp_reduction_u4
);
VCOMP_GET_PROC
(
_vcomp_reduction_u4
);
VCOMP_GET_PROC
(
_vcomp_sections_init
);
VCOMP_GET_PROC
(
_vcomp_sections_init
);
VCOMP_GET_PROC
(
_vcomp_sections_next
);
VCOMP_GET_PROC
(
_vcomp_sections_next
);
...
@@ -1883,6 +1887,50 @@ static void test_atomic_double(void)
...
@@ -1883,6 +1887,50 @@ static void test_atomic_double(void)
}
}
}
}
static
void
test_reduction_integer16
(
void
)
{
struct
{
unsigned
int
flags
;
short
v1
,
v2
,
expected
;
}
tests
[]
=
{
{
0x000
,
0x1122
,
0x7766
,
-
0x7778
},
{
VCOMP_REDUCTION_FLAGS_ADD
,
0x1122
,
0x7766
,
-
0x7778
},
{
VCOMP_REDUCTION_FLAGS_MUL
,
0x1122
,
0x7766
,
-
0x5e74
},
{
VCOMP_REDUCTION_FLAGS_MUL
,
0x1122
,
-
0x7766
,
0x5e74
},
{
VCOMP_REDUCTION_FLAGS_AND
,
0x1122
,
0x7766
,
0x1122
},
{
VCOMP_REDUCTION_FLAGS_OR
,
0x1122
,
0x7766
,
0x7766
},
{
VCOMP_REDUCTION_FLAGS_XOR
,
0x1122
,
0x7766
,
0x6644
},
{
VCOMP_REDUCTION_FLAGS_BOOL_AND
,
1
,
2
,
1
},
{
VCOMP_REDUCTION_FLAGS_BOOL_OR
,
0
,
2
,
1
},
{
0x800
,
0
,
2
,
1
},
{
0x900
,
0
,
2
,
1
},
{
0xa00
,
0
,
2
,
1
},
{
0xb00
,
0
,
2
,
1
},
{
0xc00
,
0
,
2
,
1
},
{
0xd00
,
0
,
2
,
1
},
{
0xe00
,
0
,
2
,
1
},
{
0xf00
,
0
,
2
,
1
},
};
int
i
;
for
(
i
=
0
;
i
<
sizeof
(
tests
)
/
sizeof
(
tests
[
0
]);
i
++
)
{
short
val
=
tests
[
i
].
v1
;
p_vcomp_reduction_i2
(
tests
[
i
].
flags
,
&
val
,
tests
[
i
].
v2
);
ok
(
val
==
tests
[
i
].
expected
,
"test %d: expected val == %d, got %d
\n
"
,
i
,
tests
[
i
].
expected
,
val
);
}
for
(
i
=
0
;
i
<
sizeof
(
tests
)
/
sizeof
(
tests
[
0
]);
i
++
)
{
unsigned
short
val
=
tests
[
i
].
v1
;
p_vcomp_reduction_u2
(
tests
[
i
].
flags
,
&
val
,
tests
[
i
].
v2
);
ok
(
val
==
(
unsigned
short
)
tests
[
i
].
expected
,
"test %d: expected val == %u, got %u
\n
"
,
i
,
(
unsigned
short
)
tests
[
i
].
expected
,
val
);
}
}
static
void
CDECL
reduction_cb
(
int
*
a
,
int
*
b
)
static
void
CDECL
reduction_cb
(
int
*
a
,
int
*
b
)
{
{
p_vcomp_reduction_i4
(
VCOMP_REDUCTION_FLAGS_ADD
,
a
,
1
);
p_vcomp_reduction_i4
(
VCOMP_REDUCTION_FLAGS_ADD
,
a
,
1
);
...
@@ -1989,6 +2037,7 @@ START_TEST(vcomp)
...
@@ -1989,6 +2037,7 @@ START_TEST(vcomp)
test_atomic_integer64
();
test_atomic_integer64
();
test_atomic_float
();
test_atomic_float
();
test_atomic_double
();
test_atomic_double
();
test_reduction_integer16
();
test_reduction_integer32
();
test_reduction_integer32
();
release_vcomp
();
release_vcomp
();
...
...
dlls/vcomp/vcomp.spec
View file @
86dea350
...
@@ -74,13 +74,13 @@
...
@@ -74,13 +74,13 @@
@ stub _vcomp_ordered_end
@ stub _vcomp_ordered_end
@ stub _vcomp_ordered_loop_end
@ stub _vcomp_ordered_loop_end
@ stub _vcomp_reduction_i1
@ stub _vcomp_reduction_i1
@
stub _vcomp_reduction_i2
@
cdecl _vcomp_reduction_i2(long ptr long)
@ cdecl _vcomp_reduction_i4(long ptr long)
@ cdecl _vcomp_reduction_i4(long ptr long)
@ stub _vcomp_reduction_i8
@ stub _vcomp_reduction_i8
@ stub _vcomp_reduction_r4
@ stub _vcomp_reduction_r4
@ stub _vcomp_reduction_r8
@ stub _vcomp_reduction_r8
@ stub _vcomp_reduction_u1
@ stub _vcomp_reduction_u1
@
stub _vcomp_reduction_u
2
@
cdecl _vcomp_reduction_u2(long ptr long) _vcomp_reduction_i
2
@ cdecl _vcomp_reduction_u4(long ptr long) _vcomp_reduction_i4
@ cdecl _vcomp_reduction_u4(long ptr long) _vcomp_reduction_i4
@ stub _vcomp_reduction_u8
@ stub _vcomp_reduction_u8
@ cdecl _vcomp_sections_init(long)
@ cdecl _vcomp_sections_init(long)
...
...
dlls/vcomp100/vcomp100.spec
View file @
86dea350
...
@@ -74,13 +74,13 @@
...
@@ -74,13 +74,13 @@
@ stub _vcomp_ordered_end
@ stub _vcomp_ordered_end
@ stub _vcomp_ordered_loop_end
@ stub _vcomp_ordered_loop_end
@ stub _vcomp_reduction_i1
@ stub _vcomp_reduction_i1
@
stub
_vcomp_reduction_i2
@
cdecl _vcomp_reduction_i2(long ptr long) vcomp.
_vcomp_reduction_i2
@ cdecl _vcomp_reduction_i4(long ptr long) vcomp._vcomp_reduction_i4
@ cdecl _vcomp_reduction_i4(long ptr long) vcomp._vcomp_reduction_i4
@ stub _vcomp_reduction_i8
@ stub _vcomp_reduction_i8
@ stub _vcomp_reduction_r4
@ stub _vcomp_reduction_r4
@ stub _vcomp_reduction_r8
@ stub _vcomp_reduction_r8
@ stub _vcomp_reduction_u1
@ stub _vcomp_reduction_u1
@
stub
_vcomp_reduction_u2
@
cdecl _vcomp_reduction_u2(long ptr long) vcomp.
_vcomp_reduction_u2
@ cdecl _vcomp_reduction_u4(long ptr long) vcomp._vcomp_reduction_u4
@ cdecl _vcomp_reduction_u4(long ptr long) vcomp._vcomp_reduction_u4
@ stub _vcomp_reduction_u8
@ stub _vcomp_reduction_u8
@ cdecl _vcomp_sections_init(long) vcomp._vcomp_sections_init
@ cdecl _vcomp_sections_init(long) vcomp._vcomp_sections_init
...
...
dlls/vcomp110/vcomp110.spec
View file @
86dea350
...
@@ -75,13 +75,13 @@
...
@@ -75,13 +75,13 @@
@ stub _vcomp_ordered_end
@ stub _vcomp_ordered_end
@ stub _vcomp_ordered_loop_end
@ stub _vcomp_ordered_loop_end
@ stub _vcomp_reduction_i1
@ stub _vcomp_reduction_i1
@
stub
_vcomp_reduction_i2
@
cdecl _vcomp_reduction_i2(long ptr long) vcomp.
_vcomp_reduction_i2
@ cdecl _vcomp_reduction_i4(long ptr long) vcomp._vcomp_reduction_i4
@ cdecl _vcomp_reduction_i4(long ptr long) vcomp._vcomp_reduction_i4
@ stub _vcomp_reduction_i8
@ stub _vcomp_reduction_i8
@ stub _vcomp_reduction_r4
@ stub _vcomp_reduction_r4
@ stub _vcomp_reduction_r8
@ stub _vcomp_reduction_r8
@ stub _vcomp_reduction_u1
@ stub _vcomp_reduction_u1
@
stub
_vcomp_reduction_u2
@
cdecl _vcomp_reduction_u2(long ptr long) vcomp.
_vcomp_reduction_u2
@ cdecl _vcomp_reduction_u4(long ptr long) vcomp._vcomp_reduction_u4
@ cdecl _vcomp_reduction_u4(long ptr long) vcomp._vcomp_reduction_u4
@ stub _vcomp_reduction_u8
@ stub _vcomp_reduction_u8
@ cdecl _vcomp_sections_init(long) vcomp._vcomp_sections_init
@ cdecl _vcomp_sections_init(long) vcomp._vcomp_sections_init
...
...
dlls/vcomp120/vcomp120.spec
View file @
86dea350
...
@@ -75,13 +75,13 @@
...
@@ -75,13 +75,13 @@
@ stub _vcomp_ordered_end
@ stub _vcomp_ordered_end
@ stub _vcomp_ordered_loop_end
@ stub _vcomp_ordered_loop_end
@ stub _vcomp_reduction_i1
@ stub _vcomp_reduction_i1
@
stub
_vcomp_reduction_i2
@
cdecl _vcomp_reduction_i2(long ptr long) vcomp.
_vcomp_reduction_i2
@ cdecl _vcomp_reduction_i4(long ptr long) vcomp._vcomp_reduction_i4
@ cdecl _vcomp_reduction_i4(long ptr long) vcomp._vcomp_reduction_i4
@ stub _vcomp_reduction_i8
@ stub _vcomp_reduction_i8
@ stub _vcomp_reduction_r4
@ stub _vcomp_reduction_r4
@ stub _vcomp_reduction_r8
@ stub _vcomp_reduction_r8
@ stub _vcomp_reduction_u1
@ stub _vcomp_reduction_u1
@
stub
_vcomp_reduction_u2
@
cdecl _vcomp_reduction_u2(long ptr long) vcomp.
_vcomp_reduction_u2
@ cdecl _vcomp_reduction_u4(long ptr long) vcomp._vcomp_reduction_u4
@ cdecl _vcomp_reduction_u4(long ptr long) vcomp._vcomp_reduction_u4
@ stub _vcomp_reduction_u8
@ stub _vcomp_reduction_u8
@ cdecl _vcomp_sections_init(long) vcomp._vcomp_sections_init
@ cdecl _vcomp_sections_init(long) vcomp._vcomp_sections_init
...
...
dlls/vcomp140/vcomp140.spec
View file @
86dea350
...
@@ -75,13 +75,13 @@
...
@@ -75,13 +75,13 @@
@ stub _vcomp_ordered_end
@ stub _vcomp_ordered_end
@ stub _vcomp_ordered_loop_end
@ stub _vcomp_ordered_loop_end
@ stub _vcomp_reduction_i1
@ stub _vcomp_reduction_i1
@
stub
_vcomp_reduction_i2
@
cdecl _vcomp_reduction_i2(long ptr long) vcomp.
_vcomp_reduction_i2
@ cdecl _vcomp_reduction_i4(long ptr long) vcomp._vcomp_reduction_i4
@ cdecl _vcomp_reduction_i4(long ptr long) vcomp._vcomp_reduction_i4
@ stub _vcomp_reduction_i8
@ stub _vcomp_reduction_i8
@ stub _vcomp_reduction_r4
@ stub _vcomp_reduction_r4
@ stub _vcomp_reduction_r8
@ stub _vcomp_reduction_r8
@ stub _vcomp_reduction_u1
@ stub _vcomp_reduction_u1
@
stub
_vcomp_reduction_u2
@
cdecl _vcomp_reduction_u2(long ptr long) vcomp.
_vcomp_reduction_u2
@ cdecl _vcomp_reduction_u4(long ptr long) vcomp._vcomp_reduction_u4
@ cdecl _vcomp_reduction_u4(long ptr long) vcomp._vcomp_reduction_u4
@ stub _vcomp_reduction_u8
@ stub _vcomp_reduction_u8
@ cdecl _vcomp_sections_init(long) vcomp._vcomp_sections_init
@ cdecl _vcomp_sections_init(long) vcomp._vcomp_sections_init
...
...
dlls/vcomp90/vcomp90.spec
View file @
86dea350
...
@@ -74,13 +74,13 @@
...
@@ -74,13 +74,13 @@
@ stub _vcomp_ordered_end
@ stub _vcomp_ordered_end
@ stub _vcomp_ordered_loop_end
@ stub _vcomp_ordered_loop_end
@ stub _vcomp_reduction_i1
@ stub _vcomp_reduction_i1
@
stub
_vcomp_reduction_i2
@
cdecl _vcomp_reduction_i2(long ptr long) vcomp.
_vcomp_reduction_i2
@ cdecl _vcomp_reduction_i4(long ptr long) vcomp._vcomp_reduction_i4
@ cdecl _vcomp_reduction_i4(long ptr long) vcomp._vcomp_reduction_i4
@ stub _vcomp_reduction_i8
@ stub _vcomp_reduction_i8
@ stub _vcomp_reduction_r4
@ stub _vcomp_reduction_r4
@ stub _vcomp_reduction_r8
@ stub _vcomp_reduction_r8
@ stub _vcomp_reduction_u1
@ stub _vcomp_reduction_u1
@
stub
_vcomp_reduction_u2
@
cdecl _vcomp_reduction_u2(long ptr long) vcomp.
_vcomp_reduction_u2
@ cdecl _vcomp_reduction_u4(long ptr long) vcomp._vcomp_reduction_u4
@ cdecl _vcomp_reduction_u4(long ptr long) vcomp._vcomp_reduction_u4
@ stub _vcomp_reduction_u8
@ stub _vcomp_reduction_u8
@ cdecl _vcomp_sections_init(long) vcomp._vcomp_sections_init
@ cdecl _vcomp_sections_init(long) vcomp._vcomp_sections_init
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment