编译器里面有个编译选项Allow reassociation of FP arithmetic --fp_reassoc
是干什么用的 编译快速浮点库的时候有开启
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
编译器里面有个编译选项Allow reassociation of FP arithmetic --fp_reassoc
是干什么用的 编译快速浮点库的时候有开启
你好,这跟浮点库没有关系,用于编译器在编译代码时决定是否关联浮点算法。请参考以下说明:
--fp_reassoc={on|off}
Enables or disables the reassociation of floating-point arithmetic. The
default value is --fp_reassoc=on.
Because floating-point values are of limited precision, and because
floating-point operations round, floating-point arithmetic is neither
associative nor distributive. For instance, (1 + 3e100) - 3e100 is not
equal to 1 + (3e100 - 3e100). If strictly following IEEE 754, the
compiler cannot, in general, reassociate floating-point operations.
Using --fp_reassoc=on allows the compiler to perform the algebraic
reassociation, at the cost of a small amount of precision for some
operations.
When --fp_reassoc=on, RPT MACF32 instructions may be generated.
Because the RPT MACF32 instruction computes two partial sums and
adds them together afterward to compute the entire accumulation, the
result can vary in precision from a serial floating-point multiply
accumulate loop.