diff mbox

wide-int, arc

Message ID CCD9E62A-BED7-43F4-A1CF-3FF5EB743F06@comcast.net
State New
Headers show

Commit Message

Mike Stump Nov. 25, 2013, 11:27 p.m. UTC
On Nov 23, 2013, at 5:19 PM, Joern Rennecke <joern.rennecke@embecosm.com> 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?

Comments

Joern Rennecke Nov. 26, 2013, 12:31 a.m. UTC | #1
On 25 November 2013 23:27, Mike Stump <mikestump@comcast.net> wrote:
> 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?

OK.
Mike Stump Nov. 26, 2013, 1:25 a.m. UTC | #2
On Nov 25, 2013, at 4:31 PM, Joern Rennecke <joern.rennecke@embecosm.com> wrote:
> On 25 November 2013 23:27, Mike Stump <mikestump@comcast.net> wrote:
>> 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?
> 
> OK.

Oh, and I did mean to ask, Ok? for the original patch as well.
Joern Rennecke Nov. 26, 2013, 1:29 a.m. UTC | #3
On 26 November 2013 01:25, Mike Stump <mikestump@comcast.net> wrote:

> Oh, and I did mean to ask, Ok? for the original patch as well.

Yes.
diff mbox

Patch

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 = "";