From patchwork Wed Nov 27 04:30:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 294479 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 34BD32C009C for ; Wed, 27 Nov 2013 15:30:26 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=O5zOo0oBLu4eZHnzs kAKNUO9s/uO2qUCIfbdjW3esR3k2fHfHYV8hDoio5jL2pAOu4nsNwdo+5vrxkiFP WX23xVfmOFe5WRCcTRk/fnoWSxayaXFGsYsP0mxRXsGe4UYV66GZhC/9/gOjiXov o3Hs3ajXD7Z50EeSo5izUzBjfw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=ldrAJqhBDyQJ2Ltwoe90Nlu j8Ng=; b=CVOGYbKds9t1JtueHdu61AaOfh2ae5UujVgyUjo+77i9NQw4dND9kfE q6YfEECIqenU8wJB1SD0PJipODipV33fjb696AEgdA6ta7bF3Hzj7Bix675wLJyv j14iK6nIfJp4V/SEkXe+MjKXWyzmx6vVuQLRJrt/8QTJLvunUpLY= Received: (qmail 8180 invoked by alias); 27 Nov 2013 04:30:16 -0000 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 Received: (qmail 8166 invoked by uid 89); 27 Nov 2013 04:30:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.6 required=5.0 tests=BAYES_50, RDNS_NONE, SPF_PASS, URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mail-pb0-f43.google.com Received: from Unknown (HELO mail-pb0-f43.google.com) (209.85.160.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 27 Nov 2013 04:30:14 +0000 Received: by mail-pb0-f43.google.com with SMTP id rq2so9516316pbb.16 for ; Tue, 26 Nov 2013 20:30:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=/ikYaYkfZO7yPiUUc9082e/gxAEXARjeLRhLewPqke0=; b=EcLglj5Zip4DNKB+jz1FC3CLbUT/L3K7ovKBsz5Q6Uh2ngDRVrZR2SMv7qIplfjJLB UI5+5Pm4MqJYRf7QawcuK5YPFe6QEw9YrPtLJPysnQkwv/9zC/UqNLRu0p357KX2c1P8 D5RCU36M5ABiwOZ7+r9EF4XbMwAHx63Hlocy3WTaDnGi7DhMaTGi2i8O0HAcIy/DT3uC HVqV5XEpeU/upRIBfFCvIwDKBXSnWwe3Xc4DMjjrdq/LLUB+ZzZbrY+gMrvleSsyF74d PFSomXjqUwhkWgl8FHFeTWK36t/uNnJ3Z4LvjXBv2R3UwMYG4kiHX5Wgzw965yjzmV1z yemA== X-Gm-Message-State: ALoCoQnyPjSUHmSmcpep3AlPLkPVJ7Jues9cCLQqIYjvbiH67MMlq0nD4efIoyY9fiTSAgqDNREK X-Received: by 10.67.1.101 with SMTP id bf5mr38749501pad.50.1385526606819; Tue, 26 Nov 2013 20:30:06 -0800 (PST) Received: from [192.168.0.100] ([110.151.55.35]) by mx.google.com with ESMTPSA id qv8sm84527040pbc.31.2013.11.26.20.30.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Nov 2013 20:30:05 -0800 (PST) Message-ID: <52957548.8060308@linaro.org> Date: Wed, 27 Nov 2013 15:30:00 +1100 From: Kugan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Richard Earnshaw CC: "gcc-patches@gcc.gnu.org" , "ian@airs.com" , "patches@linaro.org" Subject: Re: [RFC][LIBGCC][2 of 2] 64 bit divide implementation for processor without hw divide instruction References: <52900902.9020602@linaro.org> <52900AEC.2060301@linaro.org> <5294B930.6030608@arm.com> In-Reply-To: <5294B930.6030608@arm.com> X-IsSubscribed: yes On 27/11/13 02:07, Richard Earnshaw wrote: > On 23/11/13 01:54, Kugan wrote: [snip] >> +2013-11-22 Kugan Vivekanandarajah >> + >> + * libgcc/config/arm/pbapi-lib.h (HAVE_NO_HW_DIVIDE): Define for > > It's bpabi-lib.h Thanks for the review. >> + __ARM_ARCH_7_A__. >> + >> >> > > No, this will: > 1) Do the wrong thing for Cortex-a7, A12 and A15 (which all have HW > divide, and currently define __ARM_ARCH_7_A__). > 2) Do the wrong thing for v7-M and v7-R devices, which have Thumb HW > division instructions. > 3) Do the wrong thing for all pre-v7 devices, which don't have HW division. > > I think the correct solution is to test !defined(__ARM_ARCH_EXT_IDIV__) I understand it now and updated the code as attached. +2013-11-27 Kugan Vivekanandarajah + + * config/arm/bpapi-lib.h (TARGET_HAS_NO_HW_DIVIDE): Define for + architectures that does not have hardware divide instruction. + i.e. architectures that does not define __ARM_ARCH_EXT_IDIV__. + Is this OK for trunk now? Thanks, Kugan diff --git a/libgcc/config/arm/bpabi-lib.h b/libgcc/config/arm/bpabi-lib.h index e0e46a6..7c6b489 100644 --- a/libgcc/config/arm/bpabi-lib.h +++ b/libgcc/config/arm/bpabi-lib.h @@ -75,3 +75,7 @@ helper functions - not everything in libgcc - in the interests of maintaining backward compatibility. */ #define LIBGCC2_FIXEDBIT_GNU_PREFIX + +#if (!defined(__ARM_ARCH_EXT_IDIV__)) +# define TARGET_HAS_NO_HW_DIVIDE +#endif