about summary refs log tree commit diff
path: root/src/libsyntax/errors
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-05-16 09:46:09 -0700
committerbors <bors@rust-lang.org>2016-05-16 09:46:09 -0700
commit8310de856db8ba78ba3f4c58e3fe6d3d87f2cb4f (patch)
tree52deea39bd5881872b1d8c2130d3a81f9b5e6b6a /src/libsyntax/errors
parentc1ccf97e51ca22ccfa585aec85392cc059bc0e12 (diff)
parent4ec1f8de418a96dc2c5f3e70e4e344fc307569e3 (diff)
downloadrust-8310de856db8ba78ba3f4c58e3fe6d3d87f2cb4f.tar.gz
rust-8310de856db8ba78ba3f4c58e3fe6d3d87f2cb4f.zip
Auto merge of #33429 - ranma42:fix-x87-parsing, r=alexcrichton
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