diff options
author | Georg-Johann Lay <avr@gjlay.de> | 2024-09-12 14:24:53 +0200 |
---|---|---|
committer | Georg-Johann Lay <avr@gjlay.de> | 2024-09-13 11:48:51 +0200 |
commit | 494d3c3faaee0dbde696ea334f8e242ae85ae2b5 (patch) | |
tree | ce66291991892dc11d02d74d00397541eb13a473 /libbacktrace/zstdtest.c | |
parent | 1ec16778312a902592822cbda626241da68ea643 (diff) | |
download | gcc-494d3c3faaee0dbde696ea334f8e242ae85ae2b5.zip gcc-494d3c3faaee0dbde696ea334f8e242ae85ae2b5.tar.gz gcc-494d3c3faaee0dbde696ea334f8e242ae85ae2b5.tar.bz2 |
AVR: Rework avr_out_compare.
16-bit comparisons like R25:24 == -1 are currently performed like
cpi R24, -1
cpc R25, R24
Similar is possible for wider modes. ADIW can be used like SBIW when
the compare code is EQ or NE because such comparisons are just about
(propagating) the Z flag. The patch adds helper functions like avr_byte()
that may be useful in other functions than avr_out_compare().
Use new convenient helper functions that may be useful in
other output functions, too.
For example, with the patch
R24:SI == -1 (unused after)
adiw r26,1
sbci r25,hi8(-1)
sbci r24,lo8(-1)
R18:SI == -1
cpi r18,-1
cpc r19,r18
cpc r20,r18
cpc r21,r18
Without the patch, we had:
R24:SI == -1 (unused after)
cpi r24,-1
sbci r25,-1
sbci r26,-1
sbci r27,-1
R18:SI == -1
cpi r18,-1
ldi r24,-1
cpc r19,r24
cpc r20,r24
cpc r21,r24
gcc/
* config/avr/avr.cc (avr_chunk, avr_byte, avr_word)
(avr_int8, avr_uint8, avr_int16): New helper functions.
(avr_out_compare): Overhaul.
Diffstat (limited to 'libbacktrace/zstdtest.c')
0 files changed, 0 insertions, 0 deletions