Module: wine Branch: master Commit: 4655942816dd32e6330224871d8e166cedc6922a URL: http://source.winehq.org/git/wine.git/?a=commit;h=4655942816dd32e6330224871d... Author: Daniel Lehman <dlehman(a)esri.com> Date: Tue Sep 5 15:01:47 2017 -0700 msvcp120: Implement concurrent_vector::_Segment_index_of. Signed-off-by: Daniel Lehman <dlehman(a)esri.com> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/concrt140/concrt140.spec | 4 +-- dlls/msvcp100/msvcp100.spec | 4 +-- dlls/msvcp110/msvcp110.spec | 4 +-- dlls/msvcp120/msvcp120.spec | 4 +-- dlls/msvcp120_app/msvcp120_app.spec | 4 +-- dlls/msvcp90/misc.c | 49 +++++++++++++++++++++++++++++++++++++ 6 files changed, 59 insertions(+), 10 deletions(-) diff --git a/dlls/concrt140/concrt140.spec b/dlls/concrt140/concrt140.spec index c0a0473..eb0c9fb 100644 --- a/dlls/concrt140/concrt140.spec +++ b/dlls/concrt140/concrt140.spec @@ -436,8 +436,8 @@ @ stub -arch=win64 ?_Schedule(a)_TaskCollection@details(a)Concurrency@@QEAAXPEAV_UnrealizedChore(a)23@PEAVlocation(a)3@@Z @ cdecl -arch=win32 ?_ScheduleTask(a)_CurrentScheduler@details(a)Concurrency@@SAXP6AXPAX(a)Z0@Z(ptr ptr) msvcr120.?_ScheduleTask(a)_CurrentScheduler@details(a)Concurrency@@SAXP6AXPAX(a)Z0@Z @ cdecl -arch=win64 ?_ScheduleTask(a)_CurrentScheduler@details(a)Concurrency@@SAXP6AXPEAX(a)Z0@Z(ptr ptr) msvcr120.?_ScheduleTask(a)_CurrentScheduler@details(a)Concurrency@@SAXP6AXPEAX(a)Z0@Z -@ stub -arch=win32 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KAII(a)Z -@ stub -arch=win64 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KA_K_K(a)Z +@ cdecl -arch=win32 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KAII(a)Z(long) msvcp120.?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KAII(a)Z +@ cdecl -arch=win64 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KA_K_K(a)Z(long) msvcp120.?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KA_K_K(a)Z @ thiscall -arch=i386 ?_SetSpinCount@?$_SpinWait@$00(a)details@Concurrency@@QAEXI(a)Z(ptr long) msvcr120.?_SetSpinCount@?$_SpinWait@$00(a)details@Concurrency@@QAEXI(a)Z @ cdecl -arch=win64 ?_SetSpinCount@?$_SpinWait@$00(a)details@Concurrency@@QEAAXI(a)Z(ptr long) msvcr120.?_SetSpinCount@?$_SpinWait@$00(a)details@Concurrency@@QEAAXI(a)Z @ thiscall -arch=i386 ?_SetSpinCount@?$_SpinWait@$0A@@details(a)Concurrency@@QAEXI(a)Z(ptr long) msvcr120.?_SetSpinCount@?$_SpinWait@$0A@@details(a)Concurrency@@QAEXI(a)Z diff --git a/dlls/msvcp100/msvcp100.spec b/dlls/msvcp100/msvcp100.spec index 3cbb88d..8bffda2 100644 --- a/dlls/msvcp100/msvcp100.spec +++ b/dlls/msvcp100/msvcp100.spec @@ -1223,8 +1223,8 @@ @ cdecl -arch=win64 ?_Rep@?$num_put(a)_WV?$ostreambuf_iterator(a)_WU?$char_traits(a)_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator(a)_WU?$char_traits(a)_W@std@@@2(a)V32@_W_K(a)Z(ptr ptr ptr long long) num_put_wchar__Rep @ stub -arch=win32 ?_Rng_abort(a)tr1@std@@YAXPBD(a)Z @ stub -arch=win64 ?_Rng_abort(a)tr1@std@@YAXPEBD(a)Z -@ stub -arch=win32 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KAII(a)Z -@ stub -arch=win64 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KA_K_K(a)Z +@ cdecl -arch=win32 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KAII(a)Z(long) _vector_base_v4__Segment_index_of +@ cdecl -arch=win64 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KA_K_K(a)Z(long) _vector_base_v4__Segment_index_of @ cdecl -arch=win32 ?_Setgloballocale(a)locale@std@@CAXPAX(a)Z(ptr) locale__Setgloballocale @ cdecl -arch=win64 ?_Setgloballocale(a)locale@std@@CAXPEAX(a)Z(ptr) locale__Setgloballocale @ cdecl -arch=arm ?_Swap_all(a)_Container_base0@std@@QAAXAAU12@@Z(ptr ptr) Container_base0_Swap_all diff --git a/dlls/msvcp110/msvcp110.spec b/dlls/msvcp110/msvcp110.spec index f88719f..c912202 100644 --- a/dlls/msvcp110/msvcp110.spec +++ b/dlls/msvcp110/msvcp110.spec @@ -1735,8 +1735,8 @@ @ stub ?_Rethrow_future_exception(a)std@@YAXVexception_ptr(a)1@@Z @ stub -arch=win32 ?_Rng_abort(a)std@@YAXPBD(a)Z @ stub -arch=win64 ?_Rng_abort(a)std@@YAXPEBD(a)Z -@ stub -arch=win32 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KAII(a)Z -@ stub -arch=win64 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KA_K_K(a)Z +@ cdecl -arch=win32 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KAII(a)Z(long) _vector_base_v4__Segment_index_of +@ cdecl -arch=win64 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KA_K_K(a)Z(long) _vector_base_v4__Segment_index_of @ cdecl -arch=win32 ?_Setgloballocale(a)locale@std@@CAXPAX(a)Z(ptr) locale__Setgloballocale @ cdecl -arch=win64 ?_Setgloballocale(a)locale@std@@CAXPEAX(a)Z(ptr) locale__Setgloballocale @ stub -arch=win32 ?_Src@?1??_Getffldx@?$num_get(a)DV?$istreambuf_iterator(a)DU?$char_traits(a)D@std@@@std@@@std@@ABAHPADAAV?$istreambuf_iterator(a)DU?$char_traits(a)D@std@@@3(a)1AAVios_base@3(a)PAH@Z(a)4QBDB diff --git a/dlls/msvcp120/msvcp120.spec b/dlls/msvcp120/msvcp120.spec index ae1ac57..61d7c7d 100644 --- a/dlls/msvcp120/msvcp120.spec +++ b/dlls/msvcp120/msvcp120.spec @@ -1696,8 +1696,8 @@ @ stub ?_Rethrow_future_exception(a)std@@YAXVexception_ptr(a)1@@Z @ stub -arch=win32 ?_Rng_abort(a)std@@YAXPBD(a)Z @ stub -arch=win64 ?_Rng_abort(a)std@@YAXPEBD(a)Z -@ stub -arch=win32 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KAII(a)Z -@ stub -arch=win64 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KA_K_K(a)Z +@ cdecl -arch=win32 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KAII(a)Z(long) _vector_base_v4__Segment_index_of +@ cdecl -arch=win64 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KA_K_K(a)Z(long) _vector_base_v4__Segment_index_of @ cdecl -arch=win32 ?_Setgloballocale(a)locale@std@@CAXPAX(a)Z(ptr) locale__Setgloballocale @ cdecl -arch=win64 ?_Setgloballocale(a)locale@std@@CAXPEAX(a)Z(ptr) locale__Setgloballocale @ stub -arch=win32 ?_Src@?1??_Getffldx@?$num_get(a)DV?$istreambuf_iterator(a)DU?$char_traits(a)D@std@@@std@@@std@@ABAHPADAAV?$istreambuf_iterator(a)DU?$char_traits(a)D@std@@@3(a)1AAVios_base@3(a)PAH@Z(a)4QBDB diff --git a/dlls/msvcp120_app/msvcp120_app.spec b/dlls/msvcp120_app/msvcp120_app.spec index 56bed79..e63b3f7 100644 --- a/dlls/msvcp120_app/msvcp120_app.spec +++ b/dlls/msvcp120_app/msvcp120_app.spec @@ -1696,8 +1696,8 @@ @ stub ?_Rethrow_future_exception(a)std@@YAXVexception_ptr(a)1@@Z @ stub -arch=win32 ?_Rng_abort(a)std@@YAXPBD(a)Z @ stub -arch=win64 ?_Rng_abort(a)std@@YAXPEBD(a)Z -@ stub -arch=win32 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KAII(a)Z -@ stub -arch=win64 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KA_K_K(a)Z +@ cdecl -arch=win32 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KAII(a)Z(long) msvcp120.?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KAII(a)Z +@ cdecl -arch=win64 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KA_K_K(a)Z(long) msvcp120.?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KA_K_K(a)Z @ cdecl -arch=win32 ?_Setgloballocale(a)locale@std@@CAXPAX(a)Z(ptr) msvcp120.?_Setgloballocale(a)locale@std@@CAXPAX(a)Z @ cdecl -arch=win64 ?_Setgloballocale(a)locale@std@@CAXPEAX(a)Z(ptr) msvcp120.?_Setgloballocale(a)locale@std@@CAXPEAX(a)Z @ stub -arch=win32 ?_Src@?1??_Getffldx@?$num_get(a)DV?$istreambuf_iterator(a)DU?$char_traits(a)D@std@@@std@@@std@@ABAHPADAAV?$istreambuf_iterator(a)DU?$char_traits(a)D@std@@@3(a)1AAVios_base@3(a)PAH@Z(a)4QBDB diff --git a/dlls/msvcp90/misc.c b/dlls/msvcp90/misc.c index 28d1af3..1dcc590 100644 --- a/dlls/msvcp90/misc.c +++ b/dlls/msvcp90/misc.c @@ -1645,3 +1645,52 @@ _Ph _Ph_6 = {0}, _Ph_7 = {0}, _Ph_8 = {0}, _Ph_9 = {0}, _Ph_10 = {0}; _Ph _Ph_11 = {0}, _Ph_12 = {0}, _Ph_13 = {0}, _Ph_14 = {0}, _Ph_15 = {0}; _Ph _Ph_16 = {0}, _Ph_17 = {0}, _Ph_18 = {0}, _Ph_19 = {0}, _Ph_20 = {0}; #endif + +#if _MSVCP_VER >= 100 +/* based on wined3d_log2i from wined3d.h */ +/* Return the integer base-2 logarithm of (x|1). Result is 0 for x == 0. */ +static inline unsigned int log2i(unsigned int x) +{ +#ifdef HAVE___BUILTIN_CLZ + return __builtin_clz(x|1) ^ 0x1f; +#else + static const unsigned int l[] = + { + ~0u, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + }; + unsigned int i; + + x |= 1; + return (i = x >> 16) ? (x = i >> 8) ? l[x] + 24 : l[i] + 16 : (i = x >> 8) ? l[i] + 8 : l[x]; +#endif +} + +/* ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KAII(a)Z */ +/* ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KA_K_K(a)Z */ +MSVCP_size_t __cdecl _vector_base_v4__Segment_index_of(MSVCP_size_t x) +{ + unsigned int half; + + TRACE("(%lu)\n", x); + + if((sizeof(x) == 8) && (half = x >> 32)) + return log2i(half) + 32; + + return log2i(x); +} +#endif