From: Fredrik Hederstierna <fredrik.hederstierna@verisure.com>
To: "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: ARM peephole2 from 2003 never merged, still valid
Date: Sat, 01 Jun 2019 23:35:00 -0000 [thread overview]
Message-ID: <HE1PR1001MB1306BBEED3FA8BE45F6CCCACEF1A0@HE1PR1001MB1306.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <HE1PR1001MB1306C71F79B5D87ACD247F23EF180@HE1PR1001MB1306.EURPRD10.PROD.OUTLOOK.COM>
I found this patch from 2003 by Tamas Gergely that was never merged.
Though it seems to still be valid, since when applying it, the CSiBE benchmark reduce total code size -170 bytes, making 35 out of 893 files smaller (from -4 to -12 bytes (1-3 instructions).
Bug
asd
asd
asd
updated patch:
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 20bdc2bec37..4c924499ad9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2019-06-01 Fredrik Hederstierna <fredrik@hederstierna.com>
+ Tamas Gergely <gertom@rgai.hu>
+
+ * gcc/config/arm/arm.md: new peephole2 pattern added for extending
+ move and compare parallelization. Retake from 2003 patch adapted.
+
2019-06-01 Martin Sebor <msebor@redhat.com>
PR middle-end/90694
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index ae582172ab9..753d18fbfc5 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -10951,6 +10951,19 @@
""
)
+; The same as the previous, but with exchanged operands
+;
+(define_peephole2
+ [(set (match_operand:SI 0 "arm_general_register_operand" "")
+ (match_operand:SI 1 "arm_general_register_operand" ""))
+ (set (reg:CC CC_REGNUM)
+ (compare:CC (match_dup 0) (const_int 0)))]
+ "TARGET_ARM"
+ [(parallel [(set (reg:CC CC_REGNUM) (compare:CC (match_dup 1) (const_int 0)))
+ (set (match_dup 0) (match_dup 1))])]
+ ""
+)
+
(define_split
[(set (match_operand:SI 0 "s_register_operand" "")
(and:SI (ge:SI (match_operand:SI 1 "s_register_operand" "")
next prev parent reply other threads:[~2019-06-01 23:35 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-24 8:48 Question about GCC benchmarks and uninitialized variables Fredrik Hederstierna
2018-07-24 9:04 ` Alexander Monakov
2018-07-24 12:17 ` David Brown
2019-05-30 9:13 ` Question about GCC not warning for some noncompliant SEI CERT C code examples Fredrik Hederstierna
2019-05-30 14:28 ` Martin Sebor
2019-05-30 14:48 ` Jeff Law
2019-06-01 23:35 ` Fredrik Hederstierna [this message]
2019-06-01 23:41 ` ARM peephole2 from 2003 never merged, still valid Fredrik Hederstierna
2019-06-02 12:28 ` Segher Boessenkool
2019-06-05 23:03 ` Jeff Law
2019-06-05 23:46 ` Segher Boessenkool
2019-06-06 9:13 ` Richard Earnshaw (lists)
2019-06-06 14:02 ` Segher Boessenkool
2019-06-06 14:55 ` Fredrik Hederstierna
2019-06-06 16:06 ` Richard Earnshaw (lists)
2019-06-06 16:49 ` Segher Boessenkool
2019-07-08 6:41 ` Fredrik Hederstierna
2019-07-09 19:13 ` Jeff Law
2019-06-14 20:30 ` Jeff Law
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=HE1PR1001MB1306BBEED3FA8BE45F6CCCACEF1A0@HE1PR1001MB1306.EURPRD10.PROD.OUTLOOK.COM \
--to=fredrik.hederstierna@verisure.com \
--cc=gcc@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).