diff options
author | Takayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp> | 2022-07-15 19:50:52 +0900 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2022-07-16 00:27:42 -0700 |
commit | 1884f8978237b15013576a720bcb32e7c5647574 (patch) | |
tree | b98ef99aa38d61419a85495dcc6eadf1f28df9e1 /gcc/go | |
parent | bdc7b765f8728cbb769fe1eeef773eda15578aee (diff) | |
download | gcc-1884f8978237b15013576a720bcb32e7c5647574.zip gcc-1884f8978237b15013576a720bcb32e7c5647574.tar.gz gcc-1884f8978237b15013576a720bcb32e7c5647574.tar.bz2 |
xtensa: constantsynth: Make try to find shorter instruction
This patch allows the constant synthesis to choose shorter instruction
if possible.
/* example */
int test(void) {
return 128 << 8;
}
;; before
test:
movi a2, 0x100
addmi a2, a2, 0x7f00
ret.n
;; after
test:
movi.n a2, 1
slli a2, a2, 15
ret.n
When the Code Density Option is configured, the latter is one byte smaller
than the former.
gcc/ChangeLog:
* config/xtensa/xtensa.cc (xtensa_emit_constantsynth): Remove.
(xtensa_constantsynth_2insn): Change to try all three synthetic
methods and to use the one that fits the immediate value of
the seed into a Narrow Move Immediate instruction "MOVI.N"
when the Code Density Option is configured.
Diffstat (limited to 'gcc/go')
0 files changed, 0 insertions, 0 deletions