@@ -87,7 +87,6 @@ class SVEType {
87
87
bool isPointer () const { return Pointer; }
88
88
bool isConstant () const { return Constant; }
89
89
bool isImmediate () const { return Immediate; }
90
- bool isSigned () const { return Kind != UInt; }
91
90
bool isScalar () const { return NumVectors == 0 ; }
92
91
bool isVector () const { return NumVectors > 0 ; }
93
92
bool isScalableVector () const { return isVector () && IsScalable; }
@@ -98,11 +97,12 @@ class SVEType {
98
97
bool isFloat () const { return Kind == Float; }
99
98
bool isBFloat () const { return Kind == BFloat16; }
100
99
bool isMFloat () const { return Kind == MFloat8; }
101
- bool isTypedPointer () const { return Pointer && Kind != Void; }
102
100
bool isFloatingPoint () const {
103
101
return Kind == Float || Kind == BFloat16 || Kind == MFloat8;
104
102
}
105
103
bool isInteger () const { return Kind == SInt || Kind == UInt; }
104
+ bool isSignedInteger () const { return Kind == SInt; }
105
+ bool isUnsignedInteger () const { return Kind == UInt; }
106
106
bool isScalarPredicate () const {
107
107
return Kind == Predicate && NumVectors == 0 ;
108
108
}
@@ -491,13 +491,11 @@ std::string SVEType::builtin_str() const {
491
491
}
492
492
}
493
493
494
- // Make chars and typed pointers explicitly signed.
495
- if (!isFloatingPoint () && !isVoid ()) {
496
- if ((ElementBitwidth == 8 || isPointer ()) && isSigned ())
497
- OutStr = " S" + OutStr;
498
- if (!isSigned ())
499
- OutStr = " U" + OutStr;
500
- }
494
+ // Make chars and integer pointers explicitly signed.
495
+ if ((ElementBitwidth == 8 || isPointer ()) && isSignedInteger ())
496
+ OutStr = " S" + OutStr;
497
+ else if (isUnsignedInteger ())
498
+ OutStr = " U" + OutStr;
501
499
502
500
// Constant indices are "int", but have the "constant expression" modifier.
503
501
if (isImmediate ()) {
@@ -544,12 +542,10 @@ std::string SVEType::str() const {
544
542
S += " bfloat" ;
545
543
else if (isMFloat ())
546
544
S += " mfloat" ;
547
- else {
548
- if (isSigned ())
549
- S += " int" ;
550
- else
551
- S += " uint" ;
552
- };
545
+ else if (isSignedInteger ())
546
+ S += " int" ;
547
+ else if (isUnsignedInteger ())
548
+ S += " uint" ;
553
549
554
550
if (!isPredicate () && !isSvcount ())
555
551
S += utostr (ElementBitwidth);
@@ -1008,8 +1004,11 @@ std::string Intrinsic::replaceTemplatedArgs(std::string Name, TypeSpec TS,
1008
1004
1009
1005
// Replace templated arg with the right suffix (e.g. u32)
1010
1006
std::string TypeCode;
1011
- if (T.isInteger ())
1012
- TypeCode = T.isSigned () ? ' s' : ' u' ;
1007
+
1008
+ if (T.isSignedInteger ())
1009
+ TypeCode = ' s' ;
1010
+ else if (T.isUnsignedInteger ())
1011
+ TypeCode = ' u' ;
1013
1012
else if (T.isSvcount ())
1014
1013
TypeCode = ' c' ;
1015
1014
else if (T.isPredicate ())
0 commit comments