{"action":"created","issue":{"url":"https://api.github.com/repos/gnuradio/volk/issues/63","repository_url":"https://api.github.com/repos/gnuradio/volk","labels_url":"https://api.github.com/repos/gnuradio/volk/issues/63/labels{/name}","comments_url":"https://api.github.com/repos/gnuradio/volk/issues/63/comments","events_url":"https://api.github.com/repos/gnuradio/volk/issues/63/events","html_url":"https://github.com/gnuradio/volk/issues/63","id":131891154,"number":63,"title":" __cpuid_count() for MSVC","user":{"login":"gnieboer","id":3222377,"avatar_url":"https://avatars.githubusercontent.com/u/3222377?v=3","gravatar_id":"","url":"https://api.github.com/users/gnieboer","html_url":"https://github.com/gnieboer","followers_url":"https://api.github.com/users/gnieboer/followers","following_url":"https://api.github.com/users/gnieboer/following{/other_user}","gists_url":"https://api.github.com/users/gnieboer/gists{/gist_id}","starred_url":"https://api.github.com/users/gnieboer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnieboer/subscriptions","organizations_url":"https://api.github.com/users/gnieboer/orgs","repos_url":"https://api.github.com/users/gnieboer/repos","events_url":"https://api.github.com/users/gnieboer/events{/privacy}","received_events_url":"https://api.github.com/users/gnieboer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-06T19:34:28Z","updated_at":"2016-02-07T04:57:07Z","closed_at":null,"body":"Volk won't build on MSVC because __cpuid_count() isn't available.  This was posted previously to the discussion board but the submitter never submitted an issue here.  It's cut and pasted below...\r\n\r\n-------------------\r\nI noticed since last time (a year ago) I tried building\r\nVolk using MSVC v16, the volk_cpu.tmp.c now uses the\r\ngcc-centric function '__cpuid_count()' which MSVC doesn't\r\nhave.\r\n\r\nI'm not really sure if the below patch is correct. But I\r\nassume (from looking at gcc 5.1's source) that the ECX should\r\nbe loaded with the 'count' value. So could it be patched into\r\nsomething like this?\r\n\r\n```\r\n--- a/volk/tmpl/volk_cpu.tmpl.c  2015-09-01 13:52:53\r\n+++ b/volk_cpu.tmpl.c     2015-09-07 13:44:25\r\n@@ -71,8 +71,16 @@\r\n\r\n static inline unsigned int cpuid_count_x86_bit(unsigned int level, unsigned int count, unsigned int reg, unsigned int bit) {\r\n #if defined(VOLK_CPU_x86)\r\n+    #if defined(_MSC_VER) && defined(HAVE_INTRIN_H)\r\n+      int regs[4];\r\n+      __cpuidex(regs, level, count);\r\n+    #elif defined(__GNUC__)\r\n     unsigned int regs[4];\r\n     __cpuid_count(level, count, regs[0],  regs[1],  regs[2], regs[3]);\r\n+    #else\r\n+      #error No __cpuid()!\r\n+    #endif\r\n     return regs[reg] >> bit & 0x01;\r\n #else\r\n     return 0;\r\n\r\n```\r\n\r\n-------\r\n\r\nJust to let you know.\r\n\r\nThe docs on MSVC's __cpuidex() is here:\r\n  https://msdn.microsoft.com/en-us/library/vstudio/hskdteyh(v=vs.100).aspx\r\n\r\n-- \r\n--g"},"comment":{"url":"https://api.github.com/repos/gnuradio/volk/issues/comments/180946299","html_url":"https://github.com/gnuradio/volk/issues/63#issuecomment-180946299","issue_url":"https://api.github.com/repos/gnuradio/volk/issues/63","id":180946299,"user":{"login":"n-west","id":1879306,"avatar_url":"https://avatars.githubusercontent.com/u/1879306?v=3","gravatar_id":"","url":"https://api.github.com/users/n-west","html_url":"https://github.com/n-west","followers_url":"https://api.github.com/users/n-west/followers","following_url":"https://api.github.com/users/n-west/following{/other_user}","gists_url":"https://api.github.com/users/n-west/gists{/gist_id}","starred_url":"https://api.github.com/users/n-west/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/n-west/subscriptions","organizations_url":"https://api.github.com/users/n-west/orgs","repos_url":"https://api.github.com/users/n-west/repos","events_url":"https://api.github.com/users/n-west/events{/privacy}","received_events_url":"https://api.github.com/users/n-west/received_events","type":"User","site_admin":false},"created_at":"2016-02-07T04:57:07Z","updated_at":"2016-02-07T04:57:07Z","body":"It looks like you have functionally equivalent patches, and I'm going to take a version of Josh's that works with gcc. Confirmation that this fixes your windows issues would be nice as I have no way to test windows stuff"}}