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
f5939399
Commit
f5939399
authored
Dec 10, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use __builtin_clz() in wined3d_log2i() when available.
parent
42b8a767
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
0 deletions
+50
-0
configure
configure
+33
-0
configure.ac
configure.ac
+9
-0
utils.c
dlls/wined3d/utils.c
+5
-0
config.h.in
include/config.h.in
+3
-0
No files found.
configure
View file @
f5939399
...
...
@@ -16448,6 +16448,39 @@ done
LIBS
=
"
$ac_save_LIBS
"
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for __builtin_clz"
>
&5
$as_echo_n
"checking for __builtin_clz... "
>
&6
;
}
if
${
ac_cv_have___builtin_clz
+
:
}
false
;
then
:
$as_echo_n
"(cached) "
>
&6
else
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
int
main ()
{
return __builtin_clz(1)
;
return 0;
}
_ACEOF
if
ac_fn_c_try_link
"
$LINENO
"
;
then
:
ac_cv_have___builtin_clz
=
"yes"
else
ac_cv_have___builtin_clz
=
"no"
fi
rm
-f
core conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
conftest.
$ac_ext
fi
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_have___builtin_clz
"
>
&5
$as_echo
"
$ac_cv_have___builtin_clz
"
>
&6
;
}
if
test
"
$ac_cv_have___builtin_clz
"
=
"yes"
then
$as_echo
"#define HAVE___BUILTIN_CLZ 1"
>>
confdefs.h
fi
case
$host_cpu
in
*
i[3456789]86
*
)
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking whether we need to define __i386__"
>
&5
...
...
configure.ac
View file @
f5939399
...
...
@@ -2595,6 +2595,15 @@ AC_CHECK_FUNCS(\
)
LIBS="$ac_save_LIBS"
dnl Check for __builtin_clz
AC_CACHE_CHECK([for __builtin_clz], ac_cv_have___builtin_clz,
AC_LINK_IFELSE([AC_LANG_PROGRAM(,[[return __builtin_clz(1)]])],
[ac_cv_have___builtin_clz="yes"], [ac_cv_have___builtin_clz="no"]))
if test "$ac_cv_have___builtin_clz" = "yes"
then
AC_DEFINE(HAVE___BUILTIN_CLZ, 1, [Define to 1 if you have the `__builtin_clz' built-in function.])
fi
dnl *** check for the need to define platform-specific symbols
case $host_cpu in
...
...
dlls/wined3d/utils.c
View file @
f5939399
...
...
@@ -3929,8 +3929,12 @@ const struct wine_rb_functions wined3d_ffp_vertex_program_rb_functions =
wined3d_ffp_vertex_program_key_compare
,
};
/* Return the integer base-2 logarithm of x. Undefined for x == 0. */
UINT
wined3d_log2i
(
UINT32
x
)
{
#ifdef HAVE___BUILTIN_CLZ
return
__builtin_clz
(
x
)
^
0x1f
;
#else
static
const
UINT
l
[]
=
{
~
0U
,
0
,
1
,
1
,
2
,
2
,
2
,
2
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
3
,
...
...
@@ -3953,6 +3957,7 @@ UINT wined3d_log2i(UINT32 x)
UINT32
i
;
return
(
i
=
x
>>
16
)
?
(
x
=
i
>>
8
)
?
l
[
x
]
+
24
:
l
[
i
]
+
16
:
(
i
=
x
>>
8
)
?
l
[
i
]
+
8
:
l
[
x
];
#endif
}
const
struct
blit_shader
*
wined3d_select_blitter
(
const
struct
wined3d_gl_info
*
gl_info
,
enum
wined3d_blit_op
blit_op
,
...
...
include/config.h.in
View file @
f5939399
...
...
@@ -1281,6 +1281,9 @@
/* Define to 1 if you have the `_vsnprintf' function. */
#undef HAVE__VSNPRINTF
/* Define to 1 if you have the `__builtin_clz' built-in function. */
#undef HAVE___BUILTIN_CLZ
/* Define to 1 if you have the `__res_getservers' function. */
#undef HAVE___RES_GETSERVERS
...
...
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