Digital signal processors (DSPs) are special purpose microprocessors optimised for embedded applications that require high arithmetic rates. These devices are often difficult to compile for; compared to modern general purpose processors, DSPs often have very small address spaces. In addition they contain unusual hardware features and they require correct scheduling of operands against pipeline registers to extract the highest levels of available performance. As a result, high level language compilers for these devices generate poor quality code, and are rarely used in practice. Recently, new generation processors have been launched that are very hard to program by hand in assembler because of the complexity of their internal pipelines and arithmetic structures. DSP users are therefore having to migrate to using high level language compilers since this is the only practical development environment. However, there exist large quantities of legacy code written in assembler which represent a significant investment to the user who would like to be able to deploy core algorithms on the new processors without having to re-code from scratch. The article discusses the development and use of a tool to automatically reverse-compile assembler source for the ADSP-21xx family of DSPs to ANSI-C. We include a discussion of the architectural features of the ADSP-21xx processors and the ways in which they assist the translation process. We also identify a series of translation challenges which, in the limit, can only be handled with manual intervention and give some statistics for the frequency with which these pathological cases appear in real applications.
[1]
Georg Sander.
VCG - visualization of compiler graphs
,
1995
.
[2]
Cristina Cifuentes,et al.
Reverse compilation techniques
,
1994
.
[3]
John R. Ellis,et al.
Bulldog: A Compiler for VLIW Architectures
,
1986
.
[4]
Adrian Johnstone,et al.
rdp—an iterator-based recursive descent parser generator with tree promotion operators
,
1998,
SIGP.
[5]
Peter T. Breuer,et al.
Decompilation: the enumeration of types and grammars
,
1994,
TOPL.
[6]
Liu Zongtian,et al.
Design and Implementation Techniques of the 8086 C Decompiling System
,
1995
.
[7]
Micha Sharir,et al.
Structural Analysis: A New Approach to Flow Analysis in Optimizing Compilers
,
2015
.
[8]
Cristina Cifuentes,et al.
Decompilation of binary programs
,
1995,
Softw. Pract. Exp..