We describe various issues caused by the lack of rounding in the gcc compiler implementation of the fixed-point arithmetic data types and operations. We demonstrate that there is no rounding in the conversion of constants, conversion from one numerical type to a less precise type and results of multiplications. Furthermore, we show that mixed-precision operations of fixed-point arithmetic lose precision on arguments, even before carrying out arithmetic operations. The ISO 18037:2008 standard was created to standardize C language extensions, including fixed-point arithmetic, for embedded systems. Embedded systems are usually based on ARM processors, of which approximately 100 billion were manufactured by now. Therefore, the observations about numerical issues that we show in this paper can be rather dangerous and are important to address, given a wide ranging types of applications that these embedded systems are running.
翻译:我们描述了由于在Gcc计算数据类型和操作的Gcc汇编实施过程中没有四舍五入而导致的各种问题。我们证明,在常数转换、从一个数字类型转换到一个不太精确的类型和乘数结果方面没有四舍五入。此外,我们表明,固定点算术的混合精度操作甚至在进行算术操作之前就失去了对参数的精确度。ISO 18037:2008标准是为了实现嵌入系统的C语言扩展标准化,包括固定点算术。嵌入式系统通常以ARM处理器为基础,其中大约1 000亿台已经制造出来。因此,我们在本文件中就数字问题提出的观察可能相当危险,而且鉴于这些嵌入系统正在运行的广泛应用,对于解决这些数字问题非常重要。