> > 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.
>
> Cheers,
> Oleg
>