mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-28 00:06:35 +00:00
93c19f3f1b
Add column headers to Rep functions. Change MEM_EXTRA_HASH2_PAGS to 1. (Revert this later if it causes bugs.)
722 lines
86 KiB
HTML
Executable file
722 lines
86 KiB
HTML
Executable file
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
|
|
<meta name="generator" content="ZealOS V1.04">
|
|
<style type="text/css">
|
|
body {background-color:#1f1f1f;}
|
|
.cF0{color:#e3e3e3;background-color:#1f1f1f;}
|
|
.cF1{color:#4f84a6;background-color:#1f1f1f;}
|
|
.cF2{color:#73a255;background-color:#1f1f1f;}
|
|
.cF3{color:#297582;background-color:#1f1f1f;}
|
|
.cF4{color:#b34f4b;background-color:#1f1f1f;}
|
|
.cF5{color:#8a52c3;background-color:#1f1f1f;}
|
|
.cF6{color:#b7822f;background-color:#1f1f1f;}
|
|
.cF7{color:#444444;background-color:#1f1f1f;}
|
|
.cF8{color:#6d6d6d;background-color:#1f1f1f;}
|
|
.cF9{color:#94bfde;background-color:#1f1f1f;}
|
|
.cFA{color:#a1ce97;background-color:#1f1f1f;}
|
|
.cFB{color:#6db4be;background-color:#1f1f1f;}
|
|
.cFC{color:#e88e88;background-color:#1f1f1f;}
|
|
.cFD{color:#ca94e8;background-color:#1f1f1f;}
|
|
.cFE{color:#d4b475;background-color:#1f1f1f;}
|
|
.cFF{color:#1f1f1f;background-color:#1f1f1f;}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<pre style="font-family:monospace;font-size:12pt">
|
|
<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>CCompCtrl</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, *tmpil1, *tmpil2;
|
|
<a name="l6"></a> </span><span class=cF9>I64</span><span class=cF0> code, i, j, l, member_count, used_reg_mask = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l7"></a> </span><span class=cF9>CMemberList</span><span class=cF0> *tmpm;
|
|
<a name="l8"></a> COptMemberVar *mv = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l9"></a> </span><span class=cF9>CAOT</span><span class=cF0> *tmpaot;
|
|
<a name="l10"></a> </span><span class=cF9>CAOTImportExport</span><span class=cF0> *tmpie;
|
|
<a name="l11"></a> </span><span class=cF9>CParseStack</span><span class=cF0> *ps = cc->ps;
|
|
<a name="l12"></a>
|
|
<a name="l13"></a> ps->ptr = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l14"></a> ps->ptr2 = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l15"></a>
|
|
<a name="l16"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < </span><span class=cF3>REG_REGS_NUM</span><span class=cF0>; i++)
|
|
<a name="l17"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l18"></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="l19"></a> reg_offsets[i].m = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l20"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l21"></a> </span><span class=cF1>if</span><span class=cF0> (cc->htc.fun)
|
|
<a name="l22"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l23"></a> member_count = cc->htc.fun->member_count;
|
|
<a name="l24"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&cc->htc.fun->flags, </span><span class=cF3>Ff_DOT_DOT_DOT</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l25"></a> member_count += </span><span class=cFE>2</span><span class=cF0>;
|
|
<a name="l26"></a> mv = </span><span class=cF5>CAlloc</span><span class=cF0>(member_count * </span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>COptMemberVar</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l27"></a> member_count = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l28"></a> tmpm = cc->htc.fun->member_list_and_root;
|
|
<a name="l29"></a> </span><span class=cF1>while</span><span class=cF0> (tmpm)
|
|
<a name="l30"></a> {
|
|
<a name="l31"></a> tmpc = </span><span class=cF5>OptClassFwd</span><span class=cF0>(tmpm->member_class);
|
|
<a name="l32"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFE>0</span><span class=cF0> <= tmpm-></span><span class=cF1>reg</span><span class=cF0> < </span><span class=cF3>REG_REGS_NUM</span><span class=cF0>)
|
|
<a name="l33"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l34"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bts</span><span class=cF7>(</span><span class=cF0>&used_reg_mask, tmpm-></span><span class=cF1>reg</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l35"></a> </span><span class=cF5>PrintWarn</span><span class=cF0>(</span><span class=cF6>"Reg in use\n $LK,\"FL:%s,%d\"$ '%s' in '%s'\n"</span><span class=cF0>,
|
|
<a name="l36"></a> cc->lex_include_stack->full_name,
|
|
<a name="l37"></a> cc->lex_include_stack->line_num, tmpm->str, cc->htc.fun->str);
|
|
<a name="l38"></a> reg_offsets[tmpm-></span><span class=cF1>reg</span><span class=cF0>].</span><span class=cF1>offset</span><span class=cF0> = tmpm-></span><span class=cF1>offset</span><span class=cF0>;
|
|
<a name="l39"></a> reg_offsets[tmpm-></span><span class=cF1>reg</span><span class=cF0>].m = tmpm;
|
|
<a name="l40"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l41"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmpc->raw_type != </span><span class=cF3>RT_F64</span><span class=cF0> && tmpm-></span><span class=cF1>reg</span><span class=cF0> != </span><span class=cF3>REG_NONE</span><span class=cF0> || tmpm-></span><span class=cF1>reg</span><span class=cF0> == </span><span class=cF3>REG_ALLOC</span><span class=cF0>)
|
|
<a name="l42"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l43"></a> </span><span class=cF1>if</span><span class=cF0> (tmpm-></span><span class=cF1>reg</span><span class=cF0> == </span><span class=cF3>REG_ALLOC</span><span class=cF0>)
|
|
<a name="l44"></a> mv[member_count].score = </span><span class=cF3>I64_MAX</span><span class=cF0> / </span><span class=cFE>2</span><span class=cF0>; </span><span class=cF2>//big but not too big</span><span class=cF0>
|
|
<a name="l45"></a> mv[member_count].offset_start = tmpm-></span><span class=cF1>offset</span><span class=cF0>;
|
|
<a name="l46"></a> mv[member_count].offset_end = tmpm-></span><span class=cF1>offset</span><span class=cF0> + </span><span class=cF5>MaxI64</span><span class=cF0>(</span><span class=cFE>1</span><span class=cF0>, tmpm->size);
|
|
<a name="l47"></a> mv[member_count++].m = tmpm;
|
|
<a name="l48"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l49"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmpm-></span><span class=cF1>reg</span><span class=cF0> == </span><span class=cF3>REG_ALLOC</span><span class=cF0>)
|
|
<a name="l50"></a> </span><span class=cF5>PrintWarn</span><span class=cF0>(</span><span class=cF6>"Can't reg variable\n $LK,\"FL:%s,%d\"$ '%s' in '%s'\n"</span><span class=cF0>,
|
|
<a name="l51"></a> cc->lex_include_stack->full_name,
|
|
<a name="l52"></a> cc->lex_include_stack->line_num, tmpm->str, cc->htc.fun->str);
|
|
<a name="l53"></a> tmpm = tmpm->next;
|
|
<a name="l54"></a> }
|
|
<a name="l55"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l56"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l57"></a> member_count = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l58"></a>
|
|
<a name="l59"></a> tmpi = cc->coc.coc_head.next;
|
|
<a name="l60"></a> </span><span class=cF1>while</span><span class=cF0> (code = tmpi->ic_code)
|
|
<a name="l61"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l62"></a> tmpi_next = tmpi->next;
|
|
<a name="l63"></a> </span><span class=cF1>if</span><span class=cF0> (code == </span><span class=cF3>IC_NOP1</span><span class=cF0>)
|
|
<a name="l64"></a> </span><span class=cFD>OptFree</span><span class=cF0>(tmpi);
|
|
<a name="l65"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l66"></a> {
|
|
<a name="l67"></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>)
|
|
<a name="l68"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l69"></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="l70"></a> tmpil2 = &</span><span class=cFB>cmp</span><span class=cF0>.ic_nop;
|
|
<a name="l71"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l72"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l73"></a> tmpil1 = tmpil2 = &</span><span class=cFB>cmp</span><span class=cF0>.ic_nop;
|
|
<a name="l74"></a> tmpc = tmpi->ic_class;
|
|
<a name="l75"></a> </span><span class=cF1>switch</span><span class=cF0> [</span><span class=cFD>intermediate_code_table</span><span class=cF0>[code].arg_count]
|
|
<a name="l76"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l77"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IS_V_ARG</span><span class=cF0>:
|
|
<a name="l78"></a> ps->ptr -= tmpi->ic_data >> </span><span class=cFE>3</span><span class=cF0>;
|
|
<a name="l79"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l80"></a>
|
|
<a name="l81"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IS_2_ARG</span><span class=cF0>:
|
|
<a name="l82"></a> tmpi2 = </span><span class=cFD>ParsePop</span><span class=cF0>(ps);
|
|
<a name="l83"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi2->ic_flags & </span><span class=cF3>ICF_RES_TO_F64</span><span class=cF0>)
|
|
<a name="l84"></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="l85"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmpi2->ic_flags & </span><span class=cF3>ICF_RES_TO_INT</span><span class=cF0>)
|
|
<a name="l86"></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="l87"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l88"></a> tmpc2 = tmpi->t.arg2_class;
|
|
<a name="l89"></a> tmpi->arg2.type = </span><span class=cF3>MDF_STACK</span><span class=cF0> + </span><span class=cFD>CompRawType</span><span class=cF0>(tmpc2);
|
|
<a name="l90"></a> tmpi->ic_flags |= </span><span class=cF3>ICF_ARG2_WAS_STACK</span><span class=cF0>;
|
|
<a name="l91"></a>
|
|
<a name="l92"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IS_1_ARG</span><span class=cF0>:
|
|
<a name="l93"></a> tmpi1 = </span><span class=cFD>ParsePop</span><span class=cF0>(ps);
|
|
<a name="l94"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi1->ic_flags & </span><span class=cF3>ICF_RES_TO_F64</span><span class=cF0>)
|
|
<a name="l95"></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="l96"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmpi1->ic_flags & </span><span class=cF3>ICF_RES_TO_INT</span><span class=cF0>)
|
|
<a name="l97"></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="l98"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l99"></a> tmpc1 = tmpi->t.arg1_class;
|
|
<a name="l100"></a> tmpi->arg1.type = </span><span class=cF3>MDF_STACK</span><span class=cF0> + </span><span class=cFD>CompRawType</span><span class=cF0>(tmpc1);
|
|
<a name="l101"></a> tmpi->arg1_type_pointed_to = </span><span class=cFD>CompRawTypePointed</span><span class=cF0>(tmpc1);
|
|
<a name="l102"></a> tmpi->ic_flags |= </span><span class=cF3>ICF_ARG1_WAS_STACK</span><span class=cF0>;
|
|
<a name="l103"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l104"></a>
|
|
<a name="l105"></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="l106"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l107"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l108"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFD>intermediate_code_table</span><span class=cF0>[code].res_count)
|
|
<a name="l109"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l110"></a> tmpi->res.type = </span><span class=cF3>MDF_STACK</span><span class=cF0> + </span><span class=cFD>CompRawType</span><span class=cF0>(tmpc);
|
|
<a name="l111"></a> tmpi->ic_flags |= </span><span class=cF3>ICF_RES_WAS_STACK</span><span class=cF0>;
|
|
<a name="l112"></a> </span><span class=cFD>ParsePush</span><span class=cF0>(ps, tmpi);
|
|
<a name="l113"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l114"></a> </span><span class=cF1>switch</span><span class=cF0> [code]
|
|
<a name="l115"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l116"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_IMM_F64</span><span class=cF0>:
|
|
<a name="l117"></a> tmpi->ic_flags &= ~</span><span class=cF3>ICF_RES_TO_F64</span><span class=cF0>;
|
|
<a name="l118"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi->ic_flags & </span><span class=cF3>ICF_RES_TO_INT</span><span class=cF0>)
|
|
<a name="l119"></a> {
|
|
<a name="l120"></a> tmpi->ic_data = </span><span class=cF5>ToI64</span><span class=cF0>(tmpi->ic_data</span><span class=cF7>(</span><span class=cF1>F64</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l121"></a> tmpi->ic_flags &= ~</span><span class=cF3>ICF_RES_TO_INT</span><span class=cF0>;
|
|
<a name="l122"></a> tmpi->ic_code = </span><span class=cF3>IC_IMM_I64</span><span class=cF0>;
|
|
<a name="l123"></a> }
|
|
<a name="l124"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l125"></a>
|
|
<a name="l126"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_IMM_I64</span><span class=cF0>:
|
|
<a name="l127"></a> tmpi->ic_flags &= ~</span><span class=cF3>ICF_RES_TO_INT</span><span class=cF0>;
|
|
<a name="l128"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi->ic_flags & </span><span class=cF3>ICF_RES_TO_F64</span><span class=cF0>)
|
|
<a name="l129"></a> {
|
|
<a name="l130"></a> tmpi->ic_data(</span><span class=cF1>F64</span><span class=cF0>) = </span><span class=cF5>ToF64</span><span class=cF0>(tmpi->ic_data);
|
|
<a name="l131"></a> tmpi->ic_flags &= ~</span><span class=cF3>ICF_RES_TO_F64</span><span class=cF0>;
|
|
<a name="l132"></a> tmpi->ic_code = </span><span class=cF3>IC_IMM_F64</span><span class=cF0>;
|
|
<a name="l133"></a> }
|
|
<a name="l134"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l135"></a>
|
|
<a name="l136"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_RBP</span><span class=cF0>:
|
|
<a name="l137"></a> tmpi->ic_code = </span><span class=cF3>IC_REG</span><span class=cF0>;
|
|
<a name="l138"></a> tmpi->arg1.</span><span class=cF1>reg</span><span class=cF0> = </span><span class=cF3>REG_RBP</span><span class=cF0>;
|
|
<a name="l139"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l140"></a>
|
|
<a name="l141"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_DEREF</span><span class=cF0>:
|
|
<a name="l142"></a> tmpi->arg1_type_pointed_to = tmpi->res.type.raw_type;
|
|
<a name="l143"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi1->ic_code == </span><span class=cF3>IC_LEA</span><span class=cF0>)
|
|
<a name="l144"></a> {
|
|
<a name="l145"></a> tmpi->ic_flags |= tmpi1->ic_flags;
|
|
<a name="l146"></a> tmpi->arg1.</span><span class=cF1>reg</span><span class=cF0> = tmpi1->arg1.</span><span class=cF1>reg</span><span class=cF0>;
|
|
<a name="l147"></a> tmpi->arg1.disp = tmpi1->arg1.disp;
|
|
<a name="l148"></a> tmpi->arg1.type = </span><span class=cF3>MDF_DISP</span><span class=cF0> + tmpi->res.type.raw_type;
|
|
<a name="l149"></a> tmpi->arg1_type_pointed_to = </span><span class=cFD>CompRawTypePointed</span><span class=cF0>(tmpc);
|
|
<a name="l150"></a> tmpi->ic_code = </span><span class=cF3>IC_MOV</span><span class=cF0>;
|
|
<a name="l151"></a> </span><span class=cFD>OptFree</span><span class=cF0>(tmpi1);
|
|
<a name="l152"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi->arg1.</span><span class=cF1>reg</span><span class=cF0> == </span><span class=cF3>REG_RBP</span><span class=cF0>)
|
|
<a name="l153"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < member_count; i++)
|
|
<a name="l154"></a> </span><span class=cF1>if</span><span class=cF0> (mv[i].offset_start == tmpi->arg1.disp)
|
|
<a name="l155"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l156"></a> mv[i].lea_balance--;
|
|
<a name="l157"></a> mv[i].score++;
|
|
<a name="l158"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l159"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l160"></a> }
|
|
<a name="l161"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmpil1->ic_code == </span><span class=cF3>IC_ADD_CONST</span><span class=cF0>)
|
|
<a name="l162"></a> {
|
|
<a name="l163"></a> </span><span class=cF1>if</span><span class=cF0> (tmpil2->ic_code == </span><span class=cF3>IC_REG</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l164"></a> tmpi->ic_flags |= tmpil2->ic_flags | tmpil1->ic_flags;
|
|
<a name="l165"></a> tmpi->arg1.</span><span class=cF1>reg</span><span class=cF0> = tmpil2->arg1.</span><span class=cF1>reg</span><span class=cF0>;
|
|
<a name="l166"></a> tmpi->arg1.disp = tmpi->ic_data;
|
|
<a name="l167"></a> tmpi->arg1.type = </span><span class=cF3>MDF_DISP</span><span class=cF0> + tmpi->res.type.raw_type;
|
|
<a name="l168"></a> tmpi->arg1_type_pointed_to = </span><span class=cFD>CompRawTypePointed</span><span class=cF0>(tmpc);
|
|
<a name="l169"></a> tmpi->ic_code = </span><span class=cF3>IC_MOV</span><span class=cF0>;
|
|
<a name="l170"></a> </span><span class=cFD>OptFree</span><span class=cF0>(tmpil2);
|
|
<a name="l171"></a> </span><span class=cFD>OptFree</span><span class=cF0>(tmpil1);
|
|
<a name="l172"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l173"></a> }
|
|
<a name="l174"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l175"></a>
|
|
<a name="l176"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC__PP</span><span class=cF0>:
|
|
<a name="l177"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC__MM</span><span class=cF0>:
|
|
<a name="l178"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_PP_</span><span class=cF0>:
|
|
<a name="l179"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MM_</span><span class=cF0>:
|
|
<a name="l180"></a> </span><span class=cFD>CompMinTypePointed</span><span class=cF0>(tmpi, </span><span class=cFD>CompRawTypePointed</span><span class=cF7>(</span><span class=cF0>tmpi->t.arg1_class</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l181"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_DEREF_PP</span><span class=cF0>:
|
|
<a name="l182"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_DEREF_MM</span><span class=cF0>:
|
|
<a name="l183"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi1->ic_code == </span><span class=cF3>IC_LEA</span><span class=cF0> && tmpi1->arg1.type & </span><span class=cF3>MDF_DISP</span><span class=cF0> && tmpi1->arg1.</span><span class=cF1>reg</span><span class=cF0> == </span><span class=cF3>REG_RBP</span><span class=cF0>)
|
|
<a name="l184"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < member_count; i++)
|
|
<a name="l185"></a> </span><span class=cF1>if</span><span class=cF0> (mv[i].offset_start == tmpi1->arg1.disp)
|
|
<a name="l186"></a> {
|
|
<a name="l187"></a> mv[i].lea_balance--;
|
|
<a name="l188"></a> mv[i].score++;
|
|
<a name="l189"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l190"></a> }
|
|
<a name="l191"></a> tmpi->arg1_type_pointed_to = tmpi->res.type.raw_type;
|
|
<a name="l192"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l193"></a>
|
|
<a name="l194"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MUL</span><span class=cF0>:
|
|
<a name="l195"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_DIV</span><span class=cF0>:
|
|
<a name="l196"></a> </span><span class=cF1>if</span><span class=cF0> (tmpc->raw_type == </span><span class=cF3>RT_F64</span><span class=cF0>)
|
|
<a name="l197"></a> {
|
|
<a name="l198"></a> </span><span class=cFD>CompF2PushPop</span><span class=cF0>(tmpi, tmpi1, tmpi2);
|
|
<a name="l199"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l200"></a> }
|
|
<a name="l201"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l202"></a>
|
|
<a name="l203"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ADD</span><span class=cF0>:
|
|
<a name="l204"></a> </span><span class=cF1>if</span><span class=cF0> (tmpc->raw_type == </span><span class=cF3>RT_F64</span><span class=cF0>)
|
|
<a name="l205"></a> {
|
|
<a name="l206"></a> </span><span class=cFD>CompF2PushPop</span><span class=cF0>(tmpi, tmpi1, tmpi2);
|
|
<a name="l207"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l208"></a> }
|
|
<a name="l209"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFD>OptFixupBinaryOp2</span><span class=cF7>(</span><span class=cF0>&tmpi1, &tmpi2</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l210"></a> {
|
|
<a name="l211"></a> tmpi->ic_flags |= tmpi1->ic_flags;
|
|
<a name="l212"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi->t.arg1_tree != tmpi2)
|
|
<a name="l213"></a> tmpi->t.arg1_class = tmpi->t.arg2_class;
|
|
<a name="l214"></a> tmpi->ic_data = tmpi1->ic_data;
|
|
<a name="l215"></a> tmpi->ic_code = </span><span class=cF3>IC_ADD_CONST</span><span class=cF0>;
|
|
<a name="l216"></a> tmpi->arg1_type_pointed_to = tmpi->res.type.raw_type;
|
|
<a name="l217"></a> tmpi->arg2.type = </span><span class=cF3>MDF_NULL</span><span class=cF0>;
|
|
<a name="l218"></a> </span><span class=cFD>OptFree</span><span class=cF0>(tmpi1);
|
|
<a name="l219"></a> </span><span class=cF1>if</span><span class=cF0> (tmpil2->ic_code == </span><span class=cF3>IC_REG</span><span class=cF0> && tmpil2->arg1.</span><span class=cF1>reg</span><span class=cF0> == </span><span class=cF3>REG_RBP</span><span class=cF0>)
|
|
<a name="l220"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l221"></a> tmpi->ic_flags |= tmpil2->ic_flags;
|
|
<a name="l222"></a> tmpi->ic_code = </span><span class=cF3>IC_LEA</span><span class=cF0>;
|
|
<a name="l223"></a> tmpi->arg1.</span><span class=cF1>reg</span><span class=cF0> = </span><span class=cF3>REG_RBP</span><span class=cF0>;
|
|
<a name="l224"></a> tmpi->arg1.type = </span><span class=cF3>MDF_DISP</span><span class=cF0> + tmpi->arg1.type.raw_type;
|
|
<a name="l225"></a> tmpi->arg1.disp = tmpi->ic_data;
|
|
<a name="l226"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < member_count; i++)
|
|
<a name="l227"></a> </span><span class=cF1>if</span><span class=cF0> (mv[i].offset_start <= tmpi->ic_data < mv[i].offset_end)
|
|
<a name="l228"></a> {
|
|
<a name="l229"></a> mv[i].lea_balance++;
|
|
<a name="l230"></a> mv[i].score++;
|
|
<a name="l231"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l232"></a> }
|
|
<a name="l233"></a> </span><span class=cFD>OptFree</span><span class=cF0>(tmpil2);
|
|
<a name="l234"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l235"></a> }
|
|
<a name="l236"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l237"></a>
|
|
<a name="l238"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SUB</span><span class=cF0>:
|
|
<a name="l239"></a> </span><span class=cF1>if</span><span class=cF0> (tmpc->raw_type == </span><span class=cF3>RT_F64</span><span class=cF0>)
|
|
<a name="l240"></a> {
|
|
<a name="l241"></a> </span><span class=cFD>CompF2PushPop</span><span class=cF0>(tmpi, tmpi1, tmpi2);
|
|
<a name="l242"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l243"></a> }
|
|
<a name="l244"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi2->ic_code == </span><span class=cF3>IC_IMM_I64</span><span class=cF0>)
|
|
<a name="l245"></a> {
|
|
<a name="l246"></a> tmpi->ic_flags |= tmpi2->ic_flags;
|
|
<a name="l247"></a> tmpi->ic_data = tmpi2->ic_data;
|
|
<a name="l248"></a> tmpi->ic_code = </span><span class=cF3>IC_SUB_CONST</span><span class=cF0>;
|
|
<a name="l249"></a> tmpi->arg2.type = </span><span class=cF3>MDF_NULL</span><span class=cF0>;
|
|
<a name="l250"></a> </span><span class=cFD>OptFree</span><span class=cF0>(tmpi2);
|
|
<a name="l251"></a> }
|
|
<a name="l252"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l253"></a>
|
|
<a name="l254"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_LESS</span><span class=cF0>:
|
|
<a name="l255"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_GREATER_EQU</span><span class=cF0>:
|
|
<a name="l256"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_GREATER</span><span class=cF0>:
|
|
<a name="l257"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_LESS_EQU</span><span class=cF0>:
|
|
<a name="l258"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi->ic_flags & </span><span class=cF3>ICF_USE_F64</span><span class=cF0>)
|
|
<a name="l259"></a> </span><span class=cFD>CompF2PushPop</span><span class=cF0>(tmpi, tmpi1, tmpi2);
|
|
<a name="l260"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l261"></a>
|
|
<a name="l262"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MUL_EQU</span><span class=cF0>:
|
|
<a name="l263"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_DIV_EQU</span><span class=cF0>:
|
|
<a name="l264"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ADD_EQU</span><span class=cF0>:
|
|
<a name="l265"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SUB_EQU</span><span class=cF0>:
|
|
<a name="l266"></a> </span><span class=cF1>if</span><span class=cF0> (tmpc->raw_type == </span><span class=cF3>RT_F64</span><span class=cF0>)
|
|
<a name="l267"></a> </span><span class=cFD>CompF1PushPop</span><span class=cF0>(tmpi, tmpi2);
|
|
<a name="l268"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ASSIGN_PP</span><span class=cF0>:
|
|
<a name="l269"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ASSIGN_MM</span><span class=cF0>:
|
|
<a name="l270"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ASSIGN</span><span class=cF0>:
|
|
<a name="l271"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SHL_EQU</span><span class=cF0>:
|
|
<a name="l272"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SHR_EQU</span><span class=cF0>:
|
|
<a name="l273"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MOD_EQU</span><span class=cF0>:
|
|
<a name="l274"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_AND_EQU</span><span class=cF0>:
|
|
<a name="l275"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_OR_EQU</span><span class=cF0>:
|
|
<a name="l276"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_XOR_EQU</span><span class=cF0>:
|
|
<a name="l277"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi1->ic_code == </span><span class=cF3>IC_LEA</span><span class=cF0> && tmpi1->arg1.type & </span><span class=cF3>MDF_DISP</span><span class=cF0> && tmpi1->arg1.</span><span class=cF1>reg</span><span class=cF0> == </span><span class=cF3>REG_RBP</span><span class=cF0>)
|
|
<a name="l278"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < member_count; i++)
|
|
<a name="l279"></a> </span><span class=cF1>if</span><span class=cF0> (mv[i].offset_start == tmpi1->arg1.disp)
|
|
<a name="l280"></a> {
|
|
<a name="l281"></a> mv[i].lea_balance--;
|
|
<a name="l282"></a> mv[i].score++;
|
|
<a name="l283"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l284"></a> }
|
|
<a name="l285"></a> tmpi->arg1_type_pointed_to = tmpi->res.type.raw_type;
|
|
<a name="l286"></a> </span><span class=cFD>CompMinTypePointed</span><span class=cF0>(tmpi, </span><span class=cFD>CompRawTypePointed</span><span class=cF7>(</span><span class=cF0>tmpi->t.arg1_class</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l287"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l288"></a>
|
|
<a name="l289"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_RETURN_VAL</span><span class=cF0>:
|
|
<a name="l290"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_RETURN_VAL2</span><span class=cF0>:
|
|
<a name="l291"></a> </span><span class=cF1>if</span><span class=cF0> (tmpc)
|
|
<a name="l292"></a> {
|
|
<a name="l293"></a> </span><span class=cF1>if</span><span class=cF0> (tmpc->raw_type == </span><span class=cF3>RT_F64</span><span class=cF0> && tmpil1->ic_class->raw_type != </span><span class=cF3>RT_F64</span><span class=cF0>)
|
|
<a name="l294"></a> tmpil1->ic_flags |= </span><span class=cF3>ICF_RES_TO_F64</span><span class=cF0>;
|
|
<a name="l295"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (tmpc->raw_type != </span><span class=cF3>RT_F64</span><span class=cF0> && tmpil1->ic_class->raw_type == </span><span class=cF3>RT_F64</span><span class=cF0>)
|
|
<a name="l296"></a> tmpil1->ic_flags |= </span><span class=cF3>ICF_RES_TO_INT</span><span class=cF0>;
|
|
<a name="l297"></a> }
|
|
<a name="l298"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l299"></a>
|
|
<a name="l300"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SQR</span><span class=cF0>:
|
|
<a name="l301"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ABS</span><span class=cF0>:
|
|
<a name="l302"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SQRT</span><span class=cF0>:
|
|
<a name="l303"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SIN</span><span class=cF0>:
|
|
<a name="l304"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_COS</span><span class=cF0>:
|
|
<a name="l305"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_TAN</span><span class=cF0>:
|
|
<a name="l306"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ATAN</span><span class=cF0>:
|
|
<a name="l307"></a> </span><span class=cF1>if</span><span class=cF0> (tmpc->raw_type == </span><span class=cF3>RT_F64</span><span class=cF0>)
|
|
<a name="l308"></a> </span><span class=cFD>CompF1PushPop</span><span class=cF0>(tmpi, tmpi1);
|
|
<a name="l309"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l310"></a>
|
|
<a name="l311"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_NOBOUND_SWITCH</span><span class=cF0>:
|
|
<a name="l312"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SWITCH</span><span class=cF0>:
|
|
<a name="l313"></a> lb = </span><span class=cFD>OptLabelFwd</span><span class=cF0>(tmpi->ic_data</span><span class=cF7>(</span><span class=cF9>CCodeMisc</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>-></span><span class=cF1>default</span><span class=cF0>);
|
|
<a name="l314"></a> lb->use_count++;
|
|
<a name="l315"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l316"></a>
|
|
<a name="l317"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ASM</span><span class=cF0>:
|
|
<a name="l318"></a> tmpaot = tmpi->ic_data;
|
|
<a name="l319"></a> tmpie = tmpaot->next_ie;
|
|
<a name="l320"></a> </span><span class=cF1>while</span><span class=cF0> (tmpie != &tmpaot->next_ie)
|
|
<a name="l321"></a> {
|
|
<a name="l322"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF3>IET_REL_I0</span><span class=cF0> <= tmpie->type <= </span><span class=cF3>IET_IMM_I64</span><span class=cF0> && tmpie->str && tmpie->flags & </span><span class=cF3>IEF_GOTO_LABEL</span><span class=cF0> &&
|
|
<a name="l323"></a> </span><span class=cF7>(</span><span class=cF0>lb = </span><span class=cFD>COCGoToLabelFind</span><span class=cF0>(cc, tmpie->str)</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l324"></a> lb->use_count++; </span><span class=cF2>//Prevent deadcode elimination.</span><span class=cF0>
|
|
<a name="l325"></a> tmpie = tmpie->next;
|
|
<a name="l326"></a> }
|
|
<a name="l327"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l328"></a>
|
|
<a name="l329"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_NOT_EQU</span><span class=cF0>:
|
|
<a name="l330"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_EQU_EQU</span><span class=cF0>:
|
|
<a name="l331"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>tmpi1->ic_code == </span><span class=cF3>IC_IMM_I64</span><span class=cF0> || tmpi1->ic_code == </span><span class=cF3>IC_IMM_F64</span><span class=cF7>)</span><span class=cF0> && !tmpi1->ic_data)
|
|
<a name="l332"></a> {
|
|
<a name="l333"></a> </span><span class=cFD>OptFree</span><span class=cF0>(tmpi1);
|
|
<a name="l334"></a> </span><span class=cF5>MemCopy</span><span class=cF0>(&tmpi->arg1, &tmpi->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="l335"></a> tmpi->arg2.type = </span><span class=cF3>MDF_NULL</span><span class=cF0>;
|
|
<a name="l336"></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="l337"></a> code = tmpi->ic_code = </span><span class=cF3>IC_BR_ZERO</span><span class=cF0>;
|
|
<a name="l338"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l339"></a> code = tmpi->ic_code = </span><span class=cF3>IC_BR_NOT_ZERO</span><span class=cF0>;
|
|
<a name="l340"></a> tmpi1 = tmpi2;
|
|
<a name="l341"></a> tmpc1 = tmpc2;
|
|
<a name="l342"></a> }
|
|
<a name="l343"></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->ic_code == </span><span class=cF3>IC_IMM_I64</span><span class=cF0> || tmpi2->ic_code == </span><span class=cF3>IC_IMM_F64</span><span class=cF7>)</span><span class=cF0> && !tmpi2->ic_data)
|
|
<a name="l344"></a> {
|
|
<a name="l345"></a> </span><span class=cFD>OptFree</span><span class=cF0>(tmpi2);
|
|
<a name="l346"></a> tmpi->arg2.type = </span><span class=cF3>MDF_NULL</span><span class=cF0>;
|
|
<a name="l347"></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="l348"></a> code = tmpi->ic_code = </span><span class=cF3>IC_BR_ZERO</span><span class=cF0>;
|
|
<a name="l349"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l350"></a> code = tmpi->ic_code = </span><span class=cF3>IC_BR_NOT_ZERO</span><span class=cF0>;
|
|
<a name="l351"></a> }
|
|
<a name="l352"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l353"></a> </span><span class=cF1>goto</span><span class=cF0> here1;
|
|
<a name="l354"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_ZERO</span><span class=cF0>:
|
|
<a name="l355"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_NOT_ZERO</span><span class=cF0>:
|
|
<a name="l356"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi1->ic_code == </span><span class=cF3>IC_IMM_I64</span><span class=cF0> || tmpi1->ic_code == </span><span class=cF3>IC_IMM_F64</span><span class=cF0>)
|
|
<a name="l357"></a> {
|
|
<a name="l358"></a> </span><span class=cF1>if</span><span class=cF0> (code == </span><span class=cF3>IC_BR_ZERO</span><span class=cF0> ^^ tmpi1->ic_data)
|
|
<a name="l359"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l360"></a> </span><span class=cFD>OptFree</span><span class=cF0>(tmpi1);
|
|
<a name="l361"></a> tmpi->arg1.type = </span><span class=cF3>MDF_NULL</span><span class=cF0>;
|
|
<a name="l362"></a> tmpi->ic_code = </span><span class=cF3>IC_JMP</span><span class=cF0>;
|
|
<a name="l363"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l364"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l365"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l366"></a> </span><span class=cFD>OptFree</span><span class=cF0>(tmpi1);
|
|
<a name="l367"></a> tmpi = </span><span class=cFD>OptFree</span><span class=cF0>(tmpi);
|
|
<a name="l368"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l369"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l370"></a> }
|
|
<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_AND_ZERO</span><span class=cF0>:
|
|
<a name="l373"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi1->ic_code == </span><span class=cF3>IC_IMM_I64</span><span class=cF0>)
|
|
<a name="l374"></a> {
|
|
<a name="l375"></a> i = </span><span class=cF5>Bsr</span><span class=cF0>(tmpi1->ic_data);
|
|
<a name="l376"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFE>0</span><span class=cF0> <= i == </span><span class=cF5>Bsf</span><span class=cF7>(</span><span class=cF0>tmpi1->ic_data</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l377"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l378"></a> tmpi1->ic_data = i;
|
|
<a name="l379"></a> tmpi->ic_flags |= </span><span class=cF3>ICF_BY_VAL</span><span class=cF0>;
|
|
<a name="l380"></a> tmpi->ic_code = </span><span class=cF3>IC_BR_NOT_BT</span><span class=cF0>;
|
|
<a name="l381"></a> </span><span class=cF1>goto</span><span class=cF0> here1;
|
|
<a name="l382"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l383"></a> }
|
|
<a name="l384"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi2->ic_code == </span><span class=cF3>IC_IMM_I64</span><span class=cF0>)
|
|
<a name="l385"></a> {
|
|
<a name="l386"></a> i = </span><span class=cF5>Bsr</span><span class=cF0>(tmpi2->ic_data);
|
|
<a name="l387"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFE>0</span><span class=cF0> <= i == </span><span class=cF5>Bsf</span><span class=cF7>(</span><span class=cF0>tmpi2->ic_data</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l388"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l389"></a> tmpi2->ic_data = i;
|
|
<a name="l390"></a> tmpi->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="l391"></a> tmpi->ic_code = </span><span class=cF3>IC_BR_NOT_BT</span><span class=cF0>;
|
|
<a name="l392"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l393"></a> }
|
|
<a name="l394"></a> </span><span class=cF1>goto</span><span class=cF0> here1;
|
|
<a name="l395"></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="l396"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi1->ic_code == </span><span class=cF3>IC_IMM_I64</span><span class=cF0>)
|
|
<a name="l397"></a> {
|
|
<a name="l398"></a> i = </span><span class=cF5>Bsr</span><span class=cF0>(tmpi1->ic_data);
|
|
<a name="l399"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFE>0</span><span class=cF0> <= i == </span><span class=cF5>Bsf</span><span class=cF7>(</span><span class=cF0>tmpi1->ic_data</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l400"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l401"></a> tmpi1->ic_data = i;
|
|
<a name="l402"></a> tmpi->ic_flags |= </span><span class=cF3>ICF_BY_VAL</span><span class=cF0>;
|
|
<a name="l403"></a> tmpi->ic_code = </span><span class=cF3>IC_BR_BT</span><span class=cF0>;
|
|
<a name="l404"></a> </span><span class=cF1>goto</span><span class=cF0> here1;
|
|
<a name="l405"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l406"></a> }
|
|
<a name="l407"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi2->ic_code == </span><span class=cF3>IC_IMM_I64</span><span class=cF0>)
|
|
<a name="l408"></a> {
|
|
<a name="l409"></a> i = </span><span class=cF5>Bsr</span><span class=cF0>(tmpi2->ic_data);
|
|
<a name="l410"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFE>0</span><span class=cF0> <= i == </span><span class=cF5>Bsf</span><span class=cF7>(</span><span class=cF0>tmpi2->ic_data</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l411"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l412"></a> tmpi2->ic_data = i;
|
|
<a name="l413"></a> tmpi->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="l414"></a> tmpi->ic_code = </span><span class=cF3>IC_BR_BT</span><span class=cF0>;
|
|
<a name="l415"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l416"></a> }
|
|
<a name="l417"></a> </span><span class=cF1>goto</span><span class=cF0> here1;
|
|
<a name="l418"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_MM_ZERO</span><span class=cF0>:
|
|
<a name="l419"></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="l420"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi1->ic_code == </span><span class=cF3>IC_LEA</span><span class=cF0> && tmpi1->arg1.type & </span><span class=cF3>MDF_DISP</span><span class=cF0> && tmpi1->arg1.</span><span class=cF1>reg</span><span class=cF0> == </span><span class=cF3>REG_RBP</span><span class=cF0>)
|
|
<a name="l421"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < member_count; i++)
|
|
<a name="l422"></a> </span><span class=cF1>if</span><span class=cF0> (mv[i].offset_start == tmpi1->arg1.disp)
|
|
<a name="l423"></a> {
|
|
<a name="l424"></a> mv[i].lea_balance--;
|
|
<a name="l425"></a> mv[i].score++;
|
|
<a name="l426"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l427"></a> }
|
|
<a name="l428"></a> tmpi->arg1_type_pointed_to = </span><span class=cFD>CompRawType</span><span class=cF0>(tmpc);
|
|
<a name="l429"></a> </span><span class=cF1>goto</span><span class=cF0> here1;
|
|
<a name="l430"></a>
|
|
<a name="l431"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_LESS</span><span class=cF0>:
|
|
<a name="l432"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_GREATER_EQU</span><span class=cF0>:
|
|
<a name="l433"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_GREATER</span><span class=cF0>:
|
|
<a name="l434"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_LESS_EQU</span><span class=cF0>:
|
|
<a name="l435"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi->ic_flags & </span><span class=cF3>ICF_USE_F64</span><span class=cF0>)
|
|
<a name="l436"></a> </span><span class=cFD>CompF2PushPop</span><span class=cF0>(tmpi, tmpi1, tmpi2);
|
|
<a name="l437"></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="l438"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_CARRY</span><span class=cF0>:
|
|
<a name="l439"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_NOT_CARRY</span><span class=cF0>:
|
|
<a name="l440"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_GET_LABEL</span><span class=cF0>:
|
|
<a name="l441"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_BT</span><span class=cF0>:
|
|
<a name="l442"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_BTS</span><span class=cF0>:
|
|
<a name="l443"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_BTR</span><span class=cF0>:
|
|
<a name="l444"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_BTC</span><span class=cF0>:
|
|
<a name="l445"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_NOT_BT</span><span class=cF0>:
|
|
<a name="l446"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_NOT_BTS</span><span class=cF0>:
|
|
<a name="l447"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_NOT_BTR</span><span class=cF0>:
|
|
<a name="l448"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BR_NOT_BTC</span><span class=cF0>:
|
|
<a name="l449"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_JMP</span><span class=cF0>:
|
|
<a name="l450"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SUB_CALL</span><span class=cF0>:
|
|
<a name="l451"></a>here1:
|
|
<a name="l452"></a> </span><span class=cF1>if</span><span class=cF0> (tmpi->ic_flags & </span><span class=cF3>ICF_PUSH_CMP</span><span class=cF0>)
|
|
<a name="l453"></a> lb = tmpi->ic_data;
|
|
<a name="l454"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l455"></a> lb = </span><span class=cFD>OptLabelFwd</span><span class=cF0>(tmpi->ic_data);
|
|
<a name="l456"></a> lb->use_count++;
|
|
<a name="l457"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l458"></a>
|
|
<a name="l459"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_NOP1</span><span class=cF0>:
|
|
<a name="l460"></a> tmpi = </span><span class=cFD>OptFree</span><span class=cF0>(tmpi);
|
|
<a name="l461"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l462"></a>
|
|
<a name="l463"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_NOP2</span><span class=cF0>:
|
|
<a name="l464"></a> ps->ptr += tmpi->ic_data;
|
|
<a name="l465"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l466"></a>
|
|
<a name="l467"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SHL_CONST</span><span class=cF0>:
|
|
<a name="l468"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SHR_CONST</span><span class=cF0>:
|
|
<a name="l469"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ENTER</span><span class=cF0>:
|
|
<a name="l470"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ADD_RSP</span><span class=cF0>:
|
|
<a name="l471"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ADD_RSP1</span><span class=cF0>:
|
|
<a name="l472"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_CALL</span><span class=cF0>:
|
|
<a name="l473"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_CALL_INDIRECT</span><span class=cF0>:
|
|
<a name="l474"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_CALL_INDIRECT2</span><span class=cF0>:
|
|
<a name="l475"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_CALL_EXTERN</span><span class=cF0>:
|
|
<a name="l476"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_CALL_IMPORT</span><span class=cF0>:
|
|
<a name="l477"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_PUSH</span><span class=cF0>:
|
|
<a name="l478"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_POP</span><span class=cF0>:
|
|
<a name="l479"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_INVLPG</span><span class=cF0>:
|
|
<a name="l480"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_CLFLUSH</span><span class=cF0>:
|
|
<a name="l481"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_RFLAGS_GET</span><span class=cF0>:
|
|
<a name="l482"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_CARRY</span><span class=cF0>:
|
|
<a name="l483"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_RDTSC</span><span class=cF0>:
|
|
<a name="l484"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_RFLAGS_SET</span><span class=cF0>:
|
|
<a name="l485"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_RBP_GET</span><span class=cF0>:
|
|
<a name="l486"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_RBP_SET</span><span class=cF0>:
|
|
<a name="l487"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_RSP_GET</span><span class=cF0>:
|
|
<a name="l488"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_RAX_GET</span><span class=cF0>:
|
|
<a name="l489"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_RSP_SET</span><span class=cF0>:
|
|
<a name="l490"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_RAX_SET</span><span class=cF0>:
|
|
<a name="l491"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ABS_ADDR</span><span class=cF0>:
|
|
<a name="l492"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_HEAP_GLOBAL</span><span class=cF0>:
|
|
<a name="l493"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ADDR_IMPORT</span><span class=cF0>:
|
|
<a name="l494"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_TYPE</span><span class=cF0>:
|
|
<a name="l495"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BT</span><span class=cF0>:
|
|
<a name="l496"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BTS</span><span class=cF0>:
|
|
<a name="l497"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BTR</span><span class=cF0>:
|
|
<a name="l498"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BTC</span><span class=cF0>:
|
|
<a name="l499"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_LBTS</span><span class=cF0>:
|
|
<a name="l500"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_LBTR</span><span class=cF0>:
|
|
<a name="l501"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_LBTC</span><span class=cF0>:
|
|
<a name="l502"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BSF</span><span class=cF0>:
|
|
<a name="l503"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_BSR</span><span class=cF0>:
|
|
<a name="l504"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_POPCNT</span><span class=cF0>:
|
|
<a name="l505"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SIGN_I64</span><span class=cF0>:
|
|
<a name="l506"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_TOUPPER</span><span class=cF0>:
|
|
<a name="l507"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_TO_I64</span><span class=cF0>:
|
|
<a name="l508"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_TO_F64</span><span class=cF0>:
|
|
<a name="l509"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_TO_BOOL</span><span class=cF0>:
|
|
<a name="l510"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ABS_I64</span><span class=cF0>:
|
|
<a name="l511"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MIN_I64</span><span class=cF0>:
|
|
<a name="l512"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MAX_I64</span><span class=cF0>:
|
|
<a name="l513"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MIN_U64</span><span class=cF0>:
|
|
<a name="l514"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MAX_U64</span><span class=cF0>:
|
|
<a name="l515"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MOD_U64</span><span class=cF0>:
|
|
<a name="l516"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SQR_I64</span><span class=cF0>:
|
|
<a name="l517"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SQR_U64</span><span class=cF0>:
|
|
<a name="l518"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SWAP_U8</span><span class=cF0>:
|
|
<a name="l519"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SWAP_U16</span><span class=cF0>:
|
|
<a name="l520"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SWAP_U32</span><span class=cF0>:
|
|
<a name="l521"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SWAP_I64</span><span class=cF0>:
|
|
<a name="l522"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_QUEUE_INIT</span><span class=cF0>:
|
|
<a name="l523"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_QUEUE_INSERT</span><span class=cF0>:
|
|
<a name="l524"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_QUEUE_INSERT_REV</span><span class=cF0>:
|
|
<a name="l525"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_QUEUE_REMOVE</span><span class=cF0>:
|
|
<a name="l526"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_IN_U32</span><span class=cF0>:
|
|
<a name="l527"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_IN_U16</span><span class=cF0>:
|
|
<a name="l528"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_IN_U8</span><span class=cF0>:
|
|
<a name="l529"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_STRLEN</span><span class=cF0>:
|
|
<a name="l530"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_OUT_U32</span><span class=cF0>:
|
|
<a name="l531"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_OUT_U16</span><span class=cF0>:
|
|
<a name="l532"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_OUT_U8</span><span class=cF0>:
|
|
<a name="l533"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_STR_CONST</span><span class=cF0>:
|
|
<a name="l534"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_FS</span><span class=cF0>:
|
|
<a name="l535"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_GS</span><span class=cF0>:
|
|
<a name="l536"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MOV_FS</span><span class=cF0>:
|
|
<a name="l537"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MOV_GS</span><span class=cF0>:
|
|
<a name="l538"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_RIP</span><span class=cF0>:
|
|
<a name="l539"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_PUSH_CMP</span><span class=cF0>:
|
|
<a name="l540"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_REG</span><span class=cF0>:
|
|
<a name="l541"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_COM</span><span class=cF0>:
|
|
<a name="l542"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_HOLYC_TYPECAST</span><span class=cF0>:
|
|
<a name="l543"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_NOT</span><span class=cF0>:
|
|
<a name="l544"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_UNARY_MINUS</span><span class=cF0>:
|
|
<a name="l545"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_POWER</span><span class=cF0>:
|
|
<a name="l546"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SHL</span><span class=cF0>:
|
|
<a name="l547"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_SHR</span><span class=cF0>:
|
|
<a name="l548"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_MOD</span><span class=cF0>:
|
|
<a name="l549"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_AND</span><span class=cF0>:
|
|
<a name="l550"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_OR</span><span class=cF0>:
|
|
<a name="l551"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_XOR</span><span class=cF0>:
|
|
<a name="l552"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_EQU_EQU</span><span class=cF0>:
|
|
<a name="l553"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_NOT_EQU</span><span class=cF0>:
|
|
<a name="l554"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_AND_AND</span><span class=cF0>:
|
|
<a name="l555"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_OR_OR</span><span class=cF0>:
|
|
<a name="l556"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_XOR_XOR</span><span class=cF0>:
|
|
<a name="l557"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_LEAVE</span><span class=cF0>:
|
|
<a name="l558"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_RET</span><span class=cF0>:
|
|
<a name="l559"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_ADDR</span><span class=cF0>:
|
|
<a name="l560"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_END</span><span class=cF0>:
|
|
<a name="l561"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_END_EXP</span><span class=cF0>:
|
|
<a name="l562"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_CALL_END</span><span class=cF0>:
|
|
<a name="l563"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_CALL_END2</span><span class=cF0>:
|
|
<a name="l564"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_CALL_START</span><span class=cF0>:
|
|
<a name="l565"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_PUSH_REGS</span><span class=cF0>:
|
|
<a name="l566"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_POP_REGS</span><span class=cF0>:
|
|
<a name="l567"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>IC_LABEL</span><span class=cF0>:
|
|
<a name="l568"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l569"></a>
|
|
<a name="l570"></a> </span><span class=cF1>default</span><span class=cF0>:
|
|
<a name="l571"></a> </span><span class=cF6>"Pass:%d Missing IC handler\n"</span><span class=cF0>, cc->pass;
|
|
<a name="l572"></a> </span><span class=cFD>ICPut</span><span class=cF0>(cc, tmpi);
|
|
<a name="l573"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc,</span><span class=cF6>"Compiler Optimization Error at "</span><span class=cF0>);
|
|
<a name="l574"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l575"></a> }
|
|
<a name="l576"></a> tmpi = tmpi_next;
|
|
<a name="l577"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l578"></a></span><span class=cF2>/* REGISTER VARIABLE ASSIGNMENT</span><span class=cF0>
|
|
<a name="l579"></a>
|
|
<a name="l580"></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="l581"></a></span><span class=cF2>which variables should be assigned to register variables.</span><span class=cF0>
|
|
<a name="l582"></a>
|
|
<a name="l583"></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="l584"></a></span><span class=cF2>the times the offset is dereferenced. If the address was calculated more times</span><span class=cF0>
|
|
<a name="l585"></a></span><span class=cF2>than the offset was dereferenced, the variable's address was passed or assigned</span><span class=cF0>
|
|
<a name="l586"></a></span><span class=cF2>and we cannot use a register because you can't take address of a register variable.</span><span class=cF0>
|
|
<a name="l587"></a>
|
|
<a name="l588"></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="l589"></a></span><span class=cF2>RAX and R8 links intermediate codes together. R9 is used for stack machine</span><span class=cF0>
|
|
<a name="l590"></a></span><span class=cF2>temporaries. RBP is used as stack frame.</span><span class=cF0>
|
|
<a name="l591"></a>
|
|
<a name="l592"></a></span><span class=cF2>RSI, RDI, R10, R11, R12, R13, R14, R15 are used for register variables.</span><span class=cF0>
|
|
<a name="l593"></a></span><span class=cF2>R12 and R13, however, have a unusual ModR addressing mode in the x86_64 architecture,</span><span class=cF0>
|
|
<a name="l594"></a></span><span class=cF2>so we only use R12 and R13 as non-pointer register variables, such as index variables i, j, k.</span><span class=cF0>
|
|
<a name="l595"></a>
|
|
<a name="l596"></a></span><span class=cF2>*/</span><span class=cF0>
|
|
<a name="l597"></a> </span><span class=cF1>if</span><span class=cF0> (cc->htc.fun)
|
|
<a name="l598"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l599"></a> cc->htc.fun->used_reg_mask = cc->htc.fun->used_reg_mask &
|
|
<a name="l600"></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="l601"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&cc->opts, </span><span class=cF3>OPTf_NO_REG_VAR</span><span class=cF7>)</span><span class=cF0> && !</span><span class=cF7>(</span><span class=cF0>cc->flags & </span><span class=cF3>CCF_NO_REG_OPT</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l602"></a> {
|
|
<a name="l603"></a> </span><span class=cF5>QuickSort</span><span class=cF0>(mv, member_count, </span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>COptMemberVar</span><span class=cF7>)</span><span class=cF0>, &</span><span class=cFD>OptMVCompare</span><span class=cF0>);
|
|
<a name="l604"></a> </span><span class=cF1>while</span><span class=cF0> (member_count && !mv[member_count - </span><span class=cFE>1</span><span class=cF0>].score)
|
|
<a name="l605"></a> member_count--;
|
|
<a name="l606"></a> j = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l607"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < member_count; i++)
|
|
<a name="l608"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l609"></a> </span><span class=cF1>if</span><span class=cF0> (!mv[i].lea_balance && mv[i].offset_start)
|
|
<a name="l610"></a> {</span><span class=cF2>//addr operator cancels</span><span class=cF0>
|
|
<a name="l611"></a> mv[j].m = mv[i].m;
|
|
<a name="l612"></a> mv[j].offset_start = mv[i].offset_start;
|
|
<a name="l613"></a> mv[j++].offset_end = mv[i].offset_end;
|
|
<a name="l614"></a> }
|
|
<a name="l615"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l616"></a> {
|
|
<a name="l617"></a> </span><span class=cF1>if</span><span class=cF0> (mv[i].m-></span><span class=cF1>reg</span><span class=cF0> == </span><span class=cF3>REG_ALLOC</span><span class=cF0>)
|
|
<a name="l618"></a> </span><span class=cF5>PrintWarn</span><span class=cF0>(</span><span class=cF6>"Can't reg variable\n $LK,\"FL:%s,%d\"$ '%s' in '%s'\n"</span><span class=cF0>,
|
|
<a name="l619"></a> cc->lex_include_stack->full_name,
|
|
<a name="l620"></a> cc->lex_include_stack->line_num, mv[i].m->str, cc->htc.fun->str);
|
|
<a name="l621"></a> }
|
|
<a name="l622"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l623"></a> </span><span class=cF1>if</span><span class=cF0> (j > </span><span class=cFE>0</span><span class=cF0>)
|
|
<a name="l624"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l625"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&cc->flags, </span><span class=cF3>CCf_PASS_TRACE_PRESENT</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l626"></a> </span><span class=cF6>"Fun:%s\n"</span><span class=cF0>, cc->htc.fun->str;
|
|
<a name="l627"></a> </span><span class=cF1>if</span><span class=cF0> (j > </span><span class=cFB>cmp</span><span class=cF0>.num_reg_vars)
|
|
<a name="l628"></a> {
|
|
<a name="l629"></a> l = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l630"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < j && l < </span><span class=cFB>cmp</span><span class=cF0>.num_non_ptr_vars; i++)
|
|
<a name="l631"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l632"></a> tmpm = mv[i].m;
|
|
<a name="l633"></a> tmpc = </span><span class=cF5>OptClassFwd</span><span class=cF0>(tmpm->member_class);
|
|
<a name="l634"></a> </span><span class=cF1>if</span><span class=cF0> (!tmpc->ptr_stars_count && !tmpm->dim.next)
|
|
<a name="l635"></a> {
|
|
<a name="l636"></a> </span><span class=cF1>while</span><span class=cF0> (l < </span><span class=cFB>cmp</span><span class=cF0>.num_non_ptr_vars && </span><span class=cF5>Bts</span><span class=cF7>(</span><span class=cF0>&cc->htc.fun->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="l637"></a> l++;
|
|
<a name="l638"></a> </span><span class=cF1>if</span><span class=cF0> (l < </span><span class=cFB>cmp</span><span class=cF0>.num_non_ptr_vars)
|
|
<a name="l639"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l640"></a> tmpm-></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="l641"></a> reg_offsets[tmpm-></span><span class=cF1>reg</span><span class=cF0>].</span><span class=cF1>offset</span><span class=cF0> = mv[i].offset_start;
|
|
<a name="l642"></a> reg_offsets[tmpm-></span><span class=cF1>reg</span><span class=cF0>].m = tmpm;
|
|
<a name="l643"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&cc->flags, </span><span class=cF3>CCf_PASS_TRACE_PRESENT</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l644"></a> </span><span class=cF6>"Reg %Z Var \"%-15ts\" %016X[RBP]\n"</span><span class=cF0>, tmpm-></span><span class=cF1>reg</span><span class=cF0>, </span><span class=cF6>"ST_U64_REGS"</span><span class=cF0>,
|
|
<a name="l645"></a> tmpm->str, reg_offsets[tmpm-></span><span class=cF1>reg</span><span class=cF0>].</span><span class=cF1>offset</span><span class=cF0>;
|
|
<a name="l646"></a> mv[i].offset_start = </span><span class=cFE>0</span><span class=cF0>; </span><span class=cF2>//flag as register variable</span><span class=cF0>
|
|
<a name="l647"></a> </span><span class=cF1>if</span><span class=cF0> (tmpm->size < </span><span class=cFE>8</span><span class=cF0> && !</span><span class=cF5>StrIMatch</span><span class=cF7>(</span><span class=cF6>"Bool"</span><span class=cF0>, tmpm->member_class->str</span><span class=cF7>)</span><span class=cF0> &&
|
|
<a name="l648"></a> tmpm->member_class->type & </span><span class=cF3>HTT_INTERNAL_TYPE</span><span class=cF0>)
|
|
<a name="l649"></a> </span><span class=cF5>PrintWarn</span><span class=cF0>(</span><span class=cF6>"Using 64-bit reg variable.\n "</span><span class=cF0>
|
|
<a name="l650"></a> </span><span class=cF6>"$LK,\"FL:%s,%d\"$ '%s' in '%s'\n"</span><span class=cF0>,
|
|
<a name="l651"></a> cc->lex_include_stack->full_name,
|
|
<a name="l652"></a> cc->lex_include_stack->line_num, tmpm->str, cc->htc.fun->str);
|
|
<a name="l653"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l654"></a> }
|
|
<a name="l655"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l656"></a> }
|
|
<a name="l657"></a> l = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l658"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < j && l < </span><span class=cFB>cmp</span><span class=cF0>.num_reg_vars;i++)
|
|
<a name="l659"></a> {
|
|
<a name="l660"></a> tmpm = mv[i].m;
|
|
<a name="l661"></a></span><span class=cF2>//if not just flagged as register variable</span><span class=cF0>
|
|
<a name="l662"></a> </span><span class=cF1>if</span><span class=cF0> (mv[i].offset_start && </span><span class=cF7>(</span><span class=cF0>!mv[i].m->dim.next || tmpm-></span><span class=cF1>offset</span><span class=cF0> > </span><span class=cFE>0</span><span class=cF0> && </span><span class=cF5>StrCompare</span><span class=cF0>(tmpm->str, </span><span class=cF6>"argv"</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l663"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l664"></a> </span><span class=cF1>while</span><span class=cF0> (l < </span><span class=cFB>cmp</span><span class=cF0>.num_reg_vars && </span><span class=cF5>Bts</span><span class=cF7>(</span><span class=cF0>&cc->htc.fun->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="l665"></a> l++;
|
|
<a name="l666"></a> </span><span class=cF1>if</span><span class=cF0> (l < </span><span class=cFB>cmp</span><span class=cF0>.num_reg_vars)
|
|
<a name="l667"></a> {
|
|
<a name="l668"></a> tmpm-></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="l669"></a> reg_offsets[tmpm-></span><span class=cF1>reg</span><span class=cF0>].</span><span class=cF1>offset</span><span class=cF0> = mv[i].offset_start;
|
|
<a name="l670"></a> reg_offsets[tmpm-></span><span class=cF1>reg</span><span class=cF0>].m = tmpm;
|
|
<a name="l671"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&cc->flags, </span><span class=cF3>CCf_PASS_TRACE_PRESENT</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l672"></a> </span><span class=cF6>"Reg %Z Var \"%-15ts\" %016X[RBP]\n"</span><span class=cF0>,tmpm-></span><span class=cF1>reg</span><span class=cF0>,</span><span class=cF6>"ST_U64_REGS"</span><span class=cF0>,
|
|
<a name="l673"></a> tmpm->str, reg_offsets[tmpm-></span><span class=cF1>reg</span><span class=cF0>].</span><span class=cF1>offset</span><span class=cF0>;
|
|
<a name="l674"></a> </span><span class=cF1>if</span><span class=cF0> (tmpm->size < </span><span class=cFE>8</span><span class=cF0> && !</span><span class=cF5>StrIMatch</span><span class=cF7>(</span><span class=cF6>"Bool"</span><span class=cF0>, tmpm->member_class->str</span><span class=cF7>)</span><span class=cF0> &&
|
|
<a name="l675"></a> tmpm->member_class->type & </span><span class=cF3>HTT_INTERNAL_TYPE</span><span class=cF0>)
|
|
<a name="l676"></a> </span><span class=cF5>PrintWarn</span><span class=cF0>(</span><span class=cF6>"Using 64-bit reg variable.\n "</span><span class=cF0>
|
|
<a name="l677"></a> </span><span class=cF6>"$LK,\"FL:%s,%d\"$ '%s' in '%s'\n"</span><span class=cF0>,
|
|
<a name="l678"></a> cc->lex_include_stack->full_name,
|
|
<a name="l679"></a> cc->lex_include_stack->line_num, tmpm->str, cc->htc.fun->str);
|
|
<a name="l680"></a> }
|
|
<a name="l681"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l682"></a> }
|
|
<a name="l683"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l684"></a> }
|
|
<a name="l685"></a> </span><span class=cF5>Free</span><span class=cF0>(mv);
|
|
<a name="l686"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l687"></a> </span><span class=cF1>if</span><span class=cF0> (ps->ptr > </span><span class=cFE>2</span><span class=cF0>)
|
|
<a name="l688"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l689"></a> </span><span class=cF6>"Pass:%d Stack:%08X\n"</span><span class=cF0>, cc->pass, ps->ptr;
|
|
<a name="l690"></a> </span><span class=cF5>LexExcept</span><span class=cF0>(cc, </span><span class=cF6>"Compiler Optimization Error at "</span><span class=cF0>);
|
|
<a name="l691"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l692"></a>}
|
|
<a name="l693"></a>
|
|
</span></pre></body>
|
|
</html>
|