This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Path, AVR]: Implement __builtin_avr_fmul* if no hardware multiplier
- From: Denis Chertykov <chertykov at gmail dot com>
- To: Georg-Johann Lay <avr at gjlay dot de>
- Cc: gcc-patches at gcc dot gnu dot org, Eric Weddington <eric dot weddington at atmel dot com>, Anatoly Sokolov <aesok at post dot ru>
- Date: Mon, 4 Jul 2011 16:16:39 +0400
- Subject: Re: [Path, AVR]: Implement __builtin_avr_fmul* if no hardware multiplier
- References: <4E11AB88.4090106@gjlay.de>
2011/7/4 Georg-Johann Lay <avr@gjlay.de>:
> The current implementation of __builtin_avr_fmul/fmuls/fmulsu has a
> gap if no hardware multiplier is available.
>
> This patch closes that gap by providing libgcc implementations named
> __fmul, __fmuls resp. __fmulsu.
>
> The implementations yield the same result as respective FMUL*
> instructions and have been testes against these instructions for all
> possible combinations of input values on an atmega88 device.
>
> Johann
>
>
> Â Â Â Â* doc/extend.texi (AVR Built-in Functions): Update documentation
> Â Â Â Âof __builtin_avr_fmul*.
> Â Â Â Â* config/avr/avr.c (avr_init_builtins): Don't depend on
> Â Â Â ÂAVR_HAVE_MUL.
> Â Â Â Â* config/avr/avr-c.c (avr_cpu_cpp_builtins): Ditto.
> Â Â Â Â* config/avr/avr.md (fmul): Rename to fmul_insn.
> Â Â Â Â(fmuls): Rename to fmuls_insn.
> Â Â Â Â(fmulsu): Rename to fmulsu_insn.
> Â Â Â Â(fmul,fmuls,fmulsu): New expander.
> Â Â Â Â(*fmul.call,*fmuls.call,*fmulsu.call): New Insn.
> Â Â Â Â* config/avr/t-avr (LIB1ASMFUNCS): Add _fmul, _fmuls, _fmulsu.
> Â Â Â Â* config/avr/libgcc.S (__fmul): New function.
> Â Â Â Â(__fmuls): New function.
> Â Â Â Â(__fmulsu,__fmulsu_exit): New function.
>
Approved.
Denis.