diff options
author | yroux <yroux@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-04-02 07:21:06 +0000 |
---|---|---|
committer | yroux <yroux@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-04-02 07:21:06 +0000 |
commit | dfb23679aff2ded74788166c37c4e29a2686926b (patch) | |
tree | 8aa8bc451faf64d5f87124ba46d5dd3e988231f0 | |
parent | 65668adf48adb258b9ed93308db4c60ba77d944b (diff) |
gcc/
2015-04-02 Yvan Roux <yvan.roux@linaro.org>
Backport from trunk r218958, r218960, r218961.
2014-12-19 Alan Lawrence <alan.lawrence@arm.com>
* config/aarch64/aarch64.c (<LOGICAL:optab>_one_cmpl<mode>3):
Reparameterize to...
(<NLOGICAL:optab>_one_cmpl<mode>3): with extra SIMD-register variant.
(xor_one_cmpl<mode>3): New define_insn_and_split.
* config/aarch64/iterators.md (NLOGICAL): New define_code_iterator.
2014-12-19 Alan Lawrence <alan.lawrence@arm.com>
* config/aarch64/aarch64.md (<optab><mode>3, one_cmpl<mode>2):
Add SIMD-register variant.
* config/aarch64/iterators.md (Vbtype): Add value for SI.
2014-12-19 Alan Lawrence <alan.lawrence@arm.com>
* config/aarch64/aarch64.md (subdi3, adddi3_aarch64): Don't penalize
SIMD reg variant.
gcc/testsuite/
2015-04-02 Yvan Roux <yvan.roux@linaro.org>
Backport from trunk r218961.
2014-12-19 Alan Lawrence <alan.lawrence@arm.com>
* gcc.target/aarch64/eon_1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_9-branch@221829 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog.linaro | 35 | ||||
-rw-r--r-- | gcc/config/aarch64/aarch64.md | 73 | ||||
-rw-r--r-- | gcc/config/aarch64/iterators.md | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog.linaro | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/aarch64/eon_1.c | 39 |
5 files changed, 131 insertions, 29 deletions
diff --git a/gcc/ChangeLog.linaro b/gcc/ChangeLog.linaro index 1c6e72071d6..1a2b3ff61fb 100644 --- a/gcc/ChangeLog.linaro +++ b/gcc/ChangeLog.linaro @@ -1,4 +1,27 @@ -2015-04.02 Yvan Roux <yvan.roux@linaro.org> +2015-04-02 Yvan Roux <yvan.roux@linaro.org> + + Backport from trunk r218958, r218960, r218961. + 2014-12-19 Alan Lawrence <alan.lawrence@arm.com> + + * config/aarch64/aarch64.c (<LOGICAL:optab>_one_cmpl<mode>3): + Reparameterize to... + (<NLOGICAL:optab>_one_cmpl<mode>3): with extra SIMD-register variant. + (xor_one_cmpl<mode>3): New define_insn_and_split. + + * config/aarch64/iterators.md (NLOGICAL): New define_code_iterator. + + 2014-12-19 Alan Lawrence <alan.lawrence@arm.com> + + * config/aarch64/aarch64.md (<optab><mode>3, one_cmpl<mode>2): + Add SIMD-register variant. + * config/aarch64/iterators.md (Vbtype): Add value for SI. + + 2014-12-19 Alan Lawrence <alan.lawrence@arm.com> + + * config/aarch64/aarch64.md (subdi3, adddi3_aarch64): Don't penalize + SIMD reg variant. + +2015-04-02 Yvan Roux <yvan.roux@linaro.org> Backport from trunk r218897. 2014-12-19 Kyrylo Tkachov <kyrylo.tkachov@arm.com> @@ -6,7 +29,7 @@ * doc/invoke.texi (ARM options): Remove mention of Advanced RISC Machines. -2015-04.02 Yvan Roux <yvan.roux@linaro.org> +2015-04-02 Yvan Roux <yvan.roux@linaro.org> Backport from trunk r218895. 2014-12-19 Xingxing Pan <xxingpan@marvell.com> @@ -14,7 +37,7 @@ * config/arm/cortex-a9-neon.md (cortex_a9_neon_vmov): Change reservation to cortex_a9_neon_dp. -2015-04.02 Yvan Roux <yvan.roux@linaro.org> +2015-04-02 Yvan Roux <yvan.roux@linaro.org> Backport from trunk r218530. 2014-12-09 Alan Lawrence <alan.lawrence@arm.com> @@ -26,7 +49,7 @@ Remove final qualifier_internal. (aarch64_fold_builtin): Stop folding abs builtins, except on floats. -2015-04.02 Yvan Roux <yvan.roux@linaro.org> +2015-04-02 Yvan Roux <yvan.roux@linaro.org> Backport from trunk r218526. 2014-12-09 Wilco Dijkstra <wilco.dijkstra@arm.com> @@ -41,7 +64,7 @@ (cortexa57_tunings): Likewise. (thunderx_tunings): Likewise. -2015-04.02 Yvan Roux <yvan.roux@linaro.org> +2015-04-02 Yvan Roux <yvan.roux@linaro.org> Backport from trunk r218866. 2014-12-18 Wilco Dijkstra <wilco.dijkstra@arm.com> @@ -50,7 +73,7 @@ Define. (aarch64_min_divisions_for_recip_mul): New function. -2015-04.02 Yvan Roux <yvan.roux@linaro.org> +2015-04-02 Yvan Roux <yvan.roux@linaro.org> Backport from trunk r218867, r218868. 2014-12-18 Alan Lawrence <alan.lawrence@arm.com> diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 2dee7c7d692..9788016f02d 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -1181,10 +1181,10 @@ (define_insn "*adddi3_aarch64" [(set - (match_operand:DI 0 "register_operand" "=rk,rk,rk,!w") + (match_operand:DI 0 "register_operand" "=rk,rk,rk,w") (plus:DI - (match_operand:DI 1 "register_operand" "%rk,rk,rk,!w") - (match_operand:DI 2 "aarch64_plus_operand" "I,r,J,!w")))] + (match_operand:DI 1 "register_operand" "%rk,rk,rk,w") + (match_operand:DI 2 "aarch64_plus_operand" "I,r,J,w")))] "" "@ add\\t%x0, %x1, %2 @@ -1655,9 +1655,9 @@ ) (define_insn "subdi3" - [(set (match_operand:DI 0 "register_operand" "=rk,!w") - (minus:DI (match_operand:DI 1 "register_operand" "r,!w") - (match_operand:DI 2 "register_operand" "r,!w")))] + [(set (match_operand:DI 0 "register_operand" "=rk,w") + (minus:DI (match_operand:DI 1 "register_operand" "r,w") + (match_operand:DI 2 "register_operand" "r,w")))] "" "@ sub\\t%x0, %x1, %x2 @@ -2596,12 +2596,16 @@ ;; ------------------------------------------------------------------- (define_insn "<optab><mode>3" - [(set (match_operand:GPI 0 "register_operand" "=r,rk") - (LOGICAL:GPI (match_operand:GPI 1 "register_operand" "%r,r") - (match_operand:GPI 2 "aarch64_logical_operand" "r,<lconst>")))] + [(set (match_operand:GPI 0 "register_operand" "=r,rk,w") + (LOGICAL:GPI (match_operand:GPI 1 "register_operand" "%r,r,w") + (match_operand:GPI 2 "aarch64_logical_operand" "r,<lconst>,w")))] "" - "<logical>\\t%<w>0, %<w>1, %<w>2" - [(set_attr "type" "logic_reg,logic_imm")] + "@ + <logical>\\t%<w>0, %<w>1, %<w>2 + <logical>\\t%<w>0, %<w>1, %<w>2 + <logical>\\t%0.<Vbtype>, %1.<Vbtype>, %2.<Vbtype>" + [(set_attr "type" "logic_reg,logic_imm,neon_logic") + (set_attr "simd" "*,*,yes")] ) ;; zero_extend version of above @@ -2722,11 +2726,14 @@ ) (define_insn "one_cmpl<mode>2" - [(set (match_operand:GPI 0 "register_operand" "=r") - (not:GPI (match_operand:GPI 1 "register_operand" "r")))] + [(set (match_operand:GPI 0 "register_operand" "=r,w") + (not:GPI (match_operand:GPI 1 "register_operand" "r,w")))] "" - "mvn\\t%<w>0, %<w>1" - [(set_attr "type" "logic_reg")] + "@ + mvn\\t%<w>0, %<w>1 + mvn\\t%0.8b, %1.8b" + [(set_attr "type" "logic_reg,neon_logic") + (set_attr "simd" "*,yes")] ) (define_insn "*one_cmpl_<optab><mode>2" @@ -2738,14 +2745,36 @@ [(set_attr "type" "logic_shift_imm")] ) -(define_insn "*<LOGICAL:optab>_one_cmpl<mode>3" - [(set (match_operand:GPI 0 "register_operand" "=r") - (LOGICAL:GPI (not:GPI - (match_operand:GPI 1 "register_operand" "r")) - (match_operand:GPI 2 "register_operand" "r")))] +;; Binary logical operators negating one operand, i.e. (a & !b), (a | !b). + +(define_insn "*<NLOGICAL:optab>_one_cmpl<mode>3" + [(set (match_operand:GPI 0 "register_operand" "=r,w") + (NLOGICAL:GPI (not:GPI (match_operand:GPI 1 "register_operand" "r,w")) + (match_operand:GPI 2 "register_operand" "r,w")))] "" - "<LOGICAL:nlogical>\\t%<w>0, %<w>2, %<w>1" - [(set_attr "type" "logic_reg")] + "@ + <NLOGICAL:nlogical>\\t%<w>0, %<w>2, %<w>1 + <NLOGICAL:nlogical>\\t%0.<Vbtype>, %2.<Vbtype>, %1.<Vbtype>" + [(set_attr "type" "logic_reg,neon_logic") + (set_attr "simd" "*,yes")] +) + +;; (xor (not a) b) is simplify_rtx-ed down to (not (xor a b)). +;; eon does not operate on SIMD registers so the vector variant must be split. +(define_insn_and_split "*xor_one_cmpl<mode>3" + [(set (match_operand:GPI 0 "register_operand" "=r,w") + (not:GPI (xor:GPI (match_operand:GPI 1 "register_operand" "r,?w") + (match_operand:GPI 2 "register_operand" "r,w"))))] + "" + "eon\\t%<w>0, %<w>1, %<w>2" ;; For GPR registers (only). + "reload_completed && (which_alternative == 1)" ;; For SIMD registers. + [(set (match_operand:GPI 0 "register_operand" "=w") + (xor:GPI (match_operand:GPI 1 "register_operand" "w") + (match_operand:GPI 2 "register_operand" "w"))) + (set (match_dup 0) (not:GPI (match_dup 0)))] + "" + [(set_attr "type" "logic_reg,multiple") + (set_attr "simd" "*,yes")] ) (define_insn "*and_one_cmpl<mode>3_compare0" diff --git a/gcc/config/aarch64/iterators.md b/gcc/config/aarch64/iterators.md index 5ddd6a271a8..f6da12410aa 100644 --- a/gcc/config/aarch64/iterators.md +++ b/gcc/config/aarch64/iterators.md @@ -412,7 +412,8 @@ (V2SI "8b") (V4SI "16b") (V2DI "16b") (V2SF "8b") (V4SF "16b") (V2DF "16b") - (DI "8b") (DF "8b")]) + (DI "8b") (DF "8b") + (SI "8b")]) ;; Define element mode for each vector mode. (define_mode_attr VEL [(V8QI "QI") (V16QI "QI") @@ -689,6 +690,9 @@ ;; Code iterator for logical operations (define_code_iterator LOGICAL [and ior xor]) +;; Code iterator for logical operations whose :nlogical works on SIMD registers. +(define_code_iterator NLOGICAL [and ior]) + ;; Code iterator for sign/zero extension (define_code_iterator ANY_EXTEND [sign_extend zero_extend]) diff --git a/gcc/testsuite/ChangeLog.linaro b/gcc/testsuite/ChangeLog.linaro index ecab740bbf8..e921593b56d 100644 --- a/gcc/testsuite/ChangeLog.linaro +++ b/gcc/testsuite/ChangeLog.linaro @@ -1,5 +1,12 @@ 2015-04-02 Yvan Roux <yvan.roux@linaro.org> + Backport from trunk r218961. + 2014-12-19 Alan Lawrence <alan.lawrence@arm.com> + + * gcc.target/aarch64/eon_1.c: New test. + +2015-04-02 Yvan Roux <yvan.roux@linaro.org> + Backport from trunk r218530. 2014-12-09 Alan Lawrence <alan.lawrence@arm.com> diff --git a/gcc/testsuite/gcc.target/aarch64/eon_1.c b/gcc/testsuite/gcc.target/aarch64/eon_1.c new file mode 100644 index 00000000000..dcdf3b4d052 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/eon_1.c @@ -0,0 +1,39 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +/* { dg-final { scan-assembler-not "\tf?mov\t" } } */ + +typedef long long int64_t; +typedef int64_t int64x1_t __attribute__ ((__vector_size__ (8))); + +/* { dg-final { scan-assembler-times "\\teon\\tx\[0-9\]+, x\[0-9\]+, x\[0-9\]+" 1 } } */ + +int64_t +test_eon (int64_t a, int64_t b) +{ + return a ^ ~b; +} + +/* { dg-final { scan-assembler-times "\\tmvn\\tx\[0-9\]+, x\[0-9\]+" 1 } } */ +int64_t +test_not (int64_t a) +{ + return ~a; +} + +/* There is no eon for SIMD regs; we prefer eor+mvn to mov+mov+eon+mov. */ + +/* { dg-final { scan-assembler-times "\\teor\\tv\[0-9\]+\.8b, v\[0-9\]+\.8b, v\[0-9\]+\.8b" 1 } } */ +/* { dg-final { scan-assembler-times "\\tmvn\\tv\[0-9\]+\.8b, v\[0-9\]+\.8b" 2 } } */ +int64x1_t +test_vec_eon (int64x1_t a, int64x1_t b) +{ + return a ^ ~b; +} + +int64x1_t +test_vec_not (int64x1_t a) +{ + return ~a; +} + |