aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2019-08-07 20:34:11 +0200
committerUros Bizjak <uros@gcc.gnu.org>2019-08-07 20:34:11 +0200
commite3b4d9d7021e78a85b4627b67c89acb1515ae426 (patch)
treec0b7b84e90799aeeb1f4977de61907ffc2645679 /gcc
parent871b49afafe043d57f717e70532d66c5a56ca173 (diff)
downloadgcc-e3b4d9d7021e78a85b4627b67c89acb1515ae426.zip
gcc-e3b4d9d7021e78a85b4627b67c89acb1515ae426.tar.gz
gcc-e3b4d9d7021e78a85b4627b67c89acb1515ae426.tar.bz2
re PR target/91385 (Zero-extended negation (*negsi2_1_zext) is not generated)
PR target/91385 * config/i386/sse.md (*negsi2_1_zext): Simplify insn pattern. (*negsi2_cmpz_zext): Ditto. testsuite/ChangeLog: PR target/91385 * gcc.target/i386/pr91385.c: New test. From-SVN: r274183
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/i386/i386.md20
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/i386/pr91385.c9
4 files changed, 25 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e4605fc..31f0fec 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2019-08-07 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/91385
+ * config/i386/sse.md (*negsi2_1_zext): Simplify insn pattern.
+ (*negsi2_cmpz_zext): Ditto.
+
2019-08-07 Richard Sandiford <richard.sandiford@arm.com>
* config/aarch64/iterators.md (commutative): Remove.
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index e19a591..e0a446d 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -9337,13 +9337,10 @@
[(set_attr "type" "negnot")
(set_attr "mode" "<MODE>")])
-;; Combine is quite creative about this pattern.
(define_insn "*negsi2_1_zext"
[(set (match_operand:DI 0 "register_operand" "=r")
- (lshiftrt:DI
- (neg:DI (ashift:DI (match_operand:DI 1 "register_operand" "0")
- (const_int 32)))
- (const_int 32)))
+ (zero_extend:DI
+ (neg:SI (match_operand:SI 1 "register_operand" "0"))))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT && ix86_unary_operator_ok (NEG, SImode, operands)"
"neg{l}\t%k0"
@@ -9369,16 +9366,11 @@
(define_insn "*negsi2_cmpz_zext"
[(set (reg:CCZ FLAGS_REG)
(compare:CCZ
- (lshiftrt:DI
- (neg:DI (ashift:DI
- (match_operand:DI 1 "register_operand" "0")
- (const_int 32)))
- (const_int 32))
+ (neg:SI (match_operand:SI 1 "register_operand" "0"))
(const_int 0)))
(set (match_operand:DI 0 "register_operand" "=r")
- (lshiftrt:DI (neg:DI (ashift:DI (match_dup 1)
- (const_int 32)))
- (const_int 32)))]
+ (zero_extend:DI
+ (neg:SI (match_dup 1))))]
"TARGET_64BIT && ix86_unary_operator_ok (NEG, SImode, operands)"
"neg{l}\t%k0"
[(set_attr "type" "negnot")
@@ -9698,7 +9690,6 @@
[(set_attr "type" "negnot")
(set_attr "mode" "<MODE>")])
-;; ??? Currently never generated - xor is used instead.
(define_insn "*one_cmplsi2_1_zext"
[(set (match_operand:DI 0 "register_operand" "=r")
(zero_extend:DI
@@ -9749,7 +9740,6 @@
(set (match_dup 1)
(xor:SWI (match_dup 3) (const_int -1)))])])
-;; ??? Currently never generated - xor is used instead.
(define_insn "*one_cmplsi2_2_zext"
[(set (reg FLAGS_REG)
(compare (not:SI (match_operand:SI 1 "register_operand" "0"))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index e69e59b..a536398 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-08-07 Uroš Bizjak <ubizjak@gmail.com>
+
+ PR target/91385
+ * gcc.target/i386/pr91385.c: New test.
+
2019-08-07 Marek Polacek <polacek@redhat.com>
PR c++/81429 - wrong parsing of constructor with C++11 attribute.
diff --git a/gcc/testsuite/gcc.target/i386/pr91385.c b/gcc/testsuite/gcc.target/i386/pr91385.c
new file mode 100644
index 0000000..f3ff8c8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr91385.c
@@ -0,0 +1,9 @@
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O2 -dp" } */
+/* { dg-final { scan-assembler-not "zero_extendsidi" } } */
+
+unsigned long long
+foo (unsigned int a)
+{
+ return -a;
+}