]> git.ipfire.org Git - thirdparty/gcc.git/commit
target/90622: __builtin_avr_insert bits: Use BLD/BST for one bit in place.
authorGeorg-Johann Lay <avr@gjlay.de>
Sun, 21 May 2023 16:54:21 +0000 (18:54 +0200)
committerGeorg-Johann Lay <avr@gjlay.de>
Sun, 21 May 2023 16:59:54 +0000 (18:59 +0200)
commitdad3c18fbb481ab31f1586b8f980940fa55951b8
tree7d099667cdc6c725c61f834bd401e5a47ef72b86
parentc09471fbc7588db2480f036aa56a2403d3c03ae5
target/90622: __builtin_avr_insert bits: Use BLD/BST for one bit in place.

If just one bit is inserted in the same position like with:
    __builtin_avr_insert_bits (0xFFFFF2FF, src, dst);
a BLD/BST sequence is better than XOR/AND/XOR.  Thus, don't fold that
case to the latter sequence.

gcc/
PR target/90622
* config/avr/avr.cc (avr_fold_builtin) [AVR_BUILTIN_INSERT_BITS]:
Don't fold to XOR / AND / XOR if just one bit is copied to the
same position.
gcc/config/avr/avr.cc