From: renlin Date: Wed, 26 Aug 2015 17:37:42 +0000 (+0000) Subject: [PATCH][AARCH64]Add backend aarch64_bfi pattern. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7ebdc8814144cabb6224f5a50e1bddb357f15fe8;p=thirdparty%2Fgcc.git [PATCH][AARCH64]Add backend aarch64_bfi pattern. 2015-08-26 Renlin Li gcc/ * config/aarch64/aarch64.md (aarch64_bfi): New pattern. gcc/testsuite/ * gcc.target/aarch64/combine_bfi_1.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227226 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a0c4fb99acd4..c56f8ba11f52 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2015-08-26 Renlin Li + + * config/aarch64/aarch64.md (*aarch64_bfi4): New. + 2015-08-26 Marcus Shawcroft Jiong Wang diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 80fd6c4894eb..c8511f0c8857 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -3927,6 +3927,16 @@ [(set_attr "type" "bfm")] ) +(define_insn "*aarch64_bfi4" + [(set (zero_extract:GPI (match_operand:GPI 0 "register_operand" "+r") + (match_operand 1 "const_int_operand" "n") + (match_operand 2 "const_int_operand" "n")) + (zero_extend:GPI (match_operand:ALLX 3 "register_operand" "r")))] + "UINTVAL (operands[1]) <= " + "bfi\\t%0, %3, %2, %1" + [(set_attr "type" "bfm")] +) + (define_insn "*extr_insv_lower_reg" [(set (zero_extract:GPI (match_operand:GPI 0 "register_operand" "+r") (match_operand 1 "const_int_operand" "n") diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b1dcc1588dc1..27be013c3d9f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-08-26 Renlin Li + + * gcc.target/aarch64/combine_bfi_1.c: New testcase. + 2015-08-26 Jiong Wang * gcc.target/aarch64/tlsie_tiny_1.c: New testcase. diff --git a/gcc/testsuite/gcc.target/aarch64/combine_bfi_1.c b/gcc/testsuite/gcc.target/aarch64/combine_bfi_1.c new file mode 100644 index 000000000000..accf14410938 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/combine_bfi_1.c @@ -0,0 +1,34 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-rtl-combine" } */ + +int +f1 (int x, int y) +{ + return (x & ~0x0ffff00) | ((y << 8) & 0x0ffff00); +} + +int +f2 (int x, int y) +{ + return (x & ~0x0ff000) | ((y & 0x0ff) << 12); +} + +int +f3 (int x, int y) +{ + return (x & ~0xffff) | (y & 0xffff); +} + +int +f4 (int x, int y) +{ + return (x & ~0xff) | (y & 0xff); +} + +long +f5 (long x, long y) +{ + return (x & ~0xffffffffull) | (y & 0xffffffff); +} + +/* { dg-final { scan-rtl-dump-times "\\*aarch64_bfi" 5 "combine" } } */