{"id":294565,"date":"2019-09-11T21:00:07","date_gmt":"2019-09-11T21:00:07","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=294565"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=294565","title":{"rendered":"\u041a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f popcount \u0432 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u0445"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\"><i>\u042d\u0442\u043e \u043f\u0441\u0435\u0432\u0434\u043e\u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 <a href=\"https:\/\/www.youtube.com\/watch?v=bLFqLfz2Fmc\">\u043c\u043e\u0435\u0439 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043d\u0430 !!Con 2019<\/a>.<\/i><\/p>\n<p>  \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u044b\u0445 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440 \u0435\u0441\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <code>popcount<\/code>, \u0441\u043e\u043a\u0440\u0430\u0449\u0451\u043d\u043d\u043e \u043e\u0442 &#8216;population count&#8217;. \u041e\u043d\u0430 \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432 \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u043c \u0441\u043b\u043e\u0432\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 (\u0432\u043e\u0437\u044c\u043c\u0451\u043c 8-\u0431\u0438\u0442\u043d\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b), <code>popcount(00100110)<\/code> \u0440\u0430\u0432\u043d\u043e 3, \u0430 <code>popcount(01100000)<\/code> \u0440\u0430\u0432\u043d\u043e 2.<\/p>\n<p>  \u0412\u0430\u0441 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u0434\u0438\u0432\u0438\u0442\u044c, \u043a\u0430\u043a \u0438 \u043c\u0435\u043d\u044f, \u043d\u043e \u044d\u0442\u043e \u0432\u0441\u0451, \u0447\u0442\u043e \u043e\u043d\u0430 \u0434\u0435\u043b\u0430\u0435\u0442! \u041a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c, \u043f\u0440\u0430\u0432\u0434\u0430?<br \/>  <a name=\"habracut\"><\/a><br \/>  \u042f \u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u044d\u0442\u043e \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0433\u0438\u043f\u0435\u0440\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043e\u043d\u0430 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432, \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435, \u0441 1961 \u0433\u043e\u0434\u0430:<\/p>\n<ul>\n<li>1961: <a href=\"https:\/\/en.wikipedia.org\/wiki\/IBM_7030_Stretch\">IBM Stretch<\/a>  <\/li>\n<li>1964: <a href=\"https:\/\/en.wikipedia.org\/wiki\/CDC_6000_series\">CDC 6000<\/a>  <\/li>\n<li>1975: <a href=\"https:\/\/en.wikipedia.org\/wiki\/Cray-1\">Cray-1<\/a>  <\/li>\n<li>2005: <a href=\"https:\/\/en.wikipedia.org\/wiki\/SPARC\">SPARC<\/a>  <\/li>\n<li>2005: <a href=\"https:\/\/en.wikipedia.org\/wiki\/ARM_architecture#Advanced_SIMD_(NEON)\">ARM NEON<\/a>  <\/li>\n<li>2007: <a href=\"https:\/\/en.wikipedia.org\/wiki\/AMD_10h\">AMD K10<\/a>  <\/li>\n<li>2008: <a href=\"https:\/\/en.wikipedia.org\/wiki\/Nehalem_(microarchitecture)\">Intel Nehalem<\/a><\/li>\n<\/ul>\n<p>  \u0422\u0430\u043a \u0447\u0442\u043e \u0436\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442?  <\/p>\n<h4>\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0410\u041d\u0411<\/h4>\n<p>  <code>popcount<\/code> \u0442\u0430\u043a\u0436\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u043a\u0430\u043a \u00ab\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0410\u041d\u0411\u00bb, \u0438 \u0432 <a href=\"https:\/\/groups.google.com\/forum\/#!msg\/comp.arch\/UXEi7G6WHuU\/Z2z7fC7Xhr8J\">\u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c \u0442\u0440\u0435\u0434\u0435 \u043d\u0430 comp.arch<\/a> \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0435\u0451 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0438. \u0425\u043e\u0434\u044f\u0442 \u0441\u043b\u0443\u0445\u0438, \u0447\u0442\u043e \u0435\u0451 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0432 \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 CPU \u043f\u043e \u043f\u0440\u043e\u0441\u044c\u0431\u0435 \u0410\u041d\u0411. \u041a\u0430\u043a \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432 <a href=\"http:\/\/cryptome.org\/jya\/sadd.htm\">\u044d\u0442\u043e\u043c \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0447\u0442\u043e\u0432\u043e\u043c \u0442\u0440\u0435\u0434\u0435<\/a>:<\/p>\n<blockquote><p>\u0411\u044b\u043b\u043e \u043f\u043e\u0447\u0442\u0438 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u0435\u0439 \u043e\u0434\u043d\u0443 \u0438\u0437 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0430\u0440\u0442\u0438\u0438 \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0445 \u043c\u0430\u0448\u0438\u043d CDC \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u00ab\u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0443\u00bb \u2014 \u043f\u0440\u0438\u0435\u0437\u0436\u0430\u043b \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0433\u0440\u0443\u0437\u043e\u0432\u0438\u043a, \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e \u043d\u0435\u0439 \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0441\u043b\u044b\u0448\u0430\u043b\u0438.<\/p><\/blockquote>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u0430\u044f \u043b\u0435\u0433\u0435\u043d\u0434\u0430, \u043d\u043e \u0434\u043b\u044f \u0447\u0435\u0433\u043e \u043e\u043d\u0438 \u0435\u0451 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438?<\/p>\n<p>  \u041e\u0434\u0438\u043d \u0438\u0437 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f \u2014 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Hamming_weight\">\u0432\u0435\u0441 \u0425\u044d\u043c\u043c\u0438\u043d\u0433\u0430<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435. \u0414\u043b\u044f \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u044d\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e <code>popcount<\/code>!<\/p>\n<p>  \u041a\u0430\u043a <a href=\"http:\/\/www.talkchess.com\/forum3\/viewtopic.php?t=38521\">\u043e\u0431\u044a\u044f\u0441\u043d\u044f\u043b\u043e\u0441\u044c \u0437\u0434\u0435\u0441\u044c<\/a>, \u0410\u041d\u0411 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u043a\u0440\u0438\u043f\u0442\u043e\u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0447\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0430 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 CDC 6000 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u0441 60-\u0431\u0438\u0442\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u0431\u044b\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0438. \u041e\u043d\u0438 \u0431\u044b\u043b\u0438 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438:<\/p>\n<ol>\n<li>\u0420\u0430\u0437\u0431\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0438  <\/li>\n<li>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0438\u0442 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435  <\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>popcount<\/code> \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0447\u0438\u0441\u043b\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432  <\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0447\u0451\u0442\u0447\u0438\u043a \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0445\u044d\u0448\u0430 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u043a\u0440\u0438\u043f\u0442\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0430<\/li>\n<\/ol>\n<p>  \u041b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u043e, \u0447\u0442\u043e <code>popcount<\/code>, \u043f\u043e\u0445\u043e\u0436\u0435, \u0438\u0441\u0447\u0435\u0437 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u043e\u0432 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u043e\u0439 1970-\u0445 \u0438 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u043e\u0439 2000-\u0445 \u0433\u043e\u0434\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0442\u044c\u0441\u044f \u0447\u0435\u043c-\u0442\u043e \u0435\u0449\u0451, \u043a\u0440\u043e\u043c\u0435 \u043a\u0440\u0438\u043f\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0414\u043b\u044f \u0447\u0435\u0433\u043e \u0435\u0449\u0451 \u0435\u0451 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c?<\/p>\n<h4>\u0418\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u043a<\/h4>\n<p>  \u0421 \u043f\u043e\u043d\u044f\u0442\u0438\u0435\u043c \u0432\u0435\u0441\u0430 \u0425\u044d\u043c\u043c\u0438\u043d\u0433\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u043e <a href=\"https:\/\/en.wikipedia.org\/wiki\/Hamming_distance\">\u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0425\u044d\u043c\u043c\u0438\u043d\u0433\u0430<\/a>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u043e\u0437\u0438\u0446\u0438\u0439 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u0434\u043b\u0438\u043d\u044b. \u0414\u043b\u044f \u0434\u0432\u0443\u0445 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a <code>x<\/code> \u0438 <code>y<\/code>, \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e <code>popcount<\/code> \u043f\u043e\u0441\u043b\u0435 XOR. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre>00100110 01100000 ^ -------- 01000110  popcount(01000110) = 3<\/pre>\n<p>  \u0412 \u0442\u0435\u043b\u0435\u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u0430, \u0433\u0434\u0435 \u043f\u043e \u043f\u0440\u043e\u0432\u043e\u0434\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u0438 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0437\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438.<\/p>\n<p>  \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Hamming_distance#Error_detection_and_error_correction\">\u043a\u043e\u0434 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a<\/a>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0434\u043e \u0434\u0432\u0443\u0445 \u0438\u0437\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432, \u0442\u043e \u043a\u043e\u0434\u043e\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u0425\u044d\u043c\u043c\u0438\u043d\u0433\u0430 \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u043d\u0430 5.<\/p>\n<h4>\u0411\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0441\u0432\u0451\u0440\u0442\u043e\u0447\u043d\u044b\u0435 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0438<\/h4>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u0447\u0442\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u0438\u043d\u043e\u0435: \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0435 \u0441\u0432\u0451\u0440\u0442\u043e\u0447\u043d\u044b\u0435 \u043d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0435 \u0441\u0435\u0442\u0438! \u041d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430, \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435?<\/p>\n<ul>\n<li>\u0411\u0438\u043d\u0430\u0440\u043d\u043e\u0441\u0442\u044c \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 +1 (\u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a 1) \u0438 -1 (\u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a 0), \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 32-\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439.  <\/li>\n<li>\u0421\u0432\u0451\u0440\u0442\u043a\u0430 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446?  <\/li>\n<li>\u041d\u0435\u0439\u0440\u043e\u043d\u043d\u044b\u0435 \u0441\u0435\u0442\u0438\u00a0\u2014 \u044d\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u043b\u0451\u043d\u043d\u044b\u0435 \u043c\u043e\u0437\u0433\u043e\u043c \u0436\u0438\u0432\u043e\u0442\u043d\u044b\u0445 (\u0437\u0434\u0435\u0441\u044c \u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u0432\u0430\u044e).<\/li>\n<\/ul>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u043c\u0430\u0442\u0440\u0438\u0446. \u041d\u043e \u0447\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u043c\u0430\u0442\u0440\u0438\u0446\u0430\u0445?<\/p>\n<p>  \u041e\u0431\u044b\u0447\u043d\u043e\u0435 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446 \u043d\u0430 32-\u0431\u0438\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043e\u0432 \u0441 \u043c\u043e\u0449\u043d\u044b\u043c\u0438 CPU \u0438 GPU, \u043d\u043e \u0432\u0441\u0451 \u0447\u0430\u0449\u0435 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u044b, \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u044b, \u0443\u043c\u043d\u044b\u0435 \u0447\u0430\u0441\u044b \u0438 \u0442.\u00a0\u0434. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u044d\u0442\u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u043d\u0430 \u0441\u043b\u043e\u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u043c\u0430\u0442\u0440\u0438\u0446, \u0430 \u0441 \u043d\u0438\u043c\u0438 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0433\u0447\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0445, \u0447\u0442\u043e \u043c\u044b \u0432 \u0432\u044b\u0438\u0433\u0440\u044b\u0448\u0435 \u0434\u0430\u0436\u0435 \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u043b\u043e\u0451\u0432.<\/p>\n<p>  \u0422\u0443\u0442 \u0432\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0432 \u0438\u0433\u0440\u0443 <code>popcount<\/code>. \u041e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0441\u043a\u0430\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u043c\u0430\u0442\u0440\u0438\u0446:<\/p>\n<pre>a\u2004=\u2004xnor(x,\u2006y) b\u2004=\u2004popcount(a) c\u2004=\u2004len(a) dot(x,\u2006y)\u2004=\u20042\u2005\u00d7\u2005b\u2005\u2212\u2005c<\/pre>\n<p>  \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0441\u043c. <a href=\"https:\/\/sushscience.wordpress.com\/2017\/10\/01\/understanding-binary-neural-networks\/\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0438 <a href=\"https:\/\/developer.apple.com\/documentation\/metalperformanceshaders\/mpscnnbinaryconvolution\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h4>\u0428\u0430\u0445\u043c\u0430\u0442\u043d\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h4>\n<p>  \u041c\u043d\u043e\u0433\u0438\u0435 \u0448\u0430\u0445\u043c\u0430\u0442\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0445\u0440\u0430\u043d\u044f\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 <a href=\"https:\/\/www.chessprogramming.org\/Bitboards\">bitboard<\/a>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u0434\u043e\u0431\u043d\u043e \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 64-\u0431\u0438\u0442\u043d\u043e\u0435 \u0441\u043b\u043e\u0432\u043e. \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f <code>Population Count<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u0434\u043b\u044f \u0437\u043d\u0430\u0447\u0438\u043c\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u044d\u0442\u0438\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 <a href=\"https:\/\/www.chessprogramming.org\/Mobility#Mobility_with_Bitboards\">\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u043e\u0441\u0442\u0438<\/a> \u0444\u0438\u0433\u0443\u0440\u044b.<\/p>\n<h4>\u041c\u043e\u043b\u0435\u043a\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u0444\u0438\u043d\u0433\u0435\u0440\u043f\u0440\u0438\u043d\u0442\u0438\u043d\u0433<\/h4>\n<p>  \u042d\u0442\u043e \u0442\u043e\u0436\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0425\u044d\u043c\u043c\u0438\u043d\u0433\u0430: \u043c\u043e\u043b\u0435\u043a\u0443\u043b\u044b \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0445\u044d\u0448\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f (\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>popcount<\/code>), \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0438\u0445 \u043f\u043e\u0445\u043e\u0436\u0435\u0441\u0442\u0438. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441\u043c. <a href=\"http:\/\/www.dalkescientific.com\/writings\/diary\/archive\/2008\/06\/26\/fingerprint_background.html\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h4>Hash array mapped tries (HAMT)<\/h4>\n<p>  \u0412\u043e\u0442 \u0433\u0434\u0435 \u044f \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0443\u0437\u043d\u0430\u043b \u043e <code>popcount<\/code>! HAMT\u00a0\u2014 \u044d\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 (<a href=\"https:\/\/lampwww.epfl.ch\/papers\/idealhashtrees.pdf\">\u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u0424\u0438\u043b\u043e\u043c \u0411\u044d\u0433\u0432\u0435\u043b\u043b\u043e\u043c<\/a>), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (\u043e\u0431\u044b\u0447\u043d\u043e 32 \u0438\u043b\u0438 64) \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0443\u0437\u043b\u0435 trie. \u041e\u0434\u043d\u0430\u043a\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u043b\u044f 32 \u0438\u043b\u0438 64-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u0440\u0430\u0441\u0442\u043e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435\u0433\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0431\u0438\u0442\u043e\u0432\u0443\u044e \u043c\u0430\u0441\u043a\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0431\u0438\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \u0440\u0430\u0441\u0442\u0438 \u0438 \u0441\u0436\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043c\u0435\u0440\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>popcount<\/code>. \u0412 <a href=\"https:\/\/vaibhavsagar.com\/blog\/2018\/07\/29\/hamts-from-scratch\/\">\u043c\u043e\u0451\u043c \u0431\u043b\u043e\u0433-\u043f\u043e\u0441\u0442\u0435<\/a> \u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 HAMT \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u043a\u0430\u043a \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442.<\/p>\n<h4>\u0421\u0436\u0430\u0442\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/h4>\n<p>  \u042d\u0442\u043e \u0437\u0430\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u043d\u043e\u0432\u0430\u044f \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0442\u043e\u043c, \u043a\u0430\u043a \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435, \u043d\u0435 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u044f \u0438\u0445 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b. \u041e\u0434\u0438\u043d \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0434\u0443\u043c\u0430\u0442\u044c \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0431\u0438\u0442\u043e\u0432 (\u0431\u0438\u0442-\u0432\u0435\u043a\u0442\u043e\u0440\u044b), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0434\u0432\u0443\u043c\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c\u0438:<\/p>\n<ul>\n<li><code>rank(i)<\/code> \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0438\u0442, \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043e i-\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0432 \u0431\u0438\u0442-\u0432\u0435\u043a\u0442\u043e\u0440\u0435  <\/li>\n<li><code>select(i)<\/code> \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0438\u043d\u0434\u0435\u043a\u0441, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d i-\u0439 \u0431\u0438\u0442<\/li>\n<\/ul>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0431\u0438\u0442-\u0432\u0435\u043a\u0442\u043e\u0440\u0430\u0445, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0432 \u043e\u0431\u043e\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0441 \u0443\u0447\u0430\u0441\u0442\u0438\u0435\u043c <code>popcount<\/code>. \u0412\u043e\u0442 <a href=\"https:\/\/alexbowe.com\/rrr\/\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0435\u0441\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043e\u0431\u0437\u043e\u0440 \u0438\u043d\u0434\u0435\u043a\u0441\u0430 RRR. \u0418, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f \u043c\u043e\u0433\u0443 \u0441\u0443\u0434\u0438\u0442\u044c, \u0441\u0430\u043c\u044b\u0439 \u043f\u0435\u0440\u0435\u0434\u043e\u0432\u043e\u0439 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 <i><a href=\"http:\/\/www.cs.cmu.edu\/~.\/dga\/papers\/zhou-sea2013.pdf\">Space-Efficient, High-Performance Rank &amp; Select Structures on Uncompressed Bit Sequences<\/a><\/i>.<\/p>\n<h4>\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432<\/h4>\n<p>  <code>popcount<\/code> \u0441\u0442\u0430\u043b\u0430 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u043e\u0439, \u0447\u0442\u043e \u0438 <a href=\"https:\/\/godbolt.org\/z\/JUzmD8\">GCC<\/a>, \u0438 <a href=\"https:\/\/godbolt.org\/z\/AVqMGl\">Clang<\/a> \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b \u0435\u0451 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u041a\u043b\u0438\u043f\u043f\u0438: \u00ab\u041e, \u044f \u0432\u0438\u0436\u0443, \u0447\u0442\u043e \u0432\u044b \u043f\u044b\u0442\u0430\u0435\u0442\u0435\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c <code>popcount<\/code>, \u043f\u043e\u0437\u0432\u043e\u043b\u044c\u0442\u0435 \u043c\u043d\u0435 \u0432\u044b\u0439\u0442\u0438 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e \u0434\u043b\u044f \u0432\u0430\u0441\u00bb! \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 LLVM \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f <a href=\"https:\/\/github.com\/llvm-mirror\/llvm\/blob\/f36485f7ac2a8d72ad0e0f2134c17fd365272285\/lib\/Transforms\/Scalar\/LoopIdiomRecognize.cpp#L960\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0414\u0430\u043d\u0438\u044d\u043b\u044c \u041b\u0435\u043c\u0438\u0440 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u0435\u0433\u043e \u043a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u043c\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432.<\/p>\n<h4>\u0412\u044b\u0432\u043e\u0434<\/h4>\n<p>  \u041e\u043a\u0443\u0442\u0430\u043d\u043d\u0430\u044f \u0442\u0430\u0439\u043d\u043e\u0439 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0432\u043e\u0435\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0438, \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f <code>popcount<\/code> \u0441\u0442\u0430\u043b\u0430 \u043f\u043e\u0432\u0441\u0435\u043c\u0435\u0441\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0445\u043e\u0442\u044f \u0438 \u043e\u0441\u0442\u0430\u043b\u0430\u0441\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439 CPU. \u041c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f, \u043a\u0430\u043a \u043e\u043d\u0430 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u0430\u043a\u0438\u0435 \u0440\u0430\u0437\u043d\u044b\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u043a\u0438, \u0438 \u043c\u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0435\u0449\u0451 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0442\u0430\u043a\u0438\u0445 \u0436\u0435 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u044f \u043b\u044e\u0431\u0438\u043c\u0430\u044f, \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0443\u0441\u043b\u044b\u0448\u0430\u0442\u044c \u043e \u043d\u0435\u0439!<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/467083\/\"> https:\/\/habr.com\/ru\/post\/467083\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\"><i>\u042d\u0442\u043e \u043f\u0441\u0435\u0432\u0434\u043e\u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 <a href=\"https:\/\/www.youtube.com\/watch?v=bLFqLfz2Fmc\">\u043c\u043e\u0435\u0439 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043d\u0430 !!Con 2019<\/a>.<\/i><\/p>\n<p>  \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u044b\u0445 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440 \u0435\u0441\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <code>popcount<\/code>, \u0441\u043e\u043a\u0440\u0430\u0449\u0451\u043d\u043d\u043e \u043e\u0442 &#8216;population count&#8217;. \u041e\u043d\u0430 \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432 \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u043c \u0441\u043b\u043e\u0432\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 (\u0432\u043e\u0437\u044c\u043c\u0451\u043c 8-\u0431\u0438\u0442\u043d\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b), <code>popcount(00100110)<\/code> \u0440\u0430\u0432\u043d\u043e 3, \u0430 <code>popcount(01100000)<\/code> \u0440\u0430\u0432\u043d\u043e 2.<\/p>\n<p>  \u0412\u0430\u0441 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u0434\u0438\u0432\u0438\u0442\u044c, \u043a\u0430\u043a \u0438 \u043c\u0435\u043d\u044f, \u043d\u043e \u044d\u0442\u043e \u0432\u0441\u0451, \u0447\u0442\u043e \u043e\u043d\u0430 \u0434\u0435\u043b\u0430\u0435\u0442! \u041a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c, \u043f\u0440\u0430\u0432\u0434\u0430?  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-294565","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/294565","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=294565"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/294565\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=294565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=294565"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=294565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}