This is the mail archive of the
mailing list for the GCC project.
Re: __sdivsi3_i4i and __udivsi3_i4i called for sh2 variant.
- From: Yoshinori Sato <yo-satoh at sios dot com>
- To: Oleg Endo <oleg dot endo at t-online dot de>
- Cc: ysato at users dot sourceforge dot jp, gcc-patches at gcc dot gnu dot org, Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- Date: Tue, 05 Mar 2013 18:02:24 +0900
- Subject: Re: __sdivsi3_i4i and __udivsi3_i4i called for sh2 variant.
- References: <email@example.com> <1362438916.2219.16.camel@yam-132-YW-E178-FTW>
> > Uses a lookup table for divisors in the range -128 .. +128, and
> The code that you have enabled in lib1funcs.S will utilize dynamic shift
> instructions, which are not available on SH1 or SH2. Maybe your target
> HW is SH2A which has dynamic shift instructions and you haven't noticed
> a problem?
> Adding __SH2A__ instead of __SH2__ should be fine though.
> If I'm not mistaken, the __sdivsi3_i4i and __udivsi3_i4i division
> functions will be used by the compiler if the -mdiv=call-table option is
> used. The compiler should reject 'call-table' for SH targets that don't
> have dynamic shifts ... in sh.c there is a check...
> else if (! strcmp (sh_div_str, "call-table") && TARGET_SH2)
> sh_div_strategy = SH_DIV_CALL_TABLE;
> ... which is not quite complete.
> I will prepare a patch for this.