public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/106600] New: __builtin_bswap32 is not hooked up for ZBB
@ 2022-08-12 19:56 pinskia at gcc dot gnu.org
2022-08-12 19:57 ` [Bug target/106600] " pinskia at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-08-12 19:56 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106600
Bug ID: 106600
Summary: __builtin_bswap32 is not hooked up for ZBB
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: target
Assignee: pinskia at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Target: riscv32
Testcase:
```
int f(int a)
{
return __builtin_bswap32(a);
}
```
The reason is because the check for TARGET_64BIT is there even though it should
not be:
(define_insn "bswap<mode>2"
[(set (match_operand:X 0 "register_operand" "=r")
(bswap:X (match_operand:X 1 "register_operand" "r")))]
"TARGET_64BIT && TARGET_ZBB"
"rev8\t%0,%1"
[(set_attr "type" "bitmanip")])
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug target/106600] __builtin_bswap32 is not hooked up for ZBB
2022-08-12 19:56 [Bug target/106600] New: __builtin_bswap32 is not hooked up for ZBB pinskia at gcc dot gnu.org
@ 2022-08-12 19:57 ` pinskia at gcc dot gnu.org
2022-08-24 18:31 ` cvs-commit at gcc dot gnu.org
2022-08-24 18:32 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-08-12 19:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106600
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Ever confirmed|0 |1
Last reconfirmed| |2022-08-12
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Mine.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug target/106600] __builtin_bswap32 is not hooked up for ZBB
2022-08-12 19:56 [Bug target/106600] New: __builtin_bswap32 is not hooked up for ZBB pinskia at gcc dot gnu.org
2022-08-12 19:57 ` [Bug target/106600] " pinskia at gcc dot gnu.org
@ 2022-08-24 18:31 ` cvs-commit at gcc dot gnu.org
2022-08-24 18:32 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-08-24 18:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106600
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <pinskia@gcc.gnu.org>:
https://gcc.gnu.org/g:cb2daf5acce003300ee948a89860c0d13ebcae79
commit r13-2178-gcb2daf5acce003300ee948a89860c0d13ebcae79
Author: Andrew Pinski <apinski@marvell.com>
Date: Fri Aug 19 17:01:02 2022 +0000
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug target/106600] __builtin_bswap32 is not hooked up for ZBB
2022-08-12 19:56 [Bug target/106600] New: __builtin_bswap32 is not hooked up for ZBB pinskia at gcc dot gnu.org
2022-08-12 19:57 ` [Bug target/106600] " pinskia at gcc dot gnu.org
2022-08-24 18:31 ` cvs-commit at gcc dot gnu.org
@ 2022-08-24 18:32 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-08-24 18:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106600
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |13.0
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-08-24 18:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-12 19:56 [Bug target/106600] New: __builtin_bswap32 is not hooked up for ZBB pinskia at gcc dot gnu.org
2022-08-12 19:57 ` [Bug target/106600] " pinskia at gcc dot gnu.org
2022-08-24 18:31 ` cvs-commit at gcc dot gnu.org
2022-08-24 18:32 ` pinskia at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).