Skip to content

Commit

Permalink
[PATCH][AARCH64]Add backend aarch64_bfi pattern.
Browse files Browse the repository at this point in the history
2015-08-26  Renlin Li  <[email protected]>

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
  • Loading branch information
renlin committed Aug 26, 2015
1 parent f546e2d commit 7ebdc88
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gcc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2015-08-26 Renlin Li <[email protected]>

* config/aarch64/aarch64.md (*aarch64_bfi<GPI:mode><ALLX:mode>4): New.

2015-08-26 Marcus Shawcroft <[email protected]>
Jiong Wang <[email protected]>

Expand Down
10 changes: 10 additions & 0 deletions gcc/config/aarch64/aarch64.md
Original file line number Diff line number Diff line change
Expand Up @@ -3927,6 +3927,16 @@
[(set_attr "type" "bfm")]
)

(define_insn "*aarch64_bfi<GPI:mode><ALLX:mode>4"
[(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]) <= <ALLX:sizen>"
"bfi\\t%<GPI:w>0, %<GPI:w>3, %2, %1"
[(set_attr "type" "bfm")]
)

(define_insn "*extr_insv_lower_reg<mode>"
[(set (zero_extract:GPI (match_operand:GPI 0 "register_operand" "+r")
(match_operand 1 "const_int_operand" "n")
Expand Down
4 changes: 4 additions & 0 deletions gcc/testsuite/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2015-08-26 Renlin Li <[email protected]>

* gcc.target/aarch64/combine_bfi_1.c: New testcase.

2015-08-26 Jiong Wang <[email protected]>

* gcc.target/aarch64/tlsie_tiny_1.c: New testcase.
Expand Down
34 changes: 34 additions & 0 deletions gcc/testsuite/gcc.target/aarch64/combine_bfi_1.c
Original file line number Diff line number Diff line change
@@ -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" } } */

0 comments on commit 7ebdc88

Please sign in to comment.