@@ -739,31 +739,23 @@ Error RISCVISAInfo::checkDependency() {
739
739
return getError (" 'f' and 'zfinx' extensions are incompatible" );
740
740
741
741
if (HasZvl && !HasVector)
742
- return getError (
743
- " 'zvl*b' requires 'v' or 'zve*' extension to also be specified" );
744
-
745
- if (Exts.count (" zvbb" ) && !HasVector)
746
- return getError (
747
- " 'zvbb' requires 'v' or 'zve*' extension to also be specified" );
748
-
749
- if (Exts.count (" zvbc" ) && !Exts.count (" zve64x" ))
750
- return getError (
751
- " 'zvbc' requires 'v' or 'zve64*' extension to also be specified" );
752
-
753
- if (Exts.count (" zvbc32e" ) && !Exts.count (" zve32x" ))
754
- return getError (
755
- " 'zvbc32e' requires 'v' or 'zve*' extension to also be specified" );
756
-
757
- if ((Exts.count (" zvkb" ) || Exts.count (" zvkg" ) || Exts.count (" zvkgs" ) ||
758
- Exts.count (" zvkned" ) || Exts.count (" zvknha" ) || Exts.count (" zvksed" ) ||
759
- Exts.count (" zvksh" )) &&
760
- !HasVector)
761
- return getError (
762
- " 'zvk*' requires 'v' or 'zve*' extension to also be specified" );
763
-
764
- if (Exts.count (" zvknhb" ) && !Exts.count (" zve64x" ))
765
- return getError (
766
- " 'zvknhb' requires 'v' or 'zve64*' extension to also be specified" );
742
+ return getError (Twine (" '" ) + " zvl*b" +
743
+ " ' requires 'v' or 'zve*' extension to also be specified" );
744
+
745
+ if (!HasVector)
746
+ for (auto Ext :
747
+ {" zvbb" , " zvbc32e" , " zvkb" , " zvkg" , " zvkgs" , " zvkned" , " zvknha" , " zvksed" , " zvksh" })
748
+ if (Exts.count (Ext))
749
+ return getError (
750
+ Twine (" '" ) + Ext +
751
+ " ' requires 'v' or 'zve*' extension to also be specified" );
752
+
753
+ if (!Exts.count (" zve64x" ))
754
+ for (auto Ext : {" zvknhb" , " zvbc" })
755
+ if (Exts.count (Ext))
756
+ return getError (
757
+ Twine (" '" ) + Ext +
758
+ " ' requires 'v' or 'zve64*' extension to also be specified" );
767
759
768
760
if ((HasZcmt || Exts.count (" zcmp" )) && HasD && (HasC || Exts.count (" zcd" )))
769
761
return getError (Twine (" '" ) + (HasZcmt ? " zcmt" : " zcmp" ) +
@@ -774,13 +766,12 @@ Error RISCVISAInfo::checkDependency() {
774
766
if (XLen != 32 && Exts.count (" zcf" ))
775
767
return getError (" 'zcf' is only supported for 'rv32'" );
776
768
777
- if (Exts.count (" zacas" ) && !(Exts.count (" a" ) || Exts.count (" zaamo" )))
778
- return getError (
779
- " 'zacas' requires 'a' or 'zaamo' extension to also be specified" );
780
-
781
- if (Exts.count (" zabha" ) && !(Exts.count (" a" ) || Exts.count (" zaamo" )))
782
- return getError (
783
- " 'zabha' requires 'a' or 'zaamo' extension to also be specified" );
769
+ if (!(Exts.count (" a" ) || Exts.count (" zaamo" )))
770
+ for (auto Ext : {" zacas" , " zabha" })
771
+ if (Exts.count (Ext))
772
+ return getError (
773
+ Twine (" '" ) + Ext +
774
+ " ' requires 'a' or 'zaamo' extension to also be specified" );
784
775
785
776
if (Exts.count (" xwchc" ) != 0 ) {
786
777
if (XLen != 32 )
0 commit comments