diff --git a/gcc/testsuite/gcc.target/aarch64/combine_bfi_2.c b/gcc/testsuite/gcc.target/aarch64/combine_bfi_2.c index e69de29..145282d 100644 --- a/gcc/testsuite/gcc.target/aarch64/combine_bfi_2.c +++ b/gcc/testsuite/gcc.target/aarch64/combine_bfi_2.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +int f1(int x, int y) +{ + return (y & 0xfffffff) | (((x <<28) & 0xf0000000)); +} + + +int f2(int x, int y) +{ + return (((x <<28) & 0xf0000000)) | (y & 0xfffffff); +} + +/* { dg-final { scan-assembler-times {\tbfi\t} 2 } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/combine_bfxil.c b/gcc/testsuite/gcc.target/aarch64/combine_bfxil.c index 109f989..a2fb31c 100644 --- a/gcc/testsuite/gcc.target/aarch64/combine_bfxil.c +++ b/gcc/testsuite/gcc.target/aarch64/combine_bfxil.c @@ -114,4 +114,5 @@ main (void) return 0; } -/* { dg-final { scan-assembler-times "bfxil\\t" 18 } } */ +/* { dg-final { scan-assembler-times "bfxil\\t" 7 } } */ +/* { dg-final { scan-assembler-times "bfi\\t" 11 } } */