mirrored from git://gcc.gnu.org/git/gcc.git
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RISC-V: Produce better code with complex constants [PR95632] [PR106602]
gcc/Changelog: PR target/95632 PR target/106602 * config/riscv/riscv.md: New pattern to simulate complex const_int loads. gcc/testsuite/ChangeLog: * gcc.target/riscv/pr95632.c: New test. * gcc.target/riscv/pr106602.c: New test.
- Loading branch information
1 parent
7c755fd
commit 2e886ee
Showing
3 changed files
with
46 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,14 @@ | ||
/* { dg-do compile { target { riscv64*-*-* } } } */ | ||
/* { dg-options "-O2" } */ | ||
|
||
unsigned long | ||
foo2 (unsigned long a) | ||
{ | ||
return (unsigned long)(unsigned int) a << 6; | ||
} | ||
|
||
/* { dg-final { scan-assembler-times "slli\t" 1 } } */ | ||
/* { dg-final { scan-assembler-times "srli\t" 1 } } */ | ||
/* { dg-final { scan-assembler-not "\tli\t" } } */ | ||
/* { dg-final { scan-assembler-not "addi\t" } } */ | ||
/* { dg-final { scan-assembler-not "and\t" } } */ |
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,15 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-O2" } */ | ||
|
||
unsigned short | ||
foo (unsigned short crc) | ||
{ | ||
crc ^= 0x4002; | ||
crc >>= 1; | ||
crc |= 0x8000; | ||
|
||
return crc; | ||
} | ||
|
||
/* { dg-final { scan-assembler-times "srli\t" 1 } } */ | ||
/* { dg-final { scan-assembler-not "slli\t" } } */ |