arm: Call thumb1_gen_const_int from thumb1_movsi_insn
authorChristophe Lyon <christophe.lyon@linaro.org>
Mon, 2 Nov 2020 14:39:52 +0000 (14:39 +0000)
committerChristophe Lyon <christophe.lyon@linaro.org>
Mon, 2 Nov 2020 14:39:52 +0000 (14:39 +0000)
commitc7f49e0579329961c49ece7f9a048914bcc106d0
tree24cc17cf9e7222b6bd55beef4a5a6f572539b986
parent011f5e92f8ff87f099ed0aae736e79be20a77c6c
arm: Call thumb1_gen_const_int from thumb1_movsi_insn

thumb1_movsi_insn used the same algorithm to build a constant in asm
than thumb1_gen_const_int_1 does in RTL. Since the previous patch added
support for asm generation in thumb1_gen_const_int_1, this patch calls
it from thumb1_movsi_insn to avoid duplication.

We need to introduce a new proxy function, thumb1_gen_const_int_print
to select the right template.

This patch also adds a new testcase as the updated alternative is only
used by thumb-1 processors that also support movt/movw.

2020-11-02  Christophe Lyon  <christophe.lyon@linaro.org>

gcc/
* config/arm/thumb1.md (thumb1_movsi_insn): Call
thumb1_gen_const_int_print.
* config/arm/arm-protos.h (thumb1_gen_const_int_print): Add
prototype.
* config/arm/arm.c (thumb1_gen_const_int_print): New.

gcc/testsuite/
* gcc.target/arm/pure-code/no-literal-pool-m23.c: New.
gcc/config/arm/arm-protos.h
gcc/config/arm/arm.c
gcc/config/arm/thumb1.md
gcc/testsuite/gcc.target/arm/pure-code/no-literal-pool-m23.c [new file with mode: 0644]