From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6652 invoked by alias); 10 Jan 2007 19:31:06 -0000 Received: (qmail 6635 invoked by uid 22791); 10 Jan 2007 19:31:05 -0000 X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 10 Jan 2007 19:30:57 +0000 Received: from sunsite.mff.cuni.cz (localhost.localdomain [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.8/8.13.8) with ESMTP id l0AJXaka016850; Wed, 10 Jan 2007 20:33:36 +0100 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.13.8/8.13.8/Submit) id l0AJXZ9G016849; Wed, 10 Jan 2007 20:33:35 +0100 Date: Wed, 10 Jan 2007 19:31:00 -0000 From: Jakub Jelinek To: Ulrich Drepper Cc: Glibc hackers Subject: [PATCH] Fix x86_64 __FP_CLZ Message-ID: <20070110193335.GA3819@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2007-01/txt/msg00003.txt.bz2 Hi! bsrq %rdx, %eax ins not a valid instruction. While we could tweak these macros to store result in the same sized variable as input and only then copy to r and furthermore handle the various sizeof (x) cases, GCC 3.4+ contains __builtin_clz{,l,ll} and the generic soft-fp.h definition already handles that all (plus __builtin_clz expands to bsrl on i?86/x86_64 and __builtin_clzl on x86_64 to bsrq). 2007-01-10 Jakub Jelinek * sysdeps/i386/soft-fp/sfp-machine.h (__FP_CLZ): Remove. * sysdeps/x86_64/soft-fp/sfp-machine.h (__FP_CLZ): Likewise. --- libc/sysdeps/i386/soft-fp/sfp-machine.h.jj 2002-11-01 22:49:28.000000000 +0100 +++ libc/sysdeps/i386/soft-fp/sfp-machine.h 2007-01-10 12:15:01.000000000 +0100 @@ -27,12 +27,6 @@ : "0"(xh), "1"(xl), "g"(yh), "g"(yl) \ : "cc") -#define __FP_CLZ(r, x) \ - do { \ - __asm__("bsrl %1,%0" : "=r"(r) : "g"(x) : "cc"); \ - r ^= 31; \ - } while (0) - #define _i386_mul_32_64(rh, rl, x, y) \ __asm__("mull %2" : "=d"(rh), "=a"(rl) : "%g"(x), "1"(y) : "cc") --- libc/sysdeps/x86_64/soft-fp/sfp-machine.h.jj 2002-11-01 22:49:29.000000000 +0100 +++ libc/sysdeps/x86_64/soft-fp/sfp-machine.h 2007-01-10 12:13:31.000000000 +0100 @@ -3,12 +3,6 @@ #define _FP_WS_TYPE signed long #define _FP_I_TYPE long -#define __FP_CLZ(r, x) \ - do { \ - __asm__("bsrq %1,%0" : "=r"(r) : "g"(x) : "cc"); \ - r ^= 63; \ - } while (0) - #define _FP_NANFRAC_S _FP_QNANBIT_S #define _FP_NANFRAC_D _FP_QNANBIT_D, 0 #define _FP_NANFRAC_Q _FP_QNANBIT_Q, 0, 0, 0 Jakub