# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/ioquake3/i586-sse-target.patch # Copyright (C) 2026 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 or patched project license # --- T2-COPYRIGHT-END --- Mark the runtime-dispatched SSE inline asm functions with a target attribute, so they build for non-SSE baselines (e.g. -march=i586), also when LTO re-generates code without per-file flags. Signed-off-by: René Rebe --- a/code/asm/snapvector.c +++ b/code/asm/snapvector.c @@ -35,7 +36,7 @@ static unsigned char ssemask[16] __attri "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x00" }; -void qsnapvectorsse(vec3_t vec) +__attribute__((target("sse2"))) void qsnapvectorsse(vec3_t vec) { __asm__ volatile ( --- a/code/asm/ftola.c +++ b/code/asm/ftola.c @@ -29,7 +30,7 @@ static const unsigned short fpucw = 0x0C * GNU inline asm ftol conversion functions using SSE or FPU */ -long qftolsse(float f) +__attribute__((target("sse"))) long qftolsse(float f) { long retval; @@ -43,7 +44,7 @@ long qftolsse(float f) return retval; } -int qvmftolsse(void) +__attribute__((target("sse"))) int qvmftolsse(void) { int retval;