[trunk]: Patch to move BITS_PER_UNIT to be available for genmodes.c

Kenneth Zadeck zadeck@naturalbridge.com
Thu Dec 12 01:35:00 GMT 2013



This patch is for the trunk, but it solves a problem that comes up for 
wide-int.   For wide-int we need to have the BITS_PER_UNIT available 
earlier.    So this patch sets the default value (8) in genmodes.c so 
that it is available by anyone who includes insn-modes.h.  The generator 
for tm.h was modified to include insn-modes.h.    The value for 
BITS_PER_UNIT can be overridden by any port by placing a define for it 
in their target modes file.

This patch removes the definition of BITS_PER_UNIT from 7 platform .h 
files.   All of those platforms initialized it to the default value so 
there was no need for additions to their target modes file.

In addition, this target also changes the way that 
MAX_BITSIZE_MODE_ANY_INT is calculated.    The value is heavily used on 
the wide-int branch to allocate buffers that are used to hold large 
integer values.   The change in the way it is computed was motivated by 
the i386 port, but there may be other ports that have the same 
problem.   The i386 port defines two very large integer modes that are 
only used as containers for large vectors.   They are never used for 
large integers.  The new way of computing this allows a port to say 
(very early) that some of these integer modes are never used to hold 
numbers and so smaller buffers can be used for integer calculations.   
Other ports that play the same game should follow suit.

This patch has been bootstrapped and regression tested on x86-64. Ok to 
commit?

Kenny
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MaxBits1.diff
Type: text/x-patch
Size: 9491 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20131212/9b927795/attachment.bin>


More information about the Gcc-patches mailing list