Commit 7eb8fb77 by Richard Sandiford Committed by Richard Sandiford

gcc/

	* config/aarch64/aarch64.md (subsi3, *subsi3_uxtw, subdi3)
	(*sub_<optab><ALLX:mode>_<GPI:mode>, *sub_<optab><SHORT:mode>_si_uxtw)
	(*sub_<optab><ALLX:mode>_shft_<GPI:mode>)
	(*sub_<optab><SHORT:mode>_shft_si_uxtw, *sub_<optab><mode>_multp2)
	(*sub_<optab>si_multp2_uxtw, *sub_uxt<mode>_multp2)
	(*sub_uxtsi_multp2_uxtw): Add stack pointer sources.

gcc/testsuite/
	* gcc.target/aarch64/subsp.c: New test.

From-SVN: r219533
parent 1f46bd52
2015-01-13 Richard Sandiford <richard.sandiford@arm.com>
* config/aarch64/aarch64.md (subsi3, *subsi3_uxtw, subdi3)
(*sub_<optab><ALLX:mode>_<GPI:mode>, *sub_<optab><SHORT:mode>_si_uxtw)
(*sub_<optab><ALLX:mode>_shft_<GPI:mode>)
(*sub_<optab><SHORT:mode>_shft_si_uxtw, *sub_<optab><mode>_multp2)
(*sub_<optab>si_multp2_uxtw, *sub_uxt<mode>_multp2)
(*sub_uxtsi_multp2_uxtw): Add stack pointer sources.
2015-01-13 Andrew Pinski <apinski@cavium.com> 2015-01-13 Andrew Pinski <apinski@cavium.com>
* config/aarch64/aarch64.c (fusion_load_store): Check dest mode * config/aarch64/aarch64.c (fusion_load_store): Check dest mode
......
...@@ -1889,7 +1889,7 @@ ...@@ -1889,7 +1889,7 @@
(define_insn "subsi3" (define_insn "subsi3"
[(set (match_operand:SI 0 "register_operand" "=rk") [(set (match_operand:SI 0 "register_operand" "=rk")
(minus:SI (match_operand:SI 1 "register_operand" "r") (minus:SI (match_operand:SI 1 "register_operand" "rk")
(match_operand:SI 2 "register_operand" "r")))] (match_operand:SI 2 "register_operand" "r")))]
"" ""
"sub\\t%w0, %w1, %w2" "sub\\t%w0, %w1, %w2"
...@@ -1900,7 +1900,7 @@ ...@@ -1900,7 +1900,7 @@
(define_insn "*subsi3_uxtw" (define_insn "*subsi3_uxtw"
[(set (match_operand:DI 0 "register_operand" "=rk") [(set (match_operand:DI 0 "register_operand" "=rk")
(zero_extend:DI (zero_extend:DI
(minus:SI (match_operand:SI 1 "register_operand" "r") (minus:SI (match_operand:SI 1 "register_operand" "rk")
(match_operand:SI 2 "register_operand" "r"))))] (match_operand:SI 2 "register_operand" "r"))))]
"" ""
"sub\\t%w0, %w1, %w2" "sub\\t%w0, %w1, %w2"
...@@ -1909,7 +1909,7 @@ ...@@ -1909,7 +1909,7 @@
(define_insn "subdi3" (define_insn "subdi3"
[(set (match_operand:DI 0 "register_operand" "=rk,w") [(set (match_operand:DI 0 "register_operand" "=rk,w")
(minus:DI (match_operand:DI 1 "register_operand" "r,w") (minus:DI (match_operand:DI 1 "register_operand" "rk,w")
(match_operand:DI 2 "register_operand" "r,w")))] (match_operand:DI 2 "register_operand" "r,w")))]
"" ""
"@ "@
...@@ -2013,7 +2013,7 @@ ...@@ -2013,7 +2013,7 @@
(define_insn "*sub_<optab><ALLX:mode>_<GPI:mode>" (define_insn "*sub_<optab><ALLX:mode>_<GPI:mode>"
[(set (match_operand:GPI 0 "register_operand" "=rk") [(set (match_operand:GPI 0 "register_operand" "=rk")
(minus:GPI (match_operand:GPI 1 "register_operand" "r") (minus:GPI (match_operand:GPI 1 "register_operand" "rk")
(ANY_EXTEND:GPI (ANY_EXTEND:GPI
(match_operand:ALLX 2 "register_operand" "r"))))] (match_operand:ALLX 2 "register_operand" "r"))))]
"" ""
...@@ -2025,7 +2025,7 @@ ...@@ -2025,7 +2025,7 @@
(define_insn "*sub_<optab><SHORT:mode>_si_uxtw" (define_insn "*sub_<optab><SHORT:mode>_si_uxtw"
[(set (match_operand:DI 0 "register_operand" "=rk") [(set (match_operand:DI 0 "register_operand" "=rk")
(zero_extend:DI (zero_extend:DI
(minus:SI (match_operand:SI 1 "register_operand" "r") (minus:SI (match_operand:SI 1 "register_operand" "rk")
(ANY_EXTEND:SI (ANY_EXTEND:SI
(match_operand:SHORT 2 "register_operand" "r")))))] (match_operand:SHORT 2 "register_operand" "r")))))]
"" ""
...@@ -2035,7 +2035,7 @@ ...@@ -2035,7 +2035,7 @@
(define_insn "*sub_<optab><ALLX:mode>_shft_<GPI:mode>" (define_insn "*sub_<optab><ALLX:mode>_shft_<GPI:mode>"
[(set (match_operand:GPI 0 "register_operand" "=rk") [(set (match_operand:GPI 0 "register_operand" "=rk")
(minus:GPI (match_operand:GPI 1 "register_operand" "r") (minus:GPI (match_operand:GPI 1 "register_operand" "rk")
(ashift:GPI (ANY_EXTEND:GPI (ashift:GPI (ANY_EXTEND:GPI
(match_operand:ALLX 2 "register_operand" "r")) (match_operand:ALLX 2 "register_operand" "r"))
(match_operand 3 "aarch64_imm3" "Ui3"))))] (match_operand 3 "aarch64_imm3" "Ui3"))))]
...@@ -2048,7 +2048,7 @@ ...@@ -2048,7 +2048,7 @@
(define_insn "*sub_<optab><SHORT:mode>_shft_si_uxtw" (define_insn "*sub_<optab><SHORT:mode>_shft_si_uxtw"
[(set (match_operand:DI 0 "register_operand" "=rk") [(set (match_operand:DI 0 "register_operand" "=rk")
(zero_extend:DI (zero_extend:DI
(minus:SI (match_operand:SI 1 "register_operand" "r") (minus:SI (match_operand:SI 1 "register_operand" "rk")
(ashift:SI (ANY_EXTEND:SI (ashift:SI (ANY_EXTEND:SI
(match_operand:SHORT 2 "register_operand" "r")) (match_operand:SHORT 2 "register_operand" "r"))
(match_operand 3 "aarch64_imm3" "Ui3")))))] (match_operand 3 "aarch64_imm3" "Ui3")))))]
...@@ -2059,7 +2059,7 @@ ...@@ -2059,7 +2059,7 @@
(define_insn "*sub_<optab><mode>_multp2" (define_insn "*sub_<optab><mode>_multp2"
[(set (match_operand:GPI 0 "register_operand" "=rk") [(set (match_operand:GPI 0 "register_operand" "=rk")
(minus:GPI (match_operand:GPI 4 "register_operand" "r") (minus:GPI (match_operand:GPI 4 "register_operand" "rk")
(ANY_EXTRACT:GPI (ANY_EXTRACT:GPI
(mult:GPI (match_operand:GPI 1 "register_operand" "r") (mult:GPI (match_operand:GPI 1 "register_operand" "r")
(match_operand 2 "aarch64_pwr_imm3" "Up3")) (match_operand 2 "aarch64_pwr_imm3" "Up3"))
...@@ -2074,7 +2074,7 @@ ...@@ -2074,7 +2074,7 @@
(define_insn "*sub_<optab>si_multp2_uxtw" (define_insn "*sub_<optab>si_multp2_uxtw"
[(set (match_operand:DI 0 "register_operand" "=rk") [(set (match_operand:DI 0 "register_operand" "=rk")
(zero_extend:DI (zero_extend:DI
(minus:SI (match_operand:SI 4 "register_operand" "r") (minus:SI (match_operand:SI 4 "register_operand" "rk")
(ANY_EXTRACT:SI (ANY_EXTRACT:SI
(mult:SI (match_operand:SI 1 "register_operand" "r") (mult:SI (match_operand:SI 1 "register_operand" "r")
(match_operand 2 "aarch64_pwr_imm3" "Up3")) (match_operand 2 "aarch64_pwr_imm3" "Up3"))
...@@ -2113,7 +2113,7 @@ ...@@ -2113,7 +2113,7 @@
(define_insn "*sub_uxt<mode>_multp2" (define_insn "*sub_uxt<mode>_multp2"
[(set (match_operand:GPI 0 "register_operand" "=rk") [(set (match_operand:GPI 0 "register_operand" "=rk")
(minus:GPI (match_operand:GPI 4 "register_operand" "r") (minus:GPI (match_operand:GPI 4 "register_operand" "rk")
(and:GPI (and:GPI
(mult:GPI (match_operand:GPI 1 "register_operand" "r") (mult:GPI (match_operand:GPI 1 "register_operand" "r")
(match_operand 2 "aarch64_pwr_imm3" "Up3")) (match_operand 2 "aarch64_pwr_imm3" "Up3"))
...@@ -2130,7 +2130,7 @@ ...@@ -2130,7 +2130,7 @@
(define_insn "*sub_uxtsi_multp2_uxtw" (define_insn "*sub_uxtsi_multp2_uxtw"
[(set (match_operand:DI 0 "register_operand" "=rk") [(set (match_operand:DI 0 "register_operand" "=rk")
(zero_extend:DI (zero_extend:DI
(minus:SI (match_operand:SI 4 "register_operand" "r") (minus:SI (match_operand:SI 4 "register_operand" "rk")
(and:SI (and:SI
(mult:SI (match_operand:SI 1 "register_operand" "r") (mult:SI (match_operand:SI 1 "register_operand" "r")
(match_operand 2 "aarch64_pwr_imm3" "Up3")) (match_operand 2 "aarch64_pwr_imm3" "Up3"))
......
2015-01-13 Richard Sandiford <richard.sandiford@arm.com>
* gcc.target/aarch64/subsp.c: New test.
2015-01-13 Andrew Pinski <apinski@cavium.com> 2015-01-13 Andrew Pinski <apinski@cavium.com>
* gcc.target/aarch64/store-pair-1.c: New testcase. * gcc.target/aarch64/store-pair-1.c: New testcase.
......
/* { dg-options "-O" } */
int foo (void *);
int
f1 (int *x, long y)
{
return foo (__builtin_alloca (y));
}
int
f2 (int *x, int y)
{
char a[y + 1][16];
return foo (a);
}
/* { dg-final { scan-assembler "sub\tsp, sp, x\[0-9\]*\n" } } */
/* { dg-final { scan-assembler "sub\tsp, sp, x\[0-9\]*, sxtw 4\n" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment