diff options
author | Takayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp> | 2023-01-10 12:34:01 +0900 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2023-01-10 21:53:57 -0800 |
commit | b399afd22c6ea50722bbff3247d52f3bd14bf2b6 (patch) | |
tree | 7270bf778ed5b1c46d3891a49b370d2dd27c111c /libada | |
parent | f432ad092122c36fd8dfc7738ec6814bc2bc4e63 (diff) | |
download | gcc-b399afd22c6ea50722bbff3247d52f3bd14bf2b6.zip gcc-b399afd22c6ea50722bbff3247d52f3bd14bf2b6.tar.gz gcc-b399afd22c6ea50722bbff3247d52f3bd14bf2b6.tar.bz2 |
xtensa: Make instruction cost estimation for size more accurate
Until now, we applied COSTS_N_INSNS() (multiplying by 4) after dividing
the instruction length by 3, so we couldn't express the difference less
than modulo 3 in insn cost for size (e.g. 11 Bytes and 12 bytes cost the
same).
This patch fixes that.
;; 2 bytes
addi.n a2, a2, -1 ; cost 3
;; 3 bytes
addmi a2, a2, 1024 ; cost 4
;; 4 bytes
movi.n a3, 80 ; cost 5
bnez.n a2, a3, .L4
;; 5 bytes
srli a2, a3, 1 ; cost 7
add.n a2, a2, a2
;; 6 bytes
ssai 8 ; cost 8
src a4, a2, a3
:: 3 + 4 bytes
l32r a2, .L5 ; cost 9
;; 11 bytes ; cost 15
;; 12 bytes ; cost 16
gcc/ChangeLog:
* config/xtensa/xtensa.cc (xtensa_insn_cost):
Let insn cost for size be obtained by applying COSTS_N_INSNS()
to instruction length and then dividing by 3.
Diffstat (limited to 'libada')
0 files changed, 0 insertions, 0 deletions