diff options
author | dim <dim@FreeBSD.org> | 2017-09-05 16:59:19 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2017-09-05 16:59:19 +0000 |
commit | 113c4957913d2af0e1840d9f966d8fb95df4a4fd (patch) | |
tree | 7a30681676c68f1fbd385a21aad75efcceb9c9ea /lib | |
parent | 0cb4674c0939b66b1581c76d61da15df6ab3e6dd (diff) | |
download | FreeBSD-src-113c4957913d2af0e1840d9f966d8fb95df4a4fd.zip FreeBSD-src-113c4957913d2af0e1840d9f966d8fb95df4a4fd.tar.gz |
MFC r323001:
In compiler-rt, a few assembler implementations for i386 floating point
conversion functions use SSE2 instructions, but these are not guarded by
#ifdef __SSE2__, and there is no implementation using general purpose
registers. For these functions, use the generic C variants instead,
otherwise they will cause SIGILL on older processors.
Reported by: bsdpr@phoe.frmug.org
PR: 221733
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libcompiler_rt/Makefile.inc | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/lib/libcompiler_rt/Makefile.inc b/lib/libcompiler_rt/Makefile.inc index 3d05eed..b7b25cb 100644 --- a/lib/libcompiler_rt/Makefile.inc +++ b/lib/libcompiler_rt/Makefile.inc @@ -55,18 +55,12 @@ SRCF+= fixunsxfsi SRCF+= fixunsxfti SRCF+= fixxfdi SRCF+= fixxfti -SRCF+= floatdidf -SRCF+= floatdisf SRCF+= floatditf -SRCF+= floatdixf SRCF+= floatsitf SRCF+= floattidf SRCF+= floattisf SRCF+= floattixf -SRCF+= floatundidf -SRCF+= floatundisf SRCF+= floatunditf -SRCF+= floatundixf SRCF+= floatunsidf SRCF+= floatunsisf SRCF+= floatuntidf @@ -123,6 +117,23 @@ SRCF+= udivti3 SRCF+= umoddi3 SRCF+= umodti3 +# Avoid using SSE2 instructions on i386. +.if ${MACHINE_CPUARCH} == "i386" +SRCS+= floatdidf.c +SRCS+= floatdisf.c +SRCS+= floatdixf.c +SRCS+= floatundidf.c +SRCS+= floatundisf.c +SRCS+= floatundixf.c +.else +SRCF+= floatdidf +SRCF+= floatdisf +SRCF+= floatdixf +SRCF+= floatundidf +SRCF+= floatundisf +SRCF+= floatundixf +.endif + # __cpu_model support, only used on x86 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" SRCF+= cpu_model |