Using G ++ with -fat-math to achieve loop's vectoring Why is it mandatory to double ? I do not like - big-math because I do not want to lose accuracy.
You do not necessarily need to lose accuracy with -fast-math . It only affects the operation of nyan , inf etc. and the order in which the operation is carried out.
If you have a specific code, you can mark the variables using the asm statement if you do not want GCC to reorder or simplify computation. For example, the following code performs a rounding operation on f . However, two f + = g and f - = g functions can be customized by GCC:
Fixed double moo ( Double f, double g) {g * = 4503599627370496.0; // 2 ** 52f + = g; F - = g; Return; } On x86_64, you can use this asm statement to instruct GCC to not do this optimization:
fixed double moo (double f, double g) {g * = 4503599627370496.0; // 2 ** 52f + = g; __asm __ ("": "+ x" (f)); F - = g; Return; } You will need to customize it for each architecture, unfortunately. On PowerPC, use + f instead of + x .
Comments
Post a Comment