Re: Floating point on 32-bit x86: x87 precision (XPFPA) and fpmath=sse

From: Date: Mon, 23 Nov 2026 08:02:24 +0000
Subject: Re: Floating point on 32-bit x86: x87 precision (XPFPA) and fpmath=sse
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-133199@lists.php.net to get a copy of this message
Hi fennic, > On 22.11.2026 18:18 CET fennic log <fenniclog@gmail.com> wrote: > > > On Wed, 11 Nov 2026 at 08:18, <marc@mabe.berlin> wrote: > > > > > > > > On 8.11.2026 15:25 CET Sjoerd Langkemper <sjoerd-php@linuxonly.nl > > > mailto:sjoerd-php@linuxonly.nl> wrote: > > > > > > > > > On Sun, Nov 8, 2026, at 14:17, marc@mabe.berlin > > > mailto:marc@mabe.berlin wrote: > > > > > > > Can we enable -msse2 -mfpmath=sse by default on > > > > x86 (require SSE2). > > > > > > > > > > Yes. As I understand it we are not really interested in supporting actual 32 bit > > > hardware, but running 32 bit builds on WASM or to save memory. So breaking compatibility with old > > > CPUs seems fair. > > > > > I have opened a PR to enable SSE2 and fpmath=sse on x86 by default without configure > > option. https://github.com/php/php-src/pull/25362 > > > > > > > > I think Windows already requires SSE2? > > > > > Windows builds should use SSE2 via > > --enable-native-intrinsics=sse2 and should enable it for double > > arithmetic. I do not have windows to verify this. > > > > > > I didnt see this maillist come, but wouldn't it be better to default to the AMD64_v2 > instruction set. > Starting last year, linux distro's started setting this as the minimum requirement for > their distributions. > This equates to the following extensions: > * CMPXCHG16B > * LAHF-SAHF > * POPCNT > * SSE3 > * SSE4.1 > * SSE4.2 > * SSSE3 > > SSSE3 being released in 2006 - 20 years ago. > This thread (and the PR) is about 32-bit x86 builds only. "AMD64_v2 instruction set" is 64-bit where doubles get compute with SSE2 by default anyway and none of them would enable fpmath=sse on 32-bit on it's own. We could think about enabling other instruction sets as well but this should be discussed on it's own thread. Marc Bennewitz

« previous php.internals (#133199) next »