廖世偉Liao, Shin-Wei臺灣大學:資訊網路與多媒體研究所蘇建豪Su, Jian-HaoJian-HaoSu2010-05-052018-07-052010-05-052018-07-052009U0001-1208200900293600http://ntur.lib.ntu.edu.tw//handle/246246/180691今日3D電腦繪圖越來越顯得重要,電腦遊戲、虛擬實境等廣泛的使用3D電腦繪圖。對於電腦及行動裝置上,3D繪圖加速已經是一個必備的功能。圖處理器的產生代表者GPU接管了幾乎所有3D繪圖相關的工作,在新一代的繪圖處理器中, 甚至提供了可程式性以應付更複雜的效果需求。著色語言便是提供繪圖處理器可程式化的關鍵,它抽象化了硬體同時提供更多彈性 程式設計師因此不必使用組合語言來對繪圖處理器寫作程式色語言編譯器將著色語言轉成硬體的執行格式。我們開發了一個針對OpenGL ES著色語言與Media IC & System and DSP IC 實驗室開發的行動繪圖處理器的著色語言編譯器。論文中,我們敘述了該著色語言編譯器的實作,並對相關硬體的後端作了探討,我們針對該繪圖處理器的架構提出了最佳化方法-在指令調度方面,編譯器實作了資料前饋的偵測與程式碼的產生,另外針對著色語言與硬體特性亦提出了一個暫存器配置方法,目前實驗結果顯示最高可以省下28%的使用量3D computer graphic has become more and more important today, applications like games, virtual reality and so on prevail the way for 3D computer graphic. Accelerator for 3D Graphic has become a necessary component in computer and mobile device. PU is the new name of graphic hardware since it has taken nearly all workload of 3D graphic processing form CPU. As the evolution of GPU, programmability is now provided for more complex computation. Shading language is the key to release the power of GPU programmability. It provides the high hardware abstraction and more flexibility programmability rather than programming GPU in low-level hardware related assembly.hading language compiler translates shader codes to low level instructions. We have developed an OpenGL ES shading language compiler for a mobile GPU developed by Media IC & System and DSP IC Lab at NTU. n this thesis, we describe the compiler we have done and study the backend of shading compiler for the mobile GPU hardware. Optimization methods are proposed to improve the performance of current hardware. Code scheduling in compiler detects data forwarding and generates code to use hardware forwarding path. Register allocation supports packing to use remain part of vector type in shading language. In current experiment, at most 28% register usage can therefore shrink.ABSTRACT iiiONTENTS ivIST OF FIGURES viiIST OF TABLES ixhapter 1 Introduction 1.1 Motivation 1.2 Introduction 2.2.1 Graphic Pipeline 3.3 Graphic Processing Unit 4.4 Shading Language 5.5 Contribution 6.6 Organization: 7hapter 2 Preliminaries 8.1 OpenGL /OpenGL ES 8.2 GPU Hardware 11.2.1 Parallelism 11.2.2 Architecture 12.2.3 Our Hardware 13.3 Shading Language Compiler and Related Work 16.3.1 History 16.3.2 Related Work: 17.3.3 Features in Shading Language 19.3.4 Compiler for Hardware 19hapter 3 Compiler Architecture and Algorithm 21.1 Overview: 21.1.1 Passes 23.2 Code Scheduling 27.2.1 Implementation 27.2.2 Dependence Relation 28.2.3 List Scheduling 30.2.4 List Scheduling for VLIW: 30.2.5 Data Forwarding Detection by Compiler 31.3 Register Allocation 34.3.1 Implementation 36.3.2 Graph Coloring 36.3.3 Linear Scan Allocation 38.3.4 Packing 39hapter 4 Experiments 46.1.1 Efficiency of Data Forwarding by Compiler 46.1.2 Efficiency of Packing with Register Allocation 47.1.3 Discussion: 48hapter 5 Conclusion 50hapter 6 Future Work 51ibliography 52application/pdf721492 bytesapplication/pdfen-US著色語言編譯器繪圖處理器shading languagecompilerGPU應用於行動繪圖處理器的著色語言編譯器後端之暫存器配置與指令調度研究探討Shading Language Compiler Backend for a Mobile GPU: Case Study on Register Allocation and Code Schedulingthesishttp://ntur.lib.ntu.edu.tw/bitstream/246246/180691/1/ntu-98-R96944039-1.pdf