aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/xtensa
diff options
context:
space:
mode:
authorTakayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp>2022-06-20 04:13:56 +0900
committerMax Filippov <jcmvbkbc@gmail.com>2022-06-19 14:07:09 -0700
commit46880cd8be7c307f147a8785ac8f58e04a35d34e (patch)
treed8d70ca773a746b30a0322af95d7b722943aa324 /gcc/config/xtensa
parent75ab2f0ebd3c6ab678fea03906186068b89f9fbc (diff)
downloadgcc-46880cd8be7c307f147a8785ac8f58e04a35d34e.zip
gcc-46880cd8be7c307f147a8785ac8f58e04a35d34e.tar.gz
gcc-46880cd8be7c307f147a8785ac8f58e04a35d34e.tar.bz2
xtensa: Fix RTL insn cost estimation about relaxed MOVI instructions
These instructions will all be converted to L32R ones with litpool entries by the assembler. gcc/ChangeLog: * config/xtensa/xtensa.cc (xtensa_is_insn_L32R_p): Consider relaxed MOVI instructions as L32R.
Diffstat (limited to 'gcc/config/xtensa')
-rw-r--r--gcc/config/xtensa/xtensa.cc22
1 files changed, 14 insertions, 8 deletions
diff --git a/gcc/config/xtensa/xtensa.cc b/gcc/config/xtensa/xtensa.cc
index 2c534ff..13f2b2b 100644
--- a/gcc/config/xtensa/xtensa.cc
+++ b/gcc/config/xtensa/xtensa.cc
@@ -4286,17 +4286,23 @@ xtensa_is_insn_L32R_p (const rtx_insn *insn)
{
rtx x = PATTERN (insn);
- if (GET_CODE (x) == SET)
+ if (GET_CODE (x) != SET)
+ return false;
+
+ x = XEXP (x, 1);
+ if (MEM_P (x))
{
- x = SET_SRC (x);
- if (MEM_P (x))
- {
- x = XEXP (x, 0);
- return (SYMBOL_REF_P (x) || CONST_INT_P (x))
- && CONSTANT_POOL_ADDRESS_P (x);
- }
+ x = XEXP (x, 0);
+ return (SYMBOL_REF_P (x) || CONST_INT_P (x))
+ && CONSTANT_POOL_ADDRESS_P (x);
}
+ /* relaxed MOVI instructions, that will be converted to L32R by the
+ assembler. */
+ if (CONST_INT_P (x)
+ && ! xtensa_simm12b (INTVAL (x)))
+ return true;
+
return false;
}