Abstract
Some codes require computations to use fewer bits of precision than are normal for the target machine. For example, Java requires 32-bit arithmetic even on a 64-bit target. To run narrow codes on a wide target machine, we present a widening transformation. Almost every narrow operation can be widened by sign- or zero-extending the operands and using a target-machine instruction at its natural width. But extensions can sometimes be avoided, and our transformation avoids as many as possible. The key idea is knowing what each operation can accept in the high bits of its arguments and what it can guarantee about the high bits of its result. This knowledge is formalized using fill types, which drive the widening transformation.
Chapter PDF
Similar content being viewed by others
References
Bacon, D.F.: Kava: A Java dialect with a uniform object model for lightweight classes. In: Proceedings of the Joint ACM Java Grande/ISCOPE Conference, Stanford, California, June 2001, pp. 68–77 (2001)
Budiu, M., Sakr, M., Walker, K., Goldstein, S.C.: BitValue inference: Detecting and exploiting narrow bitwidth computations. In: Bode, A., Ludwig, T., Karl, W.C., Wismüller, R. (eds.) Euro-Par 2000. LNCS, vol. 1900, pp. 969–979. Springer, Heidelberg (2000)
Fraser, C.W., Hanson, D.R.: A Retargetable C Compiler: Design and Implementation. Benjamin/Cummings, Redwood City (1995); ISBN 0-8053- 1670-1
Kawahito, M., Komatsu, H., Nakatani, T.: Effective sign extension elimination. In: Proceedings of the ACM SIGPLAN 2002 Conference on Programming Language Design and Implementation, May 2002. SIGPLAN Notices, vol. 37(5), pp. 187–198 (2002); ISSN 0362-1340
Jones, S.L.P., Ramsey, N., Reig, F.: C–: a portable assembly language that supports garbage collection. In: Nadathur, G. (ed.) PPDP 1999. LNCS, vol. 1702, pp. 1–28. Springer, Heidelberg (1999)
Ramsey, N., Davidson, J.W.: Machine descriptions to build tools for embedded systems. In: Müller, F., Bestavros, A. (eds.) LCTES 1998. LNCS, vol. 1474, pp. 176–188. Springer, Heidelberg (1998)
Ramsey, N., Jones, S.L.P.: A single intermediate language that supports multiple implementations of exceptions. In: Proceedings of the ACM SIGPLAN 2000 Conference on Programming Language Design and Implementation, May 2000. SIGPLAN Notices, vol. 35(5), pp. 285–298 (2000)
Razdan, R., Smith, M.D.: A high-performance microarchitecture with hardware-programmable functional units. In: Proceedings of the 27th Annual International Symposium on Microarchitecture, November 1994, pp. 172–180. IEEE/ACM (1994)
Redwine, K., Ramsey, N.: Widening integer arithmetic. Technical Report TR-01-04, Division of Engineering and Applied Sciences, Harvard University (January 2004)
Stephenson, M., Babb, J., Amarasinghe, S.P.: Bitwidth analysis with application to silicon compilation. In: Proceedings of the ACM SIGPLAN 2000 Conference on Programming Language Design and Implementation, May 2000. SIGPLAN Notices, vol. 35(5), pp. 108–120 (2000)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2004 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Redwine, K., Ramsey, N. (2004). Widening Integer Arithmetic. In: Duesterwald, E. (eds) Compiler Construction. CC 2004. Lecture Notes in Computer Science, vol 2985. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-24723-4_16
Download citation
DOI: https://doi.org/10.1007/978-3-540-24723-4_16
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-21297-3
Online ISBN: 978-3-540-24723-4
eBook Packages: Springer Book Archive