From 0dbca30748132482886593434b14d7242cdee9ad Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Mon, 11 Apr 2005 03:06:13 +0000 Subject: [PATCH] quadlib.c (_U_Qfneg): Toggle sign bit instead of subtracting from zero. * pa/quadlib.c (_U_Qfneg): Toggle sign bit instead of subtracting from zero. From-SVN: r97961 --- gcc/ChangeLog | 5 +++++ gcc/config/pa/quadlib.c | 14 +++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8824718..8a0a77b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-04-10 John David Anglin + + * pa/quadlib.c (_U_Qfneg): Toggle sign bit instead of subtracting from + zero. + 2005-04-10 Kazu Hirata * config/arm/arm.c: Fix a comment typo. diff --git a/gcc/config/pa/quadlib.c b/gcc/config/pa/quadlib.c index 6dbfdcf..c377417 100644 --- a/gcc/config/pa/quadlib.c +++ b/gcc/config/pa/quadlib.c @@ -1,5 +1,5 @@ /* Subroutines for long double support. - Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. @@ -160,11 +160,19 @@ _U_Qfcomp (long double a, long double b) } -/* This violates the IEEE standard. It is better to multiply by -1.0L. */ +/* Negate long double A. */ long double _U_Qfneg (long double a) { - return (0.0L - a); + union + { + long double ld; + int i[4]; + } u; + + u.ld = a; + u.i[0] ^= 0x80000000; + return u.ld; } #ifdef __LP64__ -- 2.7.4