Daniel Lehman : msvcp120: Implement concurrent_vector::_Segment_index_of.

Alexandre Julliard julliard at winehq.org
Wed Oct 11 14:22:46 CDT 2017


Module: wine
Branch: master
Commit: 4655942816dd32e6330224871d8e166cedc6922a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4655942816dd32e6330224871d8e166cedc6922a

Author: Daniel Lehman <dlehman at esri.com>
Date:   Tue Sep  5 15:01:47 2017 -0700

msvcp120: Implement concurrent_vector::_Segment_index_of.

Signed-off-by: Daniel Lehman <dlehman at esri.com>
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at 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 at _TaskCollection@details at Concurrency@@QEAAXPEAV_UnrealizedChore at 23@PEAVlocation at 3@@Z
 @ cdecl -arch=win32 ?_ScheduleTask at _CurrentScheduler@details at Concurrency@@SAXP6AXPAX at Z0@Z(ptr ptr) msvcr120.?_ScheduleTask at _CurrentScheduler@details at Concurrency@@SAXP6AXPAX at Z0@Z
 @ cdecl -arch=win64 ?_ScheduleTask at _CurrentScheduler@details at Concurrency@@SAXP6AXPEAX at Z0@Z(ptr ptr) msvcr120.?_ScheduleTask at _CurrentScheduler@details at Concurrency@@SAXP6AXPEAX at Z0@Z
-@ stub -arch=win32 ?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KAII at Z
-@ stub -arch=win64 ?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KA_K_K at Z
+@ cdecl -arch=win32 ?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KAII at Z(long) msvcp120.?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KAII at Z
+@ cdecl -arch=win64 ?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KA_K_K at Z(long) msvcp120.?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KA_K_K at Z
 @ thiscall -arch=i386 ?_SetSpinCount@?$_SpinWait@$00 at details@Concurrency@@QAEXI at Z(ptr long) msvcr120.?_SetSpinCount@?$_SpinWait@$00 at details@Concurrency@@QAEXI at Z
 @ cdecl -arch=win64 ?_SetSpinCount@?$_SpinWait@$00 at details@Concurrency@@QEAAXI at Z(ptr long) msvcr120.?_SetSpinCount@?$_SpinWait@$00 at details@Concurrency@@QEAAXI at Z
 @ thiscall -arch=i386 ?_SetSpinCount@?$_SpinWait@$0A@@details at Concurrency@@QAEXI at Z(ptr long) msvcr120.?_SetSpinCount@?$_SpinWait@$0A@@details at Concurrency@@QAEXI at 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 at _WV?$ostreambuf_iterator at _WU?$char_traits at _W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator at _WU?$char_traits at _W@std@@@2 at V32@_W_K at Z(ptr ptr ptr long long) num_put_wchar__Rep
 @ stub -arch=win32 ?_Rng_abort at tr1@std@@YAXPBD at Z
 @ stub -arch=win64 ?_Rng_abort at tr1@std@@YAXPEBD at Z
-@ stub -arch=win32 ?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KAII at Z
-@ stub -arch=win64 ?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KA_K_K at Z
+@ cdecl -arch=win32 ?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KAII at Z(long) _vector_base_v4__Segment_index_of
+@ cdecl -arch=win64 ?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KA_K_K at Z(long) _vector_base_v4__Segment_index_of
 @ cdecl -arch=win32 ?_Setgloballocale at locale@std@@CAXPAX at Z(ptr) locale__Setgloballocale
 @ cdecl -arch=win64 ?_Setgloballocale at locale@std@@CAXPEAX at Z(ptr) locale__Setgloballocale
 @ cdecl -arch=arm ?_Swap_all at _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 at std@@YAXVexception_ptr at 1@@Z
 @ stub -arch=win32 ?_Rng_abort at std@@YAXPBD at Z
 @ stub -arch=win64 ?_Rng_abort at std@@YAXPEBD at Z
-@ stub -arch=win32 ?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KAII at Z
-@ stub -arch=win64 ?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KA_K_K at Z
+@ cdecl -arch=win32 ?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KAII at Z(long) _vector_base_v4__Segment_index_of
+@ cdecl -arch=win64 ?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KA_K_K at Z(long) _vector_base_v4__Segment_index_of
 @ cdecl -arch=win32 ?_Setgloballocale at locale@std@@CAXPAX at Z(ptr) locale__Setgloballocale
 @ cdecl -arch=win64 ?_Setgloballocale at locale@std@@CAXPEAX at Z(ptr) locale__Setgloballocale
 @ stub -arch=win32 ?_Src@?1??_Getffldx@?$num_get at DV?$istreambuf_iterator at DU?$char_traits at D@std@@@std@@@std@@ABAHPADAAV?$istreambuf_iterator at DU?$char_traits at D@std@@@3 at 1AAVios_base@3 at PAH@Z at 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 at std@@YAXVexception_ptr at 1@@Z
 @ stub -arch=win32 ?_Rng_abort at std@@YAXPBD at Z
 @ stub -arch=win64 ?_Rng_abort at std@@YAXPEBD at Z
-@ stub -arch=win32 ?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KAII at Z
-@ stub -arch=win64 ?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KA_K_K at Z
+@ cdecl -arch=win32 ?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KAII at Z(long) _vector_base_v4__Segment_index_of
+@ cdecl -arch=win64 ?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KA_K_K at Z(long) _vector_base_v4__Segment_index_of
 @ cdecl -arch=win32 ?_Setgloballocale at locale@std@@CAXPAX at Z(ptr) locale__Setgloballocale
 @ cdecl -arch=win64 ?_Setgloballocale at locale@std@@CAXPEAX at Z(ptr) locale__Setgloballocale
 @ stub -arch=win32 ?_Src@?1??_Getffldx@?$num_get at DV?$istreambuf_iterator at DU?$char_traits at D@std@@@std@@@std@@ABAHPADAAV?$istreambuf_iterator at DU?$char_traits at D@std@@@3 at 1AAVios_base@3 at PAH@Z at 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 at std@@YAXVexception_ptr at 1@@Z
 @ stub -arch=win32 ?_Rng_abort at std@@YAXPBD at Z
 @ stub -arch=win64 ?_Rng_abort at std@@YAXPEBD at Z
-@ stub -arch=win32 ?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KAII at Z
-@ stub -arch=win64 ?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KA_K_K at Z
+@ cdecl -arch=win32 ?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KAII at Z(long) msvcp120.?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KAII at Z
+@ cdecl -arch=win64 ?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KA_K_K at Z(long) msvcp120.?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KA_K_K at Z
 @ cdecl -arch=win32 ?_Setgloballocale at locale@std@@CAXPAX at Z(ptr) msvcp120.?_Setgloballocale at locale@std@@CAXPAX at Z
 @ cdecl -arch=win64 ?_Setgloballocale at locale@std@@CAXPEAX at Z(ptr) msvcp120.?_Setgloballocale at locale@std@@CAXPEAX at Z
 @ stub -arch=win32 ?_Src@?1??_Getffldx@?$num_get at DV?$istreambuf_iterator at DU?$char_traits at D@std@@@std@@@std@@ABAHPADAAV?$istreambuf_iterator at DU?$char_traits at D@std@@@3 at 1AAVios_base@3 at PAH@Z at 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 at _Concurrent_vector_base_v4@details at Concurrency@@KAII at Z */
+/* ?_Segment_index_of at _Concurrent_vector_base_v4@details at Concurrency@@KA_K_K at 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




More information about the wine-cvs mailing list