xtensa: constantsynth: Add new 3-insns synthesis pattern
commit75e5cc9c3aba943819c284902b3792f7150749cf
authorTakayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp>
Sat, 10 Sep 2022 09:29:45 +0000 (10 18:29 +0900)
committerMax Filippov <jcmvbkbc@gmail.com>
Sat, 10 Sep 2022 18:24:15 +0000 (10 11:24 -0700)
treed9b766b3dea3a76a418ea7d76e26599444a54cd5
parent16d752a514033a9e37fed2a7f78024e222ca26b9
xtensa: constantsynth: Add new 3-insns synthesis pattern

This patch adds a new 3-instructions constant synthesis pattern:

- A value that can fit into a signed 12-bit after a number of either bitwise
  left or right rotations:
    => "MOVI(.N) Ax, simm12" + "SSAI (1 ... 11) or (21 ... 31)"
+ "SRC Ax, Ax, Ax"

gcc/ChangeLog:

* config/xtensa/xtensa.cc (xtensa_constantsynth):
Add new pattern for the abovementioned case.

gcc/testsuite/ChangeLog:

* gcc.target/xtensa/constsynth_3insns.c (test_4):
Add new test function.
gcc/config/xtensa/xtensa.cc
gcc/testsuite/gcc.target/xtensa/constsynth_3insns.c