public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r15-703] rs6000: Add assert !TARGET_VSX if !TARGET_ALTIVEC and strip a useless check
@ 2024-05-21 2:02 Kewen Lin
0 siblings, 0 replies; only message in thread
From: Kewen Lin @ 2024-05-21 2:02 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:b390b0115696353ba579706531fbd3bcf39281c5
commit r15-703-gb390b0115696353ba579706531fbd3bcf39281c5
Author: Kewen Lin <linkw@linux.ibm.com>
Date: Mon May 20 21:01:06 2024 -0500
rs6000: Add assert !TARGET_VSX if !TARGET_ALTIVEC and strip a useless check
In function rs6000_option_override_internal, we have the
checks and adjustments like:
if (TARGET_P8_VECTOR && !TARGET_ALTIVEC)
rs6000_isa_flags &= ~OPTION_MASK_P8_VECTOR;
if (TARGET_P8_VECTOR && !TARGET_VSX)
rs6000_isa_flags &= ~OPTION_MASK_P8_VECTOR;
But in fact some previous code has guaranteed !TARGET_VSX if
!TARGET_ALTIVEC, so we can remove the former check and
adjustment. This patch is to remove it accordingly and also
place an explicit assertion.
gcc/ChangeLog:
* config/rs6000/rs6000.cc (rs6000_option_override_internal): Remove
useless check on TARGET_P8_VECTOR && !TARGET_ALTIVEC and add an
assertion on !TARGET_VSX if !TARGET_ALTIVEC.
Diff:
---
gcc/config/rs6000/rs6000.cc | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index d18e262d81de..e4dc629ddcc9 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -3940,8 +3940,9 @@ rs6000_option_override_internal (bool global_init_p)
rs6000_isa_flags &= ~OPTION_MASK_FPRND;
}
- if (TARGET_P8_VECTOR && !TARGET_ALTIVEC)
- rs6000_isa_flags &= ~OPTION_MASK_P8_VECTOR;
+ /* Assert !TARGET_VSX if !TARGET_ALTIVEC and make some adjustments
+ based on either !TARGET_VSX or !TARGET_ALTIVEC concise. */
+ gcc_assert (TARGET_ALTIVEC || !TARGET_VSX);
if (TARGET_P8_VECTOR && !TARGET_VSX)
rs6000_isa_flags &= ~OPTION_MASK_P8_VECTOR;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-05-21 2:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-21 2:02 [gcc r15-703] rs6000: Add assert !TARGET_VSX if !TARGET_ALTIVEC and strip a useless check Kewen Lin
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).