templeos-info/public/Wb/Compiler/OptPass3.HC.HTML

654 lines
75 KiB
Plaintext
Raw Normal View History

2024-03-24 21:24:44 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="generator" content="TempleOS V5.03">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="/style/templeos.css">
<script src="/script/templeos.js"></script>
<style type="text/css">
.cF0{color:#000000;background-color:#ffffff;}
.cF1{color:#0000aa;background-color:#ffffff;}
.cF2{color:#00aa00;background-color:#ffffff;}
.cF3{color:#00aaaa;background-color:#ffffff;}
.cF4{color:#aa0000;background-color:#ffffff;}
.cF5{color:#aa00aa;background-color:#ffffff;}
.cF6{color:#aa5500;background-color:#ffffff;}
.cF7{color:#aaaaaa;background-color:#ffffff;}
.cF8{color:#555555;background-color:#ffffff;}
.cF9{color:#5555ff;background-color:#ffffff;}
.cFA{color:#55ff55;background-color:#ffffff;}
.cFB{color:#55ffff;background-color:#ffffff;}
.cFC{color:#ff5555;background-color:#ffffff;}
.cFD{color:#ff55ff;background-color:#ffffff;}
.cFE{color:#ffff55;background-color:#ffffff;}
.cFF{color:#ffffff;background-color:#ffffff;}
</style>
</head>
<body>
<pre id="content">
<a name="l1"></a><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>OptPass3</span><span class=cF0>(</span><span class=cF9>CCmpCtrl</span><span class=cF0> *cc,</span><span class=cF9>COptReg</span><span class=cF0> *reg_offsets)
<a name="l2"></a>{
<a name="l3"></a> </span><span class=cF9>CHashClass</span><span class=cF0> *tmpc,*tmpc1,*tmpc2;
<a name="l4"></a> </span><span class=cF9>CCodeMisc</span><span class=cF0> *lb;
<a name="l5"></a> </span><span class=cF9>CIntermediateCode</span><span class=cF0> *tmpi,*tmpi1,*tmpi2,*tmpi_next,
<a name="l6"></a> *tmpil1,*tmpil2;
<a name="l7"></a> </span><span class=cF9>I64</span><span class=cF0> code,i,j,l,member_cnt,used_reg_mask=0;
<a name="l8"></a> </span><span class=cF9>CMemberLst</span><span class=cF0> *tmpm;
<a name="l9"></a> COptMemberVar *mv=</span><span class=cF3>NULL</span><span class=cF0>;
<a name="l10"></a> </span><span class=cF9>CAOT</span><span class=cF0> *tmpaot;
<a name="l11"></a> </span><span class=cF9>CAOTImportExport</span><span class=cF0> *tmpie;
<a name="l12"></a> </span><span class=cF9>CPrsStk</span><span class=cF0> *ps=cc-&gt;ps;
<a name="l13"></a> ps-&gt;ptr=0;
<a name="l14"></a> ps-&gt;ptr2=0;
<a name="l15"></a>
<a name="l16"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;</span><span class=cF3>REG_REGS_NUM</span><span class=cF0>;i++) </span><span class=cF7>{</span><span class=cF0>
<a name="l17"></a> reg_offsets[i].</span><span class=cF1>offset</span><span class=cF0>=</span><span class=cF3>I64_MAX</span><span class=cF0>;
<a name="l18"></a> reg_offsets[i].m=</span><span class=cF3>NULL</span><span class=cF0>;
<a name="l19"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l20"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;htc.fun) </span><span class=cF7>{</span><span class=cF0>
<a name="l21"></a> member_cnt=cc-&gt;htc.fun-&gt;member_cnt;
<a name="l22"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;cc-&gt;htc.fun-&gt;flags,</span><span class=cF3>Ff_DOT_DOT_DOT</span><span class=cF7>)</span><span class=cF0>)
<a name="l23"></a> member_cnt+=2;
<a name="l24"></a> mv=</span><span class=cF5>CAlloc</span><span class=cF0>(member_cnt*</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>COptMemberVar</span><span class=cF7>)</span><span class=cF0>);
<a name="l25"></a> member_cnt=0;
<a name="l26"></a> tmpm=cc-&gt;htc.fun-&gt;member_lst_and_root;
<a name="l27"></a> </span><span class=cF1>while</span><span class=cF0> (tmpm) {
<a name="l28"></a> tmpc=</span><span class=cF5>OptClassFwd</span><span class=cF0>(tmpm-&gt;member_class);
<a name="l29"></a> </span><span class=cF1>if</span><span class=cF0> (0&lt;=tmpm-&gt;</span><span class=cF1>reg</span><span class=cF0>&lt;</span><span class=cF3>REG_REGS_NUM</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l30"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bts</span><span class=cF7>(</span><span class=cF0>&amp;used_reg_mask,tmpm-&gt;</span><span class=cF1>reg</span><span class=cF7>)</span><span class=cF0>)
<a name="l31"></a> </span><span class=cF5>PrintWarn</span><span class=cF0>(</span><span class=cF6>&quot;Reg in use\n $LK,\&quot;FL:%s,%d\&quot;$ '%s' in '%s'\n&quot;</span><span class=cF0>,
<a name="l32"></a> cc-&gt;lex_include_stk-&gt;full_name,
<a name="l33"></a> cc-&gt;lex_include_stk-&gt;line_num,tmpm-&gt;str,cc-&gt;htc.fun-&gt;str);
<a name="l34"></a> reg_offsets[tmpm-&gt;</span><span class=cF1>reg</span><span class=cF0>].</span><span class=cF1>offset</span><span class=cF0>=tmpm-&gt;</span><span class=cF1>offset</span><span class=cF0>;
<a name="l35"></a> reg_offsets[tmpm-&gt;</span><span class=cF1>reg</span><span class=cF0>].m=tmpm;
<a name="l36"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmpc-&gt;raw_type!=</span><span class=cF3>RT_F64</span><span class=cF0> &amp;&amp; tmpm-&gt;</span><span class=cF1>reg</span><span class=cF0>!=</span><span class=cF3>REG_NONE</span><span class=cF0> ||
<a name="l37"></a> tmpm-&gt;</span><span class=cF1>reg</span><span class=cF0>==</span><span class=cF3>REG_ALLOC</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l38"></a> </span><span class=cF1>if</span><span class=cF0> (tmpm-&gt;</span><span class=cF1>reg</span><span class=cF0>==</span><span class=cF3>REG_ALLOC</span><span class=cF0>)
<a name="l39"></a> mv[member_cnt].score=</span><span class=cF3>I64_MAX</span><span class=cF0>/2; </span><span class=cF2>//big but not too big</span><span class=cF0>
<a name="l40"></a> mv[member_cnt].offset_start=tmpm-&gt;</span><span class=cF1>offset</span><span class=cF0>;
<a name="l41"></a> mv[member_cnt].offset_end=tmpm-&gt;</span><span class=cF1>offset</span><span class=cF0>+</span><span class=cF5>MaxI64</span><span class=cF0>(1,tmpm-&gt;size);
<a name="l42"></a> mv[member_cnt++].m=tmpm;
<a name="l43"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmpm-&gt;</span><span class=cF1>reg</span><span class=cF0>==</span><span class=cF3>REG_ALLOC</span><span class=cF0>)
<a name="l44"></a> </span><span class=cF5>PrintWarn</span><span class=cF0>(</span><span class=cF6>&quot;Can't reg var\n $LK,\&quot;FL:%s,%d\&quot;$ '%s' in '%s'\n&quot;</span><span class=cF0>,
<a name="l45"></a> cc-&gt;lex_include_stk-&gt;full_name,
<a name="l46"></a> cc-&gt;lex_include_stk-&gt;line_num,tmpm-&gt;str,cc-&gt;htc.fun-&gt;str);
<a name="l47"></a> tmpm=tmpm-&gt;next;
<a name="l48"></a> }
<a name="l49"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l50"></a> member_cnt=0;
<a name="l51"></a>
<a name="l52"></a> tmpi=cc-&gt;coc.coc_head.next;
<a name="l53"></a> </span><span class=cF1>while</span><span class=cF0> (code=tmpi-&gt;ic_code) </span><span class=cF7>{</span><span class=cF0>
<a name="l54"></a> tmpi_next=tmpi-&gt;next;
<a name="l55"></a> </span><span class=cF1>if</span><span class=cF0> (code==</span><span class=cF3>IC_NOP1</span><span class=cF0>)
<a name="l56"></a> </span><span class=cFD>OptFree</span><span class=cF0>(tmpi);
<a name="l57"></a> </span><span class=cF1>else</span><span class=cF0> {
<a name="l58"></a> </span><span class=cF1>if</span><span class=cF0> (tmpil1=</span><span class=cFD>OptLag</span><span class=cF7>(</span><span class=cF0>tmpi</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l59"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>tmpil2=</span><span class=cFD>OptLag</span><span class=cF0>(tmpil1)</span><span class=cF7>)</span><span class=cF0>)
<a name="l60"></a> tmpil2=&amp;</span><span class=cFB>cmp</span><span class=cF0>.ic_nop;
<a name="l61"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l62"></a> tmpil1=tmpil2=&amp;</span><span class=cFB>cmp</span><span class=cF0>.ic_nop;
<a name="l63"></a> tmpc=tmpi-&gt;ic_class;
<a name="l64"></a> </span><span class=cF1>switch</span><span class=cF0> [</span><span class=cFD>intermediate_code_table</span><span class=cF0>[code].arg_cnt] </span><span class=cF7>{</span><span class=cF0>
<a name="l65"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IS_V_ARG</span><span class=cF0>:
<a name="l66"></a> ps-&gt;ptr-=tmpi-&gt;ic_data&gt;&gt;3;
<a name="l67"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l68"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IS_2_ARG</span><span class=cF0>:
<a name="l69"></a> tmpi2=</span><span class=cFD>PrsPop</span><span class=cF0>(ps);
<a name="l70"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi2-&gt;ic_flags&amp;</span><span class=cF3>ICF_RES_TO_F64</span><span class=cF0>)
<a name="l71"></a> tmpc2=</span><span class=cFB>cmp</span><span class=cF0>.internal_types[</span><span class=cF3>RT_F64</span><span class=cF0>];
<a name="l72"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmpi2-&gt;ic_flags &amp; </span><span class=cF3>ICF_RES_TO_INT</span><span class=cF0>)
<a name="l73"></a> tmpc2=</span><span class=cFB>cmp</span><span class=cF0>.internal_types[</span><span class=cF3>RT_I64</span><span class=cF0>];
<a name="l74"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l75"></a> tmpc2=tmpi-&gt;t.arg2_class;
<a name="l76"></a> tmpi-&gt;arg2.type=</span><span class=cF3>MDF_STK</span><span class=cF0>+</span><span class=cFD>CmpRawType</span><span class=cF0>(tmpc2);
<a name="l77"></a> tmpi-&gt;ic_flags|=</span><span class=cF3>ICF_ARG2_WAS_STK</span><span class=cF0>;
<a name="l78"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IS_1_ARG</span><span class=cF0>:
<a name="l79"></a> tmpi1=</span><span class=cFD>PrsPop</span><span class=cF0>(ps);
<a name="l80"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi1-&gt;ic_flags&amp;</span><span class=cF3>ICF_RES_TO_F64</span><span class=cF0>)
<a name="l81"></a> tmpc1=</span><span class=cFB>cmp</span><span class=cF0>.internal_types[</span><span class=cF3>RT_F64</span><span class=cF0>];
<a name="l82"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmpi1-&gt;ic_flags &amp; </span><span class=cF3>ICF_RES_TO_INT</span><span class=cF0>)
<a name="l83"></a> tmpc1=</span><span class=cFB>cmp</span><span class=cF0>.internal_types[</span><span class=cF3>RT_I64</span><span class=cF0>];
<a name="l84"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l85"></a> tmpc1=tmpi-&gt;t.arg1_class;
<a name="l86"></a> tmpi-&gt;arg1.type=</span><span class=cF3>MDF_STK</span><span class=cF0>+</span><span class=cFD>CmpRawType</span><span class=cF0>(tmpc1);
<a name="l87"></a> tmpi-&gt;arg1_type_pointed_to=</span><span class=cFD>CmpRawTypePointed</span><span class=cF0>(tmpc1);
<a name="l88"></a> tmpi-&gt;ic_flags|=</span><span class=cF3>ICF_ARG1_WAS_STK</span><span class=cF0>;
<a name="l89"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l90"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IS_0_ARG</span><span class=cF0>: </span><span class=cF2>//nobound switch</span><span class=cF0>
<a name="l91"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l92"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l93"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFD>intermediate_code_table</span><span class=cF0>[code].res_cnt) </span><span class=cF7>{</span><span class=cF0>
<a name="l94"></a> tmpi-&gt;res.type=</span><span class=cF3>MDF_STK</span><span class=cF0>+</span><span class=cFD>CmpRawType</span><span class=cF0>(tmpc);
<a name="l95"></a> tmpi-&gt;ic_flags|=</span><span class=cF3>ICF_RES_WAS_STK</span><span class=cF0>;
<a name="l96"></a> </span><span class=cFD>PrsPush</span><span class=cF0>(ps,tmpi);
<a name="l97"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l98"></a> </span><span class=cF1>switch</span><span class=cF0> [code] </span><span class=cF7>{</span><span class=cF0>
<a name="l99"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_IMM_F64</span><span class=cF0>:
<a name="l100"></a> tmpi-&gt;ic_flags&amp;=~</span><span class=cF3>ICF_RES_TO_F64</span><span class=cF0>;
<a name="l101"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags&amp;</span><span class=cF3>ICF_RES_TO_INT</span><span class=cF0>) {
<a name="l102"></a> tmpi-&gt;ic_data=</span><span class=cF5>ToI64</span><span class=cF0>(tmpi-&gt;ic_data</span><span class=cF7>(</span><span class=cF1>F64</span><span class=cF7>)</span><span class=cF0>);
<a name="l103"></a> tmpi-&gt;ic_flags&amp;=~</span><span class=cF3>ICF_RES_TO_INT</span><span class=cF0>;
<a name="l104"></a> tmpi-&gt;ic_code=</span><span class=cF3>IC_IMM_I64</span><span class=cF0>;
<a name="l105"></a> }
<a name="l106"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l107"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_IMM_I64</span><span class=cF0>:
<a name="l108"></a> tmpi-&gt;ic_flags&amp;=~</span><span class=cF3>ICF_RES_TO_INT</span><span class=cF0>;
<a name="l109"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags&amp;</span><span class=cF3>ICF_RES_TO_F64</span><span class=cF0>) {
<a name="l110"></a> tmpi-&gt;ic_data(</span><span class=cF1>F64</span><span class=cF0>)=</span><span class=cF5>ToF64</span><span class=cF0>(tmpi-&gt;ic_data);
<a name="l111"></a> tmpi-&gt;ic_flags&amp;=~</span><span class=cF3>ICF_RES_TO_F64</span><span class=cF0>;
<a name="l112"></a> tmpi-&gt;ic_code=</span><span class=cF3>IC_IMM_F64</span><span class=cF0>;
<a name="l113"></a> }
<a name="l114"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l115"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_RBP</span><span class=cF0>:
<a name="l116"></a> tmpi-&gt;ic_code=</span><span class=cF3>IC_REG</span><span class=cF0>;
<a name="l117"></a> tmpi-&gt;arg1.</span><span class=cF1>reg</span><span class=cF0>=</span><span class=cF3>REG_RBP</span><span class=cF0>;
<a name="l118"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l119"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_DEREF</span><span class=cF0>:
<a name="l120"></a> tmpi-&gt;arg1_type_pointed_to=tmpi-&gt;res.type.raw_type;
<a name="l121"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi1-&gt;ic_code==</span><span class=cF3>IC_LEA</span><span class=cF0>) {
<a name="l122"></a> tmpi-&gt;ic_flags|=tmpi1-&gt;ic_flags;
<a name="l123"></a> tmpi-&gt;arg1.</span><span class=cF1>reg</span><span class=cF0>=tmpi1-&gt;arg1.</span><span class=cF1>reg</span><span class=cF0>;
<a name="l124"></a> tmpi-&gt;arg1.disp=tmpi1-&gt;arg1.disp;
<a name="l125"></a> tmpi-&gt;arg1.type=</span><span class=cF3>MDF_DISP</span><span class=cF0>+tmpi-&gt;res.type.raw_type;
<a name="l126"></a> tmpi-&gt;arg1_type_pointed_to=</span><span class=cFD>CmpRawTypePointed</span><span class=cF0>(tmpc);
<a name="l127"></a> tmpi-&gt;ic_code=</span><span class=cF3>IC_MOV</span><span class=cF0>;
<a name="l128"></a> </span><span class=cFD>OptFree</span><span class=cF0>(tmpi1);
<a name="l129"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;arg1.</span><span class=cF1>reg</span><span class=cF0>==</span><span class=cF3>REG_RBP</span><span class=cF0>)
<a name="l130"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;member_cnt;i++)
<a name="l131"></a> </span><span class=cF1>if</span><span class=cF0> (mv[i].offset_start==tmpi-&gt;arg1.disp) </span><span class=cF7>{</span><span class=cF0>
<a name="l132"></a> mv[i].lea_balance--;
<a name="l133"></a> mv[i].score++;
<a name="l134"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l135"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l136"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmpil1-&gt;ic_code==</span><span class=cF3>IC_ADD_CONST</span><span class=cF0>) {
<a name="l137"></a> </span><span class=cF1>if</span><span class=cF0> (tmpil2-&gt;ic_code==</span><span class=cF3>IC_REG</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l138"></a> tmpi-&gt;ic_flags|=tmpil2-&gt;ic_flags|tmpil1-&gt;ic_flags;
<a name="l139"></a> tmpi-&gt;arg1.</span><span class=cF1>reg</span><span class=cF0>=tmpil2-&gt;arg1.</span><span class=cF1>reg</span><span class=cF0>;
<a name="l140"></a> tmpi-&gt;arg1.disp=tmpi-&gt;ic_data;
<a name="l141"></a> tmpi-&gt;arg1.type=</span><span class=cF3>MDF_DISP</span><span class=cF0>+tmpi-&gt;res.type.raw_type;
<a name="l142"></a> tmpi-&gt;arg1_type_pointed_to=</span><span class=cFD>CmpRawTypePointed</span><span class=cF0>(tmpc);
<a name="l143"></a> tmpi-&gt;ic_code=</span><span class=cF3>IC_MOV</span><span class=cF0>;
<a name="l144"></a> </span><span class=cFD>OptFree</span><span class=cF0>(tmpil2);
<a name="l145"></a> </span><span class=cFD>OptFree</span><span class=cF0>(tmpil1);
<a name="l146"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l147"></a> }
<a name="l148"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l149"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC__PP</span><span class=cF0>:
<a name="l150"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC__MM</span><span class=cF0>:
<a name="l151"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_PP_</span><span class=cF0>:
<a name="l152"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MM_</span><span class=cF0>:
<a name="l153"></a> </span><span class=cFD>CmpMinTypePointed</span><span class=cF0>(tmpi,</span><span class=cFD>CmpRawTypePointed</span><span class=cF7>(</span><span class=cF0>tmpi-&gt;t.arg1_class</span><span class=cF7>)</span><span class=cF0>);
<a name="l154"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_DEREF_PP</span><span class=cF0>:
<a name="l155"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_DEREF_MM</span><span class=cF0>:
<a name="l156"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi1-&gt;ic_code==</span><span class=cF3>IC_LEA</span><span class=cF0> &amp;&amp; tmpi1-&gt;arg1.type&amp;</span><span class=cF3>MDF_DISP</span><span class=cF0> &amp;&amp;
<a name="l157"></a> tmpi1-&gt;arg1.</span><span class=cF1>reg</span><span class=cF0>==</span><span class=cF3>REG_RBP</span><span class=cF0>)
<a name="l158"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;member_cnt;i++)
<a name="l159"></a> </span><span class=cF1>if</span><span class=cF0> (mv[i].offset_start==tmpi1-&gt;arg1.disp) {
<a name="l160"></a> mv[i].lea_balance--;
<a name="l161"></a> mv[i].score++;
<a name="l162"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l163"></a> }
<a name="l164"></a> tmpi-&gt;arg1_type_pointed_to=tmpi-&gt;res.type.raw_type;
<a name="l165"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l166"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MUL</span><span class=cF0>:
<a name="l167"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_DIV</span><span class=cF0>:
<a name="l168"></a> </span><span class=cF1>if</span><span class=cF0> (tmpc-&gt;raw_type==</span><span class=cF3>RT_F64</span><span class=cF0>) {
<a name="l169"></a> </span><span class=cFD>CmpF2PushPop</span><span class=cF0>(tmpi,tmpi1,tmpi2);
<a name="l170"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l171"></a> }
<a name="l172"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l173"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ADD</span><span class=cF0>:
<a name="l174"></a> </span><span class=cF1>if</span><span class=cF0> (tmpc-&gt;raw_type==</span><span class=cF3>RT_F64</span><span class=cF0>) {
<a name="l175"></a> </span><span class=cFD>CmpF2PushPop</span><span class=cF0>(tmpi,tmpi1,tmpi2);
<a name="l176"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l177"></a> }
<a name="l178"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFD>OptFixupBinaryOp2</span><span class=cF7>(</span><span class=cF0>&amp;tmpi1,&amp;tmpi2</span><span class=cF7>)</span><span class=cF0>) {
<a name="l179"></a> tmpi-&gt;ic_flags|=tmpi1-&gt;ic_flags;
<a name="l180"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;t.arg1_tree!=tmpi2)
<a name="l181"></a> tmpi-&gt;t.arg1_class=tmpi-&gt;t.arg2_class;
<a name="l182"></a> tmpi-&gt;ic_data=tmpi1-&gt;ic_data;
<a name="l183"></a> tmpi-&gt;ic_code=</span><span class=cF3>IC_ADD_CONST</span><span class=cF0>;
<a name="l184"></a> tmpi-&gt;arg1_type_pointed_to=tmpi-&gt;res.type.raw_type;
<a name="l185"></a> tmpi-&gt;arg2.type=</span><span class=cF3>MDF_NULL</span><span class=cF0>;
<a name="l186"></a> </span><span class=cFD>OptFree</span><span class=cF0>(tmpi1);
<a name="l187"></a> </span><span class=cF1>if</span><span class=cF0> (tmpil2-&gt;ic_code==</span><span class=cF3>IC_REG</span><span class=cF0> &amp;&amp; tmpil2-&gt;arg1.</span><span class=cF1>reg</span><span class=cF0>==</span><span class=cF3>REG_RBP</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l188"></a> tmpi-&gt;ic_flags|=tmpil2-&gt;ic_flags;
<a name="l189"></a> tmpi-&gt;ic_code=</span><span class=cF3>IC_LEA</span><span class=cF0>;
<a name="l190"></a> tmpi-&gt;arg1.</span><span class=cF1>reg</span><span class=cF0>=</span><span class=cF3>REG_RBP</span><span class=cF0>;
<a name="l191"></a> tmpi-&gt;arg1.type=</span><span class=cF3>MDF_DISP</span><span class=cF0>+tmpi-&gt;arg1.type.raw_type;
<a name="l192"></a> tmpi-&gt;arg1.disp=tmpi-&gt;ic_data;
<a name="l193"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;member_cnt;i++)
<a name="l194"></a> </span><span class=cF1>if</span><span class=cF0> (mv[i].offset_start&lt;=tmpi-&gt;ic_data&lt;mv[i].offset_end) {
<a name="l195"></a> mv[i].lea_balance++;
<a name="l196"></a> mv[i].score++;
<a name="l197"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l198"></a> }
<a name="l199"></a> </span><span class=cFD>OptFree</span><span class=cF0>(tmpil2);
<a name="l200"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l201"></a> }
<a name="l202"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l203"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SUB</span><span class=cF0>:
<a name="l204"></a> </span><span class=cF1>if</span><span class=cF0> (tmpc-&gt;raw_type==</span><span class=cF3>RT_F64</span><span class=cF0>) {
<a name="l205"></a> </span><span class=cFD>CmpF2PushPop</span><span class=cF0>(tmpi,tmpi1,tmpi2);
<a name="l206"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l207"></a> }
<a name="l208"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi2-&gt;ic_code==</span><span class=cF3>IC_IMM_I64</span><span class=cF0>) {
<a name="l209"></a> tmpi-&gt;ic_flags|=tmpi2-&gt;ic_flags;
<a name="l210"></a> tmpi-&gt;ic_data=tmpi2-&gt;ic_data;
<a name="l211"></a> tmpi-&gt;ic_code=</span><span class=cF3>IC_SUB_CONST</span><span class=cF0>;
<a name="l212"></a> tmpi-&gt;arg2.type=</span><span class=cF3>MDF_NULL</span><span class=cF0>;
<a name="l213"></a> </span><span class=cFD>OptFree</span><span class=cF0>(tmpi2);
<a name="l214"></a> }
<a name="l215"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l216"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_LESS</span><span class=cF0>:
<a name="l217"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_GREATER_EQU</span><span class=cF0>:
<a name="l218"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_GREATER</span><span class=cF0>:
<a name="l219"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_LESS_EQU</span><span class=cF0>:
<a name="l220"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags&amp;</span><span class=cF3>ICF_USE_F64</span><span class=cF0>)
<a name="l221"></a> </span><span class=cFD>CmpF2PushPop</span><span class=cF0>(tmpi,tmpi1,tmpi2);
<a name="l222"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l223"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MUL_EQU</span><span class=cF0>:
<a name="l224"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_DIV_EQU</span><span class=cF0>:
<a name="l225"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ADD_EQU</span><span class=cF0>:
<a name="l226"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SUB_EQU</span><span class=cF0>:
<a name="l227"></a> </span><span class=cF1>if</span><span class=cF0> (tmpc-&gt;raw_type==</span><span class=cF3>RT_F64</span><span class=cF0>)
<a name="l228"></a> </span><span class=cFD>CmpF1PushPop</span><span class=cF0>(tmpi,tmpi2);
<a name="l229"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ASSIGN_PP</span><span class=cF0>:
<a name="l230"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ASSIGN_MM</span><span class=cF0>:
<a name="l231"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ASSIGN</span><span class=cF0>:
<a name="l232"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SHL_EQU</span><span class=cF0>:
<a name="l233"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SHR_EQU</span><span class=cF0>:
<a name="l234"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MOD_EQU</span><span class=cF0>:
<a name="l235"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_AND_EQU</span><span class=cF0>:
<a name="l236"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_OR_EQU</span><span class=cF0>:
<a name="l237"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_XOR_EQU</span><span class=cF0>:
<a name="l238"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi1-&gt;ic_code==</span><span class=cF3>IC_LEA</span><span class=cF0> &amp;&amp; tmpi1-&gt;arg1.type&amp;</span><span class=cF3>MDF_DISP</span><span class=cF0> &amp;&amp;
<a name="l239"></a> tmpi1-&gt;arg1.</span><span class=cF1>reg</span><span class=cF0>==</span><span class=cF3>REG_RBP</span><span class=cF0>)
<a name="l240"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;member_cnt;i++)
<a name="l241"></a> </span><span class=cF1>if</span><span class=cF0> (mv[i].offset_start==tmpi1-&gt;arg1.disp) {
<a name="l242"></a> mv[i].lea_balance--;
<a name="l243"></a> mv[i].score++;
<a name="l244"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l245"></a> }
<a name="l246"></a> tmpi-&gt;arg1_type_pointed_to=tmpi-&gt;res.type.raw_type;
<a name="l247"></a> </span><span class=cFD>CmpMinTypePointed</span><span class=cF0>(tmpi,</span><span class=cFD>CmpRawTypePointed</span><span class=cF7>(</span><span class=cF0>tmpi-&gt;t.arg1_class</span><span class=cF7>)</span><span class=cF0>);
<a name="l248"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l249"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_RETURN_VAL</span><span class=cF0>:
<a name="l250"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_RETURN_VAL2</span><span class=cF0>:
<a name="l251"></a> </span><span class=cF1>if</span><span class=cF0> (tmpc) {
<a name="l252"></a> </span><span class=cF1>if</span><span class=cF0> (tmpc-&gt;raw_type==</span><span class=cF3>RT_F64</span><span class=cF0> &amp;&amp; tmpil1-&gt;ic_class-&gt;raw_type!=</span><span class=cF3>RT_F64</span><span class=cF0>)
<a name="l253"></a> tmpil1-&gt;ic_flags|=</span><span class=cF3>ICF_RES_TO_F64</span><span class=cF0>;
<a name="l254"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmpc-&gt;raw_type!=</span><span class=cF3>RT_F64</span><span class=cF0> &amp;&amp;
<a name="l255"></a> tmpil1-&gt;ic_class-&gt;raw_type==</span><span class=cF3>RT_F64</span><span class=cF0>)
<a name="l256"></a> tmpil1-&gt;ic_flags|=</span><span class=cF3>ICF_RES_TO_INT</span><span class=cF0>;
<a name="l257"></a> }
<a name="l258"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l259"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SQR</span><span class=cF0>:
<a name="l260"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ABS</span><span class=cF0>:
<a name="l261"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SQRT</span><span class=cF0>:
<a name="l262"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SIN</span><span class=cF0>:
<a name="l263"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_COS</span><span class=cF0>:
<a name="l264"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_TAN</span><span class=cF0>:
<a name="l265"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ATAN</span><span class=cF0>:
<a name="l266"></a> </span><span class=cF1>if</span><span class=cF0> (tmpc-&gt;raw_type==</span><span class=cF3>RT_F64</span><span class=cF0>)
<a name="l267"></a> </span><span class=cFD>CmpF1PushPop</span><span class=cF0>(tmpi,tmpi1);
<a name="l268"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l269"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_NOBOUND_SWITCH</span><span class=cF0>:
<a name="l270"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SWITCH</span><span class=cF0>:
<a name="l271"></a> lb=</span><span class=cFD>OptLabelFwd</span><span class=cF0>(tmpi-&gt;ic_data</span><span class=cF7>(</span><span class=cF9>CCodeMisc</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>-&gt;dft);
<a name="l272"></a> lb-&gt;use_cnt++;
<a name="l273"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l274"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ASM</span><span class=cF0>:
<a name="l275"></a> tmpaot=tmpi-&gt;ic_data;
<a name="l276"></a> tmpie=tmpaot-&gt;next_ie;
<a name="l277"></a> </span><span class=cF1>while</span><span class=cF0> (tmpie!=&amp;tmpaot-&gt;next_ie) {
<a name="l278"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF3>IET_REL_I0</span><span class=cF0>&lt;=tmpie-&gt;type&lt;=</span><span class=cF3>IET_IMM_I64</span><span class=cF0> &amp;&amp;
<a name="l279"></a> tmpie-&gt;str &amp;&amp; tmpie-&gt;flags&amp;</span><span class=cF3>IEF_GOTO_LABEL</span><span class=cF0> &amp;&amp;
<a name="l280"></a> </span><span class=cF7>(</span><span class=cF0>lb=</span><span class=cFD>COCGoToLabelFind</span><span class=cF0>(cc,tmpie-&gt;str)</span><span class=cF7>)</span><span class=cF0>)
<a name="l281"></a> lb-&gt;use_cnt++; </span><span class=cF2>//Prevent deadcode elimination.</span><span class=cF0>
<a name="l282"></a> tmpie=tmpie-&gt;next;
<a name="l283"></a> }
<a name="l284"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l285"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_NOT_EQU</span><span class=cF0>:
<a name="l286"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_EQU_EQU</span><span class=cF0>:
<a name="l287"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>tmpi1-&gt;ic_code==</span><span class=cF3>IC_IMM_I64</span><span class=cF0> ||
<a name="l288"></a> tmpi1-&gt;ic_code==</span><span class=cF3>IC_IMM_F64</span><span class=cF7>)</span><span class=cF0> &amp;&amp; !tmpi1-&gt;ic_data) {
<a name="l289"></a> </span><span class=cFD>OptFree</span><span class=cF0>(tmpi1);
<a name="l290"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&amp;tmpi-&gt;arg1,&amp;tmpi-&gt;arg2,</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CICArg</span><span class=cF7>)</span><span class=cF0>);
<a name="l291"></a> tmpi-&gt;arg2.type=</span><span class=cF3>MDF_NULL</span><span class=cF0>;
<a name="l292"></a> </span><span class=cF1>if</span><span class=cF0> (code==</span><span class=cF3>IC_BR_EQU_EQU</span><span class=cF0>)
<a name="l293"></a> code=tmpi-&gt;ic_code=</span><span class=cF3>IC_BR_ZERO</span><span class=cF0>;
<a name="l294"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l295"></a> code=tmpi-&gt;ic_code=</span><span class=cF3>IC_BR_NOT_ZERO</span><span class=cF0>;
<a name="l296"></a> tmpi1=tmpi2;
<a name="l297"></a> tmpc1=tmpc2;
<a name="l298"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>tmpi2-&gt;ic_code==</span><span class=cF3>IC_IMM_I64</span><span class=cF0> ||
<a name="l299"></a> tmpi2-&gt;ic_code==</span><span class=cF3>IC_IMM_F64</span><span class=cF7>)</span><span class=cF0> &amp;&amp; !tmpi2-&gt;ic_data) {
<a name="l300"></a> </span><span class=cFD>OptFree</span><span class=cF0>(tmpi2);
<a name="l301"></a> tmpi-&gt;arg2.type=</span><span class=cF3>MDF_NULL</span><span class=cF0>;
<a name="l302"></a> </span><span class=cF1>if</span><span class=cF0> (code==</span><span class=cF3>IC_BR_EQU_EQU</span><span class=cF0>)
<a name="l303"></a> code=tmpi-&gt;ic_code=</span><span class=cF3>IC_BR_ZERO</span><span class=cF0>;
<a name="l304"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l305"></a> code=tmpi-&gt;ic_code=</span><span class=cF3>IC_BR_NOT_ZERO</span><span class=cF0>;
<a name="l306"></a> } </span><span class=cF1>else</span><span class=cF0>
<a name="l307"></a> </span><span class=cF1>goto</span><span class=cF0> here1;
<a name="l308"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_ZERO</span><span class=cF0>:
<a name="l309"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_NOT_ZERO</span><span class=cF0>:
<a name="l310"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi1-&gt;ic_code==</span><span class=cF3>IC_IMM_I64</span><span class=cF0> || tmpi1-&gt;ic_code==</span><span class=cF3>IC_IMM_F64</span><span class=cF0>) {
<a name="l311"></a> </span><span class=cF1>if</span><span class=cF0> (code==</span><span class=cF3>IC_BR_ZERO</span><span class=cF0> ^^ tmpi1-&gt;ic_data) </span><span class=cF7>{</span><span class=cF0>
<a name="l312"></a> </span><span class=cFD>OptFree</span><span class=cF0>(tmpi1);
<a name="l313"></a> tmpi-&gt;arg1.type=</span><span class=cF3>MDF_NULL</span><span class=cF0>;
<a name="l314"></a> tmpi-&gt;ic_code=</span><span class=cF3>IC_JMP</span><span class=cF0>;
<a name="l315"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l316"></a> </span><span class=cFD>OptFree</span><span class=cF0>(tmpi1);
<a name="l317"></a> tmpi=</span><span class=cFD>OptFree</span><span class=cF0>(tmpi);
<a name="l318"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l319"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l320"></a> }
<a name="l321"></a> </span><span class=cF1>goto</span><span class=cF0> here1;
<a name="l322"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_AND_ZERO</span><span class=cF0>:
<a name="l323"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi1-&gt;ic_code==</span><span class=cF3>IC_IMM_I64</span><span class=cF0>) {
<a name="l324"></a> i=</span><span class=cF5>Bsr</span><span class=cF0>(tmpi1-&gt;ic_data);
<a name="l325"></a> </span><span class=cF1>if</span><span class=cF0> (0&lt;=i==</span><span class=cF5>Bsf</span><span class=cF7>(</span><span class=cF0>tmpi1-&gt;ic_data</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l326"></a> tmpi1-&gt;ic_data=i;
<a name="l327"></a> tmpi-&gt;ic_flags|=</span><span class=cF3>ICF_BY_VAL</span><span class=cF0>;
<a name="l328"></a> tmpi-&gt;ic_code=</span><span class=cF3>IC_BR_NOT_BT</span><span class=cF0>;
<a name="l329"></a> </span><span class=cF1>goto</span><span class=cF0> here1;
<a name="l330"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l331"></a> }
<a name="l332"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi2-&gt;ic_code==</span><span class=cF3>IC_IMM_I64</span><span class=cF0>) {
<a name="l333"></a> i=</span><span class=cF5>Bsr</span><span class=cF0>(tmpi2-&gt;ic_data);
<a name="l334"></a> </span><span class=cF1>if</span><span class=cF0> (0&lt;=i==</span><span class=cF5>Bsf</span><span class=cF7>(</span><span class=cF0>tmpi2-&gt;ic_data</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l335"></a> tmpi2-&gt;ic_data=i;
<a name="l336"></a> tmpi-&gt;ic_flags|=</span><span class=cF3>ICF_SWAP</span><span class=cF0>|</span><span class=cF3>ICF_BY_VAL</span><span class=cF0>;
<a name="l337"></a> tmpi-&gt;ic_code=</span><span class=cF3>IC_BR_NOT_BT</span><span class=cF0>;
<a name="l338"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l339"></a> }
<a name="l340"></a> </span><span class=cF1>goto</span><span class=cF0> here1;
<a name="l341"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_AND_NOT_ZERO</span><span class=cF0>:
<a name="l342"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi1-&gt;ic_code==</span><span class=cF3>IC_IMM_I64</span><span class=cF0>) {
<a name="l343"></a> i=</span><span class=cF5>Bsr</span><span class=cF0>(tmpi1-&gt;ic_data);
<a name="l344"></a> </span><span class=cF1>if</span><span class=cF0> (0&lt;=i==</span><span class=cF5>Bsf</span><span class=cF7>(</span><span class=cF0>tmpi1-&gt;ic_data</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l345"></a> tmpi1-&gt;ic_data=i;
<a name="l346"></a> tmpi-&gt;ic_flags|=</span><span class=cF3>ICF_BY_VAL</span><span class=cF0>;
<a name="l347"></a> tmpi-&gt;ic_code=</span><span class=cF3>IC_BR_BT</span><span class=cF0>;
<a name="l348"></a> </span><span class=cF1>goto</span><span class=cF0> here1;
<a name="l349"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l350"></a> }
<a name="l351"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi2-&gt;ic_code==</span><span class=cF3>IC_IMM_I64</span><span class=cF0>) {
<a name="l352"></a> i=</span><span class=cF5>Bsr</span><span class=cF0>(tmpi2-&gt;ic_data);
<a name="l353"></a> </span><span class=cF1>if</span><span class=cF0> (0&lt;=i==</span><span class=cF5>Bsf</span><span class=cF7>(</span><span class=cF0>tmpi2-&gt;ic_data</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l354"></a> tmpi2-&gt;ic_data=i;
<a name="l355"></a> tmpi-&gt;ic_flags|=</span><span class=cF3>ICF_SWAP</span><span class=cF0>|</span><span class=cF3>ICF_BY_VAL</span><span class=cF0>;
<a name="l356"></a> tmpi-&gt;ic_code=</span><span class=cF3>IC_BR_BT</span><span class=cF0>;
<a name="l357"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l358"></a> }
<a name="l359"></a> </span><span class=cF1>goto</span><span class=cF0> here1;
<a name="l360"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_MM_ZERO</span><span class=cF0>:
<a name="l361"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_MM_NOT_ZERO</span><span class=cF0>:
<a name="l362"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi1-&gt;ic_code==</span><span class=cF3>IC_LEA</span><span class=cF0> &amp;&amp; tmpi1-&gt;arg1.type&amp;</span><span class=cF3>MDF_DISP</span><span class=cF0> &amp;&amp;
<a name="l363"></a> tmpi1-&gt;arg1.</span><span class=cF1>reg</span><span class=cF0>==</span><span class=cF3>REG_RBP</span><span class=cF0>)
<a name="l364"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;member_cnt;i++)
<a name="l365"></a> </span><span class=cF1>if</span><span class=cF0> (mv[i].offset_start==tmpi1-&gt;arg1.disp) {
<a name="l366"></a> mv[i].lea_balance--;
<a name="l367"></a> mv[i].score++;
<a name="l368"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l369"></a> }
<a name="l370"></a> tmpi-&gt;arg1_type_pointed_to=</span><span class=cFD>CmpRawType</span><span class=cF0>(tmpc);
<a name="l371"></a> </span><span class=cF1>goto</span><span class=cF0> here1;
<a name="l372"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_LESS</span><span class=cF0>:
<a name="l373"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_GREATER_EQU</span><span class=cF0>:
<a name="l374"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_GREATER</span><span class=cF0>:
<a name="l375"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_LESS_EQU</span><span class=cF0>:
<a name="l376"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags&amp;</span><span class=cF3>ICF_USE_F64</span><span class=cF0>)
<a name="l377"></a> </span><span class=cFD>CmpF2PushPop</span><span class=cF0>(tmpi,tmpi1,tmpi2);
<a name="l378"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_EQU_EQU2</span><span class=cF0>...</span><span class=cF3>IC_BR_LESS_EQU2</span><span class=cF0>:
<a name="l379"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_CARRY</span><span class=cF0>:
<a name="l380"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_NOT_CARRY</span><span class=cF0>:
<a name="l381"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_GET_LABEL</span><span class=cF0>:
<a name="l382"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_BT</span><span class=cF0>:
<a name="l383"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_BTS</span><span class=cF0>:
<a name="l384"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_BTR</span><span class=cF0>:
<a name="l385"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_BTC</span><span class=cF0>:
<a name="l386"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_NOT_BT</span><span class=cF0>:
<a name="l387"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_NOT_BTS</span><span class=cF0>:
<a name="l388"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_NOT_BTR</span><span class=cF0>:
<a name="l389"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_NOT_BTC</span><span class=cF0>:
<a name="l390"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_JMP</span><span class=cF0>:
<a name="l391"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SUB_CALL</span><span class=cF0>:
<a name="l392"></a>here1:
<a name="l393"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi-&gt;ic_flags&amp;</span><span class=cF3>ICF_PUSH_CMP</span><span class=cF0>)
<a name="l394"></a> lb=tmpi-&gt;ic_data;
<a name="l395"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l396"></a> lb=</span><span class=cFD>OptLabelFwd</span><span class=cF0>(tmpi-&gt;ic_data);
<a name="l397"></a> lb-&gt;use_cnt++;
<a name="l398"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l399"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_NOP1</span><span class=cF0>:
<a name="l400"></a> tmpi=</span><span class=cFD>OptFree</span><span class=cF0>(tmpi);
<a name="l401"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l402"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_NOP2</span><span class=cF0>:
<a name="l403"></a> ps-&gt;ptr+=tmpi-&gt;ic_data;
<a name="l404"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l405"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SHL_CONST</span><span class=cF0>:
<a name="l406"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SHR_CONST</span><span class=cF0>:
<a name="l407"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ENTER</span><span class=cF0>:
<a name="l408"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ADD_RSP</span><span class=cF0>:
<a name="l409"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ADD_RSP1</span><span class=cF0>:
<a name="l410"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_CALL</span><span class=cF0>:
<a name="l411"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_CALL_INDIRECT</span><span class=cF0>:
<a name="l412"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_CALL_INDIRECT2</span><span class=cF0>:
<a name="l413"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_CALL_EXTERN</span><span class=cF0>:
<a name="l414"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_CALL_IMPORT</span><span class=cF0>:
<a name="l415"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_PUSH</span><span class=cF0>:
<a name="l416"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_POP</span><span class=cF0>:
<a name="l417"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_INVLPG</span><span class=cF0>:
<a name="l418"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_CLFLUSH</span><span class=cF0>:
<a name="l419"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_GET_RFLAGS</span><span class=cF0>:
<a name="l420"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_CARRY</span><span class=cF0>:
<a name="l421"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_RDTSC</span><span class=cF0>:
<a name="l422"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SET_RFLAGS</span><span class=cF0>:
<a name="l423"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_GET_RBP</span><span class=cF0>:
<a name="l424"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SET_RBP</span><span class=cF0>:
<a name="l425"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_GET_RSP</span><span class=cF0>:
<a name="l426"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_GET_RAX</span><span class=cF0>:
<a name="l427"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SET_RSP</span><span class=cF0>:
<a name="l428"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SET_RAX</span><span class=cF0>:
<a name="l429"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ABS_ADDR</span><span class=cF0>:
<a name="l430"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_HEAP_GLBL</span><span class=cF0>:
<a name="l431"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ADDR_IMPORT</span><span class=cF0>:
<a name="l432"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_TYPE</span><span class=cF0>:
<a name="l433"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BT</span><span class=cF0>:
<a name="l434"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BTS</span><span class=cF0>:
<a name="l435"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BTR</span><span class=cF0>:
<a name="l436"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BTC</span><span class=cF0>:
<a name="l437"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_LBTS</span><span class=cF0>:
<a name="l438"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_LBTR</span><span class=cF0>:
<a name="l439"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_LBTC</span><span class=cF0>:
<a name="l440"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BSF</span><span class=cF0>:
<a name="l441"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BSR</span><span class=cF0>:
<a name="l442"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SIGN_I64</span><span class=cF0>:
<a name="l443"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_TOUPPER</span><span class=cF0>:
<a name="l444"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_TO_I64</span><span class=cF0>:
<a name="l445"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_TO_F64</span><span class=cF0>:
<a name="l446"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_TO_BOOL</span><span class=cF0>:
<a name="l447"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ABS_I64</span><span class=cF0>:
<a name="l448"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MIN_I64</span><span class=cF0>:
<a name="l449"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MAX_I64</span><span class=cF0>:
<a name="l450"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MIN_U64</span><span class=cF0>:
<a name="l451"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MAX_U64</span><span class=cF0>:
<a name="l452"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MOD_U64</span><span class=cF0>:
<a name="l453"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SQR_I64</span><span class=cF0>:
<a name="l454"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SQR_U64</span><span class=cF0>:
<a name="l455"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SWAP_U8</span><span class=cF0>:
<a name="l456"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SWAP_U16</span><span class=cF0>:
<a name="l457"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SWAP_U32</span><span class=cF0>:
<a name="l458"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SWAP_I64</span><span class=cF0>:
<a name="l459"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_QUE_INIT</span><span class=cF0>:
<a name="l460"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_QUE_INS</span><span class=cF0>:
<a name="l461"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_QUE_INS_REV</span><span class=cF0>:
<a name="l462"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_QUE_REM</span><span class=cF0>:
<a name="l463"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_IN_U32</span><span class=cF0>:
<a name="l464"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_IN_U16</span><span class=cF0>:
<a name="l465"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_IN_U8</span><span class=cF0>:
<a name="l466"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_STRLEN</span><span class=cF0>:
<a name="l467"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_OUT_U32</span><span class=cF0>:
<a name="l468"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_OUT_U16</span><span class=cF0>:
<a name="l469"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_OUT_U8</span><span class=cF0>:
<a name="l470"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_STR_CONST</span><span class=cF0>:
<a name="l471"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_FS</span><span class=cF0>:
<a name="l472"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_GS</span><span class=cF0>:
<a name="l473"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MOV_FS</span><span class=cF0>:
<a name="l474"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MOV_GS</span><span class=cF0>:
<a name="l475"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_RIP</span><span class=cF0>:
<a name="l476"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_PUSH_CMP</span><span class=cF0>:
<a name="l477"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_REG</span><span class=cF0>:
<a name="l478"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_COM</span><span class=cF0>:
<a name="l479"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_HOLYC_TYPECAST</span><span class=cF0>:
<a name="l480"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_NOT</span><span class=cF0>:
<a name="l481"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_UNARY_MINUS</span><span class=cF0>:
<a name="l482"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_POWER</span><span class=cF0>:
<a name="l483"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SHL</span><span class=cF0>:
<a name="l484"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SHR</span><span class=cF0>:
<a name="l485"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MOD</span><span class=cF0>:
<a name="l486"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_AND</span><span class=cF0>:
<a name="l487"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_OR</span><span class=cF0>:
<a name="l488"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_XOR</span><span class=cF0>:
<a name="l489"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_EQU_EQU</span><span class=cF0>:
<a name="l490"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_NOT_EQU</span><span class=cF0>:
<a name="l491"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_AND_AND</span><span class=cF0>:
<a name="l492"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_OR_OR</span><span class=cF0>:
<a name="l493"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_XOR_XOR</span><span class=cF0>:
<a name="l494"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_LEAVE</span><span class=cF0>:
<a name="l495"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_RET</span><span class=cF0>:
<a name="l496"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ADDR</span><span class=cF0>:
<a name="l497"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_END</span><span class=cF0>:
<a name="l498"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_END_EXP</span><span class=cF0>:
<a name="l499"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_CALL_END</span><span class=cF0>:
<a name="l500"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_CALL_END2</span><span class=cF0>:
<a name="l501"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_CALL_START</span><span class=cF0>:
<a name="l502"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_PUSH_REGS</span><span class=cF0>:
<a name="l503"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_POP_REGS</span><span class=cF0>:
<a name="l504"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_LABEL</span><span class=cF0>:
<a name="l505"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l506"></a> </span><span class=cF1>default</span><span class=cF0>:
<a name="l507"></a> </span><span class=cF6>&quot;Pass:%d Missing IC hndlr\n&quot;</span><span class=cF0>,cc-&gt;pass;
<a name="l508"></a> </span><span class=cFD>ICPut</span><span class=cF0>(cc,tmpi);
<a name="l509"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc,</span><span class=cF6>&quot;Compiler Optimization Error at &quot;</span><span class=cF0>);
<a name="l510"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l511"></a> }
<a name="l512"></a> tmpi=tmpi_next;
<a name="l513"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l514"></a></span><span class=cF2>/* REGISTER VARIABLE ASSIGNMENT</span><span class=cF0>
<a name="l515"></a>
<a name="l516"></a></span><span class=cF2>We just scored num occurrences of each [RBP] offset in the code to help decide</span><span class=cF0>
<a name="l517"></a></span><span class=cF2>which variables should be assigned to register variables.</span><span class=cF0>
<a name="l518"></a>
<a name="l519"></a></span><span class=cF2>We counted the times each offset was added to RBP as a plus LEA and we subtract</span><span class=cF0>
<a name="l520"></a></span><span class=cF2>the times the offset is dereferenced. If the address was calculated more times</span><span class=cF0>
<a name="l521"></a></span><span class=cF2>than the offset was dereferenced, the variable's address was passed or assigned</span><span class=cF0>
<a name="l522"></a></span><span class=cF2>and we cannot use a register because you can't take address of a reg var.</span><span class=cF0>
<a name="l523"></a>
<a name="l524"></a></span><span class=cF2>RAX,RBX,RCX,RDX, R8 are free to be clobbered by each intermediate code.</span><span class=cF0>
<a name="l525"></a></span><span class=cF2>RAX and R8 links intermediate codes together. R9 is used for stack machine</span><span class=cF0>
<a name="l526"></a></span><span class=cF2>temporaries. RBP is used as stack frame.</span><span class=cF0>
<a name="l527"></a>
<a name="l528"></a></span><span class=cF2>RSI,RDI,R10,R11,R12,R13,R14,R15 are used for reg vars.</span><span class=cF0> </span><span class=cF2>R12 and R13, however,</span><span class=cF0>
<a name="l529"></a></span><span class=cF2>have a unusual ModR addressing mode in the x86_64 architecture, so I only use</span><span class=cF0>
<a name="l530"></a></span><span class=cF2>R12 and R13 as non-pointer register variables, such as index variables i,j,k.</span><span class=cF0>
<a name="l531"></a>
<a name="l532"></a></span><span class=cF2>*/</span><span class=cF0>
<a name="l533"></a> </span><span class=cF1>if</span><span class=cF0> (cc-&gt;htc.fun) </span><span class=cF7>{</span><span class=cF0>
<a name="l534"></a> cc-&gt;htc.fun-&gt;used_reg_mask=cc-&gt;htc.fun-&gt;used_reg_mask&amp;
<a name="l535"></a> ~(</span><span class=cF3>REGG_LOCAL_VARS</span><span class=cF0>|</span><span class=cF3>REGG_LOCAL_NON_PTR_VARS</span><span class=cF0>)|used_reg_mask;
<a name="l536"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;cc-&gt;opts,</span><span class=cF3>OPTf_NO_REG_VAR</span><span class=cF7>)</span><span class=cF0> &amp;&amp;
<a name="l537"></a> !</span><span class=cF7>(</span><span class=cF0>cc-&gt;flags &amp; </span><span class=cF3>CCF_NO_REG_OPT</span><span class=cF7>)</span><span class=cF0>) {
<a name="l538"></a> </span><span class=cF5>QSort</span><span class=cF0>(mv,member_cnt,</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>COptMemberVar</span><span class=cF7>)</span><span class=cF0>,&amp;</span><span class=cFD>OptMVCompare</span><span class=cF0>);
<a name="l539"></a> </span><span class=cF1>while</span><span class=cF0> (member_cnt &amp;&amp; !mv[member_cnt-1].score)
<a name="l540"></a> member_cnt--;
<a name="l541"></a> j=0;
<a name="l542"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;member_cnt;i++) </span><span class=cF7>{</span><span class=cF0>
<a name="l543"></a> </span><span class=cF1>if</span><span class=cF0> (!mv[i].lea_balance &amp;&amp; mv[i].offset_start) {</span><span class=cF2>//addr operator cancels</span><span class=cF0>
<a name="l544"></a> mv[j].m=mv[i].m;
<a name="l545"></a> mv[j].offset_start=mv[i].offset_start;
<a name="l546"></a> mv[j++].offset_end=mv[i].offset_end;
<a name="l547"></a> } </span><span class=cF1>else</span><span class=cF0> {
<a name="l548"></a> </span><span class=cF1>if</span><span class=cF0> (mv[i].m-&gt;</span><span class=cF1>reg</span><span class=cF0>==</span><span class=cF3>REG_ALLOC</span><span class=cF0>)
<a name="l549"></a> </span><span class=cF5>PrintWarn</span><span class=cF0>(</span><span class=cF6>&quot;Can't reg var\n $LK,\&quot;FL:%s,%d\&quot;$ '%s' in '%s'\n&quot;</span><span class=cF0>,
<a name="l550"></a> cc-&gt;lex_include_stk-&gt;full_name,
<a name="l551"></a> cc-&gt;lex_include_stk-&gt;line_num,mv[i].m-&gt;str,cc-&gt;htc.fun-&gt;str);
<a name="l552"></a> }
<a name="l553"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l554"></a> </span><span class=cF1>if</span><span class=cF0> (j&gt;0) </span><span class=cF7>{</span><span class=cF0>
<a name="l555"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;cc-&gt;flags,</span><span class=cF3>CCf_PASS_TRACE_PRESENT</span><span class=cF7>)</span><span class=cF0>)
<a name="l556"></a> </span><span class=cF6>&quot;Fun:%s\n&quot;</span><span class=cF0>,cc-&gt;htc.fun-&gt;str;
<a name="l557"></a> </span><span class=cF1>if</span><span class=cF0> (j&gt;</span><span class=cFB>cmp</span><span class=cF0>.num_reg_vars) {
<a name="l558"></a> l=0;
<a name="l559"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;j &amp;&amp; l&lt;</span><span class=cFB>cmp</span><span class=cF0>.num_non_ptr_vars;i++) </span><span class=cF7>{</span><span class=cF0>
<a name="l560"></a> tmpm=mv[i].m;
<a name="l561"></a> tmpc=</span><span class=cF5>OptClassFwd</span><span class=cF0>(tmpm-&gt;member_class);
<a name="l562"></a> </span><span class=cF1>if</span><span class=cF0> (!tmpc-&gt;ptr_stars_cnt &amp;&amp; !tmpm-&gt;dim.next) {
<a name="l563"></a> </span><span class=cF1>while</span><span class=cF0> (l&lt;</span><span class=cFB>cmp</span><span class=cF0>.num_non_ptr_vars &amp;&amp;
<a name="l564"></a> </span><span class=cF5>Bts</span><span class=cF7>(</span><span class=cF0>&amp;cc-&gt;htc.fun-&gt;used_reg_mask,</span><span class=cFB>cmp</span><span class=cF0>.non_ptr_vars_map[l]</span><span class=cF7>)</span><span class=cF0>)
<a name="l565"></a> l++;
<a name="l566"></a> </span><span class=cF1>if</span><span class=cF0> (l&lt;</span><span class=cFB>cmp</span><span class=cF0>.num_non_ptr_vars) </span><span class=cF7>{</span><span class=cF0>
<a name="l567"></a> tmpm-&gt;</span><span class=cF1>reg</span><span class=cF0>=</span><span class=cFB>cmp</span><span class=cF0>.non_ptr_vars_map[l++];
<a name="l568"></a> reg_offsets[tmpm-&gt;</span><span class=cF1>reg</span><span class=cF0>].</span><span class=cF1>offset</span><span class=cF0>=mv[i].offset_start;
<a name="l569"></a> reg_offsets[tmpm-&gt;</span><span class=cF1>reg</span><span class=cF0>].m=tmpm;
<a name="l570"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;cc-&gt;flags,</span><span class=cF3>CCf_PASS_TRACE_PRESENT</span><span class=cF7>)</span><span class=cF0>)
<a name="l571"></a> </span><span class=cF6>&quot;Reg %Z Var \&quot;%-15ts\&quot; %016X[RBP]\n&quot;</span><span class=cF0>,tmpm-&gt;</span><span class=cF1>reg</span><span class=cF0>,</span><span class=cF6>&quot;ST_U64_REGS&quot;</span><span class=cF0>,
<a name="l572"></a> tmpm-&gt;str,reg_offsets[tmpm-&gt;</span><span class=cF1>reg</span><span class=cF0>].</span><span class=cF1>offset</span><span class=cF0>;
<a name="l573"></a> mv[i].offset_start=0; </span><span class=cF2>//flag as reg var</span><span class=cF0>
<a name="l574"></a> </span><span class=cF1>if</span><span class=cF0> (tmpm-&gt;size&lt;8 &amp;&amp;
<a name="l575"></a> !</span><span class=cF5>StrIMatch</span><span class=cF7>(</span><span class=cF6>&quot;Bool&quot;</span><span class=cF0>,tmpm-&gt;member_class-&gt;str</span><span class=cF7>)</span><span class=cF0> &amp;&amp;
<a name="l576"></a> tmpm-&gt;member_class-&gt;type&amp;</span><span class=cF3>HTT_INTERNAL_TYPE</span><span class=cF0>)
<a name="l577"></a> </span><span class=cF5>PrintWarn</span><span class=cF0>(</span><span class=cF6>&quot;Using 64-bit reg var.\n &quot;</span><span class=cF0>
<a name="l578"></a> </span><span class=cF6>&quot;$LK,\&quot;FL:%s,%d\&quot;$ '%s' in '%s'\n&quot;</span><span class=cF0>,
<a name="l579"></a> cc-&gt;lex_include_stk-&gt;full_name,
<a name="l580"></a> cc-&gt;lex_include_stk-&gt;line_num,
<a name="l581"></a> tmpm-&gt;str,cc-&gt;htc.fun-&gt;str);
<a name="l582"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l583"></a> }
<a name="l584"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l585"></a> }
<a name="l586"></a> l=0;
<a name="l587"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i&lt;j &amp;&amp; l&lt;</span><span class=cFB>cmp</span><span class=cF0>.num_reg_vars;i++) {
<a name="l588"></a> tmpm=mv[i].m;
<a name="l589"></a></span><span class=cF2>//if not just flagged as reg var</span><span class=cF0>
<a name="l590"></a> </span><span class=cF1>if</span><span class=cF0> (mv[i].offset_start &amp;&amp; </span><span class=cF7>(</span><span class=cF0>!mv[i].m-&gt;dim.next||
<a name="l591"></a> tmpm-&gt;</span><span class=cF1>offset</span><span class=cF0>&gt;0 &amp;&amp; </span><span class=cF5>StrCmp</span><span class=cF0>(tmpm-&gt;str,</span><span class=cF6>&quot;argv&quot;</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
<a name="l592"></a> </span><span class=cF1>while</span><span class=cF0> (l&lt;</span><span class=cFB>cmp</span><span class=cF0>.num_reg_vars &amp;&amp;
<a name="l593"></a> </span><span class=cF5>Bts</span><span class=cF7>(</span><span class=cF0>&amp;cc-&gt;htc.fun-&gt;used_reg_mask,</span><span class=cFB>cmp</span><span class=cF0>.to_reg_vars_map[l]</span><span class=cF7>)</span><span class=cF0>)
<a name="l594"></a> l++;
<a name="l595"></a> </span><span class=cF1>if</span><span class=cF0> (l&lt;</span><span class=cFB>cmp</span><span class=cF0>.num_reg_vars) {
<a name="l596"></a> tmpm-&gt;</span><span class=cF1>reg</span><span class=cF0>=</span><span class=cFB>cmp</span><span class=cF0>.to_reg_vars_map[l++];
<a name="l597"></a> reg_offsets[tmpm-&gt;</span><span class=cF1>reg</span><span class=cF0>].</span><span class=cF1>offset</span><span class=cF0>=mv[i].offset_start;
<a name="l598"></a> reg_offsets[tmpm-&gt;</span><span class=cF1>reg</span><span class=cF0>].m=tmpm;
<a name="l599"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&amp;cc-&gt;flags,</span><span class=cF3>CCf_PASS_TRACE_PRESENT</span><span class=cF7>)</span><span class=cF0>)
<a name="l600"></a> </span><span class=cF6>&quot;Reg %Z Var \&quot;%-15ts\&quot; %016X[RBP]\n&quot;</span><span class=cF0>,tmpm-&gt;</span><span class=cF1>reg</span><span class=cF0>,</span><span class=cF6>&quot;ST_U64_REGS&quot;</span><span class=cF0>,
<a name="l601"></a> tmpm-&gt;str,reg_offsets[tmpm-&gt;</span><span class=cF1>reg</span><span class=cF0>].</span><span class=cF1>offset</span><span class=cF0>;
<a name="l602"></a> </span><span class=cF1>if</span><span class=cF0> (tmpm-&gt;size&lt;8 &amp;&amp;
<a name="l603"></a> !</span><span class=cF5>StrIMatch</span><span class=cF7>(</span><span class=cF6>&quot;Bool&quot;</span><span class=cF0>,tmpm-&gt;member_class-&gt;str</span><span class=cF7>)</span><span class=cF0> &amp;&amp;
<a name="l604"></a> tmpm-&gt;member_class-&gt;type&amp;</span><span class=cF3>HTT_INTERNAL_TYPE</span><span class=cF0>)
<a name="l605"></a> </span><span class=cF5>PrintWarn</span><span class=cF0>(</span><span class=cF6>&quot;Using 64-bit reg var.\n &quot;</span><span class=cF0>
<a name="l606"></a> </span><span class=cF6>&quot;$LK,\&quot;FL:%s,%d\&quot;$ '%s' in '%s'\n&quot;</span><span class=cF0>,
<a name="l607"></a> cc-&gt;lex_include_stk-&gt;full_name,
<a name="l608"></a> cc-&gt;lex_include_stk-&gt;line_num,
<a name="l609"></a> tmpm-&gt;str,cc-&gt;htc.fun-&gt;str);
<a name="l610"></a> }
<a name="l611"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l612"></a> }
<a name="l613"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l614"></a> }
<a name="l615"></a> </span><span class=cF5>Free</span><span class=cF0>(mv);
<a name="l616"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l617"></a> </span><span class=cF1>if</span><span class=cF0> (ps-&gt;ptr&gt;2) </span><span class=cF7>{</span><span class=cF0>
<a name="l618"></a> </span><span class=cF6>&quot;Pass:%d Stk:%08X\n&quot;</span><span class=cF0>,cc-&gt;pass,ps-&gt;ptr;
<a name="l619"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc,</span><span class=cF6>&quot;Compiler Optimization Error at &quot;</span><span class=cF0>);
<a name="l620"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l621"></a>}
<a name="l622"></a>
</span></pre></body>
</html>