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

vineetg at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jul 21 21:44:28 GMT 2023


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110748

--- Comment #12 from Vineet Gupta <vineetg at gcc dot gnu.org> ---
> 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_rv64". That way df expander can elide the const pool.

(2) Add a combiner pattern to recog a set of -0.0 to bit set, which would be
automatically optim to BSETI if zbs is passed.


More information about the Gcc-bugs mailing list