forked from gcc-mirror/gcc
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix PR 106600: __builtin_bswap32 is not hooked up for ZBB for 32bit
The problem here is the bswap<mode>2 pattern had a check for TARGET_64BIT but then used the X iterator. Since the X iterator is either SI or DI depending on the setting TARGET_64BIT, there is no reason for the TARGET_64BIT. OK? Built and tested on both riscv32-linux-gnu and riscv64-linux-gnu. Thanks, Andrew Pinski gcc/ChangeLog: PR target/106600 * config/riscv/bitmanip.md (bswap<mode>2): Remove condition on TARGET_64BIT as X is already conditional there. gcc/testsuite/ChangeLog: PR target/106600 * gcc.target/riscv/zbb_32_bswap-1.c: New test. * gcc.target/riscv/zbb_bswap-1.c: New test.
- Loading branch information
1 parent
55d8c54
commit cb2daf5
Showing
3 changed files
with
23 additions
and
1 deletion.
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,11 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-march=rv32gc_zbb -mabi=ilp32" } */ | ||
/* { dg-skip-if "" { *-*-* } { "-O0" } } */ | ||
|
||
int foo(int n) | ||
{ | ||
return __builtin_bswap32(n); | ||
} | ||
|
||
/* { dg-final { scan-assembler "rev8" } } */ | ||
|
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,11 @@ | ||
/* { dg-do compile } */ | ||
/* { dg-options "-march=rv64gc_zbb -mabi=lp64" } */ | ||
/* { dg-skip-if "" { *-*-* } { "-O0" } } */ | ||
|
||
int foo(int n) | ||
{ | ||
return __builtin_bswap32(n); | ||
} | ||
|
||
/* { dg-final { scan-assembler "rev8" } } */ | ||
|