Verified Compilation and Optimization of Floating-Point Programs in CakeML
Paper in proceeding, 2022

Verified compilers such as CompCert and CakeML have become increasingly realistic over the last few years, but their support for floating-point arithmetic has thus far been limited. In particular, they lack the “fast-math-style” optimizations that unverified mainstream compilers perform. Supporting such optimizations in the setting of verified compilers is challenging because these optimizations, for the most part, do not preserve the IEEE-754 floating-point semantics. However, IEEE-754 floating-point numbers are finite approximations of the real numbers, and we argue that any compiler correctness result for fast-math optimizations should appeal to a real-valued semantics rather than the rigid IEEE-754 floating-point numbers. This paper presents RealCake, an extension of CakeML that achieves end-to-end correctness results for fast-math-style optimized compilation of floating-point arithmetic. This result is achieved by giving CakeML a flexible floating-point semantics and integrating an external proof-producing accuracy analysis. RealCake's end-to-end theorems relate the I/O behavior of the original source program under real-number semantics to the observable I/O behavior of the compiler generated and fast-math-optimized machine code.

compiler optimization

compiler verification

floating-point arithmetic

Author

Heiko Becker

Max Planck Society

Robert Rabe

Technical University of Munich

Eva Darulova

Uppsala University

Magnus Myreen

Chalmers, Computer Science and Engineering (Chalmers), Formal methods

Zachary Tatlock

University of Washington

R. Kumar

DeepMind

Yong Kiam Tan

Carnegie Mellon University (CMU)

Anthony C. J. Fox

ARM Limited

Leibniz International Proceedings in Informatics, LIPIcs

18688969 (ISSN)

Vol. 222 1
9783959772259 (ISBN)

36th European Conference on Object-Oriented Programming, ECOOP 2022
Berlin, Germany,

Subject Categories

Embedded Systems

Computer Science

Computer Systems

DOI

10.4230/LIPIcs.ECOOP.2022.1

More information

Latest update

8/1/2022 1