gcc/
commiteafea251b1c9d71413ae8cbb0d5eb2460c5f0560
authorgjl <gjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 8 Feb 2013 10:13:37 +0000 (8 10:13 +0000)
committergjl <gjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 8 Feb 2013 10:13:37 +0000 (8 10:13 +0000)
treec41ab849c5ffa4c56a753d5d4502a23fdc14617d
parent1032e48dc8189b1acbe98851508d9214951fd3c4
gcc/
PR target/54222
* config/avr/avr.md (unspec) <UNSPEC_ROUND>: Add.
* config/avr/avr-fixed.md (ALL4QA, ALL124QA): New mode iterators.
(round<mode>3, round<mode>3_const): New expanders for fixed-mode.
(*round<mode>3.libgcc): New insns for fixed-modes.
* config/avr/builtins.def (ABSxx): Use a non-NULL LIBNAME.
(ROUNDxx, COUNTLSxx, BITSxx, xxBITS): New DEF_BUILTINs.
(ROUNDFX, COUNTLSFX, ABSFX): New DEF_BUILTINs.
* config/avr/stdfix.h (absFX, bitsFX, FXbits): Remove inline
implementations.  Define to __builtin_avr_absFX,
__builtin_avr_bitsFX, __builtin_avr_FXbits, respectively.
(roundFX, countlsFX): Define to __builtin_avr_roundFX,
__builtin_avr_countlsFX, respectively.
* config/avr/avr-c.c (target.h): Include it.
(enum avr_builtin_id): New enum.
(avr_resolve_overloaded_builtin): New static function.
(avr_register_target_pragmas): Use it to set
targetm.resolve_overloaded_builtin.
* config/avr/avr.c (avr_init_builtins): Supply myriads of local
tree nodes used by DEF_BUILTIN.
(avr_expand_builtin) <AVR_BUILTIN_ROUNDxx>: Sanity-check them.
(avr_fold_builtin) <AVR_BUILTIN_BITSxx>: Fold to VIEW_COVERT_EXPR.
<AVR_BUILTIN_xxBITS>: Same.

libgcc/
PR target/54222
* config/avr/lib2funcs.c: New C sources for modules for libgcc.a.
* config/avr/lib2-object.mk: New iterator to build objects from it.
* config/avr/t-avr: Iterate lib2-object.mk to build objects from
lib2funcs.c.
(LIB2FUNCS_EXCLUDE): Add _clrsbdi2.
(LIB1ASMFUNCS): Add: _ssabs_1, _mask1, _ret, _roundqq3, _rounduqq3,
_round_s2, _round_u2, _round_2_const, _addmask_2, _round_s4,
_round_u4, _round_4_const, _addmask_4, _round_x8, _rounddq3
_roundudq3, _roundda3 _rounduda3, _roundta3 _rounduta3.
* config/avr/lib1funcs-fixed.S: Implement them.

gcc/testsuite/
PR target/54222
* gcc.target/avr/torture/builtins-4-roundfx.c: New test.
* gcc.target/avr/torture/builtins-5-countlsfx.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195878 138bc75d-0d04-0410-961f-82ee72b054a4
16 files changed:
gcc/ChangeLog
gcc/config/avr/avr-c.c
gcc/config/avr/avr-fixed.md
gcc/config/avr/avr.c
gcc/config/avr/avr.md
gcc/config/avr/builtins.def
gcc/config/avr/stdfix.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/avr/torture/builtins-4-roundfx.c [new file with mode: 0644]
gcc/testsuite/gcc.target/avr/torture/builtins-5-countlsfx.c [new file with mode: 0644]
libgcc/ChangeLog
libgcc/config/avr/lib1funcs-fixed.S
libgcc/config/avr/lib1funcs.S
libgcc/config/avr/lib2-object.mk [new file with mode: 0644]
libgcc/config/avr/lib2funcs.c [new file with mode: 0644]
libgcc/config/avr/t-avr