about summary refs log tree commit diff
path: root/src/libsyntax/errors
diff options
context:
space:
mode:
authorAndrea Canciani <ranma42@gmail.com>2016-05-04 16:08:21 +0200
committerAndrea Canciani <ranma42@gmail.com>2016-05-13 15:18:31 +0200
commit78124a2b32d61a3ab1cc5798828195970438262b (patch)
tree7a4b4a8f796de72bb3afe2c48a77d4d3d9adaef2 /src/libsyntax/errors
parenta581c82bdc2c13a398b091878d7353bc3d097d59 (diff)
downloadrust-78124a2b32d61a3ab1cc5798828195970438262b.tar.gz
rust-78124a2b32d61a3ab1cc5798828195970438262b.zip
Fix fast path of float parsing on x87
The fast path of the float parser relies on the rounding to happen
exactly and directly to the correct number of bits. On x87, instead,
double rounding would occour as the FPU stack defaults to 80 bits of
precision.

This can be fixed by setting the precision of the FPU stack before
performing the int to float conversion. This can be achieved by
changing the value of the x87 control word. This is a somewhat common
operation that is in fact performed whenever a float needs to be
truncated to an integer, but it is undesirable to add its overhead for
code that does not rely on x87 for computations (i.e. on non-x86
architectures, or x86 architectures which perform FPU computations on
using SSE).

Fixes `num::dec2flt::fast_path_correct` (on x87).
Diffstat (limited to 'src/libsyntax/errors')
0 files changed, 0 insertions, 0 deletions