{"id":134,"date":"2012-04-13T19:19:50","date_gmt":"2012-04-13T17:19:50","guid":{"rendered":"http:\/\/becpp.org\/blog\/?p=134"},"modified":"2012-04-13T19:19:50","modified_gmt":"2012-04-13T17:19:50","slug":"auto-vectorization-in-c-compilers","status":"publish","type":"post","link":"https:\/\/becpp.org\/blog\/2012\/04\/13\/auto-vectorization-in-c-compilers\/","title":{"rendered":"Auto-vectorization in C++ compilers"},"content":{"rendered":"<p>&#8220;Premature optimization is the root of all evils&#8221;&#8230; unless the compiler does it for you.<\/p>\n<p>Auto-vectorization is the next best thing to auto-parallelization: the compiler statically analyses the code and speeds up tight loops by spreading the iterated values across as many available registers as possible, resulting in speed-ups that could go as high as a factor of four. If the CPU has the required instruction set, of course.<\/p>\n<p>If you&#8217;re curious about how this can benefit your code (and without requiring anything at all on your part!), watch this nice video interview in MSDN Channel 9: <a href=\"http:\/\/media.ch9.ms\/ch9\/0bea\/9076f5ce-2575-4d6a-bfcd-a406c9850bea\/C9GoingNative7AutoVecVC11Compiler_high.mp4\">VC11 Auto-Vectorizer<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;Premature optimization is the root of all evils&#8221;&#8230; unless the compiler does it for you. Auto-vectorization is the next best thing to auto-parallelization: the compiler statically analyses the code and speeds up tight loops by spreading the iterated values across as many available registers as possible, resulting in speed-ups that could go as high as [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pgc_sgb_lightbox_settings":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-134","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/becpp.org\/blog\/wp-json\/wp\/v2\/posts\/134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/becpp.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/becpp.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/becpp.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/becpp.org\/blog\/wp-json\/wp\/v2\/comments?post=134"}],"version-history":[{"count":5,"href":"https:\/\/becpp.org\/blog\/wp-json\/wp\/v2\/posts\/134\/revisions"}],"predecessor-version":[{"id":220,"href":"https:\/\/becpp.org\/blog\/wp-json\/wp\/v2\/posts\/134\/revisions\/220"}],"wp:attachment":[{"href":"https:\/\/becpp.org\/blog\/wp-json\/wp\/v2\/media?parent=134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/becpp.org\/blog\/wp-json\/wp\/v2\/categories?post=134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/becpp.org\/blog\/wp-json\/wp\/v2\/tags?post=134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}