Profile Guided Selection of ARM and Thumb Instructions at Function Level

함수 수준에서 프로파일 정보를 이용한 ARM과 Thumb 명령어의 선택

  • 소창호 (한국과학기술원 전산학과) ;
  • 한태숙 (한국과학기술원 전산학과)
  • Published : 2005.03.01

Abstract

In the embedded system domain, both memory requirement and energy consumption are great concerns. To save memory and energy, the 32 bit ARM processor supports the 16 bit Thumb instruction set. For a given program, the Thumb code is typically smaller than the ARM code. However, the limitations of the Thumb instruction set can often lead to generation of poorer quality code. To generate codes with smaller size but a little slower execution speed, Krishnaswarmy suggests a profiling guided selection algorithm at module level for generating mixed ARM and Thumb codes for application programs. The resulting codes of the algorithm give significant code size reductions with a little loss in performance. When the instruction set is selected at module level, some functions, which should be compiled in Thumb mode to reduce code size, are compiled to ARM code. It means we have additional code size reduction chance. In this paper, we propose a profile guided selection algorithm at function level for generating mixed ARM and Thumb codes for application programs so that the resulting codes give additional code size reductions without loss in performance compared to the module level algorithm. We can reduce 2.7% code size additionally with no performance penalty

임베디드 시스템에서는 메모리와 에너지의 소비가 중요한 관심사 중 하나이다. 메모리와 에너지의 소비를 줄이기 위해 32비트의 ARM 프로세서는 16비트 Thumb 명령어 세트를 지원한다. 주어진 응용프로그램에 대해 Thumb 코드는 일반적으로 ARM 코드보다 코드 사이즈가 작지만, 실행속도는 느리다. 코드 사이즈가 작으면서도 실행속도가 느리지 않은 코드를 생성하기 위한 방법으로 Krishnaswarmy는 응용프로그램에 대한 프로파일 정보를 이용하여 모듈 수준에서 ARM과 Thumb 명령어 세트를 선택하는 알고리즘을 고안했다. 이 알고리즘은 작은 성능 손실로도 상당한 코드 사이즈 감소 효과를 갖지만, 명령어 세트가 모듈 수준에서 선택되기 때문에 Thumb 코드로 컴파일 하면 코드 사이즈를 줄일 수 있는 함수들도 ARM 코드로 컴파일 되어, 추가적인 코드 사이즈 감소의 기회를 잃게 되는 문제점을 갖고 있다. 본 논문에서는 ARM과 Thumb 코드가 혼합된 코드 사이즈의 감소를 이끌어내기 위해 함수 수준에서 프로파일(Profile) 정보를 이용한 명령어 세트 선택 알고리즘을 제안했다. 우리는 성능에서의 페널티는 없이 2.7%의 코드 사이즈를 추가로 줄일 수 있었다.

Keywords

References

  1. P. Marwedel, S. Steinke and L. Wehmeyer, 'Compilation techniques for energy-, code-size-, and run-time-efficient embedded software,' Int. Workshop on Advanced Compiler Techniques for High Performance and Embedded Processors, Bucharest, 2001
  2. L. Goudge and S. Segars, 'Thumb: Reducing the cost of 32-bit rise performance in portable and consumer applications,' In Precedings of COMPCON 96, 1996
  3. A. Halambi, A. Shrivastava, P. Biswas, N. Dutt, and A. Nicolau, 'An efficient compiler technique for code size reduction using reduced bi-width ISAs,' In Proc. of Design Automation and Test in Europe(DATE), 2002
  4. A. Krishnaswarmy and R. Gupta, 'Profile Guided Selection of ARM and Thumb Instructions,' CM SIGPLAN Joint Conference on Languages Compilers and Tools for Embedded Systems & Software and Compilers for Embedded Systems (LCTES/SCOPES), Berlin, Germany, June 2002 https://doi.org/10.1145/513829.513840
  5. ARM, 'ARM Software Development Toolkit Version 2.50 User Guide,' ARM DUI 0040D
  6. C. Lee, M. Potkonjak, and W Mangione - smith. MediaBench: A Tool for Evaluating and Synthesizing Multimedia and Communications Systems. In Proceedings of the sth Annual IEEE/ACM International Symposium on Microarchitecture, pages 330-335, Nov. 1997 https://doi.org/10.1109/MICRO.1997.645830
  7. ActiveState Perl Homepage, http://www.activestate.com/