From owner-svn-src-stable@freebsd.org  Tue Sep  5 17:35:35 2017
Return-Path: <owner-svn-src-stable@freebsd.org>
Delivered-To: svn-src-stable@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BF51E14C3F;
 Tue,  5 Sep 2017 17:35:35 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id DB2747E37C;
 Tue,  5 Sep 2017 17:35:34 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v85HZY9v075390;
 Tue, 5 Sep 2017 17:35:34 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v85HZYQY075389;
 Tue, 5 Sep 2017 17:35:34 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201709051735.v85HZYQY075389@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric <dim@FreeBSD.org>
Date: Tue, 5 Sep 2017 17:35:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject: svn commit: r323190 - stable/9/lib/libcompiler_rt
X-SVN-Group: stable-9
X-SVN-Commit-Author: dim
X-SVN-Commit-Paths: stable/9/lib/libcompiler_rt
X-SVN-Commit-Revision: 323190
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-stable@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: SVN commit messages for all the -stable branches of the src tree
 <svn-src-stable.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-stable>, 
 <mailto:svn-src-stable-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-stable/>
List-Post: <mailto:svn-src-stable@freebsd.org>
List-Help: <mailto:svn-src-stable-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-stable>,
 <mailto:svn-src-stable-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 05 Sep 2017 17:35:35 -0000

Author: dim
Date: Tue Sep  5 17:35:33 2017
New Revision: 323190
URL: https://svnweb.freebsd.org/changeset/base/323190

Log:
  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
  
  MFC r323014:
  
  Follow-up to r323001: if the actually selected CPUTYPE is capable of
  SSE2 instructions, we can use them.
  
  Suggested by: jkim

Modified:
  stable/9/lib/libcompiler_rt/Makefile
Directory Properties:
  stable/9/   (props changed)
  stable/9/lib/   (props changed)
  stable/9/lib/libcompiler_rt/   (props changed)

Modified: stable/9/lib/libcompiler_rt/Makefile
==============================================================================
--- stable/9/lib/libcompiler_rt/Makefile	Tue Sep  5 17:32:14 2017	(r323189)
+++ stable/9/lib/libcompiler_rt/Makefile	Tue Sep  5 17:35:33 2017	(r323190)
@@ -65,15 +65,9 @@ SRCF=	absvdi2 \
 	fixunsxfti \
 	fixxfdi \
 	fixxfti \
-	floatdidf \
-	floatdisf \
-	floatdixf \
 	floattidf \
 	floattisf \
 	floattixf \
-	floatundidf \
-	floatundisf \
-	floatundixf \
 	floatunsidf \
 	floatunsisf \
 	floatuntidf \
@@ -125,6 +119,23 @@ SRCF=	absvdi2 \
 	udivti3 \
 	umoddi3 \
 	umodti3
+
+# Avoid using SSE2 instructions on i386, if unsupported.
+.if ${MACHINE_CPUARCH} == "i386" && empty(MACHINE_CPU:Msse2)
+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
 
 # These are already shipped by libc.a on arm and mips
 .if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"