public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/100712] New: The vec_splatid instruction allows the creation of XXSPLTIDP instructions which produces undefined results.
@ 2021-05-21 2:37 meissner at gcc dot gnu.org
2021-05-21 10:50 ` [Bug target/100712] " segher at gcc dot gnu.org
0 siblings, 1 reply; 2+ messages in thread
From: meissner at gcc dot gnu.org @ 2021-05-21 2:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100712
Bug ID: 100712
Summary: The vec_splatid instruction allows the creation of
XXSPLTIDP instructions which produces undefined
results.
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: meissner at gcc dot gnu.org
Target Milestone: ---
The vec_splatid builtin from altivec.h (i.e. __builtin_vec_xxspltid) allows the
user to create an XXSPLTIDP instruction where the value is a single precision
denormal value. Right now the compiler warns about this usage, but it should
really not allow it.
In addition, the warning is buried in rs6000_emit_xxspltidp_v2df (in rs6000.c).
A better place might be in rs6000_expand_binop_builtin (in rs6000-calls.)
where other usage warnings are given.
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug target/100712] The vec_splatid instruction allows the creation of XXSPLTIDP instructions which produces undefined results.
2021-05-21 2:37 [Bug target/100712] New: The vec_splatid instruction allows the creation of XXSPLTIDP instructions which produces undefined results meissner at gcc dot gnu.org
@ 2021-05-21 10:50 ` segher at gcc dot gnu.org
0 siblings, 0 replies; 2+ messages in thread
From: segher at gcc dot gnu.org @ 2021-05-21 10:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100712
--- Comment #1 from Segher Boessenkool <segher at gcc dot gnu.org> ---
As background, the ISA has in the xxspltidp description
If IMM32 specifies a single-precision denormal value
(i.e., bits 1:8 equal to 0 and bits 9:31 not equal to 0),
the result is undefined.
I see no other warnings in rs6000_expand_binop_builtin btw? There are some
errors there, but those are more basic out-of-range errors. Something as
specific as this is probably best left where it is now.
Why do you think an error is better than a warning here? We allow creating UB
everywhere else (but we do warn where possible).
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-21 10:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21 2:37 [Bug target/100712] New: The vec_splatid instruction allows the creation of XXSPLTIDP instructions which produces undefined results meissner at gcc dot gnu.org
2021-05-21 10:50 ` [Bug target/100712] " segher 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).