Skip to main content Accessibility help
×
Hostname: page-component-78c5997874-g7gxr Total loading time: 0 Render date: 2024-11-08T17:38:34.148Z Has data issue: false hasContentIssue false

3 - Software compilation

Published online by Cambridge University Press:  03 May 2010

Ryan Kastner
Affiliation:
University of California, San Diego
Anup Hosangadi
Affiliation:
University of California, Santa Barbara
Farzan Fallah
Affiliation:
Stanford University, California
Get access

Summary

Chapter overview

To further motivate the techniques described in this book, we demonstrate the situations in which they are useful and the manner in which they fit into the design flow. Arithmetic optimizations are applicable when writing software as well as during the design of hardware components. This chapter gives a high-level overview of the software compilation process. We start by describing the basic structure of a modern compiler. Then we provide more detail about the compilation process including the place where arithmetic optimizations can be implemented. Finally, we describe the algebraic transformations that are used in current compilers. These include dataflow optimization, CSE, value numbering, loop invariant code motion, partial redundancy elimination (PRE), operator strength reduction, and the Horner form.

Basic software compiler structure

A compiler is used to reduce the complexity of designing digital systems. Quite simply, it transforms an input specification written in some high-level language into another language which is almost always at a lower level of abstraction. Perhaps the most common example is a software compiler, which takes source code written in some high-level programming language (e.g., C/C++, Java) into object code specified by an assembly or machine language for programming a microprocessor (e.g., Intel x86, SPARC, MIPS).

A compiler provides several benefits including:

  1. (1) Raising the level of abstraction to allow the programmer to reason about the problem in a high-level language, which is often more efficient.

  2. (2) Performing trivial and/or tedious transformations, e.g., converting assembly code into binary code.

  3. (3) Finding obvious semantic and syntactic mistakes in the specification.

  4. […]

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 2010

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Muchnick, S. S., Advanced Compiler Design and Implementation. San Francisco, CA: Morgan Kaufmann Publishers, 1997.Google Scholar
Kennedy, K. and Allen, J. R., Optimizing Compilers for Modern Architectures: A Dependence-based Approach. San Francisco, CA: Morgan Kaufmann Publishers, 2001.Google Scholar
Levine, J. R., Mason, T., and Brown, D., Lex & yacc, second edition. Sebastopol, CA: O'Reilly & Associates, 1995.Google Scholar
Cocke, J. and Schwartz, J. T., Programming Languages and Their Compilers: Preliminary Notes, Technical Report, Courant Institute of Mathematical Sciences, New York University, 1970.Google Scholar
Reif, J. R. and Lewis, H. R., Symbolic evaluation and the global value graph, Proceedings of the 4th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, Los Angeles, 1977, pp. 104–18. New York, NY: ACM, 1977.Google Scholar
Alpern, B., Wegman, M. N. and Zadeck, F. K., Detecting equality of variables in programs, Proceedings of the 15th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, San Diego, 1988, pp. 1–11. New York, NY: ACM, 1988.Google Scholar
Sinha, A. and Chandrakasan, A. P., JouleTrack – a web based tool for software energy profiling, Proceedings of the 38th Conference on Design Automation, Las Vegas, 2001. pp. 220–225. New York, NY: ACM, 2001.Google Scholar
http://www.gnu.org/software/libc/
Hosangadi, A., Fallah, F. and Kastner, R., Factoring and eliminating common subexpressions in polynomial expressions, Proceedings of the 2004 IEEE/ACM International Conference on Computer-aided Design, San Jose, 2004, pp. 169–174. Washington, DC: IEEE Computer Society, 2004.Google Scholar
Nurnberger, G., Schmidt, J. W. and Walz, G., Multivariate Approximation and Splines. Basel: Birkhäuser, 1997.CrossRefGoogle Scholar

Save book to Kindle

To save this book to your Kindle, first ensure [email protected] is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Software compilation
  • Ryan Kastner, University of California, San Diego, Anup Hosangadi, University of California, Santa Barbara, Farzan Fallah, Stanford University, California
  • Book: Arithmetic Optimization Techniques for Hardware and Software Design
  • Online publication: 03 May 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511712180.004
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Software compilation
  • Ryan Kastner, University of California, San Diego, Anup Hosangadi, University of California, Santa Barbara, Farzan Fallah, Stanford University, California
  • Book: Arithmetic Optimization Techniques for Hardware and Software Design
  • Online publication: 03 May 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511712180.004
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Software compilation
  • Ryan Kastner, University of California, San Diego, Anup Hosangadi, University of California, Santa Barbara, Farzan Fallah, Stanford University, California
  • Book: Arithmetic Optimization Techniques for Hardware and Software Design
  • Online publication: 03 May 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511712180.004
Available formats
×