Skip to content

Commit 8559fb8

Browse files
eendebakptclaude
andcommitted
Fix i686 Windows JIT: use x87 FPU instead of SSE for stencils
Add -mno-sse to clang args for i686-pc-windows-msvc target. The COFF32 stencil converter cannot handle _xmm register references that clang emits for inline float arithmetic. Using x87 FPU instructions avoids this. SSE is optional on 32-bit x86; x87 is the baseline. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 637803c commit 8559fb8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Tools/jit/_targets.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,9 @@ def get_target(host: str) -> _COFF32 | _COFF64 | _ELF | _MachO:
594594
host = "i686-pc-windows-msvc"
595595
condition = "defined(_M_IX86)"
596596
# -Wno-ignored-attributes: __attribute__((preserve_none)) is not supported here.
597-
args = ["-DPy_NO_ENABLE_SHARED", "-Wno-ignored-attributes"]
597+
# -mno-sse: Use x87 FPU instead of SSE for float math. The COFF32
598+
# stencil converter cannot handle _xmm register references.
599+
args = ["-DPy_NO_ENABLE_SHARED", "-Wno-ignored-attributes", "-mno-sse"]
598600
optimizer = _optimizers.OptimizerX86
599601
target = _COFF32(host, condition, args=args, optimizer=optimizer)
600602
elif re.fullmatch(r"x86_64-apple-darwin.*", host):

0 commit comments

Comments
 (0)