This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Implement switch statements with bit tests


On Thu, Jan 23, 2003 at 07:49:30PM -0700, Roger Sayle wrote:
> Here MINVAL is the lowest case value in the switch, RANGE is
> the value MAXVAL - MINVAL, i.e. the highest case value - MINVAL,
> DEFAULT is the default case target.  To work RANGE must be less
> than the number of bits in SImode, i.e. 31 or less on typical
> 32-bit architectures.

I don't see why you're stuck on SImode.

If I'm on a 64-bit target, then I ought to be able to use DImode
as well.  Recall that this is

	1UL << (int)X
not
	1 << (long)X

I also think you ought to find the narrowest mode that fits the
arguments.  If MAXVAL is 15, there's no reason we couldn't use
HImode.



r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]