Mercurial > hg > Papers > 2011 > nobu-prosym
diff presen/index.html @ 83:07c5304622ac
modify
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 07 Jan 2012 08:27:46 +0900 |
parents | efe2e6806c26 |
children | fb5994f49abd |
line wrap: on
line diff
--- a/presen/index.html Wed Jan 04 23:44:40 2012 +0900 +++ b/presen/index.html Sat Jan 07 08:27:46 2012 +0900 @@ -112,6 +112,14 @@ <li>本研究ではCbCコンパイラをGCC-4.6へとアップデートを行った。 </li> </div> <!-- PAGE --> +<!-- + <div class=""> + <h1>先行研究</h1> + <li>Continuation based c コン パイラの gcc-4.2 による実装</li> + <li></li> + </div> +--> + <!-- PAGE --> <div class="slide"> <h1>発表内容</h1> <ol> @@ -400,18 +408,7 @@ if ( c_parser_next_token_is (parser, CPP_NAME) && c_parser_peek_2nd_token (parser)->type == CPP_SEMICOLON ) { - stmt = c_finish_goto_label (loc, - c_parser_peek_token (parser)->value); - c_parser_consume_token (parser); - } - else if (c_parser_next_token_is (parser, CPP_MULT)) - { - tree val; - - c_parser_consume_token (parser); - val = c_parser_expression (parser).value; - mark_exp_read (val); - stmt = c_finish_goto_ptr (loc, val); + : } #ifndef noCbC else @@ -572,9 +569,9 @@ <ul> <li>expand_call関数</li> <ul> - <li>Treeで表された関数からRTLを生成する関数</li> + <li>SSAへの変換を終えたGIMPLEからとり出されたCALL_EXPREのTreeからRTLを生成する関数</li> <li>スタックの領域確保、引数の格納、関数へのcall命令の発行が行わる。</li> - <li>try_taill_call(変数名)フラグがあり、末尾除去の条件に合わなければこのフラグが落とされる。</li> + <li>try_taill_call(局所変数)フラグがあり、末尾除去の条件に合わなければこのフラグが落とされる。</li> </ul> <li class="incremental">具体的な実装内容</li> <ul> @@ -587,98 +584,23 @@ <!-- PAGE --> <div class="slide"> <h1>CbCの実装:軽量継続(末尾除去)</h1> - <li>try_tail_callフラグが落とされる部分</li> - <table width=100%> - <tr class="srctr"> - <td class="srctd"> - <pre class="srcbox"> - + <ul> + <li><small>try_tail_callフラグを落とさせない。</small></li> + <pre class="srcbox" style="font-size:28px;"> if (currently_expanding_call++ != 0 || ((!fndecl || !CbC_IS_CODE_SEGMENT (TREE_TYPE (fndecl))) && !flag_optimize_sibling_calls) || args_size.var || dbg_cnt (tail_call) == false) try_tail_call = 0; - - : - - if ( -#ifdef HAVE_sibcall_epilogue - !HAVE_sibcall_epilogue -#else - 1 -#endif - || !try_tail_call - || structure_value_addr != NULL_RTX -#ifdef REG_PARM_STACK_SPACE - || (OUTGOING_REG_PARM_STACK_SPACE (funtype) - != OUTGOING_REG_PARM_STACK_SPACE (TREE_TYPE (current_function_decl))) - || (reg_parm_stack_space != REG_PARM_STACK_SPACE (fndecl)) -#endif - || !targetm.function_ok_for_sibcall (fndecl, exp) - || (flags & (ECF_RETURNS_TWICE | ECF_NORETURN)) - || TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (addr))) - || (fndecl && decl_function_context (fndecl) == current_function_decl) - || args_size.constant > (crtl->args.size - - crtl->args.pretend_args_size) - || (targetm.calls.return_pops_args (fndecl, funtype, args_size.constant) - != targetm.calls.return_pops_args (current_function_decl, - TREE_TYPE (current_function_decl), - crtl->args.size)) - || !lang_hooks.decls.ok_for_sibcall (fndecl)) - try_tail_call = 0; - - : - - /* Check if caller and callee disagree in promotion of function - return value. */ -#ifndef noCbC - if (try_tail_call && (!fndecl || !CbC_IS_CODE_SEGMENT (TREE_TYPE (fndecl)))) -#else - if (try_tail_call) -#endif - { - enum machine_mode caller_mode, caller_promoted_mode; - enum machine_mode callee_mode, callee_promoted_mode; - int caller_unsignedp, callee_unsignedp; - tree caller_res = DECL_RESULT (current_function_decl); - - caller_unsignedp = TYPE_UNSIGNED (TREE_TYPE (caller_res)); - caller_mode = DECL_MODE (caller_res); - callee_unsignedp = TYPE_UNSIGNED (TREE_TYPE (funtype)); - callee_mode = TYPE_MODE (TREE_TYPE (funtype)); - caller_promoted_mode - = promote_function_mode (TREE_TYPE (caller_res), caller_mode, - &caller_unsignedp, - TREE_TYPE (current_function_decl), 1); - callee_promoted_mode - = promote_function_mode (TREE_TYPE (funtype), callee_mode, - &callee_unsignedp, - funtype, 1); - if (caller_mode != VOIDmode - && (caller_promoted_mode != callee_promoted_mode - || ((caller_mode != caller_promoted_mode - || callee_mode != callee_promoted_mode) - && (caller_unsignedp != callee_unsignedp - || GET_MODE_BITSIZE (caller_mode) - < GET_MODE_BITSIZE (callee_mode))))) - try_tail_call = 0; - } </pre> - </td> - </tr> - </table> - <li><string>!CbC_IS_CODE_SEGMENT (TREE_TYPE (fndecl)により条件を回避</string></li> - </div> - <!-- PAGE --> - <div class="slide"> - <h1>CbCの実装:軽量継続(末尾除去)</h1> - <li>try_tail_callフラグ矯正付与のソースコード</li> - <table width=100%> - <tr class="srctr"> - <td> - <pre class="srcbox"> -#ifndef noCbC + <ul> +<!-- + <li>!CbC_IS_CODE_SEGMENT (TREE_TYPE (fndecl)により条件を回避</li> +--> + </ul> + <li><small>try_tail_callフラグ矯正付与のソースコード</small></li> + <pre class="srcbox" style="font-size:28px;"> if (fndecl && CbC_IS_CODE_SEGMENT (TREE_TYPE (fndecl)) && CbC_IS_CODE_SEGMENT (TREE_TYPE (current_function_decl)) && try_tail_call == 0) @@ -689,14 +611,7 @@ name_callee); try_tail_call = 1; } -#endif </pre> - </td> - </tr> - </table> - <ul> - <li>try_tail_callフラグが落とされた場合warningを出してフラグを立たせる。<small>(最適化の矯正付与)</small></li> - </ul> </div> <!-- PAGE --> <div class="slide"> @@ -741,7 +656,7 @@ } </pre> </small> - <p><small>Intel64 ではレジスタが増えている為、fastcallは標準でつくようになっている。</small></p> + <p><small>Intel64 ではレジスタが増えていてfastcallは標準でつくようになっている。</small></p> </div> <!-- PAGE --> <div class="slide"> @@ -1003,7 +918,7 @@ </div> <!-- PAGE --> <div class="slide"> - <h1>今後の予定</h1> + <h1>今後の課題</h1> <ul> <li>CbCを用いたプログラムの作成</li> <ul> @@ -1053,6 +968,21 @@ </div> <!-- PAGE --> <div class="slide"> + <h1>call_insn</h1> + <li>expand_callより作成されたRTLのTreeは以下のS式となる。</li> + <pre class="srcbox" style="font-size:28px; width:45em;"> + +(call_insn/j 18 17 19 3 (call (mem:QI (symbol_ref:DI ("factorial") [flags 0x403] <function_decl 0x1443b4400 factorial>) [0 S1 A8]) + (const_int 1024 [0x400])) factorial.cbc:30 -1 + (expr_list:REG_EH_REGION (const_int 0 [0]) + (nil)) + (expr_list:REG_DEP_TRUE (use (reg:SI 5 di)) + (nil))) + </pre> + <li></li> + </div> + <!-- PAGE --> + <div class="slide"> <h1>__rectype の実装</h1> <ul> <li>通常、関数の引数に関数ポインタを渡した際は以下の様に使われる。</li>