Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Jul 2018 14:42:20 +0000 (UTC)
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r336739 - head/lib/libc/powerpcspe/gen
Message-ID:  <201807261442.w6QEgKWU061041@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhibbits
Date: Thu Jul 26 14:42:20 2018
New Revision: 336739
URL: https://svnweb.freebsd.org/changeset/base/336739

Log:
  Fix fabs(3) for powerpcspe, this time for real
  
  SPE ABI uses the soft-float ABI, which splits doubles into two words.  As such,
  fabs(3) cannot work on a double directly.  It's too costly to convert the
  argument pair into a single double to use efdabs, so clear the top bit of the
  high word, which is the sign bit.

Modified:
  head/lib/libc/powerpcspe/gen/fabs.S

Modified: head/lib/libc/powerpcspe/gen/fabs.S
==============================================================================
--- head/lib/libc/powerpcspe/gen/fabs.S	Thu Jul 26 14:15:04 2018	(r336738)
+++ head/lib/libc/powerpcspe/gen/fabs.S	Thu Jul 26 14:42:20 2018	(r336739)
@@ -31,7 +31,8 @@ __FBSDID("$FreeBSD$");
  * double fabs(double)
  */
 ENTRY(fabs)
-	efdabs	%r3,%r3
+	/* arg is split in two words, clear sign bit only, in r3. */
+	clrlwi	%r3,%r3,1
 	blr
 END(fabs)
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807261442.w6QEgKWU061041>