annotate presen/index.html @ 59:6ef99d3e66b2

modify light-weight continuation
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Mon, 26 Dec 2011 08:24:23 +0900
parents 97457764428f
children a21d16da431a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
54
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 <html xmlns="http://www.w3.org/1999/xhtml">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 <head>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 <style>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 .center {
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 margin-left: auto;
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 margin-right: auto;
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 text-align: center;
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 }
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 .textcenter {
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 text-align: center;
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 }
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 .taninaritop {
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 margin: auto;
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 width: 95%;
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 font-weight: bold;
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 }
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 </style>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 <title>2012/ 1/ 7</title>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 <!-- metadata -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 <meta name="generator" content="S5" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 <meta name="version" content="S5 1.1" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 <meta name="presdate" content="20120107" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 <meta name="author" content="Nobuyasu Oshiro" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 <meta name="company" content="University of the Ryukyu" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 <!-- meta temporary -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 <meta http-equiv="Content-Script-Type" content="text/javascript" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 <meta http-equiv="Content-Style-Type" content="text/css" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 <!-- configuration parameters -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 <meta name="defaultView" content="slideshow" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 <meta name="controlVis" content="hidden" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 <!-- configuration extensions -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 <meta name="tranSitions" content="true" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 <meta name="fadeDuration" content="500" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 <meta name="incrDuration" content="250" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 <!-- configuration autoplay extension -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 <meta name="autoMatic" content="false" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 <meta name="playLoop" content="true" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 <meta name="playDelay" content="10" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 <!-- configuration audio extension -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 <meta name="audioSupport" content="false" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 <meta name="audioVolume" content="100" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 <meta name="audioError" content="false" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 <!-- configuration audio debug -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 <meta name="audioDebug" content="false" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 <!-- style sheet links -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 <link rel="stylesheet" href="ui/default_utf/slides.css" type="text/css" media="projection" id="slideProj" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 <link rel="stylesheet" href="ui/default_utf/outline.css" type="text/css" media="screen" id="outlineStyle" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 <link rel="stylesheet" href="ui/default_utf/print.css" type="text/css" media="print" id="slidePrint" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 <link rel="stylesheet" href="ui/default_utf/opera.css" type="text/css" media="projection" id="operaFix" />
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 <!-- embedded styles -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 <style type="text/css" media="all">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 .imgcon {width: 100%; margin: 0 auto; padding: 0; text-align: center;}
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 #anim {width: 33%; height: 320px; position: relative;}
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 #anim img {position: absolute; top: 0px; left: 0px;}
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 </style>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 <!-- S5 JS -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 <script src="ui/default_utf/slides.js" type="text/javascript"></script>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 </head>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 <body>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 <div class="layout">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 <div id="controls"><!-- DO NOT EDIT --></div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 <div id="currentSlide"><!-- DO NOT EDIT --></div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 <div id="header"></div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 <div id="footer">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 <h1>プログラミングシンポジウム: 2012/ 1/ 7</h1>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 <h2>並列信頼研</h2>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 <div class="presentation">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
77
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 <div class="slide">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 <h1>Continuation based Cの GCC 4.6 上の実装について</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 <h3></h3>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 <li>大城 信康</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 <h4><a href="http://ie.u-ryukyu.ac.jp/" rel="external">琉球大学 並列信頼研究室</a></h4>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 <div class="handout"></div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
84 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 <div class="slide">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 <h1>目的と背景(1)</h1>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 <li>当研究室ではコードセグメント単位で記述するプログラミング言語Continuation based C (以下CbC)という言語を開発している。</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 <li>コードセグメントは並列実行の単位として使うことができ、プログラムの正しさを示す単位としても使用することができる。</li>
58
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
90 <li>Many Core での並列実行を高い性能と高い信頼性で実現することができると考える。</li>
54
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 <div class="slide">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 <h1>目的と背景(2)</h1>
58
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
95 <li>CbC のコンパイラは2001年に Micro-C 版、2008年には GCC 4.4 をベースとしたコンパイラが開発された。</li>
55
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
96 <li>GCC をベースとした CbC コンパイラは、修正・追加された最適化の機能を使用する為に、 GCC のアップデートに合わせ変更する必要がある。</li>
58
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
97 <li>本研究ではCbC コンパイラを GCC-4.6 へとアップデートを行った。 </li>
54
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
99 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 <div class="slide">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 <h1>発表内容</h1>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 <ol>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
103 <li>CbC の紹介</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
104 <li>GCC でのコンパイルの流れ</li>
58
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
105 <font color="red">
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
106 <li>CbC の実装</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
107 </font>
54
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 <!--
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 <ul>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 <li>Tail Call Elimination</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 <li>goto シンタックスの追加</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 <li>環境付き継続</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 </ul>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 <li>Micro-C との性能比較</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
116 <li>mercurial を用いたアップデートの方法</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
117 <li>まとめ</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 <ol>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
119 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
120 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
121 <div class="slide">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 <h1>Continuation based C </h1>
55
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
123 <h2>コードセグメント単位での記述と継続を基本としたプログラミング言語。</h2>
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
124 <li>プログラムの記述は C の構文と同じだが、ループ制御や関数コールが取り除かれる。</li>
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
125 <li>コードセグメント</li>
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
126 <ul>
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
127 <li>C の関数よりも細かい単位。</li>
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
128 <li>コードセグメントの処理は最後に別のコードセグメントへ継続(goto)することで続いていく。</li>
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
129 </ul>
54
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
130 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
131 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
132 <div class="slide">
58
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
133 <h1>Continuation Based C</h1>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
134 <h2>継続:現在の処理を実行していく為の情報</h2>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
135 <!--
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
136 <li>Cでは関数呼び出しの後、呼び出し元の環境に復帰する必要がある。</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
137 -->
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
138 <li>Cにおいての継続</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
139 <ul>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
140 <li>続く命令のアドレス</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
141 <li>命令に必要なデータ</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
142 <li>スタックに積まれている値(環境)</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
143 </ul>
59
6ef99d3e66b2 modify light-weight continuation
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 58
diff changeset
144 <li>CbCの継続(軽量継続)</li>
58
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
145 <ul>
59
6ef99d3e66b2 modify light-weight continuation
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 58
diff changeset
146 <li>Cの継続から環境を除外</li>
6ef99d3e66b2 modify light-weight continuation
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 58
diff changeset
147 <li>続く命令とその命令に必要なデータのみ</li>
58
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
148 </ul>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
149 </div>
59
6ef99d3e66b2 modify light-weight continuation
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 58
diff changeset
150 <div class="slide">
6ef99d3e66b2 modify light-weight continuation
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 58
diff changeset
151 <h1>Continuation Based C (軽量継続)</h1>
6ef99d3e66b2 modify light-weight continuation
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 58
diff changeset
152 <li>関数コールが無い -> 呼び出し元への復帰がない</li>
6ef99d3e66b2 modify light-weight continuation
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 58
diff changeset
153 <li>継続の際にスタックに載せるデータはコードセグメントへの引数だけとなる。</li>
6ef99d3e66b2 modify light-weight continuation
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 58
diff changeset
154 <!-- <li>スタックポインタの位置を変えずにすむ。</li> -->
6ef99d3e66b2 modify light-weight continuation
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 58
diff changeset
155 <p style=" margin-right:auto; margin-left:auto;">
6ef99d3e66b2 modify light-weight continuation
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 58
diff changeset
156 <img class="scale" src="./pix/cs_stack.png" style="height: 7em;">
6ef99d3e66b2 modify light-weight continuation
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 58
diff changeset
157 </p>
6ef99d3e66b2 modify light-weight continuation
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 58
diff changeset
158 </div>
6ef99d3e66b2 modify light-weight continuation
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 58
diff changeset
159 <!-- PAGE -->
58
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
160 <!-- PAGE -->
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
161 <div class="slide">
54
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
162 <h1>Continuation based C </h1>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
163 <small>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
164 <table width=100% >
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
165 <tr>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
166 <caption>階乗を求めるCbCのプログラム</caption>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
167 <td width=50%>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
168 <pre>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
169 __code print_factorial(int prod) {
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
170 printf("factorial = %d\n",prod);
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
171 exit(0);
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
172 }
58
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
173
54
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
174 __code factorial0(int prod, int x) {
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
175 if ( x >= 1) {
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
176 goto factorial0(prod*x, x-1);
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
177 }else{
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
178 goto print_factorial(prod);
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
179 }
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
180 }
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
181 </pre>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
182 </td>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
183 <td>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
184 <pre>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
185 __code factorial(int x) {
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
186 goto factorial0(1, x);
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
187 }
58
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
188
54
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
189 int main(int argc, char **argv) {
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
190 int i;
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
191 i = atoi(argv[1]);
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
192 goto factorial(i);
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
193 return 0;
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
194 }
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
195 </pre>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
196 </td>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
197 </tr>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
198 </table>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
199 </small>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
200 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
201 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
202 <div class="slide">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
203 <h1>Continuation Based C</h1>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
204 <li></li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
205 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
206 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
207 <div class="slide">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
208 <h1>GCC によるコンパイル</h1>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
209 <li>GCC についての簡単な説明を行う...</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
210 <img src="./pix/ir.png" style="height: 6em;">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
211 <li>CbCの実装は主に Parser の部分と RTL を生成する部分に行われる。</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
212 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
213 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
214 <div class="slide">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
215 <h1>CbC の実装</h1>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
216 <ul>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
217 <li>シンタックスの追加</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
218 <li>fastcall属性の付与</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
219 <li>Tail Call Elimination</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
220 <li>環境付き継続</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
221 </ul>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
222 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
223 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
224 <div class="slide">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
225 <h1>シンタックスの追加</h1>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
226 <ul>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
227 <li>__code でコードセグメントの宣言</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
228 <li>goto にコードセグメントへの継続処理を追加</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
229 </ul>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
230 <li></li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
231 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
232 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
233 <div class="slide">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
234 <h1>シンタックスの追加</h1>
55
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
235 <h2>__code でコードセグメントの宣言</h2>
54
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
236 <ul>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
237 <li>__code 用idとkeywordを作成。</li>
55
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
238 <li>戻り値が無い為、コードセグメントは void 型の関数で作成される木と同じ木が作られる。</li>
54
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
239 </ul>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
240 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
241 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
242 <div class="slide">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
243 <h1>シンタックスの追加</h1>
55
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
244 <h2>goto シンタックスの追加</h2>
54
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
245 <ul>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
246 <li>通常の goto に加え、コードセグメントを呼び出す処理を追加。</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
247 <li>コードセグメントへのgoto後は、 return の処理を自動で追加。</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
248 </ul>
55
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
249 <table border=1 width=100%>
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
250 <tr class="center">
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
251 <small>
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
252 <td>実際のコード </td>
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
253 <td>GCC 内で処理されるコード</td>
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
254 </small>
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
255 </tr>
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
256 <tr style="margin-top: auto;">
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
257 <td>
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
258 <pre>
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
259 goto factorial0(1, x);
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
260 </pre>
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
261 </td>
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
262 <td>
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
263 <pre>
58
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
264 factorial0(1, x);
55
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
265 return;
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
266 </pre>
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
267 </td>
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
268 </tr>
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
269 </table>
54
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
270 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
271 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
272 <div class="slide">
58
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
273 <h1>引数渡し</h1>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
274 <li>当初、GCCを使ってコンパイルしたCbCのプログラムはMicro-C版に速度面で勝てなかった。</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
275 <ul>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
276 <li>Micro-Cでは関数呼び出しの際にできるだけレジスタを使うようにしていたため。</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
277 </ul>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
278 <li class="incremental">そこで、GCC版CbCコンパイラの引数渡しもできるだけレジスタで行うことに</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
279 </div>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
280 <!-- PAGE -->
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
281 <div class="slide">
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
282 <h1>引数渡し(fastcall属性の付与)</h1>
55
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
283 <li>i386 において関数呼び出しの際、引数渡しをできるだけレジスタを用いるGCCの拡張機能。</li>
58
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
284 <li>__code で宣言された関数は自動でfastcall属性が付与される。</li>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
285 <small>
55
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
286 <pre>
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
287 if(!TARGET_64BIT) {
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
288 attrs = build_tree_list (get_identifier("fastcall"), NULL_TREE);
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
289 declspecs_add_attrs(specs, attrs);
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
290 }
06ce8fb8e278 modify presen/index.html
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 54
diff changeset
291 </pre>
58
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
292 </small>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
293 <p><small>Intel64 ではレジスタが増えている為、fastcallは標準でつくようになっている。</small></p>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
294 </div>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
295 <!-- PAGE -->
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
296 <div class="slide">
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
297 <h1></h1>
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 57
diff changeset
298 <li></li>
54
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
299 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
300 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
301 <div class="slide">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
302 <h1></h1>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
303 <li></li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
304 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
305 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
306 <div class="slide">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
307 <h1></h1>
57
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
308 <pre>
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
309 typedef struct node {
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
310 selftype *right;
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
311 selftype *left;
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
312 }*NODE
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
313 </pre>
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
314
54
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
315 <li></li>
57
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
316
54
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
317 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
318 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
319 <div class="slide">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
320 <h1>環境付き継続とは</h1>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
321 <li>コードセグメントを呼び出した C の関数に戻る機能</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
322 <li></li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
323 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
324 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
325 <div class="slide">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
326 <h1>環境付き継続:クロージャでの実装について</h1>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
327 <li>『GCC 4.6 と Lion の組合せでは Closure は正しく動作していないことが分かった.』<br>間違い</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
328 <li>訂正</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
329 <ul>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
330 <li class="incremental">GCC 4.6 への CbC の実装のせいでクロージャがうまくできていなかったことが判明。</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
331 <li class="incremental">GCC 4.6 と Lion でのクロージャは特に問題はない。</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
332 </ul>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
333 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
334 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
335 <div class="slide">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
336 <h1>環境付き継続:クロージャでの実装の問題点</h1>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
337 <li></li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
338 <li></li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
339 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
340 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
341 <div class="slide">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
342 <h1>環境付き継続: setjmp での実装</h1>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
343 <li>setjmp での実装</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
344 <small>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
345 <pre>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
346 ({
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
347 int a = setjmp(env);
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
348 int retval;
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
349 void _cbc_internal_return(int retval_, jmp_buf _envp){
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
350 retval = retval_;
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
351 longjmp(_envp, retval);
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
352 }
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
353 if (a) {
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
354 return retval;
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
355 }
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
356 _cbc_internal_return;
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
357 })
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
358 </pre>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
359 </small>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
360 <li></li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
361 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
362 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
363 <div class="slide">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
364 <h1>環境付き継続: setjmp での実装の問題</h1>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
365 <li>GCC 内で setjmp を生成する関数を作る必要がある。</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
366 <li>戻値の型が int </li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
367 <ul>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
368 <li>構造体等ポインタの場合使えない。</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
369 </ul>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
370 <li class="incremental">setjmp での実装はあまり実用的ではない。</li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
371 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
372 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
373 <div class="slide">
57
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
374 <h1>__rectype の実装</h1>
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
375 <li>通常、関数の引数に関数ポインタを渡した際は以下の様に使われる。</li>
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
376 <small>
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
377 <pre>
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
378 void factorial(int n, int result, void(*print)()){
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
379 :
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
380 (*print)(n,result,print,exit1, envp);
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
381 }
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
382 </pre>
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
383 </small>
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
384 <li>以下の様に扱えるようにしたい。</li>
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
385 <small>
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
386 <pre>
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
387 void factorial(int n, int result, void *print){
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
388 :
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
389 (*print)(n,result,print,exit1, envp);
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
390 }
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
391 </pre>
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
392 </small>
54
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
393 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
394 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
395 <div class="slide">
57
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
396 <h1>__rectype の実装</h1>
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
397 <li>そこで、__rectype という予約後を作り、以下の宣言を行えるようにした。</li>
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
398 <pre>
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
399 __code factorial(int n, int result, __rectype *print) {
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
400 :
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
401 (*print)(n,result,print,exit1, envp);
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
402 }
ce844f6c504d modify __rectype
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
403 </pre>
54
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
404 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
405 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
406 <div class="slide">
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
407 <h1></h1>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
408 <li></li>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
409 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
410 <!-- PAGE -->
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
411 </div>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
412 </body>
a967ee5a0b0f add presen
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
413 </html>