#1127352 gcc-15: Please raise i386 baseline to include MMX, SSE, SSE2 in forky

Package:
gcc-15
Source:
gcc-15
Description:
GNU C compiler
Submitter:
Simon McVittie
Date:
2026-02-16 06:25:01 UTC
Severity:
normal
Tags:
#1127352#5
Date:
2026-02-07 11:10:21 UTC
From:
To:
Package: gcc-15
Severity: wishlist
Tags: forky sid
X-Debbugs-Cc: debian-release@lists.debian.org, debian-amd64@lists.debian.org, bunk@debian.org, llvm-defaults@packages.debian.org
User: debian-qa@lists.debian.org
Usertags: i386
for i386 to be at least i686 + MMX + SSE + SSE2. We already announced in
the Debian 13 release notes that the purpose of the i386 port is to be
run on an x86_64 CPU in a chroot or container, or via multiarch or
multilib. Halfway through the Debian 14 cycle seems like enough of a
grace period before really enforcing this.

Given that announcement (and the fact that Ubuntu similarly only
supports a subset of i386 as a multiarch foreign architecture), if it is
possible to make the 32-bit compiler default to the equivalent of
-march=x86-64 (to use the 32-bit ABI with a baseline that is allowed to 
use any x86-64-v1-compatible instruction), then I think that would be
the best thing to do.

Or, the default could be -march=pentium4 (a closer equivalent of what
LLVM already did). According to gcc documentation, that assumes the
presence of MMX, SSE, SSE2 and FXSR, all of which are guaranteed to be
available in x86-64-v1 according to the psABI
(https://gitlab.com/x86-psABIs/x86-64-ABI/-/blob/master/x86-64-ABI/low-level-sys-info.tex)
if I'm reading correctly.

Either way, it could also be a good improvement to make -mfpmath=sse the
default, which I believe would make arithmetic on i386 behave the same
way as on amd64 and every other release architecture (64-bit rather than
80-bit intermediate values), removing a frequent source of i386-specific
test failures. That could be a subsequent transition rather than part of
raising the baseline, if preferred.

Thanks,
     smcv

#1127352#10
Date:
2026-02-16 06:16:20 UTC
From:
To:
Hi,

I think this should be part of the same transition, as without it, gcc
will often prefer x87 instructions even if SSE is available, because
that is the cheapest way to be compatible to the 32-bit ABI.

For example:

     double square(double num) {
         return num * num;
     }

without -mfpmath=sse becomes

     square(double):
         fld     QWORD PTR [esp+4]
         fmul    st, st(0)
         ret

even if SSE2 is available, because the return value is expected at the
top of the FP stack. With -mfpmath=sse, it is explicitly loaded there:

     square(double):
         sub     esp, 12
         movsd   xmm0, QWORD PTR [esp+16]
         mulsd   xmm0, xmm0
         movsd   QWORD PTR [esp], xmm0
         fld     QWORD PTR [esp]
         add     esp, 12
         ret

    Simon