-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aarch64: Emit csinv again for
a ? ~b : b
[PR110986]
After r14-3110-g7fb65f10285, the canonical form for `a ? ~b : b` changed to be `-(a) ^ b` that means for aarch64 we need to add a few new insn patterns to be able to catch this and change it to be what is the canonical form for the aarch64 backend. A secondary pattern was needed to support a zero_extended form too; this adds a testcase for all 3 cases. Bootstrapped and tested on aarch64-linux-gnu with no regressions. PR target/110986 gcc/ChangeLog: * config/aarch64/aarch64.md (*cmov<mode>_insn_insv): New pattern. (*cmov_uxtw_insn_insv): Likewise. gcc/testsuite/ChangeLog: * gcc.target/aarch64/cond_op-1.c: New test.
- Loading branch information
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-O2" } */ | ||
/* PR target/110986 */ | ||
|
||
|
||
long long full(unsigned a, unsigned b) | ||
{ | ||
return a ? ~b : b; | ||
} | ||
unsigned fuu(unsigned a, unsigned b) | ||
{ | ||
return a ? ~b : b; | ||
} | ||
long long fllll(unsigned long long a, unsigned long long b) | ||
{ | ||
return a ? ~b : b; | ||
} | ||
|
||
/* { dg-final { scan-assembler-times "csinv\tw\[0-9\]*" 2 } } */ | ||
/* { dg-final { scan-assembler-times "csinv\tx\[0-9\]*" 1 } } */ |