]> git.ipfire.org Git - thirdparty/gcc.git/commit
AVR: target/114981 - Support __builtin_powi[l] / __powidf2.
authorGeorg-Johann Lay <avr@gjlay.de>
Wed, 8 May 2024 15:56:05 +0000 (17:56 +0200)
committerGeorg-Johann Lay <avr@gjlay.de>
Thu, 9 May 2024 08:05:39 +0000 (10:05 +0200)
commitadba85bb63a45d7d668501c11bdf9772cc00b7b8
treef2472a23e2b18f20f866603d8497a58acbe49f1f
parent44d84db11ab724c34a8b1f8c0e06da1cc78439a2
AVR: target/114981 - Support __builtin_powi[l] / __powidf2.

This supports __powidf2 by means of a double wrapper for already
existing f7_powi (renamed to __f7_powi by f7-renames.h).
It tweaks the implementation so that it does not perform trivial
multiplications with 1.0 any more, but instead uses a move.
It also fixes the last statement of f7_powi, which was wrong.
Notice that f7_powi was unused until now.

PR target/114981
libgcc/config/avr/libf7/
* libf7-common.mk (F7_ASM_PARTS): Add D_powi
* libf7-asm.sx (F7MOD_D_powi_, __powidf2): New module and function.
* libf7.c (f7_powi): Fix last (wrong) statement.
Tweak trivial multiplications with 1.0.

gcc/testsuite/
* gcc.target/avr/pr114981-powil.c: New test.

(cherry picked from commit de4eea7d7ea86e54843507c68d6672eca9d8c7bb)
gcc/testsuite/gcc.target/avr/pr114981-powil.c [new file with mode: 0644]
libgcc/config/avr/libf7/libf7-asm.sx
libgcc/config/avr/libf7/libf7-common.mk
libgcc/config/avr/libf7/libf7.c