patch libgcc2.c for c4x target

Herman ten Brugge hermantenbrugge@home.nl
Sun Feb 9 13:41:00 GMT 2003


Richard Henderson wrote :
> 
> On Thu, Feb 06, 2003 at 09:35:35PM +0100, Herman ten Brugge wrote:
> > I just checked optabs.c and saw the SImode/DImode code. I agree the
> > patch is not correct without a change to this code as well.
> > The QImode on the c4x target is 32 bits so I see no problem in
> > changing the SImode into mode_for_size (INT_TYPE_SIZE, MODE_INT, 0)
> > and DImode into mode_for_size (LONG_LONG_TYPE_SIZE, MODE_INT, 0) in
> > optabs.c
> > Making this change to optabs.c and the suggested patch to libgcc2.c
> > should work for all targets.
> 
> I've been looking at the optabs.c code and it does seem
> decidedly wrong.  How does the following work for yall
> on c4x and h8300?
> 
> 
> 
> r~
> 
> 
> 
> 	* libgcc-std.ver (__clztf2): New.
> 	(__ctztf2, __popcounttf2, __paritytf2): New.
> 	* libgcc2.c (__clzSI2, __clzDI2, __ctzSI2, __ctzDI2, __popcountSI2,
> 	__popcountDI2, __paritySI2, __parityDI2): Use UWmode and UDWmode;
> 	adjust code to match the different type sizes.
> 	* libgcc2.h (__clzSI2, __ctzSI2, __popcountSI2, __paritySI2,
> 	__clzDI2, __ctzDI2, __popcountDI2, __parityDI2): New macros.
> 
> 	* optabs.c (init_integral_libfuncs): Don't hard-code SImode and
> 	TImode; select word_mode and twice that.
> 	(init_floating_libfuncs): Don't hard-code SFmode and TFmode;
> 	select the modes from float, double, and long double.
> 	(init_optabs): Remove duplicate initializations.
> 

Yes. This patch works correctly for the c4x target. Thanks for fixing this.

	Herman.



More information about the Gcc-patches mailing list