85d768f349
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. From-SVN: r195878
24 lines
864 B
Makefile
24 lines
864 B
Makefile
# This file is included several times in a row, once for each element of
|
|
# $(iter-items). On each inclusion, we advance $o to the next element.
|
|
# $(iter-labels) and $(iter-flags) are also advanced.
|
|
# This works similar to $(srcdir)/siditi-object.mk.
|
|
|
|
o := $(firstword $(iter-items))
|
|
iter-items := $(filter-out $o,$(iter-items))
|
|
|
|
$o-label := $(firstword $(iter-labels))
|
|
iter-labels := $(wordlist 2,$(words $(iter-labels)),$(iter-labels))
|
|
|
|
$o-flag := $(firstword $(iter-flags))
|
|
iter-flags := $(wordlist 2,$(words $(iter-flags)),$(iter-flags))
|
|
|
|
$o$(objext): %$(objext): $(srcdir)/config/avr/lib2funcs.c
|
|
$(gcc_compile) -DL_$($*-label) -DL_LABEL=$($*-label) $($*-flag) \
|
|
-c $< $(vis_hide)
|
|
|
|
ifeq ($(enable_shared),yes)
|
|
$(o)_s$(objext): %_s$(objext): $(srcdir)/config/avr/lib2funcs.c
|
|
$(gcc_s_compile) -DL_$($*-label) -DL_LABEL=$($*-label) $($*-flag) \
|
|
-c $<
|
|
endif
|