diff options
author | Georg-Johann Lay <avr@gjlay.de> | 2025-01-29 18:21:07 +0100 |
---|---|---|
committer | Georg-Johann Lay <avr@gjlay.de> | 2025-01-29 18:25:39 +0100 |
commit | eacb85eb24c381e38a76d3ad9b2d678c29c171f5 (patch) | |
tree | 3c929cf21be9a9cf1c6ed96bb85cb89e427a6175 /gcc | |
parent | 2a77afa0ee41cb8a3664679dcd4545ccd1aa3b35 (diff) | |
download | gcc-eacb85eb24c381e38a76d3ad9b2d678c29c171f5.zip gcc-eacb85eb24c381e38a76d3ad9b2d678c29c171f5.tar.gz gcc-eacb85eb24c381e38a76d3ad9b2d678c29c171f5.tar.bz2 |
AVR: Allow to share libgcc's __negsi2.
libgcc has a module for __negsi2: REG_22:SI := - REG_22:SI.
This patch adds a pattern that allows to share that function
provided optimize_size.
gcc/
* config/avr/avr.md (*negsi2.libgcc): New insn.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/avr/avr.md | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md index 1c95611..06e31aa 100644 --- a/gcc/config/avr/avr.md +++ b/gcc/config/avr/avr.md @@ -6299,6 +6299,15 @@ "" [(set_attr "isa" "*,*,mov,movw")]) +(define_insn "*negsi2.libgcc" + [(set (reg:SI REG_22) + (neg:SI (reg:SI REG_22))) + (clobber (reg:CC REG_CC))] + "reload_completed + && optimize_size" + "%~call __negsi2" + [(set_attr "type" "xcall")]) + (define_insn "*negsi2" [(set (match_operand:SI 0 "register_operand" "=!d,r,&r,&r") (neg:SI (match_operand:SI 1 "register_operand" "0,0,r ,r"))) |