Optimization of Glibc on Loongson 2F

Author
LiZuo
Advisor
GuNaiJie
School
University of Science and Technology of China
Major
Computer System Architecture
Classification
TP316.81
Degree
Master's thesis
Year
2010
Downloads
65
Citations
0

Request the full text

Abstract

Glibc is a core library on Linux. Many programs are based on it. Therefore, its performance is of great significance. This thesis implemented the optimization of Glibc on Looonson2F, in order that Glibc could take full advantage of Loongson2F, thus high performance and greate user experience on Loongson2F could be achived.This thesis first analyzes the composition of Glibc. The functions in Glibc can be approximately divided into two parts. One part, including functions processing signal, I/O and so on, is related to system calls and primitive operations. The orther part provides general facilities such as string processing and mathematic calculation. Functions in the former part enclose system calls and preprocesse arguments. Their control flows are almost fixed. Thus this thesis focuses on those in the later part. We have implemented the optimization of string and memory functions, mathematic functions, search and sorting functions and cryptographic functions.Various methods are used according to specific functions, including the following:Memory access optimization. By considering the layered storage architecture, it arranges the memory access to make the best of data read in cache, reduce cache conflict misses and capacity misses. It also makes use of appropriate read and store instructions. This method is used in the optimization of sorting functions and string functions.Loop unrolling. It increases the size of basic block and reduces the number of branches. Computation amount of one-loop and limit of register number should be taken into account when loop unrolling is implemented. It is wildly used in this thesis.Instruction scheduling. It rearranges the instructions locally to generate special instructions of Loongson2F and full fill the pipeline. This method is used in the optimization of mathematic functions.Besides, the original flows of the functions are often modified first to apply successive optimization.Experiment results show that optimization rates of most functions are upto 50%.

Table of contents

Abstract 4-5 ABSTRACT 5-10 first chapter 10-16 1.1 of Glibc library; 10-11 1.1.1 Glibc library introduced 10-11 1.2 Godson 2F architecture 11-14 1.2.1 instruction execution 11-13 1.2.1.1 instruction set 11-12 1.2.1.2 features 12 1.2.1.3 Out-of-order execution 12-13 1.2.2 Storage Access and Management 13-14 1.2.2.1 Cache structure and access 13-14 1.2.2.2 Memory Management 14 1.3 of this article content and technology 14-15 1.4 The paper is organized 15-16 the second chapter of the string and memory handling 16-31 2.1 function introduced 16-21 2.2 function optimization 21-30 2.2.1 seek string length 21-22 2.2.2 memory copy copy 22-25 2.2.3 string copy and connect 25-27 2.2.4 string and memory 27-29 2.2.5 string and memory lookup 29-30 2.3 Summary 30-31 the third chapter of mathematical functions 31-41 3.1 Basic data types 31-32 3.2 Function Descriptions and optimization 32-40 3.2.1 basic operations 32 3.2.2 numeric and string conversion 32-40 3.2.3 index and logarithmic functions 40 3.2.4 Trigonometric 40 3.3 Summary 40-41 Chapter search and sort 41-56 4.1 Find function 41-43 4.1.1 array lookup 41 4.1.2 binary tree lookup 41-42 4.1.3 hash table lookup 42-43 4.2 sort function 43-44 4.2.1 function prototype introduced 43-44 4.2.2 function flow analysis 44 4.3 sort function optimization 44-55 4.3.1 function process optimization 47 4.3.2 merge sort optimization 47-51 4.3.3 quicksort optimization 51-55 4.4 Summary 55-56 the fifth chapter of the encryption function 56-60 5.1 function introduced 56 5.2 function optimization 56-59 5.3 Summary 59-60 Chapter VI Summary and Outlook 60-62 6.1 This paper summarizes 60-61 6.2 Problems and Research Prospects 61-62 References 62-65 thank 65-66 papers published during the reading and research achievements 66

Related dissertations

  1. Memory Access Optimization of ATLAS on Loongson 2F
  2. Research on Green Demands of Embedded System Oriented Compiling Technique
    ChenYong ·Wuhan University ·2013 ·Doctoral dissertation
  3. Research on Static Instruction Mapping Algorithm of Edge Architecture
    WangWenTao ·Harbin Institute of Technology ·2012 ·Master's thesis
  4. Compiler Design of Scalable and Configurable Processors
    ZhongSongYan ·Tianjin University ·2012 ·Master's thesis
  5. Research in the Performance Prediction Model under Different Frequencies
    LiuZuoZuo ·Northeastern University ·2010 ·Master's thesis
  6. The Research and Implementation for XtratuM Based on Loongson2F
    LiJun ·Lanzhou University ·2013 ·Master's thesis
  7. Research on Software Pipelining Techniques for EPIC Architectures
    LinHaiBo ·Tsinghua University ·2003 ·Doctoral dissertation
  8. Key Problem Study on Configurable and Extensible Processor
    WeiJiZeng ·Tianjin University ·2010 ·Doctoral dissertation
  9. The Filtering of XML Data Based on Automata
    ShenJie ·Harbin Engineering University ·2010 ·Doctoral dissertation
  10. Research of Automatic Compiler Tuning Base on Machine Learning
    WuYongChong ·Institute of Computing Technology ·2008 ·Master's thesis
  11. Loop Realization and Optimization Based on X Stream Processor
  12. Research on Optimization of Software Pipelining for IA-64 Architecture
    LinZuoMin ·Tsinghua University ·2003 ·Master's thesis
  13. Performance Improvements for GCC Using Architecture Features on Godson Ⅱ
    DongJunFeng ·Institute of Computing Technology ·2006 ·Master's thesis
  14. Memory leak in the embedded linux system
    QiHuaJun ·Tianjin Polytechnic University ·2006 ·Master's thesis
  15. The Research of the Embedded Linux System Based on Firewall Facilities
    PeiJinGan ·Suzhou University ·2004 ·Master's thesis
  16. Research on Instruction Scheduling for IA-64
  17. Ensure that Java precise exception instruction scheduling techniques
    Zhang ·Fudan University ·2008 ·Master's thesis
  18. Research and Implementation of FT64-2 Kernel Assembler
  19. Research on Management Policy of Shared Last Level Cache for Chip Multiprocessors
  20. Study on Parallel Computing Model Characteristics and Parallel Programming Design Method
    ZhaoJianJian ·Zhongyuan Institute of Technology ·2010 ·Master's thesis