Skip to content

Commit

Permalink
gcc: xtensa: Backport patches from upstream/master (v2)
Browse files Browse the repository at this point in the history
See earlephilhower#29 and earlephilhower#36.

List of patches added after earlephilhower#29:

75ab2f0ebd3c6ab678fea03906186068b89f9fbc "xtensa: Apply a few minor fixes"
46880cd8be7c307f147a8785ac8f58e04a35d34e "xtensa: Fix RTL insn cost estimation about relaxed MOVI instructions"
ec532b47f1823e71f822c0da781c531ffff67a52 "xtensa: Fix buffer overflow"
773dffc50fbc768e3282455bd4238a67b1481176 "xtensa: Optimize integer constant addition that is between -32896 and 32639"
46dc26fdfbf3e64f82188e21aa6a13ec23108e8e "Improve initialization of objects when the initializer has trailing zeros."
e85c94d1c83072d7b894e44009e876dd41ff778a "xtensa: Minor fix for FP constant synthesis"
1884f8978237b15013576a720bcb32e7c5647574 "xtensa: constantsynth: Make try to find shorter instruction"
d6d8e6a7e1379f9dfdf2f39efcc82d9185cca6d0 "xtensa: Optimize "bitwise AND with imm1" followed by "branch if (not) equal to imm2""
2180cdd8a0e65c2790a7732c82de87f83478487b "xtensa: Correct the relative RTX cost that corresponds to the Move Immediate "MOVI" instruction"
64cb87b2381aceaa37230bae7f43c7b9f978d3e3 "xtensa: Optimize "bitwise AND NOT with imm" followed by "branch if (not) equal to zero""
48e9954d0865b5e5e31cb77ad05c45f7206eeb9f "xtensa: Add RTX costs for if_then_else"
2fa8c4a659a19ec971c80704f48f96c13aae9ac3 "xtensa: Fix conflicting hard regno between indirect sibcall fixups and EH_RETURN_STACKADJ_RTX"
a2ff389099c325bc1244b1d72744a18c5fa6fda3 "xtensa: Turn on -fsplit-wide-types-early by default"
dca74793cd42ce4c5319943a516cc5ea7265b6f7 "xtensa: Optimize stack pointer updates in function pro/epilogue under certain conditions"
8731aa98674eda56425ffd652918ce4979631f67 "xtensa: Improve indirect sibling call handling"
9e0c2696724d4d004ea189a69f15781c7baa68e1 "xtensa: add static PIE support"
06c2756e824cfe409d280fc78a0c4f68a9123e49 "xtensa: Eliminate unused stack frame allocation/freeing"
89afb2e86fcb29c559b2957fdcbea0d01740c49b "xtensa: Make complex hard register clobber elimination more robust and accurate"
75e5cc9c3aba943819c284902b3792f7150749cf "xtensa: constantsynth: Add new 3-insns synthesis pattern"
71cd6a0430ca2a2c44e3cf4cc9f3c96d3aef1ab7 "xtensa: fix builtin_apply return value"
0bf60f68ed9db2e4b373b28c125aeda339f6cd59 "xtensa: implement MI thunk generation for call0 ABI"
66d20d881647e7dd177355a851d7839394ab8341 "xtensa: enable section anchors support"
4f3f0296acbb99a0fa2867986956e53e487206a9 "xtensa: Prepare the transition from Reload to LRA"
e0927d7ddca154b1a5151da698e205593cb8912e "xtensa: Make register A0 allocable for the CALL0 ABI"
f896c13489d22b30d01257bc8316ab97b3359d1c "xtensa: Fix out-of-bounds array access in the movdi pattern"
89d5982b8f92c7441e34f8b65466840b4fe43687 "xtensa: Tabify, and trim trailing spaces"
b22f86ba9582b1483ff970aa73740864ceaa0860 "xtensa: Clean up xtensa_expand_prologue"
98a1b4d073b9993b0acda525332225f90714e2ec "xtensa: Change GP_RETURN{,_REG_COUNT} to GP_RETURN_{FIRST,LAST}"
48a0e822666b79600cae7401f9a3e8cf16bc3fd1 "xtensa: Generate density instructions in set_frame_ptr"
b92f1c2dcc7b79467662321615f6eafb0c441c7d "xtensa: use define_c_enums instead of define_constants"
65fed695f7b2eb99dfd679fbdfcf510104de2fb8 "xtensa: Check DF availability before use"
da086e472b61245dedcb2463c53f84072773d1f5 "xtensa: use GP_RETURN_* instead of magic constant"
b095a1db483c1a9522a768e52743440d6987c2cd "xtensa: Optimize stack frame adjustment more"
e3a4bd0bbdccdde0cff85f93064b01a44fb10d2a "xtensa: Optimize bitwise splicing operation"
b399afd22c6ea50722bbff3247d52f3bd14bf2b6 "xtensa: Make instruction cost estimation for size more accurate"
bb65bd084a8739feb5b85f87135c531fc8b86572 "xtensa: Tune "*btrue" insn pattern"
117be79bd84ed21b47588d0cd86d72d5d1757cae "xtensa: Optimize ctzsi2 and ffssi2 a bit"
ff6c7617102df365918402c6ccc8e497c47dbe60 "xtensa: Remove old broken tweak for leaf function"
a4b05944b7d409682197a9f50759a4ed97145e23 "xtensa: Optimize inversion of the MSB"
1c407dc088231ba5f2cc63d9278f4b797db48de1 "xtensa: Revise complex hard register clobber elimination"
a804419c89db9e1c0b99e772dda6c95095bab0bf "xtensa: Enforce return address saving when -Og is specified"
782e442e4f3b88937a725a01245dd749f3f893b9 "xtensa: fix PR target/108876"
4f609c6f762832e43524352527a7ecbea2698ff9 "xtensa: Fix missing mode warnings in machine description"
33e4559305e6f1adaa1b2b59f645d54fd98e5bbe "xtensa: Eliminate the use of callee-saved register that saves and restores only once"
f83e76c3f998c8708fe2ddca16ae3f317c39c37a "xtensa: Eliminate unnecessary general-purpose reg-reg moves"
  • Loading branch information
jjsuwa-sys3175 committed Feb 24, 2023
1 parent e1b5672 commit 59b7795
Show file tree
Hide file tree
Showing 226 changed files with 28,686 additions and 9,674 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
From a2cde0c6443c440c2a2b72b5eea060229a0cff57 Mon Sep 17 00:00:00 2001
From: Jeff Law <[email protected]>
Date: Sat, 9 Jul 2022 11:11:00 -0400
Subject: [PATCH] [RFA] Improve initialization of objects when the initializer

gcc/

* expr.c (store_expr): Identify trailing NULs in a STRING_CST
initializer and use clear_storage rather than copying the
NULs to the destination array.
---
gcc/expr.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/gcc/expr.c b/gcc/expr.c
index 991b26f33..6ff393462 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -5723,6 +5723,17 @@ store_expr (tree exp, rtx target, int call_param_p,
}

str_copy_len = TREE_STRING_LENGTH (str);
+
+ /* Trailing NUL bytes in EXP will be handled by the call to
+ clear_storage, which is more efficient than copying them from
+ the STRING_CST, so trim those from STR_COPY_LEN. */
+ while (str_copy_len)
+ {
+ if (TREE_STRING_POINTER (str)[str_copy_len - 1])
+ break;
+ str_copy_len--;
+ }
+
if ((STORE_MAX_PIECES & (STORE_MAX_PIECES - 1)) == 0)
{
str_copy_len += STORE_MAX_PIECES - 1;
--
2.20.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
From 2065a3fccb11e28ebcc42aa46c52a40b0fae9bea Mon Sep 17 00:00:00 2001
From: Kewen Lin <[email protected]>
Date: Sun, 21 Nov 2021 20:18:31 -0600
Subject: [PATCH 01/31] xtensa: Fix non-robust split condition in
define_insn_and_split

This patch is to fix some non-robust split conditions in some
define_insn_and_splits, to make each of them applied on top of
the corresponding condition for define_insn part, otherwise the
splitting could perform unexpectedly.

gcc/ChangeLog:

* config/xtensa/xtensa.md (movdi_internal, movdf_internal): Fix split
condition.
---
gcc/config/xtensa/xtensa.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md
index 2a8e59ee9..123916957 100644
--- a/gcc/config/xtensa/xtensa.md
+++ b/gcc/config/xtensa/xtensa.md
@@ -782,7 +782,7 @@
"register_operand (operands[0], DImode)
|| register_operand (operands[1], DImode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(set (match_dup 0) (match_dup 2))
(set (match_dup 1) (match_dup 3))]
{
@@ -1058,7 +1058,7 @@
"register_operand (operands[0], DFmode)
|| register_operand (operands[1], DFmode)"
"#"
- "reload_completed"
+ "&& reload_completed"
[(set (match_dup 0) (match_dup 2))
(set (match_dup 1) (match_dup 3))]
{
--
2.20.1

This file was deleted.

Loading

0 comments on commit 59b7795

Please sign in to comment.