From patchwork Mon Nov 15 21:29:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Neill X-Patchwork-Id: 71303 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id B3C5AB7105 for ; Tue, 16 Nov 2010 08:30:21 +1100 (EST) Received: (qmail 30233 invoked by alias); 15 Nov 2010 21:30:10 -0000 Received: (qmail 30204 invoked by uid 22791); 15 Nov 2010 21:30:08 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, TW_BD, TW_CL, TW_LZ, TW_ZC, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-ww0-f51.google.com (HELO mail-ww0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 15 Nov 2010 21:29:21 +0000 Received: by wwb17 with SMTP id 17so3200280wwb.8 for ; Mon, 15 Nov 2010 13:29:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.173.194 with SMTP id v44mr3872519wel.100.1289856557687; Mon, 15 Nov 2010 13:29:17 -0800 (PST) Received: by 10.216.235.194 with HTTP; Mon, 15 Nov 2010 13:29:17 -0800 (PST) In-Reply-To: References: <4CCA4375.7090403@redhat.com> <4CD033E3.8060800@redhat.com> <4CD07642.8050607@redhat.com> <4CD2D79C.5050908@redhat.com> <4CD3423F.8080509@redhat.com> <4CD825F2.2030700@redhat.com> Date: Mon, 15 Nov 2010 15:29:17 -0600 Message-ID: Subject: Re: [patch 1/2] AMD bdver2 processors - BMI From: Quentin Neill To: gcc-patches@gcc.gnu.org X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Mon, Nov 15, 2010 at 3:28 PM, Quentin Neill wrote: > On Wed, Nov 10, 2010 at 8:06 PM, H.J. Lu wrote: >> Your checkin caused: >> >> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46422 > > Fixed with the attached, passes bootstrap and make -k check (this time > I compared against the trunk build and did not see any new failures) > > Okay to commit? > -- > Quentin Resend to the patches list, not just H.J. -- Quentin From 05720941c00255ebb50f09b40df118c306b2b7da Mon Sep 17 00:00:00 2001 From: Quentin Neill Date: Mon, 15 Nov 2010 15:21:05 -0600 Subject: [PATCH] Fix PR target/46422 2010-11-15 Quentin Neill PR target/46422 * config/i386/bmiintrin.h (__lzcnt_u16, __lzcnt_u32, __lzcnt_u64): Call the clz builtin. --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/bmiintrin.h | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 03fae9f..dae5a30 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-11-15 Quentin Neill + + PR target/46422 + * config/i386/bmiintrin.h (__lzcnt_u16, __lzcnt_u32, __lzcnt_u64): + Call the clz builtin. + 2010-11-10 Joseph Myers * cfgloop.c (verify_loop_structure): Use %' in diagnostics. Start diff --git a/gcc/config/i386/bmiintrin.h b/gcc/config/i386/bmiintrin.h index d3b3bbd..225f2ec 100644 --- a/gcc/config/i386/bmiintrin.h +++ b/gcc/config/i386/bmiintrin.h @@ -35,13 +35,13 @@ extern __inline unsigned short __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __lzcnt_u16 (unsigned short __X) { - return __builtin_ia32_lzcnt_u16 (__X); + return __builtin_clzs (__X); } extern __inline unsigned short __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __tzcnt_u16 (unsigned short __X) { - return __builtin_ctzs(__X); + return __builtin_ctzs (__X); } @@ -82,14 +82,14 @@ __blsr_u32 (unsigned int __X) extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __lzcnt_u32 (unsigned int __X) { - return __builtin_ia32_lzcnt_u32 (__X); + return __builtin_clz (__X); } extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __tzcnt_u32 (unsigned int __X) { - return __builtin_ctz(__X); + return __builtin_ctz (__X); } @@ -131,13 +131,13 @@ __blsr_u64 (unsigned long long __X) extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __lzcnt_u64 (unsigned long long __X) { - return __builtin_ia32_lzcnt_u64 (__X); + return __builtin_clzll (__X); } extern __inline unsigned long long __attribute__((__gnu_inline__, __always_inline__, __artificial__)) __tzcnt_u64 (unsigned long long __X) { - return __builtin_ctzll(__X); + return __builtin_ctzll (__X); } #endif /* __x86_64__ */ -- 1.7.0.4