From patchwork Mon Nov 25 23:27:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Stump X-Patchwork-Id: 294139 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 A1BAF2C0089 for ; Tue, 26 Nov 2013 10:28:04 +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 :content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; q=dns; s= default; b=Sf0Mw8msJ7mea2K4DWWjNO4dB49kcGLmhcEGLQeFgJHM9pIiFUHys oCJdsmUW9jtIVknoRVM+MlldREhH274lrybucjMrzvhLnSFEvC9JEFy+9GUZuDvx uH+4ZpRJ/PQGc+cTu2ec4OhLyD96dzSBYwmn99XgR1zZgIAxGiV1hQ= 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 :content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=default; bh=8A7LzY7lRuRFrRhg6xr82VKeC2Q=; b=Vq9eUDcMwCgk1CsWPSizIq6Guxtd R2+BHCqPl4QjDddryZCC1xNuRHXThGPSHVX1682WfiATdcOPsImxE24MDScBWdm3 XpOBOu7aWfICnY2MOQQi5r8NPDJgllU+hkx1UIfpbxnXcIhCyRHbGkn4LR42MjyU mIEKi8JpUxpgqGw= Received: (qmail 31304 invoked by alias); 25 Nov 2013 23:27:55 -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 31291 invoked by uid 89); 25 Nov 2013 23:27:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL, BAYES_50, FREEMAIL_FROM, RDNS_NONE, SPF_PASS, URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: qmta10.emeryville.ca.mail.comcast.net Received: from Unknown (HELO qmta10.emeryville.ca.mail.comcast.net) (76.96.30.17) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 25 Nov 2013 23:27:54 +0000 Received: from omta11.emeryville.ca.mail.comcast.net ([76.96.30.36]) by qmta10.emeryville.ca.mail.comcast.net with comcast id tywf1m0030mlR8UAAzTmu4; Mon, 25 Nov 2013 23:27:46 +0000 Received: from up.mrs.kithrup.com ([24.4.193.8]) by omta11.emeryville.ca.mail.comcast.net with comcast id tzTl1m00U0BKwT48XzTmb8; Mon, 25 Nov 2013 23:27:46 +0000 Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: wide-int, arc From: Mike Stump In-Reply-To: Date: Mon, 25 Nov 2013 15:27:45 -0800 Cc: "gcc-patches@gcc.gnu.org Patches" , Kenneth Zadeck Message-Id: References: <3D9B9EED-1787-463F-8E6A-1EBCA54598EC@comcast.net> To: Joern Rennecke X-IsSubscribed: yes On Nov 23, 2013, at 5:19 PM, Joern Rennecke wrote: > wide-int.h says widest_int is always signed, yet the iterations count > in the doloop interface is now unsigned. So, which is right, the code > or the documentation? The interface for TARGET_CAN_USE_DOLOOP_P's iteration parameter is documented to be const widest_int&. The documentation suggests that only non-negative values are actually used. I don't view this as much different from an int parameter that is documented as being 0 or 1. You are free to think of it as signed, because int is signed, or unsigned, as the values 0 and 1 are both non-negative. The type of formal parameter is signed. Does that help? > I see that dfp.c and vax.c directly include wide-int.h, > but aarch64.c and arc.c don't. Is that safe? Certainly it is reasonable to include this, and by doing this, one doesn't have to worry if another header changes to not include it. Ok for the patch directly below? Index: gcc/ChangeLog.wide-int =================================================================== --- gcc/ChangeLog.wide-int (revision 205365) +++ gcc/ChangeLog.wide-int (working copy) @@ -43,7 +43,7 @@ * config/aarch64/aarch64.c (aapcs_vfp_sub_candidate): Use wide-int interfaces. (aarch64_float_const_representable_p): Likewise. - * config/arc/arc.c + * config/arc/arc.c: Include wide-int.h. (arc_can_use_doloop_p): Use wide-int interfaces. * config/arm/arm.c (aapcs_vfp_sub_candidate): Use wide-int interfaces. Index: gcc/config/arc/arc.c =================================================================== --- gcc/config/arc/arc.c (revision 205364) +++ gcc/config/arc/arc.c (working copy) @@ -66,6 +66,7 @@ along with GCC; see the file COPYING3. #include "tree-pass.h" #include "context.h" #include "pass_manager.h" +#include "wide-int.h" /* Which cpu we're compiling for (A5, ARC600, ARC601, ARC700). */ static const char *arc_cpu_string = "";