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: 21802 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f70.google.com (mail-pb0-f70.google.com [209.85.160.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0A022202DB for ; Wed, 27 Nov 2013 04:30:10 +0000 (UTC) Received: by mail-pb0-f70.google.com with SMTP id rq2sf17165737pbb.9 for ; Tue, 26 Nov 2013 20:30:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=/ikYaYkfZO7yPiUUc9082e/gxAEXARjeLRhLewPqke0=; b=OQn4n+ruNCw5bUFJbRmg5q5fMEwokbtilO8bwH4UDJV333AW3aRC41XiypVRnkXK6+ p74sRytB2Vr93PgXOrzdBq80SRWxgFUZHcNr+GWM+YoMUBt4nAf8hNCfC97WnYtCkS3F tmEptkt+w6xbvKdFDFpLpvkHRDegzHpYsN4G2DhQiGasyhUMPKGZOSypi/puNg7o7HpC 8zFhKQop3R9ROBv0TWWHCSDO1VyRY2i1v4evJZu4c1MEsLZH/XgCGYcXz1JQ5BXlBI2V TCOiy0w3lliv7MLI1J/Prr7+KCKE3wjgU9RWdrApyROMHqCbBtwspdLOl/NTcV0nxx2v olJA== X-Gm-Message-State: ALoCoQkP8oAacbFdnSuX+HOsMrvnfQL7pt9S6pAeCh6nk9gmCq8IBKqmvD85LvtXGIAW1Rg/FYKb X-Received: by 10.68.197.137 with SMTP id iu9mr1093788pbc.3.1385526609854; Tue, 26 Nov 2013 20:30:09 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.25.42 with SMTP id z10ls2870732qef.63.gmail; Tue, 26 Nov 2013 20:30:09 -0800 (PST) X-Received: by 10.52.98.194 with SMTP id ek2mr27550992vdb.11.1385526609731; Tue, 26 Nov 2013 20:30:09 -0800 (PST) Received: from mail-vb0-f46.google.com (mail-vb0-f46.google.com [209.85.212.46]) by mx.google.com with ESMTPS id mj10si20505757vcb.12.2013.11.26.20.30.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Nov 2013 20:30:09 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.46 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.46; Received: by mail-vb0-f46.google.com with SMTP id i12so4549125vbh.33 for ; Tue, 26 Nov 2013 20:30:09 -0800 (PST) X-Received: by 10.52.171.79 with SMTP id as15mr27955558vdc.1.1385526609182; Tue, 26 Nov 2013 20:30:09 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp257895vcz; Tue, 26 Nov 2013 20:30:07 -0800 (PST) X-Received: by 10.66.7.68 with SMTP id h4mr40103395paa.0.1385526607275; Tue, 26 Nov 2013 20:30:07 -0800 (PST) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id yg5si32613088pbc.56.2013.11.26.20.30.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Nov 2013 20:30:07 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of kugan.vivekanandarajah@linaro.org) client-ip=209.85.160.50; Received: by mail-pb0-f50.google.com with SMTP id rr13so9584536pbb.9 for ; Tue, 26 Nov 2013 20:30:06 -0800 (PST) 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: kugan.vivekanandarajah@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.46 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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