1 //===--- TargetInfo.cpp - Information about Target machine ----------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 //  This file implements the TargetInfo and TargetInfoImpl interfaces.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "clang/Basic/TargetInfo.h"
15 #include "clang/Basic/AddressSpaces.h"
16 #include "clang/Basic/CharInfo.h"
17 #include "clang/Basic/LangOptions.h"
18 #include "llvm/ADT/APFloat.h"
19 #include "llvm/ADT/STLExtras.h"
20 #include "llvm/Support/ErrorHandling.h"
21 #include "llvm/Support/TargetParser.h"
22 #include <cstdlib>
23 using namespace clang;
24 
25 static const LangASMap DefaultAddrSpaceMap = {0};
26 
27 // TargetInfo Constructor.
28 TargetInfo::TargetInfo(const llvm::Triple &T) : TargetOpts(), Triple(T) {
29   // Set defaults.  Defaults are set for a 32-bit RISC platform, like PPC or
30   // SPARC.  These should be overridden by concrete targets as needed.
31   BigEndian = !T.isLittleEndian();
32   TLSSupported = true;
33   VLASupported = true;
34   NoAsmVariants = false;
35   HasLegalHalfType = false;
36   HasFloat128 = false;
37   PointerWidth = PointerAlign = 32;
38   BoolWidth = BoolAlign = 8;
39   IntWidth = IntAlign = 32;
40   LongWidth = LongAlign = 32;
41   LongLongWidth = LongLongAlign = 64;
42   SuitableAlign = 64;
43   DefaultAlignForAttributeAligned = 128;
44   MinGlobalAlign = 0;
45   // From the glibc documentation, on GNU systems, malloc guarantees 16-byte
46   // alignment on 64-bit systems and 8-byte alignment on 32-bit systems. See
47   // https://www.gnu.org/software/libc/manual/html_node/Malloc-Examples.html
48   if (T.isGNUEnvironment() || T.isWindowsMSVCEnvironment())
49     NewAlign = Triple.isArch64Bit() ? 128 : Triple.isArch32Bit() ? 64 : 0;
50   else
51     NewAlign = 0; // Infer from basic type alignment.
52   HalfWidth = 16;
53   HalfAlign = 16;
54   FloatWidth = 32;
55   FloatAlign = 32;
56   DoubleWidth = 64;
57   DoubleAlign = 64;
58   LongDoubleWidth = 64;
59   LongDoubleAlign = 64;
60   Float128Align = 128;
61   LargeArrayMinWidth = 0;
62   LargeArrayAlign = 0;
63   MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 0;
64   MaxVectorAlign = 0;
65   MaxTLSAlign = 0;
66   SimdDefaultAlign = 0;
67   SizeType = UnsignedLong;
68   PtrDiffType = SignedLong;
69   IntMaxType = SignedLongLong;
70   IntPtrType = SignedLong;
71   WCharType = SignedInt;
72   WIntType = SignedInt;
73   Char16Type = UnsignedShort;
74   Char32Type = UnsignedInt;
75   Int64Type = SignedLongLong;
76   SigAtomicType = SignedInt;
77   ProcessIDType = SignedInt;
78   UseSignedCharForObjCBool = true;
79   UseBitFieldTypeAlignment = true;
80   UseZeroLengthBitfieldAlignment = false;
81   UseExplicitBitFieldAlignment = true;
82   ZeroLengthBitfieldBoundary = 0;
83   HalfFormat = &llvm::APFloat::IEEEhalf();
84   FloatFormat = &llvm::APFloat::IEEEsingle();
85   DoubleFormat = &llvm::APFloat::IEEEdouble();
86   LongDoubleFormat = &llvm::APFloat::IEEEdouble();
87   Float128Format = &llvm::APFloat::IEEEquad();
88   MCountName = "mcount";
89   RegParmMax = 0;
90   SSERegParmMax = 0;
91   HasAlignMac68kSupport = false;
92   HasBuiltinMSVaList = false;
93   IsRenderScriptTarget = false;
94 
95   // Default to no types using fpret.
96   RealTypeUsesObjCFPRet = 0;
97 
98   // Default to not using fp2ret for __Complex long double
99   ComplexLongDoubleUsesFP2Ret = false;
100 
101   // Set the C++ ABI based on the triple.
102   TheCXXABI.set(Triple.isKnownWindowsMSVCEnvironment()
103                     ? TargetCXXABI::Microsoft
104                     : TargetCXXABI::GenericItanium);
105 
106   // Default to an empty address space map.
107   AddrSpaceMap = &DefaultAddrSpaceMap;
108   UseAddrSpaceMapMangling = false;
109 
110   // Default to an unknown platform name.
111   PlatformName = "unknown";
112   PlatformMinVersion = VersionTuple();
113 }
114 
115 // Out of line virtual dtor for TargetInfo.
116 TargetInfo::~TargetInfo() {}
117 
118 /// getTypeName - Return the user string for the specified integer type enum.
119 /// For example, SignedShort -> "short".
120 const char *TargetInfo::getTypeName(IntType T) {
121   switch (T) {
122   default: llvm_unreachable("not an integer!");
123   case SignedChar:       return "signed char";
124   case UnsignedChar:     return "unsigned char";
125   case SignedShort:      return "short";
126   case UnsignedShort:    return "unsigned short";
127   case SignedInt:        return "int";
128   case UnsignedInt:      return "unsigned int";
129   case SignedLong:       return "long int";
130   case UnsignedLong:     return "long unsigned int";
131   case SignedLongLong:   return "long long int";
132   case UnsignedLongLong: return "long long unsigned int";
133   }
134 }
135 
136 /// getTypeConstantSuffix - Return the constant suffix for the specified
137 /// integer type enum. For example, SignedLong -> "L".
138 const char *TargetInfo::getTypeConstantSuffix(IntType T) const {
139   switch (T) {
140   default: llvm_unreachable("not an integer!");
141   case SignedChar:
142   case SignedShort:
143   case SignedInt:        return "";
144   case SignedLong:       return "L";
145   case SignedLongLong:   return "LL";
146   case UnsignedChar:
147     if (getCharWidth() < getIntWidth())
148       return "";
149     LLVM_FALLTHROUGH;
150   case UnsignedShort:
151     if (getShortWidth() < getIntWidth())
152       return "";
153     LLVM_FALLTHROUGH;
154   case UnsignedInt:      return "U";
155   case UnsignedLong:     return "UL";
156   case UnsignedLongLong: return "ULL";
157   }
158 }
159 
160 /// getTypeFormatModifier - Return the printf format modifier for the
161 /// specified integer type enum. For example, SignedLong -> "l".
162 
163 const char *TargetInfo::getTypeFormatModifier(IntType T) {
164   switch (T) {
165   default: llvm_unreachable("not an integer!");
166   case SignedChar:
167   case UnsignedChar:     return "hh";
168   case SignedShort:
169   case UnsignedShort:    return "h";
170   case SignedInt:
171   case UnsignedInt:      return "";
172   case SignedLong:
173   case UnsignedLong:     return "l";
174   case SignedLongLong:
175   case UnsignedLongLong: return "ll";
176   }
177 }
178 
179 /// getTypeWidth - Return the width (in bits) of the specified integer type
180 /// enum. For example, SignedInt -> getIntWidth().
181 unsigned TargetInfo::getTypeWidth(IntType T) const {
182   switch (T) {
183   default: llvm_unreachable("not an integer!");
184   case SignedChar:
185   case UnsignedChar:     return getCharWidth();
186   case SignedShort:
187   case UnsignedShort:    return getShortWidth();
188   case SignedInt:
189   case UnsignedInt:      return getIntWidth();
190   case SignedLong:
191   case UnsignedLong:     return getLongWidth();
192   case SignedLongLong:
193   case UnsignedLongLong: return getLongLongWidth();
194   };
195 }
196 
197 TargetInfo::IntType TargetInfo::getIntTypeByWidth(
198     unsigned BitWidth, bool IsSigned) const {
199   if (getCharWidth() == BitWidth)
200     return IsSigned ? SignedChar : UnsignedChar;
201   if (getShortWidth() == BitWidth)
202     return IsSigned ? SignedShort : UnsignedShort;
203   if (getIntWidth() == BitWidth)
204     return IsSigned ? SignedInt : UnsignedInt;
205   if (getLongWidth() == BitWidth)
206     return IsSigned ? SignedLong : UnsignedLong;
207   if (getLongLongWidth() == BitWidth)
208     return IsSigned ? SignedLongLong : UnsignedLongLong;
209   return NoInt;
210 }
211 
212 TargetInfo::IntType TargetInfo::getLeastIntTypeByWidth(unsigned BitWidth,
213                                                        bool IsSigned) const {
214   if (getCharWidth() >= BitWidth)
215     return IsSigned ? SignedChar : UnsignedChar;
216   if (getShortWidth() >= BitWidth)
217     return IsSigned ? SignedShort : UnsignedShort;
218   if (getIntWidth() >= BitWidth)
219     return IsSigned ? SignedInt : UnsignedInt;
220   if (getLongWidth() >= BitWidth)
221     return IsSigned ? SignedLong : UnsignedLong;
222   if (getLongLongWidth() >= BitWidth)
223     return IsSigned ? SignedLongLong : UnsignedLongLong;
224   return NoInt;
225 }
226 
227 TargetInfo::RealType TargetInfo::getRealTypeByWidth(unsigned BitWidth) const {
228   if (getFloatWidth() == BitWidth)
229     return Float;
230   if (getDoubleWidth() == BitWidth)
231     return Double;
232 
233   switch (BitWidth) {
234   case 96:
235     if (&getLongDoubleFormat() == &llvm::APFloat::x87DoubleExtended())
236       return LongDouble;
237     break;
238   case 128:
239     if (&getLongDoubleFormat() == &llvm::APFloat::PPCDoubleDouble() ||
240         &getLongDoubleFormat() == &llvm::APFloat::IEEEquad())
241       return LongDouble;
242     if (hasFloat128Type())
243       return Float128;
244     break;
245   }
246 
247   return NoFloat;
248 }
249 
250 /// getTypeAlign - Return the alignment (in bits) of the specified integer type
251 /// enum. For example, SignedInt -> getIntAlign().
252 unsigned TargetInfo::getTypeAlign(IntType T) const {
253   switch (T) {
254   default: llvm_unreachable("not an integer!");
255   case SignedChar:
256   case UnsignedChar:     return getCharAlign();
257   case SignedShort:
258   case UnsignedShort:    return getShortAlign();
259   case SignedInt:
260   case UnsignedInt:      return getIntAlign();
261   case SignedLong:
262   case UnsignedLong:     return getLongAlign();
263   case SignedLongLong:
264   case UnsignedLongLong: return getLongLongAlign();
265   };
266 }
267 
268 /// isTypeSigned - Return whether an integer types is signed. Returns true if
269 /// the type is signed; false otherwise.
270 bool TargetInfo::isTypeSigned(IntType T) {
271   switch (T) {
272   default: llvm_unreachable("not an integer!");
273   case SignedChar:
274   case SignedShort:
275   case SignedInt:
276   case SignedLong:
277   case SignedLongLong:
278     return true;
279   case UnsignedChar:
280   case UnsignedShort:
281   case UnsignedInt:
282   case UnsignedLong:
283   case UnsignedLongLong:
284     return false;
285   };
286 }
287 
288 /// adjust - Set forced language options.
289 /// Apply changes to the target information with respect to certain
290 /// language options which change the target configuration and adjust
291 /// the language based on the target options where applicable.
292 void TargetInfo::adjust(LangOptions &Opts) {
293   if (Opts.NoBitFieldTypeAlign)
294     UseBitFieldTypeAlignment = false;
295 
296   switch (Opts.WCharSize) {
297   default: llvm_unreachable("invalid wchar_t width");
298   case 0: break;
299   case 1: WCharType = Opts.WCharIsSigned ? SignedChar : UnsignedChar; break;
300   case 2: WCharType = Opts.WCharIsSigned ? SignedShort : UnsignedShort; break;
301   case 4: WCharType = Opts.WCharIsSigned ? SignedInt : UnsignedInt; break;
302   }
303 
304   if (Opts.AlignDouble) {
305     DoubleAlign = LongLongAlign = 64;
306     LongDoubleAlign = 64;
307   }
308 
309   if (Opts.OpenCL) {
310     // OpenCL C requires specific widths for types, irrespective of
311     // what these normally are for the target.
312     // We also define long long and long double here, although the
313     // OpenCL standard only mentions these as "reserved".
314     IntWidth = IntAlign = 32;
315     LongWidth = LongAlign = 64;
316     LongLongWidth = LongLongAlign = 128;
317     HalfWidth = HalfAlign = 16;
318     FloatWidth = FloatAlign = 32;
319 
320     // Embedded 32-bit targets (OpenCL EP) might have double C type
321     // defined as float. Let's not override this as it might lead
322     // to generating illegal code that uses 64bit doubles.
323     if (DoubleWidth != FloatWidth) {
324       DoubleWidth = DoubleAlign = 64;
325       DoubleFormat = &llvm::APFloat::IEEEdouble();
326     }
327     LongDoubleWidth = LongDoubleAlign = 128;
328 
329     unsigned MaxPointerWidth = getMaxPointerWidth();
330     assert(MaxPointerWidth == 32 || MaxPointerWidth == 64);
331     bool Is32BitArch = MaxPointerWidth == 32;
332     SizeType = Is32BitArch ? UnsignedInt : UnsignedLong;
333     PtrDiffType = Is32BitArch ? SignedInt : SignedLong;
334     IntPtrType = Is32BitArch ? SignedInt : SignedLong;
335 
336     IntMaxType = SignedLongLong;
337     Int64Type = SignedLong;
338 
339     HalfFormat = &llvm::APFloat::IEEEhalf();
340     FloatFormat = &llvm::APFloat::IEEEsingle();
341     LongDoubleFormat = &llvm::APFloat::IEEEquad();
342   }
343 
344   if (Opts.NewAlignOverride)
345     NewAlign = Opts.NewAlignOverride * getCharWidth();
346 }
347 
348 bool TargetInfo::initFeatureMap(
349     llvm::StringMap<bool> &Features, DiagnosticsEngine &Diags, StringRef CPU,
350     const std::vector<std::string> &FeatureVec) const {
351   for (const auto &F : FeatureVec) {
352     StringRef Name = F;
353     // Apply the feature via the target.
354     bool Enabled = Name[0] == '+';
355     setFeatureEnabled(Features, Name.substr(1), Enabled);
356   }
357   return true;
358 }
359 
360 TargetInfo::CallingConvKind
361 TargetInfo::getCallingConvKind(bool ClangABICompat4) const {
362   if (getCXXABI() != TargetCXXABI::Microsoft &&
363       (ClangABICompat4 || getTriple().getOS() == llvm::Triple::PS4))
364     return CCK_ClangABI4OrPS4;
365   return CCK_Default;
366 }
367 
368 LangAS TargetInfo::getOpenCLTypeAddrSpace(OpenCLTypeKind TK) const {
369   switch (TK) {
370   case OCLTK_Image:
371   case OCLTK_Pipe:
372     return LangAS::opencl_global;
373 
374   case OCLTK_Sampler:
375     return LangAS::opencl_constant;
376 
377   default:
378     return LangAS::Default;
379   }
380 }
381 
382 //===----------------------------------------------------------------------===//
383 
384 
385 static StringRef removeGCCRegisterPrefix(StringRef Name) {
386   if (Name[0] == '%' || Name[0] == '#')
387     Name = Name.substr(1);
388 
389   return Name;
390 }
391 
392 /// isValidClobber - Returns whether the passed in string is
393 /// a valid clobber in an inline asm statement. This is used by
394 /// Sema.
395 bool TargetInfo::isValidClobber(StringRef Name) const {
396   return (isValidGCCRegisterName(Name) ||
397           Name == "memory" || Name == "cc");
398 }
399 
400 /// isValidGCCRegisterName - Returns whether the passed in string
401 /// is a valid register name according to GCC. This is used by Sema for
402 /// inline asm statements.
403 bool TargetInfo::isValidGCCRegisterName(StringRef Name) const {
404   if (Name.empty())
405     return false;
406 
407   // Get rid of any register prefix.
408   Name = removeGCCRegisterPrefix(Name);
409   if (Name.empty())
410     return false;
411 
412   ArrayRef<const char *> Names = getGCCRegNames();
413 
414   // If we have a number it maps to an entry in the register name array.
415   if (isDigit(Name[0])) {
416     unsigned n;
417     if (!Name.getAsInteger(0, n))
418       return n < Names.size();
419   }
420 
421   // Check register names.
422   if (std::find(Names.begin(), Names.end(), Name) != Names.end())
423     return true;
424 
425   // Check any additional names that we have.
426   for (const AddlRegName &ARN : getGCCAddlRegNames())
427     for (const char *AN : ARN.Names) {
428       if (!AN)
429         break;
430       // Make sure the register that the additional name is for is within
431       // the bounds of the register names from above.
432       if (AN == Name && ARN.RegNum < Names.size())
433         return true;
434     }
435 
436   // Now check aliases.
437   for (const GCCRegAlias &GRA : getGCCRegAliases())
438     for (const char *A : GRA.Aliases) {
439       if (!A)
440         break;
441       if (A == Name)
442         return true;
443     }
444 
445   return false;
446 }
447 
448 StringRef TargetInfo::getNormalizedGCCRegisterName(StringRef Name,
449                                                    bool ReturnCanonical) const {
450   assert(isValidGCCRegisterName(Name) && "Invalid register passed in");
451 
452   // Get rid of any register prefix.
453   Name = removeGCCRegisterPrefix(Name);
454 
455   ArrayRef<const char *> Names = getGCCRegNames();
456 
457   // First, check if we have a number.
458   if (isDigit(Name[0])) {
459     unsigned n;
460     if (!Name.getAsInteger(0, n)) {
461       assert(n < Names.size() && "Out of bounds register number!");
462       return Names[n];
463     }
464   }
465 
466   // Check any additional names that we have.
467   for (const AddlRegName &ARN : getGCCAddlRegNames())
468     for (const char *AN : ARN.Names) {
469       if (!AN)
470         break;
471       // Make sure the register that the additional name is for is within
472       // the bounds of the register names from above.
473       if (AN == Name && ARN.RegNum < Names.size())
474         return ReturnCanonical ? Names[ARN.RegNum] : Name;
475     }
476 
477   // Now check aliases.
478   for (const GCCRegAlias &RA : getGCCRegAliases())
479     for (const char *A : RA.Aliases) {
480       if (!A)
481         break;
482       if (A == Name)
483         return RA.Register;
484     }
485 
486   return Name;
487 }
488 
489 bool TargetInfo::validateOutputConstraint(ConstraintInfo &Info) const {
490   const char *Name = Info.getConstraintStr().c_str();
491   // An output constraint must start with '=' or '+'
492   if (*Name != '=' && *Name != '+')
493     return false;
494 
495   if (*Name == '+')
496     Info.setIsReadWrite();
497 
498   Name++;
499   while (*Name) {
500     switch (*Name) {
501     default:
502       if (!validateAsmConstraint(Name, Info)) {
503         // FIXME: We temporarily return false
504         // so we can add more constraints as we hit it.
505         // Eventually, an unknown constraint should just be treated as 'g'.
506         return false;
507       }
508       break;
509     case '&': // early clobber.
510       Info.setEarlyClobber();
511       break;
512     case '%': // commutative.
513       // FIXME: Check that there is a another register after this one.
514       break;
515     case 'r': // general register.
516       Info.setAllowsRegister();
517       break;
518     case 'm': // memory operand.
519     case 'o': // offsetable memory operand.
520     case 'V': // non-offsetable memory operand.
521     case '<': // autodecrement memory operand.
522     case '>': // autoincrement memory operand.
523       Info.setAllowsMemory();
524       break;
525     case 'g': // general register, memory operand or immediate integer.
526     case 'X': // any operand.
527       Info.setAllowsRegister();
528       Info.setAllowsMemory();
529       break;
530     case ',': // multiple alternative constraint.  Pass it.
531       // Handle additional optional '=' or '+' modifiers.
532       if (Name[1] == '=' || Name[1] == '+')
533         Name++;
534       break;
535     case '#': // Ignore as constraint.
536       while (Name[1] && Name[1] != ',')
537         Name++;
538       break;
539     case '?': // Disparage slightly code.
540     case '!': // Disparage severely.
541     case '*': // Ignore for choosing register preferences.
542     case 'i': // Ignore i,n,E,F as output constraints (match from the other
543               // chars)
544     case 'n':
545     case 'E':
546     case 'F':
547       break;  // Pass them.
548     }
549 
550     Name++;
551   }
552 
553   // Early clobber with a read-write constraint which doesn't permit registers
554   // is invalid.
555   if (Info.earlyClobber() && Info.isReadWrite() && !Info.allowsRegister())
556     return false;
557 
558   // If a constraint allows neither memory nor register operands it contains
559   // only modifiers. Reject it.
560   return Info.allowsMemory() || Info.allowsRegister();
561 }
562 
563 bool TargetInfo::resolveSymbolicName(const char *&Name,
564                                      ArrayRef<ConstraintInfo> OutputConstraints,
565                                      unsigned &Index) const {
566   assert(*Name == '[' && "Symbolic name did not start with '['");
567   Name++;
568   const char *Start = Name;
569   while (*Name && *Name != ']')
570     Name++;
571 
572   if (!*Name) {
573     // Missing ']'
574     return false;
575   }
576 
577   std::string SymbolicName(Start, Name - Start);
578 
579   for (Index = 0; Index != OutputConstraints.size(); ++Index)
580     if (SymbolicName == OutputConstraints[Index].getName())
581       return true;
582 
583   return false;
584 }
585 
586 bool TargetInfo::validateInputConstraint(
587                               MutableArrayRef<ConstraintInfo> OutputConstraints,
588                               ConstraintInfo &Info) const {
589   const char *Name = Info.ConstraintStr.c_str();
590 
591   if (!*Name)
592     return false;
593 
594   while (*Name) {
595     switch (*Name) {
596     default:
597       // Check if we have a matching constraint
598       if (*Name >= '0' && *Name <= '9') {
599         const char *DigitStart = Name;
600         while (Name[1] >= '0' && Name[1] <= '9')
601           Name++;
602         const char *DigitEnd = Name;
603         unsigned i;
604         if (StringRef(DigitStart, DigitEnd - DigitStart + 1)
605                 .getAsInteger(10, i))
606           return false;
607 
608         // Check if matching constraint is out of bounds.
609         if (i >= OutputConstraints.size()) return false;
610 
611         // A number must refer to an output only operand.
612         if (OutputConstraints[i].isReadWrite())
613           return false;
614 
615         // If the constraint is already tied, it must be tied to the
616         // same operand referenced to by the number.
617         if (Info.hasTiedOperand() && Info.getTiedOperand() != i)
618           return false;
619 
620         // The constraint should have the same info as the respective
621         // output constraint.
622         Info.setTiedOperand(i, OutputConstraints[i]);
623       } else if (!validateAsmConstraint(Name, Info)) {
624         // FIXME: This error return is in place temporarily so we can
625         // add more constraints as we hit it.  Eventually, an unknown
626         // constraint should just be treated as 'g'.
627         return false;
628       }
629       break;
630     case '[': {
631       unsigned Index = 0;
632       if (!resolveSymbolicName(Name, OutputConstraints, Index))
633         return false;
634 
635       // If the constraint is already tied, it must be tied to the
636       // same operand referenced to by the number.
637       if (Info.hasTiedOperand() && Info.getTiedOperand() != Index)
638         return false;
639 
640       // A number must refer to an output only operand.
641       if (OutputConstraints[Index].isReadWrite())
642         return false;
643 
644       Info.setTiedOperand(Index, OutputConstraints[Index]);
645       break;
646     }
647     case '%': // commutative
648       // FIXME: Fail if % is used with the last operand.
649       break;
650     case 'i': // immediate integer.
651     case 'n': // immediate integer with a known value.
652       break;
653     case 'I':  // Various constant constraints with target-specific meanings.
654     case 'J':
655     case 'K':
656     case 'L':
657     case 'M':
658     case 'N':
659     case 'O':
660     case 'P':
661       if (!validateAsmConstraint(Name, Info))
662         return false;
663       break;
664     case 'r': // general register.
665       Info.setAllowsRegister();
666       break;
667     case 'm': // memory operand.
668     case 'o': // offsettable memory operand.
669     case 'V': // non-offsettable memory operand.
670     case '<': // autodecrement memory operand.
671     case '>': // autoincrement memory operand.
672       Info.setAllowsMemory();
673       break;
674     case 'g': // general register, memory operand or immediate integer.
675     case 'X': // any operand.
676       Info.setAllowsRegister();
677       Info.setAllowsMemory();
678       break;
679     case 'E': // immediate floating point.
680     case 'F': // immediate floating point.
681     case 'p': // address operand.
682       break;
683     case ',': // multiple alternative constraint.  Ignore comma.
684       break;
685     case '#': // Ignore as constraint.
686       while (Name[1] && Name[1] != ',')
687         Name++;
688       break;
689     case '?': // Disparage slightly code.
690     case '!': // Disparage severely.
691     case '*': // Ignore for choosing register preferences.
692       break;  // Pass them.
693     }
694 
695     Name++;
696   }
697 
698   return true;
699 }
700