Skip to content

Commit cfde36e

Browse files
committed
Fix case for 'q' and add assertions for non-modifiable types
1 parent 88a49cf commit cfde36e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

clang/utils/TableGen/SveEmitter.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -579,15 +579,15 @@ void SVEType::applyTypespec(StringRef TS) {
579579
for (char I : TS) {
580580
switch (I) {
581581
case 'Q':
582-
assert(Kind == Invalid && "Invalid use of modifer!");
582+
assert(isInvalid() && "Unexpected use of typespec modifier");
583583
Kind = Svcount;
584584
break;
585585
case 'P':
586-
assert(Kind == Invalid && "Invalid use of modifer!");
586+
assert(isInvalid() && "Unexpected use of typespec modifier");
587587
Kind = Predicate;
588588
break;
589589
case 'U':
590-
assert(Kind == Invalid && "Invalid use of modifer!");
590+
assert(isInvalid() && "Unexpected use of typespec modifier");
591591
Kind = UInt;
592592
break;
593593
case 'c':
@@ -607,26 +607,31 @@ void SVEType::applyTypespec(StringRef TS) {
607607
ElementBitwidth = 64;
608608
break;
609609
case 'q':
610-
Kind = SInt;
610+
Kind = isInvalid() ? SInt : Kind;
611611
ElementBitwidth = 128;
612612
break;
613613
case 'h':
614+
assert(isInvalid() && "Unexpected use of typespec modifier");
614615
Kind = Float;
615616
ElementBitwidth = 16;
616617
break;
617618
case 'f':
619+
assert(isInvalid() && "Unexpected use of typespec modifier");
618620
Kind = Float;
619621
ElementBitwidth = 32;
620622
break;
621623
case 'd':
624+
assert(isInvalid() && "Unexpected use of typespec modifier");
622625
Kind = Float;
623626
ElementBitwidth = 64;
624627
break;
625628
case 'b':
629+
assert(isInvalid() && "Unexpected use of typespec modifier");
626630
Kind = BFloat16;
627631
ElementBitwidth = 16;
628632
break;
629633
case 'm':
634+
assert(isInvalid() && "Unexpected use of typespec modifier");
630635
Kind = MFloat8;
631636
ElementBitwidth = 8;
632637
break;

0 commit comments

Comments
 (0)