[Bug target/110748] RISC-V: optimize store of DF 0.0

2024-12-28 Thread law at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110748 --- Comment #17 from Jeffrey A. Law --- *** Bug 115849 has been marked as a duplicate of this bug. ***

[Bug target/110748] RISC-V: optimize store of DF 0.0

2023-08-15 Thread vineetg at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110748 --- Comment #16 from Vineet Gupta --- (In reply to Vineet Gupta from comment #15) > On the branch devel/vineetg/optim-double-const-m0 I have double -0.0 working. > > znd: > li a5,-1 > sllia5,a5,63 > sd a5,

[Bug target/110748] RISC-V: optimize store of DF 0.0

2023-07-28 Thread vineetg at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110748 --- Comment #15 from Vineet Gupta --- (In reply to Vineet Gupta from comment #12) > > void znd(double *d) { *d = -0.0; } > > void znf(float *f) { *f = -0.0; } We need 3 set of changes to get const -0.0 working: 1. Allow expand to generate set

[Bug target/110748] RISC-V: optimize store of DF 0.0

2023-07-22 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110748 --- Comment #14 from CVS Commits --- The master branch has been updated by Vineet Gupta : https://gcc.gnu.org/g:ecfa870ff29d979bd2c3d411643b551f2b6915b0 commit r14-2731-gecfa870ff29d979bd2c3d411643b551f2b6915b0 Author: Vineet Gupta Date: Th

[Bug target/110748] RISC-V: optimize store of DF 0.0

2023-07-21 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110748 --- Comment #13 from Andrew Pinski --- You could also look at how aarch64 implemented a similar thing (not just for -0.0 but for many other constants too): r8-2248-ga217096563e356fa03c .

[Bug target/110748] RISC-V: optimize store of DF 0.0

2023-07-21 Thread vineetg at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110748 --- Comment #12 from Vineet Gupta --- > void znd(double *d) { *d = -0.0; } > void znf(float *f) { *f = -0.0; } The rough approach I'm thinking of is to (1) Introduce a constraint for -0.0 and perhaps a predicate as well for "*movdf_hardfloat

[Bug target/110748] RISC-V: optimize store of DF 0.0

2023-07-21 Thread vineetg at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110748 --- Comment #11 from Vineet Gupta --- There's a variation which can be optimized as well and seems non trivial to implement Now it is the negative constant -0.0 to be stored to mem. In bit notation this has a single sign bit set thus can be opt

[Bug target/110748] RISC-V: optimize store of DF 0.0

2023-07-21 Thread vineetg at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110748 --- Comment #10 from Vineet Gupta --- The fix for handling +0.0 is posted to list - really trivial. https://gcc.gnu.org/pipermail/gcc-patches/2023-July/625217.html

[Bug target/110748] RISC-V: optimize store of DF 0.0

2023-07-20 Thread vineetg at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110748 --- Comment #9 from Vineet Gupta --- (In reply to Vineet Gupta from comment #8) > (In reply to Jeffrey A. Law from comment #5) > > I'd bet it's const_0_operand not allowing CONST_DOUBLE. > > Correct. > > > The question is what unintended side

[Bug target/110748] RISC-V: optimize store of DF 0.0

2023-07-20 Thread vineetg at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110748 --- Comment #8 from Vineet Gupta --- (In reply to Jeffrey A. Law from comment #5) > I'd bet it's const_0_operand not allowing CONST_DOUBLE. Correct. > The question is what unintended side effects we'd have if we allowed > CONST_DOUBLE 0.0 in c

[Bug target/110748] RISC-V: optimize store of DF 0.0

2023-07-20 Thread palmer at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110748 --- Comment #7 from palmer at gcc dot gnu.org --- (In reply to palmer from comment #6) > (In reply to Jeffrey A. Law from comment #5) > > I'd bet it's const_0_operand not allowing CONST_DOUBLE. > > > > The question is what unintended side effect

[Bug target/110748] RISC-V: optimize store of DF 0.0

2023-07-20 Thread palmer at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110748 palmer at gcc dot gnu.org changed: What|Removed |Added CC||palmer at gcc dot gnu.org --

[Bug target/110748] RISC-V: optimize store of DF 0.0

2023-07-20 Thread law at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110748 Jeffrey A. Law changed: What|Removed |Added CC||law at gcc dot gnu.org --- Comment #5

[Bug target/110748] RISC-V: optimize store of DF 0.0

2023-07-20 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110748 --- Comment #4 from Andrew Pinski --- aarch64 has the following function to check for +0.0: ``` /* Return TRUE if rtx X is immediate constant 0.0 (but not in Decimal Floating Point). */ bool aarch64_float_const_zero_rtx_p (rtx x) { /* 0.0

[Bug target/110748] RISC-V: optimize store of DF 0.0

2023-07-19 Thread vineetg at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110748 --- Comment #3 from Vineet Gupta --- Indeed the constraint already exists (define_insn "*movdf_hardfloat_rv64" [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,m,m,*f,*r, *r,*r,*m")

[Bug target/110748] RISC-V: optimize store of DF 0.0

2023-07-19 Thread kito at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110748 --- Comment #2 from Kito Cheng --- And seems we already has such constraint for a while, not sure why GCC 13 did that, I saw the status has changed to ASSIGNED, so I assume Vineet you are already spending time on that, so I will just stop there

[Bug target/110748] RISC-V: optimize store of DF 0.0

2023-07-19 Thread kito at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110748 Kito Cheng changed: What|Removed |Added CC||kito at gcc dot gnu.org --- Comment #1 fro

[Bug target/110748] RISC-V: optimize store of DF 0.0

2023-07-19 Thread vineetg at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110748 Vineet Gupta changed: What|Removed |Added Ever confirmed|0 |1 Last reconfirmed|