diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-05-03 13:45:04 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-05-03 13:45:04 +0200 |
commit | 31ed166586451e3955d0da9c7931c71da968eee4 (patch) | |
tree | 1ce1e1bae4e7829ce25014d49a2a894842c9b7d1 /gcc/testsuite | |
parent | e7437b594f9c54bc07a2ef0bda9801ce62b1eab7 (diff) | |
download | gcc-31ed166586451e3955d0da9c7931c71da968eee4.zip gcc-31ed166586451e3955d0da9c7931c71da968eee4.tar.gz gcc-31ed166586451e3955d0da9c7931c71da968eee4.tar.bz2 |
re PR rtl-optimization/70467 (Useless "and [esp],-1" emitted on AND with uint64_t variable)
PR rtl-optimization/70467
* config/i386/predicates.md (x86_64_hilo_int_operand,
x86_64_hilo_general_operand): New predicates.
* config/i386/constraints.md (Wd): New constraint.
* config/i386/i386.md (mode attr di): Use Wd instead of e.
(general_hilo_operand): New mode attr.
(add<mode>3, sub<mode>3): Use <general_hilo_operand>
instead of <general_operand>.
(*add<dwi>3_doubleword, *sub<dwi>3_doubleword): Use
x86_64_hilo_general_operand instead of <general_operand>.
* gcc.target/i386/pr70467-3.c: New test.
* gcc.target/i386/pr70467-4.c: New test.
Co-Authored-By: Uros Bizjak <ubizjak@gmail.com>
From-SVN: r235816
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr70467-3.c | 19 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr70467-4.c | 18 |
3 files changed, 41 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0941f39..7a89868 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2016-05-03 Jakub Jelinek <jakub@redhat.com> + PR rtl-optimization/70467 + * gcc.target/i386/pr70467-3.c: New test. + * gcc.target/i386/pr70467-4.c: New test. + PR tree-optimization/70916 * gcc.c-torture/compile/pr70916.c: New test. diff --git a/gcc/testsuite/gcc.target/i386/pr70467-3.c b/gcc/testsuite/gcc.target/i386/pr70467-3.c new file mode 100644 index 0000000..4d2a6cf --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr70467-3.c @@ -0,0 +1,19 @@ +/* PR rtl-optimization/70467 */ +/* { dg-do compile { target int128 } } */ +/* { dg-options "-O2" } */ + +__uint128_t +foo (__uint128_t x) +{ + return x + ((__uint128_t) 123456 << 64); +} + +__uint128_t +bar (__uint128_t x) +{ + return x - ((__uint128_t) 123456 << 64); +} + +/* Make sure there are no unnecessary additions with carry. */ +/* { dg-final { scan-assembler-not "adcq\[^\n\r\]*%" } } */ +/* { dg-final { scan-assembler-not "sbbq\[^\n\r\]*%" } } */ diff --git a/gcc/testsuite/gcc.target/i386/pr70467-4.c b/gcc/testsuite/gcc.target/i386/pr70467-4.c new file mode 100644 index 0000000..91f9b6f --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr70467-4.c @@ -0,0 +1,18 @@ +/* PR rtl-optimization/70467 */ +/* { dg-do compile { target int128 } } */ +/* { dg-options "-O2" } */ + +__uint128_t +foo (__uint128_t x) +{ + return x + ((__uint128_t) 123456 << 64) + 0x1234567; +} + +__uint128_t +bar (__uint128_t x) +{ + return x - ((__uint128_t) 123456 << 64) + 0x1234567; +} + +/* Make sure the immediates are not loaded into registers first. */ +/* { dg-final { scan-assembler-not "mov\[lq\]\[ \t\]*.\[0-9-\]" } } */ |