[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Emacs using SSE2 on x86
From: |
Paul Eggert |
Subject: |
Emacs using SSE2 on x86 |
Date: |
Sat, 4 Jul 2020 09:27:11 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 |
Bug#42147 reports that Emacs floating-point rounds differently on x86 than on
all other platforms, and in its Message #104 I propose a patch to fix this by
using GCC's -msse2 -mfpmath=sse options. This patch is needed on GNU/Linux
systems; it should be irrelevant on macOS (where SSE2 has always been required)
or on MS-Windows development systems (where SSE2 has been the default since
2012).
The patch cajoles GCC and similar compilers into using 64-bit floating point
instead of erratically substituting 80-bit floating point. Although using 80
bits can improve accuracy, it means the numbers disagree with other platforms
and (as Bug#42147 notes) this is more of a problem for Emacs than any lost
accuracy.
The patch relies on SSE2 instructions on the x86, which were introduced in 2000
and which have by now become universal. I don't see a downside of requiring SSE2
for GCC etc., because as far as I can see, in the GNU/Linux world the only
people running 32-bit Emacs on Intelish platforms nowadays are using AMD64 Linux
kernels and compiling with 'gcc -m32', and AMD64 requires SSE2 anyway. However,
I thought I'd mention this on emacs-devel in case I'm missing something.
- Emacs using SSE2 on x86,
Paul Eggert <=