* さらに小さなフロントエンドコードを目指して
-(by [[K]], 2015.12.01)

** はじめに
-これはrev3の構想のためのメモです。
--現時点での切り分け。
--rev1: JITC型でとにかく作ってみたバージョン
--rev2: rev1での経験を踏まえて今度はインタプリタ型でフロントエンドコードを改良。
--rev3: さらにフロントエンドコードを改良。でもまだレンジコーダには手を出さない。予定。
--rev4: ついに究極のレンジコーダ利用のフロントエンドコード。もはや読めない。


** このページで何をやりたいのか
-OSECPU-VMのアプリのフロントエンドコードの中には、様々な整数の定数が現れるが、rev2ではこれらをhh4の改造版でエンコードしている。かなりいいところまで行っていると思うけど、しかしまだ完全ではない気がする。場当たり的な感じがする。
-それをもっと系統的に整理したい。

-関連:
--rev2のフロントエンドバイトコードの仕様:[[page0107]]

** 分かっていること
-絶対値の小さな数値は頻出する。
-負の数は-1を除けばめったに表れない。
-2のベキ数を短くエンコードできると有利。
-10のベキ数も短くエンコードできると有利。
-四則演算ができるとさらに良い。
-レジスタ参照も含める必要がある。
-ビット列を見ると、1か0のどちらかが多い。均等に配分されることは珍しい。

** 案1
-4ビット形式(7通り):
 -1, 0, 1, 2, 3, 4, rep0
-8ビット形式(64通り):
--0および正の数(16):0~15
--リピートレジスタ(8):rep0~7
--通常レジスタ(8):R00~0F
--負の数(8):-1~-8
--2のベキ数(8):16,32,64,128,256,512,2^n(n=10~),16^n(n=3~)
---2^nのnについて: 4ビット形式の特例: 10,11,13,14,15,17,pre-mul
--演算(6):ビット反転,積,和,差,xのy乗(x=3~,y=2~),10^(n=3~)
--未定(2):
---R3Fを入れる?
-12ビット形式(512通り):
--0および正の数(384):0~383
--通常レジスタ(64):R00~3F
--負の数(32):-1~-32
--未定(32)
---割り算もほしい
-16ビット形式:
--0および正の数(3584):0~3583
--未定(512)
-24ビット形式以降では、0および正の数しかない。
-考察:
--8ビット形式で、リピートレジスタを半減させてしまったのは良い判断だっただろうか?
---でもぶっちゃけ、rep8以降の出現率はかなり低そうだから、まあいいんじゃないかな?
--典型的な数のエンコード例:
---1024は12ビット、65536も12ビット
---100は12ビット、1000や1万も12ビット。1億まで12ビット。
---4億は(10^)(pre-mul)(8)(4)で8+4+4+4=20ビット。rev2と同点。
---192は普通に12ビット。
---384は普通に16ビット。

** 案2
-pre-mulは利用頻度が高そうなのでデフォルトで適用する。これで4ビット減らせる。
--pre-mulがデフォルトではない2のベキを未定に入れる。

** 案3
-いや、ちょっとまて。こんなことがやりたかったわけじゃない。これじゃあrev2と大差ない(やり方的には)。
-数値ごとに利用頻度的なものをうまく定義して、それで上位64個を8ビット形式に割り振って、上位512個を12ビット形式に割り振って・・・みたいなことがやりたい。

* こめんと欄
-Do you know each other?  http://thisav.fun/ thisav.com  The Rangers aren’t deep enough to bench players left and right, with Rick Nash (concussion) and Carl Hagelin (shoulder) sidelined. But Vigneault still has cause to demote his struggling forwards. Zuccarello (17:23), Pyatt (15:22) and Pouliot (13:49) rank third, seventh and eighth, respectively, among Rangers forwards in minutes played. But they have combined for no points and a minus-11 through five games.  -- ''Irea'' SIZE(10){2019-06-29 (土) 20:30:05}
-Please wait http://redtube.in.net/ free sex videos  “My theory would be to go to Findlay Prep and then be able to go to the pros,” Vaccaro said. “That would be what I would hope for these kids, rather than put these kids in a year of purgatory in college. If you look at their roster, every one of them that goes there thinks they’re going to be professional. And there’s no sin in that.”  -- ''Miles'' SIZE(10){2019-06-30 (日) 02:41:25}
-I'm in a band http://silverdaddies.fun/ www.silverdaddies.com  Call me a pessimist, but you have Russia's leader Vladimir Putin stating there are no chemical weapons and that America, and President Obama specifically, is lying. Now he wants to "help" broker some type of a deal where Syria brings forth those same chemical weapons that America and our president "lied" about? And how about Assad, whose interview with Charlie Rose sounds a bit threatening ... discussing how there would be consequences if America were to bomb Syria? And now, the very leader who stated there were no chemical weapons used – no chemical weapons in his possession perhaps – now he wants to come clean? Right.  -- ''Willis'' SIZE(10){2019-06-30 (日) 03:04:11}
-Could you ask him to call me? http://tubegalore.in.net/ www.tubegalore  Most of the commentary that’s appeared so far has tried to make sense of that pivotal time. Some argue that Lehman and other troubled financial firms were simply caught in a perfect storm of too much leverage in a sudden and severe confidence crisis.  -- ''Graig'' SIZE(10){2019-06-30 (日) 03:22:28}
-A law firm http://boobs.pet/ reddit boobs  It was another wasted opportunity by Smith. Late in the first half, he fired too long for Stephen Hill, who was a few steps behind Ike Taylor and Troy Polamalu for what would have been a 77-yard touchdown. Smith’s strength this season has actually been on the deep ball, but his longest completion was the 29-yarder to Cumberland with the Jets’ game plan more about the run and short passes.  -- ''Felton'' SIZE(10){2019-06-30 (日) 03:50:10}
-Pleased to meet you http://boobs.pet/ boobs nude  Northrup admits this one sounds simple, but she says it works. “This morning, I was feeling grumpy about something, and my fiancé said, ‘Why don’t you just decide to be excited,’” Northrup says. So she did, and it worked. "The simplicity of making a decision to approach money in a different way can be very powerful,” Northrup adds.  -- ''Lightsoul'' SIZE(10){2019-06-30 (日) 04:49:26}
-Where did you go to university? http://lamalinks.fun/ lamalinks.com  “It’s a little tear in the rotator cuff, it wasn’t anything major so they called it normal wear and tear,” said Niese, who drove to Miami from Port St. Lucie, where was rehabbing at the team’s spring training facility to meet Warthen and the team.  -- ''Sara'' SIZE(10){2019-06-30 (日) 06:28:43}
-I've got a very weak signal http://rulertube.fun/ rulertube  There is always the suspicion of course that it’s because they are invariably run by gruesome and sexless old men. The fanatical devotion they usually demand, combined with the vulnerability of those almost magnetically drawn to charismatic “gurus” who claim to be in sole possession of “the truth”, offers perhaps another explanation.  -- ''Irea'' SIZE(10){2019-07-07 (日) 17:57:29}
-How do you do? http://xhub.in.net/ Literotica  “I drew no lie at all from my third shot,” he explained. “I was just trying to play 20 feet long and putt back to try to just get bogey. I didn’t even get it over the bunker. Came out nowhere. Didn’t really have much from there, hit a beautiful putt, just lipped out.”  -- ''Frank'' SIZE(10){2019-07-07 (日) 17:57:30}
-I can't get through at the moment http://beeg.in.net/ site beeg.tel  The punishment suggests that Smith did not test positive for a performance-enhancing drug but instead tested positive for marijuana. According to the league’s drug policy, a player is suspended five games after a third positive test for marijuana A second offense results in a $25,000 fine, while the first positive test calls for the player to enter a program.  -- ''Wesley'' SIZE(10){2019-07-08 (月) 10:06:19}
-I enjoy travelling http://boobs.pet/ rate my boobs  The mass murderers must swiftly be brought to trial. Given the wealth of evidence connecting them to the worst terror attack in U.S. history — not to mention KSM’s defiant confession to same — this verdict will inevitably be guilty.  -- ''Earnest'' SIZE(10){2019-07-08 (月) 10:07:54}
-I'll text you later http://xhub.in.net/ Youporn  For the most part, we tag along as recently retired Lenny (Sandler) and his life-long friends (Kevin James, Chris Rock and David Spade) complain about their wives (despite being married to Salma Hayek, Maria Bello and Maya Rudolph); ogle the single hotties in their hometown; and lament the good old days when they were in high school. Perhaps you’ve noticed that extreme wish-fulfillment is a major appeal of this franchise.  -- ''Peter'' SIZE(10){2019-07-08 (月) 10:28:44}
-Have you got any qualifications? http://xnxx.photography/ xnxx.com  The Argentine government and the holdouts should make STILL THIS YEAR A BINDING AGREEMENT with respect to the “time after” (end of the “Rights Upon Future Offers (RUFO)” clause) with the advantage that seizure risks and a technical default would thus be immediately averted.  -- ''Porter'' SIZE(10){2019-07-08 (月) 11:20:42}
-Please call back later http://9taxi.in.net/ 9 taxi  Anthony Weiner’s mayoral marketing campaign is using Bill Clinton’s past political marketing campaigns as its guide. And the Clintons don’t like it one bit. “New York Times” columnist Maureen Dowd wrote that the Clintons –  -- ''Jose'' SIZE(10){2019-07-08 (月) 14:17:18}
-Could you give me some smaller notes? http://xnxx.zone/ www.xnxx.com.  “With wearable computing devices becoming a reality, you could imagine eventually having a pair of glasses that toggles between wide-angle, telephoto, or reading modes based on voice commands or gestures,” suggested Liss.  -- ''Curtis'' SIZE(10){2019-07-08 (月) 18:10:57}

#comment

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS