This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/53100] Optimize __int128 with range information
- From: "marc.glisse at normalesup dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 29 Apr 2012 08:05:59 +0000
- Subject: [Bug middle-end/53100] Optimize __int128 with range information
- Auto-submitted: auto-generated
- References: <bug-53100-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53100
--- Comment #1 from Marc Glisse <marc.glisse at normalesup dot org> 2012-04-29 08:05:59 UTC ---
(In reply to comment #0)
> It would be convenient if I
> could just write the whole code with __int128 and let the compiler do the
> optimization by tracking the range of numbers.
The transformation from an __int128 to a pair of long happens extremely late
(optabs.c), so we can't count on tree-vrp to notice that one of them is always
zero (and actually it is either 0 or -1, as a sign extension, which would make
this hard). On the other hand, tree-vrp does have the information that the
differences are in [-4294967295, 4294967295], which comfortably fits in a type
half the size of __int128. It seems a possible strategy would be to have
tree-vrp mark variables that fit in a type half their size (only for TImode?),
try and preserve that information along the way, and finally use it in
expand_doubleword_mult. But that seems to imply storing the information in an
rtx, and rtx seems a bit too densely packed to add this.
Better ideas?