changeset 30:5ec4d6ecebd1 draft

commit
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Mon, 27 Feb 2012 14:29:47 +0900
parents 24ef9b912739
children ca5104bbc3eb
files paper/graffle/state_conv1_noopt.graffle presen/cbc.md presen/pix/state_conv1_noopt.png presen/presentation.html
diffstat 4 files changed, 172 insertions(+), 121 deletions(-) [+]
line wrap: on
line diff
--- a/paper/graffle/state_conv1_noopt.graffle	Mon Feb 27 14:11:40 2012 +0900
+++ b/paper/graffle/state_conv1_noopt.graffle	Mon Feb 27 14:29:47 2012 +0900
@@ -44,7 +44,7 @@
 	<key>Creator</key>
 	<string>Nobuyasu Oshiro</string>
 	<key>DisplayScale</key>
-	<string>1 0/72 in = 1 0/72 in</string>
+	<string>1 0/72 in = 1.0000 in</string>
 	<key>GraphDocumentVersion</key>
 	<integer>8</integer>
 	<key>GraphicsList</key>
@@ -61,8 +61,8 @@
 			<integer>19</integer>
 			<key>Points</key>
 			<array>
-				<string>{103.20886, 197.46736}</string>
-				<string>{99.059959, 184.40334}</string>
+				<string>{112.4254, 198.11032}</string>
+				<string>{103.82727, 182.45906}</string>
 			</array>
 			<key>Style</key>
 			<dict>
@@ -88,14 +88,14 @@
 			<key>Head</key>
 			<dict>
 				<key>ID</key>
-				<integer>3</integer>
+				<integer>5</integer>
 			</dict>
 			<key>ID</key>
 			<integer>18</integer>
 			<key>Points</key>
 			<array>
-				<string>{332.91068, 183.37383}</string>
-				<string>{339.76672, 198.76688}</string>
+				<string>{309.3009, 181.97667}</string>
+				<string>{298.96802, 199.18106}</string>
 			</array>
 			<key>Style</key>
 			<dict>
@@ -283,8 +283,8 @@
 			<integer>11</integer>
 			<key>Points</key>
 			<array>
-				<string>{166.49998, 222}</string>
-				<string>{139.50002, 222}</string>
+				<string>{180.49998, 221}</string>
+				<string>{153.50002, 221}</string>
 			</array>
 			<key>Style</key>
 			<dict>
@@ -316,8 +316,8 @@
 			<integer>10</integer>
 			<key>Points</key>
 			<array>
-				<string>{245.49998, 222}</string>
-				<string>{218.50002, 222}</string>
+				<string>{259.5, 221}</string>
+				<string>{232.50002, 221}</string>
 			</array>
 			<key>Style</key>
 			<dict>
@@ -343,39 +343,6 @@
 			<key>Head</key>
 			<dict>
 				<key>ID</key>
-				<integer>5</integer>
-			</dict>
-			<key>ID</key>
-			<integer>9</integer>
-			<key>Points</key>
-			<array>
-				<string>{324.5, 222}</string>
-				<string>{297.5, 222}</string>
-			</array>
-			<key>Style</key>
-			<dict>
-				<key>stroke</key>
-				<dict>
-					<key>HeadArrow</key>
-					<string>FilledArrow</string>
-					<key>LineType</key>
-					<integer>1</integer>
-					<key>TailArrow</key>
-					<string>0</string>
-				</dict>
-			</dict>
-			<key>Tail</key>
-			<dict>
-				<key>ID</key>
-				<integer>3</integer>
-			</dict>
-		</dict>
-		<dict>
-			<key>Class</key>
-			<string>LineGraphic</string>
-			<key>Head</key>
-			<dict>
-				<key>ID</key>
 				<integer>13</integer>
 			</dict>
 			<key>ID</key>
@@ -405,7 +372,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{83, 197}, {56, 50}}</string>
+			<string>{{97, 196}, {56, 50}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>ID</key>
@@ -436,7 +403,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{167, 197}, {51, 50}}</string>
+			<string>{{181, 196}, {51, 50}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>ID</key>
@@ -466,7 +433,7 @@
 		</dict>
 		<dict>
 			<key>Bounds</key>
-			<string>{{246, 197}, {51, 50}}</string>
+			<string>{{260, 196}, {51, 50}}</string>
 			<key>Class</key>
 			<string>ShapedGraphic</string>
 			<key>ID</key>
@@ -524,36 +491,6 @@
 				<integer>0</integer>
 			</dict>
 		</dict>
-		<dict>
-			<key>Bounds</key>
-			<string>{{325, 197}, {51, 50}}</string>
-			<key>Class</key>
-			<string>ShapedGraphic</string>
-			<key>ID</key>
-			<integer>3</integer>
-			<key>Shape</key>
-			<string>Circle</string>
-			<key>Style</key>
-			<dict>
-				<key>shadow</key>
-				<dict>
-					<key>Draws</key>
-					<string>NO</string>
-				</dict>
-			</dict>
-			<key>Text</key>
-			<dict>
-				<key>Text</key>
-				<string>{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230
-{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\qc
-
-\f0\b\fs24 \cf0 f_g0}</string>
-				<key>VerticalPad</key>
-				<integer>0</integer>
-			</dict>
-		</dict>
 	</array>
 	<key>GridInfo</key>
 	<dict/>
@@ -602,7 +539,7 @@
 	<key>MasterSheets</key>
 	<array/>
 	<key>ModificationDate</key>
-	<string>2012-02-26 10:06:54 +0000</string>
+	<string>2012-02-27 05:28:25 +0000</string>
 	<key>Modifier</key>
 	<string>Nobuyasu Oshiro</string>
 	<key>NotesVisible</key>
--- a/presen/cbc.md	Mon Feb 27 14:11:40 2012 +0900
+++ b/presen/cbc.md	Mon Feb 27 14:29:47 2012 +0900
@@ -286,8 +286,6 @@
 - GCC-4.5 でもインライン展開はされていたが、GCC-4.6 はより良い最適化がかけられている。
 
 
-
-
 ---
 
 
@@ -319,6 +317,32 @@
 
 ---
 
+conv1 プログラム
+========
+- conv1 プログラムでは計算と継続を交互に繰り返し行なう。
+- しかし状態のいくつかへは関数ポインタとして保存させておき継続を行う。
+<pre>
+__code g(int i,stack sp) { // Caller
+    struct f_g0_interface *c = 
+        (struct f_g0_interface *)(sp -= sizeof(struct f_g0_interface));
+
+    c->ret = g_h1;
+    c->i_ = i;
+
+    goto h(i+3,sp);
+}
+
+__code h(int i,stack sp) {
+    struct f_g0_interface *c = (struct f_g0_interface *)sp;
+    goto (c->ret)(i+4,sp);
+}
+</pre>
+
+- 関数ポインタへの継続はインライン展開されない。
+
+---
+
+
 CbC の実装: 環境付き継続
 ========
 - 環境付き継続: C との互換を取るための機能。継続を行った C の関数に戻ることができる。 
Binary file presen/pix/state_conv1_noopt.png has changed
--- a/presen/presentation.html	Mon Feb 27 14:11:40 2012 +0900
+++ b/presen/presentation.html	Mon Feb 27 14:29:47 2012 +0900
@@ -74,7 +74,7 @@
             </aside>
             
             <aside class="page_number">
-              1/19
+              1/21
             </aside>
           </footer>
         </div>
@@ -109,7 +109,7 @@
             </aside>
             
             <aside class="page_number">
-              2/19
+              2/21
             </aside>
           </footer>
         </div>
@@ -144,7 +144,7 @@
             </aside>
             
             <aside class="page_number">
-              3/19
+              3/21
             </aside>
           </footer>
         </div>
@@ -182,7 +182,7 @@
             </aside>
             
             <aside class="page_number">
-              4/19
+              4/21
             </aside>
           </footer>
         </div>
@@ -225,7 +225,7 @@
             </aside>
             
             <aside class="page_number">
-              5/19
+              5/21
             </aside>
           </footer>
         </div>
@@ -284,7 +284,7 @@
             </aside>
             
             <aside class="page_number">
-              6/19
+              6/21
             </aside>
           </footer>
         </div>
@@ -347,7 +347,7 @@
             </aside>
             
             <aside class="page_number">
-              7/19
+              7/21
             </aside>
           </footer>
         </div>
@@ -375,7 +375,7 @@
             </aside>
             
             <aside class="page_number">
-              8/19
+              8/21
             </aside>
           </footer>
         </div>
@@ -434,7 +434,7 @@
             </aside>
             
             <aside class="page_number">
-              9/19
+              9/21
             </aside>
           </footer>
         </div>
@@ -477,7 +477,7 @@
             </aside>
             
             <aside class="page_number">
-              10/19
+              10/21
             </aside>
           </footer>
         </div>
@@ -514,7 +514,7 @@
             </aside>
             
             <aside class="page_number">
-              11/19
+              11/21
             </aside>
           </footer>
         </div>
@@ -558,7 +558,7 @@
             </aside>
             
             <aside class="page_number">
-              12/19
+              12/21
             </aside>
           </footer>
         </div>
@@ -611,7 +611,7 @@
             </aside>
             
             <aside class="page_number">
-              13/19
+              13/21
             </aside>
           </footer>
         </div>
@@ -626,18 +626,11 @@
             
             
             <section><ul>
-<li>conv1 プログラムでは、GCC-4.6 のインライン展開が GCC-4.5 に比べより良くなっていることが分かった。</li>
-</ul>
-<h2>インライン展開</h2>
-<ul>
-<li></li>
-<li>
-<p>また, GCC では新たな最適化もアップデートが行われていく。
-その為、GCC のアップデートに合わせる</p>
-</li>
-</ul>
-<h2>引数 1 の時のプログラム</h2>
-<p><li>引数が 1 の時は, 関数ポインタとして構造体に保存していたコードセグメントへと継続を行なっている</li></p></section>
+<li>最適化無しに比べると GCC-4.5、 GGC-4.6 共にコードセグメントの数が減っている。</l></li>
+<li>これは、最適化の 1 つ『インライン展開』により各コードセグメントの計算がまとめて行われる為、
+継続する数を減らすことができるから。</li>
+<li>GCC-4.5 でもインライン展開はされていたが、GCC-4.6 はより良い最適化がかけられている。</li>
+</ul></section>
             
           </div>
           <div class="presenter_notes">
@@ -653,7 +646,41 @@
             </aside>
             
             <aside class="page_number">
-              14/19
+              14/21
+            </aside>
+          </footer>
+        </div>
+      </div>
+      
+      <!-- slide source: ./cbc.md -->
+      <div class="slide-wrapper">
+        <div class="slide">
+          <div class="inner">
+            
+            <header><h1>GCC のアップデートに合わせる事の重要性</h1></header>
+            
+            
+            <section><ul>
+<li>今回の『インライン展開』のように GCC の最適化は日々改良されていく。</li>
+<li>また、既存の最適化の改良だけでなく新たな最適化の追加等も行われていく。</li>
+<li>それらの恩恵を受ける為にも GCC のアップデートに合わせていく事は今後も重要である。</li>
+</ul></section>
+            
+          </div>
+          <div class="presenter_notes">
+            <header><h1>Presenter Notes</h1></header>
+            <section>
+            
+            </section>
+          </div>
+          <footer>
+            
+            <aside class="source">
+              Source: <a href="./cbc.md">./cbc.md</a>
+            </aside>
+            
+            <aside class="page_number">
+              15/21
             </aside>
           </footer>
         </div>
@@ -668,10 +695,10 @@
             
             
             <section><ul>
-<li>今回 CbC-GCC を GCC-4.6 へとアップデートを行った.</li>
-<li>アップデートに伴い最適化の強制付与や環境付き継続の部分の実装の修正を行った.</li>
-<li>アップデートにかけたことで, より良い最適化がかかることを確認できた.</li>
-<li>GCC ベースの CbC コンパイラは今後 GCC のアップデートに合わせていくだけとなる.</li>
+<li>今回 CbC-GCC を GCC-4.6 へとアップデートを行った。</li>
+<li>アップデートに伴い最適化の強制付与や環境付き継続の部分の実装の修正を行った。</li>
+<li>アップデートにかけたことで, より良い最適化がかかることを確認できた。</li>
+<li>GCC ベースの CbC コンパイラは今後 GCC のアップデートに合わせていくだけとなる。</li>
 </ul>
 <h2>今後の課題</h2>
 <ul>
@@ -693,7 +720,58 @@
             </aside>
             
             <aside class="page_number">
-              15/19
+              16/21
+            </aside>
+          </footer>
+        </div>
+      </div>
+      
+      <!-- slide source: ./cbc.md -->
+      <div class="slide-wrapper">
+        <div class="slide">
+          <div class="inner">
+            
+            <header><h1>conv1 プログラム</h1></header>
+            
+            
+            <section><ul>
+<li>conv1 プログラムでは計算と継続を交互に繰り返し行なう。</li>
+<li>
+<p>しかし状態のいくつかへは関数ポインタとして保存させておき継続を行う。
+<pre>
+__code g(int i,stack sp) { // Caller
+    struct f_g0_interface <em>c = 
+        (struct f_g0_interface </em>)(sp -= sizeof(struct f_g0_interface));</p>
+<p>c-&gt;ret = g_h1;
+c-&gt;i_ = i;</p>
+<p>goto h(i+3,sp);
+}</p>
+</li>
+</ul>
+<p>__code h(int i,stack sp) {
+    struct f_g0_interface <em>c = (struct f_g0_interface </em>)sp;
+    goto (c-&gt;ret)(i+4,sp);
+}
+</pre></p>
+<ul>
+<li>関数ポインタへの継続はインライン展開されない。</li>
+</ul></section>
+            
+          </div>
+          <div class="presenter_notes">
+            <header><h1>Presenter Notes</h1></header>
+            <section>
+            
+            </section>
+          </div>
+          <footer>
+            
+            <aside class="source">
+              Source: <a href="./cbc.md">./cbc.md</a>
+            </aside>
+            
+            <aside class="page_number">
+              17/21
             </aside>
           </footer>
         </div>
@@ -740,7 +818,7 @@
             </aside>
             
             <aside class="page_number">
-              16/19
+              18/21
             </aside>
           </footer>
         </div>
@@ -788,7 +866,7 @@
             </aside>
             
             <aside class="page_number">
-              17/19
+              19/21
             </aside>
           </footer>
         </div>
@@ -824,7 +902,7 @@
             </aside>
             
             <aside class="page_number">
-              18/19
+              20/21
             </aside>
           </footer>
         </div>
@@ -886,7 +964,7 @@
   </tr>
 <!--
   <tr> 
-    <td></td>\<Element 'br' at 0x10756cb70>    <td></td>\<Element 'br' at 0x10756cbd0>  </tr>
+    <td></td>\<Element 'br' at 0x108357630>    <td></td>\<Element 'br' at 0x108357690>  </tr>
 --></p>
 <p></table>
 <li>関数を展開してその場で計算する『インライン展開』がより強力になっているのが確認できる</li>
@@ -908,7 +986,7 @@
             </aside>
             
             <aside class="page_number">
-              19/19
+              21/21
             </aside>
           </footer>
         </div>
@@ -930,7 +1008,7 @@
           <footer>
             
             <aside class="page_number">
-              /19
+              /21
             </aside>
           </footer>
         </div>
@@ -1029,35 +1107,47 @@
       
       
       <tr id="toc-row-15">
-        <th><a href="#slide15">まとめ</a></th>
+        <th><a href="#slide15">GCC のアップデートに合わせる事の重要性</a></th>
         <td><a href="#slide15">15</a></td>
       </tr>
       
       
       <tr id="toc-row-16">
-        <th><a href="#slide16">CbC の実装: 環境付き継続</a></th>
+        <th><a href="#slide16">まとめ</a></th>
         <td><a href="#slide16">16</a></td>
       </tr>
       
       
       <tr id="toc-row-17">
-        <th><a href="#slide17">CbC 引数渡し</a></th>
+        <th><a href="#slide17">conv1 プログラム</a></th>
         <td><a href="#slide17">17</a></td>
       </tr>
       
       
       <tr id="toc-row-18">
-        <th><a href="#slide18">GCC でのコンパイルの仕組み</a></th>
+        <th><a href="#slide18">CbC の実装: 環境付き継続</a></th>
         <td><a href="#slide18">18</a></td>
       </tr>
       
       
       <tr id="toc-row-19">
-        <th><a href="#slide19">最適化の比較</a></th>
+        <th><a href="#slide19">CbC 引数渡し</a></th>
         <td><a href="#slide19">19</a></td>
       </tr>
       
       
+      <tr id="toc-row-20">
+        <th><a href="#slide20">GCC でのコンパイルの仕組み</a></th>
+        <td><a href="#slide20">20</a></td>
+      </tr>
+      
+      
+      <tr id="toc-row-21">
+        <th><a href="#slide21">最適化の比較</a></th>
+        <td><a href="#slide21">21</a></td>
+      </tr>
+      
+      
     </table>
   </div>