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 #29 and #36.

List of patches added after #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""
  • Loading branch information
jjsuwa-sys3175 committed Jul 16, 2022
1 parent ce0952a commit 22f5f68
Show file tree
Hide file tree
Showing 115 changed files with 15,201 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 22f5f68

Please sign in to comment.