<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765306</guid>
        <pubDate>Sat, 31 Mar 2018 18:34:31 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765306</link>
        <description><![CDATA[Jin X: <strong class='tag-b'>Славян</strong>, напомню, что раньше память ОЗУ была в дифиците и измерялась килобайтами, а не гигабайтами, поэтому вполне логично было иметь 1-байтовые инструкции как альтернативу 3-байтовым - это раз.<br>
Ну и да, во времена 8086 процессора <strong class='tag-b'>add</strong> (reg,imm) выполнялась за 4 такта, а <strong class='tag-b'>inc</strong> - за 3. Но с тех пор воды утекло целое озеро Байкал...]]></description>
        <author>Jin X</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765303</guid>
        <pubDate>Sat, 31 Mar 2018 18:24:32 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765303</link>
        <description><![CDATA[Славян: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3765296'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Jin X &#064; <time class="tag-quote__quoted-time" datetime="2018-03-31T17:47:38+00:00">31.03.18, 17:47</time></span><div class='quote '>Ещё в качестве примера: inc eax по твоей логике должен быть быстрее, чем add eax,1, однако на Pentium 4 он работает медленнее, т.к. не меняет значения флага CF, что требует дополнительной микрооперации.</div></div>Ну во многих древних книжках по ASM&#39;у так и писалось, что INC - короткая и быстрая, а не то что ADD. Что там поменяли существенно с годами - неясно, но всё же думается, что первые инженеры процессоров не зря сделали такую команду отдельно, - нутром чуяли её специфику, а потому и ускорение.  :yes:  :yes:]]></description>
        <author>Славян</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765296</guid>
        <pubDate>Sat, 31 Mar 2018 17:47:38 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765296</link>
        <description><![CDATA[Jin X: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3765212'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>amk &#064; <time class="tag-quote__quoted-time" datetime="2018-03-30T21:26:52+00:00">30.03.18, 21:26</time></span><div class='quote '>На AMD, судя по таймингам, одинаково, только комбинация push+pop немного длиннее</div></div>Почему длиннее? <strong class='tag-b'>push 1</strong> = 2 байта, <strong class='tag-b'>pop eax</strong> = 1 байт, итого 3.<br>
<strong class='tag-b'>xor eax,eax</strong> = 2 байта, <strong class='tag-b'>inc eax</strong> = 1 байт (на 32-х битах, не 64), итого тоже 3.<br>
<br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3765212'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>amk &#064; <time class="tag-quote__quoted-time" datetime="2018-03-30T21:26:52+00:00">30.03.18, 21:26</time></span><div class='quote '>А непосредственная засылка единицы в регистр на обоих процессорах будет работать ещё быстрее.</div></div>Это понятно, но тут оптимизации по размеру.<br>
<br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3765229'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Славян &#064; <time class="tag-quote__quoted-time" datetime="2018-03-31T04:38:51+00:00">31.03.18, 04:38</time></span><div class='quote '>Это они практически такие же, но идеологически test не меняет регистр, а лишь &quot;проверяет&quot; (and &quot;в уме&quot;) биты, посему ДОЛЖЕН быть быстрее. </div></div>OMG, в каком &quot;уме&quot;? &quot;В уме&quot; может так же означать (в теории), что его нужно куда-то скопировать и там сделать <strong class='tag-b'>and</strong>. Это как вариант. Как там в микрокоде конкретно реализовано - не знаю. Но это всё демагогия. А надо смотреть на таблицы, которые говорят, что на Nehalem, к примеру, <strong class='tag-b'>mov, xor, test, or, and, add, sub, inc</strong> и <strong class='tag-b'>dec</strong> (для операция reg,reg или reg,imm) имеют одни и те же характеристики: используемые порты, кол-во микроопераций и latency. К тому же, <strong class='tag-b'>xor</strong> с <strong class='tag-b'>inc</strong> не могут параллелиться даже чисто теоретически, т.к. <strong class='tag-b'>inc</strong> зависим от результата предыдущей операции - <strong class='tag-b'>xor</strong>.<br>
Ещё в качестве примера: <strong class='tag-b'>inc eax</strong> по твоей логике должен быть быстрее, чем <strong class='tag-b'>add eax,1</strong>, однако на Pentium 4 он работает медленнее, т.к. не меняет значения флага CF, что требует дополнительной микрооперации.<br>
Ещё &quot;в теории&quot; <strong class='tag-b'>loop</strong> должен работать быстрее, чем <strong class='tag-b'>dec eax + jnz</strong>, но вот на практике всё иначе (ещё со времён царя Гороха)...<br>
<br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3765245'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Славян &#064; <time class="tag-quote__quoted-time" datetime="2018-03-31T07:55:25+00:00">31.03.18, 07:55</time></span><div class='quote '>Ну я вижу работу декодера как-то так</div></div>Видь. А Intel видим её по-своему :tong:]]></description>
        <author>Jin X</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765245</guid>
        <pubDate>Sat, 31 Mar 2018 07:55:25 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765245</link>
        <description><![CDATA[Славян: Ну я вижу работу декодера как-то так:<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">if( XOR )</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp;switch( операнды )</div><div class="code_line">&nbsp;&nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp;case reg32s:</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if( reg32a vs reg32a ) обнулить!( reg32a );</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;else ФабрикаXOR(...);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;...</div><div class="code_line">&nbsp;&nbsp; &nbsp;case память:</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ВытащитьДанные();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ФабрикаXOR(...);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;...</div><div class="code_line">&nbsp;&nbsp; &nbsp;case ...</div><div class="code_line">&nbsp;&nbsp;}</div><div class="code_line">}</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script>А команды <strong class='tag-b'>mov reg32, data8</strong> всё равно ж нет, так что приходится зачитывать аж 32 бита, что долго и много.]]></description>
        <author>Славян</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765242</guid>
        <pubDate>Sat, 31 Mar 2018 06:52:15 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765242</link>
        <description><![CDATA[amk: Непосредственные данные (в диапазоне от -128 до 127 это всего 1 байт) поступают на исполнение одновременно с командой, так что никаких дополнительных задержек они в принципе создать не могут. А вот для команды XOR приходится задействовать ALU - пересылать данные туда-сюда. Хорошо, что требуется на это всего один такт. Но потом-то приходится ещё и инкремент делать. А это отдельная команда, вдобавок завязанная на результат предыдущей, запараллелить её не получится.]]></description>
        <author>amk</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765241</guid>
        <pubDate>Sat, 31 Mar 2018 06:35:05 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765241</link>
        <description><![CDATA[Славян: Э, погодьте-ка&#33; Регистр всё же кусок памяти процессора, такие-то ячейки на подложке, элементы микросхемы. Поэтому ничего в кармане у них вечно нет, - всё откуда-то завозится. И непосредственное значение, даже бит его, всё равно придёт=принесётся&#33; А вот нанофабрика по созданию операции XOR вполне может быть тут же, в шаге; так что мне мыслится это быстрее. Хоть и соглашусь, что практическая реализация может статься и наоборот сделана. :yes-sad:]]></description>
        <author>Славян</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765239</guid>
        <pubDate>Sat, 31 Mar 2018 06:12:06 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765239</link>
        <description><![CDATA[amk: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3765229'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Славян &#064; <time class="tag-quote__quoted-time" datetime="2018-03-31T04:38:51+00:00">31.03.18, 04:38</time></span><div class='quote '>засылка значения - это как привоз некими 32-мя фурами издалека значения 0 или 1 (распараллелили)</div></div> Это не завоз издалека. Это когда ты приходишь куда-то, а нужное значение у тебя тут-же с собой, в кармане, и не надо никого за ним куда-то посылать, ни из подручных средств на месте готовить.]]></description>
        <author>amk</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765233</guid>
        <pubDate>Sat, 31 Mar 2018 05:26:59 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765233</link>
        <description><![CDATA[Славян: Я имел ввиду схемотехническую реализацию, аппаратную. И цитата та не от <strong class='tag-b'>amk</strong>. ;)]]></description>
        <author>Славян</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765232</guid>
        <pubDate>Sat, 31 Mar 2018 04:51:29 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765232</link>
        <description><![CDATA[JoeUser: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3765212'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>amk &#064; <time class="tag-quote__quoted-time" datetime="2018-03-30T21:26:52+00:00">30.03.18, 21:26</time></span><div class='quote '>посему ДОЛЖЕН быть быстрее.</div></div><br>
Лично я, чтобы так плотно, на асме не прогал лет 20 точно. Но одно - помню, нет такого понятия &quot;ДОЛЖЕН&quot;. Есть документация.]]></description>
        <author>JoeUser</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765229</guid>
        <pubDate>Sat, 31 Mar 2018 04:38:51 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765229</link>
        <description><![CDATA[Славян: Я вполне допускаю, что засылка значения быстрее и всё такое, но всё же идеологически вижу это медленнее/неправильнее по таким причинам: засылка значения - это как привоз некими 32-мя фурами издалека значения 0 или 1 (распараллелили), а XOR - это работат тут, на месте, недалёкая=простая в геометрико-транзисторном виде, тоже параллельная 32 раза, - должна быть существенно быстрее&#33; Будет ещё, конечно, INC, но и он ничего извне не просит, а может и тут, на месте, молотить. Так что... :yes-sad: <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-03-31T04:43:34+00:00">31.03.18, 04:43</time></span></span><br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3764873'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Jin X &#064; <time class="tag-quote__quoted-time" datetime="2018-03-27T19:59:41+00:00">27.03.18, 19:59</time></span><div class='quote '>При этом <strong class='tag-b'>test edi,edi</strong> можно с тем же успехом заменить на <strong class='tag-b'>and edi,edi</strong> или на <strong class='tag-b'>or edi,edi</strong>.<br>
Размер тот же, скорость та же.</div></div>Это они практически такие же, но идеологически <strong class='tag-b'>test</strong> не меняет регистр, а лишь &quot;проверяет&quot; (<strong class='tag-b'>and</strong> &quot;в уме&quot;) биты, посему ДОЛЖЕН быть быстрее. :yes-sad:]]></description>
        <author>Славян</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765212</guid>
        <pubDate>Fri, 30 Mar 2018 21:26:52 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765212</link>
        <description><![CDATA[amk: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3765076'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Jin X &#064; <time class="tag-quote__quoted-time" datetime="2018-03-29T15:35:49+00:00">29.03.18, 15:35</time></span><div class='quote '>Ну и мои тесты показывают, что push 1+pop eax работает медленнее, чем xor eax,eax+inc eax, хотя я понимаю, что при других сочетаниях результаты могут быть другими.<br>
Но в любом случае вряд ли push/pop будет когда-либо быстрее, чем xor/inc.</div></div> На AMD, судя по таймингам, одинаково, только комбинация push+pop немного длиннее. на intel push+pop выполняется дольше.<br>
А непосредственная засылка единицы в регистр на обоих процессорах будет работать ещё быстрее.]]></description>
        <author>amk</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765081</guid>
        <pubDate>Thu, 29 Mar 2018 17:17:57 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765081</link>
        <description><![CDATA[Qraizer: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3765076'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Jin X &#064; <time class="tag-quote__quoted-time" datetime="2018-03-29T15:35:49+00:00">29.03.18, 15:35</time></span><div class='quote '>Собственно, хочется понять: это продуманный умысел Intel (и тогда в чём он?) или недочёт (что было бы странно для производителя процессоров)? </div></div>Думаю, никаких теорий заговоров. У него просто мало информации. Если использовать эти функции в контексте, да ещё и инлайнить, код может отличаться от голых __fastcall функций разительно.]]></description>
        <author>Qraizer</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765076</guid>
        <pubDate>Thu, 29 Mar 2018 15:35:49 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765076</link>
        <description><![CDATA[Jin X: По поводу <strong class='tag-b'>cmov</strong>&#39;ов Агнер пишет так:<br>
<div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '>The advantage of a conditional move is that it avoids branch mispredictions. But it has the disadvantage that <strong class='tag-b'>it increases the length of a dependency chain</strong>, while a predicted branch breaks the dependency chain. If the code in example 9.9c is part of a dependency chain then the cmov instruction adds to the length of the chain. The <strong class='tag-b'>latency of cmov is two clock cycles on Intel processors</strong>, and one clock cycle on AMD processors.</div></div>9.9c - это<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;; Example 9.9c. Branch implemented with conditional move</div><div class="code_line">&nbsp;mov eax, [b]</div><div class="code_line">&nbsp;cmp eax, [c]</div><div class="code_line">&nbsp;mov eax, [d]</div><div class="code_line">&nbsp;cmovng eax, [e]</div></ol></div></div></div></div>p.s. Про цепочку зависимостей, в общем-то, оно и так понятно.<br>
<br>
И вот ещё:<br>
<div class='tag-quote'><span class='tag-quote-prefix'>Цитата</span> <div class='quote '>If a conditional jump is used for setting a Boolean variable to 0 or 1 then <strong class='tag-b'>it is often more efficient to use the conditional set</strong> instruction.</div></div>Здесь он, конечно, сравнивает <strong class='tag-b'>setcc</strong> с <strong class='tag-b'>jcc</strong>, но всё же не про <strong class='tag-b'>movcc</strong> не пишет, а именно про <strong class='tag-b'>setcc</strong>.<br>
<br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3765074'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Qraizer &#064; <time class="tag-quote__quoted-time" datetime="2018-03-29T14:14:04+00:00">29.03.18, 14:14</time></span><div class='quote '>в P6 появилась фича вытаскивать эти данные прям из очереди, т.е. даже без обращения к L1</div></div>Может быть, конечно.<br>
Но я могу лишь судить по таблице скоростей и задержек: <a class='tag-url' href='http://agner.org/optimize/instruction_tables.pdf' target='_blank'>http://agner.org/optimize/instruction_tables.pdf</a><br>
Ну и мои тесты показывают, что <strong class='tag-b'>push 1+pop eax</strong> работает медленнее, чем <strong class='tag-b'>xor eax,eax+inc eax</strong>, хотя я понимаю, что при других сочетаниях результаты могут быть другими.<br>
Но в любом случае вряд ли <strong class='tag-b'>push/pop</strong> будет когда-либо быстрее, чем <strong class='tag-b'>xor/inc</strong>. <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-03-29T15:40:27+00:00">29.03.18, 15:40</time></span></span><br>
Собственно, хочется понять: это продуманный умысел Intel (и тогда в чём он?) или недочёт (что было бы странно для производителя процессоров)? <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-03-29T15:41:57+00:00">29.03.18, 15:41</time></span></span><br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3765074'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Qraizer &#064; <time class="tag-quote__quoted-time" datetime="2018-03-29T14:14:04+00:00">29.03.18, 14:14</time></span><div class='quote '>Поспрашивай leo, он больше об этом всём знает.</div></div>Я его, пожалуй, приглашу в эту тему :)]]></description>
        <author>Jin X</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765074</guid>
        <pubDate>Thu, 29 Mar 2018 14:14:04 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765074</link>
        <description><![CDATA[Qraizer: Так это не отнимет тактов. Ещё в i486 была очередь отложенных записей, которые не тормозили ALU, в отличие от чтений, а, если не ошибаюсь, в P6 появилась фича вытаскивать эти данные прям из очереди, т.е. даже без обращения к L1. Поспрашивай <strong class='tag-b'>leo</strong>, он больше об этом всём знает.]]></description>
        <author>Qraizer</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765073</guid>
        <pubDate>Thu, 29 Mar 2018 14:05:43 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765073</link>
        <description><![CDATA[Jin X: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3765005'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Qraizer &#064; <time class="tag-quote__quoted-time" datetime="2018-03-29T02:46:34+00:00">29.03.18, 02:46</time></span><div class='quote '>Ничего страшного. Ляжет в L1 кэша</div></div>Ляжет, но обращение к кэшу тоже требует времени. Кэш (даже L1) - это же не регистры.]]></description>
        <author>Jin X</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765005</guid>
        <pubDate>Thu, 29 Mar 2018 02:46:34 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765005</link>
        <description><![CDATA[Qraizer: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3765001'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Jin X &#064; <time class="tag-quote__quoted-time" datetime="2018-03-28T21:52:05+00:00">28.03.18, 21:52</time></span><div class='quote '>Так, дело не в зависимости, а в использовании стека (то бишь памяти, а это время).</div></div>Ничего страшного. Ляжет в L1 кэша, ибо вершина стека да в кэш.промахе... когда такое бывало-то, оттуда же прочтётся, а в память запишется в фоне при отбросе кеш.строк, да и то не факт, что не перезапишется к тому времени мульён раз другими данными.]]></description>
        <author>Qraizer</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765001</guid>
        <pubDate>Wed, 28 Mar 2018 21:52:05 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3765001</link>
        <description><![CDATA[Jin X: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3764947'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Qraizer &#064; <time class="tag-quote__quoted-time" datetime="2018-03-28T12:55:32+00:00">28.03.18, 12:55</time></span><div class='quote '>Соседние push/pop не имеют штрафов по зависимостям.</div></div>Так, дело не в зависимости, а в использовании стека (то бишь памяти, а это время).<br>
<br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3764947'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Qraizer &#064; <time class="tag-quote__quoted-time" datetime="2018-03-28T12:55:32+00:00">28.03.18, 12:55</time></span><div class='quote '>Ну я же привёл прототипы. Там int. Если хочешь C++, где есть честный bool, то это будут другие прототипы.</div></div>Я заменил int на bool и откомпилил gcc, но результат всё равно почему-то пишется в eax.<br>
<br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3764947'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Qraizer &#064; <time class="tag-quote__quoted-time" datetime="2018-03-28T12:55:32+00:00">28.03.18, 12:55</time></span><div class='quote '>Вообще, даже самые древние мануалы советуют никогда не смешивать разноразмерные данные в зависимых инструкциях</div></div>Не спорю (кстати, это может быть причиной использования cmov), просто здесь всё равно используется sete, поэтому xor eax,eax ничего ускорить не должен, по идее...<br>
Возможно, просто компилер устроен так, что оперирует только полными регистрами. Вот, кстати, надо посмотреть как он будет char возвращать - как байт или дворд. Intel и gcc.]]></description>
        <author>Jin X</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3764947</guid>
        <pubDate>Wed, 28 Mar 2018 12:55:32 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3764947</link>
        <description><![CDATA[Qraizer: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3764945'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Jin X &#064; <time class="tag-quote__quoted-time" datetime="2018-03-28T12:47:12+00:00">28.03.18, 12:47</time></span><div class='quote '>с чем она может быть спараллелена, когда её работа зависит от результата предыдущей операции</div></div>С последующими действиями. Может использоваться либо eax, либо edx, но какой именно, станет известно лишь позднее. Временно можно использовать два потока исполнения, один из которых будет впоследствии отброшен, а второй, использующий &quot;правильный&quot; risc-регистр, переотображён на eax. То же можно сделать с setcc, также задействуя два risc-регистра, однако тут больше сложностей с подготовкой значения для второго. В отличие от cmovcc, где оба значения уже подготовлены и лежат в регистрах, для setcc значения 0 и 1, причём чётко байтовые, нужно подготавливать явно. Вероятно, по этой причине микрокод для них может отличаться. <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-03-28T13:00:48+00:00">28.03.18, 13:00</time></span></span><br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3764945'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Jin X &#064; <time class="tag-quote__quoted-time" datetime="2018-03-28T12:47:12+00:00">28.03.18, 12:47</time></span><div class='quote '>Жесть какая&#33;</div></div>Соседние push/pop не имеют штрафов по зависимостям. Они спецом для этого оптимизированы. Пара xor/inс зависит от ALU <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-03-28T13:03:54+00:00">28.03.18, 13:03</time></span></span><br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3764945'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Jin X &#064; <time class="tag-quote__quoted-time" datetime="2018-03-28T12:47:12+00:00">28.03.18, 12:47</time></span><div class='quote '>Зачем тут xor eax,eax, когда я объявляю тип функции bool? Он же байтовый&#33;</div></div>Ну я же привёл прототипы. Там int. Если хочешь C++, где есть честный bool, то это будут другие прототипы. <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-03-28T13:09:21+00:00">28.03.18, 13:09</time></span></span><br>
Проверил на intel, никакой разницы. Он всегда предпочитает работать с полноразмерными регистрами, ибо так куда эффективнее работает микрокод. (Вообще, даже самые древние мануалы советуют никогда не смешивать разноразмерные данные в зависимых инструкциях.) А вот visual немного удивил:<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">_TEXT &nbsp; SEGMENT</div><div class="code_line">?bar@@YI_NH@Z PROC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; bar, COMDAT</div><div class="code_line">; _x$ = ecx</div><div class="code_line">; File c:\users\shmatko\documents\intel\документация\qq.cpp</div><div class="code_line">; Line 8</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;test &nbsp; &nbsp;ecx, 2147483647 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; 7fffffffH</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;sete &nbsp; &nbsp;al</div><div class="code_line">; Line 9</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; 0</div><div class="code_line">?bar@@YI_NH@Z ENDP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; bar</div><div class="code_line">_TEXT &nbsp; ENDS</div><div class="code_line">; Function compile flags: /Ogtpy</div><div class="code_line">; &nbsp; &nbsp; &nbsp; COMDAT ?foo@@YI_NH@Z</div><div class="code_line">_TEXT &nbsp; SEGMENT</div><div class="code_line">?foo@@YI_NH@Z PROC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; foo, COMDAT</div><div class="code_line">; _x$ = ecx</div><div class="code_line">; File c:\users\shmatko\documents\intel\документация\qq.cpp</div><div class="code_line">; Line 3</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;test &nbsp; &nbsp;ecx, ecx</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;je &nbsp; &nbsp; &nbsp;SHORT $LN3@foo</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cmp &nbsp; &nbsp; ecx, -2147483648 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; 80000000H</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;je &nbsp; &nbsp; &nbsp;SHORT $LN3@foo</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;xor &nbsp; &nbsp; al, al</div><div class="code_line">; Line 4</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; 0</div><div class="code_line">$LN3@foo:</div><div class="code_line">; Line 3</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; al, 1</div><div class="code_line">; Line 4</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; 0</div><div class="code_line">?foo@@YI_NH@Z ENDP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; foo</div><div class="code_line">_TEXT &nbsp; ENDS</div></ol></div></div></div></div>Это по скорости. <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-03-28T13:11:43+00:00">28.03.18, 13:11</time></span></span><br>
Тока эта... сегодня VC2017. <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-03-28T13:12:57+00:00">28.03.18, 13:12</time></span></span><br>
P.S.<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3764947'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Qraizer &#064; <time class="tag-quote__quoted-time" datetime="2018-03-28T12:55:32+00:00">28.03.18, 12:55</time></span><div class='quote '>Временно можно использовать два потока исполнения...</div></div>Забыл добавить, что это лишь мои рассуждения, почему такое может иметь место. Как оно на самом деле, без понятия.]]></description>
        <author>Qraizer</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3764945</guid>
        <pubDate>Wed, 28 Mar 2018 12:47:12 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3764945</link>
        <description><![CDATA[Jin X: <strong class='tag-b'>Qraizer</strong>, с чем она может быть спараллелена, когда её работа зависит от результата предыдущей операции (всех 3-х предыдущих инструкций, я даже скажу)?<br>
<br>
<strong class='tag-b'>gcc</strong>, кстати, срабатывает как <strong class='tag-b'>xor+test+sete</strong> (<strong class='tag-b'>xor+and+sete</strong> для регистра) при оптимизации по скорости для обоих вариантов кода.<br>
А вот просто <strong class='tag-b'>&#33;x</strong> или <strong class='tag-b'>x==0</strong> он компилит аж в:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">mov edx,[esp+4]</div><div class="code_line">xor eax,eax</div><div class="code_line">test edx,edx</div><div class="code_line">sete al</div></ol></div></div></div></div> <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-03-28T12:49:43+00:00">28.03.18, 12:49</time></span></span><br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3764943'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Qraizer &#064; <time class="tag-quote__quoted-time" datetime="2018-03-28T12:35:00+00:00">28.03.18, 12:35</time></span><div class='quote '>        push      1<br>
        pop       eax   </div></div>Жесть какая&#33;<br>
Тогда бы уж сделали<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">xor eax,eax</div><div class="code_line">inc eax</div></ol></div></div></div></div>Размер тот же, но хоть быстрее должно быть... <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-03-28T12:52:14+00:00">28.03.18, 12:52</time></span></span><br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3764945'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Jin X &#064; <time class="tag-quote__quoted-time" datetime="2018-03-28T12:47:12+00:00">28.03.18, 12:47</time></span><div class='quote '>xor+test+sete</div></div>Зачем тут <strong class='tag-b'>xor eax,eax</strong>, когда я объявляю тип функции bool? Он же байтовый&#33;]]></description>
        <author>Jin X</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3764943</guid>
        <pubDate>Wed, 28 Mar 2018 12:35:00 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3764943</link>
        <description><![CDATA[Qraizer: Медленнее, на такт. Но она может быть спараллелена посредством задействования обоих значений результата, тогда как setcc не может. <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-03-28T12:46:29+00:00">28.03.18, 12:46</time></span></span><br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3764929'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Jin X &#064; <time class="tag-quote__quoted-time" datetime="2018-03-28T10:54:44+00:00">28.03.18, 10:54</time></span><div class='quote '>Интересен вариант с icl в случае, если x будет не в стеке, а в регистре...</div></div>Ок, fastcall. По скорости:<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">_TEXT &nbsp; SEGMENT &nbsp;PARA PUBLIC FLAT &nbsp;&#39;CODE&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; ALIGN &nbsp; &nbsp; 16</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;PUBLIC @foo@4</div><div class="code_line">; --- foo(int)</div><div class="code_line">@foo@4 &nbsp;PROC NEAR </div><div class="code_line">; parameter 1: ecx</div><div class="code_line">.B1.1: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B1.0</div><div class="code_line">L1::</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;2.1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;test &nbsp; &nbsp; &nbsp;ecx, ecx &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;je &nbsp; &nbsp; &nbsp; &nbsp;.B1.3 &nbsp; &nbsp; &nbsp; &nbsp; ; Prob 50% &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE ecx ebx ebp esi edi</div><div class="code_line">.B1.2: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B1.1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cmp &nbsp; &nbsp; &nbsp; ecx, -2147483648 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;3.20</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;jne &nbsp; &nbsp; &nbsp; .B1.4 &nbsp; &nbsp; &nbsp; &nbsp; ; Prob 50% &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;3.20</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE ebx ebp esi edi</div><div class="code_line">.B1.3: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B1.2 .B1.1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; &nbsp; eax, 1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE eax ebx ebp esi edi</div><div class="code_line">.B1.4: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B1.2</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;xor &nbsp; &nbsp; &nbsp; eax, eax &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE eax ebx ebp esi edi</div><div class="code_line">.B1.5: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B1.4</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ALIGN &nbsp; &nbsp; 16</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE</div><div class="code_line">; mark_end;</div><div class="code_line">@foo@4 ENDP</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; ALIGN &nbsp; &nbsp; 16</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;PUBLIC @bar@4</div><div class="code_line">; --- bar(int)</div><div class="code_line">@bar@4 &nbsp;PROC NEAR </div><div class="code_line">; parameter 1: ecx</div><div class="code_line">.B2.1: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B2.0</div><div class="code_line">L2::</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;7.1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;xor &nbsp; &nbsp; &nbsp; eax, eax &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;8.14</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; &nbsp; edx, 1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;8.14</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;test &nbsp; &nbsp; &nbsp;ecx, 2147483647 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;8.14</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cmove &nbsp; &nbsp; eax, edx &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;8.14</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;8.14</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ALIGN &nbsp; &nbsp; 16</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE</div><div class="code_line">; mark_end;</div><div class="code_line">@bar@4 ENDP</div><div class="code_line">;@bar@4 ENDS</div><div class="code_line">_TEXT &nbsp; ENDS</div></ol></div></div></div></div>По размеру:<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">_TEXT &nbsp; SEGMENT &nbsp;DWORD PUBLIC FLAT &nbsp;&#39;CODE&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;PUBLIC @foo@4</div><div class="code_line">; --- foo(int)</div><div class="code_line">@foo@4 &nbsp;PROC NEAR </div><div class="code_line">; parameter 1: ecx</div><div class="code_line">.B1.1: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B1.0</div><div class="code_line">L1::</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;2.1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;test &nbsp; &nbsp; &nbsp;ecx, ecx &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;je &nbsp; &nbsp; &nbsp; &nbsp;.B1.3 &nbsp; &nbsp; &nbsp; &nbsp; ; Prob 50% &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE ecx ebx ebp esi edi</div><div class="code_line">.B1.2: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B1.1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cmp &nbsp; &nbsp; &nbsp; ecx, -2147483648 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;3.20</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;jne &nbsp; &nbsp; &nbsp; .B1.4 &nbsp; &nbsp; &nbsp; &nbsp; ; Prob 50% &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;3.20</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE ebx ebp esi edi</div><div class="code_line">.B1.3: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B1.2 .B1.1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;push &nbsp; &nbsp; &nbsp;1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;pop &nbsp; &nbsp; &nbsp; eax &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE eax ebx ebp esi edi</div><div class="code_line">.B1.4: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B1.2</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;xor &nbsp; &nbsp; &nbsp; eax, eax &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE eax ebx ebp esi edi</div><div class="code_line">.B1.5: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B1.4</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE</div><div class="code_line">; mark_end;</div><div class="code_line">@foo@4 ENDP</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;PUBLIC @bar@4</div><div class="code_line">; --- bar(int)</div><div class="code_line">@bar@4 &nbsp;PROC NEAR </div><div class="code_line">; parameter 1: ecx</div><div class="code_line">.B2.1: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B2.0</div><div class="code_line">L2::</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;7.1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;test &nbsp; &nbsp; &nbsp;ecx, 2147483647 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;8.14</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;push &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;8.14</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;pop &nbsp; &nbsp; &nbsp; eax &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;8.14</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;sete &nbsp; &nbsp; &nbsp;al &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;8.14</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;8.14</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE</div><div class="code_line">; mark_end;</div><div class="code_line">@bar@4 ENDP</div><div class="code_line">;@bar@4 ENDS</div><div class="code_line">_TEXT &nbsp; ENDS</div></ol></div></div></div></div>]]></description>
        <author>Qraizer</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3764929</guid>
        <pubDate>Wed, 28 Mar 2018 10:54:44 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3764929</link>
        <description><![CDATA[Jin X: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3764880'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Qraizer &#064; <time class="tag-quote__quoted-time" datetime="2018-03-27T23:52:05+00:00">27.03.18, 23:52</time></span><div class='quote '>64 бита приводить?</div></div>Не надо, спасибо.<br>
<br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3764880'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Qraizer &#064; <time class="tag-quote__quoted-time" datetime="2018-03-27T23:52:05+00:00">27.03.18, 23:52</time></span><div class='quote '>        test      DWORD PTR [4+esp], 2147483647                 ;8.14<br>
        sete      al   </div></div>Вот это уже нормально :good:<br>
<br>
Но Intel что-то гонит. Оптимизация по размеру (приведённый чуть выше код) должна быть быстрее, ибо <strong class='tag-b'>cmovcc</strong> медленнее, чем <strong class='tag-b'>setcc</strong>.<br>
<br>
Интересен вариант с icl в случае, если x будет не в стеке, а в регистре...]]></description>
        <author>Jin X</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3764880</guid>
        <pubDate>Tue, 27 Mar 2018 23:52:05 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3764880</link>
        <description><![CDATA[Qraizer: <div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">int foo(int x)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp;return (!x || x==0x80000000);</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">int bar(int x)</div><div class="code_line">{</div><div class="code_line">&nbsp;&nbsp;return !(x&amp;0x7FFFFFFF);</div><div class="code_line">}</div></ol></div></div></div></div>По скорости. VC2015:<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">_TEXT &nbsp; SEGMENT</div><div class="code_line">_x$ = 8 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; size = 4</div><div class="code_line">_bar &nbsp; &nbsp;PROC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; COMDAT</div><div class="code_line">; File c:\disk_f\work0olymp\q.c</div><div class="code_line">; Line 8</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; eax, DWORD PTR _x$[esp-4]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;and &nbsp; &nbsp; eax, 2147483647 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; 7fffffffH</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;neg &nbsp; &nbsp; eax</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;sbb &nbsp; &nbsp; eax, eax</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;inc &nbsp; &nbsp; eax</div><div class="code_line">; Line 9</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; 0</div><div class="code_line">_bar &nbsp; &nbsp;ENDP</div><div class="code_line">_TEXT &nbsp; ENDS</div><div class="code_line">; Function compile flags: /Ogtpy</div><div class="code_line">; &nbsp; &nbsp; &nbsp; COMDAT _foo</div><div class="code_line">_TEXT &nbsp; SEGMENT</div><div class="code_line">_x$ = 8 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; size = 4</div><div class="code_line">_foo &nbsp; &nbsp;PROC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; COMDAT</div><div class="code_line">; File c:\disk_f\work0olymp\q.c</div><div class="code_line">; Line 3</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; eax, DWORD PTR _x$[esp-4]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;test &nbsp; &nbsp;eax, eax</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;je &nbsp; &nbsp; &nbsp;SHORT $LN3@foo</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cmp &nbsp; &nbsp; eax, -2147483648 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; 80000000H</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;je &nbsp; &nbsp; &nbsp;SHORT $LN3@foo</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;xor &nbsp; &nbsp; eax, eax</div><div class="code_line">; Line 4</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; 0</div><div class="code_line">$LN3@foo:</div><div class="code_line">; Line 3</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; eax, 1</div><div class="code_line">; Line 4</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; 0</div><div class="code_line">_foo &nbsp; &nbsp;ENDP</div><div class="code_line">_TEXT &nbsp; ENDS</div></ol></div></div></div></div>ICL2016:<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">_TEXT &nbsp; SEGMENT &nbsp;PARA PUBLIC FLAT &nbsp;&#39;CODE&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; ALIGN &nbsp; &nbsp; 16</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;PUBLIC _foo</div><div class="code_line">; --- foo(int)</div><div class="code_line">_foo &nbsp; &nbsp;PROC NEAR </div><div class="code_line">; parameter 1: 4 + esp</div><div class="code_line">.B1.1: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B1.0</div><div class="code_line">L1::</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;2.1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; &nbsp; eax, DWORD PTR [4+esp] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;1.5</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;test &nbsp; &nbsp; &nbsp;eax, eax &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;je &nbsp; &nbsp; &nbsp; &nbsp;.B1.3 &nbsp; &nbsp; &nbsp; &nbsp; ; Prob 50% &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE eax ebx ebp esi edi</div><div class="code_line">.B1.2: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B1.1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cmp &nbsp; &nbsp; &nbsp; eax, -2147483648 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;3.20</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;jne &nbsp; &nbsp; &nbsp; .B1.4 &nbsp; &nbsp; &nbsp; &nbsp; ; Prob 50% &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;3.20</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE ebx ebp esi edi</div><div class="code_line">.B1.3: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B1.2 .B1.1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; &nbsp; eax, 1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE eax ebx ebp esi edi</div><div class="code_line">.B1.4: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B1.2</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;xor &nbsp; &nbsp; &nbsp; eax, eax &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE eax ebx ebp esi edi</div><div class="code_line">.B1.5: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B1.4</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ALIGN &nbsp; &nbsp; 16</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE</div><div class="code_line">; mark_end;</div><div class="code_line">_foo ENDP</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; ALIGN &nbsp; &nbsp; 16</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;PUBLIC _bar</div><div class="code_line">; --- bar(int)</div><div class="code_line">_bar &nbsp; &nbsp;PROC NEAR </div><div class="code_line">; parameter 1: 4 + esp</div><div class="code_line">.B2.1: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B2.0</div><div class="code_line">L2::</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;7.1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;xor &nbsp; &nbsp; &nbsp; eax, eax &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;8.14</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; &nbsp; edx, 1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;8.14</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;test &nbsp; &nbsp; &nbsp;DWORD PTR [4+esp], 2147483647 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;8.14</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cmove &nbsp; &nbsp; eax, edx &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;8.14</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;8.14</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ALIGN &nbsp; &nbsp; 16</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE</div><div class="code_line">; mark_end;</div><div class="code_line">_bar ENDP</div><div class="code_line">;_bar &nbsp; ENDS</div><div class="code_line">_TEXT &nbsp; ENDS</div></ol></div></div></div></div>По размеру. VC2015:<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">PUBLIC &nbsp;_foo</div><div class="code_line">PUBLIC &nbsp;_bar</div><div class="code_line">; Function compile flags: /Ogspy</div><div class="code_line">; &nbsp; &nbsp; &nbsp; COMDAT _bar</div><div class="code_line">_TEXT &nbsp; SEGMENT</div><div class="code_line">_x$ = 8 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; size = 4</div><div class="code_line">_bar &nbsp; &nbsp;PROC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; COMDAT</div><div class="code_line">; File c:\disk_f\work0olymp\q.c</div><div class="code_line">; Line 8</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; eax, DWORD PTR _x$[esp-4]</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;and &nbsp; &nbsp; eax, 2147483647 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; 7fffffffH</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;neg &nbsp; &nbsp; eax</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;sbb &nbsp; &nbsp; eax, eax</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;inc &nbsp; &nbsp; eax</div><div class="code_line">; Line 9</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; 0</div><div class="code_line">_bar &nbsp; &nbsp;ENDP</div><div class="code_line">_TEXT &nbsp; ENDS</div><div class="code_line">; Function compile flags: /Ogspy</div><div class="code_line">; &nbsp; &nbsp; &nbsp; COMDAT _foo</div><div class="code_line">_TEXT &nbsp; SEGMENT</div><div class="code_line">_x$ = 8 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; size = 4</div><div class="code_line">_foo &nbsp; &nbsp;PROC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; COMDAT</div><div class="code_line">; File c:\disk_f\work0olymp\q.c</div><div class="code_line">; Line 3</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cmp &nbsp; &nbsp; DWORD PTR _x$[esp-4], 0</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;je &nbsp; &nbsp; &nbsp;SHORT $LN3@foo</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cmp &nbsp; &nbsp; DWORD PTR _x$[esp-4], -2147483648 &nbsp; &nbsp; &nbsp; ; 80000000H</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;je &nbsp; &nbsp; &nbsp;SHORT $LN3@foo</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;xor &nbsp; &nbsp; eax, eax</div><div class="code_line">; Line 4</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; 0</div><div class="code_line">$LN3@foo:</div><div class="code_line">; Line 3</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;xor &nbsp; &nbsp; eax, eax</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;inc &nbsp; &nbsp; eax</div><div class="code_line">; Line 4</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; 0</div><div class="code_line">_foo &nbsp; &nbsp;ENDP</div><div class="code_line">_TEXT &nbsp; ENDS</div></ol></div></div></div></div>ICL2016:<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">_TEXT &nbsp; SEGMENT &nbsp;DWORD PUBLIC FLAT &nbsp;&#39;CODE&#39;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;PUBLIC _foo</div><div class="code_line">; --- foo(int)</div><div class="code_line">_foo &nbsp; &nbsp;PROC NEAR </div><div class="code_line">; parameter 1: 4 + esp</div><div class="code_line">.B1.1: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B1.0</div><div class="code_line">L1::</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;2.1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;mov &nbsp; &nbsp; &nbsp; eax, DWORD PTR [4+esp] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;1.5</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;test &nbsp; &nbsp; &nbsp;eax, eax &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;je &nbsp; &nbsp; &nbsp; &nbsp;.B1.3 &nbsp; &nbsp; &nbsp; &nbsp; ; Prob 50% &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE eax ebx ebp esi edi</div><div class="code_line">.B1.2: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B1.1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;cmp &nbsp; &nbsp; &nbsp; eax, -2147483648 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;3.20</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;jne &nbsp; &nbsp; &nbsp; .B1.4 &nbsp; &nbsp; &nbsp; &nbsp; ; Prob 50% &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;3.20</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE ebx ebp esi edi</div><div class="code_line">.B1.3: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B1.2 .B1.1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;push &nbsp; &nbsp; &nbsp;1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;pop &nbsp; &nbsp; &nbsp; eax &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE eax ebx ebp esi edi</div><div class="code_line">.B1.4: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B1.2</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;xor &nbsp; &nbsp; &nbsp; eax, eax &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE eax ebx ebp esi edi</div><div class="code_line">.B1.5: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B1.4</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;3.12</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE</div><div class="code_line">; mark_end;</div><div class="code_line">_foo ENDP</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;PUBLIC _bar</div><div class="code_line">; --- bar(int)</div><div class="code_line">_bar &nbsp; &nbsp;PROC NEAR </div><div class="code_line">; parameter 1: 4 + esp</div><div class="code_line">.B2.1: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; Preds .B2.0</div><div class="code_line">L2::</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;7.1</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;xor &nbsp; &nbsp; &nbsp; eax, eax &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;8.14</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;test &nbsp; &nbsp; &nbsp;DWORD PTR [4+esp], 2147483647 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;8.14</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;sete &nbsp; &nbsp; &nbsp;al &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;;8.14</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ;8.14</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; LOE</div><div class="code_line">; mark_end;</div><div class="code_line">_bar ENDP</div><div class="code_line">;_bar &nbsp; ENDS</div><div class="code_line">_TEXT &nbsp; ENDS</div></ol></div></div></div></div>64 бита приводить?]]></description>
        <author>Qraizer</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3764873</guid>
        <pubDate>Tue, 27 Mar 2018 19:59:41 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3764873</link>
        <description><![CDATA[Jin X: <strong class='tag-b'>applegame</strong>, а стоило ли рассчитывать, что эти варианты будут различаться? :)<br>
<br>
Вот так надо:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">for(;x;) return false; return true;</div></ol></div></div></div></div> :D <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-03-27T20:07:02+00:00">27.03.18, 20:07</time></span></span><br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3764770'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Славян &#064; <time class="tag-quote__quoted-time" datetime="2018-03-26T15:09:17+00:00">26.03.18, 15:09</time></span><div class='quote '>Но это лишь говорит о том, что оптимизатор понял, что test (делает AND по сути  ) быстрее довольно туповатого и прямого CMP&#33; </div></div>Это лишь говорит о том, что <strong class='tag-b'>test</strong> короче, чем <strong class='tag-b'>cmp</strong>. Скорость работы та же :)<br>
Потому что будет <strong class='tag-b'>cmp edi,0</strong> (3 байта), а не <strong class='tag-b'>cmp edi,edi</strong> (2 байта, как и <strong class='tag-b'>test edi,edi</strong>). <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-03-27T20:13:34+00:00">27.03.18, 20:13</time></span></span><br>
При этом <strong class='tag-b'>test edi,edi</strong> можно с тем же успехом заменить на <strong class='tag-b'>and edi,edi</strong> или на <strong class='tag-b'>or edi,edi</strong>.<br>
Размер тот же, скорость та же. <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-03-27T20:23:09+00:00">27.03.18, 20:23</time></span></span><br>
У меня сейчас комп не пашет (загрузился с флешки). Кто может скомпилить и прислать дизасм такого кода (для 32-х бит)?<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">return (!x || x==0x80000000);</div></ol></div></div></div></div>Любопытно, как это оптимизируется.<br>
Я поаплодирую, если там будет написано так:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">add edi,edi</div><div class="code_line">sete al</div></ol></div></div></div></div>(ну там вместо <strong class='tag-b'>edi</strong> может быть что-то другое, разумеется) <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-03-27T20:25:34+00:00">27.03.18, 20:25</time></span></span><br>
Можно ещё так попробовать:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">return !(x&amp;0x7FFFFFFF);</div></ol></div></div></div></div>]]></description>
        <author>Jin X</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3764770</guid>
        <pubDate>Mon, 26 Mar 2018 15:09:17 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3764770</link>
        <description><![CDATA[Славян: Да, я тоже только что проверил на типичном примере, и вижу, что оба случая (при настройках оптимизации в максимум) реализуются через <strong class='tag-b'>test</strong>. Но это лишь говорит о том, что оптимизатор понял, что <strong class='tag-b'>test</strong> (делает AND по сути ;) ) быстрее довольно туповатого и прямого CMP&#33; Так что всё норм&#33; :yes: :yes: :yes: <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-03-26T15:14:33+00:00">26.03.18, 15:14</time></span></span><br>
Более того, посмотрел на <strong class='tag-b'>Release</strong> и <strong class='tag-b'>Debug</strong> варианты и что видим:<br>
Release: test reg32, reg32<br>
Debug: cmp dword ptr [], 0<br>
<strong class='tag-b'>Итог:</strong> &#33; быстрее ==0 при их прямом переводе на маш. код&#33; ч.т.д. :tong:]]></description>
        <author>Славян</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3764766</guid>
        <pubDate>Mon, 26 Mar 2018 14:21:43 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3764766</link>
        <description><![CDATA[applegame: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762150'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Славян &#064; <time class="tag-quote__quoted-time" datetime="2018-02-23T16:09:56+00:00">23.02.18, 16:09</time></span><div class='quote '>Только &quot;&#33;&quot; использую. Ибо вещали (сильно давно), что операция CMP (асм-реализация &quot;==0&quot;) крайне тормознутая, а &quot;test&quot; (в случае &#33; используется, бывает) существенно быстрее&#33; </div></div><br>
ЛОЛШТО?<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">bool foo1(int a) {</div><div class="code_line">&nbsp;&nbsp; &nbsp;return a == 0;</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">bool foo2(int a) {</div><div class="code_line">&nbsp;&nbsp; &nbsp;return !a;</div><div class="code_line">}</div></ol></div></div></div></div><br>
компилируется в <br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">foo1(int):</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;test &nbsp; &nbsp;edi, edi</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;sete &nbsp; &nbsp;al</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret</div><div class="code_line">foo2(int):</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;test &nbsp; &nbsp;edi, edi</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;sete &nbsp; &nbsp;al</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ret</div></ol></div></div></div></div><br>
Пруф - <a class='tag-url' href='https://godbolt.org/g/oKkN1v' target='_blank'>https://godbolt.org/g/oKkN1v</a>]]></description>
        <author>applegame</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3764237</guid>
        <pubDate>Mon, 19 Mar 2018 19:01:10 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3764237</link>
        <description><![CDATA[Славян: Так и не должно быть ровненько&#33; Строки вида &quot;if( a...)&quot; несут суть <strong class='tag-b'>опосля</strong> переменной (вида &quot;if( a&#33;=...)&quot;), а строки же с отрицанием сразу утверждают нечто &quot;if( &#33;c )&quot;. Разная идеология&#33; В первых вариантах &quot;a&quot; сравнится с чем-то/с какой-то субстанцией, а в отрицании ужо сказано, что всё тут двоичное грядёт. Так что - норм&#33;&#33; :yes: :yes:]]></description>
        <author>Славян</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3764227</guid>
        <pubDate>Mon, 19 Mar 2018 18:49:27 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3764227</link>
        <description><![CDATA[Qraizer: А я вот так пишу:<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">if ( a ...)</div><div class="code_line">if ( b ...)</div><div class="code_line">if (!c ...)</div></ol></div></div></div></div>А ещё<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">a = ... </div><div class="code_line">b =(...)</div><div class="code_line">c+= ...</div></ol></div></div></div></div>итп.]]></description>
        <author>Qraizer</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3764214</guid>
        <pubDate>Mon, 19 Mar 2018 18:03:50 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3764214</link>
        <description><![CDATA[wind: терпеть не могу &#33; в начале<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">if (a ...)</div><div class="code_line">if (b ...)</div><div class="code_line">if (!c ...)</div></ol></div></div></div></div><br>
неровненько... &lt;_&lt;]]></description>
        <author>wind</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3763011</guid>
        <pubDate>Tue, 06 Mar 2018 04:20:27 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3763011</link>
        <description><![CDATA[Polinom2686: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3763005'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>JoeUser &#064; <time class="tag-quote__quoted-time" datetime="2018-03-05T23:09:21+00:00">05.03.18, 23:09</time></span><div class='quote '>И экономия и красота, но... мечты?..</div></div><br>
Переходи на питон  :)]]></description>
        <author>Polinom2686</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3763008</guid>
        <pubDate>Tue, 06 Mar 2018 01:10:12 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3763008</link>
        <description><![CDATA[Славян: Единственным выходом из непреодолимой ситуации вижу только такой: если весь блок вычислений находится правее <em class='tag-i'>if</em>&#39;а (<em class='tag-i'>for</em>&#39;а, <em class='tag-i'>while</em>&#39;а, ...), то компилер бы его сам заключал в фигурные скобки&#33; И экономия и красота, но... мечты?..]]></description>
        <author>Славян</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3763005</guid>
        <pubDate>Mon, 05 Mar 2018 23:09:21 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3763005</link>
        <description><![CDATA[JoeUser: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762981'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Славян &#064; <time class="tag-quote__quoted-time" datetime="2018-03-05T19:22:49+00:00">05.03.18, 19:22</time></span><div class='quote '>Сокрытие строки</div></div><br>
не сокрытие - а экономия&#33; <span class="tag-color tag-color-named" data-value="gray" style="color: gray"><s class='tag-s'>не халявщик - а партнер&#33;</s></span>  :lol:]]></description>
        <author>JoeUser</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3763001</guid>
        <pubDate>Mon, 05 Mar 2018 21:14:14 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3763001</link>
        <description><![CDATA[Da&#036;aD: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762907'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Polinom2686 &#064; <time class="tag-quote__quoted-time" datetime="2018-03-05T05:08:36+00:00">05.03.18, 05:08</time></span><div class='quote '>Я выбираю первый вариант  </div></div><br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">func :: ArgType -&#62; ReturnType</div><div class="code_line">func arg = statement</div></ol></div></div></div></div><br>
<br>
Problems?  :crazy:]]></description>
        <author>Da&#036;aD</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762981</guid>
        <pubDate>Mon, 05 Mar 2018 19:22:49 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762981</link>
        <description><![CDATA[Славян: Сокрытие строки не есть светлая сторона, а токмо тёмная&#33; :angry:]]></description>
        <author>Славян</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762980</guid>
        <pubDate>Mon, 05 Mar 2018 19:07:17 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762980</link>
        <description><![CDATA[JoeUser: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762975'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Славян &#064; <time class="tag-quote__quoted-time" datetime="2018-03-05T17:56:03+00:00">05.03.18, 17:56</time></span><div class='quote '>Да, а я как бы согласен с вами, Qraizer, но всё равно мне чертовски жаль, что на фигурки уходит две строчки. Ничего тут не могу поделать&#33; Горе, непреодолимое, и всё тут.</div></div><br>
Не слушай <strong class='tag-b'>Qraizer</strong>&#39;а - переходи на светлую сторону Силы&#33; :lol: Одну строчку можно сэкономить - используй Java Style.]]></description>
        <author>JoeUser</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762975</guid>
        <pubDate>Mon, 05 Mar 2018 17:56:03 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762975</link>
        <description><![CDATA[Славян: Да, а я как бы согласен с вами, <strong class='tag-b'>Qraizer</strong>, но всё равно мне чертовски жаль, что на фигурки уходит две строчки. Ничего тут не могу поделать&#33; Горе, непреодолимое, и всё тут. :&#39;( :&#39;( :&#39;(]]></description>
        <author>Славян</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762974</guid>
        <pubDate>Mon, 05 Mar 2018 17:24:52 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762974</link>
        <description><![CDATA[Qraizer: Вот и правильно, <strong class='tag-b'>Славян</strong>. А то для }, вишьли, отдельная строка, потому что заканчивает блок, а { почему-то скромненько спаривается с заголовком, что к последующему блоку не имеет никакого отношения, кроме обоснования его наличия.]]></description>
        <author>Qraizer</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762969</guid>
        <pubDate>Mon, 05 Mar 2018 16:10:51 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762969</link>
        <description><![CDATA[Славян: Здесь пока - фифти-фифти; в той отдельной думаю, что Полином2pentPro будет с перевесом (по количеству виденых мною исходников...). :yes-sad:]]></description>
        <author>Славян</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762967</guid>
        <pubDate>Mon, 05 Mar 2018 15:31:38 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762967</link>
        <description><![CDATA[B.V.: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762907'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Polinom2686 &#064; <time class="tag-quote__quoted-time" datetime="2018-03-05T05:08:36+00:00">05.03.18, 05:08</time></span><div class='quote '>Я выбираю первый</div></div><br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762965'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Славян &#064; <time class="tag-quote__quoted-time" datetime="2018-03-05T14:57:02+00:00">05.03.18, 14:57</time></span><div class='quote '>А я - только второй</div></div><br>
Воу-воу, погодите до отдельной голосовалки :D]]></description>
        <author>B.V.</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762965</guid>
        <pubDate>Mon, 05 Mar 2018 14:57:02 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762965</link>
        <description><![CDATA[Славян: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762907'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Polinom2686 &#064; <time class="tag-quote__quoted-time" datetime="2018-03-05T05:08:36+00:00">05.03.18, 05:08</time></span><div class='quote '>Я выбираю первый вариант</div></div>А я - только второй; по-моему даже в 100% случаев. :yes:]]></description>
        <author>Славян</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762928</guid>
        <pubDate>Mon, 05 Mar 2018 08:46:38 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762928</link>
        <description><![CDATA[JoeUser: Для сравнения числовых значений - использую &quot;==&quot;, для булевских просто проверка или проверка с отрицанием. <br>
Для форматирования C/C++ кода все ж использую <a class='tag-url' href='https://google.github.io/styleguide/javaguide.html#s4.1-braces' target='_blank'>JavaStyle</a>. Для меня он кажется более компактным и лучше читаемым.]]></description>
        <author>JoeUser</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762907</guid>
        <pubDate>Mon, 05 Mar 2018 05:08:36 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762907</link>
        <description><![CDATA[Polinom2686: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762255'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>B.V. &#064; <time class="tag-quote__quoted-time" datetime="2018-02-25T19:10:17+00:00">25.02.18, 19:10</time></span><div class='quote '>Слабо. Даже <br>
<br>
() {<br>
}<br>
<br>
vs <br>
<br>
()<br>
{<br>
}<br>
<br>
как-то, ИМХО, интереснее  </div></div><br>
Я выбираю первый вариант  :)]]></description>
        <author>Polinom2686</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762867</guid>
        <pubDate>Sun, 04 Mar 2018 11:20:47 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762867</link>
        <description><![CDATA[amk: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762817'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>korvin &#064; <time class="tag-quote__quoted-time" datetime="2018-03-02T20:39:58+00:00">02.03.18, 20:39</time></span><div class='quote '>А почему не между двумя семантиками проверки булевого значения?</div></div> Булевы значения вообще не принято сравнивать. Ещё в C, где вместо них использовались целые, сравнение признака с нулём считалось плохим стилем, если не ошибкой. А сравнение с TRUE (макрос, равный единице) было именно ошибкой.]]></description>
        <author>amk</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762843</guid>
        <pubDate>Sat, 03 Mar 2018 17:27:01 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762843</link>
        <description><![CDATA[B.V.: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762817'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>korvin &#064; <time class="tag-quote__quoted-time" datetime="2018-03-02T20:39:58+00:00">02.03.18, 20:39</time></span><div class='quote '>А почему не между двумя семантиками проверки булевого значения?</div></div><br>
Потому что думаю, что выбор был бы слишком предсказуем: подавляющее большинство выбрало бы вариант &#33;. А вот с численными значениями интереснее]]></description>
        <author>B.V.</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762817</guid>
        <pubDate>Fri, 02 Mar 2018 20:39:58 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762817</link>
        <description><![CDATA[korvin: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762139'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>B.V. &#064; <time class="tag-quote__quoted-time" datetime="2018-02-23T15:17:06+00:00">23.02.18, 15:17</time></span><div class='quote '>Это не выбор между нулём и НЕ, это выбор между двумя семантиками проверки нулевого значения</div></div><br>
А почему не между двумя семантиками проверки булевого значения?]]></description>
        <author>korvin</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762384</guid>
        <pubDate>Tue, 27 Feb 2018 06:18:43 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762384</link>
        <description><![CDATA[leo: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762150'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Славян &#064; <time class="tag-quote__quoted-time" datetime="2018-02-23T16:09:56+00:00">23.02.18, 16:09</time></span><div class='quote '>Ибо вещали (сильно давно), что операция CMP (асм-реализация &quot;==0&quot;) крайне тормознутая, а &quot;test&quot; (в случае &#33; используется, бывает) существенно быстрее&#33;</div></div><br>
Все эти &quot;крайне&quot; и &quot;существенно&quot; сильно преувеличены. Регистровые операции cmp r,i и test r,r исполняются одинаково быстро. Разница между ними в размере команды, что косвенно&#092;теоретически может сказаться на задержке их декодирования, да и то только при при определенных &quot;неблагоприятных обстоятельствах&quot;. Причем в х86 есть укороченный вариант команды сравнения cmp r/m,i8 с однобайтовой константой, автоматически расширяемой знаком до размера операнда. Соотв-но нормальный (не тупой) компилятор для сравнения с нулем должен использовать именно этот вариант (а не общий, когда размер константы совпадает с размером операнда). Зато cmp на современных x86 имеет преимущество перед test r,r при сравнении операнда в памяти (когда окружающий код не требует его загрузки в регистр), т.к. одна команда cmp m,i8 и декодируется, и все in-order стадии конвеера проходит быстрее, чем пара команд mov r,m + test r,r (хотя на практике разницы может и не быть, т.к. все зависит от окружающего кода, &quot;ветра&quot;, &quot;фаз луны&quot; и т.д.).]]></description>
        <author>leo</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762308</guid>
        <pubDate>Mon, 26 Feb 2018 11:42:49 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762308</link>
        <description><![CDATA[Bas: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762264'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Qraizer &#064; <time class="tag-quote__quoted-time" datetime="2018-02-25T22:52:12+00:00">25.02.18, 22:52</time></span><div class='quote '>Если переменная хранит признак, то &#33; в самый раз, а если число, то == 0. </div></div><br>
Если переменная объявлена но не определена? <br>
Или в условии задачи она точно определена? <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-02-26T11:45:05+00:00">26.02.18, 11:45</time></span></span><br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762139'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>B.V. &#064; <time class="tag-quote__quoted-time" datetime="2018-02-23T15:17:06+00:00">23.02.18, 15:17</time></span><div class='quote '>это выбор между двумя семантиками проверки нулевого значения</div></div><br>
Все таки проверка числа.]]></description>
        <author>Bas</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762264</guid>
        <pubDate>Sun, 25 Feb 2018 22:52:12 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762264</link>
        <description><![CDATA[Qraizer: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762255'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>B.V. &#064; <time class="tag-quote__quoted-time" datetime="2018-02-25T19:10:17+00:00">25.02.18, 19:10</time></span><div class='quote '>мнения в голосовалке разделились почти поровну</div></div>Всё просто: каждой ситуации своё предпочтение. Если переменная хранит признак, то &#33; в самый раз, а если число, то == 0. Просто это не каждый сформулировать догадывается.]]></description>
        <author>Qraizer</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762255</guid>
        <pubDate>Sun, 25 Feb 2018 19:10:17 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762255</link>
        <description><![CDATA[B.V.: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762186'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>OpenGL &#064; <time class="tag-quote__quoted-time" datetime="2018-02-24T08:58:29+00:00">24.02.18, 08:58</time></span><div class='quote '>Даёшь табы vs пробелы  </div></div><br>
Слабо. Даже <br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">() {</div><div class="code_line">}</div></ol></div></div></div></div> <br>
vs <br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">() </div><div class="code_line">{</div><div class="code_line">}</div></ol></div></div></div></div><br>
как-то, ИМХО, интереснее :) <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-02-25T19:11:05+00:00">25.02.18, 19:11</time></span></span><br>
Между тем, мнения в голосовалке разделились почти поровну. Не ожидал..]]></description>
        <author>B.V.</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762200</guid>
        <pubDate>Sat, 24 Feb 2018 11:38:44 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762200</link>
        <description><![CDATA[OpenGL: Так нечестно. Я это должен был выложить это в качестве аргумента того, что сторонники пробелов не умеют пользоваться табами :( <br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762197'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Da&#036;aD &#064; <time class="tag-quote__quoted-time" datetime="2018-02-24T10:16:36+00:00">24.02.18, 10:16</time></span><div class='quote '>Проблема только в том, что инструментарий (IDE, редакторы) не умеют в грамотный индент табами с выравниванием пробелами, поэтому приходится деградировать до all-spaces.</div></div><br>
Я для этого пользуюсь astyl-ом, автоматически запускаемым при сохранении файла. Он в абсолютном большинстве случаев отличает, когда надо использовать alignment, а когда - indentation - в целом меня вполне устраивает. Пример из статьи отформатировал он правильно.]]></description>
        <author>OpenGL</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762197</guid>
        <pubDate>Sat, 24 Feb 2018 10:16:36 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762197</link>
        <description><![CDATA[Da&#036;aD: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762186'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>OpenGL &#064; <time class="tag-quote__quoted-time" datetime="2018-02-24T08:58:29+00:00">24.02.18, 08:58</time></span><div class='quote '>Даёшь табы vs пробелы   </div></div><br>
Так уже давно холивар закрыт.<br>
<br>
<a class='tag-url' href='http://intellindent.info/seriously/' target='_blank'>http://intellindent.info/seriously/</a><br>
<br>
Проблема только в том, что инструментарий (IDE, редакторы) не умеют в грамотный индент табами с выравниванием пробелами, поэтому приходится деградировать до all-spaces.]]></description>
        <author>Da&#036;aD</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762186</guid>
        <pubDate>Sat, 24 Feb 2018 08:58:29 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762186</link>
        <description><![CDATA[OpenGL: (x == 0).toString().length() == 4  :crazy: <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-02-24T08:59:08+00:00">24.02.18, 08:59</time></span></span><br>
А вообще фигня холивар. Даёшь табы vs пробелы  :yes: <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-02-24T09:11:16+00:00">24.02.18, 09:11</time></span></span><br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762175'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Славян &#064; <time class="tag-quote__quoted-time" datetime="2018-02-23T21:43:38+00:00">23.02.18, 21:43</time></span><div class='quote '>Увы, но у меня и сейчас MSVS 2017 так жедает (CMP) без настроек ускорения/оптимизации. </div></div><br>
У тебя странная студия. У меня она даже в дебаге test-ом сравнивает. В релизе с оптимизациями тем более.]]></description>
        <author>OpenGL</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762178</guid>
        <pubDate>Fri, 23 Feb 2018 23:39:12 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762178</link>
        <description><![CDATA[amk: Ну, видимо так M&#036; понимает понятие оптимизации. Раз нет оптимизации, значит нельзя даже мелочи оптимизировать.]]></description>
        <author>amk</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762175</guid>
        <pubDate>Fri, 23 Feb 2018 21:43:38 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762175</link>
        <description><![CDATA[Славян: Увы, но у меня и сейчас MSVS 2017 так жедает (CMP) без настроек ускорения/оптимизации. :yes-sad:]]></description>
        <author>Славян</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762174</guid>
        <pubDate>Fri, 23 Feb 2018 21:28:17 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762174</link>
        <description><![CDATA[amk: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762150'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Славян &#064; <time class="tag-quote__quoted-time" datetime="2018-02-23T16:09:56+00:00">23.02.18, 16:09</time></span><div class='quote '>Ибо вещали (сильно давно), что операция CMP (асм-реализация &quot;==0&quot;) крайне тормознутая, а &quot;test&quot; (в случае &#33; используется, бывает) существенно быстрее&#33;</div></div> Для сравнения с нулём CMP никогда не использовался. Даже в простейших компиляторах Small-C и Rat-C сравнение с нулём обрабатывалось отдельно от общего случая.<br>
Так что тебе лапшу на уши вешали.]]></description>
        <author>amk</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762154</guid>
        <pubDate>Fri, 23 Feb 2018 16:34:20 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762154</link>
        <description><![CDATA[negram: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762139'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>B.V. &#064; <time class="tag-quote__quoted-time" datetime="2018-02-23T15:17:06+00:00">23.02.18, 15:17</time></span><div class='quote '><div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762131'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>negram &#064; <time class="tag-quote__quoted-time" datetime="2018-02-23T14:14:33+00:00">23.02.18, 14:14</time></span><div class='quote '>Потребуются, ибо выбора между сравнением с нулём и логическим &quot;не&quot; никогда не было. В плюсах, в смысле.</div></div><br>
Это не выбор между нулём и НЕ, это выбор между двумя семантиками проверки нулевого значения</div></div><br>
Не было никогда такого выбора в плюсах. Выбор мог быть только у тех, кто воспринимает плюсы как &quot;си с классами&quot;. благо, такие уже лет 10-15 как вымерли. :-?]]></description>
        <author>negram</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762153</guid>
        <pubDate>Fri, 23 Feb 2018 16:24:29 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762153</link>
        <description><![CDATA[KILLER: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762150'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Славян &#064; <time class="tag-quote__quoted-time" datetime="2018-02-23T16:09:56+00:00">23.02.18, 16:09</time></span><div class='quote '>Только &quot;&#33;&quot; использую. Ибо вещали (сильно давно), что операция CMP (асм-реализация &quot;==0&quot;) крайне тормознутая, а &quot;test&quot; (в случае &#33; используется, бывает) существенно быстрее&#33; </div></div><br>
Не представляю даже, как бы ты на явошарпах с питонами писал бы. Повесился наверное раньше  :D]]></description>
        <author>KILLER</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762150</guid>
        <pubDate>Fri, 23 Feb 2018 16:09:56 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762150</link>
        <description><![CDATA[Славян: Только &quot;&#33;&quot; использую. Ибо вещали (сильно давно), что операция CMP (асм-реализация &quot;==0&quot;) крайне тормознутая, а &quot;test&quot; (в случае &#33; используется, бывает) существенно быстрее&#33;]]></description>
        <author>Славян</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762146</guid>
        <pubDate>Fri, 23 Feb 2018 15:40:48 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762146</link>
        <description><![CDATA[KILLER: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762145'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>B.V. &#064; <time class="tag-quote__quoted-time" datetime="2018-02-23T15:35:47+00:00">23.02.18, 15:35</time></span><div class='quote '>Да нет, выхватишь UB. </div></div><br>
Незнаю что там на счет UB. Может в новом стандарте UB будет, помню у Страуструпа вроде было написано что деление на 0 приведет к аппаратной ошибке процессора, и соответственно обрабатывать такую ошибку нужно с помощью какого нибудь SEH исключения. Стандартные исключения ловят только программные ошибки, и надеяться на то что catch отловит деление на 0 глупая затея. <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-02-23T15:42:03+00:00">23.02.18, 15:42</time></span></span><br>
Хотя помню компилятор майкрософт в дебаге ловит деление на ноль. В релизе хз.]]></description>
        <author>KILLER</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762145</guid>
        <pubDate>Fri, 23 Feb 2018 15:35:47 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762145</link>
        <description><![CDATA[B.V.: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762144'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>KILLER &#064; <time class="tag-quote__quoted-time" datetime="2018-02-23T15:25:55+00:00">23.02.18, 15:25</time></span><div class='quote '>а в С++ выхватишь Access Violation</div></div><br>
Да нет, выхватишь <a class='tag-url' href='https://stackoverflow.com/questions/3004095/division-by-zero-undefined-behavior-or-implementation-defined-in-c-and-or-c' target='_blank'>UB</a>.]]></description>
        <author>B.V.</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762144</guid>
        <pubDate>Fri, 23 Feb 2018 15:25:55 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762144</link>
        <description><![CDATA[KILLER: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762143'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>B.V. &#064; <time class="tag-quote__quoted-time" datetime="2018-02-23T15:24:43+00:00">23.02.18, 15:24</time></span><div class='quote '>Что-то вспомнилась картинка</div></div><br>
Последний вариант прокатит разве что в скриптовых языках или в каком нибудь C# с Java, а в С++ выхватишь Access Violation.]]></description>
        <author>KILLER</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762143</guid>
        <pubDate>Fri, 23 Feb 2018 15:24:43 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762143</link>
        <description><![CDATA[B.V.: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762142'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>KILLER &#064; <time class="tag-quote__quoted-time" datetime="2018-02-23T15:20:55+00:00">23.02.18, 15:20</time></span><div class='quote '>Но вообще делитель я бы проверял с помощью if a == 0 togda error</div></div><br>
Что-то вспомнилась картинка<br>
<img class='tag-img' src='https://pp.userapi.com/c841439/v841439905/6ff40/boV6Lbde30E.jpg' alt='user posted image'>]]></description>
        <author>B.V.</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762142</guid>
        <pubDate>Fri, 23 Feb 2018 15:20:55 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762142</link>
        <description><![CDATA[KILLER: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762141'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>B.V. &#064; <time class="tag-quote__quoted-time" datetime="2018-02-23T15:19:21+00:00">23.02.18, 15:19</time></span><div class='quote '>Так наверное или удобнее? :) Сам-то что используешь и в каких ситуациях? </div></div><br>
Я голоснул за восклицательный знак. Но вообще делитель я бы проверял с помощью if a == 0 togda error, с указателями и прочим юзал бы if &#33;pointer togda error]]></description>
        <author>KILLER</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762141</guid>
        <pubDate>Fri, 23 Feb 2018 15:19:21 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762141</link>
        <description><![CDATA[B.V.: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762140'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>KILLER &#064; <time class="tag-quote__quoted-time" datetime="2018-02-23T15:17:49+00:00">23.02.18, 15:17</time></span><div class='quote '>удобнее <strong class='tag-b'>наверное</strong> на 0 проверять</div></div><br>
Так наверное или удобнее? :) Сам-то что используешь и в каких ситуациях?]]></description>
        <author>B.V.</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762140</guid>
        <pubDate>Fri, 23 Feb 2018 15:17:49 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762140</link>
        <description><![CDATA[KILLER: Когда работаешь с числами - удобнее наверное на 0 проверять. Например делитель числа.]]></description>
        <author>KILLER</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762139</guid>
        <pubDate>Fri, 23 Feb 2018 15:17:06 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762139</link>
        <description><![CDATA[B.V.: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=412187&view=findpost&p=3762131'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>negram &#064; <time class="tag-quote__quoted-time" datetime="2018-02-23T14:14:33+00:00">23.02.18, 14:14</time></span><div class='quote '>Потребуются, ибо выбора между сравнением с нулём и логическим &quot;не&quot; никогда не было. В плюсах, в смысле.</div></div><br>
Это не выбор между нулём и НЕ, это выбор между двумя семантиками проверки нулевого значения]]></description>
        <author>B.V.</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762136</guid>
        <pubDate>Fri, 23 Feb 2018 15:04:03 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762136</link>
        <description><![CDATA[amk: Зависит от ситуации. Что понятнее, то и использую. Это не Python, издержек на сравнение с 0 нет]]></description>
        <author>amk</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762131</guid>
        <pubDate>Fri, 23 Feb 2018 14:14:33 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762131</link>
        <description><![CDATA[negram: Потребуются, ибо выбора между сравнением с нулём и логическим &quot;не&quot; никогда не было. В плюсах, в смысле.]]></description>
        <author>negram</author>
        <category>Наши голосования</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762129</guid>
        <pubDate>Fri, 23 Feb 2018 14:10:56 +0000</pubDate>
        <title>== 0 ИЛИ &amp;#33;</title>
        <link>https://forum.sources.ru/index.php?showtopic=412187&amp;view=findpost&amp;p=3762129</link>
        <description><![CDATA[B.V.: В продолжение темы сложного выбора. Обращаю внимание, что речь снова о C++. Примеры, надеюсь, не потребуются]]></description>
        <author>B.V.</author>
        <category>Наши голосования</category>
      </item>
	
      </channel>
      </rss>
	