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%의 코드 사이즈를 추가로 줄일 수 있었다.